@blinkk/root-cms 1.4.5 → 1.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +2 -2
- package/dist/{client-c_QAurxr.d.ts → client-vS0mO6Nw.d.ts} +2 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +2 -1
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -1
- package/dist/functions.js +2 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +2 -1
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +10 -10
- package/package.json +3 -3
package/dist/ui/ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";(()=>{var Gj=Object.create;var Iv=Object.defineProperty;var Wj=Object.getOwnPropertyDescriptor;var Kj=Object.getOwnPropertyNames;var Xj=Object.getPrototypeOf,Yj=Object.prototype.hasOwnProperty;var $e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qj=(t,e)=>{for(var r in e)Iv(t,r,{get:e[r],enumerable:!0})},Zj=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Kj(e))!Yj.call(t,n)&&n!==r&&Iv(t,n,{get:()=>e[n],enumerable:!(o=Wj(e,n))||o.enumerable});return t};var wv=(t,e,r)=>(r=t!=null?Gj(Xj(t)):{},Zj(e||!t||!t.__esModule?Iv(r,"default",{value:t,enumerable:!0}):r,t));var _A=$e(Et=>{"use strict";var Dr=typeof Symbol=="function"&&Symbol.for,Gv=Dr?Symbol.for("react.element"):60103,Wv=Dr?Symbol.for("react.portal"):60106,Gm=Dr?Symbol.for("react.fragment"):60107,Wm=Dr?Symbol.for("react.strict_mode"):60108,Km=Dr?Symbol.for("react.profiler"):60114,Xm=Dr?Symbol.for("react.provider"):60109,Ym=Dr?Symbol.for("react.context"):60110,Kv=Dr?Symbol.for("react.async_mode"):60111,Qm=Dr?Symbol.for("react.concurrent_mode"):60111,Zm=Dr?Symbol.for("react.forward_ref"):60112,Jm=Dr?Symbol.for("react.suspense"):60113,aG=Dr?Symbol.for("react.suspense_list"):60120,eh=Dr?Symbol.for("react.memo"):60115,th=Dr?Symbol.for("react.lazy"):60116,iG=Dr?Symbol.for("react.block"):60121,sG=Dr?Symbol.for("react.fundamental"):60117,lG=Dr?Symbol.for("react.responder"):60118,cG=Dr?Symbol.for("react.scope"):60119;function Yo(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Gv:switch(t=t.type,t){case Kv:case Qm:case Gm:case Km:case Wm:case Jm:return t;default:switch(t=t&&t.$$typeof,t){case Ym:case Zm:case th:case eh:case Xm:return t;default:return e}}case Wv:return e}}}function gA(t){return Yo(t)===Qm}Et.AsyncMode=Kv;Et.ConcurrentMode=Qm;Et.ContextConsumer=Ym;Et.ContextProvider=Xm;Et.Element=Gv;Et.ForwardRef=Zm;Et.Fragment=Gm;Et.Lazy=th;Et.Memo=eh;Et.Portal=Wv;Et.Profiler=Km;Et.StrictMode=Wm;Et.Suspense=Jm;Et.isAsyncMode=function(t){return gA(t)||Yo(t)===Kv};Et.isConcurrentMode=gA;Et.isContextConsumer=function(t){return Yo(t)===Ym};Et.isContextProvider=function(t){return Yo(t)===Xm};Et.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Gv};Et.isForwardRef=function(t){return Yo(t)===Zm};Et.isFragment=function(t){return Yo(t)===Gm};Et.isLazy=function(t){return Yo(t)===th};Et.isMemo=function(t){return Yo(t)===eh};Et.isPortal=function(t){return Yo(t)===Wv};Et.isProfiler=function(t){return Yo(t)===Km};Et.isStrictMode=function(t){return Yo(t)===Wm};Et.isSuspense=function(t){return Yo(t)===Jm};Et.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Gm||t===Qm||t===Km||t===Wm||t===Jm||t===aG||typeof t=="object"&&t!==null&&(t.$$typeof===th||t.$$typeof===eh||t.$$typeof===Xm||t.$$typeof===Ym||t.$$typeof===Zm||t.$$typeof===sG||t.$$typeof===lG||t.$$typeof===cG||t.$$typeof===iG)};Et.typeOf=Yo});var bA=$e((gke,xA)=>{"use strict";xA.exports=_A()});var CA=$e((_ke,SA)=>{"use strict";var Xv=bA(),uG={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},dG={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},fG={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},wA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Yv={};Yv[Xv.ForwardRef]=fG;Yv[Xv.Memo]=wA;function yA(t){return Xv.isMemo(t)?wA:Yv[t.$$typeof]||uG}var pG=Object.defineProperty,mG=Object.getOwnPropertyNames,vA=Object.getOwnPropertySymbols,hG=Object.getOwnPropertyDescriptor,gG=Object.getPrototypeOf,IA=Object.prototype;function EA(t,e,r){if(typeof e!="string"){if(IA){var o=gG(e);o&&o!==IA&&EA(t,o,r)}var n=mG(e);vA&&(n=n.concat(vA(e)));for(var a=yA(t),i=yA(e),s=0;s<n.length;++s){var l=n[s];if(!dG[l]&&!(r&&r[l])&&!(i&&i[l])&&!(a&&a[l])){var c=hG(e,l);try{pG(t,l,c)}catch{}}}}return t}SA.exports=EA});var w2=$e((PLe,I2)=>{"use strict";var $Y=typeof Element<"u",jY=typeof Map=="function",qY=typeof Set=="function",GY=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function qh(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,o,n;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(o=r;o--!==0;)if(!qh(t[o],e[o]))return!1;return!0}var a;if(jY&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!e.has(o.value[0]))return!1;for(a=t.entries();!(o=a.next()).done;)if(!qh(o.value[1],e.get(o.value[0])))return!1;return!0}if(qY&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(o=a.next()).done;)if(!e.has(o.value[0]))return!1;return!0}if(GY&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(o=r;o--!==0;)if(t[o]!==e[o])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(n=Object.keys(t),r=n.length,r!==Object.keys(e).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(e,n[o]))return!1;if($Y&&t instanceof Element)return!1;for(o=r;o--!==0;)if(!((n[o]==="_owner"||n[o]==="__v"||n[o]==="__o")&&t.$$typeof)&&!qh(t[n[o]],e[n[o]]))return!1;return!0}return t!==t&&e!==e}I2.exports=function(e,r){try{return qh(e,r)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}}});var C8=$e((JKe,S8)=>{"use strict";var FC={exports:{}};function zC(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(e){var r=t[e];typeof r=="object"&&!Object.isFrozen(r)&&zC(r)}),t}FC.exports=zC;FC.exports.default=zC;var Gb=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function h8(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ji(t,...e){let r=Object.create(null);for(let o in t)r[o]=t[o];return e.forEach(function(o){for(let n in o)r[n]=o[n]}),r}var wxe="</span>",c8=t=>!!t.scope||t.sublanguage&&t.language,Exe=(t,{prefix:e})=>{if(t.includes(".")){let r=t.split(".");return[`${e}${r.shift()}`,...r.map((o,n)=>`${o}${"_".repeat(n+1)}`)].join(" ")}return`${e}${t}`},NC=class{constructor(e,r){this.buffer="",this.classPrefix=r.classPrefix,e.walk(this)}addText(e){this.buffer+=h8(e)}openNode(e){if(!c8(e))return;let r="";e.sublanguage?r=`language-${e.language}`:r=Exe(e.scope,{prefix:this.classPrefix}),this.span(r)}closeNode(e){c8(e)&&(this.buffer+=wxe)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u8=(t={})=>{let e={children:[]};return Object.assign(e,t),e},MC=class t{constructor(){this.rootNode=u8(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let r=u8({scope:e});this.add(r),this.stack.push(r)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,r){return typeof r=="string"?e.addText(r):r.children&&(e.openNode(r),r.children.forEach(o=>this._walk(e,o)),e.closeNode(r)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(r=>typeof r=="string")?e.children=[e.children.join("")]:e.children.forEach(r=>{t._collapse(r)}))}},LC=class extends MC{constructor(e){super(),this.options=e}addKeyword(e,r){e!==""&&(this.openNode(r),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,r){let o=e.root;o.sublanguage=!0,o.language=r,this.add(o)}toHTML(){return new NC(this,this.options).value()}finalize(){return!0}};function Qp(t){return t?typeof t=="string"?t:t.source:null}function g8(t){return Pl("(?=",t,")")}function Sxe(t){return Pl("(?:",t,")*")}function Cxe(t){return Pl("(?:",t,")?")}function Pl(...t){return t.map(r=>Qp(r)).join("")}function kxe(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function UC(...t){return"("+(kxe(t).capture?"":"?:")+t.map(o=>Qp(o)).join("|")+")"}function _8(t){return new RegExp(t.toString()+"|").exec("").length-1}function Txe(t,e){let r=t&&t.exec(e);return r&&r.index===0}var Pxe=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function VC(t,{joinWith:e}){let r=0;return t.map(o=>{r+=1;let n=r,a=Qp(o),i="";for(;a.length>0;){let s=Pxe.exec(a);if(!s){i+=a;break}i+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?i+="\\"+String(Number(s[1])+n):(i+=s[0],s[0]==="("&&r++)}return i}).map(o=>`(${o})`).join(e)}var Oxe=/\b\B/,x8="[a-zA-Z]\\w*",HC="[a-zA-Z_]\\w*",b8="\\b\\d+(\\.\\d+)?",y8="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v8="\\b(0b[01]+)",Axe="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Dxe=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Pl(e,/.*\b/,t.binary,/\b.*/)),Ji({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(r,o)=>{r.index!==0&&o.ignoreMatch()}},t)},Zp={begin:"\\\\[\\s\\S]",relevance:0},Rxe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Zp]},Nxe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Zp]},Mxe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Kb=function(t,e,r={}){let o=Ji({scope:"comment",begin:t,end:e,contains:[]},r);o.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let n=UC("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return o.contains.push({begin:Pl(/[ ]+/,"(",n,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),o},Lxe=Kb("//","$"),Bxe=Kb("/\\*","\\*/"),Fxe=Kb("#","$"),zxe={scope:"number",begin:b8,relevance:0},Uxe={scope:"number",begin:y8,relevance:0},Vxe={scope:"number",begin:v8,relevance:0},Hxe={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Zp,{begin:/\[/,end:/\]/,relevance:0,contains:[Zp]}]}]},$xe={scope:"title",begin:x8,relevance:0},jxe={scope:"title",begin:HC,relevance:0},qxe={begin:"\\.\\s*"+HC,relevance:0},Gxe=function(t){return Object.assign(t,{"on:begin":(e,r)=>{r.data._beginMatch=e[1]},"on:end":(e,r)=>{r.data._beginMatch!==e[1]&&r.ignoreMatch()}})},qb=Object.freeze({__proto__:null,MATCH_NOTHING_RE:Oxe,IDENT_RE:x8,UNDERSCORE_IDENT_RE:HC,NUMBER_RE:b8,C_NUMBER_RE:y8,BINARY_NUMBER_RE:v8,RE_STARTERS_RE:Axe,SHEBANG:Dxe,BACKSLASH_ESCAPE:Zp,APOS_STRING_MODE:Rxe,QUOTE_STRING_MODE:Nxe,PHRASAL_WORDS_MODE:Mxe,COMMENT:Kb,C_LINE_COMMENT_MODE:Lxe,C_BLOCK_COMMENT_MODE:Bxe,HASH_COMMENT_MODE:Fxe,NUMBER_MODE:zxe,C_NUMBER_MODE:Uxe,BINARY_NUMBER_MODE:Vxe,REGEXP_MODE:Hxe,TITLE_MODE:$xe,UNDERSCORE_TITLE_MODE:jxe,METHOD_GUARD:qxe,END_SAME_AS_BEGIN:Gxe});function Wxe(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Kxe(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Xxe(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Wxe,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Yxe(t,e){Array.isArray(t.illegal)&&(t.illegal=UC(...t.illegal))}function Qxe(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function Zxe(t,e){t.relevance===void 0&&(t.relevance=1)}var Jxe=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let r=Object.assign({},t);Object.keys(t).forEach(o=>{delete t[o]}),t.keywords=r.keywords,t.begin=Pl(r.beforeMatch,g8(r.begin)),t.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},t.relevance=0,delete r.beforeMatch},ebe=["of","and","for","in","not","or","if","then","parent","list","value"],tbe="keyword";function I8(t,e,r=tbe){let o=Object.create(null);return typeof t=="string"?n(r,t.split(" ")):Array.isArray(t)?n(r,t):Object.keys(t).forEach(function(a){Object.assign(o,I8(t[a],e,a))}),o;function n(a,i){e&&(i=i.map(s=>s.toLowerCase())),i.forEach(function(s){let l=s.split("|");o[l[0]]=[a,rbe(l[0],l[1])]})}}function rbe(t,e){return e?Number(e):obe(t)?0:1}function obe(t){return ebe.includes(t.toLowerCase())}var d8={},Tl=t=>{console.error(t)},f8=(t,...e)=>{console.log(`WARN: ${t}`,...e)},Fu=(t,e)=>{d8[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),d8[`${t}/${e}`]=!0)},Wb=new Error;function w8(t,e,{key:r}){let o=0,n=t[r],a={},i={};for(let s=1;s<=e.length;s++)i[s+o]=n[s],a[s+o]=!0,o+=_8(e[s-1]);t[r]=i,t[r]._emit=a,t[r]._multi=!0}function nbe(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Tl("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Wb;if(typeof t.beginScope!="object"||t.beginScope===null)throw Tl("beginScope must be object"),Wb;w8(t,t.begin,{key:"beginScope"}),t.begin=VC(t.begin,{joinWith:""})}}function abe(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Tl("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Wb;if(typeof t.endScope!="object"||t.endScope===null)throw Tl("endScope must be object"),Wb;w8(t,t.end,{key:"endScope"}),t.end=VC(t.end,{joinWith:""})}}function ibe(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function sbe(t){ibe(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),nbe(t),abe(t)}function lbe(t){function e(i,s){return new RegExp(Qp(i),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(s?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=_8(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let s=this.regexes.map(l=>l[1]);this.matcherRe=e(VC(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(s);if(!l)return null;let c=l.findIndex((d,p)=>p>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class o{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];let l=new r;return this.rules.slice(s).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(s);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(s)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function n(i){let s=new o;return i.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),i.terminatorEnd&&s.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&s.addRule(i.illegal,{type:"illegal"}),s}function a(i,s){let l=i;if(i.isCompiled)return l;[Kxe,Qxe,sbe,Jxe].forEach(u=>u(i,s)),t.compilerExtensions.forEach(u=>u(i,s)),i.__beforeBegin=null,[Xxe,Yxe,Zxe].forEach(u=>u(i,s)),i.isCompiled=!0;let c=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),c=i.keywords.$pattern,delete i.keywords.$pattern),c=c||/\w+/,i.keywords&&(i.keywords=I8(i.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),s&&(i.begin||(i.begin=/\B|\b/),l.beginRe=e(l.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(l.endRe=e(l.end)),l.terminatorEnd=Qp(l.end)||"",i.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(l.illegalRe=e(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(u){return cbe(u==="self"?i:u)})),i.contains.forEach(function(u){a(u,l)}),i.starts&&a(i.starts,s),l.matcher=n(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ji(t.classNameAliases||{}),a(t)}function E8(t){return t?t.endsWithParent||E8(t.starts):!1}function cbe(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ji(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:E8(t)?Ji(t,{starts:t.starts?Ji(t.starts):null}):Object.isFrozen(t)?Ji(t):t}var ube="11.6.0",BC=class extends Error{constructor(e,r){super(e),this.name="HTMLInjectionError",this.html=r}},RC=h8,p8=Ji,m8=Symbol("nomatch"),dbe=7,fbe=function(t){let e=Object.create(null),r=Object.create(null),o=[],n=!0,a="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:LC};function l(M){return s.noHighlightRe.test(M)}function c(M){let V=M.className+" ";V+=M.parentNode?M.parentNode.className:"";let U=s.languageDetectRe.exec(V);if(U){let G=S(U[1]);return G||(f8(a.replace("{}",U[1])),f8("Falling back to no-highlight mode for this block.",M)),G?U[1]:"no-highlight"}return V.split(/\s+/).find(G=>l(G)||S(G))}function u(M,V,U){let G="",k="";typeof V=="object"?(G=M,U=V.ignoreIllegals,k=V.language):(Fu("10.7.0","highlight(lang, code, ...args) has been deprecated."),Fu("10.7.0",`Please use highlight(code, options) instead.
|
|
2
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),k=M,G=V),U===void 0&&(U=!0);let Z={code:G,language:k};z("before:highlight",Z);let te=Z.result?Z.result:d(Z.language,Z.code,U);return te.code=Z.code,z("after:highlight",te),te}function d(M,V,U,G){let k=Object.create(null);function Z(W,D){return W.keywords[D]}function te(){if(!fe.keywords){ft.addText(Be);return}let W=0;fe.keywordPatternRe.lastIndex=0;let D=fe.keywordPatternRe.exec(Be),$="";for(;D;){$+=Be.substring(W,D.index);let J=ot.case_insensitive?D[0].toLowerCase():D[0],ye=Z(fe,J);if(ye){let[je,nt]=ye;if(ft.addText($),$="",k[J]=(k[J]||0)+1,k[J]<=dbe&&(wr+=nt),je.startsWith("_"))$+=D[0];else{let Fo=ot.classNameAliases[je]||je;ft.addKeyword(D[0],Fo)}}else $+=D[0];W=fe.keywordPatternRe.lastIndex,D=fe.keywordPatternRe.exec(Be)}$+=Be.substring(W),ft.addText($)}function A(){if(Be==="")return;let W=null;if(typeof fe.subLanguage=="string"){if(!e[fe.subLanguage]){ft.addText(Be);return}W=d(fe.subLanguage,Be,!0,go[fe.subLanguage]),go[fe.subLanguage]=W._top}else W=m(Be,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(wr+=W.relevance),ft.addSublanguage(W._emitter,W.language)}function ce(){fe.subLanguage!=null?A():te(),Be=""}function Se(W,D){let $=1,J=D.length-1;for(;$<=J;){if(!W._emit[$]){$++;continue}let ye=ot.classNameAliases[W[$]]||W[$],je=D[$];ye?ft.addKeyword(je,ye):(Be=je,te(),Be=""),$++}}function Ge(W,D){return W.scope&&typeof W.scope=="string"&&ft.openNode(ot.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(ft.addKeyword(Be,ot.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Be=""):W.beginScope._multi&&(Se(W.beginScope,D),Be="")),fe=Object.create(W,{parent:{value:fe}}),fe}function et(W,D,$){let J=Txe(W.endRe,$);if(J){if(W["on:end"]){let ye=new Gb(W);W["on:end"](D,ye),ye.isMatchIgnored&&(J=!1)}if(J){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return et(W.parent,D,$)}function Oe(W){return fe.matcher.regexIndex===0?(Be+=W[0],1):(_e=!0,0)}function be(W){let D=W[0],$=W.rule,J=new Gb($),ye=[$.__beforeBegin,$["on:begin"]];for(let je of ye)if(je&&(je(W,J),J.isMatchIgnored))return Oe(D);return $.skip?Be+=D:($.excludeBegin&&(Be+=D),ce(),!$.returnBegin&&!$.excludeBegin&&(Be=D)),Ge($,W),$.returnBegin?0:D.length}function st(W){let D=W[0],$=V.substring(W.index),J=et(fe,W,$);if(!J)return m8;let ye=fe;fe.endScope&&fe.endScope._wrap?(ce(),ft.addKeyword(D,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(ce(),Se(fe.endScope,W)):ye.skip?Be+=D:(ye.returnEnd||ye.excludeEnd||(Be+=D),ce(),ye.excludeEnd&&(Be=D));do fe.scope&&ft.closeNode(),!fe.skip&&!fe.subLanguage&&(wr+=fe.relevance),fe=fe.parent;while(fe!==J.parent);return J.starts&&Ge(J.starts,W),ye.returnEnd?0:D.length}function wt(){let W=[];for(let D=fe;D!==ot;D=D.parent)D.scope&&W.unshift(D.scope);W.forEach(D=>ft.openNode(D))}let mt={};function zt(W,D){let $=D&&D[0];if(Be+=W,$==null)return ce(),0;if(mt.type==="begin"&&D.type==="end"&&mt.index===D.index&&$===""){if(Be+=V.slice(D.index,D.index+1),!n){let J=new Error(`0 width match regex (${M})`);throw J.languageName=M,J.badRule=mt.rule,J}return 1}if(mt=D,D.type==="begin")return be(D);if(D.type==="illegal"&&!U){let J=new Error('Illegal lexeme "'+$+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw J.mode=fe,J}else if(D.type==="end"){let J=st(D);if(J!==m8)return J}if(D.type==="illegal"&&$==="")return 1;if(Vr>1e5&&Vr>D.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=$,$.length}let ot=S(M);if(!ot)throw Tl(a.replace("{}",M)),new Error('Unknown language: "'+M+'"');let ao=lbe(ot),dt="",fe=G||ao,go={},ft=new s.__emitter(s);wt();let Be="",wr=0,fr=0,Vr=0,_e=!1;try{for(fe.matcher.considerAll();;){Vr++,_e?_e=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=fr;let W=fe.matcher.exec(V);if(!W)break;let D=V.substring(fr,W.index),$=zt(D,W);fr=W.index+$}return zt(V.substring(fr)),ft.closeAllNodes(),ft.finalize(),dt=ft.toHTML(),{language:M,value:dt,relevance:wr,illegal:!1,_emitter:ft,_top:fe}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:M,value:RC(V),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:fr,context:V.slice(fr-100,fr+100),mode:W.mode,resultSoFar:dt},_emitter:ft};if(n)return{language:M,value:RC(V),illegal:!1,relevance:0,errorRaised:W,_emitter:ft,_top:fe};throw W}}function p(M){let V={value:RC(M),illegal:!1,relevance:0,_top:i,_emitter:new s.__emitter(s)};return V._emitter.addText(M),V}function m(M,V){V=V||s.languages||Object.keys(e);let U=p(M),G=V.filter(S).filter(F).map(ce=>d(ce,M,!1));G.unshift(U);let k=G.sort((ce,Se)=>{if(ce.relevance!==Se.relevance)return Se.relevance-ce.relevance;if(ce.language&&Se.language){if(S(ce.language).supersetOf===Se.language)return 1;if(S(Se.language).supersetOf===ce.language)return-1}return 0}),[Z,te]=k,A=Z;return A.secondBest=te,A}function h(M,V,U){let G=V&&r[V]||U;M.classList.add("hljs"),M.classList.add(`language-${G}`)}function g(M){let V=null,U=c(M);if(l(U))return;if(z("before:highlightElement",{el:M,language:U}),M.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(M)),s.throwUnescapedHTML))throw new BC("One of your code blocks includes unescaped HTML.",M.innerHTML);V=M;let G=V.textContent,k=U?u(G,{language:U,ignoreIllegals:!0}):m(G);M.innerHTML=k.value,h(M,U,k.language),M.result={language:k.language,re:k.relevance,relevance:k.relevance},k.secondBest&&(M.secondBest={language:k.secondBest.language,relevance:k.secondBest.relevance}),z("after:highlightElement",{el:M,result:k,text:G})}function _(M){s=p8(s,M)}let x=()=>{I(),Fu("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){I(),Fu("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let y=!1;function I(){if(document.readyState==="loading"){y=!0;return}document.querySelectorAll(s.cssSelector).forEach(g)}function w(){y&&I()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",w,!1);function v(M,V){let U=null;try{U=V(t)}catch(G){if(Tl("Language definition for '{}' could not be registered.".replace("{}",M)),n)Tl(G);else throw G;U=i}U.name||(U.name=M),e[M]=U,U.rawDefinition=V.bind(null,t),U.aliases&&C(U.aliases,{languageName:M})}function T(M){delete e[M];for(let V of Object.keys(r))r[V]===M&&delete r[V]}function O(){return Object.keys(e)}function S(M){return M=(M||"").toLowerCase(),e[M]||e[r[M]]}function C(M,{languageName:V}){typeof M=="string"&&(M=[M]),M.forEach(U=>{r[U.toLowerCase()]=V})}function F(M){let V=S(M);return V&&!V.disableAutodetect}function N(M){M["before:highlightBlock"]&&!M["before:highlightElement"]&&(M["before:highlightElement"]=V=>{M["before:highlightBlock"](Object.assign({block:V.el},V))}),M["after:highlightBlock"]&&!M["after:highlightElement"]&&(M["after:highlightElement"]=V=>{M["after:highlightBlock"](Object.assign({block:V.el},V))})}function R(M){N(M),o.push(M)}function z(M,V){let U=M;o.forEach(function(G){G[U]&&G[U](V)})}function B(M){return Fu("10.7.0","highlightBlock will be removed entirely in v12.0"),Fu("10.7.0","Please use highlightElement now."),g(M)}Object.assign(t,{highlight:u,highlightAuto:m,highlightAll:I,highlightElement:g,highlightBlock:B,configure:_,initHighlighting:x,initHighlightingOnLoad:b,registerLanguage:v,unregisterLanguage:T,listLanguages:O,getLanguage:S,registerAliases:C,autoDetection:F,inherit:p8,addPlugin:R}),t.debugMode=function(){n=!1},t.safeMode=function(){n=!0},t.versionString=ube,t.regex={concat:Pl,lookahead:g8,either:UC,optional:Cxe,anyNumberOfTimes:Sxe};for(let M in qb)typeof qb[M]=="object"&&FC.exports(qb[M]);return Object.assign(t,qb),t},Jp=fbe({});S8.exports=Jp;Jp.HighlightJS=Jp;Jp.default=Jp});var T8=$e((eXe,k8)=>{"use strict";function pbe(t){let e=t.regex,r=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,n={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=t.inherit(a,{begin:/\(/,end:/\)/}),s=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[n]},{begin:/'/,end:/'/,contains:[n]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,l,s,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,i,l,s]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},n,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(r,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}k8.exports=pbe});var O8=$e((tXe,P8)=>{"use strict";function mbe(t){let e=t.regex,r={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});let n={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},i={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,n]};n.contains.push(i);let s={className:"",begin:/\\"/},l={className:"string",begin:/'/,end:/'/},c={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,r]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=t.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],h=["true","false"],g={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],b=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],y=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...x,"set","shopt",...b,...y]},contains:[d,t.SHEBANG(),p,c,t.HASH_COMMENT_MODE,a,g,i,s,l,r]}}P8.exports=mbe});var D8=$e((rXe,A8)=>{"use strict";function hbe(t){let e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",n="[a-zA-Z_]\\w*::",a="<[^<>]+>",i="("+o+"|"+e.optional(n)+"[a-zA-Z_]\\w*"+e.optional(a)+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(n)+t.IDENT_RE,relevance:0},m=e.optional(n)+t.IDENT_RE+"\\s*\\(",_={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},x=[d,s,r,t.C_BLOCK_COMMENT_MODE,u,c],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:x.concat([{begin:/\(/,end:/\)/,keywords:_,contains:x.concat(["self"]),relevance:0}]),relevance:0},y={begin:"("+i+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:_,relevance:0},{begin:m,returnBegin:!0,contains:[t.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:_,disableAutodetect:!0,illegal:"</",contains:[].concat(b,y,x,[d,{begin:t.IDENT_RE+"::",keywords:_},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:_}}}A8.exports=hbe});var N8=$e((oXe,R8)=>{"use strict";function gbe(t){let e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",n="[a-zA-Z_]\\w*::",a="<[^<>]+>",i="(?!struct)("+o+"|"+e.optional(n)+"[a-zA-Z_]\\w*"+e.optional(a)+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(n)+t.IDENT_RE,relevance:0},m=e.optional(n)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],_=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],x=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],I={type:g,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:_},w={className:"function.dispatch",relevance:0,keywords:{_hint:x},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},v=[w,d,s,r,t.C_BLOCK_COMMENT_MODE,u,c],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:I,contains:v.concat([{begin:/\(/,end:/\)/,keywords:I,contains:v.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+i+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:I,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:I,relevance:0},{begin:m,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:I,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,O,w,v,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:I,contains:["self",s]},{begin:t.IDENT_RE+"::",keywords:I},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}R8.exports=gbe});var L8=$e((nXe,M8)=>{"use strict";function _be(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],o=["default","false","null","true"],n=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],i={keyword:n.concat(a),built_in:e,literal:o},s=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=t.inherit(c,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:i},p=t.inherit(d,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,p]},h={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},g=t.inherit(h,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});d.contains=[h,m,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],p.contains=[g,m,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let _={variants:[h,m,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},s]},b=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",y={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:i,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},s,x,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,x,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:i,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,relevance:0,contains:[_,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},y]}}M8.exports=_be});var F8=$e((aXe,B8)=>{"use strict";var xbe=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),bbe=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ybe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],vbe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Ibe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],wbe=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function Ebe(t){let e=t.regex,r=xbe(t),o={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n="and or not only",a=/@-?\w[\w]*(-\w+)*/,i="[a-zA-Z-][a-zA-Z0-9_-]*",s=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,o,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+i,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+vbe.join("|")+")"},{begin:":(:)?("+Ibe.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wbe.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:n,attribute:ybe.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+bbe.join("|")+")\\b"}]}}B8.exports=Ebe});var U8=$e((iXe,z8)=>{"use strict";function Sbe(t){let e=t.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={begin:"^[-\\*]{3,}",end:"$"},n={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]},d=t.inherit(c,{contains:[]}),p=t.inherit(u,{contains:[]});c.contains.push(p),u.contains.push(d);let m=[r,l];return[c,u,d,p].forEach(_=>{_.contains=_.contains.concat(m)}),m=m.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},r,a,c,u,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},n,o,l,i]}}z8.exports=Sbe});var H8=$e((sXe,V8)=>{"use strict";function Cbe(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}V8.exports=Cbe});var j8=$e((lXe,$8)=>{"use strict";function kbe(t){let e=t.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",o=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),n=e.concat(o,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__"],"variable.language":["self","super"],keyword:["alias","and","attr_accessor","attr_reader","attr_writer","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","include","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield"],built_in:["proc","lambda"],literal:["true","false","nil"]},i={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},l=[t.COMMENT("#","$",{contains:[i]}),t.COMMENT("^=begin","^=end",{contains:[i],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:a},u={className:"string",contains:[t.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,c]})]}]},d="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},y=[u,{variants:[{match:[/class\s+/,n,/\s+<\s+/,n]},{match:[/class\s+/,n]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{relevance:0,match:[n,/\.new[ (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:r}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,l),relevance:0}].concat(s,l);c.contains=y,h.contains=y;let I="[>?]>",w="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",v="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",T=[{begin:/^\s*=>/,starts:{end:"$",contains:y}},{className:"meta.prompt",begin:"^("+I+"|"+w+"|"+v+")(?=[ ])",starts:{end:"$",keywords:a,contains:y}}];return l.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(T).concat(l).concat(y)}}$8.exports=kbe});var G8=$e((cXe,q8)=>{"use strict";function Tbe(t){let a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:t.C_NUMBER_RE+"[i]",relevance:1},t.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}q8.exports=Tbe});var K8=$e((uXe,W8)=>{"use strict";function Pbe(t){let e=t.regex,r=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(r,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}W8.exports=Pbe});var Y8=$e((dXe,X8)=>{"use strict";function Obe(t){let e=t.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},o=t.COMMENT();o.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let n={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:"literal",begin:/\bon|off|true|false|yes|no\b/},i={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},s={begin:/\[/,end:/\]/,contains:[o,a,n,i,r,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,u=/'[^']*'/,d=e.either(l,c,u),p=e.concat(d,"(\\s*\\.\\s*",d,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[o,{className:"section",begin:/\[+/,end:/\]+/},{begin:p,className:"attr",starts:{end:/$/,contains:[o,s,a,n,i,r]}}]}}X8.exports=Obe});var eV=$e((fXe,J8)=>{"use strict";var zu="[0-9](_*[0-9])*",Xb=`\\.(${zu})`,Yb="[0-9a-fA-F](_*[0-9a-fA-F])*",Q8={className:"number",variants:[{begin:`(\\b(${zu})((${Xb})|\\.)?|(${Xb}))[eE][+-]?(${zu})[fFdD]?\\b`},{begin:`\\b(${zu})((${Xb})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Xb})[fFdD]?\\b`},{begin:`\\b(${zu})[fFdD]\\b`},{begin:`\\b0[xX]((${Yb})\\.?|(${Yb})?\\.(${Yb}))[pP][+-]?(${zu})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Yb})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Z8(t,e,r){return r===-1?"":t.replace(e,o=>Z8(t,e,r-1))}function Abe(t){let e=t.regex,r="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",o=r+Z8("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[u,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+o+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Q8,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Q8,c]}}J8.exports=Abe});var iV=$e((pXe,aV)=>{"use strict";var tV="[A-Za-z$_][0-9A-Za-z$_]*",Dbe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Rbe=["true","false","null","undefined","NaN","Infinity"],rV=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],oV=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nV=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Nbe=["arguments","this","super","console","window","document","localStorage","module","global"],Mbe=[].concat(nV,rV,oV);function Lbe(t){let e=t.regex,r=(V,{after:U})=>{let G="</"+V[0].slice(1);return V.input.indexOf(G,U)!==-1},o=tV,n={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,U)=>{let G=V[0].length+V.index,k=V.input[G];if(k==="<"||k===","){U.ignoreMatch();return}k===">"&&(r(V,{after:G})||U.ignoreMatch());let Z;if((Z=V.input.substring(G).match(/^\s+extends\s+/))&&Z.index===0){U.ignoreMatch();return}}},s={$pattern:tV,keyword:Dbe,literal:Rbe,built_in:Mbe,"variable.language":Nbe},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},m={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},b=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,h,g,d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});let y=[].concat(x,p.contains),I=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:I},v={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,e.concat(o,"(",e.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rV,...oV]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},C={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(V){return e.concat("(?!",V.join("|"),")")}let N={match:e.concat(/\b/,F([...nV,"super"]),o,e.lookahead(/\(/)),className:"title.function",relevance:0},R={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,h,g,x,d,T,{className:"attr",begin:o+e.lookahead(":"),relevance:0},M,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:a},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},N,C,v,z,{match:/\$[(.]/}]}}aV.exports=Lbe});var lV=$e((mXe,sV)=>{"use strict";function Bbe(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],n={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",keywords:{literal:o},contains:[e,r,t.QUOTE_STRING_MODE,n,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}sV.exports=Bbe});var uV=$e((hXe,cV)=>{"use strict";var Uu="[0-9](_*[0-9])*",Qb=`\\.(${Uu})`,Zb="[0-9a-fA-F](_*[0-9a-fA-F])*",Fbe={className:"number",variants:[{begin:`(\\b(${Uu})((${Qb})|\\.)?|(${Qb}))[eE][+-]?(${Uu})[fFdD]?\\b`},{begin:`\\b(${Uu})((${Qb})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Qb})[fFdD]?\\b`},{begin:`\\b(${Uu})[fFdD]\\b`},{begin:`\\b0[xX]((${Zb})\\.?|(${Zb})?\\.(${Zb}))[pP][+-]?(${Uu})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Zb})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function zbe(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},o={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},n={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},i={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,n]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,a,n]}]};n.contains.push(i);let s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(i,{className:"string"}),"self"]}]},c=Fbe,u=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=d;return p.variants[1].contains=[d],d.variants[1].contains=[p],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,u,r,o,s,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,u],relevance:0},t.C_LINE_COMMENT_MODE,u,s,l,i,t.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,l]},i,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
3
|
-
`},c]}}cV.exports=zbe});var mV=$e((gXe,pV)=>{"use strict";var Ube=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),Vbe=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Hbe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],dV=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],fV=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],$be=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),jbe=dV.concat(fV);function qbe(t){let e=Ube(t),r=jbe,o="and or not only",n="[\\w-]+",a="("+n+"|@\\{"+n+"\\})",i=[],s=[],l=function(y){return{className:"string",begin:"~?"+y+".*?"+y}},c=function(y,I,w){return{className:y,begin:I,relevance:w}},u={$pattern:/[a-z-]+/,keyword:o,attribute:Hbe.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:u,relevance:0};s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,c("variable","@@?"+n,10),c("variable","@\\{"+n+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:n+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let p=s.concat({begin:/\{/,end:/\}/,contains:i}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},h={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$be.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:s,relevance:0}},_={className:"variable",variants:[{begin:"@"+n+"\\s*:",relevance:15},{begin:"@"+n}],starts:{end:"[;}]",returnEnd:!0,contains:p}},x={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,c("keyword","all\\b"),c("variable","@\\{"+n+"\\}"),{begin:"\\b("+Vbe.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",a,0),c("selector-id","#"+a),c("selector-class","\\."+a,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+dV.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+fV.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},e.FUNCTION_DISPATCH]},b={begin:n+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[x]};return i.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,_,b,h,x,m,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:i}}pV.exports=qbe});var gV=$e((_Xe,hV)=>{"use strict";function Gbe(t){let e="\\[=*\\[",r="\\]=*\\]",o={begin:e,end:r,contains:["self"]},n=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,r,{contains:[o],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:n.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:n}].concat(n)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:r,contains:[o],relevance:5}])}}hV.exports=Gbe});var xV=$e((xXe,_V)=>{"use strict";function Wbe(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},o={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e]},n={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},a={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},i={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,r,o,n,a,i]}}_V.exports=Wbe});var yV=$e((bXe,bV)=>{"use strict";function Kbe(t){let e=t.regex,r=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],o=/[dualxmsipngr]{0,12}/,n={$pattern:/[\w.]+/,keyword:r.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},i={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},l=[t.BACKSLASH_ESCAPE,a,s],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(m,h,g="\\1")=>{let _=g==="\\1"?g:e.concat(g,h);return e.concat(e.concat("(?:",m,")"),h,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,g,o)},d=(m,h,g)=>e.concat(e.concat("(?:",m,")"),h,/(?:\\.|[^\\\/])*?/,g,o),p=[s,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),i,{className:"string",contains:l,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",e.either(...c,{capture:!0}))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",e.either(...c,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=p,i.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:n,contains:p}}bV.exports=Kbe});var IV=$e((yXe,vV)=>{"use strict";function Xbe(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,s={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:s,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}vV.exports=Xbe});var EV=$e((vXe,wV)=>{"use strict";function Ybe(t){let e=t.regex,r=/(?![A-Za-z0-9])(?![$])/,o=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),n=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),a={scope:"variable",match:"\\$+"+o},i={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=t.inherit(t.APOS_STRING_MODE,{illegal:null}),c=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(s)}),u=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(s)}),d=`[
|
|
4
|
-
]`,p={scope:"string",variants:[c,l,u]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},h=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],_=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],b={keyword:g,literal:(N=>{let R=[];return N.forEach(z=>{R.push(z),z.toLowerCase()===z?R.push(z.toUpperCase()):R.push(z.toLowerCase())}),R})(h),built_in:_},y=N=>N.map(R=>R.replace(/\|\d+$/,"")),I={variants:[{match:[/new/,e.concat(d,"+"),e.concat("(?!",y(_).join("\\b|"),"\\b)"),n],scope:{1:"keyword",4:"title.class"}}]},w=e.concat(o,"\\b(?!\\()"),v={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[n,e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[n,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[n,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},T={scope:"attr",match:e.concat(o,e.lookahead(":"),e.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:b,contains:[T,a,v,t.C_BLOCK_COMMENT_MODE,p,m,I]},S={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",y(g).join("\\b|"),"|",y(_).join("\\b|"),"\\b)"),o,e.concat(d,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(S);let C=[T,v,t.C_BLOCK_COMMENT_MODE,p,m,I],F={begin:e.concat(/#\[\s*/,n),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:h,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:h,keyword:["new","array"]},contains:["self",...C]},...C,{scope:"meta",match:n}]};return{case_insensitive:!1,keywords:b,contains:[F,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},i,{scope:"variable.language",match:/\$this\b/},a,S,v,{match:[/const/,/\s/,o],scope:{1:"keyword",3:"variable.constant"}},I,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:b,contains:["self",a,v,t.C_BLOCK_COMMENT_MODE,p,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},p,m]}}wV.exports=Ybe});var CV=$e((IXe,SV)=>{"use strict";function Qbe(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}SV.exports=Qbe});var TV=$e((wXe,kV)=>{"use strict";function Zbe(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}kV.exports=Zbe});var OV=$e((EXe,PV)=>{"use strict";function Jbe(t){let e=t.regex,r=/[\p{XID_Start}_]\p{XID_Continue}*/u,o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,u,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",m=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,h=`\\b|${o.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${m}))[eE][+-]?(${p})[jJ]?(?=${h})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${p})[jJ](?=${h})`}]},_={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",l,g,d,t.HASH_COMMENT_MODE]}]};return c.contains=[d,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,illegal:/(<\/|->|\?)|=>/,contains:[l,g,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},d,_,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,x,d]}]}}PV.exports=Jbe});var DV=$e((SXe,AV)=>{"use strict";function eye(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}AV.exports=eye});var NV=$e((CXe,RV)=>{"use strict";function tye(t){let e=t.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,o=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),n=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[n,o]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,o]},{scope:{1:"punctuation",2:"number"},match:[a,o]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,o]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:n},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}RV.exports=tye});var LV=$e((kXe,MV)=>{"use strict";function rye(t){let e=t.regex,r={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",n=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],a=["true","false","Some","None","Ok","Err"],i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],s=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:s,keyword:n,literal:a,built_in:i},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,t.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:i,type:s}},{className:"punctuation",begin:"->"},r]}}MV.exports=rye});var FV=$e((TXe,BV)=>{"use strict";var oye=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),nye=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],aye=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],iye=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],sye=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],lye=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function cye(t){let e=oye(t),r=sye,o=iye,n="@[a-z-]+",a="and or not only",s={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+nye.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+o.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+lye.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,s,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:n,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:aye.join(" ")},contains:[{begin:n,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}BV.exports=cye});var UV=$e((PXe,zV)=>{"use strict";function uye(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}zV.exports=uye});var HV=$e((OXe,VV)=>{"use strict";function dye(t){let e=t.regex,r=t.COMMENT("--","$"),o={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},n={begin:/"/,end:/"/,contains:[{begin:/""/}]},a=["true","false","unknown"],i=["double precision","large object","with timezone","without timezone"],s=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=u,h=[...c,...l].filter(y=>!u.includes(y)),g={className:"variable",begin:/@[a-z0-9]+/},_={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={begin:e.concat(/\b/,e.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function b(y,{exceptions:I,when:w}={}){let v=w;return I=I||[],y.map(T=>T.match(/\|\d+$/)||I.includes(T)?T:v(T)?`${T}|0`:T)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(h,{when:y=>y.length<3}),literal:a,type:s,built_in:d},contains:[{begin:e.either(...p),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:h.concat(p),literal:a,type:s}},{className:"type",begin:e.either(...i)},x,g,o,n,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,_]}}VV.exports=dye});var QV=$e((AXe,YV)=>{"use strict";function GV(t){return t?typeof t=="string"?t:t.source:null}function Jb(t){return At("(?=",t,")")}function At(...t){return t.map(r=>GV(r)).join("")}function fye(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Wo(...t){return"("+(fye(t).capture?"":"?:")+t.map(o=>GV(o)).join("|")+")"}var GC=t=>At(/\b/,t,/\w$/.test(t)?/\b/:/\B/),pye=["Protocol","Type"].map(GC),$V=["init","self"].map(GC),mye=["Any","Self"],$C=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],jV=["false","nil","true"],hye=["assignment","associativity","higherThan","left","lowerThan","none","right"],gye=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],qV=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],WV=Wo(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),KV=Wo(WV,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),jC=At(WV,KV,"*"),XV=Wo(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),ey=Wo(XV,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),oi=At(XV,ey,"*"),qC=At(/[A-Z]/,ey,"*"),_ye=["autoclosure",At(/convention\(/,Wo("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",At(/objc\(/,oi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],xye=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function bye(t){let e={match:/\s+/,relevance:0},r=t.COMMENT("/\\*","\\*/",{contains:["self"]}),o=[t.C_LINE_COMMENT_MODE,r],n={match:[/\./,Wo(...pye,...$V)],className:{2:"keyword"}},a={match:At(/\./,Wo(...$C)),relevance:0},i=$C.filter(be=>typeof be=="string").concat(["_|0"]),s=$C.filter(be=>typeof be!="string").concat(mye).map(GC),l={variants:[{className:"keyword",match:Wo(...s,...$V)}]},c={$pattern:Wo(/\b\w+/,/#\w+/),keyword:i.concat(gye),literal:jV},u=[n,a,l],d={match:At(/\./,Wo(...qV)),relevance:0},p={className:"built_in",match:At(/\b/,Wo(...qV),/(?=\()/)},m=[d,p],h={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:jC},{match:`\\.(\\.|${KV})+`}]},_=[h,g],x="([0-9]_*)+",b="([0-9a-fA-F]_*)+",y={className:"number",relevance:0,variants:[{match:`\\b(${x})(\\.(${x}))?([eE][+-]?(${x}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${x}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},I=(be="")=>({className:"subst",variants:[{match:At(/\\/,be,/[0\\tnr"']/)},{match:At(/\\/,be,/u\{[0-9a-fA-F]{1,8}\}/)}]}),w=(be="")=>({className:"subst",match:At(/\\/,be,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(be="")=>({className:"subst",label:"interpol",begin:At(/\\/,be,/\(/),end:/\)/}),T=(be="")=>({begin:At(be,/"""/),end:At(/"""/,be),contains:[I(be),w(be),v(be)]}),O=(be="")=>({begin:At(be,/"/),end:At(/"/,be),contains:[I(be),v(be)]}),S={className:"string",variants:[T(),T("#"),T("##"),T("###"),O(),O("#"),O("##"),O("###")]},C={match:At(/`/,oi,/`/)},F={className:"variable",match:/\$\d+/},N={className:"variable",match:`\\$${ey}+`},R=[C,F,N],z={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:xye,contains:[..._,y,S]}]}},B={className:"keyword",match:At(/@/,Wo(..._ye))},M={className:"meta",match:At(/@/,oi)},V=[z,B,M],U={match:Jb(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:At(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,ey,"+")},{className:"type",match:qC,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:At(/\s+&\s+/,Jb(qC)),relevance:0}]},G={begin:/</,end:/>/,keywords:c,contains:[...o,...u,...V,h,U]};U.contains.push(G);let k={match:At(oi,/\s*:/),keywords:"_|0",relevance:0},Z={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",k,...o,...u,...m,..._,y,S,...R,...V,U]},te={begin:/</,end:/>/,contains:[...o,U]},A={begin:Wo(Jb(At(oi,/\s*:/)),Jb(At(oi,/\s+/,oi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:oi}]},ce={begin:/\(/,end:/\)/,keywords:c,contains:[A,...o,...u,..._,y,S,...V,U,Z],endsParent:!0,illegal:/["']/},Se={match:[/func/,/\s+/,Wo(C.match,oi,jC)],className:{1:"keyword",3:"title.function"},contains:[te,ce,e],illegal:[/\[/,/%/]},Ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[te,ce,e],illegal:/\[|%/},et={match:[/operator/,/\s+/,jC],className:{1:"keyword",3:"title"}},Oe={begin:[/precedencegroup/,/\s+/,qC],className:{1:"keyword",3:"title"},contains:[U],keywords:[...hye,...jV],end:/}/};for(let be of S.variants){let st=be.contains.find(mt=>mt.label==="interpol");st.keywords=c;let wt=[...u,...m,..._,y,S,...R];st.contains=[...wt,{begin:/\(/,end:/\)/,contains:["self",...wt]}]}return{name:"Swift",keywords:c,contains:[...o,Se,Ge,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:c,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...u]},et,Oe,{beginKeywords:"import",end:/$/,contains:[...o],relevance:0},...u,...m,..._,y,S,...R,...V,U,Z]}}YV.exports=bye});var JV=$e((DXe,ZV)=>{"use strict";function yye(t){let e="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},n={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,n]},i=t.inherit(a,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s="[0-9]{4}(-[0-9][0-9]){0,2}",l="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",c="(\\.[0-9]*)?",u="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",d={className:"number",begin:"\\b"+s+l+c+u+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},h={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},g=[o,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},d,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},m,h,a],_=[...g];return _.pop(),_.push(i),p.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}ZV.exports=yye});var l7=$e((RXe,s7)=>{"use strict";var ty="[A-Za-z$_][0-9A-Za-z$_]*",e7=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],t7=["true","false","null","undefined","NaN","Infinity"],r7=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],o7=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],n7=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],a7=["arguments","this","super","console","window","document","localStorage","module","global"],i7=[].concat(n7,r7,o7);function vye(t){let e=t.regex,r=(V,{after:U})=>{let G="</"+V[0].slice(1);return V.input.indexOf(G,U)!==-1},o=ty,n={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,U)=>{let G=V[0].length+V.index,k=V.input[G];if(k==="<"||k===","){U.ignoreMatch();return}k===">"&&(r(V,{after:G})||U.ignoreMatch());let Z;if((Z=V.input.substring(G).match(/^\s+extends\s+/))&&Z.index===0){U.ignoreMatch();return}}},s={$pattern:ty,keyword:e7,literal:t7,built_in:i7,"variable.language":a7},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},m={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},b=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,h,g,d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});let y=[].concat(x,p.contains),I=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:I},v={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,e.concat(o,"(",e.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...r7,...o7]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},C={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(V){return e.concat("(?!",V.join("|"),")")}let N={match:e.concat(/\b/,F([...n7,"super"]),o,e.lookahead(/\(/)),className:"title.function",relevance:0},R={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,h,g,x,d,T,{className:"attr",begin:o+e.lookahead(":"),relevance:0},M,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:a},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},N,C,v,z,{match:/\$[(.]/}]}}function Iye(t){let e=vye(t),r=ty,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],n={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[e.exports.CLASS_REFERENCE]},i={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},s=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:ty,keyword:e7.concat(s),literal:t7,built_in:i7.concat(o),"variable.language":a7},c={className:"meta",begin:"@"+r},u=(p,m,h)=>{let g=p.contains.findIndex(_=>_.label===m);if(g===-1)throw new Error("can not find mode to replace");p.contains.splice(g,1,h)};Object.assign(e.keywords,l),e.exports.PARAMS_CONTAINS.push(c),e.contains=e.contains.concat([c,n,a]),u(e,"shebang",t.SHEBANG()),u(e,"use_strict",i);let d=e.contains.find(p=>p.label==="func.def");return d.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx"]}),e}s7.exports=Iye});var u7=$e((NXe,c7)=>{"use strict";function wye(t){let e=t.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},o={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},n=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(a,n),/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,i,/ *#/)},{begin:e.concat(/# */,e.either(a,n),/ +/,e.either(i,s),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),p=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[r,o,l,c,u,d,p,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[p]}]}}c7.exports=wye});var f7=$e((MXe,d7)=>{"use strict";function Eye(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let r=t.COMMENT(/;;/,/$/),o=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],n={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},i={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},s={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:o},contains:[r,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,i,n,t.QUOTE_STRING_MODE,l,c,s]}}d7.exports=Eye});var m7=$e((LXe,p7)=>{"use strict";var qe=C8();qe.registerLanguage("xml",T8());qe.registerLanguage("bash",O8());qe.registerLanguage("c",D8());qe.registerLanguage("cpp",N8());qe.registerLanguage("csharp",L8());qe.registerLanguage("css",F8());qe.registerLanguage("markdown",U8());qe.registerLanguage("diff",H8());qe.registerLanguage("ruby",j8());qe.registerLanguage("go",G8());qe.registerLanguage("graphql",K8());qe.registerLanguage("ini",Y8());qe.registerLanguage("java",eV());qe.registerLanguage("javascript",iV());qe.registerLanguage("json",lV());qe.registerLanguage("kotlin",uV());qe.registerLanguage("less",mV());qe.registerLanguage("lua",gV());qe.registerLanguage("makefile",xV());qe.registerLanguage("perl",yV());qe.registerLanguage("objectivec",IV());qe.registerLanguage("php",EV());qe.registerLanguage("php-template",CV());qe.registerLanguage("plaintext",TV());qe.registerLanguage("python",OV());qe.registerLanguage("python-repl",DV());qe.registerLanguage("r",NV());qe.registerLanguage("rust",LV());qe.registerLanguage("scss",FV());qe.registerLanguage("shell",UV());qe.registerLanguage("sql",HV());qe.registerLanguage("swift",QV());qe.registerLanguage("yaml",JV());qe.registerLanguage("typescript",l7());qe.registerLanguage("vbnet",u7());qe.registerLanguage("wasm",f7());qe.HighlightJS=qe;qe.default=qe;p7.exports=qe});var Ev={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function YP(t){return()=>({fontFamily:t.fontFamily||"sans-serif"})}function QP(t){return()=>({WebkitTapHighlightColor:"transparent","&:focus":{outlineOffset:2,outline:t.focusRing==="always"||t.focusRing==="auto"?`2px solid ${t.colors[t.primaryColor][t.colorScheme==="dark"?7:5]}`:"none"},"&:focus:not(:focus-visible)":{outline:t.focusRing==="auto"||t.focusRing==="never"?"none":void 0}})}function Tm(t){return(e,r,o=!0)=>{let n=t.colors[t.primaryColor];return e in t.colors?t.colors[e][r]:o?n[r]:e}}function Sv(t){let e="";for(let r=1;r<t.length-1;r+=1)e+=`${t[r]} ${r/(t.length-1)*100}%, `;return`${t[0]} 0%, ${e}${t[t.length-1]} 100%`}function ZP(t,...e){return`linear-gradient(${t}deg, ${Sv(e)})`}function JP(...t){return`radial-gradient(circle, ${Sv(t)})`}function yd(t){return typeof t.size=="number"?t.size:t.sizes[t.size]||t.size||t.sizes.md}function eO(t){return e=>`@media (min-width: ${yd({size:e,sizes:t.breakpoints})+1}px)`}function tO(t){return e=>`@media (max-width: ${yd({size:e,sizes:t.breakpoints})}px)`}function Jj(t){return/^#?([0-9A-F]{3}){1,2}$/i.test(t)}function eq(t){let e=t.replace("#","");if(e.length===3){let i=e.split("");e=[i[0],i[0],i[1],i[1],i[2],i[2]].join("")}let r=parseInt(e,16),o=r>>16&255,n=r>>8&255,a=r&255;return{r:o,g:n,b:a,a:1}}function tq(t){let[e,r,o,n]=t.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:e,g:r,b:o,a:n||1}}function Wl(t){return Jj(t)?eq(t):t.startsWith("rgb")?tq(t):{r:0,g:0,b:0,a:1}}function _i(t,e){if(typeof t!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";let{r,g:o,b:n}=Wl(t);return`rgba(${r}, ${o}, ${n}, ${e})`}function rO(t=0){return{position:"absolute",top:t,right:t,left:t,bottom:t}}function oO(t,e){let{r,g:o,b:n,a}=Wl(t),i=1-e,s=l=>Math.round(l*i);return`rgba(${s(r)}, ${s(o)}, ${s(n)}, ${a})`}function nO(t,e){let{r,g:o,b:n,a}=Wl(t),i=s=>Math.round(s+(255-s)*e);return`rgba(${i(r)}, ${i(o)}, ${i(n)}, ${a})`}function aO(t){return e=>{if(typeof e=="number")return e;let r=typeof t.defaultRadius=="number"?t.defaultRadius:t.radius[t.defaultRadius]||t.defaultRadius;return t.radius[e]||e||r}}function Pm(t){return e=>typeof t.primaryShade=="number"?t.primaryShade:t.primaryShade[e||t.colorScheme]}var Cv={from:"indigo",to:"cyan",deg:45};function iO(t){let e=Tm(t),r=Pm(t);return({variant:o,color:n,gradient:a})=>{if(o==="light")return{border:"transparent",background:_i(e(n,t.colorScheme==="dark"?8:0),t.colorScheme==="dark"?.35:1),color:n==="dark"?t.colorScheme==="dark"?t.colors.dark[0]:t.colors.dark[9]:e(n,t.colorScheme==="dark"?2:r("light")),hover:_i(e(n,t.colorScheme==="dark"?7:1),t.colorScheme==="dark"?.45:.65)};if(o==="default")return{border:t.colorScheme==="dark"?t.colors.dark[5]:t.colors.gray[4],background:t.colorScheme==="dark"?t.colors.dark[5]:t.white,color:t.colorScheme==="dark"?t.white:t.black,hover:t.colorScheme==="dark"?t.colors.dark[4]:t.colors.gray[0]};if(o==="white")return{border:"transparent",background:t.white,color:e(n,r()),hover:null};if(o==="outline")return{border:e(n,t.colorScheme==="dark"?4:r("light")),background:"transparent",color:e(n,t.colorScheme==="dark"?4:r("light")),hover:t.colorScheme==="dark"?_i(e(n,4),.05):_i(e(n,0),.35)};if(o==="gradient"){let i={from:a?.from||Cv.from,to:a?.to||Cv.to,deg:a?.deg||Cv.deg};return{background:`linear-gradient(${i.deg}deg, ${e(i.from,r(),!1)} 0%, ${e(i.to,r(),!1)} 100%)`,color:t.white,border:"transparent",hover:null}}return o==="subtle"?{border:"transparent",background:"transparent",color:n==="dark"?t.colorScheme==="dark"?t.colors.dark[0]:t.colors.dark[9]:e(n,t.colorScheme==="dark"?2:r("light")),hover:_i(e(n,t.colorScheme==="dark"?8:0),t.colorScheme==="dark"?.35:1)}:{border:"transparent",background:e(n,r()),color:t.white,hover:e(n,r()===9?8:r()+1)}}}function sO(t){return{"@media (hover: hover)":{"&:hover":t},"@media (hover: none)":{"&:active":t}}}var jr={fontStyles:YP,themeColor:Tm,focusStyles:QP,linearGradient:ZP,radialGradient:JP,smallerThan:tO,largerThan:eO,rgba:_i,size:yd,cover:rO,darken:oO,lighten:nO,radius:aO,variant:iO,primaryShade:Pm,hover:sO};var rq=Object.defineProperty,oq=Object.defineProperties,nq=Object.getOwnPropertyDescriptors,lO=Object.getOwnPropertySymbols,aq=Object.prototype.hasOwnProperty,iq=Object.prototype.propertyIsEnumerable,cO=(t,e,r)=>e in t?rq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sq=(t,e)=>{for(var r in e||(e={}))aq.call(e,r)&&cO(t,r,e[r]);if(lO)for(var r of lO(e))iq.call(e,r)&&cO(t,r,e[r]);return t},lq=(t,e)=>oq(t,nq(e));function Om(t){return lq(sq({},t),{fn:{fontStyles:jr.fontStyles(t),themeColor:jr.themeColor(t),focusStyles:jr.focusStyles(t),largerThan:jr.largerThan(t),smallerThan:jr.smallerThan(t),radialGradient:jr.radialGradient,linearGradient:jr.linearGradient,rgba:jr.rgba,size:jr.size,cover:jr.cover,lighten:jr.lighten,darken:jr.darken,primaryShade:jr.primaryShade(t),radius:jr.radius(t),variant:jr.variant(t),hover:jr.hover}})}var RCe=Object.keys(Ev);var cq={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",dateFormat:"MMMM D, YYYY",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:Ev,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",shadows:{xs:"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",sm:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 10px 15px -5px, rgba(0, 0, 0, 0.04) 0px 7px 7px -5px",md:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px",lg:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 28px 23px -7px, rgba(0, 0, 0, 0.04) 0px 12px 12px -7px",xl:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 36px 28px -7px, rgba(0, 0, 0, 0.04) 0px 17px 17px -7px"},fontSizes:{xs:12,sm:14,md:16,lg:18,xl:20},radius:{xs:2,sm:4,md:8,lg:16,xl:32},spacing:{xs:10,sm:12,md:16,lg:20,xl:24},breakpoints:{xs:576,sm:768,md:992,lg:1200,xl:1400},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:34,lineHeight:1.3},h2:{fontSize:26,lineHeight:1.35},h3:{fontSize:22,lineHeight:1.4},h4:{fontSize:18,lineHeight:1.45},h5:{fontSize:16,lineHeight:1.5},h6:{fontSize:14,lineHeight:1.5}}},other:{},datesLocale:"en"},Am=Om(cq);var wd,he,mO,uq,hs,uO,hO,kv,gO,Id={},_O=[],dq=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Nm=Array.isArray;function La(t,e){for(var r in e)t[r]=e[r];return t}function xO(t){var e=t.parentNode;e&&e.removeChild(t)}function Q(t,e,r){var o,n,a,i={};for(a in e)a=="key"?o=e[a]:a=="ref"?n=e[a]:i[a]=e[a];if(arguments.length>2&&(i.children=arguments.length>3?wd.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)i[a]===void 0&&(i[a]=t.defaultProps[a]);return vd(t,i,o,n,null)}function vd(t,e,r,o,n){var a={type:t,props:e,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++mO,__i:-1,__u:0};return n==null&&he.vnode!=null&&he.vnode(a),a}function Ov(){return{current:null}}function Ae(t){return t.children}function Vo(t,e){this.props=t,this.context=e}function Kl(t,e){if(e==null)return t.__?Kl(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Kl(t):null}function bO(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return bO(t)}}function Tv(t){(!t.__d&&(t.__d=!0)&&hs.push(t)&&!Rm.__r++||uO!==he.debounceRendering)&&((uO=he.debounceRendering)||hO)(Rm)}function Rm(){var t,e,r,o,n,a,i,s,l;for(hs.sort(kv);t=hs.shift();)t.__d&&(e=hs.length,o=void 0,a=(n=(r=t).__v).__e,s=[],l=[],(i=r.__P)&&((o=La({},n)).__v=n.__v+1,he.vnode&&he.vnode(o),Av(i,o,n,r.__n,i.ownerSVGElement!==void 0,32&n.__u?[a]:null,s,a??Kl(n),!!(32&n.__u),l),o.__.__k[o.__i]=o,IO(s,o,l),o.__e!=a&&bO(o)),hs.length>e&&hs.sort(kv));Rm.__r=0}function yO(t,e,r,o,n,a,i,s,l,c,u){var d,p,m,h,g,_=o&&o.__k||_O,x=e.length;for(r.__d=l,fq(r,e,_),l=r.__d,d=0;d<x;d++)(m=r.__k[d])!=null&&typeof m!="boolean"&&typeof m!="function"&&(p=m.__i===-1?Id:_[m.__i]||Id,m.__i=d,Av(t,m,p,n,a,i,s,l,c,u),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Dv(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),65536&m.__u||p.__k===m.__k?l=vO(m,l,t):typeof m.type=="function"&&m.__d!==void 0?l=m.__d:h&&(l=h.nextSibling),m.__d=void 0,m.__u&=-196609);r.__d=l,r.__e=g}function fq(t,e,r){var o,n,a,i,s,l=e.length,c=r.length,u=c,d=0;for(t.__k=[],o=0;o<l;o++)(n=t.__k[o]=(n=e[o])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?vd(null,n,null,null,n):Nm(n)?vd(Ae,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?vd(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=t,n.__b=t.__b+1,s=pq(n,r,i=o+d,u),n.__i=s,a=null,s!==-1&&(u--,(a=r[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof n.type!="function"&&(n.__u|=65536)):s!==i&&(s===i+1?d++:s>i?u>l-i?d+=s-i:d--:d=s<i&&s==i-1?s-i:0,s!==o+d&&(n.__u|=65536))):(a=r[o])&&a.key==null&&a.__e&&(a.__e==t.__d&&(t.__d=Kl(a)),Pv(a,a,!1),r[o]=null,u--);if(u)for(o=0;o<c;o++)(a=r[o])!=null&&!(131072&a.__u)&&(a.__e==t.__d&&(t.__d=Kl(a)),Pv(a,a))}function vO(t,e,r){var o,n;if(typeof t.type=="function"){for(o=t.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=t,e=vO(o[n],e,r));return e}return t.__e!=e&&(r.insertBefore(t.__e,e||null),e=t.__e),e&&e.nextSibling}function yo(t,e){return e=e||[],t==null||typeof t=="boolean"||(Nm(t)?t.some(function(r){yo(r,e)}):e.push(t)),e}function pq(t,e,r,o){var n=t.key,a=t.type,i=r-1,s=r+1,l=e[r];if(l===null||l&&n==l.key&&a===l.type)return r;if(o>(l!=null&&!(131072&l.__u)?1:0))for(;i>=0||s<e.length;){if(i>=0){if((l=e[i])&&!(131072&l.__u)&&n==l.key&&a===l.type)return i;i--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&n==l.key&&a===l.type)return s;s++}}return-1}function dO(t,e,r){e[0]==="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||dq.test(e)?r:r+"px"}function Dm(t,e,r,o,n){var a;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)r&&e in r||dO(t.style,e,"");if(r)for(e in r)o&&r[e]===o[e]||dO(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")a=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+a]=r,r?o?r.u=o.u:(r.u=Date.now(),t.addEventListener(e,a?pO:fO,a)):t.removeEventListener(e,a?pO:fO,a);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,r))}}function fO(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(he.event?he.event(t):t)}function pO(t){return this.l[t.type+!0](he.event?he.event(t):t)}function Av(t,e,r,o,n,a,i,s,l,c){var u,d,p,m,h,g,_,x,b,y,I,w,v,T,O,S=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),a=[s=e.__e=r.__e]),(u=he.__b)&&u(e);e:if(typeof S=="function")try{if(x=e.props,b=(u=S.contextType)&&o[u.__c],y=u?b?b.props.value:u.__:o,r.__c?_=(d=e.__c=r.__c).__=d.__E:("prototype"in S&&S.prototype.render?e.__c=d=new S(x,y):(e.__c=d=new Vo(x,y),d.constructor=S,d.render=hq),b&&b.sub(d),d.props=x,d.state||(d.state={}),d.context=y,d.__n=o,p=d.__d=!0,d.__h=[],d._sb=[]),d.__s==null&&(d.__s=d.state),S.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=La({},d.__s)),La(d.__s,S.getDerivedStateFromProps(x,d.__s))),m=d.props,h=d.state,d.__v=e,p)S.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(S.getDerivedStateFromProps==null&&x!==m&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(x,y),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(x,d.__s,y)===!1||e.__v===r.__v)){for(e.__v!==r.__v&&(d.props=x,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach(function(C){C&&(C.__=e)}),I=0;I<d._sb.length;I++)d.__h.push(d._sb[I]);d._sb=[],d.__h.length&&i.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(x,d.__s,y),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(m,h,g)})}if(d.context=y,d.props=x,d.__P=t,d.__e=!1,w=he.__r,v=0,"prototype"in S&&S.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(e),u=d.render(d.props,d.state,d.context),T=0;T<d._sb.length;T++)d.__h.push(d._sb[T]);d._sb=[]}else do d.__d=!1,w&&w(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++v<25);d.state=d.__s,d.getChildContext!=null&&(o=La(La({},o),d.getChildContext())),p||d.getSnapshotBeforeUpdate==null||(g=d.getSnapshotBeforeUpdate(m,h)),yO(t,Nm(O=u!=null&&u.type===Ae&&u.key==null?u.props.children:u)?O:[O],e,r,o,n,a,i,s,l,c),d.base=e.__e,e.__u&=-161,d.__h.length&&i.push(d),_&&(d.__E=d.__=null)}catch(C){e.__v=null,l||a!=null?(e.__e=s,e.__u|=l?160:32,a[a.indexOf(s)]=null):(e.__e=r.__e,e.__k=r.__k),he.__e(C,e,r)}else a==null&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=mq(r.__e,e,r,o,n,a,i,l,c);(u=he.diffed)&&u(e)}function IO(t,e,r){e.__d=void 0;for(var o=0;o<r.length;o++)Dv(r[o],r[++o],r[++o]);he.__c&&he.__c(e,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(a){a.call(n)})}catch(a){he.__e(a,n.__v)}})}function mq(t,e,r,o,n,a,i,s,l){var c,u,d,p,m,h,g,_=r.props,x=e.props,b=e.type;if(b==="svg"&&(n=!0),a!=null){for(c=0;c<a.length;c++)if((m=a[c])&&"setAttribute"in m==!!b&&(b?m.localName===b:m.nodeType===3)){t=m,a[c]=null;break}}if(t==null){if(b===null)return document.createTextNode(x);t=n?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,x.is&&x),a=null,s=!1}if(b===null)_===x||s&&t.data===x||(t.data=x);else{if(a=a&&wd.call(t.childNodes),_=r.props||Id,!s&&a!=null)for(_={},c=0;c<t.attributes.length;c++)_[(m=t.attributes[c]).name]=m.value;for(c in _)m=_[c],c=="children"||(c=="dangerouslySetInnerHTML"?d=m:c==="key"||c in x||Dm(t,c,null,m,n));for(c in x)m=x[c],c=="children"?p=m:c=="dangerouslySetInnerHTML"?u=m:c=="value"?h=m:c=="checked"?g=m:c==="key"||s&&typeof m!="function"||_[c]===m||Dm(t,c,m,_[c],n);if(u)s||d&&(u.__html===d.__html||u.__html===t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),yO(t,Nm(p)?p:[p],e,r,o,n&&b!=="foreignObject",a,i,a?a[0]:r.__k&&Kl(r,0),s,l),a!=null)for(c=a.length;c--;)a[c]!=null&&xO(a[c]);s||(c="value",h!==void 0&&(h!==t[c]||b==="progress"&&!h||b==="option"&&h!==_[c])&&Dm(t,c,h,_[c],!1),c="checked",g!==void 0&&g!==t[c]&&Dm(t,c,g,_[c],!1))}return t}function Dv(t,e,r){try{typeof t=="function"?t(e):t.current=e}catch(o){he.__e(o,r)}}function Pv(t,e,r){var o,n;if(he.unmount&&he.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||Dv(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){he.__e(a,e)}o.base=o.__P=null,t.__c=void 0}if(o=t.__k)for(n=0;n<o.length;n++)o[n]&&Pv(o[n],e,r||typeof t.type!="function");r||t.__e==null||xO(t.__e),t.__=t.__e=t.__d=void 0}function hq(t,e,r){return this.constructor(t,r)}function xi(t,e,r){var o,n,a,i;he.__&&he.__(t,e),n=(o=typeof r=="function")?null:r&&r.__k||e.__k,a=[],i=[],Av(e,t=(!o&&r||e).__k=Q(Ae,null,[t]),n||Id,Id,e.ownerSVGElement!==void 0,!o&&r?[r]:n?null:e.firstChild?wd.call(e.childNodes):null,a,!o&&r?r:n?n.__e:e.firstChild,o,i),IO(a,t,i)}function Rv(t,e){xi(t,e,Rv)}function Mm(t,e,r){var o,n,a,i,s=La({},t.props);for(a in t.type&&t.type.defaultProps&&(i=t.type.defaultProps),e)a=="key"?o=e[a]:a=="ref"?n=e[a]:s[a]=e[a]===void 0&&i!==void 0?i[a]:e[a];return arguments.length>2&&(s.children=arguments.length>3?wd.call(arguments,2):r),vd(t.type,s,o||t.key,n||t.ref,null)}function Rt(t,e){var r={__c:e="__cC"+gO++,__:t,Consumer:function(o,n){return o.children(n)},Provider:function(o){var n,a;return this.getChildContext||(n=[],(a={})[e]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(i){this.props.value!==i.value&&n.some(function(s){s.__e=!0,Tv(s)})},this.sub=function(i){n.push(i);var s=i.componentWillUnmount;i.componentWillUnmount=function(){n.splice(n.indexOf(i),1),s&&s.call(i)}}),o.children}};return r.Provider.__=r.Consumer.contextType=r}wd=_O.slice,he={__e:function(t,e,r,o){for(var n,a,i;e=e.__;)if((n=e.__c)&&!n.__)try{if((a=n.constructor)&&a.getDerivedStateFromError!=null&&(n.setState(a.getDerivedStateFromError(t)),i=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(t,o||{}),i=n.__d),i)return n.__E=n}catch(s){t=s}throw t}},mO=0,uq=function(t){return t!=null&&t.constructor==null},Vo.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=La({},this.state),typeof t=="function"&&(t=t(La({},r),this.props)),t&&La(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Tv(this))},Vo.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Tv(this))},Vo.prototype.render=Ae,hs=[],hO=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,kv=function(t,e){return t.__v.__b-e.__v.__b},Rm.__r=0,gO=0;var bi,Nt,Nv,wO,Xl=0,OO=[],Lm=[],EO=he.__b,SO=he.__r,CO=he.diffed,kO=he.__c,TO=he.unmount;function Yl(t,e){he.__h&&he.__h(Nt,t,Xl||e),Xl=0;var r=Nt.__H||(Nt.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Lm}),r.__[t]}function P(t){return Xl=1,Ko(NO,t)}function Ko(t,e,r){var o=Yl(bi++,2);if(o.t=t,!o.__c&&(o.__=[r?r(e):NO(void 0,e),function(s){var l=o.__N?o.__N[0]:o.__[0],c=o.t(l,s);l!==c&&(o.__N=[c,o.__[1]],o.__c.setState({}))}],o.__c=Nt,!Nt.u)){var n=function(s,l,c){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(p){return p.__c});if(u.every(function(p){return!p.__N}))return!a||a.call(this,s,l,c);var d=!1;return u.forEach(function(p){if(p.__N){var m=p.__[0];p.__=p.__N,p.__N=void 0,m!==p.__[0]&&(d=!0)}}),!(!d&&o.__c.props===s)&&(!a||a.call(this,s,l,c))};Nt.u=!0;var a=Nt.shouldComponentUpdate,i=Nt.componentWillUpdate;Nt.componentWillUpdate=function(s,l,c){if(this.__e){var u=a;a=void 0,n(s,l,c),a=u}i&&i.call(this,s,l,c)},Nt.shouldComponentUpdate=n}return o.__N||o.__}function L(t,e){var r=Yl(bi++,3);!he.__s&&Lv(r.__H,e)&&(r.__=t,r.i=e,Nt.__H.__h.push(r))}function Er(t,e){var r=Yl(bi++,4);!he.__s&&Lv(r.__H,e)&&(r.__=t,r.i=e,Nt.__h.push(r))}function H(t){return Xl=5,Tt(function(){return{current:t}},[])}function AO(t,e,r){Xl=6,Er(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function Tt(t,e){var r=Yl(bi++,7);return Lv(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function Ht(t,e){return Xl=8,Tt(function(){return t},e)}function Mt(t){var e=Nt.context[t.__c],r=Yl(bi++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(Nt)),e.props.value):t.__}function DO(t,e){he.useDebugValue&&he.useDebugValue(e?e(t):t)}function RO(){var t=Yl(bi++,11);if(!t.__){for(var e=Nt.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function gq(){for(var t;t=OO.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Bm),t.__H.__h.forEach(Mv),t.__H.__h=[]}catch(e){t.__H.__h=[],he.__e(e,t.__v)}}he.__b=function(t){Nt=null,EO&&EO(t)},he.__r=function(t){SO&&SO(t),bi=0;var e=(Nt=t.__c).__H;e&&(Nv===Nt?(e.__h=[],Nt.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Lm,r.__N=r.i=void 0})):(e.__h.forEach(Bm),e.__h.forEach(Mv),e.__h=[],bi=0)),Nv=Nt},he.diffed=function(t){CO&&CO(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(OO.push(e)!==1&&wO===he.requestAnimationFrame||((wO=he.requestAnimationFrame)||_q)(gq)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Lm&&(r.__=r.__V),r.i=void 0,r.__V=Lm})),Nv=Nt=null},he.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Bm),r.__h=r.__h.filter(function(o){return!o.__||Mv(o)})}catch(o){e.some(function(n){n.__h&&(n.__h=[])}),e=[],he.__e(o,r.__v)}}),kO&&kO(t,e)},he.unmount=function(t){TO&&TO(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{Bm(o)}catch(n){e=n}}),r.__H=void 0,e&&he.__e(e,r.__v))};var PO=typeof requestAnimationFrame=="function";function _q(t){var e,r=function(){clearTimeout(o),PO&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(r,100);PO&&(e=requestAnimationFrame(r))}function Bm(t){var e=Nt,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Nt=e}function Mv(t){var e=Nt;t.__c=t.__(),Nt=e}function Lv(t,e){return!t||t.length!==e.length||e.some(function(r,o){return r!==t[o]})}function NO(t,e){return typeof e=="function"?e(t):e}function $O(t,e){for(var r in e)t[r]=e[r];return t}function Fv(t,e){for(var r in t)if(r!=="__source"&&!(r in e))return!0;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return!0;return!1}function zv(t){this.props=t}function xq(t,e){function r(n){var a=this.props.ref,i=a==n.ref;return!i&&a&&(a.call?a(null):a.current=null),e?!e(this.props,n)||!i:Fv(this.props,n)}function o(n){return this.shouldComponentUpdate=r,Q(t,n)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(zv.prototype=new Vo).isPureReactComponent=!0,zv.prototype.shouldComponentUpdate=function(t,e){return Fv(this.props,t)||Fv(this.state,e)};var MO=he.__b;he.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),MO&&MO(t)};var bq=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function K(t){function e(r){var o=$O({},r);return delete o.ref,t(o,r.ref||null)}return e.$$typeof=bq,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var LO=function(t,e){return t==null?null:yo(yo(t).map(e))},so={map:LO,forEach:LO,count:function(t){return t?yo(t).length:0},only:function(t){var e=yo(t);if(e.length!==1)throw"Children.only";return e[0]},toArray:yo},yq=he.__e;he.__e=function(t,e,r,o){if(t.then){for(var n,a=e;a=a.__;)if((n=a.__c)&&n.__c)return e.__e==null&&(e.__e=r.__e,e.__k=r.__k),n.__c(t,e)}yq(t,e,r,o)};var BO=he.unmount;function jO(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=$O({},t)).__c!=null&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return jO(o,e,r)})),t}function qO(t,e,r){return t&&r&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return qO(o,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=r)),t}function Fm(){this.__u=0,this.t=null,this.__b=null}function GO(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function vq(t){var e,r,o;function n(a){if(e||(e=t()).then(function(i){r=i.default||i},function(i){o=i}),o)throw o;if(!r)throw e;return Q(r,a)}return n.displayName="Lazy",n.__f=!0,n}function Ed(){this.u=null,this.o=null}he.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),BO&&BO(t)},(Fm.prototype=new Vo).__c=function(t,e){var r=e.__c,o=this;o.t==null&&(o.t=[]),o.t.push(r);var n=GO(o.__v),a=!1,i=function(){a||(a=!0,r.__R=null,n?n(s):s())};r.__R=i;var s=function(){if(!--o.__u){if(o.state.__a){var l=o.state.__a;o.__v.__k[0]=qO(l,l.__c.__P,l.__c.__O)}var c;for(o.setState({__a:o.__b=null});c=o.t.pop();)c.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(i,i)},Fm.prototype.componentWillUnmount=function(){this.t=[]},Fm.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=jO(this.__b,r,o.__O=o.__P)}this.__b=null}var n=e.__a&&Q(Ae,null,t.fallback);return n&&(n.__u&=-33),[Q(Ae,null,e.__a?null:t.children),n]};var FO=function(t,e,r){if(++r[1]===r[0]&&t.o.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.o.size))for(r=t.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;t.u=r=r[2]}};function Iq(t){return this.getChildContext=function(){return t.context},t.children}function wq(t){var e=this,r=t.i;e.componentWillUnmount=function(){xi(null,e.l),e.l=null,e.i=null},e.i&&e.i!==r&&e.componentWillUnmount(),e.l||(e.i=r,e.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(o){this.childNodes.push(o),e.i.appendChild(o)},insertBefore:function(o,n){this.childNodes.push(o),e.i.appendChild(o)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),e.i.removeChild(o)}}),xi(Q(Iq,{context:e.context},t.__v),e.l)}function Uv(t,e){var r=Q(wq,{__v:t,i:e});return r.containerInfo=e,r}(Ed.prototype=new Vo).__a=function(t){var e=this,r=GO(e.__v),o=e.o.get(t);return o[0]++,function(n){var a=function(){e.props.revealOrder?(o.push(n),FO(e,t,o)):n()};r?r(a):a()}},Ed.prototype.render=function(t){this.u=null,this.o=new Map;var e=yo(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var r=e.length;r--;)this.o.set(e[r],this.u=[1,0,this.u]);return t.children},Ed.prototype.componentDidUpdate=Ed.prototype.componentDidMount=function(){var t=this;this.o.forEach(function(e,r){FO(t,r,e)})};var WO=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Eq=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Sq=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Cq=/[A-Z0-9]/g,kq=typeof document<"u",Tq=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function Pq(t,e,r){return e.__k==null&&(e.textContent=""),xi(t,e),typeof r=="function"&&r(),t?t.__c:null}function Oq(t,e,r){return Rv(t,e),typeof r=="function"&&r(),t?t.__c:null}Vo.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Vo.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var zO=he.event;function Aq(){}function Dq(){return this.cancelBubble}function Rq(){return this.defaultPrevented}he.event=function(t){return zO&&(t=zO(t)),t.persist=Aq,t.isPropagationStopped=Dq,t.isDefaultPrevented=Rq,t.nativeEvent=t};var Vv,Nq={enumerable:!1,configurable:!0,get:function(){return this.class}},UO=he.vnode;he.vnode=function(t){typeof t.type=="string"&&function(e){var r=e.props,o=e.type,n={};for(var a in r){var i=r[a];if(!(a==="value"&&"defaultValue"in r&&i==null||kq&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&i===!0?i="":s==="ondoubleclick"?a="ondblclick":s!=="onchange"||o!=="input"&&o!=="textarea"||Tq(r.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":Sq.test(a)?a=s:o.indexOf("-")===-1&&Eq.test(a)?a=a.replace(Cq,"-$&").toLowerCase():i===null&&(i=void 0):s=a="oninput",s==="oninput"&&n[a=s]&&(a="oninputCapture"),n[a]=i}}o=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=yo(r.children).forEach(function(l){l.props.selected=n.value.indexOf(l.props.value)!=-1})),o=="select"&&n.defaultValue!=null&&(n.value=yo(r.children).forEach(function(l){l.props.selected=n.multiple?n.defaultValue.indexOf(l.props.value)!=-1:n.defaultValue==l.props.value})),r.class&&!r.className?(n.class=r.class,Object.defineProperty(n,"className",Nq)):(r.className&&!r.class||r.class&&r.className)&&(n.class=n.className=r.className),e.props=n}(t),t.$$typeof=WO,UO&&UO(t)};var VO=he.__r;he.__r=function(t){VO&&VO(t),Vv=t.__c};var HO=he.diffed;he.diffed=function(t){HO&&HO(t);var e=t.props,r=t.__e;r!=null&&t.type==="textarea"&&"value"in e&&e.value!==r.value&&(r.value=e.value==null?"":e.value),Vv=null};var Mq={ReactCurrentDispatcher:{current:{readContext:function(t){return Vv.__n[t.__c].props.value}}}};function Lq(t){return Q.bind(null,t)}function yn(t){return!!t&&t.$$typeof===WO}function Bq(t){return yn(t)&&t.type===Ae}function vn(t){return yn(t)?Mm.apply(null,arguments):t}function Fq(t){return!!t.__k&&(xi(null,t),!0)}function zq(t){return t&&(t.base||t.nodeType===1&&t)||null}var Uq=function(t,e){return t(e)},Hv=function(t,e){return t(e)},Vq=Ae;function KO(t){t()}function Hq(t){return t}function $q(){return[!1,KO]}var jq=Er,qq=yn;function Gq(t,e){var r=e(),o=P({h:{__:r,v:e}}),n=o[0].h,a=o[1];return Er(function(){n.__=r,n.v=e,Bv(n)&&a({h:n})},[t,r,e]),L(function(){return Bv(n)&&a({h:n}),t(function(){Bv(n)&&a({h:n})})},[t]),r}function Bv(t){var e,r,o=t.v,n=t.__;try{var a=o();return!((e=n)===(r=a)&&(e!==0||1/e==1/r)||e!=e&&r!=r)}catch{return!0}}var E={useState:P,useId:RO,useReducer:Ko,useEffect:L,useLayoutEffect:Er,useInsertionEffect:jq,useTransition:$q,useDeferredValue:Hq,useSyncExternalStore:Gq,startTransition:KO,useRef:H,useImperativeHandle:AO,useMemo:Tt,useCallback:Ht,useContext:Mt,useDebugValue:DO,version:"17.0.2",Children:so,render:Pq,hydrate:Oq,unmountComponentAtNode:Fq,createPortal:Uv,createElement:Q,createContext:Rt,createFactory:Lq,cloneElement:vn,createRef:Ov,Fragment:Ae,isValidElement:yn,isElement:qq,isFragment:Bq,findDOMNode:zq,Component:Vo,PureComponent:zv,memo:xq,forwardRef:K,flushSync:Hv,unstable_batchedUpdates:Uq,StrictMode:Vq,Suspense:Fm,SuspenseList:Ed,lazy:vq,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Mq};function Wq(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function Kq(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Ql=function(){function t(r){var o=this;this._insertTag=function(n){var a;o.tags.length===0?o.insertionPoint?a=o.insertionPoint.nextSibling:o.prepend?a=o.container.firstChild:a=o.before:a=o.tags[o.tags.length-1].nextSibling,o.container.insertBefore(n,a),o.tags.push(n)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(o){o.forEach(this._insertTag)},e.insert=function(o){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Kq(this));var n=this.tags[this.tags.length-1];if(0)var a;if(this.isSpeedy){var i=Wq(n);try{i.insertRule(o,i.cssRules.length)}catch{}}else n.appendChild(document.createTextNode(o));this.ctr++},e.flush=function(){this.tags.forEach(function(o){return o.parentNode&&o.parentNode.removeChild(o)}),this.tags=[],this.ctr=0},t}();var qr="-ms-",Sd="-moz-",pt="-webkit-",zm="comm",Zl="rule",Jl="decl";var XO="@import";var Um="@keyframes";var YO=Math.abs,gs=String.fromCharCode,QO=Object.assign;function ZO(t,e){return ar(t,0)^45?(((e<<2^ar(t,0))<<2^ar(t,1))<<2^ar(t,2))<<2^ar(t,3):0}function Vm(t){return t.trim()}function $v(t,e){return(t=e.exec(t))?t[0]:t}function lt(t,e,r){return t.replace(e,r)}function Cd(t,e){return t.indexOf(e)}function ar(t,e){return t.charCodeAt(e)|0}function yi(t,e,r){return t.slice(e,r)}function vo(t){return t.length}function ec(t){return t.length}function tc(t,e){return e.push(t),t}function jv(t,e){return t.map(e).join("")}var Hm=1,rc=1,JO=0,Io=0,mr=0,nc="";function kd(t,e,r,o,n,a,i){return{value:t,root:e,parent:r,type:o,props:n,children:a,line:Hm,column:rc,length:i,return:""}}function ac(t,e){return QO(kd("",null,null,"",null,null,0),t,{length:-t.length},e)}function eA(){return mr}function tA(){return mr=Io>0?ar(nc,--Io):0,rc--,mr===10&&(rc=1,Hm--),mr}function wo(){return mr=Io<JO?ar(nc,Io++):0,rc++,mr===10&&(rc=1,Hm++),mr}function In(){return ar(nc,Io)}function Td(){return Io}function ic(t,e){return yi(nc,t,e)}function oc(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $m(t){return Hm=rc=1,JO=vo(nc=t),Io=0,[]}function jm(t){return nc="",t}function sc(t){return Vm(ic(Io-1,qv(t===91?t+2:t===40?t+1:t)))}function rA(t){for(;(mr=In())&&mr<33;)wo();return oc(t)>2||oc(mr)>3?"":" "}function oA(t,e){for(;--e&&wo()&&!(mr<48||mr>102||mr>57&&mr<65||mr>70&&mr<97););return ic(t,Td()+(e<6&&In()==32&&wo()==32))}function qv(t){for(;wo();)switch(mr){case t:return Io;case 34:case 39:t!==34&&t!==39&&qv(mr);break;case 40:t===41&&qv(t);break;case 92:wo();break}return Io}function nA(t,e){for(;wo()&&t+mr!==57;)if(t+mr===84&&In()===47)break;return"/*"+ic(e,Io-1)+"*"+gs(t===47?t:wo())}function aA(t){for(;!oc(In());)wo();return ic(t,Io)}function lA(t){return jm(qm("",null,null,null,[""],t=$m(t),0,[0],t))}function qm(t,e,r,o,n,a,i,s,l){for(var c=0,u=0,d=i,p=0,m=0,h=0,g=1,_=1,x=1,b=0,y="",I=n,w=a,v=o,T=y;_;)switch(h=b,b=wo()){case 40:if(h!=108&&ar(T,d-1)==58){Cd(T+=lt(sc(b),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:T+=sc(b);break;case 9:case 10:case 13:case 32:T+=rA(h);break;case 92:T+=oA(Td()-1,7);continue;case 47:switch(In()){case 42:case 47:tc(Xq(nA(wo(),Td()),e,r),l);break;default:T+="/"}break;case 123*g:s[c++]=vo(T)*x;case 125*g:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:m>0&&vo(T)-d&&tc(m>32?sA(T+";",o,r,d-1):sA(lt(T," ","")+";",o,r,d-2),l);break;case 59:T+=";";default:if(tc(v=iA(T,e,r,c,u,n,s,y,I=[],w=[],d),a),b===123)if(u===0)qm(T,e,v,v,I,a,d,s,w);else switch(p===99&&ar(T,3)===110?100:p){case 100:case 109:case 115:qm(t,v,v,o&&tc(iA(t,v,v,0,0,n,s,y,n,I=[],d),w),n,w,d,s,o?I:w);break;default:qm(T,v,v,v,[""],w,0,s,w)}}c=u=m=0,g=x=1,y=T="",d=i;break;case 58:d=1+vo(T),m=h;default:if(g<1){if(b==123)--g;else if(b==125&&g++==0&&tA()==125)continue}switch(T+=gs(b),b*g){case 38:x=u>0?1:(T+="\f",-1);break;case 44:s[c++]=(vo(T)-1)*x,x=1;break;case 64:In()===45&&(T+=sc(wo())),p=In(),u=d=vo(y=T+=aA(Td())),b++;break;case 45:h===45&&vo(T)==2&&(g=0)}}return a}function iA(t,e,r,o,n,a,i,s,l,c,u){for(var d=n-1,p=n===0?a:[""],m=ec(p),h=0,g=0,_=0;h<o;++h)for(var x=0,b=yi(t,d+1,d=YO(g=i[h])),y=t;x<m;++x)(y=Vm(g>0?p[x]+" "+b:lt(b,/&\f/g,p[x])))&&(l[_++]=y);return kd(t,e,r,n===0?Zl:s,l,c,u)}function Xq(t,e,r){return kd(t,e,r,zm,gs(eA()),yi(t,2,-2),0)}function sA(t,e,r,o){return kd(t,e,r,Jl,yi(t,0,o),yi(t,o+1,-1),o)}function _s(t,e){for(var r="",o=ec(t),n=0;n<o;n++)r+=e(t[n],n,t,e)||"";return r}function cA(t,e,r,o){switch(t.type){case XO:case Jl:return t.return=t.return||t.value;case zm:return"";case Um:return t.return=t.value+"{"+_s(t.children,o)+"}";case Zl:t.value=t.props.join(",")}return vo(r=_s(t.children,o))?t.return=t.value+"{"+r+"}":""}function uA(t){var e=ec(t);return function(r,o,n,a){for(var i="",s=0;s<e;s++)i+=t[s](r,o,n,a)||"";return i}}function dA(t){return function(e){e.root||(e=e.return)&&t(e)}}function Yq(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var fA=Yq;var Qq=function(e,r,o){for(var n=0,a=0;n=a,a=In(),n===38&&a===12&&(r[o]=1),!oc(a);)wo();return ic(e,Io)},Zq=function(e,r){var o=-1,n=44;do switch(oc(n)){case 0:n===38&&In()===12&&(r[o]=1),e[o]+=Qq(Io-1,r,o);break;case 2:e[o]+=sc(n);break;case 4:if(n===44){e[++o]=In()===58?"&\f":"",r[o]=e[o].length;break}default:e[o]+=gs(n)}while(n=wo());return e},Jq=function(e,r){return jm(Zq($m(e),r))},pA=new WeakMap,eG=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var r=e.value,o=e.parent,n=e.column===o.column&&e.line===o.line;o.type!=="rule";)if(o=o.parent,!o)return;if(!(e.props.length===1&&r.charCodeAt(0)!==58&&!pA.get(o))&&!n){pA.set(e,!0);for(var a=[],i=Jq(r,a),s=o.props,l=0,c=0;l<i.length;l++)for(var u=0;u<s.length;u++,c++)e.props[c]=a[l]?i[l].replace(/&\f/g,s[u]):s[u]+" "+i[l]}}},tG=function(e){if(e.type==="decl"){var r=e.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(e.return="",e.value="")}};function mA(t,e){switch(ZO(t,e)){case 5103:return pt+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return pt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return pt+t+Sd+t+qr+t+t;case 6828:case 4268:return pt+t+qr+t+t;case 6165:return pt+t+qr+"flex-"+t+t;case 5187:return pt+t+lt(t,/(\w+).+(:[^]+)/,pt+"box-$1$2"+qr+"flex-$1$2")+t;case 5443:return pt+t+qr+"flex-item-"+lt(t,/flex-|-self/,"")+t;case 4675:return pt+t+qr+"flex-line-pack"+lt(t,/align-content|flex-|-self/,"")+t;case 5548:return pt+t+qr+lt(t,"shrink","negative")+t;case 5292:return pt+t+qr+lt(t,"basis","preferred-size")+t;case 6060:return pt+"box-"+lt(t,"-grow","")+pt+t+qr+lt(t,"grow","positive")+t;case 4554:return pt+lt(t,/([^-])(transform)/g,"$1"+pt+"$2")+t;case 6187:return lt(lt(lt(t,/(zoom-|grab)/,pt+"$1"),/(image-set)/,pt+"$1"),t,"")+t;case 5495:case 3959:return lt(t,/(image-set\([^]*)/,pt+"$1$`$1");case 4968:return lt(lt(t,/(.+:)(flex-)?(.*)/,pt+"box-pack:$3"+qr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+pt+t+t;case 4095:case 3583:case 4068:case 2532:return lt(t,/(.+)-inline(.+)/,pt+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(vo(t)-1-e>6)switch(ar(t,e+1)){case 109:if(ar(t,e+4)!==45)break;case 102:return lt(t,/(.+:)(.+)-([^]+)/,"$1"+pt+"$2-$3$1"+Sd+(ar(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Cd(t,"stretch")?mA(lt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(ar(t,e+1)!==115)break;case 6444:switch(ar(t,vo(t)-3-(~Cd(t,"!important")&&10))){case 107:return lt(t,":",":"+pt)+t;case 101:return lt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+pt+(ar(t,14)===45?"inline-":"")+"box$3$1"+pt+"$2$3$1"+qr+"$2box$3")+t}break;case 5936:switch(ar(t,e+11)){case 114:return pt+t+qr+lt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return pt+t+qr+lt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return pt+t+qr+lt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return pt+t+qr+t+t}return t}var rG=function(e,r,o,n){if(e.length>-1&&!e.return)switch(e.type){case Jl:e.return=mA(e.value,e.length);break;case Um:return _s([ac(e,{value:lt(e.value,"@","@"+pt)})],n);case Zl:if(e.length)return jv(e.props,function(a){switch($v(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return _s([ac(e,{props:[lt(a,/:(read-\w+)/,":"+Sd+"$1")]})],n);case"::placeholder":return _s([ac(e,{props:[lt(a,/:(plac\w+)/,":"+pt+"input-$1")]}),ac(e,{props:[lt(a,/:(plac\w+)/,":"+Sd+"$1")]}),ac(e,{props:[lt(a,/:(plac\w+)/,qr+"input-$1")]})],n)}return""})}},oG=[rG],nG=function(e){var r=e.key;if(r==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(g){var _=g.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var n=e.stylisPlugins||oG,a={},i,s=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(g){for(var _=g.getAttribute("data-emotion").split(" "),x=1;x<_.length;x++)a[_[x]]=!0;s.push(g)});var l,c=[eG,tG];{var u,d=[cA,dA(function(g){u.insert(g)})],p=uA(c.concat(n,d)),m=function(_){return _s(lA(_),p)};l=function(_,x,b,y){u=b,m(_?_+"{"+x.styles+"}":x.styles),y&&(h.inserted[x.name]=!0)}}var h={key:r,sheet:new Ql({key:r,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:l};return h.sheet.hydrate(s),h},hA=nG;function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},ht.apply(this,arguments)}var _G=!0;var xG=function(e,r,o){var n=e.key+"-"+r.name;(o===!1||_G===!1)&&e.registered[n]===void 0&&(e.registered[n]=r.styles)},Qv=function(e,r,o){xG(e,r,o);var n=e.key+"-"+r.name;if(e.inserted[r.name]===void 0){var a=r;do{var i=e.insert(r===a?"."+n:"",a,e.sheet,!0);a=a.next}while(a!==void 0)}};function bG(t){for(var e=0,r,o=0,n=t.length;n>=4;++o,n-=4)r=t.charCodeAt(o)&255|(t.charCodeAt(++o)&255)<<8|(t.charCodeAt(++o)&255)<<16|(t.charCodeAt(++o)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(n){case 3:e^=(t.charCodeAt(o+2)&255)<<16;case 2:e^=(t.charCodeAt(o+1)&255)<<8;case 1:e^=t.charCodeAt(o)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var kA=bG;var yG={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},TA=yG;var vG=/[A-Z]|^ms/g,IG=/_EMO_([^_]+?)_([^]*?)_EMO_/g,DA=function(e){return e.charCodeAt(1)===45},PA=function(e){return e!=null&&typeof e!="boolean"},Zv=fA(function(t){return DA(t)?t:t.replace(vG,"-$&").toLowerCase()}),OA=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(IG,function(o,n,a){return ia={name:n,styles:a,next:ia},n})}return TA[e]!==1&&!DA(e)&&typeof r=="number"&&r!==0?r+"px":r};function Pd(t,e,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return ia={name:r.name,styles:r.styles,next:ia},r.name;if(r.styles!==void 0){var o=r.next;if(o!==void 0)for(;o!==void 0;)ia={name:o.name,styles:o.styles,next:ia},o=o.next;var n=r.styles+";";return n}return wG(t,e,r)}case"function":{if(t!==void 0){var a=ia,i=r(t);return ia=a,Pd(t,e,i)}break}case"string":if(0)var s,l;break}if(e==null)return r;var c=e[r];return c!==void 0?c:r}function wG(t,e,r){var o="";if(Array.isArray(r))for(var n=0;n<r.length;n++)o+=Pd(t,e,r[n])+";";else for(var a in r){var i=r[a];if(typeof i!="object")e!=null&&e[i]!==void 0?o+=a+"{"+e[i]+"}":PA(i)&&(o+=Zv(a)+":"+OA(a,i)+";");else if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var s=0;s<i.length;s++)PA(i[s])&&(o+=Zv(a)+":"+OA(a,i[s])+";");else{var l=Pd(t,e,i);switch(a){case"animation":case"animationName":{o+=Zv(a)+":"+l+";";break}default:o+=a+"{"+l+"}"}}}return o}var AA=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var ia,Jv=function(e,r,o){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";ia=void 0;var i=e[0];i==null||i.raw===void 0?(n=!1,a+=Pd(o,r,i)):a+=i[0];for(var s=1;s<e.length;s++)a+=Pd(o,r,e[s]),n&&(a+=i[s]);var l;AA.lastIndex=0;for(var c="",u;(u=AA.exec(a))!==null;)c+="-"+u[1];var d=kA(a)+c;return{name:d,styles:a,next:ia}};var SG={}.hasOwnProperty,RA=Rt(typeof HTMLElement<"u"?hA({key:"css"}):null),Dke=RA.Provider;var NA=function(e){return K(function(r,o){var n=Mt(RA);return e(r,n,o)})},MA=Rt({});var Vke=wv(CA());var lc=NA(function(t,e){var r=t.styles,o=Jv([r],void 0,Mt(MA)),n=H();return Er(function(){var a=e.key+"-global",i=new Ql({key:a,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+a+" "+o.name+'"]');return e.sheet.tags.length&&(i.before=e.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",a),i.hydrate([l])),n.current=[i,s],function(){i.flush()}},[e]),Er(function(){var a=n.current,i=a[0],s=a[1];if(s){a[1]=!1;return}if(o.next!==void 0&&Qv(e,o.next,!0),i.tags.length){var l=i.tags[i.tags.length-1].nextElementSibling;i.before=l,i.flush()}e.insert("",o,i,!1)},[e,o.name]),null});var CG=Object.defineProperty,kG=Object.defineProperties,TG=Object.getOwnPropertyDescriptors,LA=Object.getOwnPropertySymbols,PG=Object.prototype.hasOwnProperty,OG=Object.prototype.propertyIsEnumerable,BA=(t,e,r)=>e in t?CG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,AG=(t,e)=>{for(var r in e||(e={}))PG.call(e,r)&&BA(t,r,e[r]);if(LA)for(var r of LA(e))OG.call(e,r)&&BA(t,r,e[r]);return t},DG=(t,e)=>kG(t,TG(e));function FA({theme:t}){return E.createElement(lc,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},body:DG(AG({},t.fn.fontStyles()),{backgroundColor:t.colorScheme==="dark"?t.colors.dark[7]:t.white,color:t.colorScheme==="dark"?t.colors.dark[0]:t.black,lineHeight:t.lineHeight,fontSize:t.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function rh(t,e,r){Object.keys(e).forEach(o=>{t[`--mantine-${r}-${o}`]=typeof e[o]=="number"?`${e[o]}px`:e[o]})}function zA({theme:t}){let e={"--mantine-color-white":t.white,"--mantine-color-black":t.black,"--mantine-transition-timing-function":t.transitionTimingFunction,"--mantine-line-height":`${t.lineHeight}`,"--mantine-font-family":t.fontFamily,"--mantine-font-family-monospace":t.fontFamilyMonospace,"--mantine-font-family-headings":t.headings.fontFamily,"--mantine-heading-font-weight":`${t.headings.fontWeight}`};rh(e,t.shadows,"shadow"),rh(e,t.fontSizes,"font-size"),rh(e,t.radius,"radius"),rh(e,t.spacing,"spacing"),Object.keys(t.colors).forEach(o=>{t.colors[o].forEach((n,a)=>{e[`--mantine-color-${o}-${a}`]=n})});let r=t.headings.sizes;return Object.keys(r).forEach(o=>{e[`--mantine-${o}-font-size`]=`${r[o].fontSize}px`,e[`--mantine-${o}-line-height`]=`${r[o].lineHeight}`}),E.createElement(lc,{styles:{":root":e}})}var RG=Object.defineProperty,NG=Object.defineProperties,MG=Object.getOwnPropertyDescriptors,UA=Object.getOwnPropertySymbols,LG=Object.prototype.hasOwnProperty,BG=Object.prototype.propertyIsEnumerable,VA=(t,e,r)=>e in t?RG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xs=(t,e)=>{for(var r in e||(e={}))LG.call(e,r)&&VA(t,r,e[r]);if(UA)for(var r of UA(e))BG.call(e,r)&&VA(t,r,e[r]);return t},HA=(t,e)=>NG(t,MG(e));function FG(t,e){return e?Object.keys(t).reduce((r,o)=>{if(o==="headings"&&e.headings){let n=e.headings.sizes?Object.keys(t.headings.sizes).reduce((a,i)=>(a[i]=xs(xs({},t.headings.sizes[i]),e.headings.sizes[i]),a),{}):t.headings.sizes;return HA(xs({},r),{headings:HA(xs(xs({},t.headings),e.headings),{sizes:n})})}return r[o]=typeof e[o]=="object"?xs(xs({},t[o]),e[o]):typeof e[o]=="number"?e[o]:e[o]||t[o],r},{}):t}function $A(t,e){return Om(FG(t,e))}function jA(t){return Object.keys(t).reduce((e,r)=>(t[r]!==void 0&&(e[r]=t[r]),e),{})}var zG={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:"1px dotted ButtonText"},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"},"[hidden]":{display:"none"}};function qA(){return E.createElement(lc,{styles:zG})}var UG=Object.defineProperty,GA=Object.getOwnPropertySymbols,VG=Object.prototype.hasOwnProperty,HG=Object.prototype.propertyIsEnumerable,WA=(t,e,r)=>e in t?UG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qo=(t,e)=>{for(var r in e||(e={}))VG.call(e,r)&&WA(t,r,e[r]);if(GA)for(var r of GA(e))HG.call(e,r)&&WA(t,r,e[r]);return t},cc=Rt({theme:Am,styles:{},classNames:{},emotionOptions:{key:"mantine",prepend:!0},defaultProps:{}});function Lt(){var t;return((t=Mt(cc))==null?void 0:t.theme)||Am}function KA(t){let e=Mt(cc);return{styles:e.styles[t]||{},classNames:e.classNames[t]||{}}}function XA(){var t;return((t=Mt(cc))==null?void 0:t.emotionOptions)||{key:"mantine",prepend:!0}}function ue(t,e,r){var o,n;let a=((n=(o=Mt(cc))==null?void 0:o.defaultProps)==null?void 0:n[t])||{};return Qo(Qo(Qo({},e),a),jA(r))}function oh({theme:t,styles:e={},classNames:r={},defaultProps:o={},emotionOptions:n,withNormalizeCSS:a=!1,withGlobalStyles:i=!1,withCSSVariables:s=!1,inherit:l=!1,children:c}){let u=Mt(cc),d={themeOverride:l?Qo(Qo({},u.theme),t):t,emotionOptions:l?Qo(Qo({},u.emotionOptions),n):n,styles:l?Qo(Qo({},u.styles),e):e,classNames:l?Qo(Qo({},u.classNames),r):r,defaultProps:l?Qo(Qo({},u.defaultProps),o):o},p=$A(Am,d.themeOverride);return E.createElement(cc.Provider,{value:{theme:p,styles:d.styles,classNames:d.classNames,emotionOptions:d.emotionOptions,defaultProps:d.defaultProps}},a&&E.createElement(qA,null),i&&E.createElement(FA,{theme:p}),s&&E.createElement(zA,{theme:p}),c)}oh.displayName="@mantine/core/MantineProvider";var $G={app:100,modal:200,popover:300,overlay:400};function $t(t){return $G[t]}var YA=Object.getOwnPropertySymbols,jG=Object.prototype.hasOwnProperty,qG=Object.prototype.propertyIsEnumerable,GG=(t,e)=>{var r={};for(var o in t)jG.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&YA)for(var o of YA(t))e.indexOf(o)<0&&qG.call(t,o)&&(r[o]=t[o]);return r};function Gr(t){let e=t,{m:r,mx:o,my:n,mt:a,mb:i,ml:s,mr:l,p:c,px:u,py:d,pt:p,pb:m,pl:h,pr:g}=e,_=GG(e,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr"]),x={m:r,mx:o,my:n,mt:a,mb:i,ml:s,mr:l,p:c,px:u,py:d,pt:p,pb:m,pl:h,pr:g};return Object.keys(x).forEach(b=>{x[b]===void 0&&delete x[b]}),{systemStyles:x,rest:_}}function QA(t){let e={};return Object.keys(t).forEach(r=>{let[o,n]=t[r];e[o]=n}),e}function ZA(t){var e,r,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=ZA(t[e]))&&(o&&(o+=" "),o+=r);else for(e in t)t[e]&&(o&&(o+=" "),o+=e);return o}function JA(){for(var t=0,e,r,o="";t<arguments.length;)(e=arguments[t++])&&(r=ZA(e))&&(o&&(o+=" "),o+=r);return o}function WG(t){for(var e=0,r,o=0,n=t.length;n>=4;++o,n-=4)r=t.charCodeAt(o)&255|(t.charCodeAt(++o)&255)<<8|(t.charCodeAt(++o)&255)<<16|(t.charCodeAt(++o)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(n){case 3:e^=(t.charCodeAt(o+2)&255)<<16;case 2:e^=(t.charCodeAt(o+1)&255)<<8;case 1:e^=t.charCodeAt(o)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var eD=WG;var KG={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},tD=KG;function XG(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var rD=XG;var YG=/[A-Z]|^ms/g,QG=/_EMO_([^_]+?)_([^]*?)_EMO_/g,iD=function(e){return e.charCodeAt(1)===45},oD=function(e){return e!=null&&typeof e!="boolean"},eI=rD(function(t){return iD(t)?t:t.replace(YG,"-$&").toLowerCase()}),nD=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(QG,function(o,n,a){return sa={name:n,styles:a,next:sa},n})}return tD[e]!==1&&!iD(e)&&typeof r=="number"&&r!==0?r+"px":r};function Od(t,e,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return sa={name:r.name,styles:r.styles,next:sa},r.name;if(r.styles!==void 0){var o=r.next;if(o!==void 0)for(;o!==void 0;)sa={name:o.name,styles:o.styles,next:sa},o=o.next;var n=r.styles+";";return n}return ZG(t,e,r)}case"function":{if(t!==void 0){var a=sa,i=r(t);return sa=a,Od(t,e,i)}break}case"string":if(0)var s,l;break}if(e==null)return r;var c=e[r];return c!==void 0?c:r}function ZG(t,e,r){var o="";if(Array.isArray(r))for(var n=0;n<r.length;n++)o+=Od(t,e,r[n])+";";else for(var a in r){var i=r[a];if(typeof i!="object")e!=null&&e[i]!==void 0?o+=a+"{"+e[i]+"}":oD(i)&&(o+=eI(a)+":"+nD(a,i)+";");else if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var s=0;s<i.length;s++)oD(i[s])&&(o+=eI(a)+":"+nD(a,i[s])+";");else{var l=Od(t,e,i);switch(a){case"animation":case"animationName":{o+=eI(a)+":"+l+";";break}default:o+=a+"{"+l+"}"}}}return o}var aD=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var sa,sD=function(e,r,o){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";sa=void 0;var i=e[0];i==null||i.raw===void 0?(n=!1,a+=Od(o,r,i)):a+=i[0];for(var s=1;s<e.length;s++)a+=Od(o,r,e[s]),n&&(a+=i[s]);var l;aD.lastIndex=0;for(var c="",u;(u=aD.exec(a))!==null;)c+="-"+u[1];var d=eD(a)+c;return{name:d,styles:a,next:sa}};var JG=!0;function lD(t,e,r){var o="";return r.split(" ").forEach(function(n){t[n]!==void 0?e.push(t[n]+";"):o+=n+" "}),o}var cD=function(e,r,o){var n=e.key+"-"+r.name;if((o===!1||JG===!1)&&e.registered[n]===void 0&&(e.registered[n]=r.styles),e.inserted[r.name]===void 0){var a=r;do{var i=e.insert(r===a?"."+n:"",a,e.sheet,!0);a=a.next}while(a!==void 0)}};function uD(t,e){let r=H();return(!r.current||e.length!==r.current.prevDeps.length||r.current.prevDeps.map((o,n)=>o===e[n]).indexOf(!1)>=0)&&(r.current={v:t(),prevDeps:[...e]}),r.current.v}var Rr="-ms-",uc="-moz-",ct="-webkit-",nh="comm",dc="rule",fc="decl";var dD="@import";var ah="@keyframes";var fD=Math.abs,bs=String.fromCharCode,pD=Object.assign;function mD(t,e){return(((e<<2^Wr(t,0))<<2^Wr(t,1))<<2^Wr(t,2))<<2^Wr(t,3)}function ih(t){return t.trim()}function hD(t,e){return(t=e.exec(t))?t[0]:t}function ut(t,e,r){return t.replace(e,r)}function Ad(t,e){return t.indexOf(e)}function Wr(t,e){return t.charCodeAt(e)|0}function vi(t,e,r){return t.slice(e,r)}function Eo(t){return t.length}function pc(t){return t.length}function mc(t,e){return e.push(t),t}function gD(t,e){return t.map(e).join("")}var sh=1,hc=1,_D=0,So=0,hr=0,_c="";function Dd(t,e,r,o,n,a,i){return{value:t,root:e,parent:r,type:o,props:n,children:a,line:sh,column:hc,length:i,return:""}}function xc(t,e){return pD(Dd("",null,null,"",null,null,0),t,{length:-t.length},e)}function xD(){return hr}function bD(){return hr=So>0?Wr(_c,--So):0,hc--,hr===10&&(hc=1,sh--),hr}function Co(){return hr=So<_D?Wr(_c,So++):0,hc++,hr===10&&(hc=1,sh++),hr}function wn(){return Wr(_c,So)}function Rd(){return So}function bc(t,e){return vi(_c,t,e)}function gc(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function lh(t){return sh=hc=1,_D=Eo(_c=t),So=0,[]}function ch(t){return _c="",t}function yc(t){return ih(bc(So-1,tI(t===91?t+2:t===40?t+1:t)))}function yD(t){for(;(hr=wn())&&hr<33;)Co();return gc(t)>2||gc(hr)>3?"":" "}function vD(t,e){for(;--e&&Co()&&!(hr<48||hr>102||hr>57&&hr<65||hr>70&&hr<97););return bc(t,Rd()+(e<6&&wn()==32&&Co()==32))}function tI(t){for(;Co();)switch(hr){case t:return So;case 34:case 39:t!==34&&t!==39&&tI(hr);break;case 40:t===41&&tI(t);break;case 92:Co();break}return So}function ID(t,e){for(;Co()&&t+hr!==57;)if(t+hr===84&&wn()===47)break;return"/*"+bc(e,So-1)+"*"+bs(t===47?t:Co())}function wD(t){for(;!gc(wn());)Co();return bc(t,So)}function CD(t){return ch(uh("",null,null,null,[""],t=lh(t),0,[0],t))}function uh(t,e,r,o,n,a,i,s,l){for(var c=0,u=0,d=i,p=0,m=0,h=0,g=1,_=1,x=1,b=0,y="",I=n,w=a,v=o,T=y;_;)switch(h=b,b=Co()){case 40:if(h!=108&&T.charCodeAt(d-1)==58){Ad(T+=ut(yc(b),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:T+=yc(b);break;case 9:case 10:case 13:case 32:T+=yD(h);break;case 92:T+=vD(Rd()-1,7);continue;case 47:switch(wn()){case 42:case 47:mc(eW(ID(Co(),Rd()),e,r),l);break;default:T+="/"}break;case 123*g:s[c++]=Eo(T)*x;case 125*g:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:m>0&&Eo(T)-d&&mc(m>32?SD(T+";",o,r,d-1):SD(ut(T," ","")+";",o,r,d-2),l);break;case 59:T+=";";default:if(mc(v=ED(T,e,r,c,u,n,s,y,I=[],w=[],d),a),b===123)if(u===0)uh(T,e,v,v,I,a,d,s,w);else switch(p){case 100:case 109:case 115:uh(t,v,v,o&&mc(ED(t,v,v,0,0,n,s,y,n,I=[],d),w),n,w,d,s,o?I:w);break;default:uh(T,v,v,v,[""],w,0,s,w)}}c=u=m=0,g=x=1,y=T="",d=i;break;case 58:d=1+Eo(T),m=h;default:if(g<1){if(b==123)--g;else if(b==125&&g++==0&&bD()==125)continue}switch(T+=bs(b),b*g){case 38:x=u>0?1:(T+="\f",-1);break;case 44:s[c++]=(Eo(T)-1)*x,x=1;break;case 64:wn()===45&&(T+=yc(Co())),p=wn(),u=d=Eo(y=T+=wD(Rd())),b++;break;case 45:h===45&&Eo(T)==2&&(g=0)}}return a}function ED(t,e,r,o,n,a,i,s,l,c,u){for(var d=n-1,p=n===0?a:[""],m=pc(p),h=0,g=0,_=0;h<o;++h)for(var x=0,b=vi(t,d+1,d=fD(g=i[h])),y=t;x<m;++x)(y=ih(g>0?p[x]+" "+b:ut(b,/&\f/g,p[x])))&&(l[_++]=y);return Dd(t,e,r,n===0?dc:s,l,c,u)}function eW(t,e,r){return Dd(t,e,r,nh,bs(xD()),vi(t,2,-2),0)}function SD(t,e,r,o){return Dd(t,e,r,fc,vi(t,0,o),vi(t,o+1,-1),o)}function rI(t,e){switch(mD(t,e)){case 5103:return ct+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ct+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return ct+t+uc+t+Rr+t+t;case 6828:case 4268:return ct+t+Rr+t+t;case 6165:return ct+t+Rr+"flex-"+t+t;case 5187:return ct+t+ut(t,/(\w+).+(:[^]+)/,ct+"box-$1$2"+Rr+"flex-$1$2")+t;case 5443:return ct+t+Rr+"flex-item-"+ut(t,/flex-|-self/,"")+t;case 4675:return ct+t+Rr+"flex-line-pack"+ut(t,/align-content|flex-|-self/,"")+t;case 5548:return ct+t+Rr+ut(t,"shrink","negative")+t;case 5292:return ct+t+Rr+ut(t,"basis","preferred-size")+t;case 6060:return ct+"box-"+ut(t,"-grow","")+ct+t+Rr+ut(t,"grow","positive")+t;case 4554:return ct+ut(t,/([^-])(transform)/g,"$1"+ct+"$2")+t;case 6187:return ut(ut(ut(t,/(zoom-|grab)/,ct+"$1"),/(image-set)/,ct+"$1"),t,"")+t;case 5495:case 3959:return ut(t,/(image-set\([^]*)/,ct+"$1$`$1");case 4968:return ut(ut(t,/(.+:)(flex-)?(.*)/,ct+"box-pack:$3"+Rr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ct+t+t;case 4095:case 3583:case 4068:case 2532:return ut(t,/(.+)-inline(.+)/,ct+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Eo(t)-1-e>6)switch(Wr(t,e+1)){case 109:if(Wr(t,e+4)!==45)break;case 102:return ut(t,/(.+:)(.+)-([^]+)/,"$1"+ct+"$2-$3$1"+uc+(Wr(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Ad(t,"stretch")?rI(ut(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Wr(t,e+1)!==115)break;case 6444:switch(Wr(t,Eo(t)-3-(~Ad(t,"!important")&&10))){case 107:return ut(t,":",":"+ct)+t;case 101:return ut(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ct+(Wr(t,14)===45?"inline-":"")+"box$3$1"+ct+"$2$3$1"+Rr+"$2box$3")+t}break;case 5936:switch(Wr(t,e+11)){case 114:return ct+t+Rr+ut(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return ct+t+Rr+ut(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return ct+t+Rr+ut(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return ct+t+Rr+t+t}return t}function Ii(t,e){for(var r="",o=pc(t),n=0;n<o;n++)r+=e(t[n],n,t,e)||"";return r}function kD(t,e,r,o){switch(t.type){case dD:case fc:return t.return=t.return||t.value;case nh:return"";case ah:return t.return=t.value+"{"+Ii(t.children,o)+"}";case dc:t.value=t.props.join(",")}return Eo(r=Ii(t.children,o))?t.return=t.value+"{"+r+"}":""}function TD(t){var e=pc(t);return function(r,o,n,a){for(var i="",s=0;s<e;s++)i+=t[s](r,o,n,a)||"";return i}}function PD(t){return function(e){e.root||(e=e.return)&&t(e)}}function OD(t,e,r,o){if(t.length>-1&&!t.return)switch(t.type){case fc:t.return=rI(t.value,t.length);break;case ah:return Ii([xc(t,{value:ut(t.value,"@","@"+ct)})],o);case dc:if(t.length)return gD(t.props,function(n){switch(hD(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ii([xc(t,{props:[ut(n,/:(read-\w+)/,":"+uc+"$1")]})],o);case"::placeholder":return Ii([xc(t,{props:[ut(n,/:(plac\w+)/,":"+ct+"input-$1")]}),xc(t,{props:[ut(n,/:(plac\w+)/,":"+uc+"$1")]}),xc(t,{props:[ut(n,/:(plac\w+)/,Rr+"input-$1")]})],o)}return""})}}var tW=function(e,r,o){for(var n=0,a=0;n=a,a=wn(),n===38&&a===12&&(r[o]=1),!gc(a);)Co();return bc(e,So)},rW=function(e,r){var o=-1,n=44;do switch(gc(n)){case 0:n===38&&wn()===12&&(r[o]=1),e[o]+=tW(So-1,r,o);break;case 2:e[o]+=yc(n);break;case 4:if(n===44){e[++o]=wn()===58?"&\f":"",r[o]=e[o].length;break}default:e[o]+=bs(n)}while(n=Co());return e},oW=function(e,r){return ch(rW(lh(e),r))},AD=new WeakMap,nW=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var r=e.value,o=e.parent,n=e.column===o.column&&e.line===o.line;o.type!=="rule";)if(o=o.parent,!o)return;if(!(e.props.length===1&&r.charCodeAt(0)!==58&&!AD.get(o))&&!n){AD.set(e,!0);for(var a=[],i=oW(r,a),s=o.props,l=0,c=0;l<i.length;l++)for(var u=0;u<s.length;u++,c++)e.props[c]=a[l]?i[l].replace(/&\f/g,s[u]):s[u]+" "+i[l]}}},aW=function(e){if(e.type==="decl"){var r=e.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(e.return="",e.value="")}};var iW=[OD],sW=function(e){var r=e.key;if(r==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(g){var _=g.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var n=e.stylisPlugins||iW,a={},i,s=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(g){for(var _=g.getAttribute("data-emotion").split(" "),x=1;x<_.length;x++)a[_[x]]=!0;s.push(g)});var l,c=[nW,aW];{var u,d=[kD,PD(function(g){u.insert(g)})],p=TD(c.concat(n,d)),m=function(_){return Ii(CD(_),p)};l=function(_,x,b,y){u=b,m(_?_+"{"+x.styles+"}":x.styles),y&&(h.inserted[x.name]=!0)}}var h={key:r,sheet:new Ql({key:r,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:l};return h.sheet.hydrate(s),h},DD=sW;var RD={key:"mantine",prepend:!0},{getCache:lW}=(()=>{let t,e=RD.key;function r(o){return(t===void 0||e!==o?.key)&&(e=o?.key||"mantine",t=DD(o?.key?o:RD)),t}return{getCache:r}})();function ND(){let t=XA();return lW(t)}var cW=Object.defineProperty,MD=Object.getOwnPropertySymbols,uW=Object.prototype.hasOwnProperty,dW=Object.prototype.propertyIsEnumerable,LD=(t,e,r)=>e in t?cW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fW=(t,e)=>{for(var r in e||(e={}))uW.call(e,r)&&LD(t,r,e[r]);if(MD)for(var r of MD(e))dW.call(e,r)&&LD(t,r,e[r]);return t},oI="ref";function pW(t){let e;if(t.length!==1)return{args:t,ref:e};let[r]=t;if(!(r instanceof Object))return{args:t,ref:e};if(!(oI in r))return{args:t,ref:e};e=r[oI];let o=fW({},r);return delete o[oI],{args:[o],ref:e}}var{cssFactory:mW}=(()=>{function t(r,o,n){let a=[],i=lD(r,a,n);return a.length<2?n:i+o(a)}function e(r){let{cache:o}=r,n=(...i)=>{let{ref:s,args:l}=pW(i),c=sD(l,o.registered);return cD(o,c,!1),`${o.key}-${c.name}${s===void 0?"":` ${s}`}`};return{css:n,cx:(...i)=>t(o.registered,n,JA(i))}}return{cssFactory:e}})();function Nd(){let t=ND();return uD(()=>mW({cache:t}),[t])}function BD(t,e,r,o,n){return Object.keys(e).reduce((a,i)=>(a[i]=t(e[i],r!==null&&r[i],o!=null&&o[i],n?`mantine-${n}-${i}`:null),a),{})}function oe(t){let e=typeof t=="function"?t:()=>t;function r(o,n){let a=Lt(),{styles:i,classNames:s}=KA(n?.name),{css:l,cx:c}=Nd();function u(g){return`__mantine-ref-${g||""}`}let d=e(a,o,u),p=typeof n?.styles=="function"?n?.styles(a):n?.styles||{},m=typeof i=="function"?i(a,o||{}):i||{},h=QA(Object.keys(d).map(g=>{let _=c(l(d[g]),l(m[g]),l(p[g]));return[g,_]}));return{classes:BD(c,h,s,n?.classNames,n?.name),cx:c,theme:a}}return r}var hW=Object.defineProperty,gW=Object.defineProperties,_W=Object.getOwnPropertyDescriptors,FD=Object.getOwnPropertySymbols,xW=Object.prototype.hasOwnProperty,bW=Object.prototype.propertyIsEnumerable,zD=(t,e,r)=>e in t?hW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Md=(t,e)=>{for(var r in e||(e={}))xW.call(e,r)&&zD(t,r,e[r]);if(FD)for(var r of FD(e))bW.call(e,r)&&zD(t,r,e[r]);return t},Ld=(t,e)=>gW(t,_W(e)),Bd={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(.9) translateY(10px)"},transitionProperty:"transform, opacity"},Fd={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Ld(Md({},Bd),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Ld(Md({},Bd),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Ld(Md({},Bd),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Ld(Md({},Bd),{common:{transformOrigin:"top left"}}),"pop-top-right":Ld(Md({},Bd),{common:{transformOrigin:"top right"}})};function dh(t,e){return so.toArray(t).filter(r=>Array.isArray(e)?e.some(o=>o===r.type):r.type===e)}function UD(t){return so.toArray(t).filter(Boolean)}function fh({data:t}){let e=[],r=[],o=t.reduce((n,a,i)=>(a.group?n[a.group]?n[a.group].push(i):n[a.group]=[i]:r.push(i),n),{});return Object.keys(o).forEach(n=>{e.push(...o[n].map(a=>t[a]))}),e.push(...r.map(n=>t[n])),e}function yW(t,e){let r=t;for(;(r=r.parentElement)&&!r.classList.contains(e););return r}function VD(t,e){return e?Array.from(yW(e,t.parentClassName).querySelectorAll(t.elementSelector)).findIndex(r=>r===e):-1}function HD(t){let e=Rt(t);function r(o){let n=Mt(e),[a]=o.split(".");if(!n)throw new Error(`${o} component was rendered outside of ${a} component context`);return n}return[e.Provider,r]}var $D=(t,e,r)=>Number.isInteger(t)&&t>=0&&e===0?"numeric":!Number.isInteger(t)&&t>=0&&e!==0?"decimal":Number.isInteger(t)&&t<0&&e===0||!Number.isInteger(t)&&t<0&&e!==0?r==="ios"?"text":"decimal":"numeric";var jD=["mousedown","touchstart"];function nI(t,e,r){let o=H();return L(()=>{let n=a=>{var i;if(Array.isArray(r)){let s=(i=a?.target)==null?void 0:i.hasAttribute("data-ignore-outside-clicks");r.every(c=>!!c&&!c.contains(a.target))&&!s&&t()}else o.current&&!o.current.contains(a.target)&&t()};return(e||jD).forEach(a=>document.addEventListener(a,n)),()=>{(e||jD).forEach(a=>document.removeEventListener(a,n))}},[o,t,r]),o}function vW(t,e){try{return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}catch{return t.addListener(e),()=>t.removeListener(e)}}function IW(t,e){return e!==void 0?e:typeof window<"u"&&"matchMedia"in window?window.matchMedia(t).matches:!1}function qD(t,e){let[r,o]=P(IW(t,e)),n=H();return L(()=>{if("matchMedia"in window)return n.current=window.matchMedia(t),o(n.current.matches),vW(n.current,a=>o(a.matches))},[t]),r}var zd=typeof document<"u"?Er:L;function Yt(t,e){let r=H(!1);L(()=>{r.current?t():r.current=!0},e)}function aI({opened:t,transitionDuration:e,shouldReturnFocus:r=!0}){let o=H(),n=()=>{var a;o.current&&"focus"in o.current&&typeof o.current.focus=="function"&&((a=o.current)==null||a.focus())};return Yt(()=>{let a=-1,i=s=>{s.code==="Tab"&&window.clearTimeout(a)};return document.addEventListener("keydown",i),t?o.current=document.activeElement:r&&(a=window.setTimeout(n,e+10)),()=>{window.clearTimeout(a),document.removeEventListener("keydown",i)}},[t]),n}var wW=/input|select|textarea|button|object/,iI="a, input, select, textarea, button, object, [tabindex]";function EW(t){return t.style.display==="none"}function SW(t){if(t.getAttribute("aria-hidden")||t.getAttribute("hidden")||t.getAttribute("type")==="hidden")return!1;let r=t;for(;r&&r!==document.body;){if(EW(r))return!1;r=r.parentNode}return!0}function GD(t){let e=t.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function ph(t){let e=t.nodeName.toLowerCase(),r=!Number.isNaN(GD(t));return(wW.test(e)&&!t.disabled||t instanceof HTMLAnchorElement&&t.href||r)&&SW(t)}function sI(t){let e=GD(t);return(Number.isNaN(e)||e>=0)&&ph(t)}function WD(t){return Array.from(t.querySelectorAll(iI)).filter(sI)}function KD(t,e){let r=WD(t);if(!r.length){e.preventDefault();return}if(!(r[e.shiftKey?0:r.length-1]===document.activeElement||t===document.activeElement))return;e.preventDefault();let a=r[e.shiftKey?r.length-1:0];a&&a.focus()}function XD(t,e="body > :not(script)"){let r=Array.from(document.querySelectorAll(e)).map(o=>{if(o.contains(t))return;let n=o.getAttribute("aria-hidden");return(n===null||n==="false")&&o.setAttribute("aria-hidden","true"),{node:o,ariaHidden:n}});return()=>{r.forEach(o=>{o&&(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden))})}}function lI(t=!0){let e=H(),r=H(null),o=Ht(n=>{if(t)if(r.current&&r.current(),n){let a=i=>{r.current=XD(i);let s=n.querySelector("[data-autofocus]");if(!s){let l=Array.from(n.querySelectorAll(iI));s=l.find(sI)||l.find(ph)||null,!s&&ph(n)&&(s=n)}s&&s.focus()};setTimeout(()=>{n.ownerDocument&&a(n)}),e.current=n}else e.current=null},[t]);return L(()=>{if(!t)return;let n=a=>{a.key==="Tab"&&e.current&&KD(e.current,a)};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[t]),o}var CW=t=>(t+1)%1e6;function cI(){let[,t]=Ko(CW,0);return t}function Ba(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function Fa(t,e,r){L(()=>(window.addEventListener(t,e,r),()=>window.removeEventListener(t,e,r)),[])}function kW(t){try{return JSON.stringify(t)}catch{throw new Error("@mantine/hooks use-local-storage: Failed to serialize the value")}}function TW(t){try{return JSON.parse(t)}catch{return t}}function uI({key:t,defaultValue:e=void 0,getInitialValueInEffect:r=!1,deserialize:o=TW,serialize:n=kW}){var a;let[i,s]=P(typeof window<"u"&&"localStorage"in window&&!r?o((a=window.localStorage.getItem(t))!=null?a:void 0):e??""),l=Ht(c=>{c instanceof Function?s(u=>{let d=c(u);return window.localStorage.setItem(t,n(d)),window.dispatchEvent(new CustomEvent("mantine-local-storage",{detail:{key:t,value:c(u)}})),d}):(window.localStorage.setItem(t,n(c)),window.dispatchEvent(new CustomEvent("mantine-local-storage",{detail:{key:t,value:c}})),s(c))},[t]);return Fa("storage",c=>{var u;c.storageArea===window.localStorage&&c.key===t&&s(o((u=c.newValue)!=null?u:void 0))}),Fa("mantine-local-storage",c=>{c.detail.key===t&&s(c.detail.value)}),L(()=>{e!==void 0&&i===void 0&&l(e)},[e,i,l]),L(()=>{var c;r&&s(o((c=window.localStorage.getItem(t))!=null?c:void 0)||(e??""))},[]),[i===void 0?e:i,l]}function vc(t,e){typeof t=="function"?t(e):typeof t=="object"&&t!==null&&"current"in t&&(t.current=e)}function ko(...t){return Ht(e=>{t.forEach(r=>vc(r,e))},t)}function ys(...t){return e=>{t.forEach(r=>vc(r,e))}}function vs({value:t,min:e,max:r}){return Math.min(Math.max(t,e),r)}function Zo({value:t,defaultValue:e,finalValue:r,rule:o,onChange:n,onValueUpdate:a}){let i=o(t),s=H("initial"),l=o(e)?e:r,[c,u]=P(l),d=i?t:c;!i&&s.current==="controlled"&&(d=r),s.current=i?"controlled":"uncontrolled";let p=s.current,m=h=>{typeof n=="function"&&n(h),p==="uncontrolled"&&u(h)};return L(()=>{p==="uncontrolled"&&u(d),typeof a=="function"&&a(d)},[p,d]),[d,m,s.current]}function dI({initialValues:t=[],limit:e}){let[{state:r,queue:o},n]=P({state:t.slice(0,e),queue:t.slice(e)});return{state:r,queue:o,add:(...l)=>n(c=>{let u=[...c.state,...c.queue,...l];return{state:u.slice(0,e),queue:u.slice(e)}}),update:l=>n(c=>{let u=l([...c.state,...c.queue]);return{state:u.slice(0,e),queue:u.slice(e)}}),cleanQueue:()=>n(l=>({state:l.state,queue:[]}))}}function Vn(t){return qD("(prefers-reduced-motion: reduce)",t)}var YD=t=>t<.5?2*t*t:-1+(4-2*t)*t;var QD=({axis:t,target:e,parent:r,alignment:o,offset:n,isList:a})=>{if(!e||!r&&typeof document>"u")return 0;let i=!!r,l=(r||document.body).getBoundingClientRect(),c=e.getBoundingClientRect(),u=d=>c[d]-l[d];if(t==="y"){let d=u("top");if(d===0)return 0;if(o==="start"){let m=d-n;return m<=c.height*(a?0:1)||!a?m:0}let p=i?l.height:window.innerHeight;if(o==="end"){let m=d+n-p+c.height;return m>=-c.height*(a?0:1)||!a?m:0}return o==="center"?d-p/2+c.height/2:0}if(t==="x"){let d=u("left");if(d===0)return 0;if(o==="start"){let m=d-n;return m<=c.width||!a?m:0}let p=i?l.width:window.innerWidth;if(o==="end"){let m=d+n-p+c.width;return m>=-c.width||!a?m:0}return o==="center"?d-p/2+c.width/2:0}return 0};var ZD=({axis:t,parent:e})=>{if(!e&&typeof document>"u")return 0;let r=t==="y"?"scrollTop":"scrollLeft";if(e)return e[r];let{body:o,documentElement:n}=document;return o[r]+n[r]};var JD=({axis:t,parent:e,distance:r})=>{if(!e&&typeof document>"u")return;let o=t==="y"?"scrollTop":"scrollLeft";if(e)e[o]=r;else{let{body:n,documentElement:a}=document;n[o]=r,a[o]=r}};function Ud({duration:t=1250,axis:e="y",onScrollFinish:r,easing:o=YD,offset:n=0,cancelable:a=!0,isList:i=!1}={}){let s=H(0),l=H(0),c=H(!1),u=H(null),d=H(null),p=Vn(),m=()=>{s.current&&cancelAnimationFrame(s.current)},h=Ht(({alignment:_="start"}={})=>{var x;c.current=!1,s.current&&m();let b=(x=ZD({parent:u.current,axis:e}))!=null?x:0,y=QD({parent:u.current,target:d.current,axis:e,alignment:_,offset:n,isList:i})-(u.current?0:b);function I(){l.current===0&&(l.current=performance.now());let v=performance.now()-l.current,T=p||t===0?1:v/t,O=b+y*o(T);JD({parent:u.current,axis:e,distance:O}),!c.current&&T<1?s.current=requestAnimationFrame(I):(typeof r=="function"&&r(),l.current=0,s.current=0,m())}I()},[u.current]),g=()=>{a&&(c.current=!0)};return Fa("wheel",g,{passive:!0}),Fa("touchmove",g,{passive:!0}),L(()=>m,[]),{scrollableRef:u,targetRef:d,scrollIntoView:h,cancel:m}}function eR(){if(typeof window>"u"||typeof document>"u")return 0;let t=parseInt(window.getComputedStyle(document.body).paddingRight,10),e=window.innerWidth-document.documentElement.clientWidth;return t+e}var tR=({disableBodyPadding:t})=>{let e=t?null:eR();return`body {
|
|
2
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),k=M,G=V),U===void 0&&(U=!0);let Z={code:G,language:k};z("before:highlight",Z);let te=Z.result?Z.result:d(Z.language,Z.code,U);return te.code=Z.code,z("after:highlight",te),te}function d(M,V,U,G){let k=Object.create(null);function Z(W,D){return W.keywords[D]}function te(){if(!fe.keywords){ft.addText(Be);return}let W=0;fe.keywordPatternRe.lastIndex=0;let D=fe.keywordPatternRe.exec(Be),$="";for(;D;){$+=Be.substring(W,D.index);let J=ot.case_insensitive?D[0].toLowerCase():D[0],ye=Z(fe,J);if(ye){let[je,nt]=ye;if(ft.addText($),$="",k[J]=(k[J]||0)+1,k[J]<=dbe&&(wr+=nt),je.startsWith("_"))$+=D[0];else{let Fo=ot.classNameAliases[je]||je;ft.addKeyword(D[0],Fo)}}else $+=D[0];W=fe.keywordPatternRe.lastIndex,D=fe.keywordPatternRe.exec(Be)}$+=Be.substring(W),ft.addText($)}function A(){if(Be==="")return;let W=null;if(typeof fe.subLanguage=="string"){if(!e[fe.subLanguage]){ft.addText(Be);return}W=d(fe.subLanguage,Be,!0,go[fe.subLanguage]),go[fe.subLanguage]=W._top}else W=m(Be,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(wr+=W.relevance),ft.addSublanguage(W._emitter,W.language)}function ce(){fe.subLanguage!=null?A():te(),Be=""}function Se(W,D){let $=1,J=D.length-1;for(;$<=J;){if(!W._emit[$]){$++;continue}let ye=ot.classNameAliases[W[$]]||W[$],je=D[$];ye?ft.addKeyword(je,ye):(Be=je,te(),Be=""),$++}}function Ge(W,D){return W.scope&&typeof W.scope=="string"&&ft.openNode(ot.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(ft.addKeyword(Be,ot.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Be=""):W.beginScope._multi&&(Se(W.beginScope,D),Be="")),fe=Object.create(W,{parent:{value:fe}}),fe}function et(W,D,$){let J=Txe(W.endRe,$);if(J){if(W["on:end"]){let ye=new Gb(W);W["on:end"](D,ye),ye.isMatchIgnored&&(J=!1)}if(J){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return et(W.parent,D,$)}function Oe(W){return fe.matcher.regexIndex===0?(Be+=W[0],1):(_e=!0,0)}function be(W){let D=W[0],$=W.rule,J=new Gb($),ye=[$.__beforeBegin,$["on:begin"]];for(let je of ye)if(je&&(je(W,J),J.isMatchIgnored))return Oe(D);return $.skip?Be+=D:($.excludeBegin&&(Be+=D),ce(),!$.returnBegin&&!$.excludeBegin&&(Be=D)),Ge($,W),$.returnBegin?0:D.length}function st(W){let D=W[0],$=V.substring(W.index),J=et(fe,W,$);if(!J)return m8;let ye=fe;fe.endScope&&fe.endScope._wrap?(ce(),ft.addKeyword(D,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(ce(),Se(fe.endScope,W)):ye.skip?Be+=D:(ye.returnEnd||ye.excludeEnd||(Be+=D),ce(),ye.excludeEnd&&(Be=D));do fe.scope&&ft.closeNode(),!fe.skip&&!fe.subLanguage&&(wr+=fe.relevance),fe=fe.parent;while(fe!==J.parent);return J.starts&&Ge(J.starts,W),ye.returnEnd?0:D.length}function wt(){let W=[];for(let D=fe;D!==ot;D=D.parent)D.scope&&W.unshift(D.scope);W.forEach(D=>ft.openNode(D))}let mt={};function zt(W,D){let $=D&&D[0];if(Be+=W,$==null)return ce(),0;if(mt.type==="begin"&&D.type==="end"&&mt.index===D.index&&$===""){if(Be+=V.slice(D.index,D.index+1),!n){let J=new Error(`0 width match regex (${M})`);throw J.languageName=M,J.badRule=mt.rule,J}return 1}if(mt=D,D.type==="begin")return be(D);if(D.type==="illegal"&&!U){let J=new Error('Illegal lexeme "'+$+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw J.mode=fe,J}else if(D.type==="end"){let J=st(D);if(J!==m8)return J}if(D.type==="illegal"&&$==="")return 1;if(Vr>1e5&&Vr>D.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=$,$.length}let ot=S(M);if(!ot)throw Tl(a.replace("{}",M)),new Error('Unknown language: "'+M+'"');let ao=lbe(ot),dt="",fe=G||ao,go={},ft=new s.__emitter(s);wt();let Be="",wr=0,fr=0,Vr=0,_e=!1;try{for(fe.matcher.considerAll();;){Vr++,_e?_e=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=fr;let W=fe.matcher.exec(V);if(!W)break;let D=V.substring(fr,W.index),$=zt(D,W);fr=W.index+$}return zt(V.substring(fr)),ft.closeAllNodes(),ft.finalize(),dt=ft.toHTML(),{language:M,value:dt,relevance:wr,illegal:!1,_emitter:ft,_top:fe}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:M,value:RC(V),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:fr,context:V.slice(fr-100,fr+100),mode:W.mode,resultSoFar:dt},_emitter:ft};if(n)return{language:M,value:RC(V),illegal:!1,relevance:0,errorRaised:W,_emitter:ft,_top:fe};throw W}}function p(M){let V={value:RC(M),illegal:!1,relevance:0,_top:i,_emitter:new s.__emitter(s)};return V._emitter.addText(M),V}function m(M,V){V=V||s.languages||Object.keys(e);let U=p(M),G=V.filter(S).filter(F).map(ce=>d(ce,M,!1));G.unshift(U);let k=G.sort((ce,Se)=>{if(ce.relevance!==Se.relevance)return Se.relevance-ce.relevance;if(ce.language&&Se.language){if(S(ce.language).supersetOf===Se.language)return 1;if(S(Se.language).supersetOf===ce.language)return-1}return 0}),[Z,te]=k,A=Z;return A.secondBest=te,A}function h(M,V,U){let G=V&&r[V]||U;M.classList.add("hljs"),M.classList.add(`language-${G}`)}function g(M){let V=null,U=c(M);if(l(U))return;if(z("before:highlightElement",{el:M,language:U}),M.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(M)),s.throwUnescapedHTML))throw new BC("One of your code blocks includes unescaped HTML.",M.innerHTML);V=M;let G=V.textContent,k=U?u(G,{language:U,ignoreIllegals:!0}):m(G);M.innerHTML=k.value,h(M,U,k.language),M.result={language:k.language,re:k.relevance,relevance:k.relevance},k.secondBest&&(M.secondBest={language:k.secondBest.language,relevance:k.secondBest.relevance}),z("after:highlightElement",{el:M,result:k,text:G})}function _(M){s=p8(s,M)}let x=()=>{I(),Fu("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){I(),Fu("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let y=!1;function I(){if(document.readyState==="loading"){y=!0;return}document.querySelectorAll(s.cssSelector).forEach(g)}function w(){y&&I()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",w,!1);function v(M,V){let U=null;try{U=V(t)}catch(G){if(Tl("Language definition for '{}' could not be registered.".replace("{}",M)),n)Tl(G);else throw G;U=i}U.name||(U.name=M),e[M]=U,U.rawDefinition=V.bind(null,t),U.aliases&&C(U.aliases,{languageName:M})}function T(M){delete e[M];for(let V of Object.keys(r))r[V]===M&&delete r[V]}function O(){return Object.keys(e)}function S(M){return M=(M||"").toLowerCase(),e[M]||e[r[M]]}function C(M,{languageName:V}){typeof M=="string"&&(M=[M]),M.forEach(U=>{r[U.toLowerCase()]=V})}function F(M){let V=S(M);return V&&!V.disableAutodetect}function N(M){M["before:highlightBlock"]&&!M["before:highlightElement"]&&(M["before:highlightElement"]=V=>{M["before:highlightBlock"](Object.assign({block:V.el},V))}),M["after:highlightBlock"]&&!M["after:highlightElement"]&&(M["after:highlightElement"]=V=>{M["after:highlightBlock"](Object.assign({block:V.el},V))})}function R(M){N(M),o.push(M)}function z(M,V){let U=M;o.forEach(function(G){G[U]&&G[U](V)})}function B(M){return Fu("10.7.0","highlightBlock will be removed entirely in v12.0"),Fu("10.7.0","Please use highlightElement now."),g(M)}Object.assign(t,{highlight:u,highlightAuto:m,highlightAll:I,highlightElement:g,highlightBlock:B,configure:_,initHighlighting:x,initHighlightingOnLoad:b,registerLanguage:v,unregisterLanguage:T,listLanguages:O,getLanguage:S,registerAliases:C,autoDetection:F,inherit:p8,addPlugin:R}),t.debugMode=function(){n=!1},t.safeMode=function(){n=!0},t.versionString=ube,t.regex={concat:Pl,lookahead:g8,either:UC,optional:Cxe,anyNumberOfTimes:Sxe};for(let M in qb)typeof qb[M]=="object"&&FC.exports(qb[M]);return Object.assign(t,qb),t},Jp=fbe({});S8.exports=Jp;Jp.HighlightJS=Jp;Jp.default=Jp});var T8=$e((eXe,k8)=>{"use strict";function pbe(t){let e=t.regex,r=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,n={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=t.inherit(a,{begin:/\(/,end:/\)/}),s=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[n]},{begin:/'/,end:/'/,contains:[n]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,l,s,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,i,l,s]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},n,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(r,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}k8.exports=pbe});var O8=$e((tXe,P8)=>{"use strict";function mbe(t){let e=t.regex,r={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});let n={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},i={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,n]};n.contains.push(i);let s={className:"",begin:/\\"/},l={className:"string",begin:/'/,end:/'/},c={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,r]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=t.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],h=["true","false"],g={match:/(\/[a-z._-]+)+/},_=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],x=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],b=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],y=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...x,"set","shopt",...b,...y]},contains:[d,t.SHEBANG(),p,c,t.HASH_COMMENT_MODE,a,g,i,s,l,r]}}P8.exports=mbe});var D8=$e((rXe,A8)=>{"use strict";function hbe(t){let e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",n="[a-zA-Z_]\\w*::",a="<[^<>]+>",i="("+o+"|"+e.optional(n)+"[a-zA-Z_]\\w*"+e.optional(a)+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(n)+t.IDENT_RE,relevance:0},m=e.optional(n)+t.IDENT_RE+"\\s*\\(",_={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},x=[d,s,r,t.C_BLOCK_COMMENT_MODE,u,c],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:x.concat([{begin:/\(/,end:/\)/,keywords:_,contains:x.concat(["self"]),relevance:0}]),relevance:0},y={begin:"("+i+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:_,relevance:0},{begin:m,returnBegin:!0,contains:[t.inherit(p,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:_,disableAutodetect:!0,illegal:"</",contains:[].concat(b,y,x,[d,{begin:t.IDENT_RE+"::",keywords:_},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:_}}}A8.exports=hbe});var N8=$e((oXe,R8)=>{"use strict";function gbe(t){let e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",n="[a-zA-Z_]\\w*::",a="<[^<>]+>",i="(?!struct)("+o+"|"+e.optional(n)+"[a-zA-Z_]\\w*"+e.optional(a)+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},p={className:"title",begin:e.optional(n)+t.IDENT_RE,relevance:0},m=e.optional(n)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],_=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],x=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],I={type:g,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:_},w={className:"function.dispatch",relevance:0,keywords:{_hint:x},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},v=[w,d,s,r,t.C_BLOCK_COMMENT_MODE,u,c],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:I,contains:v.concat([{begin:/\(/,end:/\)/,keywords:I,contains:v.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+i+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:I,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:I,relevance:0},{begin:m,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,c,u,s,{begin:/\(/,end:/\)/,keywords:I,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,c,u,s]}]},s,r,t.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:I,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,O,w,v,[d,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:I,contains:["self",s]},{begin:t.IDENT_RE+"::",keywords:I},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}R8.exports=gbe});var L8=$e((nXe,M8)=>{"use strict";function _be(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],o=["default","false","null","true"],n=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],i={keyword:n.concat(a),built_in:e,literal:o},s=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=t.inherit(c,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:i},p=t.inherit(d,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,p]},h={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},g=t.inherit(h,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});d.contains=[h,m,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],p.contains=[g,m,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let _={variants:[h,m,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},s]},b=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",y={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:i,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},s,x,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,x,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+b+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:i,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,relevance:0,contains:[_,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},y]}}M8.exports=_be});var F8=$e((aXe,B8)=>{"use strict";var xbe=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),bbe=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ybe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],vbe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Ibe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],wbe=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function Ebe(t){let e=t.regex,r=xbe(t),o={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n="and or not only",a=/@-?\w[\w]*(-\w+)*/,i="[a-zA-Z-][a-zA-Z0-9_-]*",s=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,o,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+i,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+vbe.join("|")+")"},{begin:":(:)?("+Ibe.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wbe.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:n,attribute:ybe.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+bbe.join("|")+")\\b"}]}}B8.exports=Ebe});var U8=$e((iXe,z8)=>{"use strict";function Sbe(t){let e=t.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={begin:"^[-\\*]{3,}",end:"$"},n={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]},d=t.inherit(c,{contains:[]}),p=t.inherit(u,{contains:[]});c.contains.push(p),u.contains.push(d);let m=[r,l];return[c,u,d,p].forEach(_=>{_.contains=_.contains.concat(m)}),m=m.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},r,a,c,u,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},n,o,l,i]}}z8.exports=Sbe});var H8=$e((sXe,V8)=>{"use strict";function Cbe(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}V8.exports=Cbe});var j8=$e((lXe,$8)=>{"use strict";function kbe(t){let e=t.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",o=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),n=e.concat(o,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__"],"variable.language":["self","super"],keyword:["alias","and","attr_accessor","attr_reader","attr_writer","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","include","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield"],built_in:["proc","lambda"],literal:["true","false","nil"]},i={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},l=[t.COMMENT("#","$",{contains:[i]}),t.COMMENT("^=begin","^=end",{contains:[i],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:a},u={className:"string",contains:[t.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,c]})]}]},d="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},y=[u,{variants:[{match:[/class\s+/,n,/\s+<\s+/,n]},{match:[/class\s+/,n]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{relevance:0,match:[n,/\.new[ (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:r}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,l),relevance:0}].concat(s,l);c.contains=y,h.contains=y;let I="[>?]>",w="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",v="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",T=[{begin:/^\s*=>/,starts:{end:"$",contains:y}},{className:"meta.prompt",begin:"^("+I+"|"+w+"|"+v+")(?=[ ])",starts:{end:"$",keywords:a,contains:y}}];return l.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(T).concat(l).concat(y)}}$8.exports=kbe});var G8=$e((cXe,q8)=>{"use strict";function Tbe(t){let a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:t.C_NUMBER_RE+"[i]",relevance:1},t.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}q8.exports=Tbe});var K8=$e((uXe,W8)=>{"use strict";function Pbe(t){let e=t.regex,r=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(r,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}W8.exports=Pbe});var Y8=$e((dXe,X8)=>{"use strict";function Obe(t){let e=t.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},o=t.COMMENT();o.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let n={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:"literal",begin:/\bon|off|true|false|yes|no\b/},i={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},s={begin:/\[/,end:/\]/,contains:[o,a,n,i,r,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,u=/'[^']*'/,d=e.either(l,c,u),p=e.concat(d,"(\\s*\\.\\s*",d,")*",e.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[o,{className:"section",begin:/\[+/,end:/\]+/},{begin:p,className:"attr",starts:{end:/$/,contains:[o,s,a,n,i,r]}}]}}X8.exports=Obe});var e7=$e((fXe,J8)=>{"use strict";var zu="[0-9](_*[0-9])*",Xb=`\\.(${zu})`,Yb="[0-9a-fA-F](_*[0-9a-fA-F])*",Q8={className:"number",variants:[{begin:`(\\b(${zu})((${Xb})|\\.)?|(${Xb}))[eE][+-]?(${zu})[fFdD]?\\b`},{begin:`\\b(${zu})((${Xb})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Xb})[fFdD]?\\b`},{begin:`\\b(${zu})[fFdD]\\b`},{begin:`\\b0[xX]((${Yb})\\.?|(${Yb})?\\.(${Yb}))[pP][+-]?(${zu})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Yb})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Z8(t,e,r){return r===-1?"":t.replace(e,o=>Z8(t,e,r-1))}function Abe(t){let e=t.regex,r="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",o=r+Z8("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[u,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+o+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Q8,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Q8,c]}}J8.exports=Abe});var i7=$e((pXe,a7)=>{"use strict";var t7="[A-Za-z$_][0-9A-Za-z$_]*",Dbe=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Rbe=["true","false","null","undefined","NaN","Infinity"],r7=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],o7=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],n7=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Nbe=["arguments","this","super","console","window","document","localStorage","module","global"],Mbe=[].concat(n7,r7,o7);function Lbe(t){let e=t.regex,r=(V,{after:U})=>{let G="</"+V[0].slice(1);return V.input.indexOf(G,U)!==-1},o=t7,n={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,U)=>{let G=V[0].length+V.index,k=V.input[G];if(k==="<"||k===","){U.ignoreMatch();return}k===">"&&(r(V,{after:G})||U.ignoreMatch());let Z;if((Z=V.input.substring(G).match(/^\s+extends\s+/))&&Z.index===0){U.ignoreMatch();return}}},s={$pattern:t7,keyword:Dbe,literal:Rbe,built_in:Mbe,"variable.language":Nbe},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},m={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},b=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,h,g,d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});let y=[].concat(x,p.contains),I=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:I},v={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,e.concat(o,"(",e.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...r7,...o7]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},C={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(V){return e.concat("(?!",V.join("|"),")")}let N={match:e.concat(/\b/,F([...n7,"super"]),o,e.lookahead(/\(/)),className:"title.function",relevance:0},R={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,h,g,x,d,T,{className:"attr",begin:o+e.lookahead(":"),relevance:0},M,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:a},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},N,C,v,z,{match:/\$[(.]/}]}}a7.exports=Lbe});var l7=$e((mXe,s7)=>{"use strict";function Bbe(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],n={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",keywords:{literal:o},contains:[e,r,t.QUOTE_STRING_MODE,n,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}s7.exports=Bbe});var u7=$e((hXe,c7)=>{"use strict";var Uu="[0-9](_*[0-9])*",Qb=`\\.(${Uu})`,Zb="[0-9a-fA-F](_*[0-9a-fA-F])*",Fbe={className:"number",variants:[{begin:`(\\b(${Uu})((${Qb})|\\.)?|(${Qb}))[eE][+-]?(${Uu})[fFdD]?\\b`},{begin:`\\b(${Uu})((${Qb})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Qb})[fFdD]?\\b`},{begin:`\\b(${Uu})[fFdD]\\b`},{begin:`\\b0[xX]((${Zb})\\.?|(${Zb})?\\.(${Zb}))[pP][+-]?(${Uu})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Zb})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function zbe(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},o={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},n={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},i={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,n]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,a,n]}]};n.contains.push(i);let s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(i,{className:"string"}),"self"]}]},c=Fbe,u=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=d;return p.variants[1].contains=[d],d.variants[1].contains=[p],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,u,r,o,s,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,u],relevance:0},t.C_LINE_COMMENT_MODE,u,s,l,i,t.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,l]},i,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
3
|
+
`},c]}}c7.exports=zbe});var m7=$e((gXe,p7)=>{"use strict";var Ube=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),Vbe=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Hbe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],d7=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],f7=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],$be=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),jbe=d7.concat(f7);function qbe(t){let e=Ube(t),r=jbe,o="and or not only",n="[\\w-]+",a="("+n+"|@\\{"+n+"\\})",i=[],s=[],l=function(y){return{className:"string",begin:"~?"+y+".*?"+y}},c=function(y,I,w){return{className:y,begin:I,relevance:w}},u={$pattern:/[a-z-]+/,keyword:o,attribute:Hbe.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:u,relevance:0};s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,c("variable","@@?"+n,10),c("variable","@\\{"+n+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:n+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let p=s.concat({begin:/\{/,end:/\}/,contains:i}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},h={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$be.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:s,relevance:0}},_={className:"variable",variants:[{begin:"@"+n+"\\s*:",relevance:15},{begin:"@"+n}],starts:{end:"[;}]",returnEnd:!0,contains:p}},x={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,c("keyword","all\\b"),c("variable","@\\{"+n+"\\}"),{begin:"\\b("+Vbe.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",a,0),c("selector-id","#"+a),c("selector-class","\\."+a,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+d7.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+f7.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},e.FUNCTION_DISPATCH]},b={begin:n+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[x]};return i.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,_,b,h,x,m,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:i}}p7.exports=qbe});var g7=$e((_Xe,h7)=>{"use strict";function Gbe(t){let e="\\[=*\\[",r="\\]=*\\]",o={begin:e,end:r,contains:["self"]},n=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,r,{contains:[o],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:n.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:n}].concat(n)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:r,contains:[o],relevance:5}])}}h7.exports=Gbe});var x7=$e((xXe,_7)=>{"use strict";function Wbe(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},o={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e]},n={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},a={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},i={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,r,o,n,a,i]}}_7.exports=Wbe});var y7=$e((bXe,b7)=>{"use strict";function Kbe(t){let e=t.regex,r=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],o=/[dualxmsipngr]{0,12}/,n={$pattern:/[\w.]+/,keyword:r.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},i={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},l=[t.BACKSLASH_ESCAPE,a,s],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(m,h,g="\\1")=>{let _=g==="\\1"?g:e.concat(g,h);return e.concat(e.concat("(?:",m,")"),h,/(?:\\.|[^\\\/])*?/,_,/(?:\\.|[^\\\/])*?/,g,o)},d=(m,h,g)=>e.concat(e.concat("(?:",m,")"),h,/(?:\\.|[^\\\/])*?/,g,o),p=[s,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),i,{className:"string",contains:l,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",e.either(...c,{capture:!0}))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",e.either(...c,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=p,i.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:n,contains:p}}b7.exports=Kbe});var I7=$e((yXe,v7)=>{"use strict";function Xbe(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,s={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:s,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}v7.exports=Xbe});var E7=$e((vXe,w7)=>{"use strict";function Ybe(t){let e=t.regex,r=/(?![A-Za-z0-9])(?![$])/,o=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),n=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),a={scope:"variable",match:"\\$+"+o},i={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=t.inherit(t.APOS_STRING_MODE,{illegal:null}),c=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(s)}),u=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(s)}),d=`[
|
|
4
|
+
]`,p={scope:"string",variants:[c,l,u]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},h=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],_=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],b={keyword:g,literal:(N=>{let R=[];return N.forEach(z=>{R.push(z),z.toLowerCase()===z?R.push(z.toUpperCase()):R.push(z.toLowerCase())}),R})(h),built_in:_},y=N=>N.map(R=>R.replace(/\|\d+$/,"")),I={variants:[{match:[/new/,e.concat(d,"+"),e.concat("(?!",y(_).join("\\b|"),"\\b)"),n],scope:{1:"keyword",4:"title.class"}}]},w=e.concat(o,"\\b(?!\\()"),v={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[n,e.concat(/::/,e.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[n,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[n,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},T={scope:"attr",match:e.concat(o,e.lookahead(":"),e.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:b,contains:[T,a,v,t.C_BLOCK_COMMENT_MODE,p,m,I]},S={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",y(g).join("\\b|"),"|",y(_).join("\\b|"),"\\b)"),o,e.concat(d,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(S);let C=[T,v,t.C_BLOCK_COMMENT_MODE,p,m,I],F={begin:e.concat(/#\[\s*/,n),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:h,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:h,keyword:["new","array"]},contains:["self",...C]},...C,{scope:"meta",match:n}]};return{case_insensitive:!1,keywords:b,contains:[F,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},i,{scope:"variable.language",match:/\$this\b/},a,S,v,{match:[/const/,/\s/,o],scope:{1:"keyword",3:"variable.constant"}},I,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:b,contains:["self",a,v,t.C_BLOCK_COMMENT_MODE,p,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},p,m]}}w7.exports=Ybe});var C7=$e((IXe,S7)=>{"use strict";function Qbe(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}S7.exports=Qbe});var T7=$e((wXe,k7)=>{"use strict";function Zbe(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}k7.exports=Zbe});var O7=$e((EXe,P7)=>{"use strict";function Jbe(t){let e=t.regex,r=/[\p{XID_Start}_]\p{XID_Continue}*/u,o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,u,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",m=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,h=`\\b|${o.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${m}))[eE][+-]?(${p})[jJ]?(?=${h})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${p})[jJ](?=${h})`}]},_={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",l,g,d,t.HASH_COMMENT_MODE]}]};return c.contains=[d,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,illegal:/(<\/|->|\?)|=>/,contains:[l,g,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},d,_,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,x,d]}]}}P7.exports=Jbe});var D7=$e((SXe,A7)=>{"use strict";function eye(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}A7.exports=eye});var N7=$e((CXe,R7)=>{"use strict";function tye(t){let e=t.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,o=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),n=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[n,o]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,o]},{scope:{1:"punctuation",2:"number"},match:[a,o]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,o]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:n},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}R7.exports=tye});var L7=$e((kXe,M7)=>{"use strict";function rye(t){let e=t.regex,r={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",n=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],a=["true","false","Some","None","Ok","Err"],i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],s=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:s,keyword:n,literal:a,built_in:i},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,t.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:i,type:s}},{className:"punctuation",begin:"->"},r]}}M7.exports=rye});var F7=$e((TXe,B7)=>{"use strict";var oye=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),nye=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],aye=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],iye=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],sye=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],lye=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function cye(t){let e=oye(t),r=sye,o=iye,n="@[a-z-]+",a="and or not only",s={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+nye.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+o.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+lye.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,s,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:n,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:aye.join(" ")},contains:[{begin:n,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}B7.exports=cye});var U7=$e((PXe,z7)=>{"use strict";function uye(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}z7.exports=uye});var H7=$e((OXe,V7)=>{"use strict";function dye(t){let e=t.regex,r=t.COMMENT("--","$"),o={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},n={begin:/"/,end:/"/,contains:[{begin:/""/}]},a=["true","false","unknown"],i=["double precision","large object","with timezone","without timezone"],s=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=u,h=[...c,...l].filter(y=>!u.includes(y)),g={className:"variable",begin:/@[a-z0-9]+/},_={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={begin:e.concat(/\b/,e.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function b(y,{exceptions:I,when:w}={}){let v=w;return I=I||[],y.map(T=>T.match(/\|\d+$/)||I.includes(T)?T:v(T)?`${T}|0`:T)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(h,{when:y=>y.length<3}),literal:a,type:s,built_in:d},contains:[{begin:e.either(...p),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:h.concat(p),literal:a,type:s}},{className:"type",begin:e.either(...i)},x,g,o,n,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,_]}}V7.exports=dye});var Q7=$e((AXe,Y7)=>{"use strict";function G7(t){return t?typeof t=="string"?t:t.source:null}function Jb(t){return At("(?=",t,")")}function At(...t){return t.map(r=>G7(r)).join("")}function fye(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Wo(...t){return"("+(fye(t).capture?"":"?:")+t.map(o=>G7(o)).join("|")+")"}var GC=t=>At(/\b/,t,/\w$/.test(t)?/\b/:/\B/),pye=["Protocol","Type"].map(GC),$7=["init","self"].map(GC),mye=["Any","Self"],$C=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],j7=["false","nil","true"],hye=["assignment","associativity","higherThan","left","lowerThan","none","right"],gye=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],q7=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],W7=Wo(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),K7=Wo(W7,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),jC=At(W7,K7,"*"),X7=Wo(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),ey=Wo(X7,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),oi=At(X7,ey,"*"),qC=At(/[A-Z]/,ey,"*"),_ye=["autoclosure",At(/convention\(/,Wo("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",At(/objc\(/,oi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],xye=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function bye(t){let e={match:/\s+/,relevance:0},r=t.COMMENT("/\\*","\\*/",{contains:["self"]}),o=[t.C_LINE_COMMENT_MODE,r],n={match:[/\./,Wo(...pye,...$7)],className:{2:"keyword"}},a={match:At(/\./,Wo(...$C)),relevance:0},i=$C.filter(be=>typeof be=="string").concat(["_|0"]),s=$C.filter(be=>typeof be!="string").concat(mye).map(GC),l={variants:[{className:"keyword",match:Wo(...s,...$7)}]},c={$pattern:Wo(/\b\w+/,/#\w+/),keyword:i.concat(gye),literal:j7},u=[n,a,l],d={match:At(/\./,Wo(...q7)),relevance:0},p={className:"built_in",match:At(/\b/,Wo(...q7),/(?=\()/)},m=[d,p],h={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:jC},{match:`\\.(\\.|${K7})+`}]},_=[h,g],x="([0-9]_*)+",b="([0-9a-fA-F]_*)+",y={className:"number",relevance:0,variants:[{match:`\\b(${x})(\\.(${x}))?([eE][+-]?(${x}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${x}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},I=(be="")=>({className:"subst",variants:[{match:At(/\\/,be,/[0\\tnr"']/)},{match:At(/\\/,be,/u\{[0-9a-fA-F]{1,8}\}/)}]}),w=(be="")=>({className:"subst",match:At(/\\/,be,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(be="")=>({className:"subst",label:"interpol",begin:At(/\\/,be,/\(/),end:/\)/}),T=(be="")=>({begin:At(be,/"""/),end:At(/"""/,be),contains:[I(be),w(be),v(be)]}),O=(be="")=>({begin:At(be,/"/),end:At(/"/,be),contains:[I(be),v(be)]}),S={className:"string",variants:[T(),T("#"),T("##"),T("###"),O(),O("#"),O("##"),O("###")]},C={match:At(/`/,oi,/`/)},F={className:"variable",match:/\$\d+/},N={className:"variable",match:`\\$${ey}+`},R=[C,F,N],z={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:xye,contains:[..._,y,S]}]}},B={className:"keyword",match:At(/@/,Wo(..._ye))},M={className:"meta",match:At(/@/,oi)},V=[z,B,M],U={match:Jb(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:At(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,ey,"+")},{className:"type",match:qC,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:At(/\s+&\s+/,Jb(qC)),relevance:0}]},G={begin:/</,end:/>/,keywords:c,contains:[...o,...u,...V,h,U]};U.contains.push(G);let k={match:At(oi,/\s*:/),keywords:"_|0",relevance:0},Z={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",k,...o,...u,...m,..._,y,S,...R,...V,U]},te={begin:/</,end:/>/,contains:[...o,U]},A={begin:Wo(Jb(At(oi,/\s*:/)),Jb(At(oi,/\s+/,oi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:oi}]},ce={begin:/\(/,end:/\)/,keywords:c,contains:[A,...o,...u,..._,y,S,...V,U,Z],endsParent:!0,illegal:/["']/},Se={match:[/func/,/\s+/,Wo(C.match,oi,jC)],className:{1:"keyword",3:"title.function"},contains:[te,ce,e],illegal:[/\[/,/%/]},Ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[te,ce,e],illegal:/\[|%/},et={match:[/operator/,/\s+/,jC],className:{1:"keyword",3:"title"}},Oe={begin:[/precedencegroup/,/\s+/,qC],className:{1:"keyword",3:"title"},contains:[U],keywords:[...hye,...j7],end:/}/};for(let be of S.variants){let st=be.contains.find(mt=>mt.label==="interpol");st.keywords=c;let wt=[...u,...m,..._,y,S,...R];st.contains=[...wt,{begin:/\(/,end:/\)/,contains:["self",...wt]}]}return{name:"Swift",keywords:c,contains:[...o,Se,Ge,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:c,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...u]},et,Oe,{beginKeywords:"import",end:/$/,contains:[...o],relevance:0},...u,...m,..._,y,S,...R,...V,U,Z]}}Y7.exports=bye});var J7=$e((DXe,Z7)=>{"use strict";function yye(t){let e="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},n={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,n]},i=t.inherit(a,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s="[0-9]{4}(-[0-9][0-9]){0,2}",l="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",c="(\\.[0-9]*)?",u="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",d={className:"number",begin:"\\b"+s+l+c+u+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},h={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},g=[o,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},d,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},m,h,a],_=[...g];return _.pop(),_.push(i),p.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}Z7.exports=yye});var lV=$e((RXe,sV)=>{"use strict";var ty="[A-Za-z$_][0-9A-Za-z$_]*",eV=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],tV=["true","false","null","undefined","NaN","Infinity"],rV=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],oV=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nV=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],aV=["arguments","this","super","console","window","document","localStorage","module","global"],iV=[].concat(nV,rV,oV);function vye(t){let e=t.regex,r=(V,{after:U})=>{let G="</"+V[0].slice(1);return V.input.indexOf(G,U)!==-1},o=ty,n={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,U)=>{let G=V[0].length+V.index,k=V.input[G];if(k==="<"||k===","){U.ignoreMatch();return}k===">"&&(r(V,{after:G})||U.ignoreMatch());let Z;if((Z=V.input.substring(G).match(/^\s+extends\s+/))&&Z.index===0){U.ignoreMatch();return}}},s={$pattern:ty,keyword:eV,literal:tV,built_in:iV,"variable.language":aV},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},m={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},b=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,h,g,d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});let y=[].concat(x,p.contains),I=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:I},v={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,e.concat(o,"(",e.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rV,...oV]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},C={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(V){return e.concat("(?!",V.join("|"),")")}let N={match:e.concat(/\b/,F([...nV,"super"]),o,e.lookahead(/\(/)),className:"title.function",relevance:0},R={begin:e.concat(/\./,e.lookahead(e.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},B="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(B)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,m,h,g,x,d,T,{className:"attr",begin:o+e.lookahead(":"),relevance:0},M,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:B,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:a},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,t.inherit(t.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},N,C,v,z,{match:/\$[(.]/}]}}function Iye(t){let e=vye(t),r=ty,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],n={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[e.exports.CLASS_REFERENCE]},i={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},s=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:ty,keyword:eV.concat(s),literal:tV,built_in:iV.concat(o),"variable.language":aV},c={className:"meta",begin:"@"+r},u=(p,m,h)=>{let g=p.contains.findIndex(_=>_.label===m);if(g===-1)throw new Error("can not find mode to replace");p.contains.splice(g,1,h)};Object.assign(e.keywords,l),e.exports.PARAMS_CONTAINS.push(c),e.contains=e.contains.concat([c,n,a]),u(e,"shebang",t.SHEBANG()),u(e,"use_strict",i);let d=e.contains.find(p=>p.label==="func.def");return d.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx"]}),e}sV.exports=Iye});var uV=$e((NXe,cV)=>{"use strict";function wye(t){let e=t.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},o={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},n=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(a,n),/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,i,/ *#/)},{begin:e.concat(/# */,e.either(a,n),/ +/,e.either(i,s),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),p=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[r,o,l,c,u,d,p,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[p]}]}}cV.exports=wye});var fV=$e((MXe,dV)=>{"use strict";function Eye(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let r=t.COMMENT(/;;/,/$/),o=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],n={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},i={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},s={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:o},contains:[r,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,i,n,t.QUOTE_STRING_MODE,l,c,s]}}dV.exports=Eye});var mV=$e((LXe,pV)=>{"use strict";var qe=C8();qe.registerLanguage("xml",T8());qe.registerLanguage("bash",O8());qe.registerLanguage("c",D8());qe.registerLanguage("cpp",N8());qe.registerLanguage("csharp",L8());qe.registerLanguage("css",F8());qe.registerLanguage("markdown",U8());qe.registerLanguage("diff",H8());qe.registerLanguage("ruby",j8());qe.registerLanguage("go",G8());qe.registerLanguage("graphql",K8());qe.registerLanguage("ini",Y8());qe.registerLanguage("java",e7());qe.registerLanguage("javascript",i7());qe.registerLanguage("json",l7());qe.registerLanguage("kotlin",u7());qe.registerLanguage("less",m7());qe.registerLanguage("lua",g7());qe.registerLanguage("makefile",x7());qe.registerLanguage("perl",y7());qe.registerLanguage("objectivec",I7());qe.registerLanguage("php",E7());qe.registerLanguage("php-template",C7());qe.registerLanguage("plaintext",T7());qe.registerLanguage("python",O7());qe.registerLanguage("python-repl",D7());qe.registerLanguage("r",N7());qe.registerLanguage("rust",L7());qe.registerLanguage("scss",F7());qe.registerLanguage("shell",U7());qe.registerLanguage("sql",H7());qe.registerLanguage("swift",Q7());qe.registerLanguage("yaml",J7());qe.registerLanguage("typescript",lV());qe.registerLanguage("vbnet",uV());qe.registerLanguage("wasm",fV());qe.HighlightJS=qe;qe.default=qe;pV.exports=qe});var Ev={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]};function YP(t){return()=>({fontFamily:t.fontFamily||"sans-serif"})}function QP(t){return()=>({WebkitTapHighlightColor:"transparent","&:focus":{outlineOffset:2,outline:t.focusRing==="always"||t.focusRing==="auto"?`2px solid ${t.colors[t.primaryColor][t.colorScheme==="dark"?7:5]}`:"none"},"&:focus:not(:focus-visible)":{outline:t.focusRing==="auto"||t.focusRing==="never"?"none":void 0}})}function Tm(t){return(e,r,o=!0)=>{let n=t.colors[t.primaryColor];return e in t.colors?t.colors[e][r]:o?n[r]:e}}function Sv(t){let e="";for(let r=1;r<t.length-1;r+=1)e+=`${t[r]} ${r/(t.length-1)*100}%, `;return`${t[0]} 0%, ${e}${t[t.length-1]} 100%`}function ZP(t,...e){return`linear-gradient(${t}deg, ${Sv(e)})`}function JP(...t){return`radial-gradient(circle, ${Sv(t)})`}function yd(t){return typeof t.size=="number"?t.size:t.sizes[t.size]||t.size||t.sizes.md}function eO(t){return e=>`@media (min-width: ${yd({size:e,sizes:t.breakpoints})+1}px)`}function tO(t){return e=>`@media (max-width: ${yd({size:e,sizes:t.breakpoints})}px)`}function Jj(t){return/^#?([0-9A-F]{3}){1,2}$/i.test(t)}function eq(t){let e=t.replace("#","");if(e.length===3){let i=e.split("");e=[i[0],i[0],i[1],i[1],i[2],i[2]].join("")}let r=parseInt(e,16),o=r>>16&255,n=r>>8&255,a=r&255;return{r:o,g:n,b:a,a:1}}function tq(t){let[e,r,o,n]=t.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:e,g:r,b:o,a:n||1}}function Wl(t){return Jj(t)?eq(t):t.startsWith("rgb")?tq(t):{r:0,g:0,b:0,a:1}}function _i(t,e){if(typeof t!="string"||e>1||e<0)return"rgba(0, 0, 0, 1)";let{r,g:o,b:n}=Wl(t);return`rgba(${r}, ${o}, ${n}, ${e})`}function rO(t=0){return{position:"absolute",top:t,right:t,left:t,bottom:t}}function oO(t,e){let{r,g:o,b:n,a}=Wl(t),i=1-e,s=l=>Math.round(l*i);return`rgba(${s(r)}, ${s(o)}, ${s(n)}, ${a})`}function nO(t,e){let{r,g:o,b:n,a}=Wl(t),i=s=>Math.round(s+(255-s)*e);return`rgba(${i(r)}, ${i(o)}, ${i(n)}, ${a})`}function aO(t){return e=>{if(typeof e=="number")return e;let r=typeof t.defaultRadius=="number"?t.defaultRadius:t.radius[t.defaultRadius]||t.defaultRadius;return t.radius[e]||e||r}}function Pm(t){return e=>typeof t.primaryShade=="number"?t.primaryShade:t.primaryShade[e||t.colorScheme]}var Cv={from:"indigo",to:"cyan",deg:45};function iO(t){let e=Tm(t),r=Pm(t);return({variant:o,color:n,gradient:a})=>{if(o==="light")return{border:"transparent",background:_i(e(n,t.colorScheme==="dark"?8:0),t.colorScheme==="dark"?.35:1),color:n==="dark"?t.colorScheme==="dark"?t.colors.dark[0]:t.colors.dark[9]:e(n,t.colorScheme==="dark"?2:r("light")),hover:_i(e(n,t.colorScheme==="dark"?7:1),t.colorScheme==="dark"?.45:.65)};if(o==="default")return{border:t.colorScheme==="dark"?t.colors.dark[5]:t.colors.gray[4],background:t.colorScheme==="dark"?t.colors.dark[5]:t.white,color:t.colorScheme==="dark"?t.white:t.black,hover:t.colorScheme==="dark"?t.colors.dark[4]:t.colors.gray[0]};if(o==="white")return{border:"transparent",background:t.white,color:e(n,r()),hover:null};if(o==="outline")return{border:e(n,t.colorScheme==="dark"?4:r("light")),background:"transparent",color:e(n,t.colorScheme==="dark"?4:r("light")),hover:t.colorScheme==="dark"?_i(e(n,4),.05):_i(e(n,0),.35)};if(o==="gradient"){let i={from:a?.from||Cv.from,to:a?.to||Cv.to,deg:a?.deg||Cv.deg};return{background:`linear-gradient(${i.deg}deg, ${e(i.from,r(),!1)} 0%, ${e(i.to,r(),!1)} 100%)`,color:t.white,border:"transparent",hover:null}}return o==="subtle"?{border:"transparent",background:"transparent",color:n==="dark"?t.colorScheme==="dark"?t.colors.dark[0]:t.colors.dark[9]:e(n,t.colorScheme==="dark"?2:r("light")),hover:_i(e(n,t.colorScheme==="dark"?8:0),t.colorScheme==="dark"?.35:1)}:{border:"transparent",background:e(n,r()),color:t.white,hover:e(n,r()===9?8:r()+1)}}}function sO(t){return{"@media (hover: hover)":{"&:hover":t},"@media (hover: none)":{"&:active":t}}}var jr={fontStyles:YP,themeColor:Tm,focusStyles:QP,linearGradient:ZP,radialGradient:JP,smallerThan:tO,largerThan:eO,rgba:_i,size:yd,cover:rO,darken:oO,lighten:nO,radius:aO,variant:iO,primaryShade:Pm,hover:sO};var rq=Object.defineProperty,oq=Object.defineProperties,nq=Object.getOwnPropertyDescriptors,lO=Object.getOwnPropertySymbols,aq=Object.prototype.hasOwnProperty,iq=Object.prototype.propertyIsEnumerable,cO=(t,e,r)=>e in t?rq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sq=(t,e)=>{for(var r in e||(e={}))aq.call(e,r)&&cO(t,r,e[r]);if(lO)for(var r of lO(e))iq.call(e,r)&&cO(t,r,e[r]);return t},lq=(t,e)=>oq(t,nq(e));function Om(t){return lq(sq({},t),{fn:{fontStyles:jr.fontStyles(t),themeColor:jr.themeColor(t),focusStyles:jr.focusStyles(t),largerThan:jr.largerThan(t),smallerThan:jr.smallerThan(t),radialGradient:jr.radialGradient,linearGradient:jr.linearGradient,rgba:jr.rgba,size:jr.size,cover:jr.cover,lighten:jr.lighten,darken:jr.darken,primaryShade:jr.primaryShade(t),radius:jr.radius(t),variant:jr.variant(t),hover:jr.hover}})}var RCe=Object.keys(Ev);var cq={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",dateFormat:"MMMM D, YYYY",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:Ev,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",shadows:{xs:"0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1)",sm:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 10px 15px -5px, rgba(0, 0, 0, 0.04) 0px 7px 7px -5px",md:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px",lg:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 28px 23px -7px, rgba(0, 0, 0, 0.04) 0px 12px 12px -7px",xl:"0 1px 3px rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0px 36px 28px -7px, rgba(0, 0, 0, 0.04) 0px 17px 17px -7px"},fontSizes:{xs:12,sm:14,md:16,lg:18,xl:20},radius:{xs:2,sm:4,md:8,lg:16,xl:32},spacing:{xs:10,sm:12,md:16,lg:20,xl:24},breakpoints:{xs:576,sm:768,md:992,lg:1200,xl:1400},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:34,lineHeight:1.3},h2:{fontSize:26,lineHeight:1.35},h3:{fontSize:22,lineHeight:1.4},h4:{fontSize:18,lineHeight:1.45},h5:{fontSize:16,lineHeight:1.5},h6:{fontSize:14,lineHeight:1.5}}},other:{},datesLocale:"en"},Am=Om(cq);var wd,he,mO,uq,hs,uO,hO,kv,gO,Id={},_O=[],dq=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Nm=Array.isArray;function La(t,e){for(var r in e)t[r]=e[r];return t}function xO(t){var e=t.parentNode;e&&e.removeChild(t)}function Q(t,e,r){var o,n,a,i={};for(a in e)a=="key"?o=e[a]:a=="ref"?n=e[a]:i[a]=e[a];if(arguments.length>2&&(i.children=arguments.length>3?wd.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)i[a]===void 0&&(i[a]=t.defaultProps[a]);return vd(t,i,o,n,null)}function vd(t,e,r,o,n){var a={type:t,props:e,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++mO,__i:-1,__u:0};return n==null&&he.vnode!=null&&he.vnode(a),a}function Ov(){return{current:null}}function Ae(t){return t.children}function Vo(t,e){this.props=t,this.context=e}function Kl(t,e){if(e==null)return t.__?Kl(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Kl(t):null}function bO(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return bO(t)}}function Tv(t){(!t.__d&&(t.__d=!0)&&hs.push(t)&&!Rm.__r++||uO!==he.debounceRendering)&&((uO=he.debounceRendering)||hO)(Rm)}function Rm(){var t,e,r,o,n,a,i,s,l;for(hs.sort(kv);t=hs.shift();)t.__d&&(e=hs.length,o=void 0,a=(n=(r=t).__v).__e,s=[],l=[],(i=r.__P)&&((o=La({},n)).__v=n.__v+1,he.vnode&&he.vnode(o),Av(i,o,n,r.__n,i.ownerSVGElement!==void 0,32&n.__u?[a]:null,s,a??Kl(n),!!(32&n.__u),l),o.__.__k[o.__i]=o,IO(s,o,l),o.__e!=a&&bO(o)),hs.length>e&&hs.sort(kv));Rm.__r=0}function yO(t,e,r,o,n,a,i,s,l,c,u){var d,p,m,h,g,_=o&&o.__k||_O,x=e.length;for(r.__d=l,fq(r,e,_),l=r.__d,d=0;d<x;d++)(m=r.__k[d])!=null&&typeof m!="boolean"&&typeof m!="function"&&(p=m.__i===-1?Id:_[m.__i]||Id,m.__i=d,Av(t,m,p,n,a,i,s,l,c,u),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Dv(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),65536&m.__u||p.__k===m.__k?l=vO(m,l,t):typeof m.type=="function"&&m.__d!==void 0?l=m.__d:h&&(l=h.nextSibling),m.__d=void 0,m.__u&=-196609);r.__d=l,r.__e=g}function fq(t,e,r){var o,n,a,i,s,l=e.length,c=r.length,u=c,d=0;for(t.__k=[],o=0;o<l;o++)(n=t.__k[o]=(n=e[o])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?vd(null,n,null,null,n):Nm(n)?vd(Ae,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?vd(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=t,n.__b=t.__b+1,s=pq(n,r,i=o+d,u),n.__i=s,a=null,s!==-1&&(u--,(a=r[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof n.type!="function"&&(n.__u|=65536)):s!==i&&(s===i+1?d++:s>i?u>l-i?d+=s-i:d--:d=s<i&&s==i-1?s-i:0,s!==o+d&&(n.__u|=65536))):(a=r[o])&&a.key==null&&a.__e&&(a.__e==t.__d&&(t.__d=Kl(a)),Pv(a,a,!1),r[o]=null,u--);if(u)for(o=0;o<c;o++)(a=r[o])!=null&&!(131072&a.__u)&&(a.__e==t.__d&&(t.__d=Kl(a)),Pv(a,a))}function vO(t,e,r){var o,n;if(typeof t.type=="function"){for(o=t.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=t,e=vO(o[n],e,r));return e}return t.__e!=e&&(r.insertBefore(t.__e,e||null),e=t.__e),e&&e.nextSibling}function yo(t,e){return e=e||[],t==null||typeof t=="boolean"||(Nm(t)?t.some(function(r){yo(r,e)}):e.push(t)),e}function pq(t,e,r,o){var n=t.key,a=t.type,i=r-1,s=r+1,l=e[r];if(l===null||l&&n==l.key&&a===l.type)return r;if(o>(l!=null&&!(131072&l.__u)?1:0))for(;i>=0||s<e.length;){if(i>=0){if((l=e[i])&&!(131072&l.__u)&&n==l.key&&a===l.type)return i;i--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&n==l.key&&a===l.type)return s;s++}}return-1}function dO(t,e,r){e[0]==="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||dq.test(e)?r:r+"px"}function Dm(t,e,r,o,n){var a;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)r&&e in r||dO(t.style,e,"");if(r)for(e in r)o&&r[e]===o[e]||dO(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")a=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+a]=r,r?o?r.u=o.u:(r.u=Date.now(),t.addEventListener(e,a?pO:fO,a)):t.removeEventListener(e,a?pO:fO,a);else{if(n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,r))}}function fO(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(he.event?he.event(t):t)}function pO(t){return this.l[t.type+!0](he.event?he.event(t):t)}function Av(t,e,r,o,n,a,i,s,l,c){var u,d,p,m,h,g,_,x,b,y,I,w,v,T,O,S=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),a=[s=e.__e=r.__e]),(u=he.__b)&&u(e);e:if(typeof S=="function")try{if(x=e.props,b=(u=S.contextType)&&o[u.__c],y=u?b?b.props.value:u.__:o,r.__c?_=(d=e.__c=r.__c).__=d.__E:("prototype"in S&&S.prototype.render?e.__c=d=new S(x,y):(e.__c=d=new Vo(x,y),d.constructor=S,d.render=hq),b&&b.sub(d),d.props=x,d.state||(d.state={}),d.context=y,d.__n=o,p=d.__d=!0,d.__h=[],d._sb=[]),d.__s==null&&(d.__s=d.state),S.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=La({},d.__s)),La(d.__s,S.getDerivedStateFromProps(x,d.__s))),m=d.props,h=d.state,d.__v=e,p)S.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(S.getDerivedStateFromProps==null&&x!==m&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(x,y),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(x,d.__s,y)===!1||e.__v===r.__v)){for(e.__v!==r.__v&&(d.props=x,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach(function(C){C&&(C.__=e)}),I=0;I<d._sb.length;I++)d.__h.push(d._sb[I]);d._sb=[],d.__h.length&&i.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(x,d.__s,y),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(m,h,g)})}if(d.context=y,d.props=x,d.__P=t,d.__e=!1,w=he.__r,v=0,"prototype"in S&&S.prototype.render){for(d.state=d.__s,d.__d=!1,w&&w(e),u=d.render(d.props,d.state,d.context),T=0;T<d._sb.length;T++)d.__h.push(d._sb[T]);d._sb=[]}else do d.__d=!1,w&&w(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++v<25);d.state=d.__s,d.getChildContext!=null&&(o=La(La({},o),d.getChildContext())),p||d.getSnapshotBeforeUpdate==null||(g=d.getSnapshotBeforeUpdate(m,h)),yO(t,Nm(O=u!=null&&u.type===Ae&&u.key==null?u.props.children:u)?O:[O],e,r,o,n,a,i,s,l,c),d.base=e.__e,e.__u&=-161,d.__h.length&&i.push(d),_&&(d.__E=d.__=null)}catch(C){e.__v=null,l||a!=null?(e.__e=s,e.__u|=l?160:32,a[a.indexOf(s)]=null):(e.__e=r.__e,e.__k=r.__k),he.__e(C,e,r)}else a==null&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=mq(r.__e,e,r,o,n,a,i,l,c);(u=he.diffed)&&u(e)}function IO(t,e,r){e.__d=void 0;for(var o=0;o<r.length;o++)Dv(r[o],r[++o],r[++o]);he.__c&&he.__c(e,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(a){a.call(n)})}catch(a){he.__e(a,n.__v)}})}function mq(t,e,r,o,n,a,i,s,l){var c,u,d,p,m,h,g,_=r.props,x=e.props,b=e.type;if(b==="svg"&&(n=!0),a!=null){for(c=0;c<a.length;c++)if((m=a[c])&&"setAttribute"in m==!!b&&(b?m.localName===b:m.nodeType===3)){t=m,a[c]=null;break}}if(t==null){if(b===null)return document.createTextNode(x);t=n?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,x.is&&x),a=null,s=!1}if(b===null)_===x||s&&t.data===x||(t.data=x);else{if(a=a&&wd.call(t.childNodes),_=r.props||Id,!s&&a!=null)for(_={},c=0;c<t.attributes.length;c++)_[(m=t.attributes[c]).name]=m.value;for(c in _)m=_[c],c=="children"||(c=="dangerouslySetInnerHTML"?d=m:c==="key"||c in x||Dm(t,c,null,m,n));for(c in x)m=x[c],c=="children"?p=m:c=="dangerouslySetInnerHTML"?u=m:c=="value"?h=m:c=="checked"?g=m:c==="key"||s&&typeof m!="function"||_[c]===m||Dm(t,c,m,_[c],n);if(u)s||d&&(u.__html===d.__html||u.__html===t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),yO(t,Nm(p)?p:[p],e,r,o,n&&b!=="foreignObject",a,i,a?a[0]:r.__k&&Kl(r,0),s,l),a!=null)for(c=a.length;c--;)a[c]!=null&&xO(a[c]);s||(c="value",h!==void 0&&(h!==t[c]||b==="progress"&&!h||b==="option"&&h!==_[c])&&Dm(t,c,h,_[c],!1),c="checked",g!==void 0&&g!==t[c]&&Dm(t,c,g,_[c],!1))}return t}function Dv(t,e,r){try{typeof t=="function"?t(e):t.current=e}catch(o){he.__e(o,r)}}function Pv(t,e,r){var o,n;if(he.unmount&&he.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||Dv(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){he.__e(a,e)}o.base=o.__P=null,t.__c=void 0}if(o=t.__k)for(n=0;n<o.length;n++)o[n]&&Pv(o[n],e,r||typeof t.type!="function");r||t.__e==null||xO(t.__e),t.__=t.__e=t.__d=void 0}function hq(t,e,r){return this.constructor(t,r)}function xi(t,e,r){var o,n,a,i;he.__&&he.__(t,e),n=(o=typeof r=="function")?null:r&&r.__k||e.__k,a=[],i=[],Av(e,t=(!o&&r||e).__k=Q(Ae,null,[t]),n||Id,Id,e.ownerSVGElement!==void 0,!o&&r?[r]:n?null:e.firstChild?wd.call(e.childNodes):null,a,!o&&r?r:n?n.__e:e.firstChild,o,i),IO(a,t,i)}function Rv(t,e){xi(t,e,Rv)}function Mm(t,e,r){var o,n,a,i,s=La({},t.props);for(a in t.type&&t.type.defaultProps&&(i=t.type.defaultProps),e)a=="key"?o=e[a]:a=="ref"?n=e[a]:s[a]=e[a]===void 0&&i!==void 0?i[a]:e[a];return arguments.length>2&&(s.children=arguments.length>3?wd.call(arguments,2):r),vd(t.type,s,o||t.key,n||t.ref,null)}function Rt(t,e){var r={__c:e="__cC"+gO++,__:t,Consumer:function(o,n){return o.children(n)},Provider:function(o){var n,a;return this.getChildContext||(n=[],(a={})[e]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(i){this.props.value!==i.value&&n.some(function(s){s.__e=!0,Tv(s)})},this.sub=function(i){n.push(i);var s=i.componentWillUnmount;i.componentWillUnmount=function(){n.splice(n.indexOf(i),1),s&&s.call(i)}}),o.children}};return r.Provider.__=r.Consumer.contextType=r}wd=_O.slice,he={__e:function(t,e,r,o){for(var n,a,i;e=e.__;)if((n=e.__c)&&!n.__)try{if((a=n.constructor)&&a.getDerivedStateFromError!=null&&(n.setState(a.getDerivedStateFromError(t)),i=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(t,o||{}),i=n.__d),i)return n.__E=n}catch(s){t=s}throw t}},mO=0,uq=function(t){return t!=null&&t.constructor==null},Vo.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=La({},this.state),typeof t=="function"&&(t=t(La({},r),this.props)),t&&La(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Tv(this))},Vo.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Tv(this))},Vo.prototype.render=Ae,hs=[],hO=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,kv=function(t,e){return t.__v.__b-e.__v.__b},Rm.__r=0,gO=0;var bi,Nt,Nv,wO,Xl=0,OO=[],Lm=[],EO=he.__b,SO=he.__r,CO=he.diffed,kO=he.__c,TO=he.unmount;function Yl(t,e){he.__h&&he.__h(Nt,t,Xl||e),Xl=0;var r=Nt.__H||(Nt.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Lm}),r.__[t]}function P(t){return Xl=1,Ko(NO,t)}function Ko(t,e,r){var o=Yl(bi++,2);if(o.t=t,!o.__c&&(o.__=[r?r(e):NO(void 0,e),function(s){var l=o.__N?o.__N[0]:o.__[0],c=o.t(l,s);l!==c&&(o.__N=[c,o.__[1]],o.__c.setState({}))}],o.__c=Nt,!Nt.u)){var n=function(s,l,c){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(p){return p.__c});if(u.every(function(p){return!p.__N}))return!a||a.call(this,s,l,c);var d=!1;return u.forEach(function(p){if(p.__N){var m=p.__[0];p.__=p.__N,p.__N=void 0,m!==p.__[0]&&(d=!0)}}),!(!d&&o.__c.props===s)&&(!a||a.call(this,s,l,c))};Nt.u=!0;var a=Nt.shouldComponentUpdate,i=Nt.componentWillUpdate;Nt.componentWillUpdate=function(s,l,c){if(this.__e){var u=a;a=void 0,n(s,l,c),a=u}i&&i.call(this,s,l,c)},Nt.shouldComponentUpdate=n}return o.__N||o.__}function L(t,e){var r=Yl(bi++,3);!he.__s&&Lv(r.__H,e)&&(r.__=t,r.i=e,Nt.__H.__h.push(r))}function Er(t,e){var r=Yl(bi++,4);!he.__s&&Lv(r.__H,e)&&(r.__=t,r.i=e,Nt.__h.push(r))}function H(t){return Xl=5,Tt(function(){return{current:t}},[])}function AO(t,e,r){Xl=6,Er(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function Tt(t,e){var r=Yl(bi++,7);return Lv(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function Ht(t,e){return Xl=8,Tt(function(){return t},e)}function Mt(t){var e=Nt.context[t.__c],r=Yl(bi++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(Nt)),e.props.value):t.__}function DO(t,e){he.useDebugValue&&he.useDebugValue(e?e(t):t)}function RO(){var t=Yl(bi++,11);if(!t.__){for(var e=Nt.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function gq(){for(var t;t=OO.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Bm),t.__H.__h.forEach(Mv),t.__H.__h=[]}catch(e){t.__H.__h=[],he.__e(e,t.__v)}}he.__b=function(t){Nt=null,EO&&EO(t)},he.__r=function(t){SO&&SO(t),bi=0;var e=(Nt=t.__c).__H;e&&(Nv===Nt?(e.__h=[],Nt.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Lm,r.__N=r.i=void 0})):(e.__h.forEach(Bm),e.__h.forEach(Mv),e.__h=[],bi=0)),Nv=Nt},he.diffed=function(t){CO&&CO(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(OO.push(e)!==1&&wO===he.requestAnimationFrame||((wO=he.requestAnimationFrame)||_q)(gq)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Lm&&(r.__=r.__V),r.i=void 0,r.__V=Lm})),Nv=Nt=null},he.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Bm),r.__h=r.__h.filter(function(o){return!o.__||Mv(o)})}catch(o){e.some(function(n){n.__h&&(n.__h=[])}),e=[],he.__e(o,r.__v)}}),kO&&kO(t,e)},he.unmount=function(t){TO&&TO(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{Bm(o)}catch(n){e=n}}),r.__H=void 0,e&&he.__e(e,r.__v))};var PO=typeof requestAnimationFrame=="function";function _q(t){var e,r=function(){clearTimeout(o),PO&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(r,100);PO&&(e=requestAnimationFrame(r))}function Bm(t){var e=Nt,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Nt=e}function Mv(t){var e=Nt;t.__c=t.__(),Nt=e}function Lv(t,e){return!t||t.length!==e.length||e.some(function(r,o){return r!==t[o]})}function NO(t,e){return typeof e=="function"?e(t):e}function $O(t,e){for(var r in e)t[r]=e[r];return t}function Fv(t,e){for(var r in t)if(r!=="__source"&&!(r in e))return!0;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return!0;return!1}function zv(t){this.props=t}function xq(t,e){function r(n){var a=this.props.ref,i=a==n.ref;return!i&&a&&(a.call?a(null):a.current=null),e?!e(this.props,n)||!i:Fv(this.props,n)}function o(n){return this.shouldComponentUpdate=r,Q(t,n)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(zv.prototype=new Vo).isPureReactComponent=!0,zv.prototype.shouldComponentUpdate=function(t,e){return Fv(this.props,t)||Fv(this.state,e)};var MO=he.__b;he.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),MO&&MO(t)};var bq=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function K(t){function e(r){var o=$O({},r);return delete o.ref,t(o,r.ref||null)}return e.$$typeof=bq,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var LO=function(t,e){return t==null?null:yo(yo(t).map(e))},so={map:LO,forEach:LO,count:function(t){return t?yo(t).length:0},only:function(t){var e=yo(t);if(e.length!==1)throw"Children.only";return e[0]},toArray:yo},yq=he.__e;he.__e=function(t,e,r,o){if(t.then){for(var n,a=e;a=a.__;)if((n=a.__c)&&n.__c)return e.__e==null&&(e.__e=r.__e,e.__k=r.__k),n.__c(t,e)}yq(t,e,r,o)};var BO=he.unmount;function jO(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=$O({},t)).__c!=null&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return jO(o,e,r)})),t}function qO(t,e,r){return t&&r&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return qO(o,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=r)),t}function Fm(){this.__u=0,this.t=null,this.__b=null}function GO(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function vq(t){var e,r,o;function n(a){if(e||(e=t()).then(function(i){r=i.default||i},function(i){o=i}),o)throw o;if(!r)throw e;return Q(r,a)}return n.displayName="Lazy",n.__f=!0,n}function Ed(){this.u=null,this.o=null}he.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),BO&&BO(t)},(Fm.prototype=new Vo).__c=function(t,e){var r=e.__c,o=this;o.t==null&&(o.t=[]),o.t.push(r);var n=GO(o.__v),a=!1,i=function(){a||(a=!0,r.__R=null,n?n(s):s())};r.__R=i;var s=function(){if(!--o.__u){if(o.state.__a){var l=o.state.__a;o.__v.__k[0]=qO(l,l.__c.__P,l.__c.__O)}var c;for(o.setState({__a:o.__b=null});c=o.t.pop();)c.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(i,i)},Fm.prototype.componentWillUnmount=function(){this.t=[]},Fm.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=jO(this.__b,r,o.__O=o.__P)}this.__b=null}var n=e.__a&&Q(Ae,null,t.fallback);return n&&(n.__u&=-33),[Q(Ae,null,e.__a?null:t.children),n]};var FO=function(t,e,r){if(++r[1]===r[0]&&t.o.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.o.size))for(r=t.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;t.u=r=r[2]}};function Iq(t){return this.getChildContext=function(){return t.context},t.children}function wq(t){var e=this,r=t.i;e.componentWillUnmount=function(){xi(null,e.l),e.l=null,e.i=null},e.i&&e.i!==r&&e.componentWillUnmount(),e.l||(e.i=r,e.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(o){this.childNodes.push(o),e.i.appendChild(o)},insertBefore:function(o,n){this.childNodes.push(o),e.i.appendChild(o)},removeChild:function(o){this.childNodes.splice(this.childNodes.indexOf(o)>>>1,1),e.i.removeChild(o)}}),xi(Q(Iq,{context:e.context},t.__v),e.l)}function Uv(t,e){var r=Q(wq,{__v:t,i:e});return r.containerInfo=e,r}(Ed.prototype=new Vo).__a=function(t){var e=this,r=GO(e.__v),o=e.o.get(t);return o[0]++,function(n){var a=function(){e.props.revealOrder?(o.push(n),FO(e,t,o)):n()};r?r(a):a()}},Ed.prototype.render=function(t){this.u=null,this.o=new Map;var e=yo(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var r=e.length;r--;)this.o.set(e[r],this.u=[1,0,this.u]);return t.children},Ed.prototype.componentDidUpdate=Ed.prototype.componentDidMount=function(){var t=this;this.o.forEach(function(e,r){FO(t,r,e)})};var WO=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Eq=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Sq=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Cq=/[A-Z0-9]/g,kq=typeof document<"u",Tq=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function Pq(t,e,r){return e.__k==null&&(e.textContent=""),xi(t,e),typeof r=="function"&&r(),t?t.__c:null}function Oq(t,e,r){return Rv(t,e),typeof r=="function"&&r(),t?t.__c:null}Vo.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(Vo.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})});var zO=he.event;function Aq(){}function Dq(){return this.cancelBubble}function Rq(){return this.defaultPrevented}he.event=function(t){return zO&&(t=zO(t)),t.persist=Aq,t.isPropagationStopped=Dq,t.isDefaultPrevented=Rq,t.nativeEvent=t};var Vv,Nq={enumerable:!1,configurable:!0,get:function(){return this.class}},UO=he.vnode;he.vnode=function(t){typeof t.type=="string"&&function(e){var r=e.props,o=e.type,n={};for(var a in r){var i=r[a];if(!(a==="value"&&"defaultValue"in r&&i==null||kq&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&i===!0?i="":s==="ondoubleclick"?a="ondblclick":s!=="onchange"||o!=="input"&&o!=="textarea"||Tq(r.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":Sq.test(a)?a=s:o.indexOf("-")===-1&&Eq.test(a)?a=a.replace(Cq,"-$&").toLowerCase():i===null&&(i=void 0):s=a="oninput",s==="oninput"&&n[a=s]&&(a="oninputCapture"),n[a]=i}}o=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=yo(r.children).forEach(function(l){l.props.selected=n.value.indexOf(l.props.value)!=-1})),o=="select"&&n.defaultValue!=null&&(n.value=yo(r.children).forEach(function(l){l.props.selected=n.multiple?n.defaultValue.indexOf(l.props.value)!=-1:n.defaultValue==l.props.value})),r.class&&!r.className?(n.class=r.class,Object.defineProperty(n,"className",Nq)):(r.className&&!r.class||r.class&&r.className)&&(n.class=n.className=r.className),e.props=n}(t),t.$$typeof=WO,UO&&UO(t)};var VO=he.__r;he.__r=function(t){VO&&VO(t),Vv=t.__c};var HO=he.diffed;he.diffed=function(t){HO&&HO(t);var e=t.props,r=t.__e;r!=null&&t.type==="textarea"&&"value"in e&&e.value!==r.value&&(r.value=e.value==null?"":e.value),Vv=null};var Mq={ReactCurrentDispatcher:{current:{readContext:function(t){return Vv.__n[t.__c].props.value}}}};function Lq(t){return Q.bind(null,t)}function yn(t){return!!t&&t.$$typeof===WO}function Bq(t){return yn(t)&&t.type===Ae}function vn(t){return yn(t)?Mm.apply(null,arguments):t}function Fq(t){return!!t.__k&&(xi(null,t),!0)}function zq(t){return t&&(t.base||t.nodeType===1&&t)||null}var Uq=function(t,e){return t(e)},Hv=function(t,e){return t(e)},Vq=Ae;function KO(t){t()}function Hq(t){return t}function $q(){return[!1,KO]}var jq=Er,qq=yn;function Gq(t,e){var r=e(),o=P({h:{__:r,v:e}}),n=o[0].h,a=o[1];return Er(function(){n.__=r,n.v=e,Bv(n)&&a({h:n})},[t,r,e]),L(function(){return Bv(n)&&a({h:n}),t(function(){Bv(n)&&a({h:n})})},[t]),r}function Bv(t){var e,r,o=t.v,n=t.__;try{var a=o();return!((e=n)===(r=a)&&(e!==0||1/e==1/r)||e!=e&&r!=r)}catch{return!0}}var E={useState:P,useId:RO,useReducer:Ko,useEffect:L,useLayoutEffect:Er,useInsertionEffect:jq,useTransition:$q,useDeferredValue:Hq,useSyncExternalStore:Gq,startTransition:KO,useRef:H,useImperativeHandle:AO,useMemo:Tt,useCallback:Ht,useContext:Mt,useDebugValue:DO,version:"17.0.2",Children:so,render:Pq,hydrate:Oq,unmountComponentAtNode:Fq,createPortal:Uv,createElement:Q,createContext:Rt,createFactory:Lq,cloneElement:vn,createRef:Ov,Fragment:Ae,isValidElement:yn,isElement:qq,isFragment:Bq,findDOMNode:zq,Component:Vo,PureComponent:zv,memo:xq,forwardRef:K,flushSync:Hv,unstable_batchedUpdates:Uq,StrictMode:Vq,Suspense:Fm,SuspenseList:Ed,lazy:vq,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Mq};function Wq(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function Kq(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Ql=function(){function t(r){var o=this;this._insertTag=function(n){var a;o.tags.length===0?o.insertionPoint?a=o.insertionPoint.nextSibling:o.prepend?a=o.container.firstChild:a=o.before:a=o.tags[o.tags.length-1].nextSibling,o.container.insertBefore(n,a),o.tags.push(n)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(o){o.forEach(this._insertTag)},e.insert=function(o){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Kq(this));var n=this.tags[this.tags.length-1];if(0)var a;if(this.isSpeedy){var i=Wq(n);try{i.insertRule(o,i.cssRules.length)}catch{}}else n.appendChild(document.createTextNode(o));this.ctr++},e.flush=function(){this.tags.forEach(function(o){return o.parentNode&&o.parentNode.removeChild(o)}),this.tags=[],this.ctr=0},t}();var qr="-ms-",Sd="-moz-",pt="-webkit-",zm="comm",Zl="rule",Jl="decl";var XO="@import";var Um="@keyframes";var YO=Math.abs,gs=String.fromCharCode,QO=Object.assign;function ZO(t,e){return ar(t,0)^45?(((e<<2^ar(t,0))<<2^ar(t,1))<<2^ar(t,2))<<2^ar(t,3):0}function Vm(t){return t.trim()}function $v(t,e){return(t=e.exec(t))?t[0]:t}function lt(t,e,r){return t.replace(e,r)}function Cd(t,e){return t.indexOf(e)}function ar(t,e){return t.charCodeAt(e)|0}function yi(t,e,r){return t.slice(e,r)}function vo(t){return t.length}function ec(t){return t.length}function tc(t,e){return e.push(t),t}function jv(t,e){return t.map(e).join("")}var Hm=1,rc=1,JO=0,Io=0,mr=0,nc="";function kd(t,e,r,o,n,a,i){return{value:t,root:e,parent:r,type:o,props:n,children:a,line:Hm,column:rc,length:i,return:""}}function ac(t,e){return QO(kd("",null,null,"",null,null,0),t,{length:-t.length},e)}function eA(){return mr}function tA(){return mr=Io>0?ar(nc,--Io):0,rc--,mr===10&&(rc=1,Hm--),mr}function wo(){return mr=Io<JO?ar(nc,Io++):0,rc++,mr===10&&(rc=1,Hm++),mr}function In(){return ar(nc,Io)}function Td(){return Io}function ic(t,e){return yi(nc,t,e)}function oc(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $m(t){return Hm=rc=1,JO=vo(nc=t),Io=0,[]}function jm(t){return nc="",t}function sc(t){return Vm(ic(Io-1,qv(t===91?t+2:t===40?t+1:t)))}function rA(t){for(;(mr=In())&&mr<33;)wo();return oc(t)>2||oc(mr)>3?"":" "}function oA(t,e){for(;--e&&wo()&&!(mr<48||mr>102||mr>57&&mr<65||mr>70&&mr<97););return ic(t,Td()+(e<6&&In()==32&&wo()==32))}function qv(t){for(;wo();)switch(mr){case t:return Io;case 34:case 39:t!==34&&t!==39&&qv(mr);break;case 40:t===41&&qv(t);break;case 92:wo();break}return Io}function nA(t,e){for(;wo()&&t+mr!==57;)if(t+mr===84&&In()===47)break;return"/*"+ic(e,Io-1)+"*"+gs(t===47?t:wo())}function aA(t){for(;!oc(In());)wo();return ic(t,Io)}function lA(t){return jm(qm("",null,null,null,[""],t=$m(t),0,[0],t))}function qm(t,e,r,o,n,a,i,s,l){for(var c=0,u=0,d=i,p=0,m=0,h=0,g=1,_=1,x=1,b=0,y="",I=n,w=a,v=o,T=y;_;)switch(h=b,b=wo()){case 40:if(h!=108&&ar(T,d-1)==58){Cd(T+=lt(sc(b),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:T+=sc(b);break;case 9:case 10:case 13:case 32:T+=rA(h);break;case 92:T+=oA(Td()-1,7);continue;case 47:switch(In()){case 42:case 47:tc(Xq(nA(wo(),Td()),e,r),l);break;default:T+="/"}break;case 123*g:s[c++]=vo(T)*x;case 125*g:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:m>0&&vo(T)-d&&tc(m>32?sA(T+";",o,r,d-1):sA(lt(T," ","")+";",o,r,d-2),l);break;case 59:T+=";";default:if(tc(v=iA(T,e,r,c,u,n,s,y,I=[],w=[],d),a),b===123)if(u===0)qm(T,e,v,v,I,a,d,s,w);else switch(p===99&&ar(T,3)===110?100:p){case 100:case 109:case 115:qm(t,v,v,o&&tc(iA(t,v,v,0,0,n,s,y,n,I=[],d),w),n,w,d,s,o?I:w);break;default:qm(T,v,v,v,[""],w,0,s,w)}}c=u=m=0,g=x=1,y=T="",d=i;break;case 58:d=1+vo(T),m=h;default:if(g<1){if(b==123)--g;else if(b==125&&g++==0&&tA()==125)continue}switch(T+=gs(b),b*g){case 38:x=u>0?1:(T+="\f",-1);break;case 44:s[c++]=(vo(T)-1)*x,x=1;break;case 64:In()===45&&(T+=sc(wo())),p=In(),u=d=vo(y=T+=aA(Td())),b++;break;case 45:h===45&&vo(T)==2&&(g=0)}}return a}function iA(t,e,r,o,n,a,i,s,l,c,u){for(var d=n-1,p=n===0?a:[""],m=ec(p),h=0,g=0,_=0;h<o;++h)for(var x=0,b=yi(t,d+1,d=YO(g=i[h])),y=t;x<m;++x)(y=Vm(g>0?p[x]+" "+b:lt(b,/&\f/g,p[x])))&&(l[_++]=y);return kd(t,e,r,n===0?Zl:s,l,c,u)}function Xq(t,e,r){return kd(t,e,r,zm,gs(eA()),yi(t,2,-2),0)}function sA(t,e,r,o){return kd(t,e,r,Jl,yi(t,0,o),yi(t,o+1,-1),o)}function _s(t,e){for(var r="",o=ec(t),n=0;n<o;n++)r+=e(t[n],n,t,e)||"";return r}function cA(t,e,r,o){switch(t.type){case XO:case Jl:return t.return=t.return||t.value;case zm:return"";case Um:return t.return=t.value+"{"+_s(t.children,o)+"}";case Zl:t.value=t.props.join(",")}return vo(r=_s(t.children,o))?t.return=t.value+"{"+r+"}":""}function uA(t){var e=ec(t);return function(r,o,n,a){for(var i="",s=0;s<e;s++)i+=t[s](r,o,n,a)||"";return i}}function dA(t){return function(e){e.root||(e=e.return)&&t(e)}}function Yq(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var fA=Yq;var Qq=function(e,r,o){for(var n=0,a=0;n=a,a=In(),n===38&&a===12&&(r[o]=1),!oc(a);)wo();return ic(e,Io)},Zq=function(e,r){var o=-1,n=44;do switch(oc(n)){case 0:n===38&&In()===12&&(r[o]=1),e[o]+=Qq(Io-1,r,o);break;case 2:e[o]+=sc(n);break;case 4:if(n===44){e[++o]=In()===58?"&\f":"",r[o]=e[o].length;break}default:e[o]+=gs(n)}while(n=wo());return e},Jq=function(e,r){return jm(Zq($m(e),r))},pA=new WeakMap,eG=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var r=e.value,o=e.parent,n=e.column===o.column&&e.line===o.line;o.type!=="rule";)if(o=o.parent,!o)return;if(!(e.props.length===1&&r.charCodeAt(0)!==58&&!pA.get(o))&&!n){pA.set(e,!0);for(var a=[],i=Jq(r,a),s=o.props,l=0,c=0;l<i.length;l++)for(var u=0;u<s.length;u++,c++)e.props[c]=a[l]?i[l].replace(/&\f/g,s[u]):s[u]+" "+i[l]}}},tG=function(e){if(e.type==="decl"){var r=e.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(e.return="",e.value="")}};function mA(t,e){switch(ZO(t,e)){case 5103:return pt+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return pt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return pt+t+Sd+t+qr+t+t;case 6828:case 4268:return pt+t+qr+t+t;case 6165:return pt+t+qr+"flex-"+t+t;case 5187:return pt+t+lt(t,/(\w+).+(:[^]+)/,pt+"box-$1$2"+qr+"flex-$1$2")+t;case 5443:return pt+t+qr+"flex-item-"+lt(t,/flex-|-self/,"")+t;case 4675:return pt+t+qr+"flex-line-pack"+lt(t,/align-content|flex-|-self/,"")+t;case 5548:return pt+t+qr+lt(t,"shrink","negative")+t;case 5292:return pt+t+qr+lt(t,"basis","preferred-size")+t;case 6060:return pt+"box-"+lt(t,"-grow","")+pt+t+qr+lt(t,"grow","positive")+t;case 4554:return pt+lt(t,/([^-])(transform)/g,"$1"+pt+"$2")+t;case 6187:return lt(lt(lt(t,/(zoom-|grab)/,pt+"$1"),/(image-set)/,pt+"$1"),t,"")+t;case 5495:case 3959:return lt(t,/(image-set\([^]*)/,pt+"$1$`$1");case 4968:return lt(lt(t,/(.+:)(flex-)?(.*)/,pt+"box-pack:$3"+qr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+pt+t+t;case 4095:case 3583:case 4068:case 2532:return lt(t,/(.+)-inline(.+)/,pt+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(vo(t)-1-e>6)switch(ar(t,e+1)){case 109:if(ar(t,e+4)!==45)break;case 102:return lt(t,/(.+:)(.+)-([^]+)/,"$1"+pt+"$2-$3$1"+Sd+(ar(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Cd(t,"stretch")?mA(lt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(ar(t,e+1)!==115)break;case 6444:switch(ar(t,vo(t)-3-(~Cd(t,"!important")&&10))){case 107:return lt(t,":",":"+pt)+t;case 101:return lt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+pt+(ar(t,14)===45?"inline-":"")+"box$3$1"+pt+"$2$3$1"+qr+"$2box$3")+t}break;case 5936:switch(ar(t,e+11)){case 114:return pt+t+qr+lt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return pt+t+qr+lt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return pt+t+qr+lt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return pt+t+qr+t+t}return t}var rG=function(e,r,o,n){if(e.length>-1&&!e.return)switch(e.type){case Jl:e.return=mA(e.value,e.length);break;case Um:return _s([ac(e,{value:lt(e.value,"@","@"+pt)})],n);case Zl:if(e.length)return jv(e.props,function(a){switch($v(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return _s([ac(e,{props:[lt(a,/:(read-\w+)/,":"+Sd+"$1")]})],n);case"::placeholder":return _s([ac(e,{props:[lt(a,/:(plac\w+)/,":"+pt+"input-$1")]}),ac(e,{props:[lt(a,/:(plac\w+)/,":"+Sd+"$1")]}),ac(e,{props:[lt(a,/:(plac\w+)/,qr+"input-$1")]})],n)}return""})}},oG=[rG],nG=function(e){var r=e.key;if(r==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(g){var _=g.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var n=e.stylisPlugins||oG,a={},i,s=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(g){for(var _=g.getAttribute("data-emotion").split(" "),x=1;x<_.length;x++)a[_[x]]=!0;s.push(g)});var l,c=[eG,tG];{var u,d=[cA,dA(function(g){u.insert(g)})],p=uA(c.concat(n,d)),m=function(_){return _s(lA(_),p)};l=function(_,x,b,y){u=b,m(_?_+"{"+x.styles+"}":x.styles),y&&(h.inserted[x.name]=!0)}}var h={key:r,sheet:new Ql({key:r,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:l};return h.sheet.hydrate(s),h},hA=nG;function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},ht.apply(this,arguments)}var _G=!0;var xG=function(e,r,o){var n=e.key+"-"+r.name;(o===!1||_G===!1)&&e.registered[n]===void 0&&(e.registered[n]=r.styles)},Qv=function(e,r,o){xG(e,r,o);var n=e.key+"-"+r.name;if(e.inserted[r.name]===void 0){var a=r;do{var i=e.insert(r===a?"."+n:"",a,e.sheet,!0);a=a.next}while(a!==void 0)}};function bG(t){for(var e=0,r,o=0,n=t.length;n>=4;++o,n-=4)r=t.charCodeAt(o)&255|(t.charCodeAt(++o)&255)<<8|(t.charCodeAt(++o)&255)<<16|(t.charCodeAt(++o)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(n){case 3:e^=(t.charCodeAt(o+2)&255)<<16;case 2:e^=(t.charCodeAt(o+1)&255)<<8;case 1:e^=t.charCodeAt(o)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var kA=bG;var yG={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},TA=yG;var vG=/[A-Z]|^ms/g,IG=/_EMO_([^_]+?)_([^]*?)_EMO_/g,DA=function(e){return e.charCodeAt(1)===45},PA=function(e){return e!=null&&typeof e!="boolean"},Zv=fA(function(t){return DA(t)?t:t.replace(vG,"-$&").toLowerCase()}),OA=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(IG,function(o,n,a){return ia={name:n,styles:a,next:ia},n})}return TA[e]!==1&&!DA(e)&&typeof r=="number"&&r!==0?r+"px":r};function Pd(t,e,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return ia={name:r.name,styles:r.styles,next:ia},r.name;if(r.styles!==void 0){var o=r.next;if(o!==void 0)for(;o!==void 0;)ia={name:o.name,styles:o.styles,next:ia},o=o.next;var n=r.styles+";";return n}return wG(t,e,r)}case"function":{if(t!==void 0){var a=ia,i=r(t);return ia=a,Pd(t,e,i)}break}case"string":if(0)var s,l;break}if(e==null)return r;var c=e[r];return c!==void 0?c:r}function wG(t,e,r){var o="";if(Array.isArray(r))for(var n=0;n<r.length;n++)o+=Pd(t,e,r[n])+";";else for(var a in r){var i=r[a];if(typeof i!="object")e!=null&&e[i]!==void 0?o+=a+"{"+e[i]+"}":PA(i)&&(o+=Zv(a)+":"+OA(a,i)+";");else if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var s=0;s<i.length;s++)PA(i[s])&&(o+=Zv(a)+":"+OA(a,i[s])+";");else{var l=Pd(t,e,i);switch(a){case"animation":case"animationName":{o+=Zv(a)+":"+l+";";break}default:o+=a+"{"+l+"}"}}}return o}var AA=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var ia,Jv=function(e,r,o){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";ia=void 0;var i=e[0];i==null||i.raw===void 0?(n=!1,a+=Pd(o,r,i)):a+=i[0];for(var s=1;s<e.length;s++)a+=Pd(o,r,e[s]),n&&(a+=i[s]);var l;AA.lastIndex=0;for(var c="",u;(u=AA.exec(a))!==null;)c+="-"+u[1];var d=kA(a)+c;return{name:d,styles:a,next:ia}};var SG={}.hasOwnProperty,RA=Rt(typeof HTMLElement<"u"?hA({key:"css"}):null),Dke=RA.Provider;var NA=function(e){return K(function(r,o){var n=Mt(RA);return e(r,n,o)})},MA=Rt({});var Vke=wv(CA());var lc=NA(function(t,e){var r=t.styles,o=Jv([r],void 0,Mt(MA)),n=H();return Er(function(){var a=e.key+"-global",i=new Ql({key:a,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+a+" "+o.name+'"]');return e.sheet.tags.length&&(i.before=e.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",a),i.hydrate([l])),n.current=[i,s],function(){i.flush()}},[e]),Er(function(){var a=n.current,i=a[0],s=a[1];if(s){a[1]=!1;return}if(o.next!==void 0&&Qv(e,o.next,!0),i.tags.length){var l=i.tags[i.tags.length-1].nextElementSibling;i.before=l,i.flush()}e.insert("",o,i,!1)},[e,o.name]),null});var CG=Object.defineProperty,kG=Object.defineProperties,TG=Object.getOwnPropertyDescriptors,LA=Object.getOwnPropertySymbols,PG=Object.prototype.hasOwnProperty,OG=Object.prototype.propertyIsEnumerable,BA=(t,e,r)=>e in t?CG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,AG=(t,e)=>{for(var r in e||(e={}))PG.call(e,r)&&BA(t,r,e[r]);if(LA)for(var r of LA(e))OG.call(e,r)&&BA(t,r,e[r]);return t},DG=(t,e)=>kG(t,TG(e));function FA({theme:t}){return E.createElement(lc,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},body:DG(AG({},t.fn.fontStyles()),{backgroundColor:t.colorScheme==="dark"?t.colors.dark[7]:t.white,color:t.colorScheme==="dark"?t.colors.dark[0]:t.black,lineHeight:t.lineHeight,fontSize:t.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function rh(t,e,r){Object.keys(e).forEach(o=>{t[`--mantine-${r}-${o}`]=typeof e[o]=="number"?`${e[o]}px`:e[o]})}function zA({theme:t}){let e={"--mantine-color-white":t.white,"--mantine-color-black":t.black,"--mantine-transition-timing-function":t.transitionTimingFunction,"--mantine-line-height":`${t.lineHeight}`,"--mantine-font-family":t.fontFamily,"--mantine-font-family-monospace":t.fontFamilyMonospace,"--mantine-font-family-headings":t.headings.fontFamily,"--mantine-heading-font-weight":`${t.headings.fontWeight}`};rh(e,t.shadows,"shadow"),rh(e,t.fontSizes,"font-size"),rh(e,t.radius,"radius"),rh(e,t.spacing,"spacing"),Object.keys(t.colors).forEach(o=>{t.colors[o].forEach((n,a)=>{e[`--mantine-color-${o}-${a}`]=n})});let r=t.headings.sizes;return Object.keys(r).forEach(o=>{e[`--mantine-${o}-font-size`]=`${r[o].fontSize}px`,e[`--mantine-${o}-line-height`]=`${r[o].lineHeight}`}),E.createElement(lc,{styles:{":root":e}})}var RG=Object.defineProperty,NG=Object.defineProperties,MG=Object.getOwnPropertyDescriptors,UA=Object.getOwnPropertySymbols,LG=Object.prototype.hasOwnProperty,BG=Object.prototype.propertyIsEnumerable,VA=(t,e,r)=>e in t?RG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xs=(t,e)=>{for(var r in e||(e={}))LG.call(e,r)&&VA(t,r,e[r]);if(UA)for(var r of UA(e))BG.call(e,r)&&VA(t,r,e[r]);return t},HA=(t,e)=>NG(t,MG(e));function FG(t,e){return e?Object.keys(t).reduce((r,o)=>{if(o==="headings"&&e.headings){let n=e.headings.sizes?Object.keys(t.headings.sizes).reduce((a,i)=>(a[i]=xs(xs({},t.headings.sizes[i]),e.headings.sizes[i]),a),{}):t.headings.sizes;return HA(xs({},r),{headings:HA(xs(xs({},t.headings),e.headings),{sizes:n})})}return r[o]=typeof e[o]=="object"?xs(xs({},t[o]),e[o]):typeof e[o]=="number"?e[o]:e[o]||t[o],r},{}):t}function $A(t,e){return Om(FG(t,e))}function jA(t){return Object.keys(t).reduce((e,r)=>(t[r]!==void 0&&(e[r]=t[r]),e),{})}var zG={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:"1px dotted ButtonText"},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"},"[hidden]":{display:"none"}};function qA(){return E.createElement(lc,{styles:zG})}var UG=Object.defineProperty,GA=Object.getOwnPropertySymbols,VG=Object.prototype.hasOwnProperty,HG=Object.prototype.propertyIsEnumerable,WA=(t,e,r)=>e in t?UG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Qo=(t,e)=>{for(var r in e||(e={}))VG.call(e,r)&&WA(t,r,e[r]);if(GA)for(var r of GA(e))HG.call(e,r)&&WA(t,r,e[r]);return t},cc=Rt({theme:Am,styles:{},classNames:{},emotionOptions:{key:"mantine",prepend:!0},defaultProps:{}});function Lt(){var t;return((t=Mt(cc))==null?void 0:t.theme)||Am}function KA(t){let e=Mt(cc);return{styles:e.styles[t]||{},classNames:e.classNames[t]||{}}}function XA(){var t;return((t=Mt(cc))==null?void 0:t.emotionOptions)||{key:"mantine",prepend:!0}}function ue(t,e,r){var o,n;let a=((n=(o=Mt(cc))==null?void 0:o.defaultProps)==null?void 0:n[t])||{};return Qo(Qo(Qo({},e),a),jA(r))}function oh({theme:t,styles:e={},classNames:r={},defaultProps:o={},emotionOptions:n,withNormalizeCSS:a=!1,withGlobalStyles:i=!1,withCSSVariables:s=!1,inherit:l=!1,children:c}){let u=Mt(cc),d={themeOverride:l?Qo(Qo({},u.theme),t):t,emotionOptions:l?Qo(Qo({},u.emotionOptions),n):n,styles:l?Qo(Qo({},u.styles),e):e,classNames:l?Qo(Qo({},u.classNames),r):r,defaultProps:l?Qo(Qo({},u.defaultProps),o):o},p=$A(Am,d.themeOverride);return E.createElement(cc.Provider,{value:{theme:p,styles:d.styles,classNames:d.classNames,emotionOptions:d.emotionOptions,defaultProps:d.defaultProps}},a&&E.createElement(qA,null),i&&E.createElement(FA,{theme:p}),s&&E.createElement(zA,{theme:p}),c)}oh.displayName="@mantine/core/MantineProvider";var $G={app:100,modal:200,popover:300,overlay:400};function $t(t){return $G[t]}var YA=Object.getOwnPropertySymbols,jG=Object.prototype.hasOwnProperty,qG=Object.prototype.propertyIsEnumerable,GG=(t,e)=>{var r={};for(var o in t)jG.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&YA)for(var o of YA(t))e.indexOf(o)<0&&qG.call(t,o)&&(r[o]=t[o]);return r};function Gr(t){let e=t,{m:r,mx:o,my:n,mt:a,mb:i,ml:s,mr:l,p:c,px:u,py:d,pt:p,pb:m,pl:h,pr:g}=e,_=GG(e,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr"]),x={m:r,mx:o,my:n,mt:a,mb:i,ml:s,mr:l,p:c,px:u,py:d,pt:p,pb:m,pl:h,pr:g};return Object.keys(x).forEach(b=>{x[b]===void 0&&delete x[b]}),{systemStyles:x,rest:_}}function QA(t){let e={};return Object.keys(t).forEach(r=>{let[o,n]=t[r];e[o]=n}),e}function ZA(t){var e,r,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=ZA(t[e]))&&(o&&(o+=" "),o+=r);else for(e in t)t[e]&&(o&&(o+=" "),o+=e);return o}function JA(){for(var t=0,e,r,o="";t<arguments.length;)(e=arguments[t++])&&(r=ZA(e))&&(o&&(o+=" "),o+=r);return o}function WG(t){for(var e=0,r,o=0,n=t.length;n>=4;++o,n-=4)r=t.charCodeAt(o)&255|(t.charCodeAt(++o)&255)<<8|(t.charCodeAt(++o)&255)<<16|(t.charCodeAt(++o)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(n){case 3:e^=(t.charCodeAt(o+2)&255)<<16;case 2:e^=(t.charCodeAt(o+1)&255)<<8;case 1:e^=t.charCodeAt(o)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var eD=WG;var KG={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},tD=KG;function XG(t){var e=Object.create(null);return function(r){return e[r]===void 0&&(e[r]=t(r)),e[r]}}var rD=XG;var YG=/[A-Z]|^ms/g,QG=/_EMO_([^_]+?)_([^]*?)_EMO_/g,iD=function(e){return e.charCodeAt(1)===45},oD=function(e){return e!=null&&typeof e!="boolean"},eI=rD(function(t){return iD(t)?t:t.replace(YG,"-$&").toLowerCase()}),nD=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(QG,function(o,n,a){return sa={name:n,styles:a,next:sa},n})}return tD[e]!==1&&!iD(e)&&typeof r=="number"&&r!==0?r+"px":r};function Od(t,e,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return sa={name:r.name,styles:r.styles,next:sa},r.name;if(r.styles!==void 0){var o=r.next;if(o!==void 0)for(;o!==void 0;)sa={name:o.name,styles:o.styles,next:sa},o=o.next;var n=r.styles+";";return n}return ZG(t,e,r)}case"function":{if(t!==void 0){var a=sa,i=r(t);return sa=a,Od(t,e,i)}break}case"string":if(0)var s,l;break}if(e==null)return r;var c=e[r];return c!==void 0?c:r}function ZG(t,e,r){var o="";if(Array.isArray(r))for(var n=0;n<r.length;n++)o+=Od(t,e,r[n])+";";else for(var a in r){var i=r[a];if(typeof i!="object")e!=null&&e[i]!==void 0?o+=a+"{"+e[i]+"}":oD(i)&&(o+=eI(a)+":"+nD(a,i)+";");else if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var s=0;s<i.length;s++)oD(i[s])&&(o+=eI(a)+":"+nD(a,i[s])+";");else{var l=Od(t,e,i);switch(a){case"animation":case"animationName":{o+=eI(a)+":"+l+";";break}default:o+=a+"{"+l+"}"}}}return o}var aD=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var sa,sD=function(e,r,o){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,a="";sa=void 0;var i=e[0];i==null||i.raw===void 0?(n=!1,a+=Od(o,r,i)):a+=i[0];for(var s=1;s<e.length;s++)a+=Od(o,r,e[s]),n&&(a+=i[s]);var l;aD.lastIndex=0;for(var c="",u;(u=aD.exec(a))!==null;)c+="-"+u[1];var d=eD(a)+c;return{name:d,styles:a,next:sa}};var JG=!0;function lD(t,e,r){var o="";return r.split(" ").forEach(function(n){t[n]!==void 0?e.push(t[n]+";"):o+=n+" "}),o}var cD=function(e,r,o){var n=e.key+"-"+r.name;if((o===!1||JG===!1)&&e.registered[n]===void 0&&(e.registered[n]=r.styles),e.inserted[r.name]===void 0){var a=r;do{var i=e.insert(r===a?"."+n:"",a,e.sheet,!0);a=a.next}while(a!==void 0)}};function uD(t,e){let r=H();return(!r.current||e.length!==r.current.prevDeps.length||r.current.prevDeps.map((o,n)=>o===e[n]).indexOf(!1)>=0)&&(r.current={v:t(),prevDeps:[...e]}),r.current.v}var Rr="-ms-",uc="-moz-",ct="-webkit-",nh="comm",dc="rule",fc="decl";var dD="@import";var ah="@keyframes";var fD=Math.abs,bs=String.fromCharCode,pD=Object.assign;function mD(t,e){return(((e<<2^Wr(t,0))<<2^Wr(t,1))<<2^Wr(t,2))<<2^Wr(t,3)}function ih(t){return t.trim()}function hD(t,e){return(t=e.exec(t))?t[0]:t}function ut(t,e,r){return t.replace(e,r)}function Ad(t,e){return t.indexOf(e)}function Wr(t,e){return t.charCodeAt(e)|0}function vi(t,e,r){return t.slice(e,r)}function Eo(t){return t.length}function pc(t){return t.length}function mc(t,e){return e.push(t),t}function gD(t,e){return t.map(e).join("")}var sh=1,hc=1,_D=0,So=0,hr=0,_c="";function Dd(t,e,r,o,n,a,i){return{value:t,root:e,parent:r,type:o,props:n,children:a,line:sh,column:hc,length:i,return:""}}function xc(t,e){return pD(Dd("",null,null,"",null,null,0),t,{length:-t.length},e)}function xD(){return hr}function bD(){return hr=So>0?Wr(_c,--So):0,hc--,hr===10&&(hc=1,sh--),hr}function Co(){return hr=So<_D?Wr(_c,So++):0,hc++,hr===10&&(hc=1,sh++),hr}function wn(){return Wr(_c,So)}function Rd(){return So}function bc(t,e){return vi(_c,t,e)}function gc(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function lh(t){return sh=hc=1,_D=Eo(_c=t),So=0,[]}function ch(t){return _c="",t}function yc(t){return ih(bc(So-1,tI(t===91?t+2:t===40?t+1:t)))}function yD(t){for(;(hr=wn())&&hr<33;)Co();return gc(t)>2||gc(hr)>3?"":" "}function vD(t,e){for(;--e&&Co()&&!(hr<48||hr>102||hr>57&&hr<65||hr>70&&hr<97););return bc(t,Rd()+(e<6&&wn()==32&&Co()==32))}function tI(t){for(;Co();)switch(hr){case t:return So;case 34:case 39:t!==34&&t!==39&&tI(hr);break;case 40:t===41&&tI(t);break;case 92:Co();break}return So}function ID(t,e){for(;Co()&&t+hr!==57;)if(t+hr===84&&wn()===47)break;return"/*"+bc(e,So-1)+"*"+bs(t===47?t:Co())}function wD(t){for(;!gc(wn());)Co();return bc(t,So)}function CD(t){return ch(uh("",null,null,null,[""],t=lh(t),0,[0],t))}function uh(t,e,r,o,n,a,i,s,l){for(var c=0,u=0,d=i,p=0,m=0,h=0,g=1,_=1,x=1,b=0,y="",I=n,w=a,v=o,T=y;_;)switch(h=b,b=Co()){case 40:if(h!=108&&T.charCodeAt(d-1)==58){Ad(T+=ut(yc(b),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:T+=yc(b);break;case 9:case 10:case 13:case 32:T+=yD(h);break;case 92:T+=vD(Rd()-1,7);continue;case 47:switch(wn()){case 42:case 47:mc(eW(ID(Co(),Rd()),e,r),l);break;default:T+="/"}break;case 123*g:s[c++]=Eo(T)*x;case 125*g:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:m>0&&Eo(T)-d&&mc(m>32?SD(T+";",o,r,d-1):SD(ut(T," ","")+";",o,r,d-2),l);break;case 59:T+=";";default:if(mc(v=ED(T,e,r,c,u,n,s,y,I=[],w=[],d),a),b===123)if(u===0)uh(T,e,v,v,I,a,d,s,w);else switch(p){case 100:case 109:case 115:uh(t,v,v,o&&mc(ED(t,v,v,0,0,n,s,y,n,I=[],d),w),n,w,d,s,o?I:w);break;default:uh(T,v,v,v,[""],w,0,s,w)}}c=u=m=0,g=x=1,y=T="",d=i;break;case 58:d=1+Eo(T),m=h;default:if(g<1){if(b==123)--g;else if(b==125&&g++==0&&bD()==125)continue}switch(T+=bs(b),b*g){case 38:x=u>0?1:(T+="\f",-1);break;case 44:s[c++]=(Eo(T)-1)*x,x=1;break;case 64:wn()===45&&(T+=yc(Co())),p=wn(),u=d=Eo(y=T+=wD(Rd())),b++;break;case 45:h===45&&Eo(T)==2&&(g=0)}}return a}function ED(t,e,r,o,n,a,i,s,l,c,u){for(var d=n-1,p=n===0?a:[""],m=pc(p),h=0,g=0,_=0;h<o;++h)for(var x=0,b=vi(t,d+1,d=fD(g=i[h])),y=t;x<m;++x)(y=ih(g>0?p[x]+" "+b:ut(b,/&\f/g,p[x])))&&(l[_++]=y);return Dd(t,e,r,n===0?dc:s,l,c,u)}function eW(t,e,r){return Dd(t,e,r,nh,bs(xD()),vi(t,2,-2),0)}function SD(t,e,r,o){return Dd(t,e,r,fc,vi(t,0,o),vi(t,o+1,-1),o)}function rI(t,e){switch(mD(t,e)){case 5103:return ct+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ct+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return ct+t+uc+t+Rr+t+t;case 6828:case 4268:return ct+t+Rr+t+t;case 6165:return ct+t+Rr+"flex-"+t+t;case 5187:return ct+t+ut(t,/(\w+).+(:[^]+)/,ct+"box-$1$2"+Rr+"flex-$1$2")+t;case 5443:return ct+t+Rr+"flex-item-"+ut(t,/flex-|-self/,"")+t;case 4675:return ct+t+Rr+"flex-line-pack"+ut(t,/align-content|flex-|-self/,"")+t;case 5548:return ct+t+Rr+ut(t,"shrink","negative")+t;case 5292:return ct+t+Rr+ut(t,"basis","preferred-size")+t;case 6060:return ct+"box-"+ut(t,"-grow","")+ct+t+Rr+ut(t,"grow","positive")+t;case 4554:return ct+ut(t,/([^-])(transform)/g,"$1"+ct+"$2")+t;case 6187:return ut(ut(ut(t,/(zoom-|grab)/,ct+"$1"),/(image-set)/,ct+"$1"),t,"")+t;case 5495:case 3959:return ut(t,/(image-set\([^]*)/,ct+"$1$`$1");case 4968:return ut(ut(t,/(.+:)(flex-)?(.*)/,ct+"box-pack:$3"+Rr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ct+t+t;case 4095:case 3583:case 4068:case 2532:return ut(t,/(.+)-inline(.+)/,ct+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Eo(t)-1-e>6)switch(Wr(t,e+1)){case 109:if(Wr(t,e+4)!==45)break;case 102:return ut(t,/(.+:)(.+)-([^]+)/,"$1"+ct+"$2-$3$1"+uc+(Wr(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Ad(t,"stretch")?rI(ut(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Wr(t,e+1)!==115)break;case 6444:switch(Wr(t,Eo(t)-3-(~Ad(t,"!important")&&10))){case 107:return ut(t,":",":"+ct)+t;case 101:return ut(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ct+(Wr(t,14)===45?"inline-":"")+"box$3$1"+ct+"$2$3$1"+Rr+"$2box$3")+t}break;case 5936:switch(Wr(t,e+11)){case 114:return ct+t+Rr+ut(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return ct+t+Rr+ut(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return ct+t+Rr+ut(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return ct+t+Rr+t+t}return t}function Ii(t,e){for(var r="",o=pc(t),n=0;n<o;n++)r+=e(t[n],n,t,e)||"";return r}function kD(t,e,r,o){switch(t.type){case dD:case fc:return t.return=t.return||t.value;case nh:return"";case ah:return t.return=t.value+"{"+Ii(t.children,o)+"}";case dc:t.value=t.props.join(",")}return Eo(r=Ii(t.children,o))?t.return=t.value+"{"+r+"}":""}function TD(t){var e=pc(t);return function(r,o,n,a){for(var i="",s=0;s<e;s++)i+=t[s](r,o,n,a)||"";return i}}function PD(t){return function(e){e.root||(e=e.return)&&t(e)}}function OD(t,e,r,o){if(t.length>-1&&!t.return)switch(t.type){case fc:t.return=rI(t.value,t.length);break;case ah:return Ii([xc(t,{value:ut(t.value,"@","@"+ct)})],o);case dc:if(t.length)return gD(t.props,function(n){switch(hD(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ii([xc(t,{props:[ut(n,/:(read-\w+)/,":"+uc+"$1")]})],o);case"::placeholder":return Ii([xc(t,{props:[ut(n,/:(plac\w+)/,":"+ct+"input-$1")]}),xc(t,{props:[ut(n,/:(plac\w+)/,":"+uc+"$1")]}),xc(t,{props:[ut(n,/:(plac\w+)/,Rr+"input-$1")]})],o)}return""})}}var tW=function(e,r,o){for(var n=0,a=0;n=a,a=wn(),n===38&&a===12&&(r[o]=1),!gc(a);)Co();return bc(e,So)},rW=function(e,r){var o=-1,n=44;do switch(gc(n)){case 0:n===38&&wn()===12&&(r[o]=1),e[o]+=tW(So-1,r,o);break;case 2:e[o]+=yc(n);break;case 4:if(n===44){e[++o]=wn()===58?"&\f":"",r[o]=e[o].length;break}default:e[o]+=bs(n)}while(n=Co());return e},oW=function(e,r){return ch(rW(lh(e),r))},AD=new WeakMap,nW=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var r=e.value,o=e.parent,n=e.column===o.column&&e.line===o.line;o.type!=="rule";)if(o=o.parent,!o)return;if(!(e.props.length===1&&r.charCodeAt(0)!==58&&!AD.get(o))&&!n){AD.set(e,!0);for(var a=[],i=oW(r,a),s=o.props,l=0,c=0;l<i.length;l++)for(var u=0;u<s.length;u++,c++)e.props[c]=a[l]?i[l].replace(/&\f/g,s[u]):s[u]+" "+i[l]}}},aW=function(e){if(e.type==="decl"){var r=e.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(e.return="",e.value="")}};var iW=[OD],sW=function(e){var r=e.key;if(r==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(g){var _=g.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var n=e.stylisPlugins||iW,a={},i,s=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(g){for(var _=g.getAttribute("data-emotion").split(" "),x=1;x<_.length;x++)a[_[x]]=!0;s.push(g)});var l,c=[nW,aW];{var u,d=[kD,PD(function(g){u.insert(g)})],p=TD(c.concat(n,d)),m=function(_){return Ii(CD(_),p)};l=function(_,x,b,y){u=b,m(_?_+"{"+x.styles+"}":x.styles),y&&(h.inserted[x.name]=!0)}}var h={key:r,sheet:new Ql({key:r,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:l};return h.sheet.hydrate(s),h},DD=sW;var RD={key:"mantine",prepend:!0},{getCache:lW}=(()=>{let t,e=RD.key;function r(o){return(t===void 0||e!==o?.key)&&(e=o?.key||"mantine",t=DD(o?.key?o:RD)),t}return{getCache:r}})();function ND(){let t=XA();return lW(t)}var cW=Object.defineProperty,MD=Object.getOwnPropertySymbols,uW=Object.prototype.hasOwnProperty,dW=Object.prototype.propertyIsEnumerable,LD=(t,e,r)=>e in t?cW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fW=(t,e)=>{for(var r in e||(e={}))uW.call(e,r)&&LD(t,r,e[r]);if(MD)for(var r of MD(e))dW.call(e,r)&&LD(t,r,e[r]);return t},oI="ref";function pW(t){let e;if(t.length!==1)return{args:t,ref:e};let[r]=t;if(!(r instanceof Object))return{args:t,ref:e};if(!(oI in r))return{args:t,ref:e};e=r[oI];let o=fW({},r);return delete o[oI],{args:[o],ref:e}}var{cssFactory:mW}=(()=>{function t(r,o,n){let a=[],i=lD(r,a,n);return a.length<2?n:i+o(a)}function e(r){let{cache:o}=r,n=(...i)=>{let{ref:s,args:l}=pW(i),c=sD(l,o.registered);return cD(o,c,!1),`${o.key}-${c.name}${s===void 0?"":` ${s}`}`};return{css:n,cx:(...i)=>t(o.registered,n,JA(i))}}return{cssFactory:e}})();function Nd(){let t=ND();return uD(()=>mW({cache:t}),[t])}function BD(t,e,r,o,n){return Object.keys(e).reduce((a,i)=>(a[i]=t(e[i],r!==null&&r[i],o!=null&&o[i],n?`mantine-${n}-${i}`:null),a),{})}function oe(t){let e=typeof t=="function"?t:()=>t;function r(o,n){let a=Lt(),{styles:i,classNames:s}=KA(n?.name),{css:l,cx:c}=Nd();function u(g){return`__mantine-ref-${g||""}`}let d=e(a,o,u),p=typeof n?.styles=="function"?n?.styles(a):n?.styles||{},m=typeof i=="function"?i(a,o||{}):i||{},h=QA(Object.keys(d).map(g=>{let _=c(l(d[g]),l(m[g]),l(p[g]));return[g,_]}));return{classes:BD(c,h,s,n?.classNames,n?.name),cx:c,theme:a}}return r}var hW=Object.defineProperty,gW=Object.defineProperties,_W=Object.getOwnPropertyDescriptors,FD=Object.getOwnPropertySymbols,xW=Object.prototype.hasOwnProperty,bW=Object.prototype.propertyIsEnumerable,zD=(t,e,r)=>e in t?hW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Md=(t,e)=>{for(var r in e||(e={}))xW.call(e,r)&&zD(t,r,e[r]);if(FD)for(var r of FD(e))bW.call(e,r)&&zD(t,r,e[r]);return t},Ld=(t,e)=>gW(t,_W(e)),Bd={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(.9) translateY(10px)"},transitionProperty:"transform, opacity"},Fd={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:Ld(Md({},Bd),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Ld(Md({},Bd),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Ld(Md({},Bd),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Ld(Md({},Bd),{common:{transformOrigin:"top left"}}),"pop-top-right":Ld(Md({},Bd),{common:{transformOrigin:"top right"}})};function dh(t,e){return so.toArray(t).filter(r=>Array.isArray(e)?e.some(o=>o===r.type):r.type===e)}function UD(t){return so.toArray(t).filter(Boolean)}function fh({data:t}){let e=[],r=[],o=t.reduce((n,a,i)=>(a.group?n[a.group]?n[a.group].push(i):n[a.group]=[i]:r.push(i),n),{});return Object.keys(o).forEach(n=>{e.push(...o[n].map(a=>t[a]))}),e.push(...r.map(n=>t[n])),e}function yW(t,e){let r=t;for(;(r=r.parentElement)&&!r.classList.contains(e););return r}function VD(t,e){return e?Array.from(yW(e,t.parentClassName).querySelectorAll(t.elementSelector)).findIndex(r=>r===e):-1}function HD(t){let e=Rt(t);function r(o){let n=Mt(e),[a]=o.split(".");if(!n)throw new Error(`${o} component was rendered outside of ${a} component context`);return n}return[e.Provider,r]}var $D=(t,e,r)=>Number.isInteger(t)&&t>=0&&e===0?"numeric":!Number.isInteger(t)&&t>=0&&e!==0?"decimal":Number.isInteger(t)&&t<0&&e===0||!Number.isInteger(t)&&t<0&&e!==0?r==="ios"?"text":"decimal":"numeric";var jD=["mousedown","touchstart"];function nI(t,e,r){let o=H();return L(()=>{let n=a=>{var i;if(Array.isArray(r)){let s=(i=a?.target)==null?void 0:i.hasAttribute("data-ignore-outside-clicks");r.every(c=>!!c&&!c.contains(a.target))&&!s&&t()}else o.current&&!o.current.contains(a.target)&&t()};return(e||jD).forEach(a=>document.addEventListener(a,n)),()=>{(e||jD).forEach(a=>document.removeEventListener(a,n))}},[o,t,r]),o}function vW(t,e){try{return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}catch{return t.addListener(e),()=>t.removeListener(e)}}function IW(t,e){return e!==void 0?e:typeof window<"u"&&"matchMedia"in window?window.matchMedia(t).matches:!1}function qD(t,e){let[r,o]=P(IW(t,e)),n=H();return L(()=>{if("matchMedia"in window)return n.current=window.matchMedia(t),o(n.current.matches),vW(n.current,a=>o(a.matches))},[t]),r}var zd=typeof document<"u"?Er:L;function Yt(t,e){let r=H(!1);L(()=>{r.current?t():r.current=!0},e)}function aI({opened:t,transitionDuration:e,shouldReturnFocus:r=!0}){let o=H(),n=()=>{var a;o.current&&"focus"in o.current&&typeof o.current.focus=="function"&&((a=o.current)==null||a.focus())};return Yt(()=>{let a=-1,i=s=>{s.code==="Tab"&&window.clearTimeout(a)};return document.addEventListener("keydown",i),t?o.current=document.activeElement:r&&(a=window.setTimeout(n,e+10)),()=>{window.clearTimeout(a),document.removeEventListener("keydown",i)}},[t]),n}var wW=/input|select|textarea|button|object/,iI="a, input, select, textarea, button, object, [tabindex]";function EW(t){return t.style.display==="none"}function SW(t){if(t.getAttribute("aria-hidden")||t.getAttribute("hidden")||t.getAttribute("type")==="hidden")return!1;let r=t;for(;r&&r!==document.body;){if(EW(r))return!1;r=r.parentNode}return!0}function GD(t){let e=t.getAttribute("tabindex");return e===null&&(e=void 0),parseInt(e,10)}function ph(t){let e=t.nodeName.toLowerCase(),r=!Number.isNaN(GD(t));return(wW.test(e)&&!t.disabled||t instanceof HTMLAnchorElement&&t.href||r)&&SW(t)}function sI(t){let e=GD(t);return(Number.isNaN(e)||e>=0)&&ph(t)}function WD(t){return Array.from(t.querySelectorAll(iI)).filter(sI)}function KD(t,e){let r=WD(t);if(!r.length){e.preventDefault();return}if(!(r[e.shiftKey?0:r.length-1]===document.activeElement||t===document.activeElement))return;e.preventDefault();let a=r[e.shiftKey?r.length-1:0];a&&a.focus()}function XD(t,e="body > :not(script)"){let r=Array.from(document.querySelectorAll(e)).map(o=>{if(o.contains(t))return;let n=o.getAttribute("aria-hidden");return(n===null||n==="false")&&o.setAttribute("aria-hidden","true"),{node:o,ariaHidden:n}});return()=>{r.forEach(o=>{o&&(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden))})}}function lI(t=!0){let e=H(),r=H(null),o=Ht(n=>{if(t)if(r.current&&r.current(),n){let a=i=>{r.current=XD(i);let s=n.querySelector("[data-autofocus]");if(!s){let l=Array.from(n.querySelectorAll(iI));s=l.find(sI)||l.find(ph)||null,!s&&ph(n)&&(s=n)}s&&s.focus()};setTimeout(()=>{n.ownerDocument&&a(n)}),e.current=n}else e.current=null},[t]);return L(()=>{if(!t)return;let n=a=>{a.key==="Tab"&&e.current&&KD(e.current,a)};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[t]),o}var CW=t=>(t+1)%1e6;function cI(){let[,t]=Ko(CW,0);return t}function Ba(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function Fa(t,e,r){L(()=>(window.addEventListener(t,e,r),()=>window.removeEventListener(t,e,r)),[])}function kW(t){try{return JSON.stringify(t)}catch{throw new Error("@mantine/hooks use-local-storage: Failed to serialize the value")}}function TW(t){try{return JSON.parse(t)}catch{return t}}function uI({key:t,defaultValue:e=void 0,getInitialValueInEffect:r=!1,deserialize:o=TW,serialize:n=kW}){var a;let[i,s]=P(typeof window<"u"&&"localStorage"in window&&!r?o((a=window.localStorage.getItem(t))!=null?a:void 0):e??""),l=Ht(c=>{c instanceof Function?s(u=>{let d=c(u);return window.localStorage.setItem(t,n(d)),window.dispatchEvent(new CustomEvent("mantine-local-storage",{detail:{key:t,value:c(u)}})),d}):(window.localStorage.setItem(t,n(c)),window.dispatchEvent(new CustomEvent("mantine-local-storage",{detail:{key:t,value:c}})),s(c))},[t]);return Fa("storage",c=>{var u;c.storageArea===window.localStorage&&c.key===t&&s(o((u=c.newValue)!=null?u:void 0))}),Fa("mantine-local-storage",c=>{c.detail.key===t&&s(c.detail.value)}),L(()=>{e!==void 0&&i===void 0&&l(e)},[e,i,l]),L(()=>{var c;r&&s(o((c=window.localStorage.getItem(t))!=null?c:void 0)||(e??""))},[]),[i===void 0?e:i,l]}function vc(t,e){typeof t=="function"?t(e):typeof t=="object"&&t!==null&&"current"in t&&(t.current=e)}function ko(...t){return Ht(e=>{t.forEach(r=>vc(r,e))},t)}function ys(...t){return e=>{t.forEach(r=>vc(r,e))}}function vs({value:t,min:e,max:r}){return Math.min(Math.max(t,e),r)}function Zo({value:t,defaultValue:e,finalValue:r,rule:o,onChange:n,onValueUpdate:a}){let i=o(t),s=H("initial"),l=o(e)?e:r,[c,u]=P(l),d=i?t:c;!i&&s.current==="controlled"&&(d=r),s.current=i?"controlled":"uncontrolled";let p=s.current,m=h=>{typeof n=="function"&&n(h),p==="uncontrolled"&&u(h)};return L(()=>{p==="uncontrolled"&&u(d),typeof a=="function"&&a(d)},[p,d]),[d,m,s.current]}function dI({initialValues:t=[],limit:e}){let[{state:r,queue:o},n]=P({state:t.slice(0,e),queue:t.slice(e)});return{state:r,queue:o,add:(...l)=>n(c=>{let u=[...c.state,...c.queue,...l];return{state:u.slice(0,e),queue:u.slice(e)}}),update:l=>n(c=>{let u=l([...c.state,...c.queue]);return{state:u.slice(0,e),queue:u.slice(e)}}),cleanQueue:()=>n(l=>({state:l.state,queue:[]}))}}function Vn(t){return qD("(prefers-reduced-motion: reduce)",t)}var YD=t=>t<.5?2*t*t:-1+(4-2*t)*t;var QD=({axis:t,target:e,parent:r,alignment:o,offset:n,isList:a})=>{if(!e||!r&&typeof document>"u")return 0;let i=!!r,l=(r||document.body).getBoundingClientRect(),c=e.getBoundingClientRect(),u=d=>c[d]-l[d];if(t==="y"){let d=u("top");if(d===0)return 0;if(o==="start"){let m=d-n;return m<=c.height*(a?0:1)||!a?m:0}let p=i?l.height:window.innerHeight;if(o==="end"){let m=d+n-p+c.height;return m>=-c.height*(a?0:1)||!a?m:0}return o==="center"?d-p/2+c.height/2:0}if(t==="x"){let d=u("left");if(d===0)return 0;if(o==="start"){let m=d-n;return m<=c.width||!a?m:0}let p=i?l.width:window.innerWidth;if(o==="end"){let m=d+n-p+c.width;return m>=-c.width||!a?m:0}return o==="center"?d-p/2+c.width/2:0}return 0};var ZD=({axis:t,parent:e})=>{if(!e&&typeof document>"u")return 0;let r=t==="y"?"scrollTop":"scrollLeft";if(e)return e[r];let{body:o,documentElement:n}=document;return o[r]+n[r]};var JD=({axis:t,parent:e,distance:r})=>{if(!e&&typeof document>"u")return;let o=t==="y"?"scrollTop":"scrollLeft";if(e)e[o]=r;else{let{body:n,documentElement:a}=document;n[o]=r,a[o]=r}};function Ud({duration:t=1250,axis:e="y",onScrollFinish:r,easing:o=YD,offset:n=0,cancelable:a=!0,isList:i=!1}={}){let s=H(0),l=H(0),c=H(!1),u=H(null),d=H(null),p=Vn(),m=()=>{s.current&&cancelAnimationFrame(s.current)},h=Ht(({alignment:_="start"}={})=>{var x;c.current=!1,s.current&&m();let b=(x=ZD({parent:u.current,axis:e}))!=null?x:0,y=QD({parent:u.current,target:d.current,axis:e,alignment:_,offset:n,isList:i})-(u.current?0:b);function I(){l.current===0&&(l.current=performance.now());let v=performance.now()-l.current,T=p||t===0?1:v/t,O=b+y*o(T);JD({parent:u.current,axis:e,distance:O}),!c.current&&T<1?s.current=requestAnimationFrame(I):(typeof r=="function"&&r(),l.current=0,s.current=0,m())}I()},[u.current]),g=()=>{a&&(c.current=!0)};return Fa("wheel",g,{passive:!0}),Fa("touchmove",g,{passive:!0}),L(()=>m,[]),{scrollableRef:u,targetRef:d,scrollIntoView:h,cancel:m}}function eR(){if(typeof window>"u"||typeof document>"u")return 0;let t=parseInt(window.getComputedStyle(document.body).paddingRight,10),e=window.innerWidth-document.documentElement.clientWidth;return t+e}var tR=({disableBodyPadding:t})=>{let e=t?null:eR();return`body {
|
|
5
5
|
--removed-scroll-width: ${e}px;
|
|
6
6
|
touch-action: none;
|
|
7
7
|
overflow: hidden !important;
|
|
@@ -15,10 +15,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`),k=M,G=V),U===void 0&&(
|
|
|
15
15
|
`,r);return o==-1?z_:(r=Number(e.substring(r,o)),isNaN(r)?D0:(o+=1,o+r>e.length?z_:(e=e.slice(o,o+r),t.C=o+r,e)))}ae.cancel=function(){this.J=!0,Xs(this)};function Gf(t){t.Y=Date.now()+t.P,p6(t,t.P)}function p6(t,e){if(t.B!=null)throw Error("WatchDog timer not null");t.B=$f(lo(t.lb,t),e)}function tx(t){t.B&&(Ue.clearTimeout(t.B),t.B=null)}ae.lb=function(){this.B=null;let t=Date.now();0<=t-this.Y?(wse(this.j,this.A),this.L!=2&&(Ff(),Do(17)),Xs(this),this.o=2,Df(this)):p6(this,this.Y-t)};function Df(t){t.l.H==0||t.J||M6(t.l,t)}function Xs(t){tx(t);var e=t.M;e&&typeof e.sa=="function"&&e.sa(),t.M=null,K0(t.V),o6(t.U),t.g&&(e=t.g,t.g=null,e.abort(),e.sa())}function N0(t,e){try{var r=t.l;if(r.H!=0&&(r.g==t||M0(r.i,t))){if(!t.K&&M0(r.i,t)&&r.H==3){try{var o=r.Ja.g.parse(e)}catch{o=null}if(Array.isArray(o)&&o.length==3){var n=o;if(n[0]==0){e:if(!r.u){if(r.g)if(r.g.G+3e3<t.G)H_(r),ax(r);else break e;oE(r),Do(18)}}else r.Fa=n[1],0<r.Fa-r.V&&37500>n[2]&&r.G&&r.A==0&&!r.v&&(r.v=$f(lo(r.ib,r),6e3));if(1>=v6(r.i)&&r.oa){try{r.oa()}catch{}r.oa=void 0}}else Ys(r,11)}else if((t.K||r.g==t)&&H_(r),!Rf(e))for(n=r.Ja.g.parse(e),e=0;e<n.length;e++){let c=n[e];if(r.V=c[0],c=c[1],r.H==2)if(c[0]=="c"){r.K=c[1],r.pa=c[2];let u=c[3];u!=null&&(r.ra=u,r.l.info("VER="+r.ra));let d=c[4];d!=null&&(r.Ga=d,r.l.info("SVER="+r.Ga));let p=c[5];p!=null&&typeof p=="number"&&0<p&&(o=1.5*p,r.L=o,r.l.info("backChannelRequestTimeoutMs_="+o)),o=r;let m=t.g;if(m){let h=m.g?m.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(h){var a=o.i;a.g||h.indexOf("spdy")==-1&&h.indexOf("quic")==-1&&h.indexOf("h2")==-1||(a.j=a.l,a.g=new Set,a.h&&(J0(a,a.h),a.h=null))}if(o.F){let g=m.g?m.g.getResponseHeader("X-HTTP-Session-Id"):null;g&&(o.Da=g,Bt(o.I,o.F,g))}}r.H=3,r.h&&r.h.Ba(),r.ca&&(r.S=Date.now()-t.G,r.l.info("Handshake RTT: "+r.S+"ms")),o=r;var i=t;if(o.wa=F6(o,o.J?o.pa:null,o.Y),i.K){I6(o.i,i);var s=i,l=o.L;l&&s.setTimeout(l),s.B&&(tx(s),Gf(s)),o.g=i}else R6(o);0<r.j.length&&ix(r)}else c[0]!="stop"&&c[0]!="close"||Ys(r,7);else r.H==3&&(c[0]=="stop"||c[0]=="close"?c[0]=="stop"?Ys(r,7):rE(r):c[0]!="noop"&&r.h&&r.h.Aa(c),r.A=0)}}Ff(4)}catch{}}function kse(t){if(t.Z&&typeof t.Z=="function")return t.Z();if(typeof Map<"u"&&t instanceof Map||typeof Set<"u"&&t instanceof Set)return Array.from(t.values());if(typeof t=="string")return t.split("");if(G_(t)){for(var e=[],r=t.length,o=0;o<r;o++)e.push(t[o]);return e}e=[],r=0;for(o in t)e[r++]=t[o];return e}function Tse(t){if(t.ta&&typeof t.ta=="function")return t.ta();if(!t.Z||typeof t.Z!="function"){if(typeof Map<"u"&&t instanceof Map)return Array.from(t.keys());if(!(typeof Set<"u"&&t instanceof Set)){if(G_(t)||typeof t=="string"){var e=[];t=t.length;for(var r=0;r<t;r++)e.push(r);return e}e=[],r=0;for(let o in t)e[r++]=o;return e}}}function m6(t,e){if(t.forEach&&typeof t.forEach=="function")t.forEach(e,void 0);else if(G_(t)||typeof t=="string")Array.prototype.forEach.call(t,e,void 0);else for(var r=Tse(t),o=kse(t),n=o.length,a=0;a<n;a++)e.call(void 0,o[a],r&&r[a],t)}var h6=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Pse(t,e){if(t){t=t.split("&");for(var r=0;r<t.length;r++){var o=t[r].indexOf("="),n=null;if(0<=o){var a=t[r].substring(0,o);n=t[r].substring(o+1)}else a=t[r];e(a,n?decodeURIComponent(n.replace(/\+/g," ")):"")}}}function Qs(t){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,t instanceof Qs){this.h=t.h,U_(this,t.j),this.s=t.s,this.g=t.g,V_(this,t.m),this.l=t.l;var e=t.i,r=new zf;r.i=e.i,e.g&&(r.g=new Map(e.g),r.h=e.h),M5(this,r),this.o=t.o}else t&&(e=String(t).match(h6))?(this.h=!1,U_(this,e[1]||"",!0),this.s=Of(e[2]||""),this.g=Of(e[3]||"",!0),V_(this,e[4]),this.l=Of(e[5]||"",!0),M5(this,e[6]||"",!0),this.o=Of(e[7]||"")):(this.h=!1,this.i=new zf(null,this.h))}Qs.prototype.toString=function(){var t=[],e=this.j;e&&t.push(Af(e,L5,!0),":");var r=this.g;return(r||e=="file")&&(t.push("//"),(e=this.s)&&t.push(Af(e,L5,!0),"@"),t.push(encodeURIComponent(String(r)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),r=this.m,r!=null&&t.push(":",String(r))),(r=this.l)&&(this.g&&r.charAt(0)!="/"&&t.push("/"),t.push(Af(r,r.charAt(0)=="/"?Dse:Ase,!0))),(r=this.i.toString())&&t.push("?",r),(r=this.o)&&t.push("#",Af(r,Nse)),t.join("")};function Ya(t){return new Qs(t)}function U_(t,e,r){t.j=r?Of(e,!0):e,t.j&&(t.j=t.j.replace(/:$/,""))}function V_(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.m=e}else t.m=null}function M5(t,e,r){e instanceof zf?(t.i=e,Mse(t.i,t.h)):(r||(e=Af(e,Rse)),t.i=new zf(e,t.h))}function Bt(t,e,r){t.i.set(e,r)}function rx(t){return Bt(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function Of(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Af(t,e,r){return typeof t=="string"?(t=encodeURI(t).replace(e,Ose),r&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Ose(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(t&15).toString(16)}var L5=/[#\/\?@]/g,Ase=/[#\?:]/g,Dse=/[#\?]/g,Rse=/[#\?@]/g,Nse=/#/g;function zf(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function Ri(t){t.g||(t.g=new Map,t.h=0,t.i&&Pse(t.i,function(e,r){t.add(decodeURIComponent(e.replace(/\+/g," ")),r)}))}ae=zf.prototype;ae.add=function(t,e){Ri(this),this.i=null,t=Zc(this,t);var r=this.g.get(t);return r||this.g.set(t,r=[]),r.push(e),this.h+=1,this};function g6(t,e){Ri(t),e=Zc(t,e),t.g.has(e)&&(t.i=null,t.h-=t.g.get(e).length,t.g.delete(e))}function _6(t,e){return Ri(t),e=Zc(t,e),t.g.has(e)}ae.forEach=function(t,e){Ri(this),this.g.forEach(function(r,o){r.forEach(function(n){t.call(e,n,o,this)},this)},this)};ae.ta=function(){Ri(this);let t=Array.from(this.g.values()),e=Array.from(this.g.keys()),r=[];for(let o=0;o<e.length;o++){let n=t[o];for(let a=0;a<n.length;a++)r.push(e[o])}return r};ae.Z=function(t){Ri(this);let e=[];if(typeof t=="string")_6(this,t)&&(e=e.concat(this.g.get(Zc(this,t))));else{t=Array.from(this.g.values());for(let r=0;r<t.length;r++)e=e.concat(t[r])}return e};ae.set=function(t,e){return Ri(this),this.i=null,t=Zc(this,t),_6(this,t)&&(this.h-=this.g.get(t).length),this.g.set(t,[e]),this.h+=1,this};ae.get=function(t,e){return t?(t=this.Z(t),0<t.length?String(t[0]):e):e};function x6(t,e,r){g6(t,e),0<r.length&&(t.i=null,t.g.set(Zc(t,e),z0(r)),t.h+=r.length)}ae.toString=function(){if(this.i)return this.i;if(!this.g)return"";let t=[],e=Array.from(this.g.keys());for(var r=0;r<e.length;r++){var o=e[r];let a=encodeURIComponent(String(o)),i=this.Z(o);for(o=0;o<i.length;o++){var n=a;i[o]!==""&&(n+="="+encodeURIComponent(String(i[o]))),t.push(n)}}return this.i=t.join("&")};function Zc(t,e){return e=String(e),t.j&&(e=e.toLowerCase()),e}function Mse(t,e){e&&!t.j&&(Ri(t),t.i=null,t.g.forEach(function(r,o){var n=o.toLowerCase();o!=n&&(g6(this,o),x6(this,n,r))},t)),t.j=e}var Lse=class{constructor(t,e){this.g=t,this.map=e}};function b6(t){this.l=t||Bse,Ue.PerformanceNavigationTiming?(t=Ue.performance.getEntriesByType("navigation"),t=0<t.length&&(t[0].nextHopProtocol=="hq"||t[0].nextHopProtocol=="h2")):t=!!(Ue.g&&Ue.g.Ka&&Ue.g.Ka()&&Ue.g.Ka().dc),this.j=t?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var Bse=10;function y6(t){return t.h?!0:t.g?t.g.size>=t.j:!1}function v6(t){return t.h?1:t.g?t.g.size:0}function M0(t,e){return t.h?t.h==e:t.g?t.g.has(e):!1}function J0(t,e){t.g?t.g.add(e):t.h=e}function I6(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}b6.prototype.cancel=function(){if(this.i=w6(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(let t of this.g.values())t.cancel();this.g.clear()}};function w6(t){if(t.h!=null)return t.i.concat(t.h.F);if(t.g!=null&&t.g.size!==0){let e=t.i;for(let r of t.g.values())e=e.concat(r.F);return e}return z0(t.i)}var Fse=class{stringify(t){return Ue.JSON.stringify(t,void 0)}parse(t){return Ue.JSON.parse(t,void 0)}};function zse(){this.g=new Fse}function Use(t,e,r){let o=r||"";try{m6(t,function(n,a){let i=n;Vf(n)&&(i=G0(n)),e.push(o+a+"="+encodeURIComponent(i))})}catch(n){throw e.push(o+"type="+encodeURIComponent("_badmap")),n}}function Vse(t,e){let r=new Q_;if(Ue.Image){let o=new Image;o.onload=D_(B_,r,o,"TestLoadImage: loaded",!0,e),o.onerror=D_(B_,r,o,"TestLoadImage: error",!1,e),o.onabort=D_(B_,r,o,"TestLoadImage: abort",!1,e),o.ontimeout=D_(B_,r,o,"TestLoadImage: timeout",!1,e),Ue.setTimeout(function(){o.ontimeout&&o.ontimeout()},1e4),o.src=t}else e(!1)}function B_(t,e,r,o,n){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,n(o)}catch{}}function Wf(t){this.l=t.ec||null,this.j=t.ob||!1}Fr(Wf,Y0);Wf.prototype.g=function(){return new ox(this.l,this.j)};Wf.prototype.i=function(t){return function(){return t}}({});function ox(t,e){Br.call(this),this.F=t,this.u=e,this.m=void 0,this.readyState=eE,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}Fr(ox,Br);var eE=0;ae=ox.prototype;ae.open=function(t,e){if(this.readyState!=eE)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,Uf(this)};ae.send=function(t){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;let e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.F||Ue).fetch(new Request(this.B,e)).then(this.$a.bind(this),this.ka.bind(this))};ae.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Kf(this)),this.readyState=eE};ae.$a=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Uf(this)),this.g&&(this.readyState=3,Uf(this),this.g)))if(this.responseType==="arraybuffer")t.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(typeof Ue.ReadableStream<"u"&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;E6(this)}else t.text().then(this.Za.bind(this),this.ka.bind(this))};function E6(t){t.j.read().then(t.Xa.bind(t)).catch(t.ka.bind(t))}ae.Xa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?Kf(this):Uf(this),this.readyState==3&&E6(this)}};ae.Za=function(t){this.g&&(this.response=this.responseText=t,Kf(this))};ae.Ya=function(t){this.g&&(this.response=t,Kf(this))};ae.ka=function(){this.g&&Kf(this)};function Kf(t){t.readyState=4,t.l=null,t.j=null,t.A=null,Uf(t)}ae.setRequestHeader=function(t,e){this.v.append(t,e)};ae.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""};ae.getAllResponseHeaders=function(){if(!this.h)return"";let t=[],e=this.h.entries();for(var r=e.next();!r.done;)r=r.value,t.push(r[0]+": "+r[1]),r=e.next();return t.join(`\r
|
|
16
16
|
`)};function Uf(t){t.onreadystatechange&&t.onreadystatechange.call(t)}Object.defineProperty(ox.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(t){this.m=t?"include":"same-origin"}});var Hse=Ue.JSON.parse;function Jt(t){Br.call(this),this.headers=new Map,this.u=t||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=S6,this.L=this.M=!1}Fr(Jt,Br);var S6="",$se=/^https?$/i,jse=["POST","PUT"];ae=Jt.prototype;ae.Oa=function(t){this.M=t};ae.ha=function(t,e,r,o){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+t);e=e?e.toUpperCase():"GET",this.I=t,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():A0.g(),this.C=this.u?N5(this.u):N5(A0),this.g.onreadystatechange=lo(this.La,this);try{this.G=!0,this.g.open(e,String(t),!0),this.G=!1}catch(a){B5(this,a);return}if(t=r||"",r=new Map(this.headers),o)if(Object.getPrototypeOf(o)===Object.prototype)for(var n in o)r.set(n,o[n]);else if(typeof o.keys=="function"&&typeof o.get=="function")for(let a of o.keys())r.set(a,o.get(a));else throw Error("Unknown input type for opt_headers: "+String(o));o=Array.from(r.keys()).find(a=>a.toLowerCase()=="content-type"),n=Ue.FormData&&t instanceof Ue.FormData,!(0<=H5(jse,e))||o||n||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(let[a,i]of r)this.g.setRequestHeader(a,i);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{T6(this),0<this.B&&((this.L=qse(this.g))?(this.g.timeout=this.B,this.g.ontimeout=lo(this.ua,this)):this.A=X0(this.ua,this.B,this)),this.v=!0,this.g.send(t),this.v=!1}catch(a){B5(this,a)}};function qse(t){return Qc&&typeof t.timeout=="number"&&t.ontimeout!==void 0}ae.ua=function(){typeof F0<"u"&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,Zr(this,"timeout"),this.abort(8))};function B5(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,C6(t),nx(t)}function C6(t){t.F||(t.F=!0,Zr(t,"complete"),Zr(t,"error"))}ae.abort=function(t){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=t||7,Zr(this,"complete"),Zr(this,"abort"),nx(this))};ae.N=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),nx(this,!0)),Jt.$.N.call(this)};ae.La=function(){this.s||(this.G||this.v||this.l?k6(this):this.kb())};ae.kb=function(){k6(this)};function k6(t){if(t.h&&typeof F0<"u"&&(!t.C[1]||xa(t)!=4||t.da()!=2)){if(t.v&&xa(t)==4)X0(t.La,0,t);else if(Zr(t,"readystatechange"),xa(t)==4){t.h=!1;try{let i=t.da();e:switch(i){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break e;default:e=!1}var r;if(!(r=e)){var o;if(o=i===0){var n=String(t.I).match(h6)[1]||null;!n&&Ue.self&&Ue.self.location&&(n=Ue.self.location.protocol.slice(0,-1)),o=!$se.test(n?n.toLowerCase():"")}r=o}if(r)Zr(t,"complete"),Zr(t,"success");else{t.m=6;try{var a=2<xa(t)?t.g.statusText:""}catch{a=""}t.j=a+" ["+t.da()+"]",C6(t)}}finally{nx(t)}}}}function nx(t,e){if(t.g){T6(t);let r=t.g,o=t.C[0]?()=>{}:null;t.g=null,t.C=null,e||Zr(t,"ready");try{r.onreadystatechange=o}catch{}}}function T6(t){t.g&&t.L&&(t.g.ontimeout=null),t.A&&(Ue.clearTimeout(t.A),t.A=null)}ae.isActive=function(){return!!this.g};function xa(t){return t.g?t.g.readyState:0}ae.da=function(){try{return 2<xa(this)?this.g.status:-1}catch{return-1}};ae.ja=function(){try{return this.g?this.g.responseText:""}catch{return""}};ae.Wa=function(t){if(this.g){var e=this.g.responseText;return t&&e.indexOf(t)==0&&(e=e.substring(t.length)),Hse(e)}};function F5(t){try{if(!t.g)return null;if("response"in t.g)return t.g.response;switch(t.K){case S6:case"text":return t.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in t.g)return t.g.mozResponseArrayBuffer}return null}catch{return null}}function Gse(t){let e={};t=(t.g&&2<=xa(t)&&t.g.getAllResponseHeaders()||"").split(`\r
|
|
17
17
|
`);for(let o=0;o<t.length;o++){if(Rf(t[o]))continue;var r=xse(t[o]);let n=r[0];if(r=r[1],typeof r!="string")continue;r=r.trim();let a=e[n]||[];e[n]=a,a.push(r)}mse(e,function(o){return o.join(", ")})}ae.Ia=function(){return this.m};ae.Sa=function(){return typeof this.j=="string"?this.j:String(this.j)};function P6(t){let e="";return V0(t,function(r,o){e+=o,e+=":",e+=r,e+=`\r
|
|
18
|
-
`}),e}function tE(t,e,r){e:{for(o in r){var o=!1;break e}o=!0}o||(r=P6(r),typeof t=="string"?r!=null&&encodeURIComponent(String(r)):Bt(t,e,r))}function Tf(t,e,r){return r&&r.internalChannelParams&&r.internalChannelParams[t]||e}function O6(t){this.Ga=0,this.j=[],this.l=new Q_,this.pa=this.wa=this.I=this.Y=this.g=this.Da=this.F=this.na=this.o=this.U=this.s=null,this.fb=this.W=0,this.cb=Tf("failFast",!1,t),this.G=this.v=this.u=this.m=this.h=null,this.aa=!0,this.Fa=this.V=-1,this.ba=this.A=this.C=0,this.ab=Tf("baseRetryDelayMs",5e3,t),this.hb=Tf("retryDelaySeedMs",1e4,t),this.eb=Tf("forwardChannelMaxRetries",2,t),this.xa=Tf("forwardChannelRequestTimeoutMs",2e4,t),this.va=t&&t.xmlHttpFactory||void 0,this.Ha=t&&t.useFetchStreams||!1,this.L=void 0,this.J=t&&t.supportsCrossDomainXhr||!1,this.K="",this.i=new b6(t&&t.concurrentRequestLimit),this.Ja=new zse,this.P=t&&t.fastHandshake||!1,this.O=t&&t.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=t&&t.bc||!1,t&&t.Ea&&this.l.Ea(),t&&t.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&t&&t.detectBufferingProxy||!1,this.qa=void 0,t&&t.longPollingTimeout&&0<t.longPollingTimeout&&(this.qa=t.longPollingTimeout),this.oa=void 0,this.S=0,this.M=!1,this.ma=this.B=null}ae=O6.prototype;ae.ra=8;ae.H=1;function rE(t){if(A6(t),t.H==3){var e=t.W++,r=Ya(t.I);if(Bt(r,"SID",t.K),Bt(r,"RID",e),Bt(r,"TYPE","terminate"),Xf(t,r),e=new qf(t,t.l,e),e.L=2,e.v=rx(Ya(r)),r=!1,Ue.navigator&&Ue.navigator.sendBeacon)try{r=Ue.navigator.sendBeacon(e.v.toString(),"")}catch{}!r&&Ue.Image&&(new Image().src=e.v,r=!0),r||(e.g=z6(e.l,null),e.g.ha(e.v)),e.G=Date.now(),Gf(e)}B6(t)}function ax(t){t.g&&(nE(t),t.g.cancel(),t.g=null)}function A6(t){ax(t),t.u&&(Ue.clearTimeout(t.u),t.u=null),H_(t),t.i.cancel(),t.m&&(typeof t.m=="number"&&Ue.clearTimeout(t.m),t.m=null)}function ix(t){if(!y6(t.i)&&!t.m){t.m=!0;var e=t.Na;Mf||e6(),Lf||(Mf(),Lf=!0),W0.add(e,t),t.C=0}}function Wse(t,e){return v6(t.i)>=t.i.j-(t.m?1:0)?!1:t.m?(t.j=e.F.concat(t.j),!0):t.H==1||t.H==2||t.C>=(t.cb?0:t.eb)?!1:(t.m=$f(lo(t.Na,t,e),L6(t,t.C)),t.C++,!0)}ae.Na=function(t){if(this.m)if(this.m=null,this.H==1){if(!t){this.W=Math.floor(1e5*Math.random()),t=this.W++;let n=new qf(this,this.l,t),a=this.s;if(this.U&&(a?(a=G5(a),W5(a,this.U)):a=this.U),this.o!==null||this.O||(n.I=a,a=null),this.P)e:{for(var e=0,r=0;r<this.j.length;r++){t:{var o=this.j[r];if("__data__"in o.map&&(o=o.map.__data__,typeof o=="string")){o=o.length;break t}o=void 0}if(o===void 0)break;if(e+=o,4096<e){e=r;break e}if(e===4096||r===this.j.length-1){e=r+1;break e}}e=1e3}else e=1e3;e=D6(this,n,e),r=Ya(this.I),Bt(r,"RID",t),Bt(r,"CVER",22),this.F&&Bt(r,"X-HTTP-Session-Id",this.F),Xf(this,r),a&&(this.O?e="headers="+encodeURIComponent(String(P6(a)))+"&"+e:this.o&&tE(r,this.o,a)),J0(this.i,n),this.bb&&Bt(r,"TYPE","init"),this.P?(Bt(r,"$req",e),Bt(r,"SID","null"),n.aa=!0,R0(n,r,null)):R0(n,r,e),this.H=2}}else this.H==3&&(t?z5(this,t):this.j.length==0||y6(this.i)||z5(this))};function z5(t,e){var r;e?r=e.m:r=t.W++;let o=Ya(t.I);Bt(o,"SID",t.K),Bt(o,"RID",r),Bt(o,"AID",t.V),Xf(t,o),t.o&&t.s&&tE(o,t.o,t.s),r=new qf(t,t.l,r,t.C+1),t.o===null&&(r.I=t.s),e&&(t.j=e.F.concat(t.j)),e=D6(t,r,1e3),r.setTimeout(Math.round(.5*t.xa)+Math.round(.5*t.xa*Math.random())),J0(t.i,r),R0(r,o,e)}function Xf(t,e){t.na&&V0(t.na,function(r,o){Bt(e,o,r)}),t.h&&m6({},function(r,o){Bt(e,o,r)})}function D6(t,e,r){r=Math.min(t.j.length,r);var o=t.h?lo(t.h.Va,t.h,t):null;e:{var n=t.j;let a=-1;for(;;){let i=["count="+r];a==-1?0<r?(a=n[0].g,i.push("ofs="+a)):a=0:i.push("ofs="+a);let s=!0;for(let l=0;l<r;l++){let c=n[l].g,u=n[l].map;if(c-=a,0>c)a=Math.max(0,n[l].g-100),s=!1;else try{Use(u,i,"req"+c+"_")}catch{o&&o(u)}}if(s){o=i.join("&");break e}}}return t=t.j.splice(0,r),e.F=t,o}function R6(t){if(!t.g&&!t.u){t.ba=1;var e=t.Ma;Mf||e6(),Lf||(Mf(),Lf=!0),W0.add(e,t),t.A=0}}function oE(t){return t.g||t.u||3<=t.A?!1:(t.ba++,t.u=$f(lo(t.Ma,t),L6(t,t.A)),t.A++,!0)}ae.Ma=function(){if(this.u=null,N6(this),this.ca&&!(this.M||this.g==null||0>=this.S)){var t=2*this.S;this.l.info("BP detection timer enabled: "+t),this.B=$f(lo(this.jb,this),t)}};ae.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,Do(10),ax(this),N6(this))};function nE(t){t.B!=null&&(Ue.clearTimeout(t.B),t.B=null)}function N6(t){t.g=new qf(t,t.l,"rpc",t.ba),t.o===null&&(t.g.I=t.s),t.g.O=0;var e=Ya(t.wa);Bt(e,"RID","rpc"),Bt(e,"SID",t.K),Bt(e,"AID",t.V),Bt(e,"CI",t.G?"0":"1"),!t.G&&t.qa&&Bt(e,"TO",t.qa),Bt(e,"TYPE","xmlhttp"),Xf(t,e),t.o&&t.s&&tE(e,t.o,t.s),t.L&&t.g.setTimeout(t.L);var r=t.g;t=t.pa,r.L=1,r.v=rx(Ya(e)),r.s=null,r.S=!0,u6(r,t)}ae.ib=function(){this.v!=null&&(this.v=null,ax(this),oE(this),Do(19))};function H_(t){t.v!=null&&(Ue.clearTimeout(t.v),t.v=null)}function M6(t,e){var r=null;if(t.g==e){H_(t),nE(t),t.g=null;var o=2}else if(M0(t.i,e))r=e.F,I6(t.i,e),o=1;else return;if(t.H!=0){if(e.i)if(o==1){r=e.s?e.s.length:0,e=Date.now()-e.G;var n=t.C;o=Z_(),Zr(o,new i6(o,r)),ix(t)}else R6(t);else if(n=e.o,n==3||n==0&&0<e.ca||!(o==1&&Wse(t,e)||o==2&&oE(t)))switch(r&&0<r.length&&(e=t.i,e.i=e.i.concat(r)),n){case 1:Ys(t,5);break;case 4:Ys(t,10);break;case 3:Ys(t,6);break;default:Ys(t,2)}}}function L6(t,e){let r=t.ab+Math.floor(Math.random()*t.hb);return t.isActive()||(r*=2),r*e}function Ys(t,e){if(t.l.info("Error code "+e),e==2){var r=null;t.h&&(r=null);var o=lo(t.pb,t);r||(r=new Qs("//www.google.com/images/cleardot.gif"),Ue.location&&Ue.location.protocol=="http"||U_(r,"https"),rx(r)),Vse(r.toString(),o)}else Do(2);t.H=0,t.h&&t.h.za(e),B6(t),A6(t)}ae.pb=function(t){t?(this.l.info("Successfully pinged google.com"),Do(2)):(this.l.info("Failed to ping google.com"),Do(1))};function B6(t){if(t.H=0,t.ma=[],t.h){let e=w6(t.i);(e.length!=0||t.j.length!=0)&&(O5(t.ma,e),O5(t.ma,t.j),t.i.i.length=0,z0(t.j),t.j.length=0),t.h.ya()}}function F6(t,e,r){var o=r instanceof Qs?Ya(r):new Qs(r);if(o.g!="")e&&(o.g=e+"."+o.g),V_(o,o.m);else{var n=Ue.location;o=n.protocol,e=e?e+"."+n.hostname:n.hostname,n=+n.port;var a=new Qs(null);o&&U_(a,o),e&&(a.g=e),n&&V_(a,n),r&&(a.l=r),o=a}return r=t.F,e=t.Da,r&&e&&Bt(o,r,e),Bt(o,"VER",t.ra),Xf(t,o),o}function z6(t,e,r){if(e&&!t.J)throw Error("Can't create secondary domain capable XhrIo object.");return e=r&&t.Ha&&!t.va?new Jt(new Wf({ob:!0})):new Jt(t.va),e.Oa(t.J),e}ae.isActive=function(){return!!this.h&&this.h.isActive(this)};function U6(){}ae=U6.prototype;ae.Ba=function(){};ae.Aa=function(){};ae.za=function(){};ae.ya=function(){};ae.isActive=function(){return!0};ae.Va=function(){};function $_(){if(Qc&&!(10<=Number(use)))throw Error("Environmental error: no available transport.")}$_.prototype.g=function(t,e){return new en(t,e)};function en(t,e){Br.call(this),this.g=new O6(e),this.l=t,this.h=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.g.s=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.Ca&&(t?t["X-WebChannel-Client-Profile"]=e.Ca:t={"X-WebChannel-Client-Profile":e.Ca}),this.g.U=t,(t=e&&e.cc)&&!Rf(t)&&(this.g.o=t),this.A=e&&e.supportsCrossDomainXhr||!1,this.v=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!Rf(e)&&(this.g.F=e,t=this.h,t!==null&&e in t&&(t=this.h,e in t&&delete t[e])),this.j=new Jc(this)}Fr(en,Br);en.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var t=this.g,e=this.l,r=this.h||void 0;Do(0),t.Y=e,t.na=r||{},t.G=t.aa,t.I=F6(t,null,t.Y),ix(t)};en.prototype.close=function(){rE(this.g)};en.prototype.u=function(t){var e=this.g;if(typeof t=="string"){var r={};r.__data__=t,t=r}else this.v&&(r={},r.__data__=G0(t),t=r);e.j.push(new Lse(e.fb++,t)),e.H==3&&ix(e)};en.prototype.N=function(){this.g.h=null,delete this.j,rE(this.g),delete this.g,en.$.N.call(this)};function V6(t){Q0.call(this),t.__headers__&&(this.headers=t.__headers__,this.statusCode=t.__status__,delete t.__headers__,delete t.__status__);var e=t.__sm__;if(e){e:{for(let r in e){t=r;break e}t=void 0}(this.i=t)&&(t=this.i,e=e!==null&&t in e?e[t]:void 0),this.data=e}else this.data=t}Fr(V6,Q0);function H6(){Z0.call(this),this.status=1}Fr(H6,Z0);function Jc(t){this.g=t}Fr(Jc,U6);Jc.prototype.Ba=function(){Zr(this.g,"a")};Jc.prototype.Aa=function(t){Zr(this.g,new V6(t))};Jc.prototype.za=function(t){Zr(this.g,new H6)};Jc.prototype.ya=function(){Zr(this.g,"b")};function Kse(){this.blockSize=-1}function Kn(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.m=Array(this.blockSize),this.i=this.h=0,this.reset()}Fr(Kn,Kse);Kn.prototype.reset=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.i=this.h=0};function v0(t,e,r){r||(r=0);var o=Array(16);if(typeof e=="string")for(var n=0;16>n;++n)o[n]=e.charCodeAt(r++)|e.charCodeAt(r++)<<8|e.charCodeAt(r++)<<16|e.charCodeAt(r++)<<24;else for(n=0;16>n;++n)o[n]=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24;e=t.g[0],r=t.g[1],n=t.g[2];var a=t.g[3],i=e+(a^r&(n^a))+o[0]+3614090360&4294967295;e=r+(i<<7&4294967295|i>>>25),i=a+(n^e&(r^n))+o[1]+3905402710&4294967295,a=e+(i<<12&4294967295|i>>>20),i=n+(r^a&(e^r))+o[2]+606105819&4294967295,n=a+(i<<17&4294967295|i>>>15),i=r+(e^n&(a^e))+o[3]+3250441966&4294967295,r=n+(i<<22&4294967295|i>>>10),i=e+(a^r&(n^a))+o[4]+4118548399&4294967295,e=r+(i<<7&4294967295|i>>>25),i=a+(n^e&(r^n))+o[5]+1200080426&4294967295,a=e+(i<<12&4294967295|i>>>20),i=n+(r^a&(e^r))+o[6]+2821735955&4294967295,n=a+(i<<17&4294967295|i>>>15),i=r+(e^n&(a^e))+o[7]+4249261313&4294967295,r=n+(i<<22&4294967295|i>>>10),i=e+(a^r&(n^a))+o[8]+1770035416&4294967295,e=r+(i<<7&4294967295|i>>>25),i=a+(n^e&(r^n))+o[9]+2336552879&4294967295,a=e+(i<<12&4294967295|i>>>20),i=n+(r^a&(e^r))+o[10]+4294925233&4294967295,n=a+(i<<17&4294967295|i>>>15),i=r+(e^n&(a^e))+o[11]+2304563134&4294967295,r=n+(i<<22&4294967295|i>>>10),i=e+(a^r&(n^a))+o[12]+1804603682&4294967295,e=r+(i<<7&4294967295|i>>>25),i=a+(n^e&(r^n))+o[13]+4254626195&4294967295,a=e+(i<<12&4294967295|i>>>20),i=n+(r^a&(e^r))+o[14]+2792965006&4294967295,n=a+(i<<17&4294967295|i>>>15),i=r+(e^n&(a^e))+o[15]+1236535329&4294967295,r=n+(i<<22&4294967295|i>>>10),i=e+(n^a&(r^n))+o[1]+4129170786&4294967295,e=r+(i<<5&4294967295|i>>>27),i=a+(r^n&(e^r))+o[6]+3225465664&4294967295,a=e+(i<<9&4294967295|i>>>23),i=n+(e^r&(a^e))+o[11]+643717713&4294967295,n=a+(i<<14&4294967295|i>>>18),i=r+(a^e&(n^a))+o[0]+3921069994&4294967295,r=n+(i<<20&4294967295|i>>>12),i=e+(n^a&(r^n))+o[5]+3593408605&4294967295,e=r+(i<<5&4294967295|i>>>27),i=a+(r^n&(e^r))+o[10]+38016083&4294967295,a=e+(i<<9&4294967295|i>>>23),i=n+(e^r&(a^e))+o[15]+3634488961&4294967295,n=a+(i<<14&4294967295|i>>>18),i=r+(a^e&(n^a))+o[4]+3889429448&4294967295,r=n+(i<<20&4294967295|i>>>12),i=e+(n^a&(r^n))+o[9]+568446438&4294967295,e=r+(i<<5&4294967295|i>>>27),i=a+(r^n&(e^r))+o[14]+3275163606&4294967295,a=e+(i<<9&4294967295|i>>>23),i=n+(e^r&(a^e))+o[3]+4107603335&4294967295,n=a+(i<<14&4294967295|i>>>18),i=r+(a^e&(n^a))+o[8]+1163531501&4294967295,r=n+(i<<20&4294967295|i>>>12),i=e+(n^a&(r^n))+o[13]+2850285829&4294967295,e=r+(i<<5&4294967295|i>>>27),i=a+(r^n&(e^r))+o[2]+4243563512&4294967295,a=e+(i<<9&4294967295|i>>>23),i=n+(e^r&(a^e))+o[7]+1735328473&4294967295,n=a+(i<<14&4294967295|i>>>18),i=r+(a^e&(n^a))+o[12]+2368359562&4294967295,r=n+(i<<20&4294967295|i>>>12),i=e+(r^n^a)+o[5]+4294588738&4294967295,e=r+(i<<4&4294967295|i>>>28),i=a+(e^r^n)+o[8]+2272392833&4294967295,a=e+(i<<11&4294967295|i>>>21),i=n+(a^e^r)+o[11]+1839030562&4294967295,n=a+(i<<16&4294967295|i>>>16),i=r+(n^a^e)+o[14]+4259657740&4294967295,r=n+(i<<23&4294967295|i>>>9),i=e+(r^n^a)+o[1]+2763975236&4294967295,e=r+(i<<4&4294967295|i>>>28),i=a+(e^r^n)+o[4]+1272893353&4294967295,a=e+(i<<11&4294967295|i>>>21),i=n+(a^e^r)+o[7]+4139469664&4294967295,n=a+(i<<16&4294967295|i>>>16),i=r+(n^a^e)+o[10]+3200236656&4294967295,r=n+(i<<23&4294967295|i>>>9),i=e+(r^n^a)+o[13]+681279174&4294967295,e=r+(i<<4&4294967295|i>>>28),i=a+(e^r^n)+o[0]+3936430074&4294967295,a=e+(i<<11&4294967295|i>>>21),i=n+(a^e^r)+o[3]+3572445317&4294967295,n=a+(i<<16&4294967295|i>>>16),i=r+(n^a^e)+o[6]+76029189&4294967295,r=n+(i<<23&4294967295|i>>>9),i=e+(r^n^a)+o[9]+3654602809&4294967295,e=r+(i<<4&4294967295|i>>>28),i=a+(e^r^n)+o[12]+3873151461&4294967295,a=e+(i<<11&4294967295|i>>>21),i=n+(a^e^r)+o[15]+530742520&4294967295,n=a+(i<<16&4294967295|i>>>16),i=r+(n^a^e)+o[2]+3299628645&4294967295,r=n+(i<<23&4294967295|i>>>9),i=e+(n^(r|~a))+o[0]+4096336452&4294967295,e=r+(i<<6&4294967295|i>>>26),i=a+(r^(e|~n))+o[7]+1126891415&4294967295,a=e+(i<<10&4294967295|i>>>22),i=n+(e^(a|~r))+o[14]+2878612391&4294967295,n=a+(i<<15&4294967295|i>>>17),i=r+(a^(n|~e))+o[5]+4237533241&4294967295,r=n+(i<<21&4294967295|i>>>11),i=e+(n^(r|~a))+o[12]+1700485571&4294967295,e=r+(i<<6&4294967295|i>>>26),i=a+(r^(e|~n))+o[3]+2399980690&4294967295,a=e+(i<<10&4294967295|i>>>22),i=n+(e^(a|~r))+o[10]+4293915773&4294967295,n=a+(i<<15&4294967295|i>>>17),i=r+(a^(n|~e))+o[1]+2240044497&4294967295,r=n+(i<<21&4294967295|i>>>11),i=e+(n^(r|~a))+o[8]+1873313359&4294967295,e=r+(i<<6&4294967295|i>>>26),i=a+(r^(e|~n))+o[15]+4264355552&4294967295,a=e+(i<<10&4294967295|i>>>22),i=n+(e^(a|~r))+o[6]+2734768916&4294967295,n=a+(i<<15&4294967295|i>>>17),i=r+(a^(n|~e))+o[13]+1309151649&4294967295,r=n+(i<<21&4294967295|i>>>11),i=e+(n^(r|~a))+o[4]+4149444226&4294967295,e=r+(i<<6&4294967295|i>>>26),i=a+(r^(e|~n))+o[11]+3174756917&4294967295,a=e+(i<<10&4294967295|i>>>22),i=n+(e^(a|~r))+o[2]+718787259&4294967295,n=a+(i<<15&4294967295|i>>>17),i=r+(a^(n|~e))+o[9]+3951481745&4294967295,t.g[0]=t.g[0]+e&4294967295,t.g[1]=t.g[1]+(n+(i<<21&4294967295|i>>>11))&4294967295,t.g[2]=t.g[2]+n&4294967295,t.g[3]=t.g[3]+a&4294967295}Kn.prototype.j=function(t,e){e===void 0&&(e=t.length);for(var r=e-this.blockSize,o=this.m,n=this.h,a=0;a<e;){if(n==0)for(;a<=r;)v0(this,t,a),a+=this.blockSize;if(typeof t=="string"){for(;a<e;)if(o[n++]=t.charCodeAt(a++),n==this.blockSize){v0(this,o),n=0;break}}else for(;a<e;)if(o[n++]=t[a++],n==this.blockSize){v0(this,o),n=0;break}}this.h=n,this.i+=e};Kn.prototype.l=function(){var t=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);t[0]=128;for(var e=1;e<t.length-8;++e)t[e]=0;var r=8*this.i;for(e=t.length-8;e<t.length;++e)t[e]=r&255,r/=256;for(this.j(t),t=Array(16),e=r=0;4>e;++e)for(var o=0;32>o;o+=8)t[r++]=this.g[e]>>>o&255;return t};function St(t,e){this.h=e;for(var r=[],o=!0,n=t.length-1;0<=n;n--){var a=t[n]|0;o&&a==e||(r[n]=a,o=!1)}this.g=r}var Xse={};function aE(t){return-128<=t&&128>t?sse(t,function(e){return new St([e|0],0>e?-1:0)}):new St([t|0],0>t?-1:0)}function ba(t){if(isNaN(t)||!isFinite(t))return Yc;if(0>t)return Qr(ba(-t));for(var e=[],r=1,o=0;t>=r;o++)e[o]=t/r|0,r*=L0;return new St(e,0)}function $6(t,e){if(t.length==0)throw Error("number format error: empty string");if(e=e||10,2>e||36<e)throw Error("radix out of range: "+e);if(t.charAt(0)=="-")return Qr($6(t.substring(1),e));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var r=ba(Math.pow(e,8)),o=Yc,n=0;n<t.length;n+=8){var a=Math.min(8,t.length-n),i=parseInt(t.substring(n,n+a),e);8>a?(a=ba(Math.pow(e,a)),o=o.R(a).add(ba(i))):(o=o.R(r),o=o.add(ba(i)))}return o}var L0=4294967296,Yc=aE(0),B0=aE(1),U5=aE(16777216);ae=St.prototype;ae.ea=function(){if(Pn(this))return-Qr(this).ea();for(var t=0,e=1,r=0;r<this.g.length;r++){var o=this.D(r);t+=(0<=o?o:L0+o)*e,e*=L0}return t};ae.toString=function(t){if(t=t||10,2>t||36<t)throw Error("radix out of range: "+t);if(Xa(this))return"0";if(Pn(this))return"-"+Qr(this).toString(t);for(var e=ba(Math.pow(t,6)),r=this,o="";;){var n=q_(r,e).g;r=j_(r,n.R(e));var a=((0<r.g.length?r.g[0]:r.h)>>>0).toString(t);if(r=n,Xa(r))return a+o;for(;6>a.length;)a="0"+a;o=a+o}};ae.D=function(t){return 0>t?0:t<this.g.length?this.g[t]:this.h};function Xa(t){if(t.h!=0)return!1;for(var e=0;e<t.g.length;e++)if(t.g[e]!=0)return!1;return!0}function Pn(t){return t.h==-1}ae.X=function(t){return t=j_(this,t),Pn(t)?-1:Xa(t)?0:1};function Qr(t){for(var e=t.g.length,r=[],o=0;o<e;o++)r[o]=~t.g[o];return new St(r,~t.h).add(B0)}ae.abs=function(){return Pn(this)?Qr(this):this};ae.add=function(t){for(var e=Math.max(this.g.length,t.g.length),r=[],o=0,n=0;n<=e;n++){var a=o+(this.D(n)&65535)+(t.D(n)&65535),i=(a>>>16)+(this.D(n)>>>16)+(t.D(n)>>>16);o=i>>>16,a&=65535,i&=65535,r[n]=i<<16|a}return new St(r,r[r.length-1]&-2147483648?-1:0)};function j_(t,e){return t.add(Qr(e))}ae.R=function(t){if(Xa(this)||Xa(t))return Yc;if(Pn(this))return Pn(t)?Qr(this).R(Qr(t)):Qr(Qr(this).R(t));if(Pn(t))return Qr(this.R(Qr(t)));if(0>this.X(U5)&&0>t.X(U5))return ba(this.ea()*t.ea());for(var e=this.g.length+t.g.length,r=[],o=0;o<2*e;o++)r[o]=0;for(o=0;o<this.g.length;o++)for(var n=0;n<t.g.length;n++){var a=this.D(o)>>>16,i=this.D(o)&65535,s=t.D(n)>>>16,l=t.D(n)&65535;r[2*o+2*n]+=i*l,F_(r,2*o+2*n),r[2*o+2*n+1]+=a*l,F_(r,2*o+2*n+1),r[2*o+2*n+1]+=i*s,F_(r,2*o+2*n+1),r[2*o+2*n+2]+=a*s,F_(r,2*o+2*n+2)}for(o=0;o<e;o++)r[o]=r[2*o+1]<<16|r[2*o];for(o=e;o<2*e;o++)r[o]=0;return new St(r,0)};function F_(t,e){for(;(t[e]&65535)!=t[e];)t[e+1]+=t[e]>>>16,t[e]&=65535,e++}function Pf(t,e){this.g=t,this.h=e}function q_(t,e){if(Xa(e))throw Error("division by zero");if(Xa(t))return new Pf(Yc,Yc);if(Pn(t))return e=q_(Qr(t),e),new Pf(Qr(e.g),Qr(e.h));if(Pn(e))return e=q_(t,Qr(e)),new Pf(Qr(e.g),e.h);if(30<t.g.length){if(Pn(t)||Pn(e))throw Error("slowDivide_ only works with positive integers.");for(var r=B0,o=e;0>=o.X(t);)r=V5(r),o=V5(o);var n=Kc(r,1),a=Kc(o,1);for(o=Kc(o,2),r=Kc(r,2);!Xa(o);){var i=a.add(o);0>=i.X(t)&&(n=n.add(r),a=i),o=Kc(o,1),r=Kc(r,1)}return e=j_(t,n.R(e)),new Pf(n,e)}for(n=Yc;0<=t.X(e);){for(r=Math.max(1,Math.floor(t.ea()/e.ea())),o=Math.ceil(Math.log(r)/Math.LN2),o=48>=o?1:Math.pow(2,o-48),a=ba(r),i=a.R(e);Pn(i)||0<i.X(t);)r-=o,a=ba(r),i=a.R(e);Xa(a)&&(a=B0),n=n.add(a),t=j_(t,i)}return new Pf(n,t)}ae.gb=function(t){return q_(this,t).h};ae.and=function(t){for(var e=Math.max(this.g.length,t.g.length),r=[],o=0;o<e;o++)r[o]=this.D(o)&t.D(o);return new St(r,this.h&t.h)};ae.or=function(t){for(var e=Math.max(this.g.length,t.g.length),r=[],o=0;o<e;o++)r[o]=this.D(o)|t.D(o);return new St(r,this.h|t.h)};ae.xor=function(t){for(var e=Math.max(this.g.length,t.g.length),r=[],o=0;o<e;o++)r[o]=this.D(o)^t.D(o);return new St(r,this.h^t.h)};function V5(t){for(var e=t.g.length+1,r=[],o=0;o<e;o++)r[o]=t.D(o)<<1|t.D(o-1)>>>31;return new St(r,t.h)}function Kc(t,e){var r=e>>5;e%=32;for(var o=t.g.length-r,n=[],a=0;a<o;a++)n[a]=0<e?t.D(a+r)>>>e|t.D(a+r+1)<<32-e:t.D(a+r);return new St(n,t.h)}$_.prototype.createWebChannel=$_.prototype.g;en.prototype.send=en.prototype.u;en.prototype.open=en.prototype.m;en.prototype.close=en.prototype.close;J_.NO_ERROR=0;J_.TIMEOUT=8;J_.HTTP_ERROR=6;s6.COMPLETE="complete";l6.EventType=jf;jf.OPEN="a";jf.CLOSE="b";jf.ERROR="c";jf.MESSAGE="d";Br.prototype.listen=Br.prototype.O;Jt.prototype.listenOnce=Jt.prototype.P;Jt.prototype.getLastError=Jt.prototype.Sa;Jt.prototype.getLastErrorCode=Jt.prototype.Ia;Jt.prototype.getStatus=Jt.prototype.da;Jt.prototype.getResponseJson=Jt.prototype.Wa;Jt.prototype.getResponseText=Jt.prototype.ja;Jt.prototype.send=Jt.prototype.ha;Jt.prototype.setWithCredentials=Jt.prototype.Oa;Kn.prototype.digest=Kn.prototype.l;Kn.prototype.reset=Kn.prototype.reset;Kn.prototype.update=Kn.prototype.j;St.prototype.add=St.prototype.add;St.prototype.multiply=St.prototype.R;St.prototype.modulo=St.prototype.gb;St.prototype.compare=St.prototype.X;St.prototype.toNumber=St.prototype.ea;St.prototype.toString=St.prototype.toString;St.prototype.getBits=St.prototype.D;St.fromNumber=ba;St.fromString=$6;var j6=Xn.createWebChannelTransport=function(){return new $_},q6=Xn.getStatEventTarget=function(){return Z_()},sx=Xn.ErrorCode=J_,G6=Xn.EventType=s6,W6=Xn.Event=Zs,iE=Xn.Stat={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},K6=Xn.FetchXmlHttpFactory=Wf,Yf=Xn.WebChannel=l6,X6=Xn.XhrIo=Jt,Y6=Xn.Md5=Kn,Js=Xn.Integer=St;var Q6="@firebase/firestore";var fo=class{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}};fo.UNAUTHENTICATED=new fo(null),fo.GOOGLE_CREDENTIALS=new fo("google-credentials-uid"),fo.FIRST_PARTY=new fo("first-party-uid"),fo.MOCK_USER=new fo("mock-user");var _u="10.5.2";var rl=new Pi("@firebase/firestore");function Qf(){return rl.logLevel}function ge(t,...e){if(rl.logLevel<=Qe.DEBUG){let r=e.map($1);rl.debug(`Firestore (${_u}): ${t}`,...r)}}function Qa(t,...e){if(rl.logLevel<=Qe.ERROR){let r=e.map($1);rl.error(`Firestore (${_u}): ${t}`,...r)}}function np(t,...e){if(rl.logLevel<=Qe.WARN){let r=e.map($1);rl.warn(`Firestore (${_u}): ${t}`,...r)}}function $1(t){if(typeof t=="string")return t;try{return function(r){return JSON.stringify(r)}(t)}catch{return t}}function De(t="Unexpected state"){let e=`FIRESTORE (${_u}) INTERNAL ASSERTION FAILED: `+t;throw Qa(e),new Error(e)}function Ct(t,e){t||De()}function Ve(t,e){return t}var j={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},re=class extends Oo{constructor(e,r){super(e,r),this.code=e,this.message=r,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}};var An=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};var uE=class{constructor(e,r){this.user=r,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}},dE=class{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,r){e.enqueueRetryable(()=>r(fo.UNAUTHENTICATED))}shutdown(){}};var fE=class{constructor(e){this.t=e,this.currentUser=fo.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,r){let o=this.i,n=l=>this.i!==o?(o=this.i,r(l)):Promise.resolve(),a=new An;this.o=()=>{this.i++,this.currentUser=this.u(),a.resolve(),a=new An,e.enqueueRetryable(()=>n(this.currentUser))};let i=()=>{let l=a;e.enqueueRetryable(async()=>{await l.promise,await n(this.currentUser)})},s=l=>{ge("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,this.auth.addAuthTokenListener(this.o),i()};this.t.onInit(l=>s(l)),setTimeout(()=>{if(!this.auth){let l=this.t.getImmediate({optional:!0});l?s(l):(ge("FirebaseAuthCredentialsProvider","Auth not yet detected"),a.resolve(),a=new An)}},0),i()}getToken(){let e=this.i,r=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(r).then(o=>this.i!==e?(ge("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):o?(Ct(typeof o.accessToken=="string"),new uE(o.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){let e=this.auth&&this.auth.getUid();return Ct(e===null||typeof e=="string"),new fo(e)}},pE=class{constructor(e,r,o){this.l=e,this.h=r,this.P=o,this.type="FirstParty",this.user=fo.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);let e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}},mE=class{constructor(e,r,o){this.l=e,this.h=r,this.P=o}getToken(){return Promise.resolve(new pE(this.l,this.h,this.P))}start(e,r){e.enqueueRetryable(()=>r(fo.FIRST_PARTY))}shutdown(){}invalidateToken(){}},hE=class{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}},gE=class{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,r){let o=a=>{a.error!=null&&ge("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${a.error.message}`);let i=a.token!==this.R;return this.R=a.token,ge("FirebaseAppCheckTokenProvider",`Received ${i?"new":"existing"} token.`),i?r(a.token):Promise.resolve()};this.o=a=>{e.enqueueRetryable(()=>o(a))};let n=a=>{ge("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=a,this.appCheck.addTokenListener(this.o)};this.A.onInit(a=>n(a)),setTimeout(()=>{if(!this.appCheck){let a=this.A.getImmediate({optional:!0});a?n(a):ge("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(r=>r?(Ct(typeof r.token=="string"),this.R=r.token,new hE(r.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}};function Yse(t){let e=typeof self<"u"&&(self.crypto||self.msCrypto),r=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(r);else for(let o=0;o<t;o++)r[o]=Math.floor(256*Math.random());return r}var fx=class{static newId(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=Math.floor(256/e.length)*e.length,o="";for(;o.length<20;){let n=Yse(40);for(let a=0;a<n.length;++a)o.length<20&&n[a]<r&&(o+=e.charAt(n[a]%e.length))}return o}};function _t(t,e){return t<e?-1:t>e?1:0}function iu(t,e,r){return t.length===e.length&&t.every((o,n)=>r(o,e[n]))}var Ze=class t{constructor(e,r){if(this.seconds=e,this.nanoseconds=r,r<0)throw new re(j.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(r>=1e9)throw new re(j.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(e<-62135596800)throw new re(j.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new re(j.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return t.fromMillis(Date.now())}static fromDate(e){return t.fromMillis(e.getTime())}static fromMillis(e){let r=Math.floor(e/1e3),o=Math.floor(1e6*(e-1e3*r));return new t(r,o)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?_t(this.nanoseconds,e.nanoseconds):_t(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){let e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}};var Le=class t{constructor(e){this.timestamp=e}static fromTimestamp(e){return new t(e)}static min(){return new t(new Ze(0,0))}static max(){return new t(new Ze(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}};var px=class t{constructor(e,r,o){r===void 0?r=0:r>e.length&&De(),o===void 0?o=e.length-r:o>e.length-r&&De(),this.segments=e,this.offset=r,this.len=o}get length(){return this.len}isEqual(e){return t.comparator(this,e)===0}child(e){let r=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach(o=>{r.push(o)}):r.push(e),this.construct(r)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let r=0;r<this.length;r++)if(this.get(r)!==e.get(r))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let r=0;r<this.length;r++)if(this.get(r)!==e.get(r))return!1;return!0}forEach(e){for(let r=this.offset,o=this.limit();r<o;r++)e(this.segments[r])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,r){let o=Math.min(e.length,r.length);for(let n=0;n<o;n++){let a=e.get(n),i=r.get(n);if(a<i)return-1;if(a>i)return 1}return e.length<r.length?-1:e.length>r.length?1:0}},qt=class t extends px{construct(e,r,o){return new t(e,r,o)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...e){let r=[];for(let o of e){if(o.indexOf("//")>=0)throw new re(j.INVALID_ARGUMENT,`Invalid segment (${o}). Paths must not contain // in them.`);r.push(...o.split("/").filter(n=>n.length>0))}return new t(r)}static emptyPath(){return new t([])}},Qse=/^[_a-zA-Z][_a-zA-Z0-9]*$/,tn=class t extends px{construct(e,r,o){return new t(e,r,o)}static isValidIdentifier(e){return Qse.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new t(["__name__"])}static fromServerFormat(e){let r=[],o="",n=0,a=()=>{if(o.length===0)throw new re(j.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);r.push(o),o=""},i=!1;for(;n<e.length;){let s=e[n];if(s==="\\"){if(n+1===e.length)throw new re(j.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let l=e[n+1];if(l!=="\\"&&l!=="."&&l!=="`")throw new re(j.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);o+=l,n+=2}else s==="`"?(i=!i,n++):s!=="."||i?(o+=s,n++):(a(),n++)}if(a(),i)throw new re(j.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new t(r)}static emptyPath(){return new t([])}};var Ce=class t{constructor(e){this.path=e}static fromPath(e){return new t(qt.fromString(e))}static fromName(e){return new t(qt.fromString(e).popFirst(5))}static empty(){return new t(qt.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&qt.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,r){return qt.comparator(e.path,r.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new t(new qt(e.slice()))}};var _E=class{constructor(e,r,o,n){this.indexId=e,this.collectionGroup=r,this.fields=o,this.indexState=n}};_E.UNKNOWN_ID=-1;function Zse(t,e){let r=t.toTimestamp().seconds,o=t.toTimestamp().nanoseconds+1,n=Le.fromTimestamp(o===1e9?new Ze(r+1,0):new Ze(r,o));return new ol(n,Ce.empty(),e)}function Jse(t){return new ol(t.readTime,t.key,-1)}var ol=class t{constructor(e,r,o){this.readTime=e,this.documentKey=r,this.largestBatchId=o}static min(){return new t(Le.min(),Ce.empty(),-1)}static max(){return new t(Le.max(),Ce.empty(),-1)}};function ele(t,e){let r=t.readTime.compareTo(e.readTime);return r!==0?r:(r=Ce.comparator(t.documentKey,e.documentKey),r!==0?r:_t(t.largestBatchId,e.largestBatchId))}var tle="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",xE=class{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}};async function wp(t){if(t.code!==j.FAILED_PRECONDITION||t.message!==tle)throw t;ge("LocalStore","Unexpectedly lost primary lease")}var ee=class t{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(r=>{this.isDone=!0,this.result=r,this.nextCallback&&this.nextCallback(r)},r=>{this.isDone=!0,this.error=r,this.catchCallback&&this.catchCallback(r)})}catch(e){return this.next(void 0,e)}next(e,r){return this.callbackAttached&&De(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(r,this.error):this.wrapSuccess(e,this.result):new t((o,n)=>{this.nextCallback=a=>{this.wrapSuccess(e,a).next(o,n)},this.catchCallback=a=>{this.wrapFailure(r,a).next(o,n)}})}toPromise(){return new Promise((e,r)=>{this.next(e,r)})}wrapUserFunction(e){try{let r=e();return r instanceof t?r:t.resolve(r)}catch(r){return t.reject(r)}}wrapSuccess(e,r){return e?this.wrapUserFunction(()=>e(r)):t.resolve(r)}wrapFailure(e,r){return e?this.wrapUserFunction(()=>e(r)):t.reject(r)}static resolve(e){return new t((r,o)=>{r(e)})}static reject(e){return new t((r,o)=>{o(e)})}static waitFor(e){return new t((r,o)=>{let n=0,a=0,i=!1;e.forEach(s=>{++n,s.next(()=>{++a,i&&a===n&&r()},l=>o(l))}),i=!0,a===n&&r()})}static or(e){let r=t.resolve(!1);for(let o of e)r=r.next(n=>n?t.resolve(n):o());return r}static forEach(e,r){let o=[];return e.forEach((n,a)=>{o.push(r.call(this,n,a))}),this.waitFor(o)}static mapArray(e,r){return new t((o,n)=>{let a=e.length,i=new Array(a),s=0;for(let l=0;l<a;l++){let c=l;r(e[c]).next(u=>{i[c]=u,++s,s===a&&o(i)},u=>n(u))}})}static doWhile(e,r){return new t((o,n)=>{let a=()=>{e()===!0?r().next(()=>{a()},n):o()};a()})}};function Ep(t){return t.name==="IndexedDbTransactionError"}var ap=class{constructor(e,r){this.previousValue=e,r&&(r.sequenceNumberHandler=o=>this.se(o),this.oe=o=>r.writeSequenceNumber(o))}se(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){let e=++this.previousValue;return this.oe&&this.oe(e),e}};ap._e=-1;function Sp(t){return t==null}function ip(t){return t===0&&1/t==-1/0}function rle(t){return typeof t=="number"&&Number.isInteger(t)&&!ip(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var ole=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries"],CVe=[...ole,"documentOverlays"],nle=["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"],ale=nle,kVe=[...ale,"indexConfiguration","indexState","indexEntries"];function Z6(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function dl(t,e){for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e(r,t[r])}function T3(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var tr=class t{constructor(e,r){this.comparator=e,this.root=r||va.EMPTY}insert(e,r){return new t(this.comparator,this.root.insert(e,r,this.comparator).copy(null,null,va.BLACK,null,null))}remove(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,va.BLACK,null,null))}get(e){let r=this.root;for(;!r.isEmpty();){let o=this.comparator(e,r.key);if(o===0)return r.value;o<0?r=r.left:o>0&&(r=r.right)}return null}indexOf(e){let r=0,o=this.root;for(;!o.isEmpty();){let n=this.comparator(e,o.key);if(n===0)return r+o.left.size;n<0?o=o.left:(r+=o.left.size+1,o=o.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((r,o)=>(e(r,o),!1))}toString(){let e=[];return this.inorderTraversal((r,o)=>(e.push(`${r}:${o}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new ou(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new ou(this.root,e,this.comparator,!1)}getReverseIterator(){return new ou(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new ou(this.root,e,this.comparator,!0)}},ou=class{constructor(e,r,o,n){this.isReverse=n,this.nodeStack=[];let a=1;for(;!e.isEmpty();)if(a=r?o(e.key,r):1,r&&n&&(a*=-1),a<0)e=this.isReverse?e.left:e.right;else{if(a===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),r={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return r}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;let e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}},va=class t{constructor(e,r,o,n,a){this.key=e,this.value=r,this.color=o??t.RED,this.left=n??t.EMPTY,this.right=a??t.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,r,o,n,a){return new t(e??this.key,r??this.value,o??this.color,n??this.left,a??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,r,o){let n=this,a=o(e,n.key);return n=a<0?n.copy(null,null,null,n.left.insert(e,r,o),null):a===0?n.copy(null,r,null,null,null):n.copy(null,null,null,null,n.right.insert(e,r,o)),n.fixUp()}removeMin(){if(this.left.isEmpty())return t.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,r){let o,n=this;if(r(e,n.key)<0)n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(e,r),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),r(e,n.key)===0){if(n.right.isEmpty())return t.EMPTY;o=n.right.min(),n=n.copy(o.key,o.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(e,r))}return n.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){let e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){let e=this.left.copy(null,null,!this.left.color,null,null),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,r)}checkMaxDepth(){let e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw De();let e=this.left.check();if(e!==this.right.check())throw De();return e+(this.isRed()?0:1)}};va.EMPTY=null,va.RED=!0,va.BLACK=!1;va.EMPTY=new class{constructor(){this.size=0}get key(){throw De()}get value(){throw De()}get color(){throw De()}get left(){throw De()}get right(){throw De()}copy(e,r,o,n,a){return this}insert(e,r,o){return new va(e,r)}remove(e,r){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};var po=class t{constructor(e){this.comparator=e,this.data=new tr(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((r,o)=>(e(r),!1))}forEachInRange(e,r){let o=this.data.getIteratorFrom(e[0]);for(;o.hasNext();){let n=o.getNext();if(this.comparator(n.key,e[1])>=0)return;r(n.key)}}forEachWhile(e,r){let o;for(o=r!==void 0?this.data.getIteratorFrom(r):this.data.getIterator();o.hasNext();)if(!e(o.getNext().key))return}firstAfterOrEqual(e){let r=this.data.getIteratorFrom(e);return r.hasNext()?r.getNext().key:null}getIterator(){return new mx(this.data.getIterator())}getIteratorFrom(e){return new mx(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let r=this;return r.size<e.size&&(r=e,e=this),e.forEach(o=>{r=r.add(o)}),r}isEqual(e){if(!(e instanceof t)||this.size!==e.size)return!1;let r=this.data.getIterator(),o=e.data.getIterator();for(;r.hasNext();){let n=r.getNext().key,a=o.getNext().key;if(this.comparator(n,a)!==0)return!1}return!0}toArray(){let e=[];return this.forEach(r=>{e.push(r)}),e}toString(){let e=[];return this.forEach(r=>e.push(r)),"SortedSet("+e.toString()+")"}copy(e){let r=new t(this.comparator);return r.data=e,r}},mx=class{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}};var On=class t{constructor(e){this.fields=e,e.sort(tn.comparator)}static empty(){return new t([])}unionWith(e){let r=new po(tn.comparator);for(let o of this.fields)r=r.add(o);for(let o of e)r=r.add(o);return new t(r.toArray())}covers(e){for(let r of this.fields)if(r.isPrefixOf(e))return!0;return!1}isEqual(e){return iu(this.fields,e.fields,(r,o)=>r.isEqual(o))}};var hx=class extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}};var Ro=class t{constructor(e){this.binaryString=e}static fromBase64String(e){let r=function(n){try{return atob(n)}catch(a){throw typeof DOMException<"u"&&a instanceof DOMException?new hx("Invalid base64 string: "+a):a}}(e);return new t(r)}static fromUint8Array(e){let r=function(n){let a="";for(let i=0;i<n.length;++i)a+=String.fromCharCode(n[i]);return a}(e);return new t(r)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(r){return btoa(r)}(this.binaryString)}toUint8Array(){return function(r){let o=new Uint8Array(r.length);for(let n=0;n<r.length;n++)o[n]=r.charCodeAt(n);return o}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return _t(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}};Ro.EMPTY_BYTE_STRING=new Ro("");var ile=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Bi(t){if(Ct(!!t),typeof t=="string"){let e=0,r=ile.exec(t);if(Ct(!!r),r[1]){let n=r[1];n=(n+"000000000").substr(0,9),e=Number(n)}let o=new Date(t);return{seconds:Math.floor(o.getTime()/1e3),nanos:e}}return{seconds:er(t.seconds),nanos:er(t.nanos)}}function er(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function Fi(t){return typeof t=="string"?Ro.fromBase64String(t):Ro.fromUint8Array(t)}function j1(t){var e,r;return((r=(((e=t?.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||r===void 0?void 0:r.stringValue)==="server_timestamp"}function q1(t){let e=t.mapValue.fields.__previous_value__;return j1(e)?q1(e):e}function sp(t){let e=Bi(t.mapValue.fields.__local_write_time__.timestampValue);return new Ze(e.seconds,e.nanos)}var bE=class{constructor(e,r,o,n,a,i,s,l,c){this.databaseId=e,this.appId=r,this.persistenceKey=o,this.host=n,this.ssl=a,this.forceLongPolling=i,this.autoDetectLongPolling=s,this.longPollingOptions=l,this.useFetchStreams=c}},gx=class t{constructor(e,r){this.projectId=e,this.database=r||"(default)"}static empty(){return new t("","")}get isDefaultDatabase(){return this.database==="(default)"}isEqual(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database}};var lx={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function nl(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?j1(t)?4:P3(t)?9007199254740991:10:De()}function wa(t,e){if(t===e)return!0;let r=nl(t);if(r!==nl(e))return!1;switch(r){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return sp(t).isEqual(sp(e));case 3:return function(n,a){if(typeof n.timestampValue=="string"&&typeof a.timestampValue=="string"&&n.timestampValue.length===a.timestampValue.length)return n.timestampValue===a.timestampValue;let i=Bi(n.timestampValue),s=Bi(a.timestampValue);return i.seconds===s.seconds&&i.nanos===s.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(n,a){return Fi(n.bytesValue).isEqual(Fi(a.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(n,a){return er(n.geoPointValue.latitude)===er(a.geoPointValue.latitude)&&er(n.geoPointValue.longitude)===er(a.geoPointValue.longitude)}(t,e);case 2:return function(n,a){if("integerValue"in n&&"integerValue"in a)return er(n.integerValue)===er(a.integerValue);if("doubleValue"in n&&"doubleValue"in a){let i=er(n.doubleValue),s=er(a.doubleValue);return i===s?ip(i)===ip(s):isNaN(i)&&isNaN(s)}return!1}(t,e);case 9:return iu(t.arrayValue.values||[],e.arrayValue.values||[],wa);case 10:return function(n,a){let i=n.mapValue.fields||{},s=a.mapValue.fields||{};if(Z6(i)!==Z6(s))return!1;for(let l in i)if(i.hasOwnProperty(l)&&(s[l]===void 0||!wa(i[l],s[l])))return!1;return!0}(t,e);default:return De()}}function lp(t,e){return(t.values||[]).find(r=>wa(r,e))!==void 0}function su(t,e){if(t===e)return 0;let r=nl(t),o=nl(e);if(r!==o)return _t(r,o);switch(r){case 0:case 9007199254740991:return 0;case 1:return _t(t.booleanValue,e.booleanValue);case 2:return function(a,i){let s=er(a.integerValue||a.doubleValue),l=er(i.integerValue||i.doubleValue);return s<l?-1:s>l?1:s===l?0:isNaN(s)?isNaN(l)?0:-1:1}(t,e);case 3:return J6(t.timestampValue,e.timestampValue);case 4:return J6(sp(t),sp(e));case 5:return _t(t.stringValue,e.stringValue);case 6:return function(a,i){let s=Fi(a),l=Fi(i);return s.compareTo(l)}(t.bytesValue,e.bytesValue);case 7:return function(a,i){let s=a.split("/"),l=i.split("/");for(let c=0;c<s.length&&c<l.length;c++){let u=_t(s[c],l[c]);if(u!==0)return u}return _t(s.length,l.length)}(t.referenceValue,e.referenceValue);case 8:return function(a,i){let s=_t(er(a.latitude),er(i.latitude));return s!==0?s:_t(er(a.longitude),er(i.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(a,i){let s=a.values||[],l=i.values||[];for(let c=0;c<s.length&&c<l.length;++c){let u=su(s[c],l[c]);if(u)return u}return _t(s.length,l.length)}(t.arrayValue,e.arrayValue);case 10:return function(a,i){if(a===lx.mapValue&&i===lx.mapValue)return 0;if(a===lx.mapValue)return 1;if(i===lx.mapValue)return-1;let s=a.fields||{},l=Object.keys(s),c=i.fields||{},u=Object.keys(c);l.sort(),u.sort();for(let d=0;d<l.length&&d<u.length;++d){let p=_t(l[d],u[d]);if(p!==0)return p;let m=su(s[l[d]],c[u[d]]);if(m!==0)return m}return _t(l.length,u.length)}(t.mapValue,e.mapValue);default:throw De()}}function J6(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return _t(t,e);let r=Bi(t),o=Bi(e),n=_t(r.seconds,o.seconds);return n!==0?n:_t(r.nanos,o.nanos)}function lu(t){return yE(t)}function yE(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(r){let o=Bi(r);return`time(${o.seconds},${o.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(r){return Fi(r).toBase64()}(t.bytesValue):"referenceValue"in t?function(r){return Ce.fromName(r).toString()}(t.referenceValue):"geoPointValue"in t?function(r){return`geo(${r.latitude},${r.longitude})`}(t.geoPointValue):"arrayValue"in t?function(r){let o="[",n=!0;for(let a of r.values||[])n?n=!1:o+=",",o+=yE(a);return o+"]"}(t.arrayValue):"mapValue"in t?function(r){let o=Object.keys(r.fields||{}).sort(),n="{",a=!0;for(let i of o)a?a=!1:n+=",",n+=`${i}:${yE(r.fields[i])}`;return n+"}"}(t.mapValue):De()}function e3(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function vE(t){return!!t&&"integerValue"in t}function G1(t){return!!t&&"arrayValue"in t}function t3(t){return!!t&&"nullValue"in t}function r3(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function ux(t){return!!t&&"mapValue"in t}function Jf(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){let e={mapValue:{fields:{}}};return dl(t.mapValue.fields,(r,o)=>e.mapValue.fields[r]=Jf(o)),e}if(t.arrayValue){let e={arrayValue:{values:[]}};for(let r=0;r<(t.arrayValue.values||[]).length;++r)e.arrayValue.values[r]=Jf(t.arrayValue.values[r]);return e}return Object.assign({},t)}function P3(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}var qo=class t{constructor(e){this.value=e}static empty(){return new t({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let r=this.value;for(let o=0;o<e.length-1;++o)if(r=(r.mapValue.fields||{})[e.get(o)],!ux(r))return null;return r=(r.mapValue.fields||{})[e.lastSegment()],r||null}}set(e,r){this.getFieldsMap(e.popLast())[e.lastSegment()]=Jf(r)}setAll(e){let r=tn.emptyPath(),o={},n=[];e.forEach((i,s)=>{if(!r.isImmediateParentOf(s)){let l=this.getFieldsMap(r);this.applyChanges(l,o,n),o={},n=[],r=s.popLast()}i?o[s.lastSegment()]=Jf(i):n.push(s.lastSegment())});let a=this.getFieldsMap(r);this.applyChanges(a,o,n)}delete(e){let r=this.field(e.popLast());ux(r)&&r.mapValue.fields&&delete r.mapValue.fields[e.lastSegment()]}isEqual(e){return wa(this.value,e.value)}getFieldsMap(e){let r=this.value;r.mapValue.fields||(r.mapValue={fields:{}});for(let o=0;o<e.length;++o){let n=r.mapValue.fields[e.get(o)];ux(n)&&n.mapValue.fields||(n={mapValue:{fields:{}}},r.mapValue.fields[e.get(o)]=n),r=n}return r.mapValue.fields}applyChanges(e,r,o){dl(r,(n,a)=>e[n]=a);for(let n of o)delete e[n]}clone(){return new t(Jf(this.value))}};function O3(t){let e=[];return dl(t.fields,(r,o)=>{let n=new tn([r]);if(ux(o)){let a=O3(o.mapValue).fields;if(a.length===0)e.push(n);else for(let i of a)e.push(n.child(i))}else e.push(n)}),new On(e)}var on=class t{constructor(e,r,o,n,a,i,s){this.key=e,this.documentType=r,this.version=o,this.readTime=n,this.createTime=a,this.data=i,this.documentState=s}static newInvalidDocument(e){return new t(e,0,Le.min(),Le.min(),Le.min(),qo.empty(),0)}static newFoundDocument(e,r,o,n){return new t(e,1,r,Le.min(),o,n,0)}static newNoDocument(e,r){return new t(e,2,r,Le.min(),Le.min(),qo.empty(),0)}static newUnknownDocument(e,r){return new t(e,3,r,Le.min(),Le.min(),qo.empty(),2)}convertToFoundDocument(e,r){return!this.createTime.isEqual(Le.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=r,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=qo.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=qo.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Le.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new t(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}};var cu=class{constructor(e,r){this.position=e,this.inclusive=r}};function o3(t,e,r){let o=0;for(let n=0;n<t.position.length;n++){let a=e[n],i=t.position[n];if(a.field.isKeyField()?o=Ce.comparator(Ce.fromName(i.referenceValue),r.key):o=su(i,r.data.field(a.field)),a.dir==="desc"&&(o*=-1),o!==0)break}return o}function n3(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let r=0;r<t.position.length;r++)if(!wa(t.position[r],e.position[r]))return!1;return!0}var al=class{constructor(e,r="asc"){this.field=e,this.dir=r}};function sle(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}var _x=class{},yr=class t extends _x{constructor(e,r,o){super(),this.field=e,this.op=r,this.value=o}static create(e,r,o){return e.isKeyField()?r==="in"||r==="not-in"?this.createKeyFieldInFilter(e,r,o):new wE(e,r,o):r==="array-contains"?new CE(e,o):r==="in"?new kE(e,o):r==="not-in"?new TE(e,o):r==="array-contains-any"?new PE(e,o):new t(e,r,o)}static createKeyFieldInFilter(e,r,o){return r==="in"?new EE(e,o):new SE(e,o)}matches(e){let r=e.data.field(this.field);return this.op==="!="?r!==null&&this.matchesComparison(su(r,this.value)):r!==null&&nl(this.value)===nl(r)&&this.matchesComparison(su(r,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return De()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}},Yn=class t extends _x{constructor(e,r){super(),this.filters=e,this.op=r,this.ue=null}static create(e,r){return new t(e,r)}matches(e){return A3(this)?this.filters.find(r=>!r.matches(e))===void 0:this.filters.find(r=>r.matches(e))!==void 0}getFlattenedFilters(){return this.ue!==null||(this.ue=this.filters.reduce((e,r)=>e.concat(r.getFlattenedFilters()),[])),this.ue}getFilters(){return Object.assign([],this.filters)}};function A3(t){return t.op==="and"}function D3(t){return lle(t)&&A3(t)}function lle(t){for(let e of t.filters)if(e instanceof Yn)return!1;return!0}function IE(t){if(t instanceof yr)return t.field.canonicalString()+t.op.toString()+lu(t.value);if(D3(t))return t.filters.map(e=>IE(e)).join(",");{let e=t.filters.map(r=>IE(r)).join(",");return`${t.op}(${e})`}}function R3(t,e){return t instanceof yr?function(o,n){return n instanceof yr&&o.op===n.op&&o.field.isEqual(n.field)&&wa(o.value,n.value)}(t,e):t instanceof Yn?function(o,n){return n instanceof Yn&&o.op===n.op&&o.filters.length===n.filters.length?o.filters.reduce((a,i,s)=>a&&R3(i,n.filters[s]),!0):!1}(t,e):void De()}function N3(t){return t instanceof yr?function(r){return`${r.field.canonicalString()} ${r.op} ${lu(r.value)}`}(t):t instanceof Yn?function(r){return r.op.toString()+" {"+r.getFilters().map(N3).join(" ,")+"}"}(t):"Filter"}var wE=class extends yr{constructor(e,r,o){super(e,r,o),this.key=Ce.fromName(o.referenceValue)}matches(e){let r=Ce.comparator(e.key,this.key);return this.matchesComparison(r)}},EE=class extends yr{constructor(e,r){super(e,"in",r),this.keys=M3("in",r)}matches(e){return this.keys.some(r=>r.isEqual(e.key))}},SE=class extends yr{constructor(e,r){super(e,"not-in",r),this.keys=M3("not-in",r)}matches(e){return!this.keys.some(r=>r.isEqual(e.key))}};function M3(t,e){var r;return(((r=e.arrayValue)===null||r===void 0?void 0:r.values)||[]).map(o=>Ce.fromName(o.referenceValue))}var CE=class extends yr{constructor(e,r){super(e,"array-contains",r)}matches(e){let r=e.data.field(this.field);return G1(r)&&lp(r.arrayValue,this.value)}},kE=class extends yr{constructor(e,r){super(e,"in",r)}matches(e){let r=e.data.field(this.field);return r!==null&&lp(this.value.arrayValue,r)}},TE=class extends yr{constructor(e,r){super(e,"not-in",r)}matches(e){if(lp(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let r=e.data.field(this.field);return r!==null&&!lp(this.value.arrayValue,r)}},PE=class extends yr{constructor(e,r){super(e,"array-contains-any",r)}matches(e){let r=e.data.field(this.field);return!(!G1(r)||!r.arrayValue.values)&&r.arrayValue.values.some(o=>lp(this.value.arrayValue,o))}};var OE=class{constructor(e,r=null,o=[],n=[],a=null,i=null,s=null){this.path=e,this.collectionGroup=r,this.orderBy=o,this.filters=n,this.limit=a,this.startAt=i,this.endAt=s,this.ce=null}};function a3(t,e=null,r=[],o=[],n=null,a=null,i=null){return new OE(t,e,r,o,n,a,i)}function W1(t){let e=Ve(t);if(e.ce===null){let r=e.path.canonicalString();e.collectionGroup!==null&&(r+="|cg:"+e.collectionGroup),r+="|f:",r+=e.filters.map(o=>IE(o)).join(","),r+="|ob:",r+=e.orderBy.map(o=>function(a){return a.field.canonicalString()+a.dir}(o)).join(","),Sp(e.limit)||(r+="|l:",r+=e.limit),e.startAt&&(r+="|lb:",r+=e.startAt.inclusive?"b:":"a:",r+=e.startAt.position.map(o=>lu(o)).join(",")),e.endAt&&(r+="|ub:",r+=e.endAt.inclusive?"a:":"b:",r+=e.endAt.position.map(o=>lu(o)).join(",")),e.ce=r}return e.ce}function K1(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let r=0;r<t.orderBy.length;r++)if(!sle(t.orderBy[r],e.orderBy[r]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let r=0;r<t.filters.length;r++)if(!R3(t.filters[r],e.filters[r]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!n3(t.startAt,e.startAt)&&n3(t.endAt,e.endAt)}function AE(t){return Ce.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===0}var zi=class{constructor(e,r=null,o=[],n=[],a=null,i="F",s=null,l=null){this.path=e,this.collectionGroup=r,this.explicitOrderBy=o,this.filters=n,this.limit=a,this.limitType=i,this.startAt=s,this.endAt=l,this.le=null,this.he=null,this.Pe=null,this.startAt,this.endAt}};function cle(t,e,r,o,n,a,i,s){return new zi(t,e,r,o,n,a,i,s)}function qx(t){return new zi(t)}function i3(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function L3(t){return t.collectionGroup!==null}function ep(t){let e=Ve(t);if(e.le===null){e.le=[];let r=new Set;for(let a of e.explicitOrderBy)e.le.push(a),r.add(a.field.canonicalString());let o=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(i){let s=new po(tn.comparator);return i.filters.forEach(l=>{l.getFlattenedFilters().forEach(c=>{c.isInequality()&&(s=s.add(c.field))})}),s})(e).forEach(a=>{r.has(a.canonicalString())||a.isKeyField()||e.le.push(new al(a,o))}),r.has(tn.keyField().canonicalString())||e.le.push(new al(tn.keyField(),o))}return e.le}function Ia(t){let e=Ve(t);return e.he||(e.he=ule(e,ep(t))),e.he}function ule(t,e){if(t.limitType==="F")return a3(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(n=>{let a=n.dir==="desc"?"asc":"desc";return new al(n.field,a)});let r=t.endAt?new cu(t.endAt.position,t.endAt.inclusive):null,o=t.startAt?new cu(t.startAt.position,t.startAt.inclusive):null;return a3(t.path,t.collectionGroup,e,t.filters,t.limit,r,o)}}function DE(t,e){let r=t.filters.concat([e]);return new zi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),r,t.limit,t.limitType,t.startAt,t.endAt)}function xx(t,e,r){return new zi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,r,t.startAt,t.endAt)}function Gx(t,e){return K1(Ia(t),Ia(e))&&t.limitType===e.limitType}function B3(t){return`${W1(Ia(t))}|lt:${t.limitType}`}function eu(t){return`Query(target=${function(r){let o=r.path.canonicalString();return r.collectionGroup!==null&&(o+=" collectionGroup="+r.collectionGroup),r.filters.length>0&&(o+=`, filters: [${r.filters.map(n=>N3(n)).join(", ")}]`),Sp(r.limit)||(o+=", limit: "+r.limit),r.orderBy.length>0&&(o+=`, orderBy: [${r.orderBy.map(n=>function(i){return`${i.field.canonicalString()} (${i.dir})`}(n)).join(", ")}]`),r.startAt&&(o+=", startAt: ",o+=r.startAt.inclusive?"b:":"a:",o+=r.startAt.position.map(n=>lu(n)).join(",")),r.endAt&&(o+=", endAt: ",o+=r.endAt.inclusive?"a:":"b:",o+=r.endAt.position.map(n=>lu(n)).join(",")),`Target(${o})`}(Ia(t))}; limitType=${t.limitType})`}function Wx(t,e){return e.isFoundDocument()&&function(o,n){let a=n.key.path;return o.collectionGroup!==null?n.key.hasCollectionId(o.collectionGroup)&&o.path.isPrefixOf(a):Ce.isDocumentKey(o.path)?o.path.isEqual(a):o.path.isImmediateParentOf(a)}(t,e)&&function(o,n){for(let a of ep(o))if(!a.field.isKeyField()&&n.data.field(a.field)===null)return!1;return!0}(t,e)&&function(o,n){for(let a of o.filters)if(!a.matches(n))return!1;return!0}(t,e)&&function(o,n){return!(o.startAt&&!function(i,s,l){let c=o3(i,s,l);return i.inclusive?c<=0:c<0}(o.startAt,ep(o),n)||o.endAt&&!function(i,s,l){let c=o3(i,s,l);return i.inclusive?c>=0:c>0}(o.endAt,ep(o),n))}(t,e)}function dle(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function F3(t){return(e,r)=>{let o=!1;for(let n of ep(t)){let a=fle(n,e,r);if(a!==0)return a;o=o||n.field.isKeyField()}return 0}}function fle(t,e,r){let o=t.field.isKeyField()?Ce.comparator(e.key,r.key):function(a,i,s){let l=i.data.field(a),c=s.data.field(a);return l!==null&&c!==null?su(l,c):De()}(t.field,e,r);switch(t.dir){case"asc":return o;case"desc":return-1*o;default:return De()}}var Ui=class{constructor(e,r){this.mapKeyFn=e,this.equalsFn=r,this.inner={},this.innerSize=0}get(e){let r=this.mapKeyFn(e),o=this.inner[r];if(o!==void 0){for(let[n,a]of o)if(this.equalsFn(n,e))return a}}has(e){return this.get(e)!==void 0}set(e,r){let o=this.mapKeyFn(e),n=this.inner[o];if(n===void 0)return this.inner[o]=[[e,r]],void this.innerSize++;for(let a=0;a<n.length;a++)if(this.equalsFn(n[a][0],e))return void(n[a]=[e,r]);n.push([e,r]),this.innerSize++}delete(e){let r=this.mapKeyFn(e),o=this.inner[r];if(o===void 0)return!1;for(let n=0;n<o.length;n++)if(this.equalsFn(o[n][0],e))return o.length===1?delete this.inner[r]:o.splice(n,1),this.innerSize--,!0;return!1}forEach(e){dl(this.inner,(r,o)=>{for(let[n,a]of o)e(n,a)})}isEmpty(){return T3(this.inner)}size(){return this.innerSize}};var ple=new tr(Ce.comparator);function Za(){return ple}var z3=new tr(Ce.comparator);function Zf(...t){let e=z3;for(let r of t)e=e.insert(r.key,r);return e}function U3(t){let e=z3;return t.forEach((r,o)=>e=e.insert(r,o.overlayedDocument)),e}function el(){return tp()}function V3(){return tp()}function tp(){return new Ui(t=>t.toString(),(t,e)=>t.isEqual(e))}var mle=new tr(Ce.comparator),hle=new po(Ce.comparator);function tt(...t){let e=hle;for(let r of t)e=e.add(r);return e}var gle=new po(_t);function _le(){return gle}function H3(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ip(e)?"-0":e}}function $3(t){return{integerValue:""+t}}function xle(t,e){return rle(e)?$3(e):H3(t,e)}var uu=class{constructor(){this._=void 0}};function ble(t,e,r){return t instanceof il?function(n,a){let i={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:n.seconds,nanos:n.nanoseconds}}}};return a&&j1(a)&&(a=q1(a)),a&&(i.fields.__previous_value__=a),{mapValue:i}}(r,e):t instanceof Vi?q3(t,e):t instanceof sl?G3(t,e):function(n,a){let i=j3(n,a),s=s3(i)+s3(n.Ie);return vE(i)&&vE(n.Ie)?$3(s):H3(n.serializer,s)}(t,e)}function yle(t,e,r){return t instanceof Vi?q3(t,e):t instanceof sl?G3(t,e):r}function j3(t,e){return t instanceof du?function(o){return vE(o)||function(a){return!!a&&"doubleValue"in a}(o)}(e)?e:{integerValue:0}:null}var il=class extends uu{},Vi=class extends uu{constructor(e){super(),this.elements=e}};function q3(t,e){let r=W3(e);for(let o of t.elements)r.some(n=>wa(n,o))||r.push(o);return{arrayValue:{values:r}}}var sl=class extends uu{constructor(e){super(),this.elements=e}};function G3(t,e){let r=W3(e);for(let o of t.elements)r=r.filter(n=>!wa(n,o));return{arrayValue:{values:r}}}var du=class extends uu{constructor(e,r){super(),this.serializer=e,this.Ie=r}};function s3(t){return er(t.integerValue||t.doubleValue)}function W3(t){return G1(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var bx=class{constructor(e,r){this.field=e,this.transform=r}};function vle(t,e){return t.field.isEqual(e.field)&&function(o,n){return o instanceof Vi&&n instanceof Vi||o instanceof sl&&n instanceof sl?iu(o.elements,n.elements,wa):o instanceof du&&n instanceof du?wa(o.Ie,n.Ie):o instanceof il&&n instanceof il}(t.transform,e.transform)}var RE=class{constructor(e,r){this.version=e,this.transformResults=r}},Jr=class t{constructor(e,r){this.updateTime=e,this.exists=r}static none(){return new t}static exists(e){return new t(void 0,e)}static updateTime(e){return new t(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}};function dx(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}var fu=class{};function K3(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new cl(t.key,Jr.none()):new ll(t.key,t.data,Jr.none());{let r=t.data,o=qo.empty(),n=new po(tn.comparator);for(let a of e.fields)if(!n.has(a)){let i=r.field(a);i===null&&a.length>1&&(a=a.popLast(),i=r.field(a)),i===null?o.delete(a):o.set(a,i),n=n.add(a)}return new Ea(t.key,o,new On(n.toArray()),Jr.none())}}function Ile(t,e,r){t instanceof ll?function(n,a,i){let s=n.value.clone(),l=c3(n.fieldTransforms,a,i.transformResults);s.setAll(l),a.convertToFoundDocument(i.version,s).setHasCommittedMutations()}(t,e,r):t instanceof Ea?function(n,a,i){if(!dx(n.precondition,a))return void a.convertToUnknownDocument(i.version);let s=c3(n.fieldTransforms,a,i.transformResults),l=a.data;l.setAll(X3(n)),l.setAll(s),a.convertToFoundDocument(i.version,l).setHasCommittedMutations()}(t,e,r):function(n,a,i){a.convertToNoDocument(i.version).setHasCommittedMutations()}(0,e,r)}function rp(t,e,r,o){return t instanceof ll?function(a,i,s,l){if(!dx(a.precondition,i))return s;let c=a.value.clone(),u=u3(a.fieldTransforms,l,i);return c.setAll(u),i.convertToFoundDocument(i.version,c).setHasLocalMutations(),null}(t,e,r,o):t instanceof Ea?function(a,i,s,l){if(!dx(a.precondition,i))return s;let c=u3(a.fieldTransforms,l,i),u=i.data;return u.setAll(X3(a)),u.setAll(c),i.convertToFoundDocument(i.version,u).setHasLocalMutations(),s===null?null:s.unionWith(a.fieldMask.fields).unionWith(a.fieldTransforms.map(d=>d.field))}(t,e,r,o):function(a,i,s){return dx(a.precondition,i)?(i.convertToNoDocument(i.version).setHasLocalMutations(),null):s}(t,e,r)}function wle(t,e){let r=null;for(let o of t.fieldTransforms){let n=e.data.field(o.field),a=j3(o.transform,n||null);a!=null&&(r===null&&(r=qo.empty()),r.set(o.field,a))}return r||null}function l3(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(o,n){return o===void 0&&n===void 0||!(!o||!n)&&iu(o,n,(a,i)=>vle(a,i))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}var ll=class extends fu{constructor(e,r,o,n=[]){super(),this.key=e,this.value=r,this.precondition=o,this.fieldTransforms=n,this.type=0}getFieldMask(){return null}},Ea=class extends fu{constructor(e,r,o,n,a=[]){super(),this.key=e,this.data=r,this.fieldMask=o,this.precondition=n,this.fieldTransforms=a,this.type=1}getFieldMask(){return this.fieldMask}};function X3(t){let e=new Map;return t.fieldMask.fields.forEach(r=>{if(!r.isEmpty()){let o=t.data.field(r);e.set(r,o)}}),e}function c3(t,e,r){let o=new Map;Ct(t.length===r.length);for(let n=0;n<r.length;n++){let a=t[n],i=a.transform,s=e.data.field(a.field);o.set(a.field,yle(i,s,r[n]))}return o}function u3(t,e,r){let o=new Map;for(let n of t){let a=n.transform,i=r.data.field(n.field);o.set(n.field,ble(a,i,e))}return o}var cl=class extends fu{constructor(e,r){super(),this.key=e,this.precondition=r,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}},yx=class extends fu{constructor(e,r){super(),this.key=e,this.precondition=r,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}};var NE=class{constructor(e,r,o,n){this.batchId=e,this.localWriteTime=r,this.baseMutations=o,this.mutations=n}applyToRemoteDocument(e,r){let o=r.mutationResults;for(let n=0;n<this.mutations.length;n++){let a=this.mutations[n];a.key.isEqual(e.key)&&Ile(a,e,o[n])}}applyToLocalView(e,r){for(let o of this.baseMutations)o.key.isEqual(e.key)&&(r=rp(o,e,r,this.localWriteTime));for(let o of this.mutations)o.key.isEqual(e.key)&&(r=rp(o,e,r,this.localWriteTime));return r}applyToLocalDocumentSet(e,r){let o=V3();return this.mutations.forEach(n=>{let a=e.get(n.key),i=a.overlayedDocument,s=this.applyToLocalView(i,a.mutatedFields);s=r.has(n.key)?null:s;let l=K3(i,s);l!==null&&o.set(n.key,l),i.isValidDocument()||i.convertToNoDocument(Le.min())}),o}keys(){return this.mutations.reduce((e,r)=>e.add(r.key),tt())}isEqual(e){return this.batchId===e.batchId&&iu(this.mutations,e.mutations,(r,o)=>l3(r,o))&&iu(this.baseMutations,e.baseMutations,(r,o)=>l3(r,o))}},ME=class t{constructor(e,r,o,n){this.batch=e,this.commitVersion=r,this.mutationResults=o,this.docVersions=n}static from(e,r,o){Ct(e.mutations.length===o.length);let n=function(){return mle}(),a=e.mutations;for(let i=0;i<a.length;i++)n=n.insert(a[i].key,o[i].version);return new t(e,r,o,n)}};var LE=class{constructor(e,r){this.largestBatchId=e,this.mutation=r}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
|
|
18
|
+
`}),e}function tE(t,e,r){e:{for(o in r){var o=!1;break e}o=!0}o||(r=P6(r),typeof t=="string"?r!=null&&encodeURIComponent(String(r)):Bt(t,e,r))}function Tf(t,e,r){return r&&r.internalChannelParams&&r.internalChannelParams[t]||e}function O6(t){this.Ga=0,this.j=[],this.l=new Q_,this.pa=this.wa=this.I=this.Y=this.g=this.Da=this.F=this.na=this.o=this.U=this.s=null,this.fb=this.W=0,this.cb=Tf("failFast",!1,t),this.G=this.v=this.u=this.m=this.h=null,this.aa=!0,this.Fa=this.V=-1,this.ba=this.A=this.C=0,this.ab=Tf("baseRetryDelayMs",5e3,t),this.hb=Tf("retryDelaySeedMs",1e4,t),this.eb=Tf("forwardChannelMaxRetries",2,t),this.xa=Tf("forwardChannelRequestTimeoutMs",2e4,t),this.va=t&&t.xmlHttpFactory||void 0,this.Ha=t&&t.useFetchStreams||!1,this.L=void 0,this.J=t&&t.supportsCrossDomainXhr||!1,this.K="",this.i=new b6(t&&t.concurrentRequestLimit),this.Ja=new zse,this.P=t&&t.fastHandshake||!1,this.O=t&&t.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=t&&t.bc||!1,t&&t.Ea&&this.l.Ea(),t&&t.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&t&&t.detectBufferingProxy||!1,this.qa=void 0,t&&t.longPollingTimeout&&0<t.longPollingTimeout&&(this.qa=t.longPollingTimeout),this.oa=void 0,this.S=0,this.M=!1,this.ma=this.B=null}ae=O6.prototype;ae.ra=8;ae.H=1;function rE(t){if(A6(t),t.H==3){var e=t.W++,r=Ya(t.I);if(Bt(r,"SID",t.K),Bt(r,"RID",e),Bt(r,"TYPE","terminate"),Xf(t,r),e=new qf(t,t.l,e),e.L=2,e.v=rx(Ya(r)),r=!1,Ue.navigator&&Ue.navigator.sendBeacon)try{r=Ue.navigator.sendBeacon(e.v.toString(),"")}catch{}!r&&Ue.Image&&(new Image().src=e.v,r=!0),r||(e.g=z6(e.l,null),e.g.ha(e.v)),e.G=Date.now(),Gf(e)}B6(t)}function ax(t){t.g&&(nE(t),t.g.cancel(),t.g=null)}function A6(t){ax(t),t.u&&(Ue.clearTimeout(t.u),t.u=null),H_(t),t.i.cancel(),t.m&&(typeof t.m=="number"&&Ue.clearTimeout(t.m),t.m=null)}function ix(t){if(!y6(t.i)&&!t.m){t.m=!0;var e=t.Na;Mf||e6(),Lf||(Mf(),Lf=!0),W0.add(e,t),t.C=0}}function Wse(t,e){return v6(t.i)>=t.i.j-(t.m?1:0)?!1:t.m?(t.j=e.F.concat(t.j),!0):t.H==1||t.H==2||t.C>=(t.cb?0:t.eb)?!1:(t.m=$f(lo(t.Na,t,e),L6(t,t.C)),t.C++,!0)}ae.Na=function(t){if(this.m)if(this.m=null,this.H==1){if(!t){this.W=Math.floor(1e5*Math.random()),t=this.W++;let n=new qf(this,this.l,t),a=this.s;if(this.U&&(a?(a=G5(a),W5(a,this.U)):a=this.U),this.o!==null||this.O||(n.I=a,a=null),this.P)e:{for(var e=0,r=0;r<this.j.length;r++){t:{var o=this.j[r];if("__data__"in o.map&&(o=o.map.__data__,typeof o=="string")){o=o.length;break t}o=void 0}if(o===void 0)break;if(e+=o,4096<e){e=r;break e}if(e===4096||r===this.j.length-1){e=r+1;break e}}e=1e3}else e=1e3;e=D6(this,n,e),r=Ya(this.I),Bt(r,"RID",t),Bt(r,"CVER",22),this.F&&Bt(r,"X-HTTP-Session-Id",this.F),Xf(this,r),a&&(this.O?e="headers="+encodeURIComponent(String(P6(a)))+"&"+e:this.o&&tE(r,this.o,a)),J0(this.i,n),this.bb&&Bt(r,"TYPE","init"),this.P?(Bt(r,"$req",e),Bt(r,"SID","null"),n.aa=!0,R0(n,r,null)):R0(n,r,e),this.H=2}}else this.H==3&&(t?z5(this,t):this.j.length==0||y6(this.i)||z5(this))};function z5(t,e){var r;e?r=e.m:r=t.W++;let o=Ya(t.I);Bt(o,"SID",t.K),Bt(o,"RID",r),Bt(o,"AID",t.V),Xf(t,o),t.o&&t.s&&tE(o,t.o,t.s),r=new qf(t,t.l,r,t.C+1),t.o===null&&(r.I=t.s),e&&(t.j=e.F.concat(t.j)),e=D6(t,r,1e3),r.setTimeout(Math.round(.5*t.xa)+Math.round(.5*t.xa*Math.random())),J0(t.i,r),R0(r,o,e)}function Xf(t,e){t.na&&V0(t.na,function(r,o){Bt(e,o,r)}),t.h&&m6({},function(r,o){Bt(e,o,r)})}function D6(t,e,r){r=Math.min(t.j.length,r);var o=t.h?lo(t.h.Va,t.h,t):null;e:{var n=t.j;let a=-1;for(;;){let i=["count="+r];a==-1?0<r?(a=n[0].g,i.push("ofs="+a)):a=0:i.push("ofs="+a);let s=!0;for(let l=0;l<r;l++){let c=n[l].g,u=n[l].map;if(c-=a,0>c)a=Math.max(0,n[l].g-100),s=!1;else try{Use(u,i,"req"+c+"_")}catch{o&&o(u)}}if(s){o=i.join("&");break e}}}return t=t.j.splice(0,r),e.F=t,o}function R6(t){if(!t.g&&!t.u){t.ba=1;var e=t.Ma;Mf||e6(),Lf||(Mf(),Lf=!0),W0.add(e,t),t.A=0}}function oE(t){return t.g||t.u||3<=t.A?!1:(t.ba++,t.u=$f(lo(t.Ma,t),L6(t,t.A)),t.A++,!0)}ae.Ma=function(){if(this.u=null,N6(this),this.ca&&!(this.M||this.g==null||0>=this.S)){var t=2*this.S;this.l.info("BP detection timer enabled: "+t),this.B=$f(lo(this.jb,this),t)}};ae.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,Do(10),ax(this),N6(this))};function nE(t){t.B!=null&&(Ue.clearTimeout(t.B),t.B=null)}function N6(t){t.g=new qf(t,t.l,"rpc",t.ba),t.o===null&&(t.g.I=t.s),t.g.O=0;var e=Ya(t.wa);Bt(e,"RID","rpc"),Bt(e,"SID",t.K),Bt(e,"AID",t.V),Bt(e,"CI",t.G?"0":"1"),!t.G&&t.qa&&Bt(e,"TO",t.qa),Bt(e,"TYPE","xmlhttp"),Xf(t,e),t.o&&t.s&&tE(e,t.o,t.s),t.L&&t.g.setTimeout(t.L);var r=t.g;t=t.pa,r.L=1,r.v=rx(Ya(e)),r.s=null,r.S=!0,u6(r,t)}ae.ib=function(){this.v!=null&&(this.v=null,ax(this),oE(this),Do(19))};function H_(t){t.v!=null&&(Ue.clearTimeout(t.v),t.v=null)}function M6(t,e){var r=null;if(t.g==e){H_(t),nE(t),t.g=null;var o=2}else if(M0(t.i,e))r=e.F,I6(t.i,e),o=1;else return;if(t.H!=0){if(e.i)if(o==1){r=e.s?e.s.length:0,e=Date.now()-e.G;var n=t.C;o=Z_(),Zr(o,new i6(o,r)),ix(t)}else R6(t);else if(n=e.o,n==3||n==0&&0<e.ca||!(o==1&&Wse(t,e)||o==2&&oE(t)))switch(r&&0<r.length&&(e=t.i,e.i=e.i.concat(r)),n){case 1:Ys(t,5);break;case 4:Ys(t,10);break;case 3:Ys(t,6);break;default:Ys(t,2)}}}function L6(t,e){let r=t.ab+Math.floor(Math.random()*t.hb);return t.isActive()||(r*=2),r*e}function Ys(t,e){if(t.l.info("Error code "+e),e==2){var r=null;t.h&&(r=null);var o=lo(t.pb,t);r||(r=new Qs("//www.google.com/images/cleardot.gif"),Ue.location&&Ue.location.protocol=="http"||U_(r,"https"),rx(r)),Vse(r.toString(),o)}else Do(2);t.H=0,t.h&&t.h.za(e),B6(t),A6(t)}ae.pb=function(t){t?(this.l.info("Successfully pinged google.com"),Do(2)):(this.l.info("Failed to ping google.com"),Do(1))};function B6(t){if(t.H=0,t.ma=[],t.h){let e=w6(t.i);(e.length!=0||t.j.length!=0)&&(O5(t.ma,e),O5(t.ma,t.j),t.i.i.length=0,z0(t.j),t.j.length=0),t.h.ya()}}function F6(t,e,r){var o=r instanceof Qs?Ya(r):new Qs(r);if(o.g!="")e&&(o.g=e+"."+o.g),V_(o,o.m);else{var n=Ue.location;o=n.protocol,e=e?e+"."+n.hostname:n.hostname,n=+n.port;var a=new Qs(null);o&&U_(a,o),e&&(a.g=e),n&&V_(a,n),r&&(a.l=r),o=a}return r=t.F,e=t.Da,r&&e&&Bt(o,r,e),Bt(o,"VER",t.ra),Xf(t,o),o}function z6(t,e,r){if(e&&!t.J)throw Error("Can't create secondary domain capable XhrIo object.");return e=r&&t.Ha&&!t.va?new Jt(new Wf({ob:!0})):new Jt(t.va),e.Oa(t.J),e}ae.isActive=function(){return!!this.h&&this.h.isActive(this)};function U6(){}ae=U6.prototype;ae.Ba=function(){};ae.Aa=function(){};ae.za=function(){};ae.ya=function(){};ae.isActive=function(){return!0};ae.Va=function(){};function $_(){if(Qc&&!(10<=Number(use)))throw Error("Environmental error: no available transport.")}$_.prototype.g=function(t,e){return new en(t,e)};function en(t,e){Br.call(this),this.g=new O6(e),this.l=t,this.h=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.g.s=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.Ca&&(t?t["X-WebChannel-Client-Profile"]=e.Ca:t={"X-WebChannel-Client-Profile":e.Ca}),this.g.U=t,(t=e&&e.cc)&&!Rf(t)&&(this.g.o=t),this.A=e&&e.supportsCrossDomainXhr||!1,this.v=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!Rf(e)&&(this.g.F=e,t=this.h,t!==null&&e in t&&(t=this.h,e in t&&delete t[e])),this.j=new Jc(this)}Fr(en,Br);en.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var t=this.g,e=this.l,r=this.h||void 0;Do(0),t.Y=e,t.na=r||{},t.G=t.aa,t.I=F6(t,null,t.Y),ix(t)};en.prototype.close=function(){rE(this.g)};en.prototype.u=function(t){var e=this.g;if(typeof t=="string"){var r={};r.__data__=t,t=r}else this.v&&(r={},r.__data__=G0(t),t=r);e.j.push(new Lse(e.fb++,t)),e.H==3&&ix(e)};en.prototype.N=function(){this.g.h=null,delete this.j,rE(this.g),delete this.g,en.$.N.call(this)};function V6(t){Q0.call(this),t.__headers__&&(this.headers=t.__headers__,this.statusCode=t.__status__,delete t.__headers__,delete t.__status__);var e=t.__sm__;if(e){e:{for(let r in e){t=r;break e}t=void 0}(this.i=t)&&(t=this.i,e=e!==null&&t in e?e[t]:void 0),this.data=e}else this.data=t}Fr(V6,Q0);function H6(){Z0.call(this),this.status=1}Fr(H6,Z0);function Jc(t){this.g=t}Fr(Jc,U6);Jc.prototype.Ba=function(){Zr(this.g,"a")};Jc.prototype.Aa=function(t){Zr(this.g,new V6(t))};Jc.prototype.za=function(t){Zr(this.g,new H6)};Jc.prototype.ya=function(){Zr(this.g,"b")};function Kse(){this.blockSize=-1}function Kn(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.m=Array(this.blockSize),this.i=this.h=0,this.reset()}Fr(Kn,Kse);Kn.prototype.reset=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.i=this.h=0};function v0(t,e,r){r||(r=0);var o=Array(16);if(typeof e=="string")for(var n=0;16>n;++n)o[n]=e.charCodeAt(r++)|e.charCodeAt(r++)<<8|e.charCodeAt(r++)<<16|e.charCodeAt(r++)<<24;else for(n=0;16>n;++n)o[n]=e[r++]|e[r++]<<8|e[r++]<<16|e[r++]<<24;e=t.g[0],r=t.g[1],n=t.g[2];var a=t.g[3],i=e+(a^r&(n^a))+o[0]+3614090360&4294967295;e=r+(i<<7&4294967295|i>>>25),i=a+(n^e&(r^n))+o[1]+3905402710&4294967295,a=e+(i<<12&4294967295|i>>>20),i=n+(r^a&(e^r))+o[2]+606105819&4294967295,n=a+(i<<17&4294967295|i>>>15),i=r+(e^n&(a^e))+o[3]+3250441966&4294967295,r=n+(i<<22&4294967295|i>>>10),i=e+(a^r&(n^a))+o[4]+4118548399&4294967295,e=r+(i<<7&4294967295|i>>>25),i=a+(n^e&(r^n))+o[5]+1200080426&4294967295,a=e+(i<<12&4294967295|i>>>20),i=n+(r^a&(e^r))+o[6]+2821735955&4294967295,n=a+(i<<17&4294967295|i>>>15),i=r+(e^n&(a^e))+o[7]+4249261313&4294967295,r=n+(i<<22&4294967295|i>>>10),i=e+(a^r&(n^a))+o[8]+1770035416&4294967295,e=r+(i<<7&4294967295|i>>>25),i=a+(n^e&(r^n))+o[9]+2336552879&4294967295,a=e+(i<<12&4294967295|i>>>20),i=n+(r^a&(e^r))+o[10]+4294925233&4294967295,n=a+(i<<17&4294967295|i>>>15),i=r+(e^n&(a^e))+o[11]+2304563134&4294967295,r=n+(i<<22&4294967295|i>>>10),i=e+(a^r&(n^a))+o[12]+1804603682&4294967295,e=r+(i<<7&4294967295|i>>>25),i=a+(n^e&(r^n))+o[13]+4254626195&4294967295,a=e+(i<<12&4294967295|i>>>20),i=n+(r^a&(e^r))+o[14]+2792965006&4294967295,n=a+(i<<17&4294967295|i>>>15),i=r+(e^n&(a^e))+o[15]+1236535329&4294967295,r=n+(i<<22&4294967295|i>>>10),i=e+(n^a&(r^n))+o[1]+4129170786&4294967295,e=r+(i<<5&4294967295|i>>>27),i=a+(r^n&(e^r))+o[6]+3225465664&4294967295,a=e+(i<<9&4294967295|i>>>23),i=n+(e^r&(a^e))+o[11]+643717713&4294967295,n=a+(i<<14&4294967295|i>>>18),i=r+(a^e&(n^a))+o[0]+3921069994&4294967295,r=n+(i<<20&4294967295|i>>>12),i=e+(n^a&(r^n))+o[5]+3593408605&4294967295,e=r+(i<<5&4294967295|i>>>27),i=a+(r^n&(e^r))+o[10]+38016083&4294967295,a=e+(i<<9&4294967295|i>>>23),i=n+(e^r&(a^e))+o[15]+3634488961&4294967295,n=a+(i<<14&4294967295|i>>>18),i=r+(a^e&(n^a))+o[4]+3889429448&4294967295,r=n+(i<<20&4294967295|i>>>12),i=e+(n^a&(r^n))+o[9]+568446438&4294967295,e=r+(i<<5&4294967295|i>>>27),i=a+(r^n&(e^r))+o[14]+3275163606&4294967295,a=e+(i<<9&4294967295|i>>>23),i=n+(e^r&(a^e))+o[3]+4107603335&4294967295,n=a+(i<<14&4294967295|i>>>18),i=r+(a^e&(n^a))+o[8]+1163531501&4294967295,r=n+(i<<20&4294967295|i>>>12),i=e+(n^a&(r^n))+o[13]+2850285829&4294967295,e=r+(i<<5&4294967295|i>>>27),i=a+(r^n&(e^r))+o[2]+4243563512&4294967295,a=e+(i<<9&4294967295|i>>>23),i=n+(e^r&(a^e))+o[7]+1735328473&4294967295,n=a+(i<<14&4294967295|i>>>18),i=r+(a^e&(n^a))+o[12]+2368359562&4294967295,r=n+(i<<20&4294967295|i>>>12),i=e+(r^n^a)+o[5]+4294588738&4294967295,e=r+(i<<4&4294967295|i>>>28),i=a+(e^r^n)+o[8]+2272392833&4294967295,a=e+(i<<11&4294967295|i>>>21),i=n+(a^e^r)+o[11]+1839030562&4294967295,n=a+(i<<16&4294967295|i>>>16),i=r+(n^a^e)+o[14]+4259657740&4294967295,r=n+(i<<23&4294967295|i>>>9),i=e+(r^n^a)+o[1]+2763975236&4294967295,e=r+(i<<4&4294967295|i>>>28),i=a+(e^r^n)+o[4]+1272893353&4294967295,a=e+(i<<11&4294967295|i>>>21),i=n+(a^e^r)+o[7]+4139469664&4294967295,n=a+(i<<16&4294967295|i>>>16),i=r+(n^a^e)+o[10]+3200236656&4294967295,r=n+(i<<23&4294967295|i>>>9),i=e+(r^n^a)+o[13]+681279174&4294967295,e=r+(i<<4&4294967295|i>>>28),i=a+(e^r^n)+o[0]+3936430074&4294967295,a=e+(i<<11&4294967295|i>>>21),i=n+(a^e^r)+o[3]+3572445317&4294967295,n=a+(i<<16&4294967295|i>>>16),i=r+(n^a^e)+o[6]+76029189&4294967295,r=n+(i<<23&4294967295|i>>>9),i=e+(r^n^a)+o[9]+3654602809&4294967295,e=r+(i<<4&4294967295|i>>>28),i=a+(e^r^n)+o[12]+3873151461&4294967295,a=e+(i<<11&4294967295|i>>>21),i=n+(a^e^r)+o[15]+530742520&4294967295,n=a+(i<<16&4294967295|i>>>16),i=r+(n^a^e)+o[2]+3299628645&4294967295,r=n+(i<<23&4294967295|i>>>9),i=e+(n^(r|~a))+o[0]+4096336452&4294967295,e=r+(i<<6&4294967295|i>>>26),i=a+(r^(e|~n))+o[7]+1126891415&4294967295,a=e+(i<<10&4294967295|i>>>22),i=n+(e^(a|~r))+o[14]+2878612391&4294967295,n=a+(i<<15&4294967295|i>>>17),i=r+(a^(n|~e))+o[5]+4237533241&4294967295,r=n+(i<<21&4294967295|i>>>11),i=e+(n^(r|~a))+o[12]+1700485571&4294967295,e=r+(i<<6&4294967295|i>>>26),i=a+(r^(e|~n))+o[3]+2399980690&4294967295,a=e+(i<<10&4294967295|i>>>22),i=n+(e^(a|~r))+o[10]+4293915773&4294967295,n=a+(i<<15&4294967295|i>>>17),i=r+(a^(n|~e))+o[1]+2240044497&4294967295,r=n+(i<<21&4294967295|i>>>11),i=e+(n^(r|~a))+o[8]+1873313359&4294967295,e=r+(i<<6&4294967295|i>>>26),i=a+(r^(e|~n))+o[15]+4264355552&4294967295,a=e+(i<<10&4294967295|i>>>22),i=n+(e^(a|~r))+o[6]+2734768916&4294967295,n=a+(i<<15&4294967295|i>>>17),i=r+(a^(n|~e))+o[13]+1309151649&4294967295,r=n+(i<<21&4294967295|i>>>11),i=e+(n^(r|~a))+o[4]+4149444226&4294967295,e=r+(i<<6&4294967295|i>>>26),i=a+(r^(e|~n))+o[11]+3174756917&4294967295,a=e+(i<<10&4294967295|i>>>22),i=n+(e^(a|~r))+o[2]+718787259&4294967295,n=a+(i<<15&4294967295|i>>>17),i=r+(a^(n|~e))+o[9]+3951481745&4294967295,t.g[0]=t.g[0]+e&4294967295,t.g[1]=t.g[1]+(n+(i<<21&4294967295|i>>>11))&4294967295,t.g[2]=t.g[2]+n&4294967295,t.g[3]=t.g[3]+a&4294967295}Kn.prototype.j=function(t,e){e===void 0&&(e=t.length);for(var r=e-this.blockSize,o=this.m,n=this.h,a=0;a<e;){if(n==0)for(;a<=r;)v0(this,t,a),a+=this.blockSize;if(typeof t=="string"){for(;a<e;)if(o[n++]=t.charCodeAt(a++),n==this.blockSize){v0(this,o),n=0;break}}else for(;a<e;)if(o[n++]=t[a++],n==this.blockSize){v0(this,o),n=0;break}}this.h=n,this.i+=e};Kn.prototype.l=function(){var t=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);t[0]=128;for(var e=1;e<t.length-8;++e)t[e]=0;var r=8*this.i;for(e=t.length-8;e<t.length;++e)t[e]=r&255,r/=256;for(this.j(t),t=Array(16),e=r=0;4>e;++e)for(var o=0;32>o;o+=8)t[r++]=this.g[e]>>>o&255;return t};function St(t,e){this.h=e;for(var r=[],o=!0,n=t.length-1;0<=n;n--){var a=t[n]|0;o&&a==e||(r[n]=a,o=!1)}this.g=r}var Xse={};function aE(t){return-128<=t&&128>t?sse(t,function(e){return new St([e|0],0>e?-1:0)}):new St([t|0],0>t?-1:0)}function ba(t){if(isNaN(t)||!isFinite(t))return Yc;if(0>t)return Qr(ba(-t));for(var e=[],r=1,o=0;t>=r;o++)e[o]=t/r|0,r*=L0;return new St(e,0)}function $6(t,e){if(t.length==0)throw Error("number format error: empty string");if(e=e||10,2>e||36<e)throw Error("radix out of range: "+e);if(t.charAt(0)=="-")return Qr($6(t.substring(1),e));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var r=ba(Math.pow(e,8)),o=Yc,n=0;n<t.length;n+=8){var a=Math.min(8,t.length-n),i=parseInt(t.substring(n,n+a),e);8>a?(a=ba(Math.pow(e,a)),o=o.R(a).add(ba(i))):(o=o.R(r),o=o.add(ba(i)))}return o}var L0=4294967296,Yc=aE(0),B0=aE(1),U5=aE(16777216);ae=St.prototype;ae.ea=function(){if(Pn(this))return-Qr(this).ea();for(var t=0,e=1,r=0;r<this.g.length;r++){var o=this.D(r);t+=(0<=o?o:L0+o)*e,e*=L0}return t};ae.toString=function(t){if(t=t||10,2>t||36<t)throw Error("radix out of range: "+t);if(Xa(this))return"0";if(Pn(this))return"-"+Qr(this).toString(t);for(var e=ba(Math.pow(t,6)),r=this,o="";;){var n=q_(r,e).g;r=j_(r,n.R(e));var a=((0<r.g.length?r.g[0]:r.h)>>>0).toString(t);if(r=n,Xa(r))return a+o;for(;6>a.length;)a="0"+a;o=a+o}};ae.D=function(t){return 0>t?0:t<this.g.length?this.g[t]:this.h};function Xa(t){if(t.h!=0)return!1;for(var e=0;e<t.g.length;e++)if(t.g[e]!=0)return!1;return!0}function Pn(t){return t.h==-1}ae.X=function(t){return t=j_(this,t),Pn(t)?-1:Xa(t)?0:1};function Qr(t){for(var e=t.g.length,r=[],o=0;o<e;o++)r[o]=~t.g[o];return new St(r,~t.h).add(B0)}ae.abs=function(){return Pn(this)?Qr(this):this};ae.add=function(t){for(var e=Math.max(this.g.length,t.g.length),r=[],o=0,n=0;n<=e;n++){var a=o+(this.D(n)&65535)+(t.D(n)&65535),i=(a>>>16)+(this.D(n)>>>16)+(t.D(n)>>>16);o=i>>>16,a&=65535,i&=65535,r[n]=i<<16|a}return new St(r,r[r.length-1]&-2147483648?-1:0)};function j_(t,e){return t.add(Qr(e))}ae.R=function(t){if(Xa(this)||Xa(t))return Yc;if(Pn(this))return Pn(t)?Qr(this).R(Qr(t)):Qr(Qr(this).R(t));if(Pn(t))return Qr(this.R(Qr(t)));if(0>this.X(U5)&&0>t.X(U5))return ba(this.ea()*t.ea());for(var e=this.g.length+t.g.length,r=[],o=0;o<2*e;o++)r[o]=0;for(o=0;o<this.g.length;o++)for(var n=0;n<t.g.length;n++){var a=this.D(o)>>>16,i=this.D(o)&65535,s=t.D(n)>>>16,l=t.D(n)&65535;r[2*o+2*n]+=i*l,F_(r,2*o+2*n),r[2*o+2*n+1]+=a*l,F_(r,2*o+2*n+1),r[2*o+2*n+1]+=i*s,F_(r,2*o+2*n+1),r[2*o+2*n+2]+=a*s,F_(r,2*o+2*n+2)}for(o=0;o<e;o++)r[o]=r[2*o+1]<<16|r[2*o];for(o=e;o<2*e;o++)r[o]=0;return new St(r,0)};function F_(t,e){for(;(t[e]&65535)!=t[e];)t[e+1]+=t[e]>>>16,t[e]&=65535,e++}function Pf(t,e){this.g=t,this.h=e}function q_(t,e){if(Xa(e))throw Error("division by zero");if(Xa(t))return new Pf(Yc,Yc);if(Pn(t))return e=q_(Qr(t),e),new Pf(Qr(e.g),Qr(e.h));if(Pn(e))return e=q_(t,Qr(e)),new Pf(Qr(e.g),e.h);if(30<t.g.length){if(Pn(t)||Pn(e))throw Error("slowDivide_ only works with positive integers.");for(var r=B0,o=e;0>=o.X(t);)r=V5(r),o=V5(o);var n=Kc(r,1),a=Kc(o,1);for(o=Kc(o,2),r=Kc(r,2);!Xa(o);){var i=a.add(o);0>=i.X(t)&&(n=n.add(r),a=i),o=Kc(o,1),r=Kc(r,1)}return e=j_(t,n.R(e)),new Pf(n,e)}for(n=Yc;0<=t.X(e);){for(r=Math.max(1,Math.floor(t.ea()/e.ea())),o=Math.ceil(Math.log(r)/Math.LN2),o=48>=o?1:Math.pow(2,o-48),a=ba(r),i=a.R(e);Pn(i)||0<i.X(t);)r-=o,a=ba(r),i=a.R(e);Xa(a)&&(a=B0),n=n.add(a),t=j_(t,i)}return new Pf(n,t)}ae.gb=function(t){return q_(this,t).h};ae.and=function(t){for(var e=Math.max(this.g.length,t.g.length),r=[],o=0;o<e;o++)r[o]=this.D(o)&t.D(o);return new St(r,this.h&t.h)};ae.or=function(t){for(var e=Math.max(this.g.length,t.g.length),r=[],o=0;o<e;o++)r[o]=this.D(o)|t.D(o);return new St(r,this.h|t.h)};ae.xor=function(t){for(var e=Math.max(this.g.length,t.g.length),r=[],o=0;o<e;o++)r[o]=this.D(o)^t.D(o);return new St(r,this.h^t.h)};function V5(t){for(var e=t.g.length+1,r=[],o=0;o<e;o++)r[o]=t.D(o)<<1|t.D(o-1)>>>31;return new St(r,t.h)}function Kc(t,e){var r=e>>5;e%=32;for(var o=t.g.length-r,n=[],a=0;a<o;a++)n[a]=0<e?t.D(a+r)>>>e|t.D(a+r+1)<<32-e:t.D(a+r);return new St(n,t.h)}$_.prototype.createWebChannel=$_.prototype.g;en.prototype.send=en.prototype.u;en.prototype.open=en.prototype.m;en.prototype.close=en.prototype.close;J_.NO_ERROR=0;J_.TIMEOUT=8;J_.HTTP_ERROR=6;s6.COMPLETE="complete";l6.EventType=jf;jf.OPEN="a";jf.CLOSE="b";jf.ERROR="c";jf.MESSAGE="d";Br.prototype.listen=Br.prototype.O;Jt.prototype.listenOnce=Jt.prototype.P;Jt.prototype.getLastError=Jt.prototype.Sa;Jt.prototype.getLastErrorCode=Jt.prototype.Ia;Jt.prototype.getStatus=Jt.prototype.da;Jt.prototype.getResponseJson=Jt.prototype.Wa;Jt.prototype.getResponseText=Jt.prototype.ja;Jt.prototype.send=Jt.prototype.ha;Jt.prototype.setWithCredentials=Jt.prototype.Oa;Kn.prototype.digest=Kn.prototype.l;Kn.prototype.reset=Kn.prototype.reset;Kn.prototype.update=Kn.prototype.j;St.prototype.add=St.prototype.add;St.prototype.multiply=St.prototype.R;St.prototype.modulo=St.prototype.gb;St.prototype.compare=St.prototype.X;St.prototype.toNumber=St.prototype.ea;St.prototype.toString=St.prototype.toString;St.prototype.getBits=St.prototype.D;St.fromNumber=ba;St.fromString=$6;var j6=Xn.createWebChannelTransport=function(){return new $_},q6=Xn.getStatEventTarget=function(){return Z_()},sx=Xn.ErrorCode=J_,G6=Xn.EventType=s6,W6=Xn.Event=Zs,iE=Xn.Stat={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},K6=Xn.FetchXmlHttpFactory=Wf,Yf=Xn.WebChannel=l6,X6=Xn.XhrIo=Jt,Y6=Xn.Md5=Kn,Js=Xn.Integer=St;var Q6="@firebase/firestore";var fo=class{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}};fo.UNAUTHENTICATED=new fo(null),fo.GOOGLE_CREDENTIALS=new fo("google-credentials-uid"),fo.FIRST_PARTY=new fo("first-party-uid"),fo.MOCK_USER=new fo("mock-user");var _u="10.5.2";var rl=new Pi("@firebase/firestore");function Qf(){return rl.logLevel}function ge(t,...e){if(rl.logLevel<=Qe.DEBUG){let r=e.map($1);rl.debug(`Firestore (${_u}): ${t}`,...r)}}function Qa(t,...e){if(rl.logLevel<=Qe.ERROR){let r=e.map($1);rl.error(`Firestore (${_u}): ${t}`,...r)}}function np(t,...e){if(rl.logLevel<=Qe.WARN){let r=e.map($1);rl.warn(`Firestore (${_u}): ${t}`,...r)}}function $1(t){if(typeof t=="string")return t;try{return function(r){return JSON.stringify(r)}(t)}catch{return t}}function De(t="Unexpected state"){let e=`FIRESTORE (${_u}) INTERNAL ASSERTION FAILED: `+t;throw Qa(e),new Error(e)}function Ct(t,e){t||De()}function Ve(t,e){return t}var j={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},re=class extends Oo{constructor(e,r){super(e,r),this.code=e,this.message=r,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}};var An=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};var uE=class{constructor(e,r){this.user=r,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}},dE=class{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,r){e.enqueueRetryable(()=>r(fo.UNAUTHENTICATED))}shutdown(){}};var fE=class{constructor(e){this.t=e,this.currentUser=fo.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,r){let o=this.i,n=l=>this.i!==o?(o=this.i,r(l)):Promise.resolve(),a=new An;this.o=()=>{this.i++,this.currentUser=this.u(),a.resolve(),a=new An,e.enqueueRetryable(()=>n(this.currentUser))};let i=()=>{let l=a;e.enqueueRetryable(async()=>{await l.promise,await n(this.currentUser)})},s=l=>{ge("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,this.auth.addAuthTokenListener(this.o),i()};this.t.onInit(l=>s(l)),setTimeout(()=>{if(!this.auth){let l=this.t.getImmediate({optional:!0});l?s(l):(ge("FirebaseAuthCredentialsProvider","Auth not yet detected"),a.resolve(),a=new An)}},0),i()}getToken(){let e=this.i,r=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(r).then(o=>this.i!==e?(ge("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):o?(Ct(typeof o.accessToken=="string"),new uE(o.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){let e=this.auth&&this.auth.getUid();return Ct(e===null||typeof e=="string"),new fo(e)}},pE=class{constructor(e,r,o){this.l=e,this.h=r,this.P=o,this.type="FirstParty",this.user=fo.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);let e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}},mE=class{constructor(e,r,o){this.l=e,this.h=r,this.P=o}getToken(){return Promise.resolve(new pE(this.l,this.h,this.P))}start(e,r){e.enqueueRetryable(()=>r(fo.FIRST_PARTY))}shutdown(){}invalidateToken(){}},hE=class{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}},gE=class{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,r){let o=a=>{a.error!=null&&ge("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${a.error.message}`);let i=a.token!==this.R;return this.R=a.token,ge("FirebaseAppCheckTokenProvider",`Received ${i?"new":"existing"} token.`),i?r(a.token):Promise.resolve()};this.o=a=>{e.enqueueRetryable(()=>o(a))};let n=a=>{ge("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=a,this.appCheck.addTokenListener(this.o)};this.A.onInit(a=>n(a)),setTimeout(()=>{if(!this.appCheck){let a=this.A.getImmediate({optional:!0});a?n(a):ge("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(r=>r?(Ct(typeof r.token=="string"),this.R=r.token,new hE(r.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}};function Yse(t){let e=typeof self<"u"&&(self.crypto||self.msCrypto),r=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(r);else for(let o=0;o<t;o++)r[o]=Math.floor(256*Math.random());return r}var fx=class{static newId(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=Math.floor(256/e.length)*e.length,o="";for(;o.length<20;){let n=Yse(40);for(let a=0;a<n.length;++a)o.length<20&&n[a]<r&&(o+=e.charAt(n[a]%e.length))}return o}};function _t(t,e){return t<e?-1:t>e?1:0}function iu(t,e,r){return t.length===e.length&&t.every((o,n)=>r(o,e[n]))}var Ze=class t{constructor(e,r){if(this.seconds=e,this.nanoseconds=r,r<0)throw new re(j.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(r>=1e9)throw new re(j.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(e<-62135596800)throw new re(j.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new re(j.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return t.fromMillis(Date.now())}static fromDate(e){return t.fromMillis(e.getTime())}static fromMillis(e){let r=Math.floor(e/1e3),o=Math.floor(1e6*(e-1e3*r));return new t(r,o)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?_t(this.nanoseconds,e.nanoseconds):_t(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){let e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}};var Le=class t{constructor(e){this.timestamp=e}static fromTimestamp(e){return new t(e)}static min(){return new t(new Ze(0,0))}static max(){return new t(new Ze(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}};var px=class t{constructor(e,r,o){r===void 0?r=0:r>e.length&&De(),o===void 0?o=e.length-r:o>e.length-r&&De(),this.segments=e,this.offset=r,this.len=o}get length(){return this.len}isEqual(e){return t.comparator(this,e)===0}child(e){let r=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach(o=>{r.push(o)}):r.push(e),this.construct(r)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let r=0;r<this.length;r++)if(this.get(r)!==e.get(r))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let r=0;r<this.length;r++)if(this.get(r)!==e.get(r))return!1;return!0}forEach(e){for(let r=this.offset,o=this.limit();r<o;r++)e(this.segments[r])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,r){let o=Math.min(e.length,r.length);for(let n=0;n<o;n++){let a=e.get(n),i=r.get(n);if(a<i)return-1;if(a>i)return 1}return e.length<r.length?-1:e.length>r.length?1:0}},qt=class t extends px{construct(e,r,o){return new t(e,r,o)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...e){let r=[];for(let o of e){if(o.indexOf("//")>=0)throw new re(j.INVALID_ARGUMENT,`Invalid segment (${o}). Paths must not contain // in them.`);r.push(...o.split("/").filter(n=>n.length>0))}return new t(r)}static emptyPath(){return new t([])}},Qse=/^[_a-zA-Z][_a-zA-Z0-9]*$/,tn=class t extends px{construct(e,r,o){return new t(e,r,o)}static isValidIdentifier(e){return Qse.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),t.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new t(["__name__"])}static fromServerFormat(e){let r=[],o="",n=0,a=()=>{if(o.length===0)throw new re(j.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);r.push(o),o=""},i=!1;for(;n<e.length;){let s=e[n];if(s==="\\"){if(n+1===e.length)throw new re(j.INVALID_ARGUMENT,"Path has trailing escape character: "+e);let l=e[n+1];if(l!=="\\"&&l!=="."&&l!=="`")throw new re(j.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);o+=l,n+=2}else s==="`"?(i=!i,n++):s!=="."||i?(o+=s,n++):(a(),n++)}if(a(),i)throw new re(j.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new t(r)}static emptyPath(){return new t([])}};var Ce=class t{constructor(e){this.path=e}static fromPath(e){return new t(qt.fromString(e))}static fromName(e){return new t(qt.fromString(e).popFirst(5))}static empty(){return new t(qt.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&qt.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,r){return qt.comparator(e.path,r.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new t(new qt(e.slice()))}};var _E=class{constructor(e,r,o,n){this.indexId=e,this.collectionGroup=r,this.fields=o,this.indexState=n}};_E.UNKNOWN_ID=-1;function Zse(t,e){let r=t.toTimestamp().seconds,o=t.toTimestamp().nanoseconds+1,n=Le.fromTimestamp(o===1e9?new Ze(r+1,0):new Ze(r,o));return new ol(n,Ce.empty(),e)}function Jse(t){return new ol(t.readTime,t.key,-1)}var ol=class t{constructor(e,r,o){this.readTime=e,this.documentKey=r,this.largestBatchId=o}static min(){return new t(Le.min(),Ce.empty(),-1)}static max(){return new t(Le.max(),Ce.empty(),-1)}};function ele(t,e){let r=t.readTime.compareTo(e.readTime);return r!==0?r:(r=Ce.comparator(t.documentKey,e.documentKey),r!==0?r:_t(t.largestBatchId,e.largestBatchId))}var tle="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",xE=class{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}};async function wp(t){if(t.code!==j.FAILED_PRECONDITION||t.message!==tle)throw t;ge("LocalStore","Unexpectedly lost primary lease")}var ee=class t{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(r=>{this.isDone=!0,this.result=r,this.nextCallback&&this.nextCallback(r)},r=>{this.isDone=!0,this.error=r,this.catchCallback&&this.catchCallback(r)})}catch(e){return this.next(void 0,e)}next(e,r){return this.callbackAttached&&De(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(r,this.error):this.wrapSuccess(e,this.result):new t((o,n)=>{this.nextCallback=a=>{this.wrapSuccess(e,a).next(o,n)},this.catchCallback=a=>{this.wrapFailure(r,a).next(o,n)}})}toPromise(){return new Promise((e,r)=>{this.next(e,r)})}wrapUserFunction(e){try{let r=e();return r instanceof t?r:t.resolve(r)}catch(r){return t.reject(r)}}wrapSuccess(e,r){return e?this.wrapUserFunction(()=>e(r)):t.resolve(r)}wrapFailure(e,r){return e?this.wrapUserFunction(()=>e(r)):t.reject(r)}static resolve(e){return new t((r,o)=>{r(e)})}static reject(e){return new t((r,o)=>{o(e)})}static waitFor(e){return new t((r,o)=>{let n=0,a=0,i=!1;e.forEach(s=>{++n,s.next(()=>{++a,i&&a===n&&r()},l=>o(l))}),i=!0,a===n&&r()})}static or(e){let r=t.resolve(!1);for(let o of e)r=r.next(n=>n?t.resolve(n):o());return r}static forEach(e,r){let o=[];return e.forEach((n,a)=>{o.push(r.call(this,n,a))}),this.waitFor(o)}static mapArray(e,r){return new t((o,n)=>{let a=e.length,i=new Array(a),s=0;for(let l=0;l<a;l++){let c=l;r(e[c]).next(u=>{i[c]=u,++s,s===a&&o(i)},u=>n(u))}})}static doWhile(e,r){return new t((o,n)=>{let a=()=>{e()===!0?r().next(()=>{a()},n):o()};a()})}};function Ep(t){return t.name==="IndexedDbTransactionError"}var ap=class{constructor(e,r){this.previousValue=e,r&&(r.sequenceNumberHandler=o=>this.se(o),this.oe=o=>r.writeSequenceNumber(o))}se(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){let e=++this.previousValue;return this.oe&&this.oe(e),e}};ap._e=-1;function Sp(t){return t==null}function ip(t){return t===0&&1/t==-1/0}function rle(t){return typeof t=="number"&&Number.isInteger(t)&&!ip(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var ole=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries"],C7e=[...ole,"documentOverlays"],nle=["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"],ale=nle,k7e=[...ale,"indexConfiguration","indexState","indexEntries"];function Z6(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function dl(t,e){for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e(r,t[r])}function T3(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var tr=class t{constructor(e,r){this.comparator=e,this.root=r||va.EMPTY}insert(e,r){return new t(this.comparator,this.root.insert(e,r,this.comparator).copy(null,null,va.BLACK,null,null))}remove(e){return new t(this.comparator,this.root.remove(e,this.comparator).copy(null,null,va.BLACK,null,null))}get(e){let r=this.root;for(;!r.isEmpty();){let o=this.comparator(e,r.key);if(o===0)return r.value;o<0?r=r.left:o>0&&(r=r.right)}return null}indexOf(e){let r=0,o=this.root;for(;!o.isEmpty();){let n=this.comparator(e,o.key);if(n===0)return r+o.left.size;n<0?o=o.left:(r+=o.left.size+1,o=o.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((r,o)=>(e(r,o),!1))}toString(){let e=[];return this.inorderTraversal((r,o)=>(e.push(`${r}:${o}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new ou(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new ou(this.root,e,this.comparator,!1)}getReverseIterator(){return new ou(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new ou(this.root,e,this.comparator,!0)}},ou=class{constructor(e,r,o,n){this.isReverse=n,this.nodeStack=[];let a=1;for(;!e.isEmpty();)if(a=r?o(e.key,r):1,r&&n&&(a*=-1),a<0)e=this.isReverse?e.left:e.right;else{if(a===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),r={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return r}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;let e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}},va=class t{constructor(e,r,o,n,a){this.key=e,this.value=r,this.color=o??t.RED,this.left=n??t.EMPTY,this.right=a??t.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,r,o,n,a){return new t(e??this.key,r??this.value,o??this.color,n??this.left,a??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,r,o){let n=this,a=o(e,n.key);return n=a<0?n.copy(null,null,null,n.left.insert(e,r,o),null):a===0?n.copy(null,r,null,null,null):n.copy(null,null,null,null,n.right.insert(e,r,o)),n.fixUp()}removeMin(){if(this.left.isEmpty())return t.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,r){let o,n=this;if(r(e,n.key)<0)n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(e,r),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),r(e,n.key)===0){if(n.right.isEmpty())return t.EMPTY;o=n.right.min(),n=n.copy(o.key,o.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(e,r))}return n.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){let e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){let e=this.left.copy(null,null,!this.left.color,null,null),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,r)}checkMaxDepth(){let e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw De();let e=this.left.check();if(e!==this.right.check())throw De();return e+(this.isRed()?0:1)}};va.EMPTY=null,va.RED=!0,va.BLACK=!1;va.EMPTY=new class{constructor(){this.size=0}get key(){throw De()}get value(){throw De()}get color(){throw De()}get left(){throw De()}get right(){throw De()}copy(e,r,o,n,a){return this}insert(e,r,o){return new va(e,r)}remove(e,r){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};var po=class t{constructor(e){this.comparator=e,this.data=new tr(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((r,o)=>(e(r),!1))}forEachInRange(e,r){let o=this.data.getIteratorFrom(e[0]);for(;o.hasNext();){let n=o.getNext();if(this.comparator(n.key,e[1])>=0)return;r(n.key)}}forEachWhile(e,r){let o;for(o=r!==void 0?this.data.getIteratorFrom(r):this.data.getIterator();o.hasNext();)if(!e(o.getNext().key))return}firstAfterOrEqual(e){let r=this.data.getIteratorFrom(e);return r.hasNext()?r.getNext().key:null}getIterator(){return new mx(this.data.getIterator())}getIteratorFrom(e){return new mx(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let r=this;return r.size<e.size&&(r=e,e=this),e.forEach(o=>{r=r.add(o)}),r}isEqual(e){if(!(e instanceof t)||this.size!==e.size)return!1;let r=this.data.getIterator(),o=e.data.getIterator();for(;r.hasNext();){let n=r.getNext().key,a=o.getNext().key;if(this.comparator(n,a)!==0)return!1}return!0}toArray(){let e=[];return this.forEach(r=>{e.push(r)}),e}toString(){let e=[];return this.forEach(r=>e.push(r)),"SortedSet("+e.toString()+")"}copy(e){let r=new t(this.comparator);return r.data=e,r}},mx=class{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}};var On=class t{constructor(e){this.fields=e,e.sort(tn.comparator)}static empty(){return new t([])}unionWith(e){let r=new po(tn.comparator);for(let o of this.fields)r=r.add(o);for(let o of e)r=r.add(o);return new t(r.toArray())}covers(e){for(let r of this.fields)if(r.isPrefixOf(e))return!0;return!1}isEqual(e){return iu(this.fields,e.fields,(r,o)=>r.isEqual(o))}};var hx=class extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}};var Ro=class t{constructor(e){this.binaryString=e}static fromBase64String(e){let r=function(n){try{return atob(n)}catch(a){throw typeof DOMException<"u"&&a instanceof DOMException?new hx("Invalid base64 string: "+a):a}}(e);return new t(r)}static fromUint8Array(e){let r=function(n){let a="";for(let i=0;i<n.length;++i)a+=String.fromCharCode(n[i]);return a}(e);return new t(r)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(r){return btoa(r)}(this.binaryString)}toUint8Array(){return function(r){let o=new Uint8Array(r.length);for(let n=0;n<r.length;n++)o[n]=r.charCodeAt(n);return o}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return _t(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}};Ro.EMPTY_BYTE_STRING=new Ro("");var ile=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Bi(t){if(Ct(!!t),typeof t=="string"){let e=0,r=ile.exec(t);if(Ct(!!r),r[1]){let n=r[1];n=(n+"000000000").substr(0,9),e=Number(n)}let o=new Date(t);return{seconds:Math.floor(o.getTime()/1e3),nanos:e}}return{seconds:er(t.seconds),nanos:er(t.nanos)}}function er(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function Fi(t){return typeof t=="string"?Ro.fromBase64String(t):Ro.fromUint8Array(t)}function j1(t){var e,r;return((r=(((e=t?.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||r===void 0?void 0:r.stringValue)==="server_timestamp"}function q1(t){let e=t.mapValue.fields.__previous_value__;return j1(e)?q1(e):e}function sp(t){let e=Bi(t.mapValue.fields.__local_write_time__.timestampValue);return new Ze(e.seconds,e.nanos)}var bE=class{constructor(e,r,o,n,a,i,s,l,c){this.databaseId=e,this.appId=r,this.persistenceKey=o,this.host=n,this.ssl=a,this.forceLongPolling=i,this.autoDetectLongPolling=s,this.longPollingOptions=l,this.useFetchStreams=c}},gx=class t{constructor(e,r){this.projectId=e,this.database=r||"(default)"}static empty(){return new t("","")}get isDefaultDatabase(){return this.database==="(default)"}isEqual(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database}};var lx={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function nl(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?j1(t)?4:P3(t)?9007199254740991:10:De()}function wa(t,e){if(t===e)return!0;let r=nl(t);if(r!==nl(e))return!1;switch(r){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return sp(t).isEqual(sp(e));case 3:return function(n,a){if(typeof n.timestampValue=="string"&&typeof a.timestampValue=="string"&&n.timestampValue.length===a.timestampValue.length)return n.timestampValue===a.timestampValue;let i=Bi(n.timestampValue),s=Bi(a.timestampValue);return i.seconds===s.seconds&&i.nanos===s.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(n,a){return Fi(n.bytesValue).isEqual(Fi(a.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(n,a){return er(n.geoPointValue.latitude)===er(a.geoPointValue.latitude)&&er(n.geoPointValue.longitude)===er(a.geoPointValue.longitude)}(t,e);case 2:return function(n,a){if("integerValue"in n&&"integerValue"in a)return er(n.integerValue)===er(a.integerValue);if("doubleValue"in n&&"doubleValue"in a){let i=er(n.doubleValue),s=er(a.doubleValue);return i===s?ip(i)===ip(s):isNaN(i)&&isNaN(s)}return!1}(t,e);case 9:return iu(t.arrayValue.values||[],e.arrayValue.values||[],wa);case 10:return function(n,a){let i=n.mapValue.fields||{},s=a.mapValue.fields||{};if(Z6(i)!==Z6(s))return!1;for(let l in i)if(i.hasOwnProperty(l)&&(s[l]===void 0||!wa(i[l],s[l])))return!1;return!0}(t,e);default:return De()}}function lp(t,e){return(t.values||[]).find(r=>wa(r,e))!==void 0}function su(t,e){if(t===e)return 0;let r=nl(t),o=nl(e);if(r!==o)return _t(r,o);switch(r){case 0:case 9007199254740991:return 0;case 1:return _t(t.booleanValue,e.booleanValue);case 2:return function(a,i){let s=er(a.integerValue||a.doubleValue),l=er(i.integerValue||i.doubleValue);return s<l?-1:s>l?1:s===l?0:isNaN(s)?isNaN(l)?0:-1:1}(t,e);case 3:return J6(t.timestampValue,e.timestampValue);case 4:return J6(sp(t),sp(e));case 5:return _t(t.stringValue,e.stringValue);case 6:return function(a,i){let s=Fi(a),l=Fi(i);return s.compareTo(l)}(t.bytesValue,e.bytesValue);case 7:return function(a,i){let s=a.split("/"),l=i.split("/");for(let c=0;c<s.length&&c<l.length;c++){let u=_t(s[c],l[c]);if(u!==0)return u}return _t(s.length,l.length)}(t.referenceValue,e.referenceValue);case 8:return function(a,i){let s=_t(er(a.latitude),er(i.latitude));return s!==0?s:_t(er(a.longitude),er(i.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(a,i){let s=a.values||[],l=i.values||[];for(let c=0;c<s.length&&c<l.length;++c){let u=su(s[c],l[c]);if(u)return u}return _t(s.length,l.length)}(t.arrayValue,e.arrayValue);case 10:return function(a,i){if(a===lx.mapValue&&i===lx.mapValue)return 0;if(a===lx.mapValue)return 1;if(i===lx.mapValue)return-1;let s=a.fields||{},l=Object.keys(s),c=i.fields||{},u=Object.keys(c);l.sort(),u.sort();for(let d=0;d<l.length&&d<u.length;++d){let p=_t(l[d],u[d]);if(p!==0)return p;let m=su(s[l[d]],c[u[d]]);if(m!==0)return m}return _t(l.length,u.length)}(t.mapValue,e.mapValue);default:throw De()}}function J6(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return _t(t,e);let r=Bi(t),o=Bi(e),n=_t(r.seconds,o.seconds);return n!==0?n:_t(r.nanos,o.nanos)}function lu(t){return yE(t)}function yE(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(r){let o=Bi(r);return`time(${o.seconds},${o.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(r){return Fi(r).toBase64()}(t.bytesValue):"referenceValue"in t?function(r){return Ce.fromName(r).toString()}(t.referenceValue):"geoPointValue"in t?function(r){return`geo(${r.latitude},${r.longitude})`}(t.geoPointValue):"arrayValue"in t?function(r){let o="[",n=!0;for(let a of r.values||[])n?n=!1:o+=",",o+=yE(a);return o+"]"}(t.arrayValue):"mapValue"in t?function(r){let o=Object.keys(r.fields||{}).sort(),n="{",a=!0;for(let i of o)a?a=!1:n+=",",n+=`${i}:${yE(r.fields[i])}`;return n+"}"}(t.mapValue):De()}function e3(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function vE(t){return!!t&&"integerValue"in t}function G1(t){return!!t&&"arrayValue"in t}function t3(t){return!!t&&"nullValue"in t}function r3(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function ux(t){return!!t&&"mapValue"in t}function Jf(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){let e={mapValue:{fields:{}}};return dl(t.mapValue.fields,(r,o)=>e.mapValue.fields[r]=Jf(o)),e}if(t.arrayValue){let e={arrayValue:{values:[]}};for(let r=0;r<(t.arrayValue.values||[]).length;++r)e.arrayValue.values[r]=Jf(t.arrayValue.values[r]);return e}return Object.assign({},t)}function P3(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}var qo=class t{constructor(e){this.value=e}static empty(){return new t({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let r=this.value;for(let o=0;o<e.length-1;++o)if(r=(r.mapValue.fields||{})[e.get(o)],!ux(r))return null;return r=(r.mapValue.fields||{})[e.lastSegment()],r||null}}set(e,r){this.getFieldsMap(e.popLast())[e.lastSegment()]=Jf(r)}setAll(e){let r=tn.emptyPath(),o={},n=[];e.forEach((i,s)=>{if(!r.isImmediateParentOf(s)){let l=this.getFieldsMap(r);this.applyChanges(l,o,n),o={},n=[],r=s.popLast()}i?o[s.lastSegment()]=Jf(i):n.push(s.lastSegment())});let a=this.getFieldsMap(r);this.applyChanges(a,o,n)}delete(e){let r=this.field(e.popLast());ux(r)&&r.mapValue.fields&&delete r.mapValue.fields[e.lastSegment()]}isEqual(e){return wa(this.value,e.value)}getFieldsMap(e){let r=this.value;r.mapValue.fields||(r.mapValue={fields:{}});for(let o=0;o<e.length;++o){let n=r.mapValue.fields[e.get(o)];ux(n)&&n.mapValue.fields||(n={mapValue:{fields:{}}},r.mapValue.fields[e.get(o)]=n),r=n}return r.mapValue.fields}applyChanges(e,r,o){dl(r,(n,a)=>e[n]=a);for(let n of o)delete e[n]}clone(){return new t(Jf(this.value))}};function O3(t){let e=[];return dl(t.fields,(r,o)=>{let n=new tn([r]);if(ux(o)){let a=O3(o.mapValue).fields;if(a.length===0)e.push(n);else for(let i of a)e.push(n.child(i))}else e.push(n)}),new On(e)}var on=class t{constructor(e,r,o,n,a,i,s){this.key=e,this.documentType=r,this.version=o,this.readTime=n,this.createTime=a,this.data=i,this.documentState=s}static newInvalidDocument(e){return new t(e,0,Le.min(),Le.min(),Le.min(),qo.empty(),0)}static newFoundDocument(e,r,o,n){return new t(e,1,r,Le.min(),o,n,0)}static newNoDocument(e,r){return new t(e,2,r,Le.min(),Le.min(),qo.empty(),0)}static newUnknownDocument(e,r){return new t(e,3,r,Le.min(),Le.min(),qo.empty(),2)}convertToFoundDocument(e,r){return!this.createTime.isEqual(Le.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=r,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=qo.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=qo.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Le.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof t&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new t(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}};var cu=class{constructor(e,r){this.position=e,this.inclusive=r}};function o3(t,e,r){let o=0;for(let n=0;n<t.position.length;n++){let a=e[n],i=t.position[n];if(a.field.isKeyField()?o=Ce.comparator(Ce.fromName(i.referenceValue),r.key):o=su(i,r.data.field(a.field)),a.dir==="desc"&&(o*=-1),o!==0)break}return o}function n3(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let r=0;r<t.position.length;r++)if(!wa(t.position[r],e.position[r]))return!1;return!0}var al=class{constructor(e,r="asc"){this.field=e,this.dir=r}};function sle(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}var _x=class{},yr=class t extends _x{constructor(e,r,o){super(),this.field=e,this.op=r,this.value=o}static create(e,r,o){return e.isKeyField()?r==="in"||r==="not-in"?this.createKeyFieldInFilter(e,r,o):new wE(e,r,o):r==="array-contains"?new CE(e,o):r==="in"?new kE(e,o):r==="not-in"?new TE(e,o):r==="array-contains-any"?new PE(e,o):new t(e,r,o)}static createKeyFieldInFilter(e,r,o){return r==="in"?new EE(e,o):new SE(e,o)}matches(e){let r=e.data.field(this.field);return this.op==="!="?r!==null&&this.matchesComparison(su(r,this.value)):r!==null&&nl(this.value)===nl(r)&&this.matchesComparison(su(r,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return De()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}},Yn=class t extends _x{constructor(e,r){super(),this.filters=e,this.op=r,this.ue=null}static create(e,r){return new t(e,r)}matches(e){return A3(this)?this.filters.find(r=>!r.matches(e))===void 0:this.filters.find(r=>r.matches(e))!==void 0}getFlattenedFilters(){return this.ue!==null||(this.ue=this.filters.reduce((e,r)=>e.concat(r.getFlattenedFilters()),[])),this.ue}getFilters(){return Object.assign([],this.filters)}};function A3(t){return t.op==="and"}function D3(t){return lle(t)&&A3(t)}function lle(t){for(let e of t.filters)if(e instanceof Yn)return!1;return!0}function IE(t){if(t instanceof yr)return t.field.canonicalString()+t.op.toString()+lu(t.value);if(D3(t))return t.filters.map(e=>IE(e)).join(",");{let e=t.filters.map(r=>IE(r)).join(",");return`${t.op}(${e})`}}function R3(t,e){return t instanceof yr?function(o,n){return n instanceof yr&&o.op===n.op&&o.field.isEqual(n.field)&&wa(o.value,n.value)}(t,e):t instanceof Yn?function(o,n){return n instanceof Yn&&o.op===n.op&&o.filters.length===n.filters.length?o.filters.reduce((a,i,s)=>a&&R3(i,n.filters[s]),!0):!1}(t,e):void De()}function N3(t){return t instanceof yr?function(r){return`${r.field.canonicalString()} ${r.op} ${lu(r.value)}`}(t):t instanceof Yn?function(r){return r.op.toString()+" {"+r.getFilters().map(N3).join(" ,")+"}"}(t):"Filter"}var wE=class extends yr{constructor(e,r,o){super(e,r,o),this.key=Ce.fromName(o.referenceValue)}matches(e){let r=Ce.comparator(e.key,this.key);return this.matchesComparison(r)}},EE=class extends yr{constructor(e,r){super(e,"in",r),this.keys=M3("in",r)}matches(e){return this.keys.some(r=>r.isEqual(e.key))}},SE=class extends yr{constructor(e,r){super(e,"not-in",r),this.keys=M3("not-in",r)}matches(e){return!this.keys.some(r=>r.isEqual(e.key))}};function M3(t,e){var r;return(((r=e.arrayValue)===null||r===void 0?void 0:r.values)||[]).map(o=>Ce.fromName(o.referenceValue))}var CE=class extends yr{constructor(e,r){super(e,"array-contains",r)}matches(e){let r=e.data.field(this.field);return G1(r)&&lp(r.arrayValue,this.value)}},kE=class extends yr{constructor(e,r){super(e,"in",r)}matches(e){let r=e.data.field(this.field);return r!==null&&lp(this.value.arrayValue,r)}},TE=class extends yr{constructor(e,r){super(e,"not-in",r)}matches(e){if(lp(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let r=e.data.field(this.field);return r!==null&&!lp(this.value.arrayValue,r)}},PE=class extends yr{constructor(e,r){super(e,"array-contains-any",r)}matches(e){let r=e.data.field(this.field);return!(!G1(r)||!r.arrayValue.values)&&r.arrayValue.values.some(o=>lp(this.value.arrayValue,o))}};var OE=class{constructor(e,r=null,o=[],n=[],a=null,i=null,s=null){this.path=e,this.collectionGroup=r,this.orderBy=o,this.filters=n,this.limit=a,this.startAt=i,this.endAt=s,this.ce=null}};function a3(t,e=null,r=[],o=[],n=null,a=null,i=null){return new OE(t,e,r,o,n,a,i)}function W1(t){let e=Ve(t);if(e.ce===null){let r=e.path.canonicalString();e.collectionGroup!==null&&(r+="|cg:"+e.collectionGroup),r+="|f:",r+=e.filters.map(o=>IE(o)).join(","),r+="|ob:",r+=e.orderBy.map(o=>function(a){return a.field.canonicalString()+a.dir}(o)).join(","),Sp(e.limit)||(r+="|l:",r+=e.limit),e.startAt&&(r+="|lb:",r+=e.startAt.inclusive?"b:":"a:",r+=e.startAt.position.map(o=>lu(o)).join(",")),e.endAt&&(r+="|ub:",r+=e.endAt.inclusive?"a:":"b:",r+=e.endAt.position.map(o=>lu(o)).join(",")),e.ce=r}return e.ce}function K1(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let r=0;r<t.orderBy.length;r++)if(!sle(t.orderBy[r],e.orderBy[r]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let r=0;r<t.filters.length;r++)if(!R3(t.filters[r],e.filters[r]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!n3(t.startAt,e.startAt)&&n3(t.endAt,e.endAt)}function AE(t){return Ce.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===0}var zi=class{constructor(e,r=null,o=[],n=[],a=null,i="F",s=null,l=null){this.path=e,this.collectionGroup=r,this.explicitOrderBy=o,this.filters=n,this.limit=a,this.limitType=i,this.startAt=s,this.endAt=l,this.le=null,this.he=null,this.Pe=null,this.startAt,this.endAt}};function cle(t,e,r,o,n,a,i,s){return new zi(t,e,r,o,n,a,i,s)}function qx(t){return new zi(t)}function i3(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function L3(t){return t.collectionGroup!==null}function ep(t){let e=Ve(t);if(e.le===null){e.le=[];let r=new Set;for(let a of e.explicitOrderBy)e.le.push(a),r.add(a.field.canonicalString());let o=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(i){let s=new po(tn.comparator);return i.filters.forEach(l=>{l.getFlattenedFilters().forEach(c=>{c.isInequality()&&(s=s.add(c.field))})}),s})(e).forEach(a=>{r.has(a.canonicalString())||a.isKeyField()||e.le.push(new al(a,o))}),r.has(tn.keyField().canonicalString())||e.le.push(new al(tn.keyField(),o))}return e.le}function Ia(t){let e=Ve(t);return e.he||(e.he=ule(e,ep(t))),e.he}function ule(t,e){if(t.limitType==="F")return a3(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(n=>{let a=n.dir==="desc"?"asc":"desc";return new al(n.field,a)});let r=t.endAt?new cu(t.endAt.position,t.endAt.inclusive):null,o=t.startAt?new cu(t.startAt.position,t.startAt.inclusive):null;return a3(t.path,t.collectionGroup,e,t.filters,t.limit,r,o)}}function DE(t,e){let r=t.filters.concat([e]);return new zi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),r,t.limit,t.limitType,t.startAt,t.endAt)}function xx(t,e,r){return new zi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,r,t.startAt,t.endAt)}function Gx(t,e){return K1(Ia(t),Ia(e))&&t.limitType===e.limitType}function B3(t){return`${W1(Ia(t))}|lt:${t.limitType}`}function eu(t){return`Query(target=${function(r){let o=r.path.canonicalString();return r.collectionGroup!==null&&(o+=" collectionGroup="+r.collectionGroup),r.filters.length>0&&(o+=`, filters: [${r.filters.map(n=>N3(n)).join(", ")}]`),Sp(r.limit)||(o+=", limit: "+r.limit),r.orderBy.length>0&&(o+=`, orderBy: [${r.orderBy.map(n=>function(i){return`${i.field.canonicalString()} (${i.dir})`}(n)).join(", ")}]`),r.startAt&&(o+=", startAt: ",o+=r.startAt.inclusive?"b:":"a:",o+=r.startAt.position.map(n=>lu(n)).join(",")),r.endAt&&(o+=", endAt: ",o+=r.endAt.inclusive?"a:":"b:",o+=r.endAt.position.map(n=>lu(n)).join(",")),`Target(${o})`}(Ia(t))}; limitType=${t.limitType})`}function Wx(t,e){return e.isFoundDocument()&&function(o,n){let a=n.key.path;return o.collectionGroup!==null?n.key.hasCollectionId(o.collectionGroup)&&o.path.isPrefixOf(a):Ce.isDocumentKey(o.path)?o.path.isEqual(a):o.path.isImmediateParentOf(a)}(t,e)&&function(o,n){for(let a of ep(o))if(!a.field.isKeyField()&&n.data.field(a.field)===null)return!1;return!0}(t,e)&&function(o,n){for(let a of o.filters)if(!a.matches(n))return!1;return!0}(t,e)&&function(o,n){return!(o.startAt&&!function(i,s,l){let c=o3(i,s,l);return i.inclusive?c<=0:c<0}(o.startAt,ep(o),n)||o.endAt&&!function(i,s,l){let c=o3(i,s,l);return i.inclusive?c>=0:c>0}(o.endAt,ep(o),n))}(t,e)}function dle(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function F3(t){return(e,r)=>{let o=!1;for(let n of ep(t)){let a=fle(n,e,r);if(a!==0)return a;o=o||n.field.isKeyField()}return 0}}function fle(t,e,r){let o=t.field.isKeyField()?Ce.comparator(e.key,r.key):function(a,i,s){let l=i.data.field(a),c=s.data.field(a);return l!==null&&c!==null?su(l,c):De()}(t.field,e,r);switch(t.dir){case"asc":return o;case"desc":return-1*o;default:return De()}}var Ui=class{constructor(e,r){this.mapKeyFn=e,this.equalsFn=r,this.inner={},this.innerSize=0}get(e){let r=this.mapKeyFn(e),o=this.inner[r];if(o!==void 0){for(let[n,a]of o)if(this.equalsFn(n,e))return a}}has(e){return this.get(e)!==void 0}set(e,r){let o=this.mapKeyFn(e),n=this.inner[o];if(n===void 0)return this.inner[o]=[[e,r]],void this.innerSize++;for(let a=0;a<n.length;a++)if(this.equalsFn(n[a][0],e))return void(n[a]=[e,r]);n.push([e,r]),this.innerSize++}delete(e){let r=this.mapKeyFn(e),o=this.inner[r];if(o===void 0)return!1;for(let n=0;n<o.length;n++)if(this.equalsFn(o[n][0],e))return o.length===1?delete this.inner[r]:o.splice(n,1),this.innerSize--,!0;return!1}forEach(e){dl(this.inner,(r,o)=>{for(let[n,a]of o)e(n,a)})}isEmpty(){return T3(this.inner)}size(){return this.innerSize}};var ple=new tr(Ce.comparator);function Za(){return ple}var z3=new tr(Ce.comparator);function Zf(...t){let e=z3;for(let r of t)e=e.insert(r.key,r);return e}function U3(t){let e=z3;return t.forEach((r,o)=>e=e.insert(r,o.overlayedDocument)),e}function el(){return tp()}function V3(){return tp()}function tp(){return new Ui(t=>t.toString(),(t,e)=>t.isEqual(e))}var mle=new tr(Ce.comparator),hle=new po(Ce.comparator);function tt(...t){let e=hle;for(let r of t)e=e.add(r);return e}var gle=new po(_t);function _le(){return gle}function H3(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:ip(e)?"-0":e}}function $3(t){return{integerValue:""+t}}function xle(t,e){return rle(e)?$3(e):H3(t,e)}var uu=class{constructor(){this._=void 0}};function ble(t,e,r){return t instanceof il?function(n,a){let i={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:n.seconds,nanos:n.nanoseconds}}}};return a&&j1(a)&&(a=q1(a)),a&&(i.fields.__previous_value__=a),{mapValue:i}}(r,e):t instanceof Vi?q3(t,e):t instanceof sl?G3(t,e):function(n,a){let i=j3(n,a),s=s3(i)+s3(n.Ie);return vE(i)&&vE(n.Ie)?$3(s):H3(n.serializer,s)}(t,e)}function yle(t,e,r){return t instanceof Vi?q3(t,e):t instanceof sl?G3(t,e):r}function j3(t,e){return t instanceof du?function(o){return vE(o)||function(a){return!!a&&"doubleValue"in a}(o)}(e)?e:{integerValue:0}:null}var il=class extends uu{},Vi=class extends uu{constructor(e){super(),this.elements=e}};function q3(t,e){let r=W3(e);for(let o of t.elements)r.some(n=>wa(n,o))||r.push(o);return{arrayValue:{values:r}}}var sl=class extends uu{constructor(e){super(),this.elements=e}};function G3(t,e){let r=W3(e);for(let o of t.elements)r=r.filter(n=>!wa(n,o));return{arrayValue:{values:r}}}var du=class extends uu{constructor(e,r){super(),this.serializer=e,this.Ie=r}};function s3(t){return er(t.integerValue||t.doubleValue)}function W3(t){return G1(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var bx=class{constructor(e,r){this.field=e,this.transform=r}};function vle(t,e){return t.field.isEqual(e.field)&&function(o,n){return o instanceof Vi&&n instanceof Vi||o instanceof sl&&n instanceof sl?iu(o.elements,n.elements,wa):o instanceof du&&n instanceof du?wa(o.Ie,n.Ie):o instanceof il&&n instanceof il}(t.transform,e.transform)}var RE=class{constructor(e,r){this.version=e,this.transformResults=r}},Jr=class t{constructor(e,r){this.updateTime=e,this.exists=r}static none(){return new t}static exists(e){return new t(void 0,e)}static updateTime(e){return new t(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}};function dx(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}var fu=class{};function K3(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new cl(t.key,Jr.none()):new ll(t.key,t.data,Jr.none());{let r=t.data,o=qo.empty(),n=new po(tn.comparator);for(let a of e.fields)if(!n.has(a)){let i=r.field(a);i===null&&a.length>1&&(a=a.popLast(),i=r.field(a)),i===null?o.delete(a):o.set(a,i),n=n.add(a)}return new Ea(t.key,o,new On(n.toArray()),Jr.none())}}function Ile(t,e,r){t instanceof ll?function(n,a,i){let s=n.value.clone(),l=c3(n.fieldTransforms,a,i.transformResults);s.setAll(l),a.convertToFoundDocument(i.version,s).setHasCommittedMutations()}(t,e,r):t instanceof Ea?function(n,a,i){if(!dx(n.precondition,a))return void a.convertToUnknownDocument(i.version);let s=c3(n.fieldTransforms,a,i.transformResults),l=a.data;l.setAll(X3(n)),l.setAll(s),a.convertToFoundDocument(i.version,l).setHasCommittedMutations()}(t,e,r):function(n,a,i){a.convertToNoDocument(i.version).setHasCommittedMutations()}(0,e,r)}function rp(t,e,r,o){return t instanceof ll?function(a,i,s,l){if(!dx(a.precondition,i))return s;let c=a.value.clone(),u=u3(a.fieldTransforms,l,i);return c.setAll(u),i.convertToFoundDocument(i.version,c).setHasLocalMutations(),null}(t,e,r,o):t instanceof Ea?function(a,i,s,l){if(!dx(a.precondition,i))return s;let c=u3(a.fieldTransforms,l,i),u=i.data;return u.setAll(X3(a)),u.setAll(c),i.convertToFoundDocument(i.version,u).setHasLocalMutations(),s===null?null:s.unionWith(a.fieldMask.fields).unionWith(a.fieldTransforms.map(d=>d.field))}(t,e,r,o):function(a,i,s){return dx(a.precondition,i)?(i.convertToNoDocument(i.version).setHasLocalMutations(),null):s}(t,e,r)}function wle(t,e){let r=null;for(let o of t.fieldTransforms){let n=e.data.field(o.field),a=j3(o.transform,n||null);a!=null&&(r===null&&(r=qo.empty()),r.set(o.field,a))}return r||null}function l3(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(o,n){return o===void 0&&n===void 0||!(!o||!n)&&iu(o,n,(a,i)=>vle(a,i))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}var ll=class extends fu{constructor(e,r,o,n=[]){super(),this.key=e,this.value=r,this.precondition=o,this.fieldTransforms=n,this.type=0}getFieldMask(){return null}},Ea=class extends fu{constructor(e,r,o,n,a=[]){super(),this.key=e,this.data=r,this.fieldMask=o,this.precondition=n,this.fieldTransforms=a,this.type=1}getFieldMask(){return this.fieldMask}};function X3(t){let e=new Map;return t.fieldMask.fields.forEach(r=>{if(!r.isEmpty()){let o=t.data.field(r);e.set(r,o)}}),e}function c3(t,e,r){let o=new Map;Ct(t.length===r.length);for(let n=0;n<r.length;n++){let a=t[n],i=a.transform,s=e.data.field(a.field);o.set(a.field,yle(i,s,r[n]))}return o}function u3(t,e,r){let o=new Map;for(let n of t){let a=n.transform,i=r.data.field(n.field);o.set(n.field,ble(a,i,e))}return o}var cl=class extends fu{constructor(e,r){super(),this.key=e,this.precondition=r,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}},yx=class extends fu{constructor(e,r){super(),this.key=e,this.precondition=r,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}};var NE=class{constructor(e,r,o,n){this.batchId=e,this.localWriteTime=r,this.baseMutations=o,this.mutations=n}applyToRemoteDocument(e,r){let o=r.mutationResults;for(let n=0;n<this.mutations.length;n++){let a=this.mutations[n];a.key.isEqual(e.key)&&Ile(a,e,o[n])}}applyToLocalView(e,r){for(let o of this.baseMutations)o.key.isEqual(e.key)&&(r=rp(o,e,r,this.localWriteTime));for(let o of this.mutations)o.key.isEqual(e.key)&&(r=rp(o,e,r,this.localWriteTime));return r}applyToLocalDocumentSet(e,r){let o=V3();return this.mutations.forEach(n=>{let a=e.get(n.key),i=a.overlayedDocument,s=this.applyToLocalView(i,a.mutatedFields);s=r.has(n.key)?null:s;let l=K3(i,s);l!==null&&o.set(n.key,l),i.isValidDocument()||i.convertToNoDocument(Le.min())}),o}keys(){return this.mutations.reduce((e,r)=>e.add(r.key),tt())}isEqual(e){return this.batchId===e.batchId&&iu(this.mutations,e.mutations,(r,o)=>l3(r,o))&&iu(this.baseMutations,e.baseMutations,(r,o)=>l3(r,o))}},ME=class t{constructor(e,r,o,n){this.batch=e,this.commitVersion=r,this.mutationResults=o,this.docVersions=n}static from(e,r,o){Ct(e.mutations.length===o.length);let n=function(){return mle}(),a=e.mutations;for(let i=0;i<a.length;i++)n=n.insert(a[i].key,o[i].version);return new t(e,r,o,n)}};var LE=class{constructor(e,r){this.largestBatchId=e,this.mutation=r}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
|
|
19
19
|
largestBatchId: ${this.largestBatchId},
|
|
20
20
|
mutation: ${this.mutation.toString()}
|
|
21
|
-
}`}};var BE=class{constructor(e,r){this.count=e,this.unchangedNames=r}};var xr,it;function Y3(t){switch(t){default:return De();case j.CANCELLED:case j.UNKNOWN:case j.DEADLINE_EXCEEDED:case j.RESOURCE_EXHAUSTED:case j.INTERNAL:case j.UNAVAILABLE:case j.UNAUTHENTICATED:return!1;case j.INVALID_ARGUMENT:case j.NOT_FOUND:case j.ALREADY_EXISTS:case j.PERMISSION_DENIED:case j.FAILED_PRECONDITION:case j.ABORTED:case j.OUT_OF_RANGE:case j.UNIMPLEMENTED:case j.DATA_LOSS:return!0}}function Q3(t){if(t===void 0)return Qa("GRPC error has no .code"),j.UNKNOWN;switch(t){case xr.OK:return j.OK;case xr.CANCELLED:return j.CANCELLED;case xr.UNKNOWN:return j.UNKNOWN;case xr.DEADLINE_EXCEEDED:return j.DEADLINE_EXCEEDED;case xr.RESOURCE_EXHAUSTED:return j.RESOURCE_EXHAUSTED;case xr.INTERNAL:return j.INTERNAL;case xr.UNAVAILABLE:return j.UNAVAILABLE;case xr.UNAUTHENTICATED:return j.UNAUTHENTICATED;case xr.INVALID_ARGUMENT:return j.INVALID_ARGUMENT;case xr.NOT_FOUND:return j.NOT_FOUND;case xr.ALREADY_EXISTS:return j.ALREADY_EXISTS;case xr.PERMISSION_DENIED:return j.PERMISSION_DENIED;case xr.FAILED_PRECONDITION:return j.FAILED_PRECONDITION;case xr.ABORTED:return j.ABORTED;case xr.OUT_OF_RANGE:return j.OUT_OF_RANGE;case xr.UNIMPLEMENTED:return j.UNIMPLEMENTED;case xr.DATA_LOSS:return j.DATA_LOSS;default:return De()}}(it=xr||(xr={}))[it.OK=0]="OK",it[it.CANCELLED=1]="CANCELLED",it[it.UNKNOWN=2]="UNKNOWN",it[it.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",it[it.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",it[it.NOT_FOUND=5]="NOT_FOUND",it[it.ALREADY_EXISTS=6]="ALREADY_EXISTS",it[it.PERMISSION_DENIED=7]="PERMISSION_DENIED",it[it.UNAUTHENTICATED=16]="UNAUTHENTICATED",it[it.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",it[it.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",it[it.ABORTED=10]="ABORTED",it[it.OUT_OF_RANGE=11]="OUT_OF_RANGE",it[it.UNIMPLEMENTED=12]="UNIMPLEMENTED",it[it.INTERNAL=13]="INTERNAL",it[it.UNAVAILABLE=14]="UNAVAILABLE",it[it.DATA_LOSS=15]="DATA_LOSS";var d3=null;function Ele(){return new TextEncoder}var Sle=new Js([4294967295,4294967295],0);function f3(t){let e=Ele().encode(t),r=new Y6;return r.update(e),new Uint8Array(r.digest())}function p3(t){let e=new DataView(t.buffer),r=e.getUint32(0,!0),o=e.getUint32(4,!0),n=e.getUint32(8,!0),a=e.getUint32(12,!0);return[new Js([r,o],0),new Js([n,a],0)]}var FE=class t{constructor(e,r,o){if(this.bitmap=e,this.padding=r,this.hashCount=o,r<0||r>=8)throw new tl(`Invalid padding: ${r}`);if(o<0)throw new tl(`Invalid hash count: ${o}`);if(e.length>0&&this.hashCount===0)throw new tl(`Invalid hash count: ${o}`);if(e.length===0&&r!==0)throw new tl(`Invalid padding when bitmap length is 0: ${r}`);this.Te=8*e.length-r,this.Ee=Js.fromNumber(this.Te)}de(e,r,o){let n=e.add(r.multiply(Js.fromNumber(o)));return n.compare(Sle)===1&&(n=new Js([n.getBits(0),n.getBits(1)],0)),n.modulo(this.Ee).toNumber()}Ae(e){return(this.bitmap[Math.floor(e/8)]&1<<e%8)!=0}mightContain(e){if(this.Te===0)return!1;let r=f3(e),[o,n]=p3(r);for(let a=0;a<this.hashCount;a++){let i=this.de(o,n,a);if(!this.Ae(i))return!1}return!0}static create(e,r,o){let n=e%8==0?0:8-e%8,a=new Uint8Array(Math.ceil(e/8)),i=new t(a,n,r);return o.forEach(s=>i.insert(s)),i}insert(e){if(this.Te===0)return;let r=f3(e),[o,n]=p3(r);for(let a=0;a<this.hashCount;a++){let i=this.de(o,n,a);this.Re(i)}}Re(e){let r=Math.floor(e/8),o=e%8;this.bitmap[r]|=1<<o}},tl=class extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}};var vx=class t{constructor(e,r,o,n,a){this.snapshotVersion=e,this.targetChanges=r,this.targetMismatches=o,this.documentUpdates=n,this.resolvedLimboDocuments=a}static createSynthesizedRemoteEventForCurrentChange(e,r,o){let n=new Map;return n.set(e,cp.createSynthesizedTargetChangeForCurrentChange(e,r,o)),new t(Le.min(),n,new tr(_t),Za(),tt())}},cp=class t{constructor(e,r,o,n,a){this.resumeToken=e,this.current=r,this.addedDocuments=o,this.modifiedDocuments=n,this.removedDocuments=a}static createSynthesizedTargetChangeForCurrentChange(e,r,o){return new t(o,r,tt(),tt(),tt())}};var nu=class{constructor(e,r,o,n){this.Ve=e,this.removedTargetIds=r,this.key=o,this.me=n}},Ix=class{constructor(e,r){this.targetId=e,this.fe=r}},wx=class{constructor(e,r,o=Ro.EMPTY_BYTE_STRING,n=null){this.state=e,this.targetIds=r,this.resumeToken=o,this.cause=n}},Ex=class{constructor(){this.ge=0,this.pe=h3(),this.ye=Ro.EMPTY_BYTE_STRING,this.we=!1,this.Se=!0}get current(){return this.we}get resumeToken(){return this.ye}get be(){return this.ge!==0}get De(){return this.Se}Ce(e){e.approximateByteSize()>0&&(this.Se=!0,this.ye=e)}ve(){let e=tt(),r=tt(),o=tt();return this.pe.forEach((n,a)=>{switch(a){case 0:e=e.add(n);break;case 2:r=r.add(n);break;case 1:o=o.add(n);break;default:De()}}),new cp(this.ye,this.we,e,r,o)}Fe(){this.Se=!1,this.pe=h3()}Me(e,r){this.Se=!0,this.pe=this.pe.insert(e,r)}xe(e){this.Se=!0,this.pe=this.pe.remove(e)}Oe(){this.ge+=1}Ne(){this.ge-=1}Be(){this.Se=!0,this.we=!0}},zE=class{constructor(e){this.Le=e,this.ke=new Map,this.qe=Za(),this.Qe=m3(),this.Ke=new tr(_t)}$e(e){for(let r of e.Ve)e.me&&e.me.isFoundDocument()?this.Ue(r,e.me):this.We(r,e.key,e.me);for(let r of e.removedTargetIds)this.We(r,e.key,e.me)}Ge(e){this.forEachTarget(e,r=>{let o=this.ze(r);switch(e.state){case 0:this.je(r)&&o.Ce(e.resumeToken);break;case 1:o.Ne(),o.be||o.Fe(),o.Ce(e.resumeToken);break;case 2:o.Ne(),o.be||this.removeTarget(r);break;case 3:this.je(r)&&(o.Be(),o.Ce(e.resumeToken));break;case 4:this.je(r)&&(this.He(r),o.Ce(e.resumeToken));break;default:De()}})}forEachTarget(e,r){e.targetIds.length>0?e.targetIds.forEach(r):this.ke.forEach((o,n)=>{this.je(n)&&r(n)})}Je(e){let r=e.targetId,o=e.fe.count,n=this.Ye(r);if(n){let a=n.target;if(AE(a))if(o===0){let i=new Ce(a.path);this.We(r,i,on.newNoDocument(i,Le.min()))}else Ct(o===1);else{let i=this.Ze(r);if(i!==o){let s=this.Xe(e),l=s?this.et(s,e,i):1;if(l!==0){this.He(r);let c=l===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ke=this.Ke.insert(r,c)}d3?.tt(function(u,d,p,m,h){var g,_,x,b,y,I;let w={localCacheCount:u,existenceFilterCount:d.count,databaseId:p.database,projectId:p.projectId},v=d.unchangedNames;return v&&(w.bloomFilter={applied:h===0,hashCount:(g=v?.hashCount)!==null&&g!==void 0?g:0,bitmapLength:(b=(x=(_=v?.bits)===null||_===void 0?void 0:_.bitmap)===null||x===void 0?void 0:x.length)!==null&&b!==void 0?b:0,padding:(I=(y=v?.bits)===null||y===void 0?void 0:y.padding)!==null&&I!==void 0?I:0,mightContain:T=>{var O;return(O=m?.mightContain(T))!==null&&O!==void 0&&O}}),w}(i,e.fe,this.Le.nt(),s,l))}}}}Xe(e){let r=e.fe.unchangedNames;if(!r||!r.bits)return null;let{bits:{bitmap:o="",padding:n=0},hashCount:a=0}=r,i,s;try{i=Fi(o).toUint8Array()}catch(l){if(l instanceof hx)return np("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{s=new FE(i,n,a)}catch(l){return np(l instanceof tl?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return s.Te===0?null:s}et(e,r,o){return r.fe.count===o-this.rt(e,r.targetId)?0:2}rt(e,r){let o=this.Le.getRemoteKeysForTarget(r),n=0;return o.forEach(a=>{let i=this.Le.nt(),s=`projects/${i.projectId}/databases/${i.database}/documents/${a.path.canonicalString()}`;e.mightContain(s)||(this.We(r,a,null),n++)}),n}it(e){let r=new Map;this.ke.forEach((a,i)=>{let s=this.Ye(i);if(s){if(a.current&&AE(s.target)){let l=new Ce(s.target.path);this.qe.get(l)!==null||this.st(i,l)||this.We(i,l,on.newNoDocument(l,e))}a.De&&(r.set(i,a.ve()),a.Fe())}});let o=tt();this.Qe.forEach((a,i)=>{let s=!0;i.forEachWhile(l=>{let c=this.Ye(l);return!c||c.purpose==="TargetPurposeLimboResolution"||(s=!1,!1)}),s&&(o=o.add(a))}),this.qe.forEach((a,i)=>i.setReadTime(e));let n=new vx(e,r,this.Ke,this.qe,o);return this.qe=Za(),this.Qe=m3(),this.Ke=new tr(_t),n}Ue(e,r){if(!this.je(e))return;let o=this.st(e,r.key)?2:0;this.ze(e).Me(r.key,o),this.qe=this.qe.insert(r.key,r),this.Qe=this.Qe.insert(r.key,this.ot(r.key).add(e))}We(e,r,o){if(!this.je(e))return;let n=this.ze(e);this.st(e,r)?n.Me(r,1):n.xe(r),this.Qe=this.Qe.insert(r,this.ot(r).delete(e)),o&&(this.qe=this.qe.insert(r,o))}removeTarget(e){this.ke.delete(e)}Ze(e){let r=this.ze(e).ve();return this.Le.getRemoteKeysForTarget(e).size+r.addedDocuments.size-r.removedDocuments.size}Oe(e){this.ze(e).Oe()}ze(e){let r=this.ke.get(e);return r||(r=new Ex,this.ke.set(e,r)),r}ot(e){let r=this.Qe.get(e);return r||(r=new po(_t),this.Qe=this.Qe.insert(e,r)),r}je(e){let r=this.Ye(e)!==null;return r||ge("WatchChangeAggregator","Detected inactive target",e),r}Ye(e){let r=this.ke.get(e);return r&&r.be?null:this.Le._t(e)}He(e){this.ke.set(e,new Ex),this.Le.getRemoteKeysForTarget(e).forEach(r=>{this.We(e,r,null)})}st(e,r){return this.Le.getRemoteKeysForTarget(e).has(r)}};function m3(){return new tr(Ce.comparator)}function h3(){return new tr(Ce.comparator)}var Cle={asc:"ASCENDING",desc:"DESCENDING"},kle={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},Tle={and:"AND",or:"OR"},UE=class{constructor(e,r){this.databaseId=e,this.useProto3Json=r}};function VE(t,e){return t.useProto3Json||Sp(e)?e:{value:e}}function Sx(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Z3(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function Ple(t,e){return Sx(t,e.toTimestamp())}function rn(t){return Ct(!!t),Le.fromTimestamp(function(r){let o=Bi(r);return new Ze(o.seconds,o.nanos)}(t))}function X1(t,e){return function(o){return new qt(["projects",o.projectId,"databases",o.database])}(t).child("documents").child(e).canonicalString()}function J3(t){let e=qt.fromString(t);return Ct(n9(e)),e}function Cx(t,e){return X1(t.databaseId,e.path)}function op(t,e){let r=J3(e);if(r.get(1)!==t.databaseId.projectId)throw new re(j.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+r.get(1)+" vs "+t.databaseId.projectId);if(r.get(3)!==t.databaseId.database)throw new re(j.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+r.get(3)+" vs "+t.databaseId.database);return new Ce(e9(r))}function HE(t,e){return X1(t.databaseId,e)}function Ole(t){let e=J3(t);return e.length===4?qt.emptyPath():e9(e)}function up(t){return new qt(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function e9(t){return Ct(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function g3(t,e,r){return{name:Cx(t,e),fields:r.value.mapValue.fields}}function Ale(t,e){return"found"in e?function(o,n){Ct(!!n.found),n.found.name,n.found.updateTime;let a=op(o,n.found.name),i=rn(n.found.updateTime),s=n.found.createTime?rn(n.found.createTime):Le.min(),l=new qo({mapValue:{fields:n.found.fields}});return on.newFoundDocument(a,i,s,l)}(t,e):"missing"in e?function(o,n){Ct(!!n.missing),Ct(!!n.readTime);let a=op(o,n.missing),i=rn(n.readTime);return on.newNoDocument(a,i)}(t,e):De()}function Dle(t,e){let r;if("targetChange"in e){e.targetChange;let o=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:De()}(e.targetChange.targetChangeType||"NO_CHANGE"),n=e.targetChange.targetIds||[],a=function(c,u){return c.useProto3Json?(Ct(u===void 0||typeof u=="string"),Ro.fromBase64String(u||"")):(Ct(u===void 0||u instanceof Uint8Array),Ro.fromUint8Array(u||new Uint8Array))}(t,e.targetChange.resumeToken),i=e.targetChange.cause,s=i&&function(c){let u=c.code===void 0?j.UNKNOWN:Q3(c.code);return new re(u,c.message||"")}(i);r=new wx(o,n,a,s||null)}else if("documentChange"in e){e.documentChange;let o=e.documentChange;o.document,o.document.name,o.document.updateTime;let n=op(t,o.document.name),a=rn(o.document.updateTime),i=o.document.createTime?rn(o.document.createTime):Le.min(),s=new qo({mapValue:{fields:o.document.fields}}),l=on.newFoundDocument(n,a,i,s),c=o.targetIds||[],u=o.removedTargetIds||[];r=new nu(c,u,l.key,l)}else if("documentDelete"in e){e.documentDelete;let o=e.documentDelete;o.document;let n=op(t,o.document),a=o.readTime?rn(o.readTime):Le.min(),i=on.newNoDocument(n,a),s=o.removedTargetIds||[];r=new nu([],s,i.key,i)}else if("documentRemove"in e){e.documentRemove;let o=e.documentRemove;o.document;let n=op(t,o.document),a=o.removedTargetIds||[];r=new nu([],a,n,null)}else{if(!("filter"in e))return De();{e.filter;let o=e.filter;o.targetId;let{count:n=0,unchangedNames:a}=o,i=new BE(n,a),s=o.targetId;r=new Ix(s,i)}}return r}function t9(t,e){let r;if(e instanceof ll)r={update:g3(t,e.key,e.value)};else if(e instanceof cl)r={delete:Cx(t,e.key)};else if(e instanceof Ea)r={update:g3(t,e.key,e.data),updateMask:Vle(e.fieldMask)};else{if(!(e instanceof yx))return De();r={verify:Cx(t,e.key)}}return e.fieldTransforms.length>0&&(r.updateTransforms=e.fieldTransforms.map(o=>function(a,i){let s=i.transform;if(s instanceof il)return{fieldPath:i.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(s instanceof Vi)return{fieldPath:i.field.canonicalString(),appendMissingElements:{values:s.elements}};if(s instanceof sl)return{fieldPath:i.field.canonicalString(),removeAllFromArray:{values:s.elements}};if(s instanceof du)return{fieldPath:i.field.canonicalString(),increment:s.Ie};throw De()}(0,o))),e.precondition.isNone||(r.currentDocument=function(n,a){return a.updateTime!==void 0?{updateTime:Ple(n,a.updateTime)}:a.exists!==void 0?{exists:a.exists}:De()}(t,e.precondition)),r}function Rle(t,e){return t&&t.length>0?(Ct(e!==void 0),t.map(r=>function(n,a){let i=n.updateTime?rn(n.updateTime):rn(a);return i.isEqual(Le.min())&&(i=rn(a)),new RE(i,n.transformResults||[])}(r,e))):[]}function Nle(t,e){return{documents:[HE(t,e.path)]}}function Mle(t,e){let r={structuredQuery:{}},o=e.path;e.collectionGroup!==null?(r.parent=HE(t,o),r.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(r.parent=HE(t,o.popLast()),r.structuredQuery.from=[{collectionId:o.lastSegment()}]);let n=function(l){if(l.length!==0)return o9(Yn.create(l,"and"))}(e.filters);n&&(r.structuredQuery.where=n);let a=function(l){if(l.length!==0)return l.map(c=>function(d){return{field:tu(d.field),direction:Fle(d.dir)}}(c))}(e.orderBy);a&&(r.structuredQuery.orderBy=a);let i=VE(t,e.limit);return i!==null&&(r.structuredQuery.limit=i),e.startAt&&(r.structuredQuery.startAt=function(l){return{before:l.inclusive,values:l.position}}(e.startAt)),e.endAt&&(r.structuredQuery.endAt=function(l){return{before:!l.inclusive,values:l.position}}(e.endAt)),r}function Lle(t){let e=Ole(t.parent),r=t.structuredQuery,o=r.from?r.from.length:0,n=null;if(o>0){Ct(o===1);let u=r.from[0];u.allDescendants?n=u.collectionId:e=e.child(u.collectionId)}let a=[];r.where&&(a=function(d){let p=r9(d);return p instanceof Yn&&D3(p)?p.getFilters():[p]}(r.where));let i=[];r.orderBy&&(i=function(d){return d.map(p=>function(h){return new al(ru(h.field),function(_){switch(_){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(h.direction))}(p))}(r.orderBy));let s=null;r.limit&&(s=function(d){let p;return p=typeof d=="object"?d.value:d,Sp(p)?null:p}(r.limit));let l=null;r.startAt&&(l=function(d){let p=!!d.before,m=d.values||[];return new cu(m,p)}(r.startAt));let c=null;return r.endAt&&(c=function(d){let p=!d.before,m=d.values||[];return new cu(m,p)}(r.endAt)),cle(e,n,i,a,s,"F",l,c)}function Ble(t,e){let r=function(n){switch(n){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return De()}}(e.purpose);return r==null?null:{"goog-listen-tags":r}}function r9(t){return t.unaryFilter!==void 0?function(r){switch(r.unaryFilter.op){case"IS_NAN":let o=ru(r.unaryFilter.field);return yr.create(o,"==",{doubleValue:NaN});case"IS_NULL":let n=ru(r.unaryFilter.field);return yr.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let a=ru(r.unaryFilter.field);return yr.create(a,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let i=ru(r.unaryFilter.field);return yr.create(i,"!=",{nullValue:"NULL_VALUE"});default:return De()}}(t):t.fieldFilter!==void 0?function(r){return yr.create(ru(r.fieldFilter.field),function(n){switch(n){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return De()}}(r.fieldFilter.op),r.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(r){return Yn.create(r.compositeFilter.filters.map(o=>r9(o)),function(n){switch(n){case"AND":return"and";case"OR":return"or";default:return De()}}(r.compositeFilter.op))}(t):De()}function Fle(t){return Cle[t]}function zle(t){return kle[t]}function Ule(t){return Tle[t]}function tu(t){return{fieldPath:t.canonicalString()}}function ru(t){return tn.fromServerFormat(t.fieldPath)}function o9(t){return t instanceof yr?function(r){if(r.op==="=="){if(r3(r.value))return{unaryFilter:{field:tu(r.field),op:"IS_NAN"}};if(t3(r.value))return{unaryFilter:{field:tu(r.field),op:"IS_NULL"}}}else if(r.op==="!="){if(r3(r.value))return{unaryFilter:{field:tu(r.field),op:"IS_NOT_NAN"}};if(t3(r.value))return{unaryFilter:{field:tu(r.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:tu(r.field),op:zle(r.op),value:r.value}}}(t):t instanceof Yn?function(r){let o=r.getFilters().map(n=>o9(n));return o.length===1?o[0]:{compositeFilter:{op:Ule(r.op),filters:o}}}(t):De()}function Vle(t){let e=[];return t.fields.forEach(r=>e.push(r.canonicalString())),{fieldPaths:e}}function n9(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}var dp=class t{constructor(e,r,o,n,a=Le.min(),i=Le.min(),s=Ro.EMPTY_BYTE_STRING,l=null){this.target=e,this.targetId=r,this.purpose=o,this.sequenceNumber=n,this.snapshotVersion=a,this.lastLimboFreeSnapshotVersion=i,this.resumeToken=s,this.expectedCount=l}withSequenceNumber(e){return new t(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,r){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,r,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}};var $E=class{constructor(e){this.ut=e}};function Hle(t){let e=Lle({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?xx(e,e.limit,"L"):e}var kx=class{constructor(){}ht(e,r){this.Pt(e,r),r.It()}Pt(e,r){if("nullValue"in e)this.Tt(r,5);else if("booleanValue"in e)this.Tt(r,10),r.Et(e.booleanValue?1:0);else if("integerValue"in e)this.Tt(r,15),r.Et(er(e.integerValue));else if("doubleValue"in e){let o=er(e.doubleValue);isNaN(o)?this.Tt(r,13):(this.Tt(r,15),ip(o)?r.Et(0):r.Et(o))}else if("timestampValue"in e){let o=e.timestampValue;this.Tt(r,20),typeof o=="string"?r.dt(o):(r.dt(`${o.seconds||""}`),r.Et(o.nanos||0))}else if("stringValue"in e)this.At(e.stringValue,r),this.Rt(r);else if("bytesValue"in e)this.Tt(r,30),r.Vt(Fi(e.bytesValue)),this.Rt(r);else if("referenceValue"in e)this.ft(e.referenceValue,r);else if("geoPointValue"in e){let o=e.geoPointValue;this.Tt(r,45),r.Et(o.latitude||0),r.Et(o.longitude||0)}else"mapValue"in e?P3(e)?this.Tt(r,Number.MAX_SAFE_INTEGER):(this.gt(e.mapValue,r),this.Rt(r)):"arrayValue"in e?(this.yt(e.arrayValue,r),this.Rt(r)):De()}At(e,r){this.Tt(r,25),this.wt(e,r)}wt(e,r){r.dt(e)}gt(e,r){let o=e.fields||{};this.Tt(r,55);for(let n of Object.keys(o))this.At(n,r),this.Pt(o[n],r)}yt(e,r){let o=e.values||[];this.Tt(r,50);for(let n of o)this.Pt(n,r)}ft(e,r){this.Tt(r,37),Ce.fromName(e).path.forEach(o=>{this.Tt(r,60),this.wt(o,r)})}Tt(e,r){e.Et(r)}Rt(e){e.Et(2)}};kx.St=new kx;var jE=class{constructor(){this.on=new qE}addToCollectionParentIndex(e,r){return this.on.add(r),ee.resolve()}getCollectionParents(e,r){return ee.resolve(this.on.getEntries(r))}addFieldIndex(e,r){return ee.resolve()}deleteFieldIndex(e,r){return ee.resolve()}deleteAllFieldIndexes(e){return ee.resolve()}createTargetIndexes(e,r){return ee.resolve()}getDocumentsMatchingTarget(e,r){return ee.resolve(null)}getIndexType(e,r){return ee.resolve(0)}getFieldIndexes(e,r){return ee.resolve([])}getNextCollectionGroupToUpdate(e){return ee.resolve(null)}getMinOffset(e,r){return ee.resolve(ol.min())}getMinOffsetFromCollectionGroup(e,r){return ee.resolve(ol.min())}updateCollectionGroup(e,r,o){return ee.resolve()}updateIndexEntries(e,r){return ee.resolve()}},qE=class{constructor(){this.index={}}add(e){let r=e.lastSegment(),o=e.popLast(),n=this.index[r]||new po(qt.comparator),a=!n.has(o);return this.index[r]=n.add(o),a}has(e){let r=e.lastSegment(),o=e.popLast(),n=this.index[r];return n&&n.has(o)}getEntries(e){return(this.index[e]||new po(qt.comparator)).toArray()}};var PVe=new Uint8Array(0);var ya=class t{constructor(e,r,o){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=r,this.maximumSequenceNumbersToCollect=o}static withCacheSize(e){return new t(e,t.DEFAULT_COLLECTION_PERCENTILE,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}};ya.DEFAULT_COLLECTION_PERCENTILE=10,ya.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,ya.DEFAULT=new ya(41943040,ya.DEFAULT_COLLECTION_PERCENTILE,ya.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),ya.DISABLED=new ya(-1,0,0);var fp=class t{constructor(e){this.xn=e}next(){return this.xn+=2,this.xn}static On(){return new t(0)}static Nn(){return new t(-1)}};var GE=class{constructor(){this.changes=new Ui(e=>e.toString(),(e,r)=>e.isEqual(r)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,r){this.assertNotApplied(),this.changes.set(e,on.newInvalidDocument(e).setReadTime(r))}getEntry(e,r){this.assertNotApplied();let o=this.changes.get(r);return o!==void 0?ee.resolve(o):this.getFromCache(e,r)}getEntries(e,r){return this.getAllFromCache(e,r)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}};var WE=class{constructor(e,r){this.overlayedDocument=e,this.mutatedFields=r}};var KE=class{constructor(e,r,o,n){this.remoteDocumentCache=e,this.mutationQueue=r,this.documentOverlayCache=o,this.indexManager=n}getDocument(e,r){let o=null;return this.documentOverlayCache.getOverlay(e,r).next(n=>(o=n,this.remoteDocumentCache.getEntry(e,r))).next(n=>(o!==null&&rp(o.mutation,n,On.empty(),Ze.now()),n))}getDocuments(e,r){return this.remoteDocumentCache.getEntries(e,r).next(o=>this.getLocalViewOfDocuments(e,o,tt()).next(()=>o))}getLocalViewOfDocuments(e,r,o=tt()){let n=el();return this.populateOverlays(e,n,r).next(()=>this.computeViews(e,r,n,o).next(a=>{let i=Zf();return a.forEach((s,l)=>{i=i.insert(s,l.overlayedDocument)}),i}))}getOverlayedDocuments(e,r){let o=el();return this.populateOverlays(e,o,r).next(()=>this.computeViews(e,r,o,tt()))}populateOverlays(e,r,o){let n=[];return o.forEach(a=>{r.has(a)||n.push(a)}),this.documentOverlayCache.getOverlays(e,n).next(a=>{a.forEach((i,s)=>{r.set(i,s)})})}computeViews(e,r,o,n){let a=Za(),i=tp(),s=function(){return tp()}();return r.forEach((l,c)=>{let u=o.get(c.key);n.has(c.key)&&(u===void 0||u.mutation instanceof Ea)?a=a.insert(c.key,c):u!==void 0?(i.set(c.key,u.mutation.getFieldMask()),rp(u.mutation,c,u.mutation.getFieldMask(),Ze.now())):i.set(c.key,On.empty())}),this.recalculateAndSaveOverlays(e,a).next(l=>(l.forEach((c,u)=>i.set(c,u)),r.forEach((c,u)=>{var d;return s.set(c,new WE(u,(d=i.get(c))!==null&&d!==void 0?d:null))}),s))}recalculateAndSaveOverlays(e,r){let o=tp(),n=new tr((i,s)=>i-s),a=tt();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,r).next(i=>{for(let s of i)s.keys().forEach(l=>{let c=r.get(l);if(c===null)return;let u=o.get(l)||On.empty();u=s.applyToLocalView(c,u),o.set(l,u);let d=(n.get(s.batchId)||tt()).add(l);n=n.insert(s.batchId,d)})}).next(()=>{let i=[],s=n.getReverseIterator();for(;s.hasNext();){let l=s.getNext(),c=l.key,u=l.value,d=V3();u.forEach(p=>{if(!a.has(p)){let m=K3(r.get(p),o.get(p));m!==null&&d.set(p,m),a=a.add(p)}}),i.push(this.documentOverlayCache.saveOverlays(e,c,d))}return ee.waitFor(i)}).next(()=>o)}recalculateAndSaveOverlaysForDocumentKeys(e,r){return this.remoteDocumentCache.getEntries(e,r).next(o=>this.recalculateAndSaveOverlays(e,o))}getDocumentsMatchingQuery(e,r,o,n){return function(i){return Ce.isDocumentKey(i.path)&&i.collectionGroup===null&&i.filters.length===0}(r)?this.getDocumentsMatchingDocumentQuery(e,r.path):L3(r)?this.getDocumentsMatchingCollectionGroupQuery(e,r,o,n):this.getDocumentsMatchingCollectionQuery(e,r,o,n)}getNextDocuments(e,r,o,n){return this.remoteDocumentCache.getAllFromCollectionGroup(e,r,o,n).next(a=>{let i=n-a.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,r,o.largestBatchId,n-a.size):ee.resolve(el()),s=-1,l=a;return i.next(c=>ee.forEach(c,(u,d)=>(s<d.largestBatchId&&(s=d.largestBatchId),a.get(u)?ee.resolve():this.remoteDocumentCache.getEntry(e,u).next(p=>{l=l.insert(u,p)}))).next(()=>this.populateOverlays(e,c,a)).next(()=>this.computeViews(e,l,c,tt())).next(u=>({batchId:s,changes:U3(u)})))})}getDocumentsMatchingDocumentQuery(e,r){return this.getDocument(e,new Ce(r)).next(o=>{let n=Zf();return o.isFoundDocument()&&(n=n.insert(o.key,o)),n})}getDocumentsMatchingCollectionGroupQuery(e,r,o,n){let a=r.collectionGroup,i=Zf();return this.indexManager.getCollectionParents(e,a).next(s=>ee.forEach(s,l=>{let c=function(d,p){return new zi(p,null,d.explicitOrderBy.slice(),d.filters.slice(),d.limit,d.limitType,d.startAt,d.endAt)}(r,l.child(a));return this.getDocumentsMatchingCollectionQuery(e,c,o,n).next(u=>{u.forEach((d,p)=>{i=i.insert(d,p)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(e,r,o,n){let a;return this.documentOverlayCache.getOverlaysForCollection(e,r.path,o.largestBatchId).next(i=>(a=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,r,o,a,n))).next(i=>{a.forEach((l,c)=>{let u=c.getKey();i.get(u)===null&&(i=i.insert(u,on.newInvalidDocument(u)))});let s=Zf();return i.forEach((l,c)=>{let u=a.get(l);u!==void 0&&rp(u.mutation,c,On.empty(),Ze.now()),Wx(r,c)&&(s=s.insert(l,c))}),s})}};var XE=class{constructor(e){this.serializer=e,this.ur=new Map,this.cr=new Map}getBundleMetadata(e,r){return ee.resolve(this.ur.get(r))}saveBundleMetadata(e,r){return this.ur.set(r.id,function(n){return{id:n.id,version:n.version,createTime:rn(n.createTime)}}(r)),ee.resolve()}getNamedQuery(e,r){return ee.resolve(this.cr.get(r))}saveNamedQuery(e,r){return this.cr.set(r.name,function(n){return{name:n.name,query:Hle(n.bundledQuery),readTime:rn(n.readTime)}}(r)),ee.resolve()}};var YE=class{constructor(){this.overlays=new tr(Ce.comparator),this.lr=new Map}getOverlay(e,r){return ee.resolve(this.overlays.get(r))}getOverlays(e,r){let o=el();return ee.forEach(r,n=>this.getOverlay(e,n).next(a=>{a!==null&&o.set(n,a)})).next(()=>o)}saveOverlays(e,r,o){return o.forEach((n,a)=>{this.lt(e,r,a)}),ee.resolve()}removeOverlaysForBatchId(e,r,o){let n=this.lr.get(o);return n!==void 0&&(n.forEach(a=>this.overlays=this.overlays.remove(a)),this.lr.delete(o)),ee.resolve()}getOverlaysForCollection(e,r,o){let n=el(),a=r.length+1,i=new Ce(r.child("")),s=this.overlays.getIteratorFrom(i);for(;s.hasNext();){let l=s.getNext().value,c=l.getKey();if(!r.isPrefixOf(c.path))break;c.path.length===a&&l.largestBatchId>o&&n.set(l.getKey(),l)}return ee.resolve(n)}getOverlaysForCollectionGroup(e,r,o,n){let a=new tr((c,u)=>c-u),i=this.overlays.getIterator();for(;i.hasNext();){let c=i.getNext().value;if(c.getKey().getCollectionGroup()===r&&c.largestBatchId>o){let u=a.get(c.largestBatchId);u===null&&(u=el(),a=a.insert(c.largestBatchId,u)),u.set(c.getKey(),c)}}let s=el(),l=a.getIterator();for(;l.hasNext()&&(l.getNext().value.forEach((c,u)=>s.set(c,u)),!(s.size()>=n)););return ee.resolve(s)}lt(e,r,o){let n=this.overlays.get(o.key);if(n!==null){let i=this.lr.get(n.largestBatchId).delete(o.key);this.lr.set(n.largestBatchId,i)}this.overlays=this.overlays.insert(o.key,new LE(r,o));let a=this.lr.get(r);a===void 0&&(a=tt(),this.lr.set(r,a)),this.lr.set(r,a.add(o.key))}};var pp=class{constructor(){this.hr=new po(br.Pr),this.Ir=new po(br.Tr)}isEmpty(){return this.hr.isEmpty()}addReference(e,r){let o=new br(e,r);this.hr=this.hr.add(o),this.Ir=this.Ir.add(o)}Er(e,r){e.forEach(o=>this.addReference(o,r))}removeReference(e,r){this.dr(new br(e,r))}Ar(e,r){e.forEach(o=>this.removeReference(o,r))}Rr(e){let r=new Ce(new qt([])),o=new br(r,e),n=new br(r,e+1),a=[];return this.Ir.forEachInRange([o,n],i=>{this.dr(i),a.push(i.key)}),a}Vr(){this.hr.forEach(e=>this.dr(e))}dr(e){this.hr=this.hr.delete(e),this.Ir=this.Ir.delete(e)}mr(e){let r=new Ce(new qt([])),o=new br(r,e),n=new br(r,e+1),a=tt();return this.Ir.forEachInRange([o,n],i=>{a=a.add(i.key)}),a}containsKey(e){let r=new br(e,0),o=this.hr.firstAfterOrEqual(r);return o!==null&&e.isEqual(o.key)}},br=class{constructor(e,r){this.key=e,this.gr=r}static Pr(e,r){return Ce.comparator(e.key,r.key)||_t(e.gr,r.gr)}static Tr(e,r){return _t(e.gr,r.gr)||Ce.comparator(e.key,r.key)}};var QE=class{constructor(e,r){this.indexManager=e,this.referenceDelegate=r,this.mutationQueue=[],this.pr=1,this.yr=new po(br.Pr)}checkEmpty(e){return ee.resolve(this.mutationQueue.length===0)}addMutationBatch(e,r,o,n){let a=this.pr;this.pr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let i=new NE(a,r,o,n);this.mutationQueue.push(i);for(let s of n)this.yr=this.yr.add(new br(s.key,a)),this.indexManager.addToCollectionParentIndex(e,s.key.path.popLast());return ee.resolve(i)}lookupMutationBatch(e,r){return ee.resolve(this.wr(r))}getNextMutationBatchAfterBatchId(e,r){let o=r+1,n=this.Sr(o),a=n<0?0:n;return ee.resolve(this.mutationQueue.length>a?this.mutationQueue[a]:null)}getHighestUnacknowledgedBatchId(){return ee.resolve(this.mutationQueue.length===0?-1:this.pr-1)}getAllMutationBatches(e){return ee.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,r){let o=new br(r,0),n=new br(r,Number.POSITIVE_INFINITY),a=[];return this.yr.forEachInRange([o,n],i=>{let s=this.wr(i.gr);a.push(s)}),ee.resolve(a)}getAllMutationBatchesAffectingDocumentKeys(e,r){let o=new po(_t);return r.forEach(n=>{let a=new br(n,0),i=new br(n,Number.POSITIVE_INFINITY);this.yr.forEachInRange([a,i],s=>{o=o.add(s.gr)})}),ee.resolve(this.br(o))}getAllMutationBatchesAffectingQuery(e,r){let o=r.path,n=o.length+1,a=o;Ce.isDocumentKey(a)||(a=a.child(""));let i=new br(new Ce(a),0),s=new po(_t);return this.yr.forEachWhile(l=>{let c=l.key.path;return!!o.isPrefixOf(c)&&(c.length===n&&(s=s.add(l.gr)),!0)},i),ee.resolve(this.br(s))}br(e){let r=[];return e.forEach(o=>{let n=this.wr(o);n!==null&&r.push(n)}),r}removeMutationBatch(e,r){Ct(this.Dr(r.batchId,"removed")===0),this.mutationQueue.shift();let o=this.yr;return ee.forEach(r.mutations,n=>{let a=new br(n.key,r.batchId);return o=o.delete(a),this.referenceDelegate.markPotentiallyOrphaned(e,n.key)}).next(()=>{this.yr=o})}Fn(e){}containsKey(e,r){let o=new br(r,0),n=this.yr.firstAfterOrEqual(o);return ee.resolve(r.isEqual(n&&n.key))}performConsistencyCheck(e){return this.mutationQueue.length,ee.resolve()}Dr(e,r){return this.Sr(e)}Sr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}wr(e){let r=this.Sr(e);return r<0||r>=this.mutationQueue.length?null:this.mutationQueue[r]}};var ZE=class{constructor(e){this.Cr=e,this.docs=function(){return new tr(Ce.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,r){let o=r.key,n=this.docs.get(o),a=n?n.size:0,i=this.Cr(r);return this.docs=this.docs.insert(o,{document:r.mutableCopy(),size:i}),this.size+=i-a,this.indexManager.addToCollectionParentIndex(e,o.path.popLast())}removeEntry(e){let r=this.docs.get(e);r&&(this.docs=this.docs.remove(e),this.size-=r.size)}getEntry(e,r){let o=this.docs.get(r);return ee.resolve(o?o.document.mutableCopy():on.newInvalidDocument(r))}getEntries(e,r){let o=Za();return r.forEach(n=>{let a=this.docs.get(n);o=o.insert(n,a?a.document.mutableCopy():on.newInvalidDocument(n))}),ee.resolve(o)}getDocumentsMatchingQuery(e,r,o,n){let a=Za(),i=r.path,s=new Ce(i.child("")),l=this.docs.getIteratorFrom(s);for(;l.hasNext();){let{key:c,value:{document:u}}=l.getNext();if(!i.isPrefixOf(c.path))break;c.path.length>i.length+1||ele(Jse(u),o)<=0||(n.has(u.key)||Wx(r,u))&&(a=a.insert(u.key,u.mutableCopy()))}return ee.resolve(a)}getAllFromCollectionGroup(e,r,o,n){De()}vr(e,r){return ee.forEach(this.docs,o=>r(o))}newChangeBuffer(e){return new JE(this)}getSize(e){return ee.resolve(this.size)}},JE=class extends GE{constructor(e){super(),this._r=e}applyChanges(e){let r=[];return this.changes.forEach((o,n)=>{n.isValidDocument()?r.push(this._r.addEntry(e,n)):this._r.removeEntry(o)}),ee.waitFor(r)}getFromCache(e,r){return this._r.getEntry(e,r)}getAllFromCache(e,r){return this._r.getEntries(e,r)}};var e1=class{constructor(e){this.persistence=e,this.Fr=new Ui(r=>W1(r),K1),this.lastRemoteSnapshotVersion=Le.min(),this.highestTargetId=0,this.Mr=0,this.Or=new pp,this.targetCount=0,this.Nr=fp.On()}forEachTarget(e,r){return this.Fr.forEach((o,n)=>r(n)),ee.resolve()}getLastRemoteSnapshotVersion(e){return ee.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ee.resolve(this.Mr)}allocateTargetId(e){return this.highestTargetId=this.Nr.next(),ee.resolve(this.highestTargetId)}setTargetsMetadata(e,r,o){return o&&(this.lastRemoteSnapshotVersion=o),r>this.Mr&&(this.Mr=r),ee.resolve()}kn(e){this.Fr.set(e.target,e);let r=e.targetId;r>this.highestTargetId&&(this.Nr=new fp(r),this.highestTargetId=r),e.sequenceNumber>this.Mr&&(this.Mr=e.sequenceNumber)}addTargetData(e,r){return this.kn(r),this.targetCount+=1,ee.resolve()}updateTargetData(e,r){return this.kn(r),ee.resolve()}removeTargetData(e,r){return this.Fr.delete(r.target),this.Or.Rr(r.targetId),this.targetCount-=1,ee.resolve()}removeTargets(e,r,o){let n=0,a=[];return this.Fr.forEach((i,s)=>{s.sequenceNumber<=r&&o.get(s.targetId)===null&&(this.Fr.delete(i),a.push(this.removeMatchingKeysForTargetId(e,s.targetId)),n++)}),ee.waitFor(a).next(()=>n)}getTargetCount(e){return ee.resolve(this.targetCount)}getTargetData(e,r){let o=this.Fr.get(r)||null;return ee.resolve(o)}addMatchingKeys(e,r,o){return this.Or.Er(r,o),ee.resolve()}removeMatchingKeys(e,r,o){this.Or.Ar(r,o);let n=this.persistence.referenceDelegate,a=[];return n&&r.forEach(i=>{a.push(n.markPotentiallyOrphaned(e,i))}),ee.waitFor(a)}removeMatchingKeysForTargetId(e,r){return this.Or.Rr(r),ee.resolve()}getMatchingKeysForTargetId(e,r){let o=this.Or.mr(r);return ee.resolve(o)}containsKey(e,r){return ee.resolve(this.Or.containsKey(r))}};var t1=class{constructor(e,r){this.Br={},this.overlays={},this.Lr=new ap(0),this.kr=!1,this.kr=!0,this.referenceDelegate=e(this),this.qr=new e1(this),this.indexManager=new jE,this.remoteDocumentCache=function(n){return new ZE(n)}(o=>this.referenceDelegate.Qr(o)),this.serializer=new $E(r),this.Kr=new XE(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.kr=!1,Promise.resolve()}get started(){return this.kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let r=this.overlays[e.toKey()];return r||(r=new YE,this.overlays[e.toKey()]=r),r}getMutationQueue(e,r){let o=this.Br[e.toKey()];return o||(o=new QE(r,this.referenceDelegate),this.Br[e.toKey()]=o),o}getTargetCache(){return this.qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Kr}runTransaction(e,r,o){ge("MemoryPersistence","Starting transaction:",e);let n=new r1(this.Lr.next());return this.referenceDelegate.$r(),o(n).next(a=>this.referenceDelegate.Ur(n).next(()=>a)).toPromise().then(a=>(n.raiseOnCommittedEvent(),a))}Wr(e,r){return ee.or(Object.values(this.Br).map(o=>()=>o.containsKey(e,r)))}},r1=class extends xE{constructor(e){super(),this.currentSequenceNumber=e}},o1=class t{constructor(e){this.persistence=e,this.Gr=new pp,this.zr=null}static jr(e){return new t(e)}get Hr(){if(this.zr)return this.zr;throw De()}addReference(e,r,o){return this.Gr.addReference(o,r),this.Hr.delete(o.toString()),ee.resolve()}removeReference(e,r,o){return this.Gr.removeReference(o,r),this.Hr.add(o.toString()),ee.resolve()}markPotentiallyOrphaned(e,r){return this.Hr.add(r.toString()),ee.resolve()}removeTarget(e,r){this.Gr.Rr(r.targetId).forEach(n=>this.Hr.add(n.toString()));let o=this.persistence.getTargetCache();return o.getMatchingKeysForTargetId(e,r.targetId).next(n=>{n.forEach(a=>this.Hr.add(a.toString()))}).next(()=>o.removeTargetData(e,r))}$r(){this.zr=new Set}Ur(e){let r=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ee.forEach(this.Hr,o=>{let n=Ce.fromPath(o);return this.Jr(e,n).next(a=>{a||r.removeEntry(n,Le.min())})}).next(()=>(this.zr=null,r.apply(e)))}updateLimboDocument(e,r){return this.Jr(e,r).next(o=>{o?this.Hr.delete(r.toString()):this.Hr.add(r.toString())})}Qr(e){return 0}Jr(e,r){return ee.or([()=>ee.resolve(this.Gr.containsKey(r)),()=>this.persistence.getTargetCache().containsKey(e,r),()=>this.persistence.Wr(e,r)])}};var n1=class t{constructor(e,r,o,n){this.targetId=e,this.fromCache=r,this.ki=o,this.qi=n}static Qi(e,r){let o=tt(),n=tt();for(let a of r.docChanges)switch(a.type){case 0:o=o.add(a.doc.key);break;case 1:n=n.add(a.doc.key)}return new t(e,r.fromCache,o,n)}};var a1=class{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}};var i1=class{constructor(){this.Ki=!1,this.$i=!1,this.Ui=100,this.Wi=8}initialize(e,r){this.Gi=e,this.indexManager=r,this.Ki=!0}getDocumentsMatchingQuery(e,r,o,n){let a={result:null};return this.zi(e,r).next(i=>{a.result=i}).next(()=>{if(!a.result)return this.ji(e,r,n,o).next(i=>{a.result=i})}).next(()=>{if(a.result)return;let i=new a1;return this.Hi(e,r,i).next(s=>{if(a.result=s,this.$i)return this.Ji(e,r,i,s.size)})}).next(()=>a.result)}Ji(e,r,o,n){return o.documentReadCount<this.Ui?(Qf()<=Qe.DEBUG&&ge("QueryEngine","SDK will not create cache indexes for query:",eu(r),"since it only creates cache indexes for collection contains","more than or equal to",this.Ui,"documents"),ee.resolve()):(Qf()<=Qe.DEBUG&&ge("QueryEngine","Query:",eu(r),"scans",o.documentReadCount,"local documents and returns",n,"documents as results."),o.documentReadCount>this.Wi*n?(Qf()<=Qe.DEBUG&&ge("QueryEngine","The SDK decides to create cache indexes for query:",eu(r),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Ia(r))):ee.resolve())}zi(e,r){if(i3(r))return ee.resolve(null);let o=Ia(r);return this.indexManager.getIndexType(e,o).next(n=>n===0?null:(r.limit!==null&&n===1&&(r=xx(r,null,"F"),o=Ia(r)),this.indexManager.getDocumentsMatchingTarget(e,o).next(a=>{let i=tt(...a);return this.Gi.getDocuments(e,i).next(s=>this.indexManager.getMinOffset(e,o).next(l=>{let c=this.Yi(r,s);return this.Zi(r,c,i,l.readTime)?this.zi(e,xx(r,null,"F")):this.Xi(e,c,r,l)}))})))}ji(e,r,o,n){return i3(r)||n.isEqual(Le.min())?ee.resolve(null):this.Gi.getDocuments(e,o).next(a=>{let i=this.Yi(r,a);return this.Zi(r,i,o,n)?ee.resolve(null):(Qf()<=Qe.DEBUG&&ge("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),eu(r)),this.Xi(e,i,r,Zse(n,-1)).next(s=>s))})}Yi(e,r){let o=new po(F3(e));return r.forEach((n,a)=>{Wx(e,a)&&(o=o.add(a))}),o}Zi(e,r,o,n){if(e.limit===null)return!1;if(o.size!==r.size)return!0;let a=e.limitType==="F"?r.last():r.first();return!!a&&(a.hasPendingWrites||a.version.compareTo(n)>0)}Hi(e,r,o){return Qf()<=Qe.DEBUG&&ge("QueryEngine","Using full collection scan to execute query:",eu(r)),this.Gi.getDocumentsMatchingQuery(e,r,ol.min(),o)}Xi(e,r,o,n){return this.Gi.getDocumentsMatchingQuery(e,o,n).next(a=>(r.forEach(i=>{a=a.insert(i.key,i)}),a))}};var s1=class{constructor(e,r,o,n){this.persistence=e,this.es=r,this.serializer=n,this.ts=new tr(_t),this.ns=new Ui(a=>W1(a),K1),this.rs=new Map,this.ss=e.getRemoteDocumentCache(),this.qr=e.getTargetCache(),this.Kr=e.getBundleCache(),this.os(o)}os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new KE(this.ss,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ss.setIndexManager(this.indexManager),this.es.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",r=>e.collect(r,this.ts))}};function $le(t,e,r,o){return new s1(t,e,r,o)}async function a9(t,e){let r=Ve(t);return await r.persistence.runTransaction("Handle user change","readonly",o=>{let n;return r.mutationQueue.getAllMutationBatches(o).next(a=>(n=a,r.os(e),r.mutationQueue.getAllMutationBatches(o))).next(a=>{let i=[],s=[],l=tt();for(let c of n){i.push(c.batchId);for(let u of c.mutations)l=l.add(u.key)}for(let c of a){s.push(c.batchId);for(let u of c.mutations)l=l.add(u.key)}return r.localDocuments.getDocuments(o,l).next(c=>({_s:c,removedBatchIds:i,addedBatchIds:s}))})})}function jle(t,e){let r=Ve(t);return r.persistence.runTransaction("Acknowledge batch","readwrite-primary",o=>{let n=e.batch.keys(),a=r.ss.newChangeBuffer({trackRemovals:!0});return function(s,l,c,u){let d=c.batch,p=d.keys(),m=ee.resolve();return p.forEach(h=>{m=m.next(()=>u.getEntry(l,h)).next(g=>{let _=c.docVersions.get(h);Ct(_!==null),g.version.compareTo(_)<0&&(d.applyToRemoteDocument(g,c),g.isValidDocument()&&(g.setReadTime(c.commitVersion),u.addEntry(g)))})}),m.next(()=>s.mutationQueue.removeMutationBatch(l,d))}(r,o,e,a).next(()=>a.apply(o)).next(()=>r.mutationQueue.performConsistencyCheck(o)).next(()=>r.documentOverlayCache.removeOverlaysForBatchId(o,n,e.batch.batchId)).next(()=>r.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(o,function(s){let l=tt();for(let c=0;c<s.mutationResults.length;++c)s.mutationResults[c].transformResults.length>0&&(l=l.add(s.batch.mutations[c].key));return l}(e))).next(()=>r.localDocuments.getDocuments(o,n))})}function i9(t){let e=Ve(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",r=>e.qr.getLastRemoteSnapshotVersion(r))}function qle(t,e){let r=Ve(t),o=e.snapshotVersion,n=r.ts;return r.persistence.runTransaction("Apply remote event","readwrite-primary",a=>{let i=r.ss.newChangeBuffer({trackRemovals:!0});n=r.ts;let s=[];e.targetChanges.forEach((u,d)=>{let p=n.get(d);if(!p)return;s.push(r.qr.removeMatchingKeys(a,u.removedDocuments,d).next(()=>r.qr.addMatchingKeys(a,u.addedDocuments,d)));let m=p.withSequenceNumber(a.currentSequenceNumber);e.targetMismatches.get(d)!==null?m=m.withResumeToken(Ro.EMPTY_BYTE_STRING,Le.min()).withLastLimboFreeSnapshotVersion(Le.min()):u.resumeToken.approximateByteSize()>0&&(m=m.withResumeToken(u.resumeToken,o)),n=n.insert(d,m),function(g,_,x){return g.resumeToken.approximateByteSize()===0||_.snapshotVersion.toMicroseconds()-g.snapshotVersion.toMicroseconds()>=3e8?!0:x.addedDocuments.size+x.modifiedDocuments.size+x.removedDocuments.size>0}(p,m,u)&&s.push(r.qr.updateTargetData(a,m))});let l=Za(),c=tt();if(e.documentUpdates.forEach(u=>{e.resolvedLimboDocuments.has(u)&&s.push(r.persistence.referenceDelegate.updateLimboDocument(a,u))}),s.push(Gle(a,i,e.documentUpdates).next(u=>{l=u.us,c=u.cs})),!o.isEqual(Le.min())){let u=r.qr.getLastRemoteSnapshotVersion(a).next(d=>r.qr.setTargetsMetadata(a,a.currentSequenceNumber,o));s.push(u)}return ee.waitFor(s).next(()=>i.apply(a)).next(()=>r.localDocuments.getLocalViewOfDocuments(a,l,c)).next(()=>l)}).then(a=>(r.ts=n,a))}function Gle(t,e,r){let o=tt(),n=tt();return r.forEach(a=>o=o.add(a)),e.getEntries(t,o).next(a=>{let i=Za();return r.forEach((s,l)=>{let c=a.get(s);l.isFoundDocument()!==c.isFoundDocument()&&(n=n.add(s)),l.isNoDocument()&&l.version.isEqual(Le.min())?(e.removeEntry(s,l.readTime),i=i.insert(s,l)):!c.isValidDocument()||l.version.compareTo(c.version)>0||l.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(l),i=i.insert(s,l)):ge("LocalStore","Ignoring outdated watch update for ",s,". Current version:",c.version," Watch version:",l.version)}),{us:i,cs:n}})}function Wle(t,e){let r=Ve(t);return r.persistence.runTransaction("Get next mutation batch","readonly",o=>(e===void 0&&(e=-1),r.mutationQueue.getNextMutationBatchAfterBatchId(o,e)))}function Kle(t,e){let r=Ve(t);return r.persistence.runTransaction("Allocate target","readwrite",o=>{let n;return r.qr.getTargetData(o,e).next(a=>a?(n=a,ee.resolve(n)):r.qr.allocateTargetId(o).next(i=>(n=new dp(e,i,"TargetPurposeListen",o.currentSequenceNumber),r.qr.addTargetData(o,n).next(()=>n))))}).then(o=>{let n=r.ts.get(o.targetId);return(n===null||o.snapshotVersion.compareTo(n.snapshotVersion)>0)&&(r.ts=r.ts.insert(o.targetId,o),r.ns.set(e,o.targetId)),o})}async function l1(t,e,r){let o=Ve(t),n=o.ts.get(e),a=r?"readwrite":"readwrite-primary";try{r||await o.persistence.runTransaction("Release target",a,i=>o.persistence.referenceDelegate.removeTarget(i,n))}catch(i){if(!Ep(i))throw i;ge("LocalStore",`Failed to update sequence numbers for target ${e}: ${i}`)}o.ts=o.ts.remove(e),o.ns.delete(n.target)}function _3(t,e,r){let o=Ve(t),n=Le.min(),a=tt();return o.persistence.runTransaction("Execute query","readwrite",i=>function(l,c,u){let d=Ve(l),p=d.ns.get(u);return p!==void 0?ee.resolve(d.ts.get(p)):d.qr.getTargetData(c,u)}(o,i,Ia(e)).next(s=>{if(s)return n=s.lastLimboFreeSnapshotVersion,o.qr.getMatchingKeysForTargetId(i,s.targetId).next(l=>{a=l})}).next(()=>o.es.getDocumentsMatchingQuery(i,e,r?n:Le.min(),r?a:tt())).next(s=>(Xle(o,dle(e),s),{documents:s,ls:a})))}function Xle(t,e,r){let o=t.rs.get(e)||Le.min();r.forEach((n,a)=>{a.readTime.compareTo(o)>0&&(o=a.readTime)}),t.rs.set(e,o)}var Tx=class{constructor(){this.activeTargetIds=_le()}ds(e){this.activeTargetIds=this.activeTargetIds.add(e)}As(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Es(){let e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}};var c1=class{constructor(){this.eo=new Tx,this.no={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,r,o){}addLocalQueryTarget(e){return this.eo.ds(e),this.no[e]||"not-current"}updateQueryState(e,r,o){this.no[e]=r}removeLocalQueryTarget(e){this.eo.As(e)}isLocalQueryTarget(e){return this.eo.activeTargetIds.has(e)}clearQueryState(e){delete this.no[e]}getAllActiveQueryTargets(){return this.eo.activeTargetIds}isActiveQueryTarget(e){return this.eo.activeTargetIds.has(e)}start(){return this.eo=new Tx,Promise.resolve()}handleUserChange(e,r,o){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}};var u1=class{ro(e){}shutdown(){}};var Px=class{constructor(){this.io=()=>this.so(),this.oo=()=>this._o(),this.ao=[],this.uo()}ro(e){this.ao.push(e)}shutdown(){window.removeEventListener("online",this.io),window.removeEventListener("offline",this.oo)}uo(){window.addEventListener("online",this.io),window.addEventListener("offline",this.oo)}so(){ge("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(let e of this.ao)e(0)}_o(){ge("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(let e of this.ao)e(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}};var cx=null;function sE(){return cx===null?cx=function(){return 268435456+Math.round(2147483648*Math.random())}():cx++,"0x"+cx.toString(16)}var Yle={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};var d1=class{constructor(e){this.co=e.co,this.lo=e.lo}ho(e){this.Po=e}Io(e){this.To=e}onMessage(e){this.Eo=e}close(){this.lo()}send(e){this.co(e)}Ao(){this.Po()}Ro(e){this.To(e)}Vo(e){this.Eo(e)}};var uo="WebChannelConnection",f1=class extends class{constructor(r){this.databaseInfo=r,this.databaseId=r.databaseId;let o=r.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),a=encodeURIComponent(this.databaseId.database);this.mo=o+"://"+r.host,this.fo=`projects/${n}/databases/${a}`,this.po=this.databaseId.database==="(default)"?`project_id=${n}`:`project_id=${n}&database_id=${a}`}get yo(){return!1}wo(r,o,n,a,i){let s=sE(),l=this.So(r,o);ge("RestConnection",`Sending RPC '${r}' ${s}:`,l,n);let c={"google-cloud-resource-prefix":this.fo,"x-goog-request-params":this.po};return this.bo(c,a,i),this.Do(r,l,c,n).then(u=>(ge("RestConnection",`Received RPC '${r}' ${s}: `,u),u),u=>{throw np("RestConnection",`RPC '${r}' ${s} failed with error: `,u,"url: ",l,"request:",n),u})}Co(r,o,n,a,i,s){return this.wo(r,o,n,a,i)}bo(r,o,n){r["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+_u}(),r["Content-Type"]="text/plain",this.databaseInfo.appId&&(r["X-Firebase-GMPID"]=this.databaseInfo.appId),o&&o.headers.forEach((a,i)=>r[i]=a),n&&n.headers.forEach((a,i)=>r[i]=a)}So(r,o){let n=Yle[r];return`${this.mo}/v1/${o}:${n}`}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Do(e,r,o,n){let a=sE();return new Promise((i,s)=>{let l=new X6;l.setWithCredentials(!0),l.listenOnce(G6.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case sx.NO_ERROR:let u=l.getResponseJson();ge(uo,`XHR for RPC '${e}' ${a} received:`,JSON.stringify(u)),i(u);break;case sx.TIMEOUT:ge(uo,`RPC '${e}' ${a} timed out`),s(new re(j.DEADLINE_EXCEEDED,"Request time out"));break;case sx.HTTP_ERROR:let d=l.getStatus();if(ge(uo,`RPC '${e}' ${a} failed with status:`,d,"response text:",l.getResponseText()),d>0){let p=l.getResponseJson();Array.isArray(p)&&(p=p[0]);let m=p?.error;if(m&&m.status&&m.message){let h=function(_){let x=_.toLowerCase().replace(/_/g,"-");return Object.values(j).indexOf(x)>=0?x:j.UNKNOWN}(m.status);s(new re(h,m.message))}else s(new re(j.UNKNOWN,"Server responded with status "+l.getStatus()))}else s(new re(j.UNAVAILABLE,"Connection failed."));break;default:De()}}finally{ge(uo,`RPC '${e}' ${a} completed.`)}});let c=JSON.stringify(n);ge(uo,`RPC '${e}' ${a} sending request:`,n),l.send(r,"POST",c,o,15)})}vo(e,r,o){let n=sE(),a=[this.mo,"/","google.firestore.v1.Firestore","/",e,"/channel"],i=j6(),s=q6(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(l.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(l.xmlHttpFactory=new K6({})),this.bo(l.initMessageHeaders,r,o),l.encodeInitMessageHeaders=!0;let u=a.join("");ge(uo,`Creating RPC '${e}' stream ${n}: ${u}`,l);let d=i.createWebChannel(u,l),p=!1,m=!1,h=new d1({co:_=>{m?ge(uo,`Not sending because RPC '${e}' stream ${n} is closed:`,_):(p||(ge(uo,`Opening RPC '${e}' stream ${n} transport.`),d.open(),p=!0),ge(uo,`RPC '${e}' stream ${n} sending:`,_),d.send(_))},lo:()=>d.close()}),g=(_,x,b)=>{_.listen(x,y=>{try{b(y)}catch(I){setTimeout(()=>{throw I},0)}})};return g(d,Yf.EventType.OPEN,()=>{m||ge(uo,`RPC '${e}' stream ${n} transport opened.`)}),g(d,Yf.EventType.CLOSE,()=>{m||(m=!0,ge(uo,`RPC '${e}' stream ${n} transport closed`),h.Ro())}),g(d,Yf.EventType.ERROR,_=>{m||(m=!0,np(uo,`RPC '${e}' stream ${n} transport errored:`,_),h.Ro(new re(j.UNAVAILABLE,"The operation could not be completed")))}),g(d,Yf.EventType.MESSAGE,_=>{var x;if(!m){let b=_.data[0];Ct(!!b);let y=b,I=y.error||((x=y[0])===null||x===void 0?void 0:x.error);if(I){ge(uo,`RPC '${e}' stream ${n} received error:`,I);let w=I.status,v=function(S){let C=xr[S];if(C!==void 0)return Q3(C)}(w),T=I.message;v===void 0&&(v=j.INTERNAL,T="Unknown error status: "+w+" with message "+I.message),m=!0,h.Ro(new re(v,T)),d.close()}else ge(uo,`RPC '${e}' stream ${n} received:`,b),h.Vo(b)}}),g(s,W6.STAT_EVENT,_=>{_.stat===iE.PROXY?ge(uo,`RPC '${e}' stream ${n} detected buffering proxy`):_.stat===iE.NOPROXY&&ge(uo,`RPC '${e}' stream ${n} detected no buffering proxy`)}),setTimeout(()=>{h.Ao()},0),h}};function lE(){return typeof document<"u"?document:null}function Kx(t){return new UE(t,!0)}var mp=class{constructor(e,r,o=1e3,n=1.5,a=6e4){this.si=e,this.timerId=r,this.Fo=o,this.Mo=n,this.xo=a,this.Oo=0,this.No=null,this.Bo=Date.now(),this.reset()}reset(){this.Oo=0}Lo(){this.Oo=this.xo}ko(e){this.cancel();let r=Math.floor(this.Oo+this.qo()),o=Math.max(0,Date.now()-this.Bo),n=Math.max(0,r-o);n>0&&ge("ExponentialBackoff",`Backing off for ${n} ms (base delay: ${this.Oo} ms, delay with jitter: ${r} ms, last attempt: ${o} ms ago)`),this.No=this.si.enqueueAfterDelay(this.timerId,n,()=>(this.Bo=Date.now(),e())),this.Oo*=this.Mo,this.Oo<this.Fo&&(this.Oo=this.Fo),this.Oo>this.xo&&(this.Oo=this.xo)}Qo(){this.No!==null&&(this.No.skipDelay(),this.No=null)}cancel(){this.No!==null&&(this.No.cancel(),this.No=null)}qo(){return(Math.random()-.5)*this.Oo}};var Ox=class{constructor(e,r,o,n,a,i,s,l){this.si=e,this.Ko=o,this.$o=n,this.connection=a,this.authCredentialsProvider=i,this.appCheckCredentialsProvider=s,this.listener=l,this.state=0,this.Uo=0,this.Wo=null,this.Go=null,this.stream=null,this.zo=new mp(e,r)}jo(){return this.state===1||this.state===5||this.Ho()}Ho(){return this.state===2||this.state===3}start(){this.state!==4?this.auth():this.Jo()}async stop(){this.jo()&&await this.close(0)}Yo(){this.state=0,this.zo.reset()}Zo(){this.Ho()&&this.Wo===null&&(this.Wo=this.si.enqueueAfterDelay(this.Ko,6e4,()=>this.Xo()))}e_(e){this.t_(),this.stream.send(e)}async Xo(){if(this.Ho())return this.close(0)}t_(){this.Wo&&(this.Wo.cancel(),this.Wo=null)}n_(){this.Go&&(this.Go.cancel(),this.Go=null)}async close(e,r){this.t_(),this.n_(),this.zo.cancel(),this.Uo++,e!==4?this.zo.reset():r&&r.code===j.RESOURCE_EXHAUSTED?(Qa(r.toString()),Qa("Using maximum backoff delay to prevent overloading the backend."),this.zo.Lo()):r&&r.code===j.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.r_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Io(r)}r_(){}auth(){this.state=1;let e=this.i_(this.Uo),r=this.Uo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([o,n])=>{this.Uo===r&&this.s_(o,n)},o=>{e(()=>{let n=new re(j.UNKNOWN,"Fetching auth token failed: "+o.message);return this.o_(n)})})}s_(e,r){let o=this.i_(this.Uo);this.stream=this.__(e,r),this.stream.ho(()=>{o(()=>(this.state=2,this.Go=this.si.enqueueAfterDelay(this.$o,1e4,()=>(this.Ho()&&(this.state=3),Promise.resolve())),this.listener.ho()))}),this.stream.Io(n=>{o(()=>this.o_(n))}),this.stream.onMessage(n=>{o(()=>this.onMessage(n))})}Jo(){this.state=5,this.zo.ko(async()=>{this.state=0,this.start()})}o_(e){return ge("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}i_(e){return r=>{this.si.enqueueAndForget(()=>this.Uo===e?r():(ge("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}},p1=class extends Ox{constructor(e,r,o,n,a,i){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",r,o,n,i),this.serializer=a}__(e,r){return this.connection.vo("Listen",e,r)}onMessage(e){this.zo.reset();let r=Dle(this.serializer,e),o=function(a){if(!("targetChange"in a))return Le.min();let i=a.targetChange;return i.targetIds&&i.targetIds.length?Le.min():i.readTime?rn(i.readTime):Le.min()}(e);return this.listener.a_(r,o)}u_(e){let r={};r.database=up(this.serializer),r.addTarget=function(a,i){let s,l=i.target;if(s=AE(l)?{documents:Nle(a,l)}:{query:Mle(a,l)},s.targetId=i.targetId,i.resumeToken.approximateByteSize()>0){s.resumeToken=Z3(a,i.resumeToken);let c=VE(a,i.expectedCount);c!==null&&(s.expectedCount=c)}else if(i.snapshotVersion.compareTo(Le.min())>0){s.readTime=Sx(a,i.snapshotVersion.toTimestamp());let c=VE(a,i.expectedCount);c!==null&&(s.expectedCount=c)}return s}(this.serializer,e);let o=Ble(this.serializer,e);o&&(r.labels=o),this.e_(r)}c_(e){let r={};r.database=up(this.serializer),r.removeTarget=e,this.e_(r)}},m1=class extends Ox{constructor(e,r,o,n,a,i){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",r,o,n,i),this.serializer=a,this.l_=!1}get h_(){return this.l_}start(){this.l_=!1,this.lastStreamToken=void 0,super.start()}r_(){this.l_&&this.P_([])}__(e,r){return this.connection.vo("Write",e,r)}onMessage(e){if(Ct(!!e.streamToken),this.lastStreamToken=e.streamToken,this.l_){this.zo.reset();let r=Rle(e.writeResults,e.commitTime),o=rn(e.commitTime);return this.listener.I_(o,r)}return Ct(!e.writeResults||e.writeResults.length===0),this.l_=!0,this.listener.T_()}E_(){let e={};e.database=up(this.serializer),this.e_(e)}P_(e){let r={streamToken:this.lastStreamToken,writes:e.map(o=>t9(this.serializer,o))};this.e_(r)}};var h1=class extends class{}{constructor(e,r,o,n){super(),this.authCredentials=e,this.appCheckCredentials=r,this.connection=o,this.serializer=n,this.d_=!1}A_(){if(this.d_)throw new re(j.FAILED_PRECONDITION,"The client has already been terminated.")}wo(e,r,o){return this.A_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([n,a])=>this.connection.wo(e,r,o,n,a)).catch(n=>{throw n.name==="FirebaseError"?(n.code===j.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),n):new re(j.UNKNOWN,n.toString())})}Co(e,r,o,n){return this.A_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([a,i])=>this.connection.Co(e,r,o,a,i,n)).catch(a=>{throw a.name==="FirebaseError"?(a.code===j.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),a):new re(j.UNKNOWN,a.toString())})}terminate(){this.d_=!0}};var g1=class{constructor(e,r){this.asyncQueue=e,this.onlineStateHandler=r,this.state="Unknown",this.V_=0,this.m_=null,this.f_=!0}g_(){this.V_===0&&(this.p_("Unknown"),this.m_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.m_=null,this.y_("Backend didn't respond within 10 seconds."),this.p_("Offline"),Promise.resolve())))}w_(e){this.state==="Online"?this.p_("Unknown"):(this.V_++,this.V_>=1&&(this.S_(),this.y_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.p_("Offline")))}set(e){this.S_(),this.V_=0,e==="Online"&&(this.f_=!1),this.p_(e)}p_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}y_(e){let r=`Could not reach Cloud Firestore backend. ${e}
|
|
21
|
+
}`}};var BE=class{constructor(e,r){this.count=e,this.unchangedNames=r}};var xr,it;function Y3(t){switch(t){default:return De();case j.CANCELLED:case j.UNKNOWN:case j.DEADLINE_EXCEEDED:case j.RESOURCE_EXHAUSTED:case j.INTERNAL:case j.UNAVAILABLE:case j.UNAUTHENTICATED:return!1;case j.INVALID_ARGUMENT:case j.NOT_FOUND:case j.ALREADY_EXISTS:case j.PERMISSION_DENIED:case j.FAILED_PRECONDITION:case j.ABORTED:case j.OUT_OF_RANGE:case j.UNIMPLEMENTED:case j.DATA_LOSS:return!0}}function Q3(t){if(t===void 0)return Qa("GRPC error has no .code"),j.UNKNOWN;switch(t){case xr.OK:return j.OK;case xr.CANCELLED:return j.CANCELLED;case xr.UNKNOWN:return j.UNKNOWN;case xr.DEADLINE_EXCEEDED:return j.DEADLINE_EXCEEDED;case xr.RESOURCE_EXHAUSTED:return j.RESOURCE_EXHAUSTED;case xr.INTERNAL:return j.INTERNAL;case xr.UNAVAILABLE:return j.UNAVAILABLE;case xr.UNAUTHENTICATED:return j.UNAUTHENTICATED;case xr.INVALID_ARGUMENT:return j.INVALID_ARGUMENT;case xr.NOT_FOUND:return j.NOT_FOUND;case xr.ALREADY_EXISTS:return j.ALREADY_EXISTS;case xr.PERMISSION_DENIED:return j.PERMISSION_DENIED;case xr.FAILED_PRECONDITION:return j.FAILED_PRECONDITION;case xr.ABORTED:return j.ABORTED;case xr.OUT_OF_RANGE:return j.OUT_OF_RANGE;case xr.UNIMPLEMENTED:return j.UNIMPLEMENTED;case xr.DATA_LOSS:return j.DATA_LOSS;default:return De()}}(it=xr||(xr={}))[it.OK=0]="OK",it[it.CANCELLED=1]="CANCELLED",it[it.UNKNOWN=2]="UNKNOWN",it[it.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",it[it.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",it[it.NOT_FOUND=5]="NOT_FOUND",it[it.ALREADY_EXISTS=6]="ALREADY_EXISTS",it[it.PERMISSION_DENIED=7]="PERMISSION_DENIED",it[it.UNAUTHENTICATED=16]="UNAUTHENTICATED",it[it.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",it[it.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",it[it.ABORTED=10]="ABORTED",it[it.OUT_OF_RANGE=11]="OUT_OF_RANGE",it[it.UNIMPLEMENTED=12]="UNIMPLEMENTED",it[it.INTERNAL=13]="INTERNAL",it[it.UNAVAILABLE=14]="UNAVAILABLE",it[it.DATA_LOSS=15]="DATA_LOSS";var d3=null;function Ele(){return new TextEncoder}var Sle=new Js([4294967295,4294967295],0);function f3(t){let e=Ele().encode(t),r=new Y6;return r.update(e),new Uint8Array(r.digest())}function p3(t){let e=new DataView(t.buffer),r=e.getUint32(0,!0),o=e.getUint32(4,!0),n=e.getUint32(8,!0),a=e.getUint32(12,!0);return[new Js([r,o],0),new Js([n,a],0)]}var FE=class t{constructor(e,r,o){if(this.bitmap=e,this.padding=r,this.hashCount=o,r<0||r>=8)throw new tl(`Invalid padding: ${r}`);if(o<0)throw new tl(`Invalid hash count: ${o}`);if(e.length>0&&this.hashCount===0)throw new tl(`Invalid hash count: ${o}`);if(e.length===0&&r!==0)throw new tl(`Invalid padding when bitmap length is 0: ${r}`);this.Te=8*e.length-r,this.Ee=Js.fromNumber(this.Te)}de(e,r,o){let n=e.add(r.multiply(Js.fromNumber(o)));return n.compare(Sle)===1&&(n=new Js([n.getBits(0),n.getBits(1)],0)),n.modulo(this.Ee).toNumber()}Ae(e){return(this.bitmap[Math.floor(e/8)]&1<<e%8)!=0}mightContain(e){if(this.Te===0)return!1;let r=f3(e),[o,n]=p3(r);for(let a=0;a<this.hashCount;a++){let i=this.de(o,n,a);if(!this.Ae(i))return!1}return!0}static create(e,r,o){let n=e%8==0?0:8-e%8,a=new Uint8Array(Math.ceil(e/8)),i=new t(a,n,r);return o.forEach(s=>i.insert(s)),i}insert(e){if(this.Te===0)return;let r=f3(e),[o,n]=p3(r);for(let a=0;a<this.hashCount;a++){let i=this.de(o,n,a);this.Re(i)}}Re(e){let r=Math.floor(e/8),o=e%8;this.bitmap[r]|=1<<o}},tl=class extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}};var vx=class t{constructor(e,r,o,n,a){this.snapshotVersion=e,this.targetChanges=r,this.targetMismatches=o,this.documentUpdates=n,this.resolvedLimboDocuments=a}static createSynthesizedRemoteEventForCurrentChange(e,r,o){let n=new Map;return n.set(e,cp.createSynthesizedTargetChangeForCurrentChange(e,r,o)),new t(Le.min(),n,new tr(_t),Za(),tt())}},cp=class t{constructor(e,r,o,n,a){this.resumeToken=e,this.current=r,this.addedDocuments=o,this.modifiedDocuments=n,this.removedDocuments=a}static createSynthesizedTargetChangeForCurrentChange(e,r,o){return new t(o,r,tt(),tt(),tt())}};var nu=class{constructor(e,r,o,n){this.Ve=e,this.removedTargetIds=r,this.key=o,this.me=n}},Ix=class{constructor(e,r){this.targetId=e,this.fe=r}},wx=class{constructor(e,r,o=Ro.EMPTY_BYTE_STRING,n=null){this.state=e,this.targetIds=r,this.resumeToken=o,this.cause=n}},Ex=class{constructor(){this.ge=0,this.pe=h3(),this.ye=Ro.EMPTY_BYTE_STRING,this.we=!1,this.Se=!0}get current(){return this.we}get resumeToken(){return this.ye}get be(){return this.ge!==0}get De(){return this.Se}Ce(e){e.approximateByteSize()>0&&(this.Se=!0,this.ye=e)}ve(){let e=tt(),r=tt(),o=tt();return this.pe.forEach((n,a)=>{switch(a){case 0:e=e.add(n);break;case 2:r=r.add(n);break;case 1:o=o.add(n);break;default:De()}}),new cp(this.ye,this.we,e,r,o)}Fe(){this.Se=!1,this.pe=h3()}Me(e,r){this.Se=!0,this.pe=this.pe.insert(e,r)}xe(e){this.Se=!0,this.pe=this.pe.remove(e)}Oe(){this.ge+=1}Ne(){this.ge-=1}Be(){this.Se=!0,this.we=!0}},zE=class{constructor(e){this.Le=e,this.ke=new Map,this.qe=Za(),this.Qe=m3(),this.Ke=new tr(_t)}$e(e){for(let r of e.Ve)e.me&&e.me.isFoundDocument()?this.Ue(r,e.me):this.We(r,e.key,e.me);for(let r of e.removedTargetIds)this.We(r,e.key,e.me)}Ge(e){this.forEachTarget(e,r=>{let o=this.ze(r);switch(e.state){case 0:this.je(r)&&o.Ce(e.resumeToken);break;case 1:o.Ne(),o.be||o.Fe(),o.Ce(e.resumeToken);break;case 2:o.Ne(),o.be||this.removeTarget(r);break;case 3:this.je(r)&&(o.Be(),o.Ce(e.resumeToken));break;case 4:this.je(r)&&(this.He(r),o.Ce(e.resumeToken));break;default:De()}})}forEachTarget(e,r){e.targetIds.length>0?e.targetIds.forEach(r):this.ke.forEach((o,n)=>{this.je(n)&&r(n)})}Je(e){let r=e.targetId,o=e.fe.count,n=this.Ye(r);if(n){let a=n.target;if(AE(a))if(o===0){let i=new Ce(a.path);this.We(r,i,on.newNoDocument(i,Le.min()))}else Ct(o===1);else{let i=this.Ze(r);if(i!==o){let s=this.Xe(e),l=s?this.et(s,e,i):1;if(l!==0){this.He(r);let c=l===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ke=this.Ke.insert(r,c)}d3?.tt(function(u,d,p,m,h){var g,_,x,b,y,I;let w={localCacheCount:u,existenceFilterCount:d.count,databaseId:p.database,projectId:p.projectId},v=d.unchangedNames;return v&&(w.bloomFilter={applied:h===0,hashCount:(g=v?.hashCount)!==null&&g!==void 0?g:0,bitmapLength:(b=(x=(_=v?.bits)===null||_===void 0?void 0:_.bitmap)===null||x===void 0?void 0:x.length)!==null&&b!==void 0?b:0,padding:(I=(y=v?.bits)===null||y===void 0?void 0:y.padding)!==null&&I!==void 0?I:0,mightContain:T=>{var O;return(O=m?.mightContain(T))!==null&&O!==void 0&&O}}),w}(i,e.fe,this.Le.nt(),s,l))}}}}Xe(e){let r=e.fe.unchangedNames;if(!r||!r.bits)return null;let{bits:{bitmap:o="",padding:n=0},hashCount:a=0}=r,i,s;try{i=Fi(o).toUint8Array()}catch(l){if(l instanceof hx)return np("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{s=new FE(i,n,a)}catch(l){return np(l instanceof tl?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return s.Te===0?null:s}et(e,r,o){return r.fe.count===o-this.rt(e,r.targetId)?0:2}rt(e,r){let o=this.Le.getRemoteKeysForTarget(r),n=0;return o.forEach(a=>{let i=this.Le.nt(),s=`projects/${i.projectId}/databases/${i.database}/documents/${a.path.canonicalString()}`;e.mightContain(s)||(this.We(r,a,null),n++)}),n}it(e){let r=new Map;this.ke.forEach((a,i)=>{let s=this.Ye(i);if(s){if(a.current&&AE(s.target)){let l=new Ce(s.target.path);this.qe.get(l)!==null||this.st(i,l)||this.We(i,l,on.newNoDocument(l,e))}a.De&&(r.set(i,a.ve()),a.Fe())}});let o=tt();this.Qe.forEach((a,i)=>{let s=!0;i.forEachWhile(l=>{let c=this.Ye(l);return!c||c.purpose==="TargetPurposeLimboResolution"||(s=!1,!1)}),s&&(o=o.add(a))}),this.qe.forEach((a,i)=>i.setReadTime(e));let n=new vx(e,r,this.Ke,this.qe,o);return this.qe=Za(),this.Qe=m3(),this.Ke=new tr(_t),n}Ue(e,r){if(!this.je(e))return;let o=this.st(e,r.key)?2:0;this.ze(e).Me(r.key,o),this.qe=this.qe.insert(r.key,r),this.Qe=this.Qe.insert(r.key,this.ot(r.key).add(e))}We(e,r,o){if(!this.je(e))return;let n=this.ze(e);this.st(e,r)?n.Me(r,1):n.xe(r),this.Qe=this.Qe.insert(r,this.ot(r).delete(e)),o&&(this.qe=this.qe.insert(r,o))}removeTarget(e){this.ke.delete(e)}Ze(e){let r=this.ze(e).ve();return this.Le.getRemoteKeysForTarget(e).size+r.addedDocuments.size-r.removedDocuments.size}Oe(e){this.ze(e).Oe()}ze(e){let r=this.ke.get(e);return r||(r=new Ex,this.ke.set(e,r)),r}ot(e){let r=this.Qe.get(e);return r||(r=new po(_t),this.Qe=this.Qe.insert(e,r)),r}je(e){let r=this.Ye(e)!==null;return r||ge("WatchChangeAggregator","Detected inactive target",e),r}Ye(e){let r=this.ke.get(e);return r&&r.be?null:this.Le._t(e)}He(e){this.ke.set(e,new Ex),this.Le.getRemoteKeysForTarget(e).forEach(r=>{this.We(e,r,null)})}st(e,r){return this.Le.getRemoteKeysForTarget(e).has(r)}};function m3(){return new tr(Ce.comparator)}function h3(){return new tr(Ce.comparator)}var Cle={asc:"ASCENDING",desc:"DESCENDING"},kle={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},Tle={and:"AND",or:"OR"},UE=class{constructor(e,r){this.databaseId=e,this.useProto3Json=r}};function VE(t,e){return t.useProto3Json||Sp(e)?e:{value:e}}function Sx(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Z3(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function Ple(t,e){return Sx(t,e.toTimestamp())}function rn(t){return Ct(!!t),Le.fromTimestamp(function(r){let o=Bi(r);return new Ze(o.seconds,o.nanos)}(t))}function X1(t,e){return function(o){return new qt(["projects",o.projectId,"databases",o.database])}(t).child("documents").child(e).canonicalString()}function J3(t){let e=qt.fromString(t);return Ct(n9(e)),e}function Cx(t,e){return X1(t.databaseId,e.path)}function op(t,e){let r=J3(e);if(r.get(1)!==t.databaseId.projectId)throw new re(j.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+r.get(1)+" vs "+t.databaseId.projectId);if(r.get(3)!==t.databaseId.database)throw new re(j.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+r.get(3)+" vs "+t.databaseId.database);return new Ce(e9(r))}function HE(t,e){return X1(t.databaseId,e)}function Ole(t){let e=J3(t);return e.length===4?qt.emptyPath():e9(e)}function up(t){return new qt(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function e9(t){return Ct(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function g3(t,e,r){return{name:Cx(t,e),fields:r.value.mapValue.fields}}function Ale(t,e){return"found"in e?function(o,n){Ct(!!n.found),n.found.name,n.found.updateTime;let a=op(o,n.found.name),i=rn(n.found.updateTime),s=n.found.createTime?rn(n.found.createTime):Le.min(),l=new qo({mapValue:{fields:n.found.fields}});return on.newFoundDocument(a,i,s,l)}(t,e):"missing"in e?function(o,n){Ct(!!n.missing),Ct(!!n.readTime);let a=op(o,n.missing),i=rn(n.readTime);return on.newNoDocument(a,i)}(t,e):De()}function Dle(t,e){let r;if("targetChange"in e){e.targetChange;let o=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:De()}(e.targetChange.targetChangeType||"NO_CHANGE"),n=e.targetChange.targetIds||[],a=function(c,u){return c.useProto3Json?(Ct(u===void 0||typeof u=="string"),Ro.fromBase64String(u||"")):(Ct(u===void 0||u instanceof Uint8Array),Ro.fromUint8Array(u||new Uint8Array))}(t,e.targetChange.resumeToken),i=e.targetChange.cause,s=i&&function(c){let u=c.code===void 0?j.UNKNOWN:Q3(c.code);return new re(u,c.message||"")}(i);r=new wx(o,n,a,s||null)}else if("documentChange"in e){e.documentChange;let o=e.documentChange;o.document,o.document.name,o.document.updateTime;let n=op(t,o.document.name),a=rn(o.document.updateTime),i=o.document.createTime?rn(o.document.createTime):Le.min(),s=new qo({mapValue:{fields:o.document.fields}}),l=on.newFoundDocument(n,a,i,s),c=o.targetIds||[],u=o.removedTargetIds||[];r=new nu(c,u,l.key,l)}else if("documentDelete"in e){e.documentDelete;let o=e.documentDelete;o.document;let n=op(t,o.document),a=o.readTime?rn(o.readTime):Le.min(),i=on.newNoDocument(n,a),s=o.removedTargetIds||[];r=new nu([],s,i.key,i)}else if("documentRemove"in e){e.documentRemove;let o=e.documentRemove;o.document;let n=op(t,o.document),a=o.removedTargetIds||[];r=new nu([],a,n,null)}else{if(!("filter"in e))return De();{e.filter;let o=e.filter;o.targetId;let{count:n=0,unchangedNames:a}=o,i=new BE(n,a),s=o.targetId;r=new Ix(s,i)}}return r}function t9(t,e){let r;if(e instanceof ll)r={update:g3(t,e.key,e.value)};else if(e instanceof cl)r={delete:Cx(t,e.key)};else if(e instanceof Ea)r={update:g3(t,e.key,e.data),updateMask:Vle(e.fieldMask)};else{if(!(e instanceof yx))return De();r={verify:Cx(t,e.key)}}return e.fieldTransforms.length>0&&(r.updateTransforms=e.fieldTransforms.map(o=>function(a,i){let s=i.transform;if(s instanceof il)return{fieldPath:i.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(s instanceof Vi)return{fieldPath:i.field.canonicalString(),appendMissingElements:{values:s.elements}};if(s instanceof sl)return{fieldPath:i.field.canonicalString(),removeAllFromArray:{values:s.elements}};if(s instanceof du)return{fieldPath:i.field.canonicalString(),increment:s.Ie};throw De()}(0,o))),e.precondition.isNone||(r.currentDocument=function(n,a){return a.updateTime!==void 0?{updateTime:Ple(n,a.updateTime)}:a.exists!==void 0?{exists:a.exists}:De()}(t,e.precondition)),r}function Rle(t,e){return t&&t.length>0?(Ct(e!==void 0),t.map(r=>function(n,a){let i=n.updateTime?rn(n.updateTime):rn(a);return i.isEqual(Le.min())&&(i=rn(a)),new RE(i,n.transformResults||[])}(r,e))):[]}function Nle(t,e){return{documents:[HE(t,e.path)]}}function Mle(t,e){let r={structuredQuery:{}},o=e.path;e.collectionGroup!==null?(r.parent=HE(t,o),r.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(r.parent=HE(t,o.popLast()),r.structuredQuery.from=[{collectionId:o.lastSegment()}]);let n=function(l){if(l.length!==0)return o9(Yn.create(l,"and"))}(e.filters);n&&(r.structuredQuery.where=n);let a=function(l){if(l.length!==0)return l.map(c=>function(d){return{field:tu(d.field),direction:Fle(d.dir)}}(c))}(e.orderBy);a&&(r.structuredQuery.orderBy=a);let i=VE(t,e.limit);return i!==null&&(r.structuredQuery.limit=i),e.startAt&&(r.structuredQuery.startAt=function(l){return{before:l.inclusive,values:l.position}}(e.startAt)),e.endAt&&(r.structuredQuery.endAt=function(l){return{before:!l.inclusive,values:l.position}}(e.endAt)),r}function Lle(t){let e=Ole(t.parent),r=t.structuredQuery,o=r.from?r.from.length:0,n=null;if(o>0){Ct(o===1);let u=r.from[0];u.allDescendants?n=u.collectionId:e=e.child(u.collectionId)}let a=[];r.where&&(a=function(d){let p=r9(d);return p instanceof Yn&&D3(p)?p.getFilters():[p]}(r.where));let i=[];r.orderBy&&(i=function(d){return d.map(p=>function(h){return new al(ru(h.field),function(_){switch(_){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(h.direction))}(p))}(r.orderBy));let s=null;r.limit&&(s=function(d){let p;return p=typeof d=="object"?d.value:d,Sp(p)?null:p}(r.limit));let l=null;r.startAt&&(l=function(d){let p=!!d.before,m=d.values||[];return new cu(m,p)}(r.startAt));let c=null;return r.endAt&&(c=function(d){let p=!d.before,m=d.values||[];return new cu(m,p)}(r.endAt)),cle(e,n,i,a,s,"F",l,c)}function Ble(t,e){let r=function(n){switch(n){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return De()}}(e.purpose);return r==null?null:{"goog-listen-tags":r}}function r9(t){return t.unaryFilter!==void 0?function(r){switch(r.unaryFilter.op){case"IS_NAN":let o=ru(r.unaryFilter.field);return yr.create(o,"==",{doubleValue:NaN});case"IS_NULL":let n=ru(r.unaryFilter.field);return yr.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let a=ru(r.unaryFilter.field);return yr.create(a,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let i=ru(r.unaryFilter.field);return yr.create(i,"!=",{nullValue:"NULL_VALUE"});default:return De()}}(t):t.fieldFilter!==void 0?function(r){return yr.create(ru(r.fieldFilter.field),function(n){switch(n){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return De()}}(r.fieldFilter.op),r.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(r){return Yn.create(r.compositeFilter.filters.map(o=>r9(o)),function(n){switch(n){case"AND":return"and";case"OR":return"or";default:return De()}}(r.compositeFilter.op))}(t):De()}function Fle(t){return Cle[t]}function zle(t){return kle[t]}function Ule(t){return Tle[t]}function tu(t){return{fieldPath:t.canonicalString()}}function ru(t){return tn.fromServerFormat(t.fieldPath)}function o9(t){return t instanceof yr?function(r){if(r.op==="=="){if(r3(r.value))return{unaryFilter:{field:tu(r.field),op:"IS_NAN"}};if(t3(r.value))return{unaryFilter:{field:tu(r.field),op:"IS_NULL"}}}else if(r.op==="!="){if(r3(r.value))return{unaryFilter:{field:tu(r.field),op:"IS_NOT_NAN"}};if(t3(r.value))return{unaryFilter:{field:tu(r.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:tu(r.field),op:zle(r.op),value:r.value}}}(t):t instanceof Yn?function(r){let o=r.getFilters().map(n=>o9(n));return o.length===1?o[0]:{compositeFilter:{op:Ule(r.op),filters:o}}}(t):De()}function Vle(t){let e=[];return t.fields.forEach(r=>e.push(r.canonicalString())),{fieldPaths:e}}function n9(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}var dp=class t{constructor(e,r,o,n,a=Le.min(),i=Le.min(),s=Ro.EMPTY_BYTE_STRING,l=null){this.target=e,this.targetId=r,this.purpose=o,this.sequenceNumber=n,this.snapshotVersion=a,this.lastLimboFreeSnapshotVersion=i,this.resumeToken=s,this.expectedCount=l}withSequenceNumber(e){return new t(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,r){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,r,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new t(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}};var $E=class{constructor(e){this.ut=e}};function Hle(t){let e=Lle({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?xx(e,e.limit,"L"):e}var kx=class{constructor(){}ht(e,r){this.Pt(e,r),r.It()}Pt(e,r){if("nullValue"in e)this.Tt(r,5);else if("booleanValue"in e)this.Tt(r,10),r.Et(e.booleanValue?1:0);else if("integerValue"in e)this.Tt(r,15),r.Et(er(e.integerValue));else if("doubleValue"in e){let o=er(e.doubleValue);isNaN(o)?this.Tt(r,13):(this.Tt(r,15),ip(o)?r.Et(0):r.Et(o))}else if("timestampValue"in e){let o=e.timestampValue;this.Tt(r,20),typeof o=="string"?r.dt(o):(r.dt(`${o.seconds||""}`),r.Et(o.nanos||0))}else if("stringValue"in e)this.At(e.stringValue,r),this.Rt(r);else if("bytesValue"in e)this.Tt(r,30),r.Vt(Fi(e.bytesValue)),this.Rt(r);else if("referenceValue"in e)this.ft(e.referenceValue,r);else if("geoPointValue"in e){let o=e.geoPointValue;this.Tt(r,45),r.Et(o.latitude||0),r.Et(o.longitude||0)}else"mapValue"in e?P3(e)?this.Tt(r,Number.MAX_SAFE_INTEGER):(this.gt(e.mapValue,r),this.Rt(r)):"arrayValue"in e?(this.yt(e.arrayValue,r),this.Rt(r)):De()}At(e,r){this.Tt(r,25),this.wt(e,r)}wt(e,r){r.dt(e)}gt(e,r){let o=e.fields||{};this.Tt(r,55);for(let n of Object.keys(o))this.At(n,r),this.Pt(o[n],r)}yt(e,r){let o=e.values||[];this.Tt(r,50);for(let n of o)this.Pt(n,r)}ft(e,r){this.Tt(r,37),Ce.fromName(e).path.forEach(o=>{this.Tt(r,60),this.wt(o,r)})}Tt(e,r){e.Et(r)}Rt(e){e.Et(2)}};kx.St=new kx;var jE=class{constructor(){this.on=new qE}addToCollectionParentIndex(e,r){return this.on.add(r),ee.resolve()}getCollectionParents(e,r){return ee.resolve(this.on.getEntries(r))}addFieldIndex(e,r){return ee.resolve()}deleteFieldIndex(e,r){return ee.resolve()}deleteAllFieldIndexes(e){return ee.resolve()}createTargetIndexes(e,r){return ee.resolve()}getDocumentsMatchingTarget(e,r){return ee.resolve(null)}getIndexType(e,r){return ee.resolve(0)}getFieldIndexes(e,r){return ee.resolve([])}getNextCollectionGroupToUpdate(e){return ee.resolve(null)}getMinOffset(e,r){return ee.resolve(ol.min())}getMinOffsetFromCollectionGroup(e,r){return ee.resolve(ol.min())}updateCollectionGroup(e,r,o){return ee.resolve()}updateIndexEntries(e,r){return ee.resolve()}},qE=class{constructor(){this.index={}}add(e){let r=e.lastSegment(),o=e.popLast(),n=this.index[r]||new po(qt.comparator),a=!n.has(o);return this.index[r]=n.add(o),a}has(e){let r=e.lastSegment(),o=e.popLast(),n=this.index[r];return n&&n.has(o)}getEntries(e){return(this.index[e]||new po(qt.comparator)).toArray()}};var P7e=new Uint8Array(0);var ya=class t{constructor(e,r,o){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=r,this.maximumSequenceNumbersToCollect=o}static withCacheSize(e){return new t(e,t.DEFAULT_COLLECTION_PERCENTILE,t.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}};ya.DEFAULT_COLLECTION_PERCENTILE=10,ya.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,ya.DEFAULT=new ya(41943040,ya.DEFAULT_COLLECTION_PERCENTILE,ya.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),ya.DISABLED=new ya(-1,0,0);var fp=class t{constructor(e){this.xn=e}next(){return this.xn+=2,this.xn}static On(){return new t(0)}static Nn(){return new t(-1)}};var GE=class{constructor(){this.changes=new Ui(e=>e.toString(),(e,r)=>e.isEqual(r)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,r){this.assertNotApplied(),this.changes.set(e,on.newInvalidDocument(e).setReadTime(r))}getEntry(e,r){this.assertNotApplied();let o=this.changes.get(r);return o!==void 0?ee.resolve(o):this.getFromCache(e,r)}getEntries(e,r){return this.getAllFromCache(e,r)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}};var WE=class{constructor(e,r){this.overlayedDocument=e,this.mutatedFields=r}};var KE=class{constructor(e,r,o,n){this.remoteDocumentCache=e,this.mutationQueue=r,this.documentOverlayCache=o,this.indexManager=n}getDocument(e,r){let o=null;return this.documentOverlayCache.getOverlay(e,r).next(n=>(o=n,this.remoteDocumentCache.getEntry(e,r))).next(n=>(o!==null&&rp(o.mutation,n,On.empty(),Ze.now()),n))}getDocuments(e,r){return this.remoteDocumentCache.getEntries(e,r).next(o=>this.getLocalViewOfDocuments(e,o,tt()).next(()=>o))}getLocalViewOfDocuments(e,r,o=tt()){let n=el();return this.populateOverlays(e,n,r).next(()=>this.computeViews(e,r,n,o).next(a=>{let i=Zf();return a.forEach((s,l)=>{i=i.insert(s,l.overlayedDocument)}),i}))}getOverlayedDocuments(e,r){let o=el();return this.populateOverlays(e,o,r).next(()=>this.computeViews(e,r,o,tt()))}populateOverlays(e,r,o){let n=[];return o.forEach(a=>{r.has(a)||n.push(a)}),this.documentOverlayCache.getOverlays(e,n).next(a=>{a.forEach((i,s)=>{r.set(i,s)})})}computeViews(e,r,o,n){let a=Za(),i=tp(),s=function(){return tp()}();return r.forEach((l,c)=>{let u=o.get(c.key);n.has(c.key)&&(u===void 0||u.mutation instanceof Ea)?a=a.insert(c.key,c):u!==void 0?(i.set(c.key,u.mutation.getFieldMask()),rp(u.mutation,c,u.mutation.getFieldMask(),Ze.now())):i.set(c.key,On.empty())}),this.recalculateAndSaveOverlays(e,a).next(l=>(l.forEach((c,u)=>i.set(c,u)),r.forEach((c,u)=>{var d;return s.set(c,new WE(u,(d=i.get(c))!==null&&d!==void 0?d:null))}),s))}recalculateAndSaveOverlays(e,r){let o=tp(),n=new tr((i,s)=>i-s),a=tt();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,r).next(i=>{for(let s of i)s.keys().forEach(l=>{let c=r.get(l);if(c===null)return;let u=o.get(l)||On.empty();u=s.applyToLocalView(c,u),o.set(l,u);let d=(n.get(s.batchId)||tt()).add(l);n=n.insert(s.batchId,d)})}).next(()=>{let i=[],s=n.getReverseIterator();for(;s.hasNext();){let l=s.getNext(),c=l.key,u=l.value,d=V3();u.forEach(p=>{if(!a.has(p)){let m=K3(r.get(p),o.get(p));m!==null&&d.set(p,m),a=a.add(p)}}),i.push(this.documentOverlayCache.saveOverlays(e,c,d))}return ee.waitFor(i)}).next(()=>o)}recalculateAndSaveOverlaysForDocumentKeys(e,r){return this.remoteDocumentCache.getEntries(e,r).next(o=>this.recalculateAndSaveOverlays(e,o))}getDocumentsMatchingQuery(e,r,o,n){return function(i){return Ce.isDocumentKey(i.path)&&i.collectionGroup===null&&i.filters.length===0}(r)?this.getDocumentsMatchingDocumentQuery(e,r.path):L3(r)?this.getDocumentsMatchingCollectionGroupQuery(e,r,o,n):this.getDocumentsMatchingCollectionQuery(e,r,o,n)}getNextDocuments(e,r,o,n){return this.remoteDocumentCache.getAllFromCollectionGroup(e,r,o,n).next(a=>{let i=n-a.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,r,o.largestBatchId,n-a.size):ee.resolve(el()),s=-1,l=a;return i.next(c=>ee.forEach(c,(u,d)=>(s<d.largestBatchId&&(s=d.largestBatchId),a.get(u)?ee.resolve():this.remoteDocumentCache.getEntry(e,u).next(p=>{l=l.insert(u,p)}))).next(()=>this.populateOverlays(e,c,a)).next(()=>this.computeViews(e,l,c,tt())).next(u=>({batchId:s,changes:U3(u)})))})}getDocumentsMatchingDocumentQuery(e,r){return this.getDocument(e,new Ce(r)).next(o=>{let n=Zf();return o.isFoundDocument()&&(n=n.insert(o.key,o)),n})}getDocumentsMatchingCollectionGroupQuery(e,r,o,n){let a=r.collectionGroup,i=Zf();return this.indexManager.getCollectionParents(e,a).next(s=>ee.forEach(s,l=>{let c=function(d,p){return new zi(p,null,d.explicitOrderBy.slice(),d.filters.slice(),d.limit,d.limitType,d.startAt,d.endAt)}(r,l.child(a));return this.getDocumentsMatchingCollectionQuery(e,c,o,n).next(u=>{u.forEach((d,p)=>{i=i.insert(d,p)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(e,r,o,n){let a;return this.documentOverlayCache.getOverlaysForCollection(e,r.path,o.largestBatchId).next(i=>(a=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,r,o,a,n))).next(i=>{a.forEach((l,c)=>{let u=c.getKey();i.get(u)===null&&(i=i.insert(u,on.newInvalidDocument(u)))});let s=Zf();return i.forEach((l,c)=>{let u=a.get(l);u!==void 0&&rp(u.mutation,c,On.empty(),Ze.now()),Wx(r,c)&&(s=s.insert(l,c))}),s})}};var XE=class{constructor(e){this.serializer=e,this.ur=new Map,this.cr=new Map}getBundleMetadata(e,r){return ee.resolve(this.ur.get(r))}saveBundleMetadata(e,r){return this.ur.set(r.id,function(n){return{id:n.id,version:n.version,createTime:rn(n.createTime)}}(r)),ee.resolve()}getNamedQuery(e,r){return ee.resolve(this.cr.get(r))}saveNamedQuery(e,r){return this.cr.set(r.name,function(n){return{name:n.name,query:Hle(n.bundledQuery),readTime:rn(n.readTime)}}(r)),ee.resolve()}};var YE=class{constructor(){this.overlays=new tr(Ce.comparator),this.lr=new Map}getOverlay(e,r){return ee.resolve(this.overlays.get(r))}getOverlays(e,r){let o=el();return ee.forEach(r,n=>this.getOverlay(e,n).next(a=>{a!==null&&o.set(n,a)})).next(()=>o)}saveOverlays(e,r,o){return o.forEach((n,a)=>{this.lt(e,r,a)}),ee.resolve()}removeOverlaysForBatchId(e,r,o){let n=this.lr.get(o);return n!==void 0&&(n.forEach(a=>this.overlays=this.overlays.remove(a)),this.lr.delete(o)),ee.resolve()}getOverlaysForCollection(e,r,o){let n=el(),a=r.length+1,i=new Ce(r.child("")),s=this.overlays.getIteratorFrom(i);for(;s.hasNext();){let l=s.getNext().value,c=l.getKey();if(!r.isPrefixOf(c.path))break;c.path.length===a&&l.largestBatchId>o&&n.set(l.getKey(),l)}return ee.resolve(n)}getOverlaysForCollectionGroup(e,r,o,n){let a=new tr((c,u)=>c-u),i=this.overlays.getIterator();for(;i.hasNext();){let c=i.getNext().value;if(c.getKey().getCollectionGroup()===r&&c.largestBatchId>o){let u=a.get(c.largestBatchId);u===null&&(u=el(),a=a.insert(c.largestBatchId,u)),u.set(c.getKey(),c)}}let s=el(),l=a.getIterator();for(;l.hasNext()&&(l.getNext().value.forEach((c,u)=>s.set(c,u)),!(s.size()>=n)););return ee.resolve(s)}lt(e,r,o){let n=this.overlays.get(o.key);if(n!==null){let i=this.lr.get(n.largestBatchId).delete(o.key);this.lr.set(n.largestBatchId,i)}this.overlays=this.overlays.insert(o.key,new LE(r,o));let a=this.lr.get(r);a===void 0&&(a=tt(),this.lr.set(r,a)),this.lr.set(r,a.add(o.key))}};var pp=class{constructor(){this.hr=new po(br.Pr),this.Ir=new po(br.Tr)}isEmpty(){return this.hr.isEmpty()}addReference(e,r){let o=new br(e,r);this.hr=this.hr.add(o),this.Ir=this.Ir.add(o)}Er(e,r){e.forEach(o=>this.addReference(o,r))}removeReference(e,r){this.dr(new br(e,r))}Ar(e,r){e.forEach(o=>this.removeReference(o,r))}Rr(e){let r=new Ce(new qt([])),o=new br(r,e),n=new br(r,e+1),a=[];return this.Ir.forEachInRange([o,n],i=>{this.dr(i),a.push(i.key)}),a}Vr(){this.hr.forEach(e=>this.dr(e))}dr(e){this.hr=this.hr.delete(e),this.Ir=this.Ir.delete(e)}mr(e){let r=new Ce(new qt([])),o=new br(r,e),n=new br(r,e+1),a=tt();return this.Ir.forEachInRange([o,n],i=>{a=a.add(i.key)}),a}containsKey(e){let r=new br(e,0),o=this.hr.firstAfterOrEqual(r);return o!==null&&e.isEqual(o.key)}},br=class{constructor(e,r){this.key=e,this.gr=r}static Pr(e,r){return Ce.comparator(e.key,r.key)||_t(e.gr,r.gr)}static Tr(e,r){return _t(e.gr,r.gr)||Ce.comparator(e.key,r.key)}};var QE=class{constructor(e,r){this.indexManager=e,this.referenceDelegate=r,this.mutationQueue=[],this.pr=1,this.yr=new po(br.Pr)}checkEmpty(e){return ee.resolve(this.mutationQueue.length===0)}addMutationBatch(e,r,o,n){let a=this.pr;this.pr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let i=new NE(a,r,o,n);this.mutationQueue.push(i);for(let s of n)this.yr=this.yr.add(new br(s.key,a)),this.indexManager.addToCollectionParentIndex(e,s.key.path.popLast());return ee.resolve(i)}lookupMutationBatch(e,r){return ee.resolve(this.wr(r))}getNextMutationBatchAfterBatchId(e,r){let o=r+1,n=this.Sr(o),a=n<0?0:n;return ee.resolve(this.mutationQueue.length>a?this.mutationQueue[a]:null)}getHighestUnacknowledgedBatchId(){return ee.resolve(this.mutationQueue.length===0?-1:this.pr-1)}getAllMutationBatches(e){return ee.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,r){let o=new br(r,0),n=new br(r,Number.POSITIVE_INFINITY),a=[];return this.yr.forEachInRange([o,n],i=>{let s=this.wr(i.gr);a.push(s)}),ee.resolve(a)}getAllMutationBatchesAffectingDocumentKeys(e,r){let o=new po(_t);return r.forEach(n=>{let a=new br(n,0),i=new br(n,Number.POSITIVE_INFINITY);this.yr.forEachInRange([a,i],s=>{o=o.add(s.gr)})}),ee.resolve(this.br(o))}getAllMutationBatchesAffectingQuery(e,r){let o=r.path,n=o.length+1,a=o;Ce.isDocumentKey(a)||(a=a.child(""));let i=new br(new Ce(a),0),s=new po(_t);return this.yr.forEachWhile(l=>{let c=l.key.path;return!!o.isPrefixOf(c)&&(c.length===n&&(s=s.add(l.gr)),!0)},i),ee.resolve(this.br(s))}br(e){let r=[];return e.forEach(o=>{let n=this.wr(o);n!==null&&r.push(n)}),r}removeMutationBatch(e,r){Ct(this.Dr(r.batchId,"removed")===0),this.mutationQueue.shift();let o=this.yr;return ee.forEach(r.mutations,n=>{let a=new br(n.key,r.batchId);return o=o.delete(a),this.referenceDelegate.markPotentiallyOrphaned(e,n.key)}).next(()=>{this.yr=o})}Fn(e){}containsKey(e,r){let o=new br(r,0),n=this.yr.firstAfterOrEqual(o);return ee.resolve(r.isEqual(n&&n.key))}performConsistencyCheck(e){return this.mutationQueue.length,ee.resolve()}Dr(e,r){return this.Sr(e)}Sr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}wr(e){let r=this.Sr(e);return r<0||r>=this.mutationQueue.length?null:this.mutationQueue[r]}};var ZE=class{constructor(e){this.Cr=e,this.docs=function(){return new tr(Ce.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,r){let o=r.key,n=this.docs.get(o),a=n?n.size:0,i=this.Cr(r);return this.docs=this.docs.insert(o,{document:r.mutableCopy(),size:i}),this.size+=i-a,this.indexManager.addToCollectionParentIndex(e,o.path.popLast())}removeEntry(e){let r=this.docs.get(e);r&&(this.docs=this.docs.remove(e),this.size-=r.size)}getEntry(e,r){let o=this.docs.get(r);return ee.resolve(o?o.document.mutableCopy():on.newInvalidDocument(r))}getEntries(e,r){let o=Za();return r.forEach(n=>{let a=this.docs.get(n);o=o.insert(n,a?a.document.mutableCopy():on.newInvalidDocument(n))}),ee.resolve(o)}getDocumentsMatchingQuery(e,r,o,n){let a=Za(),i=r.path,s=new Ce(i.child("")),l=this.docs.getIteratorFrom(s);for(;l.hasNext();){let{key:c,value:{document:u}}=l.getNext();if(!i.isPrefixOf(c.path))break;c.path.length>i.length+1||ele(Jse(u),o)<=0||(n.has(u.key)||Wx(r,u))&&(a=a.insert(u.key,u.mutableCopy()))}return ee.resolve(a)}getAllFromCollectionGroup(e,r,o,n){De()}vr(e,r){return ee.forEach(this.docs,o=>r(o))}newChangeBuffer(e){return new JE(this)}getSize(e){return ee.resolve(this.size)}},JE=class extends GE{constructor(e){super(),this._r=e}applyChanges(e){let r=[];return this.changes.forEach((o,n)=>{n.isValidDocument()?r.push(this._r.addEntry(e,n)):this._r.removeEntry(o)}),ee.waitFor(r)}getFromCache(e,r){return this._r.getEntry(e,r)}getAllFromCache(e,r){return this._r.getEntries(e,r)}};var e1=class{constructor(e){this.persistence=e,this.Fr=new Ui(r=>W1(r),K1),this.lastRemoteSnapshotVersion=Le.min(),this.highestTargetId=0,this.Mr=0,this.Or=new pp,this.targetCount=0,this.Nr=fp.On()}forEachTarget(e,r){return this.Fr.forEach((o,n)=>r(n)),ee.resolve()}getLastRemoteSnapshotVersion(e){return ee.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ee.resolve(this.Mr)}allocateTargetId(e){return this.highestTargetId=this.Nr.next(),ee.resolve(this.highestTargetId)}setTargetsMetadata(e,r,o){return o&&(this.lastRemoteSnapshotVersion=o),r>this.Mr&&(this.Mr=r),ee.resolve()}kn(e){this.Fr.set(e.target,e);let r=e.targetId;r>this.highestTargetId&&(this.Nr=new fp(r),this.highestTargetId=r),e.sequenceNumber>this.Mr&&(this.Mr=e.sequenceNumber)}addTargetData(e,r){return this.kn(r),this.targetCount+=1,ee.resolve()}updateTargetData(e,r){return this.kn(r),ee.resolve()}removeTargetData(e,r){return this.Fr.delete(r.target),this.Or.Rr(r.targetId),this.targetCount-=1,ee.resolve()}removeTargets(e,r,o){let n=0,a=[];return this.Fr.forEach((i,s)=>{s.sequenceNumber<=r&&o.get(s.targetId)===null&&(this.Fr.delete(i),a.push(this.removeMatchingKeysForTargetId(e,s.targetId)),n++)}),ee.waitFor(a).next(()=>n)}getTargetCount(e){return ee.resolve(this.targetCount)}getTargetData(e,r){let o=this.Fr.get(r)||null;return ee.resolve(o)}addMatchingKeys(e,r,o){return this.Or.Er(r,o),ee.resolve()}removeMatchingKeys(e,r,o){this.Or.Ar(r,o);let n=this.persistence.referenceDelegate,a=[];return n&&r.forEach(i=>{a.push(n.markPotentiallyOrphaned(e,i))}),ee.waitFor(a)}removeMatchingKeysForTargetId(e,r){return this.Or.Rr(r),ee.resolve()}getMatchingKeysForTargetId(e,r){let o=this.Or.mr(r);return ee.resolve(o)}containsKey(e,r){return ee.resolve(this.Or.containsKey(r))}};var t1=class{constructor(e,r){this.Br={},this.overlays={},this.Lr=new ap(0),this.kr=!1,this.kr=!0,this.referenceDelegate=e(this),this.qr=new e1(this),this.indexManager=new jE,this.remoteDocumentCache=function(n){return new ZE(n)}(o=>this.referenceDelegate.Qr(o)),this.serializer=new $E(r),this.Kr=new XE(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.kr=!1,Promise.resolve()}get started(){return this.kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let r=this.overlays[e.toKey()];return r||(r=new YE,this.overlays[e.toKey()]=r),r}getMutationQueue(e,r){let o=this.Br[e.toKey()];return o||(o=new QE(r,this.referenceDelegate),this.Br[e.toKey()]=o),o}getTargetCache(){return this.qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Kr}runTransaction(e,r,o){ge("MemoryPersistence","Starting transaction:",e);let n=new r1(this.Lr.next());return this.referenceDelegate.$r(),o(n).next(a=>this.referenceDelegate.Ur(n).next(()=>a)).toPromise().then(a=>(n.raiseOnCommittedEvent(),a))}Wr(e,r){return ee.or(Object.values(this.Br).map(o=>()=>o.containsKey(e,r)))}},r1=class extends xE{constructor(e){super(),this.currentSequenceNumber=e}},o1=class t{constructor(e){this.persistence=e,this.Gr=new pp,this.zr=null}static jr(e){return new t(e)}get Hr(){if(this.zr)return this.zr;throw De()}addReference(e,r,o){return this.Gr.addReference(o,r),this.Hr.delete(o.toString()),ee.resolve()}removeReference(e,r,o){return this.Gr.removeReference(o,r),this.Hr.add(o.toString()),ee.resolve()}markPotentiallyOrphaned(e,r){return this.Hr.add(r.toString()),ee.resolve()}removeTarget(e,r){this.Gr.Rr(r.targetId).forEach(n=>this.Hr.add(n.toString()));let o=this.persistence.getTargetCache();return o.getMatchingKeysForTargetId(e,r.targetId).next(n=>{n.forEach(a=>this.Hr.add(a.toString()))}).next(()=>o.removeTargetData(e,r))}$r(){this.zr=new Set}Ur(e){let r=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ee.forEach(this.Hr,o=>{let n=Ce.fromPath(o);return this.Jr(e,n).next(a=>{a||r.removeEntry(n,Le.min())})}).next(()=>(this.zr=null,r.apply(e)))}updateLimboDocument(e,r){return this.Jr(e,r).next(o=>{o?this.Hr.delete(r.toString()):this.Hr.add(r.toString())})}Qr(e){return 0}Jr(e,r){return ee.or([()=>ee.resolve(this.Gr.containsKey(r)),()=>this.persistence.getTargetCache().containsKey(e,r),()=>this.persistence.Wr(e,r)])}};var n1=class t{constructor(e,r,o,n){this.targetId=e,this.fromCache=r,this.ki=o,this.qi=n}static Qi(e,r){let o=tt(),n=tt();for(let a of r.docChanges)switch(a.type){case 0:o=o.add(a.doc.key);break;case 1:n=n.add(a.doc.key)}return new t(e,r.fromCache,o,n)}};var a1=class{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}};var i1=class{constructor(){this.Ki=!1,this.$i=!1,this.Ui=100,this.Wi=8}initialize(e,r){this.Gi=e,this.indexManager=r,this.Ki=!0}getDocumentsMatchingQuery(e,r,o,n){let a={result:null};return this.zi(e,r).next(i=>{a.result=i}).next(()=>{if(!a.result)return this.ji(e,r,n,o).next(i=>{a.result=i})}).next(()=>{if(a.result)return;let i=new a1;return this.Hi(e,r,i).next(s=>{if(a.result=s,this.$i)return this.Ji(e,r,i,s.size)})}).next(()=>a.result)}Ji(e,r,o,n){return o.documentReadCount<this.Ui?(Qf()<=Qe.DEBUG&&ge("QueryEngine","SDK will not create cache indexes for query:",eu(r),"since it only creates cache indexes for collection contains","more than or equal to",this.Ui,"documents"),ee.resolve()):(Qf()<=Qe.DEBUG&&ge("QueryEngine","Query:",eu(r),"scans",o.documentReadCount,"local documents and returns",n,"documents as results."),o.documentReadCount>this.Wi*n?(Qf()<=Qe.DEBUG&&ge("QueryEngine","The SDK decides to create cache indexes for query:",eu(r),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Ia(r))):ee.resolve())}zi(e,r){if(i3(r))return ee.resolve(null);let o=Ia(r);return this.indexManager.getIndexType(e,o).next(n=>n===0?null:(r.limit!==null&&n===1&&(r=xx(r,null,"F"),o=Ia(r)),this.indexManager.getDocumentsMatchingTarget(e,o).next(a=>{let i=tt(...a);return this.Gi.getDocuments(e,i).next(s=>this.indexManager.getMinOffset(e,o).next(l=>{let c=this.Yi(r,s);return this.Zi(r,c,i,l.readTime)?this.zi(e,xx(r,null,"F")):this.Xi(e,c,r,l)}))})))}ji(e,r,o,n){return i3(r)||n.isEqual(Le.min())?ee.resolve(null):this.Gi.getDocuments(e,o).next(a=>{let i=this.Yi(r,a);return this.Zi(r,i,o,n)?ee.resolve(null):(Qf()<=Qe.DEBUG&&ge("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),eu(r)),this.Xi(e,i,r,Zse(n,-1)).next(s=>s))})}Yi(e,r){let o=new po(F3(e));return r.forEach((n,a)=>{Wx(e,a)&&(o=o.add(a))}),o}Zi(e,r,o,n){if(e.limit===null)return!1;if(o.size!==r.size)return!0;let a=e.limitType==="F"?r.last():r.first();return!!a&&(a.hasPendingWrites||a.version.compareTo(n)>0)}Hi(e,r,o){return Qf()<=Qe.DEBUG&&ge("QueryEngine","Using full collection scan to execute query:",eu(r)),this.Gi.getDocumentsMatchingQuery(e,r,ol.min(),o)}Xi(e,r,o,n){return this.Gi.getDocumentsMatchingQuery(e,o,n).next(a=>(r.forEach(i=>{a=a.insert(i.key,i)}),a))}};var s1=class{constructor(e,r,o,n){this.persistence=e,this.es=r,this.serializer=n,this.ts=new tr(_t),this.ns=new Ui(a=>W1(a),K1),this.rs=new Map,this.ss=e.getRemoteDocumentCache(),this.qr=e.getTargetCache(),this.Kr=e.getBundleCache(),this.os(o)}os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new KE(this.ss,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ss.setIndexManager(this.indexManager),this.es.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",r=>e.collect(r,this.ts))}};function $le(t,e,r,o){return new s1(t,e,r,o)}async function a9(t,e){let r=Ve(t);return await r.persistence.runTransaction("Handle user change","readonly",o=>{let n;return r.mutationQueue.getAllMutationBatches(o).next(a=>(n=a,r.os(e),r.mutationQueue.getAllMutationBatches(o))).next(a=>{let i=[],s=[],l=tt();for(let c of n){i.push(c.batchId);for(let u of c.mutations)l=l.add(u.key)}for(let c of a){s.push(c.batchId);for(let u of c.mutations)l=l.add(u.key)}return r.localDocuments.getDocuments(o,l).next(c=>({_s:c,removedBatchIds:i,addedBatchIds:s}))})})}function jle(t,e){let r=Ve(t);return r.persistence.runTransaction("Acknowledge batch","readwrite-primary",o=>{let n=e.batch.keys(),a=r.ss.newChangeBuffer({trackRemovals:!0});return function(s,l,c,u){let d=c.batch,p=d.keys(),m=ee.resolve();return p.forEach(h=>{m=m.next(()=>u.getEntry(l,h)).next(g=>{let _=c.docVersions.get(h);Ct(_!==null),g.version.compareTo(_)<0&&(d.applyToRemoteDocument(g,c),g.isValidDocument()&&(g.setReadTime(c.commitVersion),u.addEntry(g)))})}),m.next(()=>s.mutationQueue.removeMutationBatch(l,d))}(r,o,e,a).next(()=>a.apply(o)).next(()=>r.mutationQueue.performConsistencyCheck(o)).next(()=>r.documentOverlayCache.removeOverlaysForBatchId(o,n,e.batch.batchId)).next(()=>r.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(o,function(s){let l=tt();for(let c=0;c<s.mutationResults.length;++c)s.mutationResults[c].transformResults.length>0&&(l=l.add(s.batch.mutations[c].key));return l}(e))).next(()=>r.localDocuments.getDocuments(o,n))})}function i9(t){let e=Ve(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",r=>e.qr.getLastRemoteSnapshotVersion(r))}function qle(t,e){let r=Ve(t),o=e.snapshotVersion,n=r.ts;return r.persistence.runTransaction("Apply remote event","readwrite-primary",a=>{let i=r.ss.newChangeBuffer({trackRemovals:!0});n=r.ts;let s=[];e.targetChanges.forEach((u,d)=>{let p=n.get(d);if(!p)return;s.push(r.qr.removeMatchingKeys(a,u.removedDocuments,d).next(()=>r.qr.addMatchingKeys(a,u.addedDocuments,d)));let m=p.withSequenceNumber(a.currentSequenceNumber);e.targetMismatches.get(d)!==null?m=m.withResumeToken(Ro.EMPTY_BYTE_STRING,Le.min()).withLastLimboFreeSnapshotVersion(Le.min()):u.resumeToken.approximateByteSize()>0&&(m=m.withResumeToken(u.resumeToken,o)),n=n.insert(d,m),function(g,_,x){return g.resumeToken.approximateByteSize()===0||_.snapshotVersion.toMicroseconds()-g.snapshotVersion.toMicroseconds()>=3e8?!0:x.addedDocuments.size+x.modifiedDocuments.size+x.removedDocuments.size>0}(p,m,u)&&s.push(r.qr.updateTargetData(a,m))});let l=Za(),c=tt();if(e.documentUpdates.forEach(u=>{e.resolvedLimboDocuments.has(u)&&s.push(r.persistence.referenceDelegate.updateLimboDocument(a,u))}),s.push(Gle(a,i,e.documentUpdates).next(u=>{l=u.us,c=u.cs})),!o.isEqual(Le.min())){let u=r.qr.getLastRemoteSnapshotVersion(a).next(d=>r.qr.setTargetsMetadata(a,a.currentSequenceNumber,o));s.push(u)}return ee.waitFor(s).next(()=>i.apply(a)).next(()=>r.localDocuments.getLocalViewOfDocuments(a,l,c)).next(()=>l)}).then(a=>(r.ts=n,a))}function Gle(t,e,r){let o=tt(),n=tt();return r.forEach(a=>o=o.add(a)),e.getEntries(t,o).next(a=>{let i=Za();return r.forEach((s,l)=>{let c=a.get(s);l.isFoundDocument()!==c.isFoundDocument()&&(n=n.add(s)),l.isNoDocument()&&l.version.isEqual(Le.min())?(e.removeEntry(s,l.readTime),i=i.insert(s,l)):!c.isValidDocument()||l.version.compareTo(c.version)>0||l.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(l),i=i.insert(s,l)):ge("LocalStore","Ignoring outdated watch update for ",s,". Current version:",c.version," Watch version:",l.version)}),{us:i,cs:n}})}function Wle(t,e){let r=Ve(t);return r.persistence.runTransaction("Get next mutation batch","readonly",o=>(e===void 0&&(e=-1),r.mutationQueue.getNextMutationBatchAfterBatchId(o,e)))}function Kle(t,e){let r=Ve(t);return r.persistence.runTransaction("Allocate target","readwrite",o=>{let n;return r.qr.getTargetData(o,e).next(a=>a?(n=a,ee.resolve(n)):r.qr.allocateTargetId(o).next(i=>(n=new dp(e,i,"TargetPurposeListen",o.currentSequenceNumber),r.qr.addTargetData(o,n).next(()=>n))))}).then(o=>{let n=r.ts.get(o.targetId);return(n===null||o.snapshotVersion.compareTo(n.snapshotVersion)>0)&&(r.ts=r.ts.insert(o.targetId,o),r.ns.set(e,o.targetId)),o})}async function l1(t,e,r){let o=Ve(t),n=o.ts.get(e),a=r?"readwrite":"readwrite-primary";try{r||await o.persistence.runTransaction("Release target",a,i=>o.persistence.referenceDelegate.removeTarget(i,n))}catch(i){if(!Ep(i))throw i;ge("LocalStore",`Failed to update sequence numbers for target ${e}: ${i}`)}o.ts=o.ts.remove(e),o.ns.delete(n.target)}function _3(t,e,r){let o=Ve(t),n=Le.min(),a=tt();return o.persistence.runTransaction("Execute query","readwrite",i=>function(l,c,u){let d=Ve(l),p=d.ns.get(u);return p!==void 0?ee.resolve(d.ts.get(p)):d.qr.getTargetData(c,u)}(o,i,Ia(e)).next(s=>{if(s)return n=s.lastLimboFreeSnapshotVersion,o.qr.getMatchingKeysForTargetId(i,s.targetId).next(l=>{a=l})}).next(()=>o.es.getDocumentsMatchingQuery(i,e,r?n:Le.min(),r?a:tt())).next(s=>(Xle(o,dle(e),s),{documents:s,ls:a})))}function Xle(t,e,r){let o=t.rs.get(e)||Le.min();r.forEach((n,a)=>{a.readTime.compareTo(o)>0&&(o=a.readTime)}),t.rs.set(e,o)}var Tx=class{constructor(){this.activeTargetIds=_le()}ds(e){this.activeTargetIds=this.activeTargetIds.add(e)}As(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Es(){let e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}};var c1=class{constructor(){this.eo=new Tx,this.no={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,r,o){}addLocalQueryTarget(e){return this.eo.ds(e),this.no[e]||"not-current"}updateQueryState(e,r,o){this.no[e]=r}removeLocalQueryTarget(e){this.eo.As(e)}isLocalQueryTarget(e){return this.eo.activeTargetIds.has(e)}clearQueryState(e){delete this.no[e]}getAllActiveQueryTargets(){return this.eo.activeTargetIds}isActiveQueryTarget(e){return this.eo.activeTargetIds.has(e)}start(){return this.eo=new Tx,Promise.resolve()}handleUserChange(e,r,o){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}};var u1=class{ro(e){}shutdown(){}};var Px=class{constructor(){this.io=()=>this.so(),this.oo=()=>this._o(),this.ao=[],this.uo()}ro(e){this.ao.push(e)}shutdown(){window.removeEventListener("online",this.io),window.removeEventListener("offline",this.oo)}uo(){window.addEventListener("online",this.io),window.addEventListener("offline",this.oo)}so(){ge("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(let e of this.ao)e(0)}_o(){ge("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(let e of this.ao)e(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}};var cx=null;function sE(){return cx===null?cx=function(){return 268435456+Math.round(2147483648*Math.random())}():cx++,"0x"+cx.toString(16)}var Yle={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};var d1=class{constructor(e){this.co=e.co,this.lo=e.lo}ho(e){this.Po=e}Io(e){this.To=e}onMessage(e){this.Eo=e}close(){this.lo()}send(e){this.co(e)}Ao(){this.Po()}Ro(e){this.To(e)}Vo(e){this.Eo(e)}};var uo="WebChannelConnection",f1=class extends class{constructor(r){this.databaseInfo=r,this.databaseId=r.databaseId;let o=r.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),a=encodeURIComponent(this.databaseId.database);this.mo=o+"://"+r.host,this.fo=`projects/${n}/databases/${a}`,this.po=this.databaseId.database==="(default)"?`project_id=${n}`:`project_id=${n}&database_id=${a}`}get yo(){return!1}wo(r,o,n,a,i){let s=sE(),l=this.So(r,o);ge("RestConnection",`Sending RPC '${r}' ${s}:`,l,n);let c={"google-cloud-resource-prefix":this.fo,"x-goog-request-params":this.po};return this.bo(c,a,i),this.Do(r,l,c,n).then(u=>(ge("RestConnection",`Received RPC '${r}' ${s}: `,u),u),u=>{throw np("RestConnection",`RPC '${r}' ${s} failed with error: `,u,"url: ",l,"request:",n),u})}Co(r,o,n,a,i,s){return this.wo(r,o,n,a,i)}bo(r,o,n){r["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+_u}(),r["Content-Type"]="text/plain",this.databaseInfo.appId&&(r["X-Firebase-GMPID"]=this.databaseInfo.appId),o&&o.headers.forEach((a,i)=>r[i]=a),n&&n.headers.forEach((a,i)=>r[i]=a)}So(r,o){let n=Yle[r];return`${this.mo}/v1/${o}:${n}`}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Do(e,r,o,n){let a=sE();return new Promise((i,s)=>{let l=new X6;l.setWithCredentials(!0),l.listenOnce(G6.COMPLETE,()=>{try{switch(l.getLastErrorCode()){case sx.NO_ERROR:let u=l.getResponseJson();ge(uo,`XHR for RPC '${e}' ${a} received:`,JSON.stringify(u)),i(u);break;case sx.TIMEOUT:ge(uo,`RPC '${e}' ${a} timed out`),s(new re(j.DEADLINE_EXCEEDED,"Request time out"));break;case sx.HTTP_ERROR:let d=l.getStatus();if(ge(uo,`RPC '${e}' ${a} failed with status:`,d,"response text:",l.getResponseText()),d>0){let p=l.getResponseJson();Array.isArray(p)&&(p=p[0]);let m=p?.error;if(m&&m.status&&m.message){let h=function(_){let x=_.toLowerCase().replace(/_/g,"-");return Object.values(j).indexOf(x)>=0?x:j.UNKNOWN}(m.status);s(new re(h,m.message))}else s(new re(j.UNKNOWN,"Server responded with status "+l.getStatus()))}else s(new re(j.UNAVAILABLE,"Connection failed."));break;default:De()}}finally{ge(uo,`RPC '${e}' ${a} completed.`)}});let c=JSON.stringify(n);ge(uo,`RPC '${e}' ${a} sending request:`,n),l.send(r,"POST",c,o,15)})}vo(e,r,o){let n=sE(),a=[this.mo,"/","google.firestore.v1.Firestore","/",e,"/channel"],i=j6(),s=q6(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(l.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(l.xmlHttpFactory=new K6({})),this.bo(l.initMessageHeaders,r,o),l.encodeInitMessageHeaders=!0;let u=a.join("");ge(uo,`Creating RPC '${e}' stream ${n}: ${u}`,l);let d=i.createWebChannel(u,l),p=!1,m=!1,h=new d1({co:_=>{m?ge(uo,`Not sending because RPC '${e}' stream ${n} is closed:`,_):(p||(ge(uo,`Opening RPC '${e}' stream ${n} transport.`),d.open(),p=!0),ge(uo,`RPC '${e}' stream ${n} sending:`,_),d.send(_))},lo:()=>d.close()}),g=(_,x,b)=>{_.listen(x,y=>{try{b(y)}catch(I){setTimeout(()=>{throw I},0)}})};return g(d,Yf.EventType.OPEN,()=>{m||ge(uo,`RPC '${e}' stream ${n} transport opened.`)}),g(d,Yf.EventType.CLOSE,()=>{m||(m=!0,ge(uo,`RPC '${e}' stream ${n} transport closed`),h.Ro())}),g(d,Yf.EventType.ERROR,_=>{m||(m=!0,np(uo,`RPC '${e}' stream ${n} transport errored:`,_),h.Ro(new re(j.UNAVAILABLE,"The operation could not be completed")))}),g(d,Yf.EventType.MESSAGE,_=>{var x;if(!m){let b=_.data[0];Ct(!!b);let y=b,I=y.error||((x=y[0])===null||x===void 0?void 0:x.error);if(I){ge(uo,`RPC '${e}' stream ${n} received error:`,I);let w=I.status,v=function(S){let C=xr[S];if(C!==void 0)return Q3(C)}(w),T=I.message;v===void 0&&(v=j.INTERNAL,T="Unknown error status: "+w+" with message "+I.message),m=!0,h.Ro(new re(v,T)),d.close()}else ge(uo,`RPC '${e}' stream ${n} received:`,b),h.Vo(b)}}),g(s,W6.STAT_EVENT,_=>{_.stat===iE.PROXY?ge(uo,`RPC '${e}' stream ${n} detected buffering proxy`):_.stat===iE.NOPROXY&&ge(uo,`RPC '${e}' stream ${n} detected no buffering proxy`)}),setTimeout(()=>{h.Ao()},0),h}};function lE(){return typeof document<"u"?document:null}function Kx(t){return new UE(t,!0)}var mp=class{constructor(e,r,o=1e3,n=1.5,a=6e4){this.si=e,this.timerId=r,this.Fo=o,this.Mo=n,this.xo=a,this.Oo=0,this.No=null,this.Bo=Date.now(),this.reset()}reset(){this.Oo=0}Lo(){this.Oo=this.xo}ko(e){this.cancel();let r=Math.floor(this.Oo+this.qo()),o=Math.max(0,Date.now()-this.Bo),n=Math.max(0,r-o);n>0&&ge("ExponentialBackoff",`Backing off for ${n} ms (base delay: ${this.Oo} ms, delay with jitter: ${r} ms, last attempt: ${o} ms ago)`),this.No=this.si.enqueueAfterDelay(this.timerId,n,()=>(this.Bo=Date.now(),e())),this.Oo*=this.Mo,this.Oo<this.Fo&&(this.Oo=this.Fo),this.Oo>this.xo&&(this.Oo=this.xo)}Qo(){this.No!==null&&(this.No.skipDelay(),this.No=null)}cancel(){this.No!==null&&(this.No.cancel(),this.No=null)}qo(){return(Math.random()-.5)*this.Oo}};var Ox=class{constructor(e,r,o,n,a,i,s,l){this.si=e,this.Ko=o,this.$o=n,this.connection=a,this.authCredentialsProvider=i,this.appCheckCredentialsProvider=s,this.listener=l,this.state=0,this.Uo=0,this.Wo=null,this.Go=null,this.stream=null,this.zo=new mp(e,r)}jo(){return this.state===1||this.state===5||this.Ho()}Ho(){return this.state===2||this.state===3}start(){this.state!==4?this.auth():this.Jo()}async stop(){this.jo()&&await this.close(0)}Yo(){this.state=0,this.zo.reset()}Zo(){this.Ho()&&this.Wo===null&&(this.Wo=this.si.enqueueAfterDelay(this.Ko,6e4,()=>this.Xo()))}e_(e){this.t_(),this.stream.send(e)}async Xo(){if(this.Ho())return this.close(0)}t_(){this.Wo&&(this.Wo.cancel(),this.Wo=null)}n_(){this.Go&&(this.Go.cancel(),this.Go=null)}async close(e,r){this.t_(),this.n_(),this.zo.cancel(),this.Uo++,e!==4?this.zo.reset():r&&r.code===j.RESOURCE_EXHAUSTED?(Qa(r.toString()),Qa("Using maximum backoff delay to prevent overloading the backend."),this.zo.Lo()):r&&r.code===j.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.r_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Io(r)}r_(){}auth(){this.state=1;let e=this.i_(this.Uo),r=this.Uo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([o,n])=>{this.Uo===r&&this.s_(o,n)},o=>{e(()=>{let n=new re(j.UNKNOWN,"Fetching auth token failed: "+o.message);return this.o_(n)})})}s_(e,r){let o=this.i_(this.Uo);this.stream=this.__(e,r),this.stream.ho(()=>{o(()=>(this.state=2,this.Go=this.si.enqueueAfterDelay(this.$o,1e4,()=>(this.Ho()&&(this.state=3),Promise.resolve())),this.listener.ho()))}),this.stream.Io(n=>{o(()=>this.o_(n))}),this.stream.onMessage(n=>{o(()=>this.onMessage(n))})}Jo(){this.state=5,this.zo.ko(async()=>{this.state=0,this.start()})}o_(e){return ge("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}i_(e){return r=>{this.si.enqueueAndForget(()=>this.Uo===e?r():(ge("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}},p1=class extends Ox{constructor(e,r,o,n,a,i){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",r,o,n,i),this.serializer=a}__(e,r){return this.connection.vo("Listen",e,r)}onMessage(e){this.zo.reset();let r=Dle(this.serializer,e),o=function(a){if(!("targetChange"in a))return Le.min();let i=a.targetChange;return i.targetIds&&i.targetIds.length?Le.min():i.readTime?rn(i.readTime):Le.min()}(e);return this.listener.a_(r,o)}u_(e){let r={};r.database=up(this.serializer),r.addTarget=function(a,i){let s,l=i.target;if(s=AE(l)?{documents:Nle(a,l)}:{query:Mle(a,l)},s.targetId=i.targetId,i.resumeToken.approximateByteSize()>0){s.resumeToken=Z3(a,i.resumeToken);let c=VE(a,i.expectedCount);c!==null&&(s.expectedCount=c)}else if(i.snapshotVersion.compareTo(Le.min())>0){s.readTime=Sx(a,i.snapshotVersion.toTimestamp());let c=VE(a,i.expectedCount);c!==null&&(s.expectedCount=c)}return s}(this.serializer,e);let o=Ble(this.serializer,e);o&&(r.labels=o),this.e_(r)}c_(e){let r={};r.database=up(this.serializer),r.removeTarget=e,this.e_(r)}},m1=class extends Ox{constructor(e,r,o,n,a,i){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",r,o,n,i),this.serializer=a,this.l_=!1}get h_(){return this.l_}start(){this.l_=!1,this.lastStreamToken=void 0,super.start()}r_(){this.l_&&this.P_([])}__(e,r){return this.connection.vo("Write",e,r)}onMessage(e){if(Ct(!!e.streamToken),this.lastStreamToken=e.streamToken,this.l_){this.zo.reset();let r=Rle(e.writeResults,e.commitTime),o=rn(e.commitTime);return this.listener.I_(o,r)}return Ct(!e.writeResults||e.writeResults.length===0),this.l_=!0,this.listener.T_()}E_(){let e={};e.database=up(this.serializer),this.e_(e)}P_(e){let r={streamToken:this.lastStreamToken,writes:e.map(o=>t9(this.serializer,o))};this.e_(r)}};var h1=class extends class{}{constructor(e,r,o,n){super(),this.authCredentials=e,this.appCheckCredentials=r,this.connection=o,this.serializer=n,this.d_=!1}A_(){if(this.d_)throw new re(j.FAILED_PRECONDITION,"The client has already been terminated.")}wo(e,r,o){return this.A_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([n,a])=>this.connection.wo(e,r,o,n,a)).catch(n=>{throw n.name==="FirebaseError"?(n.code===j.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),n):new re(j.UNKNOWN,n.toString())})}Co(e,r,o,n){return this.A_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([a,i])=>this.connection.Co(e,r,o,a,i,n)).catch(a=>{throw a.name==="FirebaseError"?(a.code===j.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),a):new re(j.UNKNOWN,a.toString())})}terminate(){this.d_=!0}};var g1=class{constructor(e,r){this.asyncQueue=e,this.onlineStateHandler=r,this.state="Unknown",this.V_=0,this.m_=null,this.f_=!0}g_(){this.V_===0&&(this.p_("Unknown"),this.m_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.m_=null,this.y_("Backend didn't respond within 10 seconds."),this.p_("Offline"),Promise.resolve())))}w_(e){this.state==="Online"?this.p_("Unknown"):(this.V_++,this.V_>=1&&(this.S_(),this.y_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.p_("Offline")))}set(e){this.S_(),this.V_=0,e==="Online"&&(this.f_=!1),this.p_(e)}p_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}y_(e){let r=`Could not reach Cloud Firestore backend. ${e}
|
|
22
22
|
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.f_?(Qa(r),this.f_=!1):ge("OnlineStateTracker",r)}S_(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}};var _1=class{constructor(e,r,o,n,a){this.localStore=e,this.datastore=r,this.asyncQueue=o,this.remoteSyncer={},this.b_=[],this.D_=new Map,this.C_=new Set,this.v_=[],this.F_=a,this.F_.ro(i=>{o.enqueueAndForget(async()=>{fl(this)&&(ge("RemoteStore","Restarting streams for network reachability change."),await async function(l){let c=Ve(l);c.C_.add(4),await Cp(c),c.M_.set("Unknown"),c.C_.delete(4),await Xx(c)}(this))})}),this.M_=new g1(o,n)}};async function Xx(t){if(fl(t))for(let e of t.v_)await e(!0)}async function Cp(t){for(let e of t.v_)await e(!1)}function s9(t,e){let r=Ve(t);r.D_.has(e.targetId)||(r.D_.set(e.targetId,e),Z1(r)?Q1(r):xu(r).Ho()&&Y1(r,e))}function l9(t,e){let r=Ve(t),o=xu(r);r.D_.delete(e),o.Ho()&&c9(r,e),r.D_.size===0&&(o.Ho()?o.Zo():fl(r)&&r.M_.set("Unknown"))}function Y1(t,e){if(t.x_.Oe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(Le.min())>0){let r=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(r)}xu(t).u_(e)}function c9(t,e){t.x_.Oe(e),xu(t).c_(e)}function Q1(t){t.x_=new zE({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),_t:e=>t.D_.get(e)||null,nt:()=>t.datastore.serializer.databaseId}),xu(t).start(),t.M_.g_()}function Z1(t){return fl(t)&&!xu(t).jo()&&t.D_.size>0}function fl(t){return Ve(t).C_.size===0}function u9(t){t.x_=void 0}async function Qle(t){t.D_.forEach((e,r)=>{Y1(t,e)})}async function Zle(t,e){u9(t),Z1(t)?(t.M_.w_(e),Q1(t)):t.M_.set("Unknown")}async function Jle(t,e,r){if(t.M_.set("Online"),e instanceof wx&&e.state===2&&e.cause)try{await async function(n,a){let i=a.cause;for(let s of a.targetIds)n.D_.has(s)&&(await n.remoteSyncer.rejectListen(s,i),n.D_.delete(s),n.x_.removeTarget(s))}(t,e)}catch(o){ge("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),o),await Ax(t,o)}else if(e instanceof nu?t.x_.$e(e):e instanceof Ix?t.x_.Je(e):t.x_.Ge(e),!r.isEqual(Le.min()))try{let o=await i9(t.localStore);r.compareTo(o)>=0&&await function(a,i){let s=a.x_.it(i);return s.targetChanges.forEach((l,c)=>{if(l.resumeToken.approximateByteSize()>0){let u=a.D_.get(c);u&&a.D_.set(c,u.withResumeToken(l.resumeToken,i))}}),s.targetMismatches.forEach((l,c)=>{let u=a.D_.get(l);if(!u)return;a.D_.set(l,u.withResumeToken(Ro.EMPTY_BYTE_STRING,u.snapshotVersion)),c9(a,l);let d=new dp(u.target,l,c,u.sequenceNumber);Y1(a,d)}),a.remoteSyncer.applyRemoteEvent(s)}(t,r)}catch(o){ge("RemoteStore","Failed to raise snapshot:",o),await Ax(t,o)}}async function Ax(t,e,r){if(!Ep(e))throw e;t.C_.add(1),await Cp(t),t.M_.set("Offline"),r||(r=()=>i9(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{ge("RemoteStore","Retrying IndexedDB access"),await r(),t.C_.delete(1),await Xx(t)})}function d9(t,e){return e().catch(r=>Ax(t,r,e))}async function Yx(t){let e=Ve(t),r=Hi(e),o=e.b_.length>0?e.b_[e.b_.length-1].batchId:-1;for(;ece(e);)try{let n=await Wle(e.localStore,o);if(n===null){e.b_.length===0&&r.Zo();break}o=n.batchId,tce(e,n)}catch(n){await Ax(e,n)}f9(e)&&p9(e)}function ece(t){return fl(t)&&t.b_.length<10}function tce(t,e){t.b_.push(e);let r=Hi(t);r.Ho()&&r.h_&&r.P_(e.mutations)}function f9(t){return fl(t)&&!Hi(t).jo()&&t.b_.length>0}function p9(t){Hi(t).start()}async function rce(t){Hi(t).E_()}async function oce(t){let e=Hi(t);for(let r of t.b_)e.P_(r.mutations)}async function nce(t,e,r){let o=t.b_.shift(),n=ME.from(o,e,r);await d9(t,()=>t.remoteSyncer.applySuccessfulWrite(n)),await Yx(t)}async function ace(t,e){e&&Hi(t).h_&&await async function(o,n){if(function(i){return Y3(i)&&i!==j.ABORTED}(n.code)){let a=o.b_.shift();Hi(o).Yo(),await d9(o,()=>o.remoteSyncer.rejectFailedWrite(a.batchId,n)),await Yx(o)}}(t,e),f9(t)&&p9(t)}async function x3(t,e){let r=Ve(t);r.asyncQueue.verifyOperationInProgress(),ge("RemoteStore","RemoteStore received new credentials");let o=fl(r);r.C_.add(3),await Cp(r),o&&r.M_.set("Unknown"),await r.remoteSyncer.handleCredentialChange(e),r.C_.delete(3),await Xx(r)}async function ice(t,e){let r=Ve(t);e?(r.C_.delete(2),await Xx(r)):e||(r.C_.add(2),await Cp(r),r.M_.set("Unknown"))}function xu(t){return t.O_||(t.O_=function(r,o,n){let a=Ve(r);return a.A_(),new p1(o,a.connection,a.authCredentials,a.appCheckCredentials,a.serializer,n)}(t.datastore,t.asyncQueue,{ho:Qle.bind(null,t),Io:Zle.bind(null,t),a_:Jle.bind(null,t)}),t.v_.push(async e=>{e?(t.O_.Yo(),Z1(t)?Q1(t):t.M_.set("Unknown")):(await t.O_.stop(),u9(t))})),t.O_}function Hi(t){return t.N_||(t.N_=function(r,o,n){let a=Ve(r);return a.A_(),new m1(o,a.connection,a.authCredentials,a.appCheckCredentials,a.serializer,n)}(t.datastore,t.asyncQueue,{ho:rce.bind(null,t),Io:ace.bind(null,t),T_:oce.bind(null,t),I_:nce.bind(null,t)}),t.v_.push(async e=>{e?(t.N_.Yo(),await Yx(t)):(await t.N_.stop(),t.b_.length>0&&(ge("RemoteStore",`Stopping write stream with ${t.b_.length} pending writes`),t.b_=[]))})),t.N_}var x1=class t{constructor(e,r,o,n,a){this.asyncQueue=e,this.timerId=r,this.targetTimeMs=o,this.op=n,this.removalCallback=a,this.deferred=new An,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(i=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,r,o,n,a){let i=Date.now()+o,s=new t(e,r,i,n,a);return s.start(o),s}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new re(j.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}};function J1(t,e){if(Qa("AsyncQueue",`${e}: ${t}`),Ep(t))return new re(j.UNAVAILABLE,`${e}: ${t}`);throw t}var Dx=class t{constructor(e){this.comparator=e?(r,o)=>e(r,o)||Ce.comparator(r.key,o.key):(r,o)=>Ce.comparator(r.key,o.key),this.keyedMap=Zf(),this.sortedSet=new tr(this.comparator)}static emptySet(e){return new t(e.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){let r=this.keyedMap.get(e);return r?this.sortedSet.indexOf(r):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((r,o)=>(e(r),!1))}add(e){let r=this.delete(e.key);return r.copy(r.keyedMap.insert(e.key,e),r.sortedSet.insert(e,null))}delete(e){let r=this.get(e);return r?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(r)):this}isEqual(e){if(!(e instanceof t)||this.size!==e.size)return!1;let r=this.sortedSet.getIterator(),o=e.sortedSet.getIterator();for(;r.hasNext();){let n=r.getNext().key,a=o.getNext().key;if(!n.isEqual(a))return!1}return!0}toString(){let e=[];return this.forEach(r=>{e.push(r.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
|
|
23
23
|
`+e.join(`
|
|
24
24
|
`)+`
|
|
@@ -32,9 +32,9 @@ Content-Type: application/json; charset=utf-8\r
|
|
|
32
32
|
Content-Type: `+c.contentType+`\r
|
|
33
33
|
\r
|
|
34
34
|
`,p=`\r
|
|
35
|
-
--`+l+"--",m=ab.getBlob(d,o,p);if(m===null)throw Wce();let h={name:c.fullPath},g=H9(a,t.host,t._protocol),_="POST",x=t.maxUploadRetryTime,b=new ib(g,_,K9(t,r),x);return b.urlParams=h,b.headers=i,b.body=m.uploadData(),b.errorHandler=X9(e),b}var zVe=256*1024;var N9=null,hS=class{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=pl.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=pl.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=pl.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,r,o,n){if(this.sent_)throw Op("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(r,e,!0),n!==void 0)for(let a in n)n.hasOwnProperty(a)&&this.xhr_.setRequestHeader(a,n[a].toString());return o!==void 0?this.xhr_.send(o):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw Op("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw Op("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw Op("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw Op("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}},gS=class extends hS{initXhr(){this.xhr_.responseType="text"}};function Y9(){return N9?N9():new gS}var wu=class t{constructor(e,r){this._service=e,r instanceof Zn?this._location=r:this._location=Zn.makeFromUrl(r,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,r){return new t(e,r)}get root(){let e=new Zn(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return q9(this._location.path)}get storage(){return this._service}get parent(){let e=_ue(this._location.path);if(e===null)return null;let r=new Zn(this._location.bucket,e);return new t(this._service,r)}_throwIfRoot(e){if(this._location.path==="")throw Xce(e)}};function Oue(t,e,r){t._throwIfRoot("uploadBytes");let o=Pue(t.storage,t._location,G9(),new ab(e,!0),r);return t.storage.makeRequestWithTokens(o,Y9).then(n=>({metadata:n,ref:t}))}function Aue(t,e){t._throwIfRoot("updateMetadata");let r=Cue(t.storage,t._location,e,G9());return t.storage.makeRequestWithTokens(r,Y9)}function Due(t,e){let r=xue(t._location.path,e),o=new Zn(t._location.bucket,r);return new wu(t.storage,o)}function Rue(t){return/^[A-Za-z]+:\/\//.test(t)}function Nue(t,e){return new wu(t,e)}function Q9(t,e){if(t instanceof Rp){let r=t;if(r._bucket==null)throw Gce();let o=new wu(r,r._bucket);return e!=null?Q9(o,e):o}else return e!==void 0?Due(t,e):t}function Mue(t,e){if(e&&Rue(e)){if(t instanceof Rp)return Nue(t,e);throw fS("To use ref(service, url), the first argument must be a Storage instance.")}else return Q9(t,e)}function M9(t,e){let r=e?.[z9];return r==null?null:Zn.makeFromBucketSpec(r,t)}function Lue(t,e,r,o={}){t.host=`${e}:${r}`,t._protocol="http";let{mockUserToken:n}=o;n&&(t._overrideAuthToken=typeof n=="string"?n:kw(n,t.app.options.projectId))}var Rp=class{constructor(e,r,o,n,a){this.app=e,this._authProvider=r,this._appCheckProvider=o,this._url=n,this._firebaseVersion=a,this._bucket=null,this._host=F9,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=Mce,this._maxUploadRetryTime=Lce,this._requests=new Set,n!=null?this._bucket=Zn.makeFromBucketSpec(n,this._host):this._bucket=M9(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=Zn.makeFromBucketSpec(this._url,e):this._bucket=M9(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){R9("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){R9("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;let e=this._authProvider.getImmediate({optional:!0});if(e){let r=await e.getToken();if(r!==null)return r.accessToken}return null}async _getAppCheckToken(){let e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new wu(this,e)}_makeRequest(e,r,o,n,a=!0){if(this._deleted)return new pS(U9());{let i=iue(e,this._appId,o,n,r,this._firebaseVersion,a);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(e,r){let[o,n]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,r,o,n).getPromise()}},L9="@firebase/storage",B9="0.11.2";var Z9="storage";function J9(t,e,r){return t=kt(t),Oue(t,e,r)}function ez(t,e){return t=kt(t),Aue(t,e)}function tz(t,e){return t=kt(t),Mue(t,e)}function rz(t=pf(),e){t=kt(t);let o=Hs(t,Z9).getImmediate({identifier:e}),n=Ew("storage");return n&&Bue(o,...n),o}function Bue(t,e,r,o={}){Lue(t,e,r,o)}function Fue(t,{instanceIdentifier:e}){let r=t.getProvider("app").getImmediate(),o=t.getProvider("auth-internal"),n=t.getProvider("app-check-internal");return new Rp(r,o,n,e,pa)}function zue(){fa(new $o(Z9,Fue,"PUBLIC").setMultipleInstances(!0)),jo(L9,B9,""),jo(L9,B9,"esm2017")}zue();var Uue={};function sb(t,e){for(var r in e)t[r]=e[r];return t}function Vue(t,e,r){var o,n=/(?:\?([^#]*))?(#.*)?$/,a=t.match(n),i={};if(a&&a[1])for(var s=a[1].split("&"),l=0;l<s.length;l++){var c=s[l].split("=");i[decodeURIComponent(c[0])]=decodeURIComponent(c.slice(1).join("="))}t=bS(t.replace(n,"")),e=bS(e||"");for(var u=Math.max(t.length,e.length),d=0;d<u;d++)if(e[d]&&e[d].charAt(0)===":"){var p=e[d].replace(/(^:|[+*?]+$)/g,""),m=(e[d].match(/[+*?]+$/)||Uue)[0]||"",h=~m.indexOf("+"),g=~m.indexOf("*"),_=t[d]||"";if(!_&&!g&&(m.indexOf("?")<0||h)){o=!1;break}if(i[p]=decodeURIComponent(_),h||g){i[p]=t.slice(d).map(decodeURIComponent).join("/");break}}else if(e[d]!==t[d]){o=!1;break}return(r.default===!0||o!==!1)&&i}function Hue(t,e){return t.rank<e.rank?1:t.rank>e.rank?-1:t.index-e.index}function $ue(t,e){return t.index=e,t.rank=function(r){return r.props.default?0:bS(r.props.path).map(jue).join("")}(t),t.props}function bS(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function jue(t){return t.charAt(0)==":"?1+"*+?".indexOf(t.charAt(t.length-1))||4:5}var que={},ml=[],Np=[],ln=null,yS={url:vS()},nz=Rt(yS);function az(){var t=Mt(nz);if(t===yS){var e=P()[1];L(function(){return Np.push(e),function(){return Np.splice(Np.indexOf(e),1)}},[])}return[t,ur]}function vS(){var t;return""+((t=ln&&ln.location?ln.location:ln&&ln.getCurrentLocation?ln.getCurrentLocation():typeof location<"u"?location:que).pathname||"")+(t.search||"")}function ur(t,e){return e===void 0&&(e=!1),typeof t!="string"&&t.url&&(e=t.replace,t=t.url),function(r){for(var o=ml.length;o--;)if(ml[o].canRoute(r))return!0;return!1}(t)&&function(r,o){o===void 0&&(o="push"),ln&&ln[o]?ln[o](r):typeof history<"u"&&history[o+"State"]&&history[o+"State"](null,null,r)}(t,e?"replace":"push"),iz(t)}function iz(t){for(var e=!1,r=0;r<ml.length;r++)ml[r].routeTo(t)&&(e=!0);return e}function Gue(t){if(t&&t.getAttribute){var e=t.getAttribute("href"),r=t.getAttribute("target");if(e&&e.match(/^\//g)&&(!r||r.match(/^_?self$/i)))return ur(e)}}function Wue(t){return t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault(),!1}function Kue(t){if(!(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button)){var e=t.target;do if(e.localName==="a"&&e.getAttribute("href")){if(e.hasAttribute("data-native")||e.hasAttribute("native"))return;if(Gue(e))return Wue(t)}while(e=e.parentNode)}}var oz=!1;function IS(t){t.history&&(ln=t.history),this.state={url:t.url||vS()}}sb(IS.prototype=new Vo,{shouldComponentUpdate:function(t){return t.static!==!0||t.url!==this.props.url||t.onChange!==this.props.onChange},canRoute:function(t){var e=yo(this.props.children);return this.g(e,t)!==void 0},routeTo:function(t){this.setState({url:t});var e=this.canRoute(t);return this.p||this.forceUpdate(),e},componentWillMount:function(){this.p=!0},componentDidMount:function(){var t=this;oz||(oz=!0,ln||addEventListener("popstate",function(){iz(vS())}),addEventListener("click",Kue)),ml.push(this),ln&&(this.u=ln.listen(function(e){var r=e.location||e;t.routeTo(""+(r.pathname||"")+(r.search||""))})),this.p=!1},componentWillUnmount:function(){typeof this.u=="function"&&this.u(),ml.splice(ml.indexOf(this),1)},componentWillUpdate:function(){this.p=!0},componentDidUpdate:function(){this.p=!1},g:function(t,e){t=t.filter($ue).sort(Hue);for(var r=0;r<t.length;r++){var o=t[r],n=Vue(e,o.props.path,o.props);if(n)return[o,n]}},render:function(t,e){var r,o,n=t.onChange,a=e.url,i=this.c,s=this.g(yo(t.children),a);if(s&&(o=Mm(s[0],sb(sb({url:a,matches:r=s[1]},r),{key:void 0,ref:void 0}))),a!==(i&&i.url)){sb(yS,i=this.c={url:a,previous:i&&i.url,current:o,path:o?o.props.path:null,matches:r}),i.router=this,i.active=o?[o]:[];for(var l=Np.length;l--;)Np[l]({});typeof n=="function"&&n(i)}return Q(nz.Provider,{value:i},o)}});var Gt=function(t){return Q(t.component,t)};var Xue=/^[a-z0-9_]+(?:--?[a-z0-9_]+)*$/;function Ca(t,e){e||(e=Xue);let r=typeof e=="string"?new RegExp(e):e;return!!(t&&r.test(t))}function $i(t){return t.replace(/^[\s/]*/g,"").replace(/[\s/]*$/g,"").replace(/^\/+|\/+$/g,"").replaceAll("/","--")}function xt(){let t=Lt();return{overlayColor:t.colorScheme==="dark"?t.colors.dark[9]:t.colors.gray[2],overlayOpacity:.55,overlayBlur:3}}var Tr={year:31536e6,month:2628e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3};function Rn(t,e){let r=Math.abs(t-new Date().getTime());if(r<Tr.second)return"just now";let o=e||{numeric:"auto"},n=new Intl.RelativeTimeFormat("en",o);return r<Tr.minute?n.format(Math.round(-r/Tr.second),"second"):r<Tr.hour?n.format(Math.round(-r/Tr.minute),"minute"):r<Tr.day?n.format(Math.round(-r/Tr.hour),"hour"):r<Tr.week?n.format(Math.round(-r/Tr.day),"day"):new Date(t).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric"})}function Mp(){return Math.floor(new Date().getTime())}function lb(t){return new Date(t.toMillis()).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Eu(){let t=s=>s<10?"0"+s:s,e=new Date,r=e.getFullYear(),o=t(e.getMonth()+1),n=t(e.getDate()),a=t(e.getHours()),i=t(e.getMinutes());return`${r}-${o}-${n}T${a}:${i}`}var sz={};async function Je(t,e){let r=e?.throttle||0,o=e?.throttleId?`${t}::${e.throttleId}`:t;if(Yue(o,r))return;let n=await fetch("/cms/api/actions.log",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:t,metadata:e?.metadata||{}})});if(n.status!==200){let a=await n.text();console.error(`failed to log action "${t}":`,a);return}sz[o]=Mp()}async function lz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=nn(r,"Projects",e,"ActionLogs"),n=t?.limit||40,a=Math.ceil(n*1.5),i=to(o,Qn("timestamp","desc"),k9(a)),s=await an(i),l=[];function c(d){if(l.length===0)return!1;let p=l.at(-1);return d.action==="doc.save"&&p.action==="doc.save"&&d.by===p.by&&d.metadata.docId===p.metadata.docId&&d.timestamp.toMillis()-p.timestamp.toMillis()<60*Tr.minute}let u=0;for(let d of s.docs){if(u>=n)break;let p=d.data();c(p)||(l.push(p),u+=1)}return l}function Yue(t,e){if(e===0)return!1;let r=sz[t];return r?Mp()-r<e:!1}var wS=new Map;function Que(t){return wS.get(t)||null}async function cb(t){let e=Que(t);if(e)return e;let r=Nn(t),n=(await vr(r)).data();return Lp(t,n),n}function Lp(t,e){wS.set(t,e)}function ES(t){wS.delete(t)}function cz(t){for(let e of t)ES(e)}function SS(){let t=window.__ROOT_CTX.rootConfig.projectId,e=window.firebase.db;return nn(e,"Projects",t,"Translations")}async function ji(t){let e=SS(),r=t?.tags?to(e,eb("tags","array-contains-any",t.tags)):to(e),o=await an(r),n={};return o.forEach(a=>{let i=a.id;n[i]=a.data()}),n}async function uz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,"Translations",t);return(await vr(o)).data()}async function dz(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,"Translations",t),a={};for(let i in e){let s=ede(i);s&&(a[s]=e[i])}console.log("updating translations: ",a),await rr(n,a),Je("translations.save",{metadata:{hash:t},throttle:5*Tr.minute,throttleId:t})}async function ub(t){return Zue(ei(t))}async function Zue(t){let r=new TextEncoder().encode(t),o=await crypto.subtle.digest("SHA-1",r);return Array.from(new Uint8Array(o)).map(i=>i.toString(16).padStart(2,"0")).join("")}function ei(t){return String(t).trim().split(`
|
|
35
|
+
--`+l+"--",m=ab.getBlob(d,o,p);if(m===null)throw Wce();let h={name:c.fullPath},g=H9(a,t.host,t._protocol),_="POST",x=t.maxUploadRetryTime,b=new ib(g,_,K9(t,r),x);return b.urlParams=h,b.headers=i,b.body=m.uploadData(),b.errorHandler=X9(e),b}var z7e=256*1024;var N9=null,hS=class{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=pl.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=pl.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=pl.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,r,o,n){if(this.sent_)throw Op("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(r,e,!0),n!==void 0)for(let a in n)n.hasOwnProperty(a)&&this.xhr_.setRequestHeader(a,n[a].toString());return o!==void 0?this.xhr_.send(o):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw Op("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw Op("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw Op("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw Op("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}},gS=class extends hS{initXhr(){this.xhr_.responseType="text"}};function Y9(){return N9?N9():new gS}var wu=class t{constructor(e,r){this._service=e,r instanceof Zn?this._location=r:this._location=Zn.makeFromUrl(r,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,r){return new t(e,r)}get root(){let e=new Zn(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return q9(this._location.path)}get storage(){return this._service}get parent(){let e=_ue(this._location.path);if(e===null)return null;let r=new Zn(this._location.bucket,e);return new t(this._service,r)}_throwIfRoot(e){if(this._location.path==="")throw Xce(e)}};function Oue(t,e,r){t._throwIfRoot("uploadBytes");let o=Pue(t.storage,t._location,G9(),new ab(e,!0),r);return t.storage.makeRequestWithTokens(o,Y9).then(n=>({metadata:n,ref:t}))}function Aue(t,e){t._throwIfRoot("updateMetadata");let r=Cue(t.storage,t._location,e,G9());return t.storage.makeRequestWithTokens(r,Y9)}function Due(t,e){let r=xue(t._location.path,e),o=new Zn(t._location.bucket,r);return new wu(t.storage,o)}function Rue(t){return/^[A-Za-z]+:\/\//.test(t)}function Nue(t,e){return new wu(t,e)}function Q9(t,e){if(t instanceof Rp){let r=t;if(r._bucket==null)throw Gce();let o=new wu(r,r._bucket);return e!=null?Q9(o,e):o}else return e!==void 0?Due(t,e):t}function Mue(t,e){if(e&&Rue(e)){if(t instanceof Rp)return Nue(t,e);throw fS("To use ref(service, url), the first argument must be a Storage instance.")}else return Q9(t,e)}function M9(t,e){let r=e?.[z9];return r==null?null:Zn.makeFromBucketSpec(r,t)}function Lue(t,e,r,o={}){t.host=`${e}:${r}`,t._protocol="http";let{mockUserToken:n}=o;n&&(t._overrideAuthToken=typeof n=="string"?n:kw(n,t.app.options.projectId))}var Rp=class{constructor(e,r,o,n,a){this.app=e,this._authProvider=r,this._appCheckProvider=o,this._url=n,this._firebaseVersion=a,this._bucket=null,this._host=F9,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=Mce,this._maxUploadRetryTime=Lce,this._requests=new Set,n!=null?this._bucket=Zn.makeFromBucketSpec(n,this._host):this._bucket=M9(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=Zn.makeFromBucketSpec(this._url,e):this._bucket=M9(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){R9("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){R9("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;let e=this._authProvider.getImmediate({optional:!0});if(e){let r=await e.getToken();if(r!==null)return r.accessToken}return null}async _getAppCheckToken(){let e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new wu(this,e)}_makeRequest(e,r,o,n,a=!0){if(this._deleted)return new pS(U9());{let i=iue(e,this._appId,o,n,r,this._firebaseVersion,a);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(e,r){let[o,n]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,r,o,n).getPromise()}},L9="@firebase/storage",B9="0.11.2";var Z9="storage";function J9(t,e,r){return t=kt(t),Oue(t,e,r)}function ez(t,e){return t=kt(t),Aue(t,e)}function tz(t,e){return t=kt(t),Mue(t,e)}function rz(t=pf(),e){t=kt(t);let o=Hs(t,Z9).getImmediate({identifier:e}),n=Ew("storage");return n&&Bue(o,...n),o}function Bue(t,e,r,o={}){Lue(t,e,r,o)}function Fue(t,{instanceIdentifier:e}){let r=t.getProvider("app").getImmediate(),o=t.getProvider("auth-internal"),n=t.getProvider("app-check-internal");return new Rp(r,o,n,e,pa)}function zue(){fa(new $o(Z9,Fue,"PUBLIC").setMultipleInstances(!0)),jo(L9,B9,""),jo(L9,B9,"esm2017")}zue();var Uue={};function sb(t,e){for(var r in e)t[r]=e[r];return t}function Vue(t,e,r){var o,n=/(?:\?([^#]*))?(#.*)?$/,a=t.match(n),i={};if(a&&a[1])for(var s=a[1].split("&"),l=0;l<s.length;l++){var c=s[l].split("=");i[decodeURIComponent(c[0])]=decodeURIComponent(c.slice(1).join("="))}t=bS(t.replace(n,"")),e=bS(e||"");for(var u=Math.max(t.length,e.length),d=0;d<u;d++)if(e[d]&&e[d].charAt(0)===":"){var p=e[d].replace(/(^:|[+*?]+$)/g,""),m=(e[d].match(/[+*?]+$/)||Uue)[0]||"",h=~m.indexOf("+"),g=~m.indexOf("*"),_=t[d]||"";if(!_&&!g&&(m.indexOf("?")<0||h)){o=!1;break}if(i[p]=decodeURIComponent(_),h||g){i[p]=t.slice(d).map(decodeURIComponent).join("/");break}}else if(e[d]!==t[d]){o=!1;break}return(r.default===!0||o!==!1)&&i}function Hue(t,e){return t.rank<e.rank?1:t.rank>e.rank?-1:t.index-e.index}function $ue(t,e){return t.index=e,t.rank=function(r){return r.props.default?0:bS(r.props.path).map(jue).join("")}(t),t.props}function bS(t){return t.replace(/(^\/+|\/+$)/g,"").split("/")}function jue(t){return t.charAt(0)==":"?1+"*+?".indexOf(t.charAt(t.length-1))||4:5}var que={},ml=[],Np=[],ln=null,yS={url:vS()},nz=Rt(yS);function az(){var t=Mt(nz);if(t===yS){var e=P()[1];L(function(){return Np.push(e),function(){return Np.splice(Np.indexOf(e),1)}},[])}return[t,ur]}function vS(){var t;return""+((t=ln&&ln.location?ln.location:ln&&ln.getCurrentLocation?ln.getCurrentLocation():typeof location<"u"?location:que).pathname||"")+(t.search||"")}function ur(t,e){return e===void 0&&(e=!1),typeof t!="string"&&t.url&&(e=t.replace,t=t.url),function(r){for(var o=ml.length;o--;)if(ml[o].canRoute(r))return!0;return!1}(t)&&function(r,o){o===void 0&&(o="push"),ln&&ln[o]?ln[o](r):typeof history<"u"&&history[o+"State"]&&history[o+"State"](null,null,r)}(t,e?"replace":"push"),iz(t)}function iz(t){for(var e=!1,r=0;r<ml.length;r++)ml[r].routeTo(t)&&(e=!0);return e}function Gue(t){if(t&&t.getAttribute){var e=t.getAttribute("href"),r=t.getAttribute("target");if(e&&e.match(/^\//g)&&(!r||r.match(/^_?self$/i)))return ur(e)}}function Wue(t){return t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault(),!1}function Kue(t){if(!(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button)){var e=t.target;do if(e.localName==="a"&&e.getAttribute("href")){if(e.hasAttribute("data-native")||e.hasAttribute("native"))return;if(Gue(e))return Wue(t)}while(e=e.parentNode)}}var oz=!1;function IS(t){t.history&&(ln=t.history),this.state={url:t.url||vS()}}sb(IS.prototype=new Vo,{shouldComponentUpdate:function(t){return t.static!==!0||t.url!==this.props.url||t.onChange!==this.props.onChange},canRoute:function(t){var e=yo(this.props.children);return this.g(e,t)!==void 0},routeTo:function(t){this.setState({url:t});var e=this.canRoute(t);return this.p||this.forceUpdate(),e},componentWillMount:function(){this.p=!0},componentDidMount:function(){var t=this;oz||(oz=!0,ln||addEventListener("popstate",function(){iz(vS())}),addEventListener("click",Kue)),ml.push(this),ln&&(this.u=ln.listen(function(e){var r=e.location||e;t.routeTo(""+(r.pathname||"")+(r.search||""))})),this.p=!1},componentWillUnmount:function(){typeof this.u=="function"&&this.u(),ml.splice(ml.indexOf(this),1)},componentWillUpdate:function(){this.p=!0},componentDidUpdate:function(){this.p=!1},g:function(t,e){t=t.filter($ue).sort(Hue);for(var r=0;r<t.length;r++){var o=t[r],n=Vue(e,o.props.path,o.props);if(n)return[o,n]}},render:function(t,e){var r,o,n=t.onChange,a=e.url,i=this.c,s=this.g(yo(t.children),a);if(s&&(o=Mm(s[0],sb(sb({url:a,matches:r=s[1]},r),{key:void 0,ref:void 0}))),a!==(i&&i.url)){sb(yS,i=this.c={url:a,previous:i&&i.url,current:o,path:o?o.props.path:null,matches:r}),i.router=this,i.active=o?[o]:[];for(var l=Np.length;l--;)Np[l]({});typeof n=="function"&&n(i)}return Q(nz.Provider,{value:i},o)}});var Gt=function(t){return Q(t.component,t)};var Xue=/^[a-z0-9_]+(?:--?[a-z0-9_]+)*$/;function Ca(t,e){e||(e=Xue);let r=typeof e=="string"?new RegExp(e):e;return!!(t&&r.test(t))}function $i(t){return t.replace(/^[\s/]*/g,"").replace(/[\s/]*$/g,"").replace(/^\/+|\/+$/g,"").replaceAll("/","--")}function xt(){let t=Lt();return{overlayColor:t.colorScheme==="dark"?t.colors.dark[9]:t.colors.gray[2],overlayOpacity:.55,overlayBlur:3}}var Tr={year:31536e6,month:2628e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3};function Rn(t,e){let r=Math.abs(t-new Date().getTime());if(r<Tr.second)return"just now";let o=e||{numeric:"auto"},n=new Intl.RelativeTimeFormat("en",o);return r<Tr.minute?n.format(Math.round(-r/Tr.second),"second"):r<Tr.hour?n.format(Math.round(-r/Tr.minute),"minute"):r<Tr.day?n.format(Math.round(-r/Tr.hour),"hour"):r<Tr.week?n.format(Math.round(-r/Tr.day),"day"):new Date(t).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric"})}function Mp(){return Math.floor(new Date().getTime())}function lb(t){return new Date(t.toMillis()).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Eu(){let t=s=>s<10?"0"+s:s,e=new Date,r=e.getFullYear(),o=t(e.getMonth()+1),n=t(e.getDate()),a=t(e.getHours()),i=t(e.getMinutes());return`${r}-${o}-${n}T${a}:${i}`}var sz={};async function Je(t,e){let r=e?.throttle||0,o=e?.throttleId?`${t}::${e.throttleId}`:t;if(Yue(o,r))return;let n=await fetch("/cms/api/actions.log",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:t,metadata:e?.metadata||{}})});if(n.status!==200){let a=await n.text();console.error(`failed to log action "${t}":`,a);return}sz[o]=Mp()}async function lz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=nn(r,"Projects",e,"ActionLogs"),n=t?.limit||40,a=Math.ceil(n*1.5),i=to(o,Qn("timestamp","desc"),k9(a)),s=await an(i),l=[];function c(d){if(l.length===0)return!1;let p=l.at(-1);return d.action==="doc.save"&&p.action==="doc.save"&&d.by===p.by&&d.metadata.docId===p.metadata.docId&&d.timestamp.toMillis()-p.timestamp.toMillis()<60*Tr.minute}let u=0;for(let d of s.docs){if(u>=n)break;let p=d.data();c(p)||(l.push(p),u+=1)}return l}function Yue(t,e){if(e===0)return!1;let r=sz[t];return r?Mp()-r<e:!1}var wS=new Map;function Que(t){return wS.get(t)||null}async function cb(t){let e=Que(t);if(e)return e;let r=Nn(t),n=(await vr(r)).data();return Lp(t,n),n}function Lp(t,e){wS.set(t,e)}function ES(t){wS.delete(t)}function cz(t){for(let e of t)ES(e)}function SS(){let t=window.__ROOT_CTX.rootConfig.projectId,e=window.firebase.db;return nn(e,"Projects",t,"Translations")}async function ji(t){let e=SS(),r=t?.tags?to(e,eb("tags","array-contains-any",t.tags)):to(e),o=await an(r),n={};return o.forEach(a=>{let i=a.id;n[i]=a.data()}),n}async function uz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,"Translations",t);return(await vr(o)).data()}async function dz(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,"Translations",t),a={};for(let i in e){let s=ede(i);s&&(a[s]=e[i])}console.log("updating translations: ",a),await rr(n,a),Je("translations.save",{metadata:{hash:t},throttle:5*Tr.minute,throttleId:t})}async function ub(t){return Zue(ei(t))}async function Zue(t){let r=new TextEncoder().encode(t),o=await crypto.subtle.digest("SHA-1",r);return Array.from(new Uint8Array(o)).map(i=>i.toString(16).padStart(2,"0")).join("")}function ei(t){return String(t).trim().split(`
|
|
36
36
|
`).map(r=>Jue(r)).join(`
|
|
37
|
-
`)}function Jue(t){return String(t).trimEnd().replace(/ $/,"")}function ede(t){let r=(window.__ROOT_CTX.rootConfig.i18n||{}).locales||["en"];for(let o of r)if(String(o).toLowerCase()===t.toLowerCase())return o;return null}async function fz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/"),a=we(r,"Projects",e,"Collections",o,"Drafts",n),i=we(r,"Projects",e,"Collections",o,"Published",n),s=we(r,"Projects",e,"Collections",o,"Scheduled",n),l=sn(r);l.delete(a),l.delete(i),l.delete(s),await l.commit(),console.log(`deleted doc: ${t}`),Je("doc.delete",{metadata:{docId:t}})}async function pz(t){await CS([t])}async function CS(t,e){if(t.length===0){console.log("no docs to publish");return}let r=window.firebase.db;if(t.length>100)throw new Error("publish docs exceeds limit of 100 docs. break up your request into multiple calls.");let o=await TS(t),n=e?.batch||sn(r);t.forEach(a=>{let i=o[a];if(!i)throw new Error(`doc does not exist: ${a}`);tde(n,a,i)}),await n.commit(),t.length===1?console.log(`published ${t[0]}`):console.log(`published ${t.length} docs: ${t.join(", ")}`);for(let a of t)Je("doc.publish",{metadata:{docId:a}});cz(t)}function tde(t,e,r){if(hl(r))throw new Error(`publishing is locked for doc: ${r.id}`);let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,[a,i]=e.split("/"),s=we(n,"Projects",o,"Collections",a,"Drafts",i),l=we(n,"Projects",o,"Collections",a,"Scheduled",i),c=we(n,"Projects",o,"Collections",a,"Published",i),u={...r},d=u.sys??{};d.modifiedAt=Ut(),d.modifiedBy=window.firebase.user.email,d.publishedAt=Ut(),d.publishedBy=window.firebase.user.email,d.firstPublishedAt??=Ut(),d.firstPublishedBy??=window.firebase.user.email,delete d.scheduledAt,delete d.scheduledBy,t.update(s,{sys:d}),t.set(c,{...u,sys:d}),t.delete(l)}async function mz(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,[n,a]=t.split("/"),i=we(o,"Projects",r,"Collections",n,"Drafts",a),s=we(o,"Projects",r,"Collections",n,"Scheduled",a);await Pp(o,async l=>{let c=await l.get(i);if(!c.exists())throw new Error(`${i.id} does not exist`);let u={...c.data()},d=u.sys??{};d.modifiedAt=Ut(),d.modifiedBy=window.firebase.user.email,d.scheduledAt=Ze.fromMillis(e),d.scheduledBy=window.firebase.user.email,l.update(i,{sys:d}),l.set(s,{...u,sys:d})}),console.log(`saved ${s.id}`),Je("doc.schedule",{metadata:{docId:t,scheduledAt:e}})}async function hz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/"),a=we(r,"Projects",e,"Collections",o,"Drafts",n),i=we(r,"Projects",e,"Collections",o,"Scheduled",n),s=we(r,"Projects",e,"Collections",o,"Published",n),l=sn(r);l.update(a,{"sys.modifiedAt":Ut(),"sys.modifiedBy":window.firebase.user.email,"sys.publishedAt":zr(),"sys.publishedBy":zr(),"sys.firstPublishedAt":zr(),"sys.firstPublishedBy":zr()}),l.delete(i),l.delete(s),await l.commit(),console.log(`unpublished ${t}`),Je("doc.unpublish",{metadata:{docId:t}}),ES(t)}async function gz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/"),a=we(r,"Projects",e,"Collections",o,"Drafts",n),i=we(r,"Projects",e,"Collections",o,"Published",n);await Pp(r,async s=>{let l=await s.get(i);if(!l.exists())throw new Error(`${i.id} does not exist`);let c=l.data();s.set(a,c)}),console.log(`reverted draft ${t}`),Je("doc.revert",{metadata:{docId:t}})}async function _z(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/"),a=we(r,"Projects",e,"Collections",o,"Drafts",n),i=we(r,"Projects",e,"Collections",o,"Scheduled",n),s=sn(r);s.update(a,{"sys.modifiedAt":Ut(),"sys.modifiedBy":window.firebase.user.email,"sys.scheduledAt":zr(),"sys.scheduledBy":zr()}),s.delete(i),await s.commit(),console.log(`unscheduled ${t}`),Je("doc.unschedule",{metadata:{docId:t}})}async function xz(t,e){let r={lockedAt:Ut(),lockedBy:window.firebase.user.email,reason:e.reason||`Locked by ${window.firebase.user.email}.`};e.until&&(r.until=Ze.fromMillis(e.until));let o=Nn(t);await rr(o,{"sys.publishingLocked":r});let a={docId:t,reason:e.reason};e.until&&(a.until=e.until),Je("doc.lock_publishing",{metadata:a})}async function bz(t){let e=Nn(t),r={"sys.publishingLocked":zr()};await rr(e,r),Je("doc.unlock_publishing",{metadata:{docId:t}})}function fb(t){let e=Ze.now().toMillis();return(t?.sys?.scheduledAt?.toMillis()||0)>e}function hl(t){if(t?.sys?.publishingLocked){if(t.sys.publishingLocked.until){let e=Ze.now().toMillis(),r=t.sys.publishingLocked.until.toMillis();return e<r}return!0}return!1}async function yz(t,e,r){let o=Nn(t),n=await vr(o);if(!n.exists())throw new Error(`doc ${t} does not exist`);let a=n.data().fields??{};await kS(e,{fields:a,overwrite:r?.overwrite})}async function kS(t,e){let[r,o]=t.split("/"),n=Nn(t),a=await vr(n);if(a.exists()&&!e?.overwrite)throw new Error(`${t} already exists`);let i={id:t,collection:r,slug:o,sys:{createdAt:Ut(),createdBy:window.firebase.user.email,modifiedAt:Ut(),modifiedBy:window.firebase.user.email,locales:["en"]},fields:e?.fields??{}};if(a.exists()&&e?.overwrite){let s=a.data();i.sys={...s.sys,modifiedAt:Ut(),modifiedBy:window.firebase.user.email}}await vu(n,i),Je("doc.create",{metadata:{docId:t}})}async function gl(t,e,r){let n=(window.__ROOT_CTX.rootConfig.i18n||{}).locales||["en"];function a(m){for(let h of n)if(String(h).toLowerCase()===m.toLowerCase())return h;return null}let i={};for(let m of e){if(!m.source)continue;let h={source:ei(m.source)};Object.entries(m).forEach(([_,x])=>{if(_==="source")return;let b=a(_);b&&(h[b]=ei(x||""))});let g=await ub(h.source);i[g]=h}let l=[t.split("/")[0],t];r?.tags&&l.push(...r.tags);let c=SS(),u=window.firebase.db,d=sn(u),p=0;for(let m in i){let h=i[m],g=we(c,m);d.set(g,{...h,tags:A9(...l)},{merge:!0}),p+=1,p>=500&&(await d.commit(),d=sn(u),console.log(`saved ${p} strings`),p=0)}return p>0&&(await d.commit(),console.log(`saved ${p} strings`)),Je("doc.import_translations",{metadata:{docId:t}}),i}function Nn(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/");return we(r,"Projects",e,"Collections",o,"Drafts",n)}function rde(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/");return we(r,"Projects",e,"Collections",o,"Published",n)}function ode(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,[n,a]=t.split("/");return we(o,"Projects",r,"Collections",n,"Drafts",a,"Versions",e)}async function TS(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o={};t.forEach(a=>{let[i,s]=a.split("/");i in o?o[i].push(s):o[i]=[s]});let n={};return await Promise.all(Object.entries(o).map(async([a,i])=>{let s=nn(r,"Projects",e,"Collections",a,"Drafts"),l=to(s,eb(Zx(),"in",i));(await an(l)).forEach(u=>{let d=`${a}/${u.id}`;n[d]=u.data()})})),n}async function vz(t){let e=window.firebase.db,r=Nn(t),o=nn(e,r.path,"Versions"),n=to(o,Qn("sys.modifiedAt","desc")),a=await an(n),i=[];return a.forEach(s=>{let l={...s.data(),_versionId:s.id};i.push(l)}),i}async function Iz(t,e){let r=Nn(t),o={"sys.modifiedAt":Ut(),"sys.modifiedBy":window.firebase.user.email,fields:e.fields||{}};await rr(r,o),Je("doc.restore_version",{metadata:{docId:t,versionModifiedAt:e.sys?.modifiedAt,versionModifiedBy:e.sys?.modifiedBy}})}async function PS(t,e){let r;e==="draft"?r=Nn(t):e==="published"?r=rde(t):r=ode(t,e);let o=await vr(r);return o.exists()?o.data():null}async function pb(t,e){if(!e?.spreadsheetId)throw new Error("no spreadsheet id");let r=Nn(t),o={"sys.l10nSheet":{spreadsheetId:e.spreadsheetId,gid:e.gid||0,linkedAt:Ut(),linkedBy:window.firebase.user.email}};await rr(r,o),Je("doc.link_sheet",{metadata:{docId:t,sheetId:e}})}async function wz(t){let e=Nn(t),r={"sys.l10nSheet":zr()};await rr(e,r),Je("doc.unlink_sheet",{metadata:{docId:t}})}async function mb(t){let e=Nn(t),n=(await vr(e)).data()?.sys?.l10nSheet||{};return n?.spreadsheetId?{spreadsheetId:n.spreadsheetId,gid:n.gid||0}:null}function db(t,e){let r={};for(let o in t){let n=t[o];if(nde(n))if(n.toMillis)r[o]=n.toMillis();else if(Object.hasOwn(n,"_array")&&Array.isArray(n._array)){let a=n._array.map(i=>{let s={...db(n[i]||{},e),_arrayKey:i};return e?.removeArrayKey&&delete s._arrayKey,s});r[o]=a}else r[o]=db(n,e);else r[o]=n}return r}function nde(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}function ke(...t){return t.filter(e=>!!e).join(" ")||void 0}var ade=0,x7e=Array.isArray;function f(t,e,r,o,n,a){var i,s,l={};for(s in e)s=="ref"?i=e[s]:l[s]=e[s];var c={type:t,props:l,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ade,__i:-1,__u:0,__source:n,__self:a};if(typeof t=="function"&&(i=t.defaultProps))for(s in i)l[s]===void 0&&(l[s]=i[s]);return he.vnode&&he.vnode(c),c}function Me(t){let{className:e,as:r,size:o,weight:n,color:a,children:i,...s}=t;return f(r||"div",{...s,className:ke(e,"text",o&&`size:${o}`,n&&`weight:${n}`,a&&`color:${a}`),children:i})}function Jn(t){let r=window.__ROOT_CTX.collections[t.collectionId];if(!r)throw new Error(`collection not found: ${t.collectionId}`);let o=r.domain||window.__ROOT_CTX.rootConfig.domain||"https://example.com",n=OS(t);return`${o}${n}`}function OS(t){let e=window.__ROOT_CTX.collections,{collectionId:r,slug:o,locale:n}=t,a=e[r];if(!a)throw new Error(`collection not found: ${r}`);let i=window.__ROOT_CTX.rootConfig,s=i.base||"/",l="/[base]/[path]";n&&(l=i.i18n.urlFormat||"/[locale]/[base]/[path]");let c="",u=a?.url;if(u)if(o){let d=u.replace(/\[.*slug\]/,o).replaceAll("--","/").replace(/\/+/g,"/");d==="/index"&&(d="/"),c=d}else c=u;return Ez(l,{base:s,path:c,locale:n||"",slug:o})}function AS(t){let e=window.__ROOT_CTX.collections,{collectionId:r,slug:o,locale:n}=t,a=e[r];if(!a)throw new Error(`collection not found: ${r}`);let i=window.__ROOT_CTX.rootConfig,s=i.base||"/",l="/[base]/[path]";n&&(l=i.i18n.urlFormat||"/[locale]/[base]/[path]");let c="",u=a?.previewUrl||a?.url;if(u)if(o){let d=u.replace(/\[.*slug\]/,o).replaceAll("--","/").replace(/\/+/g,"/");d==="/index"&&(d="/"),c=d}else c=u;return Ez(l,{base:s,path:c,locale:n||"",slug:o})}function Ez(t,e){let r=t.replaceAll(/\[\[?(\.\.\.)?([\w\-_]*)\]?\]/g,(o,n,a)=>e[a]??o);return ide(r,{trailingSlash:window.__ROOT_CTX.rootConfig.server.trailingSlash})}function ide(t,e){return t=t.replace(/\/+/g,"/"),e?.trailingSlash===!1&&t!=="/"&&t.endsWith("/")&&(t=t.replace(/\/*$/g,"")),(t.endsWith("/index")||t.endsWith("/index/"))&&(t=t.slice(0,-6)),t.startsWith("/")||(t=`/${t}`),e?.trailingSlash&&!t.endsWith("/")&&(t=`${t}/`),t}function hb(t){let[e,r]=P(t.collectionId||""),o=H(null),[n,a]=P(""),i=window.__ROOT_CTX.collections[e],s=[];t.collectionId&&t.collectionDisabled?s.push({value:t.collectionId,label:t.collectionId}):Object.keys(window.__ROOT_CTX.collections).forEach(d=>{s.push({value:d,label:d})});let l="";if(i?.url){if(n){let d=$i(n),p=i?.slugRegex;Ca(d,p)?l=Jn({collectionId:e,slug:d}):l="INVALID SLUG"}else l=Jn({collectionId:e,slug:"[slug]"});l.endsWith("/index")&&(l=l.replace(/\/index$/,"/"))}function c(d){r(d),t.onChange&&t.onChange({collectionId:d,slug:n})}function u(d){a(d),t.onChange&&t.onChange({collectionId:e,slug:d})}return f("div",{className:ke(t.className,"SlugInput"),children:[f("div",{className:"SlugInput__inputs",children:[f(Pt,{className:"SlugInput__collection",placeholder:"Collection",size:"xs",data:s,onChange:d=>c(d),value:e,disabled:!!t.collectionDisabled}),f("div",{className:"SlugInput__divider",children:"/"}),f(gt,{className:"SlugInput__slug",name:"slug",ref:o,value:n,onChange:d=>{u(d.currentTarget.value)},placeholder:"slug",autoComplete:"off",size:"xs"})]}),l&&f(Me,{className:"SlugInput__urlHelp",size:"body-sm",children:l})]})}var Sz="CopyDocModal";function Cz(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(Sz,{...r,innerProps:t})}}}function gb(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(""),[l,c]=P(""),[u,d]=P(!1),[p,m]=P(!1),h=e.fromDocId,g=h.split("/")[0];async function _(x){if(x.preventDefault(),m(!0),c(""),!g){c("Please select a collection."),m(!1);return}let b=$i(i),y=window.__ROOT_CTX.collections[n]?.slugRegex;if(!Ca(b,y)){c('Please enter a valid slug (e.g. "foo-bar-123").'),m(!1);return}let I=`${n}/${b}`;try{await yz(h,I,{overwrite:u}),r.closeModal(o),pe({title:"Copied!",message:`Succesfully copied ${h} to ${I}.`,autoClose:5e3})}catch(w){let v=String(w);c(v),v.includes("already exists")&&d(!0),m(!1);return}m(!1),ur(`/cms/content/${n}/${b}`)}return f("div",{className:"CopyDocModal",children:f("form",{onSubmit:x=>_(x),children:[f("div",{className:"CopyDocModal__from",children:[f(Me,{className:"CopyDocModal__from__label",size:"body",weight:"bold",children:"From:"}),f(Me,{className:"CopyDocModal__from__value",size:"body-sm",children:f("code",{children:e.fromDocId})})]}),f("div",{className:"CopyDocModal__to",children:[f(Me,{className:"CopyDocModal__to__label",size:"body",weight:"bold",children:"To:"}),f(hb,{className:"CopyDocModal__slug",collectionId:g,onChange:x=>{a(x.collectionId),s(x.slug)}})]}),l&&f("div",{className:"CopyDocModal__error",children:l}),f("div",{className:"CopyDocModal__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",type:"submit",size:"xs",color:"dark",loading:p,children:u?"Overwrite?":"Submit"})]})]})})}gb.id=Sz;async function bt(t){try{await t()}catch(e){console.error(e);let r;typeof e=="object"&&e.body?r=String(e.body):r=String(e),pe({title:"Error",message:r,color:"red",autoClose:!1})}}var DS=Rt(null);function kz(){let t=Mt(DS);if(!t)throw new Error("useFirebase() should be called within a <FirebaseProvider>");return t}function Su(t,e){let[r,o]=P([]),[n,a]=P(!0),s=kz().db,l=window.__ROOT_CTX.rootConfig.projectId||"default",c=async()=>{a(!0);let u=nn(s,"Projects",l,"Collections",t,"Drafts"),d=u,p=e.orderBy;p==="modifiedAt"?d=to(u,Qn("sys.modifiedAt","desc")):p==="newest"?d=to(u,Qn("sys.createdAt","desc")):p==="oldest"?d=to(u,Qn("sys.createdAt")):p==="slug"&&(d=to(u,Qn(Zx()))),await bt(async()=>{let m=await an(d),h=[];m.docs.forEach(g=>{let _=g.data(),x=g.id,b=`${t}/${x}`,y={..._,id:b,slug:x};h.push(y),Lp(b,y)}),o(h)}),a(!1)};return L(()=>{a(!0),c()},[t,e.orderBy]),[n,c,r]}function Bp(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}function oo(t,e){let r=e.split("."),o=t;for(let n of r)o||(o={}),o=o[n];return o}function RS(t){let e={};for(let r in t)if(Bp(t[r])){let o=t[r],n=RS(o);for(let a in n)e[`${r}.${a}`]=n[a]}else e[r]=t[r];return e}function Tz(t,e){return t.sort((r,o)=>{let n=r[e],a=o[e];return n<a?-1:n>a?1:0})}function _b(t,e){if(t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!_b(t[n],e[n]))return!1;return!0}let r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(let n of r)if(!_b(t[n],e[n]))return!1;return!0}var NS="DocPickerModal";function Pz(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(NS,{...e,innerProps:r,size:"700px",overflow:"inside"})},close:()=>{t.closeModal(NS)}}}function qi(t){let{innerProps:e}=t,r=Object.keys(window.__ROOT_CTX.collections);e.collections?.length&&(r=r.filter(s=>e.collections?.includes(s)));let o=[{value:"",label:"Select"}];r.forEach(s=>{o.push({value:s,label:s})});let[n,a]=P(e.initialCollection||(r.length===1?r[0]:""));function i(s){e.onChange&&e.onChange(s.id)}return f("div",{className:"DocPickerModal",children:[r.length===0&&f("div",{className:"DocPickerModal__noCollections",children:"No collections matching schema field definition."}),r.length>1&&f("div",{className:"DocPickerModal__collection__select",children:[f("div",{className:"DocPickerModal__collection__select__label",children:"Content Type:"}),f(Pt,{data:o,value:n,placeholder:"Select",onChange:s=>{a(s||"")},size:"xs",radius:0,dropdownComponent:"div"})]}),n&&f(qi.DocsList,{collection:n,onDocSelected:i})]})}qi.DocsList=t=>{let[e,,r]=Su(t.collection,{orderBy:"slug"});return f("div",{className:"DocPickerModal__DocsList",children:e?f("div",{className:"DocPickerModal__DocsList__loading",children:f(Re,{color:"gray",size:"xl"})}):r.length===0?f("div",{className:"DocPickerModal__DocsList__empty",children:"Collection is empty."}):f("div",{className:"DocPickerModal__DocsList__docs",children:r.map(o=>f(qi.DocCard,{doc:o,onDocSelected:t.onDocSelected},o.id))})})};qi.DocCard=t=>{let e=t.doc,[r,o]=e.id.split("/"),n=e.fields||{},a=window.__ROOT_CTX.collections[r],i=Jn({collectionId:r,slug:o}),s=oo(n,a.preview?.title||"meta.title"),l=oo(n,a.preview?.image||"meta.image")||a.preview?.defaultImage;return f("div",{className:"DocPickerModal__DocCard",children:[f("div",{className:"DocPickerModal__DocCard__image",children:f(Tn,{src:l?.src,width:120,height:90,withPlaceholder:!l?.src})}),f("div",{className:"DocPickerModal__DocCard__content",children:[f("div",{className:"DocPickerModal__DocCard__content__header",children:f("div",{className:"DocPickerModal__DocCard__content__header__docId",children:e.id})}),f("div",{className:"DocPickerModal__DocCard__content__title",children:s||"[UNTITLED]"}),f("div",{className:"DocPickerModal__DocCard__content__url",children:i})]}),f("div",{className:"DocPickerModal__DocCard__controls",children:f(X,{color:"blue",size:"xs",onClick:()=>t.onDocSelected(t.doc),children:"Select"})})]})};qi.id=NS;var MS="DocSelectModal";function Oz(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(MS,{...e,innerProps:r,size:"700px",overflow:"inside"})},close:()=>{t.closeModal(MS)}}}function Gi(t){let{innerProps:e}=t,r=Object.keys(window.__ROOT_CTX.collections);e.collections?.length&&(r=r.filter(l=>e.collections?.includes(l)));let o=[{value:"",label:"Select"}];r.forEach(l=>{o.push({value:l,label:l})});let[n,a]=P(e.initialCollection||(r.length===1?r[0]:""));function i(l){e.onChange&&e.onChange(l.id,!0)}function s(l){e.onChange&&e.onChange(l.id,!1)}return console.log("selected docs:",e.selectedDocIds),f("div",{className:"DocSelectModal",children:[r.length===0&&f("div",{className:"DocSelectModal__noCollections",children:"No collections matching schema field definition."}),r.length>1&&f("div",{className:"DocSelectModal__collection__select",children:[f("div",{className:"DocSelectModal__collection__select__label",children:"Content Type:"}),f(Pt,{data:o,value:n,placeholder:"Select",onChange:l=>{a(l||"")},size:"xs",radius:0,dropdownComponent:"div"})]}),n&&f(Gi.DocsList,{collection:n,onDocSelected:i,onDocUnselected:s,selectedDocIds:e.selectedDocIds})]})}Gi.DocsList=t=>{let[e,,r]=Su(t.collection,{orderBy:"slug"}),o=t.selectedDocIds||[];return f("div",{className:"DocSelectModal__DocsList",children:e?f("div",{className:"DocSelectModal__DocsList__loading",children:f(Re,{color:"gray",size:"xl"})}):r.length===0?f("div",{className:"DocSelectModal__DocsList__empty",children:"Collection is empty."}):f("div",{className:"DocSelectModal__DocsList__docs",children:r.map(n=>f(Gi.DocCard,{doc:n,onDocSelected:t.onDocSelected,onDocUnselected:t.onDocUnselected,selected:o.includes(n.id)},n.id))})})};Gi.DocCard=t=>{let[e,r]=P(!!t.selected),o=t.doc,[n,a]=o.id.split("/"),i=o.fields||{},s=window.__ROOT_CTX.collections[n],l=Jn({collectionId:n,slug:a}),c=oo(i,s.preview?.title||"meta.title"),u=oo(i,s.preview?.image||"meta.image")||s.preview?.defaultImage;return f("div",{className:"DocSelectModal__DocCard",children:[f("div",{className:"DocSelectModal__DocCard__image",children:f(Tn,{src:u?.src,width:120,height:90,withPlaceholder:!u?.src})}),f("div",{className:"DocSelectModal__DocCard__content",children:[f("div",{className:"DocSelectModal__DocCard__content__header",children:f("div",{className:"DocSelectModal__DocCard__content__header__docId",children:o.id})}),f("div",{className:"DocSelectModal__DocCard__content__title",children:c||"[UNTITLED]"}),f("div",{className:"DocSelectModal__DocCard__content__url",children:l})]}),f("div",{className:"DocSelectModal__DocCard__controls",children:e?f(X,{variant:"light",color:"blue",size:"xs",onClick:()=>{r(!1),t.onDocUnselected(t.doc)},children:"Unselect"}):f(X,{variant:"filled",color:"blue",size:"xs",onClick:()=>{r(!0),t.onDocSelected(t.doc)},children:"Select"})})]})};Gi.id=MS;var Az={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var sde=Object.defineProperty,lde=Object.defineProperties,cde=Object.getOwnPropertyDescriptors,xb=Object.getOwnPropertySymbols,Nz=Object.prototype.hasOwnProperty,Mz=Object.prototype.propertyIsEnumerable,Dz=(t,e,r)=>e in t?sde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rz=(t,e)=>{for(var r in e||(e={}))Nz.call(e,r)&&Dz(t,r,e[r]);if(xb)for(var r of xb(e))Mz.call(e,r)&&Dz(t,r,e[r]);return t},ude=(t,e)=>lde(t,cde(e)),dde=(t,e)=>{var r={};for(var o in t)Nz.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&xb)for(var o of xb(t))e.indexOf(o)<0&&Mz.call(t,o)&&(r[o]=t[o]);return r},Y=(t,e,r)=>{let o=n=>{var a=n,{color:i="currentColor",size:s=24,stroke:l=2,children:c}=a,u=dde(a,["color","size","stroke","children"]);return Q("svg",Rz(ude(Rz({},Az),{width:s,height:s,stroke:i,"stroke-width":l,class:`tabler-icon tabler-icon-${t}`}),u),[...r.map(([d,p])=>Q(d,p)),...yo(c)])};return o.displayName=`${e}`,o};var LS=Y("alarm-off","IconAlarmOff",[["path",{d:"M7.587 7.566a7 7 0 1 0 9.833 9.864m1.35 -2.645a7 7 0 0 0 -8.536 -8.56",key:"svg-0"}],["path",{d:"M12 12v1h1",key:"svg-1"}],["path",{d:"M5.261 5.265l-1.011 .735",key:"svg-2"}],["path",{d:"M17 4l2.75 2",key:"svg-3"}],["path",{d:"M3 3l18 18",key:"svg-4"}]]);var BS=Y("arrow-back","IconArrowBack",[["path",{d:"M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1",key:"svg-0"}]]);var FS=Y("arrow-left","IconArrowLeft",[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M5 12l6 6",key:"svg-1"}],["path",{d:"M5 12l6 -6",key:"svg-2"}]]);var zS=Y("arrow-roundabout-right","IconArrowRoundaboutRight",[["path",{d:"M21 9h-8a5 5 0 1 0 -5 5v7",key:"svg-0"}],["path",{d:"M17 5l4 4l-4 4",key:"svg-1"}]]);var _l=Y("arrow-up-right","IconArrowUpRight",[["path",{d:"M17 7l-10 10",key:"svg-0"}],["path",{d:"M8 7l9 0l0 9",key:"svg-1"}]]);var Fp=Y("braces","IconBraces",[["path",{d:"M7 4a2 2 0 0 0 -2 2v3a2 3 0 0 1 -2 3a2 3 0 0 1 2 3v3a2 2 0 0 0 2 2",key:"svg-0"}],["path",{d:"M17 4a2 2 0 0 1 2 2v3a2 3 0 0 0 2 3a2 3 0 0 0 -2 3v3a2 2 0 0 1 -2 2",key:"svg-1"}]]);var US=Y("carrot","IconCarrot",[["path",{d:"M3 21s9.834 -3.489 12.684 -6.34a4.487 4.487 0 0 0 0 -6.344a4.483 4.483 0 0 0 -6.342 0c-2.86 2.861 -6.347 12.689 -6.347 12.689z",key:"svg-0"}],["path",{d:"M9 13l-1.5 -1.5",key:"svg-1"}],["path",{d:"M16 14l-2 -2",key:"svg-2"}],["path",{d:"M22 8s-1.14 -2 -3 -2c-1.406 0 -3 2 -3 2s1.14 2 3 2s3 -2 3 -2z",key:"svg-3"}],["path",{d:"M16 2s-2 1.14 -2 3s2 3 2 3s2 -1.577 2 -3c0 -1.86 -2 -3 -2 -3z",key:"svg-4"}]]);var Cu=Y("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);var VS=Y("circle-arrow-down","IconCircleArrowDown",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M8 12l4 4",key:"svg-1"}],["path",{d:"M12 8v8",key:"svg-2"}],["path",{d:"M16 12l-4 4",key:"svg-3"}]]);var HS=Y("circle-arrow-up","IconCircleArrowUp",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8l-4 4",key:"svg-1"}],["path",{d:"M12 8v8",key:"svg-2"}],["path",{d:"M16 12l-4 -4",key:"svg-3"}]]);var ku=Y("circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]);var $S=Y("clipboard-check","IconClipboardCheck",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M9 14l2 2l4 -4",key:"svg-2"}]]);var jS=Y("clipboard-copy","IconClipboardCopy",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h3m9 -9v-5a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M13 17v-1a1 1 0 0 1 1 -1h1m3 0h1a1 1 0 0 1 1 1v1m0 3v1a1 1 0 0 1 -1 1h-1m-3 0h-1a1 1 0 0 1 -1 -1v-1",key:"svg-1"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-2"}]]);var zp=Y("clipboard","IconClipboard",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}]]);var qS=Y("cloud-off","IconCloudOff",[["path",{d:"M9.58 5.548c.24 -.11 .492 -.207 .752 -.286c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 .957 -.383 1.824 -1.003 2.454m-2.997 1.033h-11.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.13 -.582 .37 -1.128 .7 -1.62",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]]);var Up=Y("copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);var GS=Y("database","IconDatabase",[["path",{d:"M12 6m-8 0a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]]);var WS=Y("device-desktop","IconDeviceDesktop",[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}]]);var Vp=Y("device-floppy","IconDeviceFloppy",[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]]);var KS=Y("device-ipad","IconDeviceIpad",[["path",{d:"M18 2a3 3 0 0 1 2.995 2.824l.005 .176v14a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-14a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 15h-6l-.117 .007a1 1 0 0 0 0 1.986l.117 .007h6l.117 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z",key:"svg-0"}]]);var XS=Y("device-mobile","IconDeviceMobile",[["path",{d:"M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M11 4h2",key:"svg-1"}],["path",{d:"M12 17v.01",key:"svg-2"}]]);var xl=Y("dots-vertical","IconDotsVertical",[["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);var bl=Y("file-download","IconFileDownload",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17v-6",key:"svg-2"}],["path",{d:"M9.5 14.5l2.5 2.5l2.5 -2.5",key:"svg-3"}]]);var ti=Y("file-upload","IconFileUpload",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11v6",key:"svg-2"}],["path",{d:"M9.5 13.5l2.5 -2.5l2.5 2.5",key:"svg-3"}]]);var yl=Y("folder","IconFolder",[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]]);var Hp=Y("history","IconHistory",[["path",{d:"M12 8l0 4l2 2",key:"svg-0"}],["path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5",key:"svg-1"}]]);var YS=Y("home","IconHome",[["path",{d:"M5 12l-2 0l9 -9l9 9l-2 0",key:"svg-0"}],["path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7",key:"svg-1"}],["path",{d:"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6",key:"svg-2"}]]);var Wi=Y("language","IconLanguage",[["path",{d:"M4 5h7",key:"svg-0"}],["path",{d:"M9 3v2c0 4.418 -2.239 8 -5 8",key:"svg-1"}],["path",{d:"M5 9c0 2.144 2.952 3.908 6.7 4",key:"svg-2"}],["path",{d:"M12 20l4 -9l4 9",key:"svg-3"}],["path",{d:"M19.1 18h-6.2",key:"svg-4"}]]);var $p=Y("lock-open","IconLockOpen",[["path",{d:"M5 11m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M12 16m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-5a4 4 0 0 1 8 0",key:"svg-2"}]]);var vl=Y("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]);var QS=Y("map-pin","IconMapPin",[["path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-0"}],["path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z",key:"svg-1"}]]);var jp=Y("mood-look-down","IconMoodLookDown",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 13h.01",key:"svg-1"}],["path",{d:"M15 13h.01",key:"svg-2"}],["path",{d:"M11 17h2",key:"svg-3"}]]);var ZS=Y("paperclip","IconPaperclip",[["path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5",key:"svg-0"}]]);var JS=Y("photo-up","IconPhotoUp",[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M12.5 21h-6.5a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v6.5",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l3.5 3.5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.679 -.653 1.473 -.829 2.214 -.526",key:"svg-3"}],["path",{d:"M19 22v-6",key:"svg-4"}],["path",{d:"M22 19l-3 -3l-3 3",key:"svg-5"}]]);var eC=Y("photo","IconPhoto",[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]]);var tC=Y("planet","IconPlanet",[["path",{d:"M18.816 13.58c2.292 2.138 3.546 4 3.092 4.9c-.745 1.46 -5.783 -.259 -11.255 -3.838c-5.47 -3.579 -9.304 -7.664 -8.56 -9.123c.464 -.91 2.926 -.444 5.803 .805",key:"svg-0"}],["path",{d:"M12 12m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-1"}]]);var rC=Y("reload","IconReload",[["path",{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747",key:"svg-0"}],["path",{d:"M20 4v5h-5",key:"svg-1"}]]);var Il=Y("robot","IconRobot",[["path",{d:"M6 4m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M12 2v2",key:"svg-1"}],["path",{d:"M9 12v9",key:"svg-2"}],["path",{d:"M15 12v9",key:"svg-3"}],["path",{d:"M5 16l4 -2",key:"svg-4"}],["path",{d:"M15 14l4 2",key:"svg-5"}],["path",{d:"M9 18h6",key:"svg-6"}],["path",{d:"M10 8v.01",key:"svg-7"}],["path",{d:"M14 8v.01",key:"svg-8"}]]);var Tu=Y("rocket","IconRocket",[["path",{d:"M4 13a8 8 0 0 1 7 7a6 6 0 0 0 3 -5a9 9 0 0 0 6 -8a3 3 0 0 0 -3 -3a9 9 0 0 0 -8 6a6 6 0 0 0 -5 3",key:"svg-0"}],["path",{d:"M7 14a6 6 0 0 0 -3 6a6 6 0 0 0 6 -3",key:"svg-1"}],["path",{d:"M15 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);var bb=Y("row-insert-bottom","IconRowInsertBottom",[["path",{d:"M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1z",key:"svg-0"}],["path",{d:"M12 15l0 4",key:"svg-1"}],["path",{d:"M14 17l-4 0",key:"svg-2"}]]);var yb=Y("row-insert-top","IconRowInsertTop",[["path",{d:"M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M12 9v-4",key:"svg-1"}],["path",{d:"M10 7l4 0",key:"svg-2"}]]);var oC=Y("send-2","IconSend2",[["path",{d:"M4.698 4.034l16.302 7.966l-16.302 7.966a.503 .503 0 0 1 -.546 -.124a.555 .555 0 0 1 -.12 -.568l2.468 -7.274l-2.468 -7.274a.555 .555 0 0 1 .12 -.568a.503 .503 0 0 1 .546 -.124z",key:"svg-0"}],["path",{d:"M6.5 12h14.5",key:"svg-1"}]]);var wl=Y("settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]);var El=Y("table","IconTable",[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}]]);var qp=Y("trash-filled","IconTrashFilled",[["path",{d:"M20 6a1 1 0 0 1 .117 1.993l-.117 .007h-.081l-.919 11a3 3 0 0 1 -2.824 2.995l-.176 .005h-8c-1.598 0 -2.904 -1.249 -2.992 -2.75l-.005 -.167l-.923 -11.083h-.08a1 1 0 0 1 -.117 -1.993l.117 -.007h16z",fill:"currentColor",key:"svg-0",strokeWidth:"0"}],["path",{d:"M14 2a2 2 0 0 1 2 2a1 1 0 0 1 -1.993 .117l-.007 -.117h-4l-.007 .117a1 1 0 0 1 -1.993 -.117a2 2 0 0 1 1.85 -1.995l.15 -.005h4z",fill:"currentColor",key:"svg-1",strokeWidth:"0"}]]);var cn=Y("trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);var nC=Y("triangle-filled","IconTriangleFilled",[["path",{d:"M12 1.67a2.914 2.914 0 0 0 -2.492 1.403l-8.11 13.537a2.914 2.914 0 0 0 2.484 4.385h16.225a2.914 2.914 0 0 0 2.503 -4.371l-8.116 -13.546a2.917 2.917 0 0 0 -2.494 -1.408z",fill:"currentColor",key:"svg-0",strokeWidth:"0"}]]);var aC=Y("world","IconWorld",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M3.6 9h16.8",key:"svg-1"}],["path",{d:"M3.6 15h16.8",key:"svg-2"}],["path",{d:"M11.5 3a17 17 0 0 0 0 18",key:"svg-3"}],["path",{d:"M12.5 3a17 17 0 0 1 0 18",key:"svg-4"}]]);var iC=Y("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);var sC="EditJsonModal";function vb(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(sC,{...e,innerProps:r,size:"680px"})},close:()=>{t.closeModal(sC)}}}function Ib(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(JSON.stringify(e.data||{},null,2)),[i,s]=P(!0),[l,c]=P(!1);function u(m){a(m),c(!1);try{JSON.parse(m),s(!0)}catch{s(!1)}}function d(){navigator.clipboard.writeText(n).then(()=>c(!0))}function p(){let m=JSON.parse(n);e.onSave&&e.onSave(m)}return f("div",{className:"EditJsonModal",children:[f("h3",{children:"EditJsonModal"}),f(Mc,{value:n,onChange:u,formatOnBlur:!0,autosize:!0,minRows:4,maxRows:25}),f("div",{className:"EditJsonModal__buttons",children:[f(X,{variant:"default",size:"xs",color:"dark",type:"button",onClick:()=>r.closeModal(o),children:"Cancel"}),f(X,{leftIcon:f(zp,{size:16}),variant:"filled",size:"xs",color:"dark",disabled:!i,type:"button",onClick:d,children:l?"Copied!":"Copy"}),f(X,{leftIcon:f(Vp,{size:16}),variant:"filled",size:"xs",color:"blue",disabled:!i,onClick:p,children:"Save"})]})]})}Ib.id=sC;async function Lz(){let t=window.firebase.db,e=window.__ROOT_CTX.rootConfig.projectId||"default",r=we(t,"Projects",e),o=await vr(r);if(!o.exists)return[];let a=(o.data()||{}).roles||{},i=[];return Object.entries(a).forEach(([s,l])=>{(l==="ADMIN"||l==="EDITOR")&&i.push(s)}),i}var ka=class t{constructor(e){this.spreadsheetId=e}static async create(e){let r={fields:"spreadsheetId"};e?.title&&(r.resource={properties:{title:e.title}});let n=(await gapi.client.sheets.spreadsheets.create(r)).result,a=new t(n.spreadsheetId);a.setSpreadsheet(n);let i=await Lz();return await a.share(i,"writer"),a}getUrl(){return Mn({spreadsheetId:this.spreadsheetId})}async getSheet(e){if(this.sheets||await this.fetchSheets(),this.sheets){for(let r=0;r<this.sheets.length;r++)if(this.sheets[r].gid===e)return this.sheets[r]}return null}async createSheet(e){console.log("createSheet",this.spreadsheetId);let r=await gapi.client.sheets.spreadsheets.batchUpdate({spreadsheetId:this.spreadsheetId,resource:{requests:[{addSheet:{properties:{title:e.title}}}]}}),o=r.result.replies||[];if(o&&o.length>0){let n=o[0].addSheet?.properties?.sheetId;if(typeof n=="number")return new wb(this,n,e.title)}throw console.error(r),new Error("failed to get gid of new tab")}async fetchSheets(){let r=(await gapi.client.sheets.spreadsheets.get({spreadsheetId:this.spreadsheetId,fields:"sheets.properties"})).result;this.setSpreadsheet(r)}setSpreadsheet(e){this.spreadsheet=e,this.spreadsheet.sheets&&this.setSheets(this.spreadsheet.sheets)}setSheets(e){let r=[];e.forEach(o=>{let n=o.properties?.sheetId,a=o.properties?.title,i=new wb(this,n??0,a);r.push(i)}),this.sheets=r}async share(e,r){await Promise.all(e.map(async o=>{let n;o.startsWith("*@")?n={type:"domain",domain:o.slice(2),role:r}:n={type:"user",emailAddress:o,role:r},await gapi.client.drive.permissions.create({fileId:this.spreadsheetId,resource:n,sendNotificationEmail:!1,fields:"id"})}))}},wb=class{constructor(e,r,o){this.spreadsheet=e,this.gid=r,this.title=o}async updateValuesMap(e,r){let o=r.keyedBy,n=r.preserveColumns||[];if(!o)throw new Error('missing "keyedBy" argument');let[a,i]=await this.getValues(),s=[...a],l=[],c=-1,u=new Set;l.push(a.map((y,I)=>(y===o&&(c=I),n.includes(y)&&u.add(I),{hasChanges:!1,value:y})));function d(y){l[0].push({hasChanges:!0,value:y}),s.push(y)}c===-1&&d(o);let p={};i.forEach((y,I)=>{let w=I+1;l.push(y.map((v,T)=>(T===c&&v&&(v in p?console.warn(`multiple rows keyed by "${v}"`):p[v]=w),{hasChanges:!1,value:v})))});function m(y){for(let w in y)s.includes(w)||d(w);return s.map(w=>y[w]??null)}e.forEach(y=>{let I=m(y),w=y[o],v=p[w];if(v){let T=l[v];I.map((O,S)=>{S>=T.length?T.push({hasChanges:!0,value:O||""}):O!==null&&T[S].value!==O&&(!u.has(S)||!T[S].value)&&(T[S]={hasChanges:!0,value:O})})}else l.push(I.map(T=>({hasChanges:!!T,value:T||""})))});let h=s.length,g=l.length,_=a.length,x=i.length+1;(h>_||g>x)&&await this.resizeSheet({numCols:h+2,numRows:g+20});let b=[];l.forEach((y,I)=>{for(;y.length>0&&y.at(-1)?.hasChanges===!1;)y.pop();if(y.length!==0){if(y.every(w=>w.hasChanges)){b.push({range:`${this.title}!A${I+1}`,majorDimension:"ROWS",values:[y.map(w=>w.value||"")]});return}y.forEach((w,v)=>{if(w.hasChanges){let T=Bz(v);b.push({range:`${this.title}!${T}${I+1}`,majorDimension:"ROWS",values:[[w.value||""]]})}})}}),b.length>0&&await gapi.client.sheets.spreadsheets.values.batchUpdate({spreadsheetId:this.spreadsheet.spreadsheetId,resource:{data:b,valueInputOption:"RAW"}})}async replaceSheet(e,r){let o=e.length,n=r.length+1,a=[];a.push(e),a.push(...r.map(s=>e.map(l=>s[l]||""))),await this.resizeSheet({numCols:o+2,numRows:n+20}),console.log("updating cell values");let i=Bz(o-1);await gapi.client.sheets.spreadsheets.values.update({spreadsheetId:this.spreadsheet.spreadsheetId,range:`${this.title}!A1:${i}${n}`,valueInputOption:"RAW",resource:{range:`${this.title}!A1:${i}${n}`,majorDimension:"ROWS",values:a}})}async resizeSheet(e){let r=[];e.numCols&&r.push({updateSheetProperties:{properties:{sheetId:this.gid,gridProperties:{columnCount:e.numCols}},fields:"gridProperties.columnCount"}}),e.numRows&&r.push({updateSheetProperties:{properties:{sheetId:this.gid,gridProperties:{rowCount:e.numRows}},fields:"gridProperties.rowCount"}}),r.length>0&&(console.log("resizing sheet"),await gapi.client.sheets.spreadsheets.batchUpdate({spreadsheetId:this.spreadsheet.spreadsheetId,resource:{requests:r}}))}async getValues(){let r=(await gapi.client.sheets.spreadsheets.values.get({spreadsheetId:this.spreadsheet.spreadsheetId,range:this.title})).result.values;if(!r||r.length===0)return[[],[]];let o=r[0],n=r.slice(1);return[o,n]}async getValuesMap(){let[e,r]=await this.getValues();return r.map(n=>{let a={};return n.forEach((i,s)=>{let l=e[s];l&&(a[l]=String(i||""))}),a})}async setTitle(e){await gapi.client.sheets.spreadsheets.batchUpdate({spreadsheetId:this.spreadsheet.spreadsheetId,resource:{requests:[{updateSheetProperties:{properties:{title:e,sheetId:this.gid},fields:"title"}}]}}),this.title=e}getUrl(){return Mn({spreadsheetId:this.spreadsheet.spreadsheetId,gid:this.gid})}async applyL10nTheme(){await gapi.client.sheets.spreadsheets.batchUpdate({spreadsheetId:this.spreadsheet.spreadsheetId,resource:{requests:[{repeatCell:{range:{sheetId:this.gid,startRowIndex:0},cell:{userEnteredFormat:{textFormat:{fontFamily:"Ubuntu",fontSize:10}}},fields:"userEnteredFormat(textFormat)"}},{repeatCell:{range:{sheetId:this.gid,startRowIndex:0,endRowIndex:1},cell:{userEnteredFormat:{textFormat:{bold:!0,fontFamily:"Ubuntu",fontSize:10}}},fields:"userEnteredFormat(textFormat)"}},{updateSheetProperties:{properties:{sheetId:this.gid,gridProperties:{frozenRowCount:1}},fields:"gridProperties.frozenRowCount"}},{updateDimensionProperties:{range:{sheetId:this.gid,dimension:"COLUMNS",startIndex:0,endIndex:1},properties:{pixelSize:320},fields:"pixelSize"}},{updateDimensionProperties:{range:{sheetId:this.gid,dimension:"COLUMNS",startIndex:1},properties:{pixelSize:320},fields:"pixelSize"}},{repeatCell:{range:{sheetId:this.gid,startRowIndex:1,startColumnIndex:0},cell:{userEnteredFormat:{wrapStrategy:"WRAP"}},fields:"userEnteredFormat(wrapStrategy)"}}]}})}};function Mn(t){let r=[`https://docs.google.com/spreadsheets/d/${t.spreadsheetId}/edit`];return typeof t.gid=="number"&&r.push(`#gid=${t.gid}`),r.join("")}function Ki(t){if(!t.startsWith("https://docs.google.com/spreadsheets/d/"))return null;let e=t.split("/"),r=e[e.length-2],n=t.slice(t.indexOf("#")).match(/gid=(\d+)/),a=0;return n&&n[1]&&(a=parseInt(n[1])),{spreadsheetId:r,gid:a}}function Bz(t){let e=[];for(;t>=0;){let r=t%26;e.push(String.fromCharCode(r+65)),t=(t-r-1)/26}return e.reverse().join("")}function Te(t){let{className:e,as:r,size:o,weight:n,color:a,children:i,...s}=t;return f(r||"h2",{...s,className:ke(e,"heading",o&&`size:${o}`,n&&`weight:${n}`,a&&`color:${a}`),children:i})}var lC="EditTranslationsModal";function Fz(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(lC,{...e,innerProps:r,size:"900px",title:"Edit translations",overflow:"inside",className:"EditTranslationsModalWrap"})},close:()=>{t.closeModal(lC)}}}function Pu(t){let{innerProps:e,context:r,id:o}=t,n=e.strings||[],i=(window.__ROOT_CTX.rootConfig.i18n||{}).locales||["en"],[s,l]=P({}),[c,u]=P([]),[d,p]=P(!1),[m,h]=P(!1),[g,_]=P(!0);L(()=>{ji({tags:[e.docId]}).then(y=>{let I={};Object.values(y).forEach(w=>{I[w.source]=w}),l(I),_(!1)})},[e.docId]);async function x(){h(!0),await bt(async()=>{console.log("EditTranslationsModal.onSave()");let y=`edit-translations-${e.docId}`;pe({id:y,loading:!0,title:"Saving translations",message:`Updating for ${e.docId}...`,autoClose:!1,disallowClose:!0});let I=[];c.forEach(w=>{let v=s[w];I.push(v)}),await gl(e.docId,I),at({id:y,title:"Saved translations",message:`Updated translations for ${e.docId}!`,autoClose:!1})}),h(!1)}function b(y){l(I=>{let w={...I};return w[y.source]=y,w}),u(I=>{let w=new Set(I);return w.add(y.source),Array.from(w)}),p(!0)}return f("div",{className:"EditTranslationsModal",children:[f("div",{className:"EditTranslationsModal__header",children:f(X,{component:"a",href:`/cms/translations/${e.docId}`,target:"_blank",variant:"default",size:"xs",children:"Open Translations Editor"})}),g?f(Re,{}):f("table",{className:"EditTranslationsModal__table",children:[f("thead",{children:f("tr",{children:[f("th",{children:f(Te,{size:"h4",weight:"semi-bold",children:"SOURCE"})}),f("th",{children:f(Te,{size:"h4",weight:"semi-bold",children:"TRANSLATIONS"})})]})}),f("tbody",{children:n.map(y=>f("tr",{children:[f("td",{children:f("div",{className:"EditTranslationsModal__table__source",children:y})}),f("td",{children:f(Pu.StringsEditor,{source:y,locales:i,translations:s[y]||{},onChange:b})})]}))})]}),f("div",{className:"EditTranslationsModal__footer",children:[e.l10nSheet&&f("div",{className:"EditTranslationsModal__footer__gsheet",children:[f("strong",{children:"NOTE:"})," Translations for this doc are managed in"," ",f("a",{href:Mn(e.l10nSheet),target:"_blank",rel:"noopener noreferrer",children:"Google Sheets"})]}),f("div",{className:"EditTranslationsModal__footer__buttons",children:[f(X,{variant:"default",size:"xs",color:"dark",type:"button",onClick:()=>r.closeModal(o),children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",onClick:()=>x(),disabled:!d,loading:m,children:"Save"})]})]})]})}Pu.StringsEditor=t=>{let e=t.locales,[r,o]=P(t.translations||{}),[n,a]=P(!1);function i(s,l){a(!0),o(c=>{let u={...c,source:t.source};return u[s]=l,u})}return L(()=>{n&&t.onChange(r)},[n,r]),f("div",{className:"EditTranslationsModal__StringsEditor",children:e.map(s=>f("div",{className:"EditTranslationsModal__StringsEditor__row",children:[f("div",{className:"EditTranslationsModal__StringsEditor__row__locale",children:s}),f("div",{className:ke("EditTranslationsModal__StringsEditor__row__translation",r[s]?"hasValue":"empty"),children:f(Zt,{size:"xs",radius:0,autosize:!0,minRows:1,maxRows:10,value:r[s],onChange:l=>{i(s,l.currentTarget.value)}})})]}))})};Pu.id=lC;var fC=["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/spreadsheets"],fde=["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest","https://sheets.googleapis.com/$discovery/rest?version=v4"];function Xi(){let t=window.__ROOT_CTX.rootConfig.projectId,e=!!(window.__ROOT_CTX.gapi?.apiKey&&window.__ROOT_CTX.gapi?.clientId),[r,o]=P(e),[n,a]=P(0),[i,s]=uI({key:`root-cms::${t}::gapi-user-consent`,defaultValue:{}});async function l(){await Promise.all([mde(),hde()]),o(!1)}L(()=>{e&&l()},[]);function c(){return new Promise(d=>{let p=window.__ROOT_CTX.gapi.clientId,m=google.accounts.oauth2.initTokenClient({client_id:p,scope:fC.join(" "),callback:async h=>{let g=cC()+parseInt(h.expires_in);a(g),s({at:cC(),clientId:p,scopes:fC}),d()}});i&&pde(i)?(console.log("requesting token without prompt"),m.requestAccessToken({prompt:""})):(console.log("requesting token with prompt"),m.requestAccessToken({prompt:"consent"}))})}function u(){return cC()<n}return{enabled:e,loading:r,isLoggedIn:u,login:c}}function pde(t){if(!t||!t.at)return!1;let e=window.__ROOT_CTX.gapi?.clientId;if(t.clientId!==e)return!1;let r=t.scopes||[];return fC.every(o=>r.includes(o))}function cC(){return Math.floor(new Date().getTime()/1e3)}var uC=null;async function mde(){return uC||(uC=new Promise((t,e)=>{let r=document.createElement("script");r.src="https://apis.google.com/js/api.js",r.onload=()=>{gapi.load("client",async()=>{try{await gapi.client.init({}),await Promise.all(fde.map(o=>gapi.client.load(o))),console.log("gapi loaded"),t()}catch(o){console.error("Error initializing gapi:",o),e(o)}})},r.onerror=()=>{console.error("gapi script failed to load"),e(new Error("gapi script failed to load"))},document.head.appendChild(r)})),uC}var dC=null;async function hde(){return dC||(dC=new Promise((t,e)=>{let r=document.createElement("script");r.src="https://accounts.google.com/gsi/client",r.onload=()=>{t()},r.onerror=()=>{console.error("gis script failed to load"),e(new Error("gis script failed to load"))},document.head.appendChild(r)})),dC}var zz="ExportSheetModal";function Uz(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(zz,{...e,title:"Export to Google Sheet",innerProps:r,size:"650px"})}}}function Ou(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(!1),[i,s]=P("new-sheet"),[l,c]=P(""),[u,d]=P(!1),p=Xi(),m=[{value:"new-sheet",label:"Create Google Sheet",help:"Creates a new Google Sheet and exports strings to the sheet."},{value:"add-tab",label:"Add tab in Google Sheet",help:"Adds a new tab in an existing Google Sheet and exports strings to the sheet."},{value:"link-sheet",label:"Link Google Sheet",help:"Links an existing Google Sheet without exporting strings."}],h=!1;(i==="add-tab"||i==="link-sheet")&&(h=!0,l&&Ki(l)?.spreadsheetId&&(h=!1));async function g(I,w){let v=w?.isNew||!1,{headers:T,rows:O}=e.csvData;v?(await I.replaceSheet(T,O),await I.applyL10nTheme()):await I.updateValuesMap(O,{keyedBy:"source",preserveColumns:e.locales})}async function _(){p.isLoggedIn()||await p.login();let I=window.__ROOT_CTX.rootConfig,w=I.projectName||I.projectId||"Root CMS",v,T,O="create-google-sheet";try{if(pe({id:O,loading:!0,title:"Creating Google Sheet...",message:"Creating Google Sheet for localization.",autoClose:!1,disallowClose:!0}),v=await ka.create({title:`${w} Localization`}),T=await v.getSheet(0),!T)throw new Error("could not find sheet gid=0");T.setTitle(e.docId)}catch(S){console.error(S);let C=S;typeof S=="object"&&S.body&&(C=String(S.body)),at({id:O,title:"Failed to create Google Sheet",message:String(C),color:"red",autoClose:!1});return}try{at({id:O,loading:!0,title:"Created Google Sheet!",message:`Linking sheet to ${e.docId}...`,autoClose:!1,disallowClose:!0});let S={spreadsheetId:v.spreadsheetId,gid:0};await pb(e.docId,S),c(T.getUrl())}catch(S){console.error(S),at({id:O,title:"Failed to link Google Sheet",message:String(S),color:"red",autoClose:!1});return}try{at({id:O,loading:!0,title:"Linked Google Sheet!",message:"Exporting strings to sheet...",autoClose:!1,disallowClose:!0}),await g(T,{isNew:!0})}catch(S){console.error(S);let C=S;typeof S=="object"&&S.body&&(C=String(S.body)),at({id:O,title:"Failed to export strings to Google Sheet",message:C,color:"red",autoClose:!1});return}d(!0),at({id:O,title:"Done! Exported strings to Google Sheet.",message:v.getUrl(),autoClose:!1})}async function x(){p.isLoggedIn()||await p.login();let I=Ki(l);if(!I?.spreadsheetId)throw new Error("failed to parse spreadsheet id");let w=new ka(I.spreadsheetId),v,T="add-tab-google-sheet";try{pe({id:T,loading:!0,title:"Creating tab in Google Sheet...",message:"Adding tab in existing Google Sheet",autoClose:!1,disallowClose:!0}),v=await w.createSheet({title:e.docId})}catch(O){console.error(O);let S=O;typeof O=="object"&&O.body&&(S=String(O.body)),at({id:T,title:"Failed to create Google Sheet",message:String(S),color:"red",autoClose:!1});return}try{at({id:T,loading:!0,title:"Created Google Sheet!",message:`Linking sheet to ${e.docId}...`,autoClose:!1,disallowClose:!0});let O={spreadsheetId:w.spreadsheetId,gid:v.gid};await pb(e.docId,O)}catch(O){console.error(O),at({id:T,title:"Failed to link Google Sheet",message:String(O),color:"red",autoClose:!1});return}try{at({id:T,loading:!0,title:"Linked Google Sheet!",message:"Exporting strings to sheet...",autoClose:!1,disallowClose:!0}),await g(v,{isNew:!0})}catch(O){console.error(O);let S=O;typeof O=="object"&&O.body&&(S=String(O.body)),at({id:T,title:"Failed to export strings to Google Sheet",message:S,color:"red",autoClose:!1});return}d(!0),at({id:T,title:"Done! Exported strings to Google Sheet.",message:v.getUrl(),autoClose:!1})}async function b(){let I="link-google-sheet",w=Ki(l);if(!w?.spreadsheetId)throw new Error("failed to parse spreadsheet id");try{pe({id:I,loading:!0,title:"Link Google Sheet",message:`Linking sheet to ${e.docId}...`,autoClose:!1,disallowClose:!0}),await pb(e.docId,w)}catch(v){console.error(v),at({id:I,title:"Failed to link Google Sheet",message:String(v),color:"red",autoClose:!1});return}d(!0),at({id:I,title:`Done! Linked ${e.docId} to Google Sheet.`,message:Mn(w),autoClose:!1})}async function y(){console.log(i),a(!0),i==="new-sheet"?await bt(_):i==="add-tab"?await bt(x):i==="link-sheet"&&await bt(b),a(!1)}return f("div",{className:"ExportSheetModal",children:f("div",{className:"ExportSheetModal__content",children:[f("div",{className:"ExportSheetModal__content__body",children:"Export strings to Google Sheet or link an existing Google Sheet for managing translations."}),f("form",{className:"ExportSheetModal__form",children:[f("div",{className:"ExportSheetModal__form__section",children:[f("div",{className:"ExportSheetModal__form__description",children:"Export options:"}),f(Pt,{itemComponent:Ou.SelectItem,data:m,onChange:I=>{s(I),I==="new-sheet"&&c("")},value:i})]}),f("div",{className:"ExportSheetModal__form__section",children:[f("div",{className:"ExportSheetModal__form__description",children:"Google Sheet URL:"}),f(gt,{disabled:i==="new-sheet",value:l,onChange:I=>c(I.currentTarget.value)})]}),f("div",{className:"ExportSheetModal__form__buttons",children:u?f(Ae,{children:[f(X,{component:"a",target:"_blank",rel:"noopener noreferrer",href:l,variant:"default",size:"xs",color:"dark",children:"Open Google Sheet"}),f(X,{variant:"filled",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"primary",children:"Done"})]}):f(Ae,{children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"primary",loading:n,disabled:h,onClick:()=>y(),children:i==="link-sheet"?"Link Google Sheet":"Export to Google Sheet"})]})})]})]})})}Ou.SelectItem=K(t=>{let{label:e,help:r,...o}=t;return f("div",{className:"ExportSheetModal__SelectItem",...o,children:[f(Me,{className:"ExportSheetModal__SelectItem__label",size:"body",children:e}),f(Me,{className:"ExportSheetModal__SelectItem__help",size:"body-sm",children:r})]})});Ou.id=zz;async function Au(t){if(!window.__ROOT_CTX.collections[t])throw new Error(`collection not found: ${t}`);let r=await window.fetch("/cms/api/collection.get",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collectionId:t})});if(r.status!==200){let n=await r.text();throw new Error(n)}return(await r.json()).data}async function Eb(t){let e=window.firebase.db,r=window.__ROOT_CTX.rootConfig.projectId,[o,n]=t.split("/",2),a=await Au(o),i=we(e,"Projects",r,"Collections",o,"Drafts",n),l=(await vr(i)).data()||{},c=new Set;return Gp(c,a.fields,l.fields||{}),Array.from(c)}function Gp(t,e,r){e.forEach(o=>{if(!o.id)return;let n=r[o.id];Sb(t,o,n)})}function Sb(t,e,r){if(!r)return;function o(n){let a=ei(n);a&&t.add(a)}if(e.type==="object")Gp(t,e.fields||[],r);else if(e.type==="array"){let n=r._array||[];for(let a of n)Sb(t,e.of,r[a])}else if(e.type==="string"||e.type==="select")e.translate&&o(r);else if(e.type==="image")e.translate&&r&&r.alt&&o(r.alt);else if(e.type==="multiselect"){if(e.translate&&Array.isArray(r))for(let n of r)o(n)}else if(e.type==="oneof"){let a=(e.types||[]).find(i=>i.name===r._type);a&&Gp(t,a.fields||[],r)}else e.type==="richtext"?e.translate&&gde(t,r):console.log(`extract: ignoring field, id=${e.id}, type=${e.type}`)}function gde(t,e){(e?.blocks||[]).forEach(o=>{_de(t,o)})}function _de(t,e){if(!e?.type)return;function r(n){if(!n)return;let a=ei(n);a&&t.add(a)}function o(n){n&&n.forEach(a=>{r(a.content),o(a.items)})}e.type==="heading"||e.type==="paragraph"?r(e.data?.text):e.type==="orderedList"||e.type==="unorderedList"?o(e.data?.items):e.type==="html"&&r(e.data?.html)}var Vz="LocalizationModal";function Hz(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(Vz,{...r,innerProps:t,size:"clamp(80%, 1024px, 1280px)",onClose:()=>{t.draft.flush()}})}}}function un(t){let e=t.innerProps;return f("div",{className:"LocalizationModal",children:f("div",{className:"LocalizationModal__layout",children:[f(un.ConfigLocales,{...e}),f(un.Translations,{...e})]})})}un.id=Vz;un.ConfigLocales=t=>{let[e,r]=P(()=>t.draft?t.draft.getLocales():["en"]),o=window.__ROOT_CTX.rootConfig.i18n||{},n=o.locales||["en"],a=o.groups||{default:{label:"",locales:n}};function i(c){return e.filter(u=>(a[c].locales||[]).includes(u))}function s(c,u){let d=new Set(e),p=a[c].locales||[];for(let h of p)u.includes(h)?d.add(h):d.delete(h);let m=Array.from(d.values()).sort();l(m)}function l(c){r(c),t.draft.setLocales(c)}return f("div",{className:"LocalizationModal__locales",children:f(Fc,{spacing:30,children:[f(Gn,{children:[f(Te,{className:"LocalizationModal__iconTitle LocalizationModal__locales__title",size:"h2",children:[f(QS,{strokeWidth:1.5}),f("span",{children:"Locales"})]}),f(un.AllNoneButtons,{onAllClicked:()=>l(n),onNoneClicked:()=>l([])})]}),f(Fc,{spacing:40,children:Object.keys(a).map(c=>{let u=a[c],d=i(c);return f(un.LocaleGroup,{group:u,groupEnabledLocales:d,allEnabledLocales:e,onChange:p=>s(c,p)})})})]})})};un.LocaleGroup=t=>{let e=t.groupEnabledLocales||[],r=t.group.locales||[],o=t.allEnabledLocales||[];function n(i){t.onChange&&t.onChange(i)}function a(i){let s=e.indexOf(i);s===-1?e.push(i):e.splice(s,1),n(e)}return f(Fc,{spacing:16,children:[t.group.label&&f(Gn,{position:"apart",children:[f(Te,{size:"h4",weight:"semi-bold",children:t.group.label}),f(un.AllNoneButtons,{onAllClicked:()=>n(r),onNoneClicked:()=>n([])})]}),f(Gn,{children:r.map(i=>{let s=e.includes(i),l=o.length<=1&&s;return f(Rc,{value:i,checked:s,disabled:l,label:$z(i),onChange:()=>a(i),size:"xs"})})})]})};un.AllNoneButtons=t=>f(Gn,{spacing:"8px",children:[f(X,{variant:"subtle",size:"xs",compact:!0,onClick:t.onAllClicked,sx:e=>({"&:hover":{backgroundColor:e.colors.gray[0]}}),children:"All"}),"/",f(X,{variant:"subtle",size:"xs",compact:!0,onClick:t.onNoneClicked,sx:e=>({"&:hover":{backgroundColor:e.colors.gray[0]}}),children:"None"})]});un.Translations=t=>{let[e,r]=P(!0),[o,n]=P([]),[a,i]=P("en"),[s,l]=P({}),[c,u]=P({}),d=Xi(),[p,m]=P(null),h=Uz(),g=Tt(()=>{let N={};return Object.values(c).forEach(R=>{N[R.source]=R}),N},[c]),_=window.__ROOT_CTX.rootConfig.i18n?.locales||[],x=_.map(N=>({value:N,label:$z(N)}));L(()=>{r(!0),Promise.all([Eb(t.docId),ji(),mb(t.docId)]).then(([N,R,z])=>{n(N),u(R),m(z),r(!1)})},[t.docId]),L(()=>{if(!a){l({});return}let N={};Object.values(c).forEach(R=>{N[R.source]=R[a]||""}),l(N)},[a,c]);function b(N,R){let z=g[N];return z&&z[R]||""}function y(){let N=_.filter(B=>B!=="en"),R=["source","en",...N],z=[];return o.forEach(B=>{let M={source:B,en:b(B,"en")||B};N.forEach(V=>{M[V]=b(B,V)}),z.push(M)}),{headers:R,rows:z}}async function I(){let{headers:N,rows:R}=y(),z=await window.fetch("/cms/api/csv.download",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:N,rows:R})});if(z.status!==200){console.error("csv.download failed:");let V=await z.text();console.error(V)}let B=await z.blob(),M=window.URL.createObjectURL(B);window.location.assign(M),window.URL.revokeObjectURL(M)}async function w(){let N=document.createElement("input");N.type="file",N.accept=".csv",N.addEventListener("change",async()=>{let R=N.files?.[0];if(R){let z=new FormData;z.append("file",R);try{let B=await fetch("/cms/api/csv.import",{method:"POST",body:z});if(B.status!==200){let U=await B.text();throw new Error(`RPCError: ${U}`)}let M=(await B.json()).data,V=await gl(t.docId,M);u(U=>Object.assign({},U,V)),pe({title:"Saved!",message:`Imported translations for ${t.docId}.`,autoClose:5e3})}catch(B){console.error(B),pe({title:"Failed to import CSV",message:String(B),color:"red",autoClose:!1})}}}),N.click()}async function v(){if(d.isLoggedIn()||await d.login(),!p?.spreadsheetId)throw new Error("no sheet linked");let R=await new ka(p.spreadsheetId).getSheet(p.gid??0);if(!R)throw new Error(`sheet not found: ${JSON.stringify(p)}`);await T(R),pe({title:"Exported strings to Google Sheet",message:R.getUrl(),autoClose:!1})}async function T(N,R){let z=R?.isNew||!1,{headers:B,rows:M}=y();z?(await N.replaceSheet(B,M),await N.applyL10nTheme()):await N.updateValuesMap(M,{keyedBy:"source",preserveColumns:_}),Je("doc.export_to_sheet",{metadata:{docId:t.docId,sheetId:{spreadsheetId:N.spreadsheet.spreadsheetId,gid:N.gid}}})}async function O(){if(d.isLoggedIn()||await d.login(),!p?.spreadsheetId)throw new Error("no sheet linked");let R=await new ka(p.spreadsheetId).getSheet(p.gid??0);if(!R)throw new Error(`sheet not found: ${JSON.stringify(p)}`);console.log("importing google sheet");let z=await R.getValuesMap(),B=await gl(t.docId,z);u(M=>Object.assign({},M,B)),pe({title:"Saved!",message:`Imported translations for ${t.docId}.`,autoClose:5e3})}async function S(){await wz(t.docId),m(null),pe({title:"Unlinked Google Sheet",message:`${t.docId} is no longer connected to a Google Sheet.`,autoClose:5e3})}async function C(N){try{await N()}catch(R){console.error(R);let z;typeof R=="object"&&R.body?z=String(R.body):z=String(R),pe({title:"Error",message:z,color:"red",autoClose:!1})}}function F(N){switch(N){case"EXPORT_DOWNLOAD_CSV":{C(I);return}case"EXPORT_GOOGLE_SHEET_LINKED":{C(v);return}case"EXPORT_GOOGLE_SHEET_SHOW_OPTIONS":{h.open({docId:t.docId,csvData:y(),locales:_});return}case"IMPORT_CSV":{C(w);return}case"IMPORT_GOOGLE_SHEET_LINKED":{C(O);return}case"UNLINK_GOOGLE_SHEET":{C(S);return}default:console.log("unhandled action: "+N)}}return e?f("div",{className:"LocalizationModal__translations__loading",children:f(Re,{color:"gray",size:"xl"})}):f("div",{className:"LocalizationModal__translations",children:[f("div",{className:"LocalizationModal__translations__header",children:[f("div",{className:"LocalizationModal__translations__titleWrap",children:[f(Te,{className:"LocalizationModal__translations__title LocalizationModal__iconTitle",size:"h2",children:[f(Wi,{strokeWidth:1.5})," ",f("span",{children:"Translations"})]}),f(X,{component:"a",href:`/cms/translations/${t.docId}`,target:"_blank",variant:"default",size:"xs",children:"Open Translations Editor"})]}),f("div",{className:"LocalizationModal__translations__header__buttons",children:[d.enabled&&p?.spreadsheetId&&f(xe,{label:"Open Google Sheet",children:f(Fe,{component:"a",href:Mn(p),target:"_blank",variant:"filled",color:"green",size:"sm",children:f(El,{size:16,strokeWidth:2.25})})}),f(xde,{onAction:F,gapiClient:d,linkedSheet:p}),f(bde,{onAction:F,gapiClient:d,linkedSheet:p})]})]}),f("table",{className:"LocalizationModal__translations__table",children:[f("tr",{className:"LocalizationModal__translations__table__row LocalizationModal__translations__table__row--header",children:[f("th",{className:"LocalizationModal__translations__table__header",children:f(Te,{size:"h4",weight:"semi-bold",children:"SOURCE STRING"})}),f("th",{className:"LocalizationModal__translations__table__header",children:f(Te,{className:"LocalizationModal__translations__localeSelect",size:"h4",weight:"semi-bold",children:[f("span",{children:"LOCALE: "})," ",f(Pt,{data:x,size:"xs",placeholder:"select locale",allowDeselect:!0,value:a,onChange:N=>i(N)})]})})]}),o.map((N,R)=>f("tr",{className:"LocalizationModal__translations__table__row",children:[f("td",{className:"LocalizationModal__translations__table__col",children:f(ne,{sx:z=>({backgroundColor:z.colors.gray[0],border:`1px solid ${z.colors.gray[3]}`,padding:"10px 20px",borderRadius:4,height:"100%"}),children:f(jt,{size:"xs",sx:{whiteSpace:"pre-wrap"},children:N})})}),f("td",{className:"LocalizationModal__translations__table__col",children:f(ne,{sx:z=>({backgroundColor:z.colors.gray[0],border:`1px solid ${z.colors.gray[3]}`,padding:"10px 20px",borderRadius:4,height:"100%"}),children:f(jt,{size:"xs",sx:{whiteSpace:"pre-wrap"},children:s[N]||" "})})})]},R))]})]})};function xde(t){function e(o){t.onAction&&t.onAction(o)}let r=t.linkedSheet;return f(ze,{className:"LocalizationModal__translations__menu",position:"bottom",placement:"end",control:f(X,{variant:"default",color:"dark",size:"xs",leftIcon:f(ti,{size:16,strokeWidth:1.75}),rightIcon:f(Cu,{size:16,strokeWidth:1.75}),children:"Import"}),children:[t.gapiClient.enabled&&f(Ae,{children:[f(ze.Label,{children:"Google Sheets"}),f(ze.Item,{className:"LocalizationModal__translations__menu__item",disabled:!r?.spreadsheetId,onClick:()=>e("IMPORT_GOOGLE_SHEET_LINKED"),children:"Import Google Sheet"}),f(ja,{})]}),f(ze.Label,{children:"File"}),f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("IMPORT_CSV"),children:"Import .csv"})]})}function bde(t){async function e(n){t.onAction&&t.onAction(n)}let o=!!t.linkedSheet?.spreadsheetId;return f(ze,{className:"LocalizationModal__translations__menu",position:"bottom",placement:"start",control:f(X,{variant:"default",color:"dark",size:"xs",leftIcon:f(bl,{size:16,strokeWidth:1.75}),rightIcon:f(Cu,{size:16,strokeWidth:1.75}),children:"Export"}),children:[t.gapiClient.enabled&&f(Ae,{children:[f(ze.Label,{children:"Google Sheets"}),o?f(Ae,{children:f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("EXPORT_GOOGLE_SHEET_LINKED"),children:"Export to Google Sheet"})}):f(Ae,{children:f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("EXPORT_GOOGLE_SHEET_SHOW_OPTIONS"),children:"Export to Google Sheet"})}),f(ja,{})]}),f(ze.Label,{children:"File"}),f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("EXPORT_DOWNLOAD_CSV"),children:"Download .csv"}),o&&f(Ae,{children:[f(ja,{}),f(ze.Label,{children:"Danger zone"}),f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("UNLINK_GOOGLE_SHEET"),color:"red",children:"Unlink Google Sheet"})]})]})}function $z(t){let e=t.split("_"),r=e[0];if(r==="ALL"){let a=String(e[1]).toUpperCase();return`${new Intl.DisplayNames(["en"],{type:"region"}).of(a)||t} (${t})`}return`${new Intl.DisplayNames(["en"],{type:"language"}).of(r)||t} (${t})`}var jz="LockPublishingModal";function qz(t){let e=Ye(),r=xt();return{open:o=>{let a={...t,...o}.unlock?`Unlock publishing for ${t.docId}`:`Lock publishing for ${t.docId}`;e.openContextModal(jz,{...r,title:a,innerProps:{...t,...o},size:"600px"})}}}function Yi(t){let{innerProps:e}=t;return e.unlock?f(Yi.Unlock,{...t}):f(Yi.Lock,{...t})}Yi.Lock=t=>{let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(0),[l,c]=P(!1),u=Ye();function d(m){return m?Math.floor(new Date(m).getTime()):0}async function p(m){m.preventDefault(),c(!0),await bt(async()=>{await xz(e.docId,{reason:n,until:i}),pe({title:"Locked!",message:`Publishing is locked for ${e.docId}.`,autoClose:1e4}),u.closeModal(o)})}return f("div",{className:"LockPublishingModal LockPublishingModal--lock",children:[f(Me,{className:"LockPublishingModal__body",children:"Are you sure you want to lock publishing? Content editors will not be able to publish until publishing is unlocked."}),f("form",{className:"LockPublishingModal__form",onSubmit:m=>p(m),children:[f("div",{className:"LockPublishingModal__form__section",children:f(gt,{name:"reason",label:"Reason",description:"Specify a short reason so other content editors know why publishing is locked.",size:"xs",radius:0,onChange:m=>{a(m.currentTarget.value)}})}),f("div",{className:"LockPublishingModal__form__section",children:f(Ho,{label:"Lock until",description:"Optional. Publishing is unlocked at the specified time. If not provided, publishing will be locked indefinitely.",size:"xs",children:f("div",{className:"DocEditor__DateTimeField",children:[f("input",{name:"until",type:"datetime-local",min:Eu(),onChange:m=>{let g=m.target.value;s(d(g))}}),f("div",{className:"DocEditor__DateTimeField__timezone",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})})}),f("div",{className:"LockPublishingModal__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",leftIcon:f(vl,{size:14}),disabled:!n,type:"submit",loading:l,children:"Lock"})]})]})]})};Yi.Unlock=t=>{let{innerProps:e,context:r,id:o}=t,[n,a]=P(!1),i=Ye();async function s(){a(!0),await bt(async()=>{await bz(e.docId),pe({title:"Unlocked!",message:`Publishing is unlocked for ${e.docId}.`,autoClose:1e4}),i.closeModal(o)})}return f("div",{className:"LockPublishingModal LockPublishingModal--unlock",children:[f(Me,{className:"LockPublishingModal__body",children:["Are you sure you want to unlock publishing for ",e.docId,"? This will re-enable content editors to publish the doc."]}),f("div",{className:"LockPublishingModal__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",leftIcon:f($p,{size:14}),loading:n,onClick:()=>s(),children:"Unlock"})]})]})};Yi.id=jz;var gC=t=>{if(typeof t>"u"||t===null||typeof t=="bigint"||Number.isNaN(t)||t===1/0||t===-1/0)return;if(["string","number","boolean"].includes(typeof t))return t;if(Array.isArray(t))return t.map(gC).filter(r=>typeof r<"u");let e={};for(let[r,o]of Object.entries(t)){let n=gC(o);typeof n<"u"&&(e[r]=n)}return e},Gz=gC,yde=(t,e,r=!1)=>{if(!Array.isArray(t)||!Array.isArray(e))throw new Error("Both arguments should be arrays.");let o=t.length,n=e.length,a=o+n,i=new Array(a);if(r){for(let s=0;s<n;s++)i[s]=e[n-s-1];for(let s=0;s<o;s++)i[s+n]=t[s];return i}for(let s=0;s<o;s++)i[s]=t[s];for(let s=0;s<n;s++)i[s+o]=e[s];return i},Ot=yde,_C=(t,e=new Map)=>{if(typeof t!="object"||t===null)return!1;if(e.has(t))return!0;if(e.set(t,!0),Array.isArray(t)){for(let r=0;r<t.length;r++)if(_C(t[r],e))return!0;return!1}for(let r in t)if(_C(t[r],e))return!0;return!1},vde=_C,xC=(t,e,r,o=1/0,n)=>{if(!t||typeof t!="object"){let i;if(!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&typeof t!="bigint"&&(i=JSON.stringify(t,e,r)),i===void 0)switch(n){case Xp.throw:throw new Error(`Value is not valid in JSON, got ${String(t)}`);case Xp.stringify:return Ide(t);default:throw new Error("Should not reach here, please report this bug.")}return i}let a=o<1?'"..."':Array.isArray(t)?`[${t.map(i=>xC(i,e,r,o-1,n)).join(",")}]`:`{${Object.keys(t).map(i=>`"${i}": ${xC(t[i],e,r,o-1,n)}`).join(", ")}}`;return JSON.stringify(JSON.parse(a),e,r)},Ide=t=>t===void 0?"undefined":t===1/0?"Infinity":t===-1/0?"-Infinity":Number.isNaN(t)?"NaN":typeof t=="bigint"?`${t}n`:String(t),Ur=xC,wde=(t,e=1/0,r=!1,o=Xp.stringify)=>t===null?"null":Array.isArray(t)||typeof t=="object"?Ur(t,void 0,r?1:void 0,e,o):Ur(t,void 0,void 0,void 0,o),Ln=wde,Wz=t=>typeof t=="boolean"?0:typeof t=="number"?1:typeof t=="string"?2:t===null?3:Array.isArray(t)?4:typeof t=="object"?5:typeof t=="symbol"?6:typeof t=="function"?7:typeof t=="bigint"?8:-1,Ede=(t,e,r)=>{let o=r.keyOrdersMap?.get(t),n=r.keyOrdersMap?.get(e);if(o!==void 0&&n!==void 0)return o-n;let a=Wz(t),i=Wz(e);if(a!==i)return a-i;if(t===null&&e===null||Array.isArray(t)&&Array.isArray(e)||a===5&&i===5)return 0;switch(typeof t){case"number":return Number.isNaN(t)&&Number.isNaN(e)||t===1/0&&e===1/0||t===-1/0&&e===-1/0?0:t-e;case"string":return r.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t<e?-1:t>e?1:0;case"boolean":return+t-+e;case"symbol":case"function":return String(t).localeCompare(String(e))}if(typeof t=="bigint"&&typeof e=="bigint"){let s=BigInt(t)-BigInt(e);return s<0?-1:s>0?1:0}return String(t).localeCompare(String(e))},Yp=Ede,Sde=t=>Array.isArray(t)?"array":t===null?"null":typeof t,ea=Sde,Cde=(t,e,r,o,n,a,i,s)=>{let l={ignoreCase:s.ignoreCase},c=Ln(n,s.maxDepth,!0,s.undefinedBehavior).split(`
|
|
37
|
+
`)}function Jue(t){return String(t).trimEnd().replace(/ $/,"")}function ede(t){let r=(window.__ROOT_CTX.rootConfig.i18n||{}).locales||["en"];for(let o of r)if(String(o).toLowerCase()===t.toLowerCase())return o;return null}async function fz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/"),a=we(r,"Projects",e,"Collections",o,"Drafts",n),i=we(r,"Projects",e,"Collections",o,"Published",n),s=we(r,"Projects",e,"Collections",o,"Scheduled",n),l=sn(r);l.delete(a),l.delete(i),l.delete(s),await l.commit(),console.log(`deleted doc: ${t}`),Je("doc.delete",{metadata:{docId:t}})}async function pz(t){await CS([t])}async function CS(t,e){if(t.length===0){console.log("no docs to publish");return}let r=window.firebase.db;if(t.length>100)throw new Error("publish docs exceeds limit of 100 docs. break up your request into multiple calls.");let o=await TS(t),n=e?.batch||sn(r);t.forEach(a=>{let i=o[a];if(!i)throw new Error(`doc does not exist: ${a}`);tde(n,a,i)}),await n.commit(),t.length===1?console.log(`published ${t[0]}`):console.log(`published ${t.length} docs: ${t.join(", ")}`);for(let a of t)Je("doc.publish",{metadata:{docId:a}});cz(t)}function tde(t,e,r){if(hl(r))throw new Error(`publishing is locked for doc: ${r.id}`);let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,[a,i]=e.split("/"),s=we(n,"Projects",o,"Collections",a,"Drafts",i),l=we(n,"Projects",o,"Collections",a,"Scheduled",i),c=we(n,"Projects",o,"Collections",a,"Published",i),u={...r},d=u.sys??{};d.modifiedAt=Ut(),d.modifiedBy=window.firebase.user.email,d.publishedAt=Ut(),d.publishedBy=window.firebase.user.email,d.firstPublishedAt??=Ut(),d.firstPublishedBy??=window.firebase.user.email,delete d.scheduledAt,delete d.scheduledBy,t.update(s,{sys:d}),t.set(c,{...u,sys:d}),t.delete(l)}async function mz(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,[n,a]=t.split("/"),i=we(o,"Projects",r,"Collections",n,"Drafts",a),s=we(o,"Projects",r,"Collections",n,"Scheduled",a);await Pp(o,async l=>{let c=await l.get(i);if(!c.exists())throw new Error(`${i.id} does not exist`);let u={...c.data()},d=u.sys??{};d.modifiedAt=Ut(),d.modifiedBy=window.firebase.user.email,d.scheduledAt=Ze.fromMillis(e),d.scheduledBy=window.firebase.user.email,l.update(i,{sys:d}),l.set(s,{...u,sys:d})}),console.log(`saved ${s.id}`),Je("doc.schedule",{metadata:{docId:t,scheduledAt:e}})}async function hz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/"),a=we(r,"Projects",e,"Collections",o,"Drafts",n),i=we(r,"Projects",e,"Collections",o,"Scheduled",n),s=we(r,"Projects",e,"Collections",o,"Published",n),l=sn(r);l.update(a,{"sys.modifiedAt":Ut(),"sys.modifiedBy":window.firebase.user.email,"sys.publishedAt":zr(),"sys.publishedBy":zr(),"sys.firstPublishedAt":zr(),"sys.firstPublishedBy":zr()}),l.delete(i),l.delete(s),await l.commit(),console.log(`unpublished ${t}`),Je("doc.unpublish",{metadata:{docId:t}}),ES(t)}async function gz(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/"),a=we(r,"Projects",e,"Collections",o,"Drafts",n),i=we(r,"Projects",e,"Collections",o,"Published",n);await Pp(r,async s=>{let l=await s.get(i);if(!l.exists())throw new Error(`${i.id} does not exist`);let c=l.data();s.set(a,c)}),console.log(`reverted draft ${t}`),Je("doc.revert",{metadata:{docId:t}})}async function _z(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/"),a=we(r,"Projects",e,"Collections",o,"Drafts",n),i=we(r,"Projects",e,"Collections",o,"Scheduled",n),s=sn(r);s.update(a,{"sys.modifiedAt":Ut(),"sys.modifiedBy":window.firebase.user.email,"sys.scheduledAt":zr(),"sys.scheduledBy":zr()}),s.delete(i),await s.commit(),console.log(`unscheduled ${t}`),Je("doc.unschedule",{metadata:{docId:t}})}async function xz(t,e){let r={lockedAt:Ut(),lockedBy:window.firebase.user.email,reason:e.reason||`Locked by ${window.firebase.user.email}.`};e.until&&(r.until=Ze.fromMillis(e.until));let o=Nn(t);await rr(o,{"sys.publishingLocked":r});let a={docId:t,reason:e.reason};e.until&&(a.until=e.until),Je("doc.lock_publishing",{metadata:a})}async function bz(t){let e=Nn(t),r={"sys.publishingLocked":zr()};await rr(e,r),Je("doc.unlock_publishing",{metadata:{docId:t}})}function fb(t){let e=Ze.now().toMillis();return(t?.sys?.scheduledAt?.toMillis()||0)>e}function hl(t){if(t?.sys?.publishingLocked){if(t.sys.publishingLocked.until){let e=Ze.now().toMillis(),r=t.sys.publishingLocked.until.toMillis();return e<r}return!0}return!1}async function yz(t,e,r){let o=Nn(t),n=await vr(o);if(!n.exists())throw new Error(`doc ${t} does not exist`);let a=n.data().fields??{};await kS(e,{fields:a,overwrite:r?.overwrite})}async function kS(t,e){let[r,o]=t.split("/"),n=Nn(t),a=await vr(n);if(a.exists()&&!e?.overwrite)throw new Error(`${t} already exists`);let i={id:t,collection:r,slug:o,sys:{createdAt:Ut(),createdBy:window.firebase.user.email,modifiedAt:Ut(),modifiedBy:window.firebase.user.email,locales:["en"]},fields:e?.fields??{}};if(a.exists()&&e?.overwrite){let s=a.data();i.sys={...s.sys,modifiedAt:Ut(),modifiedBy:window.firebase.user.email}}await vu(n,i),Je("doc.create",{metadata:{docId:t}})}async function gl(t,e,r){let n=(window.__ROOT_CTX.rootConfig.i18n||{}).locales||["en"];function a(m){for(let h of n)if(String(h).toLowerCase()===m.toLowerCase())return h;return null}let i={};for(let m of e){if(!m.source)continue;let h={source:ei(m.source)};Object.entries(m).forEach(([_,x])=>{if(_==="source")return;let b=a(_);b&&(h[b]=ei(x||""))});let g=await ub(h.source);i[g]=h}let l=[t.split("/")[0],t];r?.tags&&l.push(...r.tags);let c=SS(),u=window.firebase.db,d=sn(u),p=0;for(let m in i){let h=i[m],g=we(c,m);d.set(g,{...h,tags:A9(...l)},{merge:!0}),p+=1,p>=500&&(await d.commit(),d=sn(u),console.log(`saved ${p} strings`),p=0)}return p>0&&(await d.commit(),console.log(`saved ${p} strings`)),Je("doc.import_translations",{metadata:{docId:t}}),i}function Nn(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/");return we(r,"Projects",e,"Collections",o,"Drafts",n)}function rde(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,[o,n]=t.split("/");return we(r,"Projects",e,"Collections",o,"Published",n)}function ode(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,[n,a]=t.split("/");return we(o,"Projects",r,"Collections",n,"Drafts",a,"Versions",e)}async function TS(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o={};t.forEach(a=>{let[i,s]=a.split("/");i in o?o[i].push(s):o[i]=[s]});let n={};return await Promise.all(Object.entries(o).map(async([a,i])=>{let s=nn(r,"Projects",e,"Collections",a,"Drafts"),l=to(s,eb(Zx(),"in",i));(await an(l)).forEach(u=>{let d=`${a}/${u.id}`;n[d]=u.data()})})),n}async function vz(t){let e=window.firebase.db,r=Nn(t),o=nn(e,r.path,"Versions"),n=to(o,Qn("sys.modifiedAt","desc")),a=await an(n),i=[];return a.forEach(s=>{let l={...s.data(),_versionId:s.id};i.push(l)}),i}async function Iz(t,e){let r=Nn(t),o={"sys.modifiedAt":Ut(),"sys.modifiedBy":window.firebase.user.email,fields:e.fields||{}};await rr(r,o),Je("doc.restore_version",{metadata:{docId:t,versionModifiedAt:e.sys?.modifiedAt,versionModifiedBy:e.sys?.modifiedBy}})}async function PS(t,e){let r;e==="draft"?r=Nn(t):e==="published"?r=rde(t):r=ode(t,e);let o=await vr(r);return o.exists()?o.data():null}async function pb(t,e){if(!e?.spreadsheetId)throw new Error("no spreadsheet id");let r=Nn(t),o={"sys.l10nSheet":{spreadsheetId:e.spreadsheetId,gid:e.gid||0,linkedAt:Ut(),linkedBy:window.firebase.user.email}};await rr(r,o),Je("doc.link_sheet",{metadata:{docId:t,sheetId:e}})}async function wz(t){let e=Nn(t),r={"sys.l10nSheet":zr()};await rr(e,r),Je("doc.unlink_sheet",{metadata:{docId:t}})}async function mb(t){let e=Nn(t),n=(await vr(e)).data()?.sys?.l10nSheet||{};return n?.spreadsheetId?{spreadsheetId:n.spreadsheetId,gid:n.gid||0}:null}function db(t,e){let r={};for(let o in t){let n=t[o];if(nde(n))if(n.toMillis)r[o]=n.toMillis();else if(Object.hasOwn(n,"_array")&&Array.isArray(n._array)){let a=n._array.map(i=>{let s={...db(n[i]||{},e),_arrayKey:i};return e?.removeArrayKey&&delete s._arrayKey,s});r[o]=a}else r[o]=db(n,e);else r[o]=n}return r}function nde(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}function ke(...t){return t.filter(e=>!!e).join(" ")||void 0}var ade=0,xVe=Array.isArray;function f(t,e,r,o,n,a){var i,s,l={};for(s in e)s=="ref"?i=e[s]:l[s]=e[s];var c={type:t,props:l,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ade,__i:-1,__u:0,__source:n,__self:a};if(typeof t=="function"&&(i=t.defaultProps))for(s in i)l[s]===void 0&&(l[s]=i[s]);return he.vnode&&he.vnode(c),c}function Me(t){let{className:e,as:r,size:o,weight:n,color:a,children:i,...s}=t;return f(r||"div",{...s,className:ke(e,"text",o&&`size:${o}`,n&&`weight:${n}`,a&&`color:${a}`),children:i})}function Jn(t){let r=window.__ROOT_CTX.collections[t.collectionId];if(!r)throw new Error(`collection not found: ${t.collectionId}`);let o=r.domain||window.__ROOT_CTX.rootConfig.domain||"https://example.com",n=OS(t);return`${o}${n}`}function OS(t){let e=window.__ROOT_CTX.collections,{collectionId:r,slug:o,locale:n}=t,a=e[r];if(!a)throw new Error(`collection not found: ${r}`);let i=window.__ROOT_CTX.rootConfig,s=i.base||"/",l="/[base]/[path]";n&&(l=i.i18n.urlFormat||"/[locale]/[base]/[path]");let c="",u=a?.url;if(u)if(o){let d=u.replace(/\[.*slug\]/,o).replaceAll("--","/").replace(/\/+/g,"/");d==="/index"&&(d="/"),c=d}else c=u;return Ez(l,{base:s,path:c,locale:n||"",slug:o})}function AS(t){let e=window.__ROOT_CTX.collections,{collectionId:r,slug:o,locale:n}=t,a=e[r];if(!a)throw new Error(`collection not found: ${r}`);let i=window.__ROOT_CTX.rootConfig,s=i.base||"/",l="/[base]/[path]";n&&(l=i.i18n.urlFormat||"/[locale]/[base]/[path]");let c="",u=a?.previewUrl||a?.url;if(u)if(o){let d=u.replace(/\[.*slug\]/,o).replaceAll("--","/").replace(/\/+/g,"/");d==="/index"&&(d="/"),c=d}else c=u;return Ez(l,{base:s,path:c,locale:n||"",slug:o})}function Ez(t,e){let r=t.replaceAll(/\[\[?(\.\.\.)?([\w\-_]*)\]?\]/g,(o,n,a)=>e[a]??o);return ide(r,{trailingSlash:window.__ROOT_CTX.rootConfig.server.trailingSlash})}function ide(t,e){return t=t.replace(/\/+/g,"/"),e?.trailingSlash===!1&&t!=="/"&&t.endsWith("/")&&(t=t.replace(/\/*$/g,"")),(t.endsWith("/index")||t.endsWith("/index/"))&&(t=t.slice(0,-6)),t.startsWith("/")||(t=`/${t}`),e?.trailingSlash&&!t.endsWith("/")&&(t=`${t}/`),t}function hb(t){let[e,r]=P(t.collectionId||""),o=H(null),[n,a]=P(""),i=window.__ROOT_CTX.collections[e],s=[];t.collectionId&&t.collectionDisabled?s.push({value:t.collectionId,label:t.collectionId}):Object.keys(window.__ROOT_CTX.collections).forEach(d=>{s.push({value:d,label:d})});let l="";if(i?.url){if(n){let d=$i(n),p=i?.slugRegex;Ca(d,p)?l=Jn({collectionId:e,slug:d}):l="INVALID SLUG"}else l=Jn({collectionId:e,slug:"[slug]"});l.endsWith("/index")&&(l=l.replace(/\/index$/,"/"))}function c(d){r(d),t.onChange&&t.onChange({collectionId:d,slug:n})}function u(d){a(d),t.onChange&&t.onChange({collectionId:e,slug:d})}return f("div",{className:ke(t.className,"SlugInput"),children:[f("div",{className:"SlugInput__inputs",children:[f(Pt,{className:"SlugInput__collection",placeholder:"Collection",size:"xs",data:s,onChange:d=>c(d),value:e,disabled:!!t.collectionDisabled}),f("div",{className:"SlugInput__divider",children:"/"}),f(gt,{className:"SlugInput__slug",name:"slug",ref:o,value:n,onChange:d=>{u(d.currentTarget.value)},placeholder:"slug",autoComplete:"off",size:"xs"})]}),l&&f(Me,{className:"SlugInput__urlHelp",size:"body-sm",children:l})]})}var Sz="CopyDocModal";function Cz(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(Sz,{...r,innerProps:t})}}}function gb(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(""),[l,c]=P(""),[u,d]=P(!1),[p,m]=P(!1),h=e.fromDocId,g=h.split("/")[0];async function _(x){if(x.preventDefault(),m(!0),c(""),!g){c("Please select a collection."),m(!1);return}let b=$i(i),y=window.__ROOT_CTX.collections[n]?.slugRegex;if(!Ca(b,y)){c('Please enter a valid slug (e.g. "foo-bar-123").'),m(!1);return}let I=`${n}/${b}`;try{await yz(h,I,{overwrite:u}),r.closeModal(o),pe({title:"Copied!",message:`Succesfully copied ${h} to ${I}.`,autoClose:5e3})}catch(w){let v=String(w);c(v),v.includes("already exists")&&d(!0),m(!1);return}m(!1),ur(`/cms/content/${n}/${b}`)}return f("div",{className:"CopyDocModal",children:f("form",{onSubmit:x=>_(x),children:[f("div",{className:"CopyDocModal__from",children:[f(Me,{className:"CopyDocModal__from__label",size:"body",weight:"bold",children:"From:"}),f(Me,{className:"CopyDocModal__from__value",size:"body-sm",children:f("code",{children:e.fromDocId})})]}),f("div",{className:"CopyDocModal__to",children:[f(Me,{className:"CopyDocModal__to__label",size:"body",weight:"bold",children:"To:"}),f(hb,{className:"CopyDocModal__slug",collectionId:g,onChange:x=>{a(x.collectionId),s(x.slug)}})]}),l&&f("div",{className:"CopyDocModal__error",children:l}),f("div",{className:"CopyDocModal__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",type:"submit",size:"xs",color:"dark",loading:p,children:u?"Overwrite?":"Submit"})]})]})})}gb.id=Sz;async function bt(t){try{await t()}catch(e){console.error(e);let r;typeof e=="object"&&e.body?r=String(e.body):r=String(e),pe({title:"Error",message:r,color:"red",autoClose:!1})}}var DS=Rt(null);function kz(){let t=Mt(DS);if(!t)throw new Error("useFirebase() should be called within a <FirebaseProvider>");return t}function Su(t,e){let[r,o]=P([]),[n,a]=P(!0),s=kz().db,l=window.__ROOT_CTX.rootConfig.projectId||"default",c=async()=>{a(!0);let u=nn(s,"Projects",l,"Collections",t,"Drafts"),d=u,p=e.orderBy;p==="modifiedAt"?d=to(u,Qn("sys.modifiedAt","desc")):p==="newest"?d=to(u,Qn("sys.createdAt","desc")):p==="oldest"?d=to(u,Qn("sys.createdAt")):p==="slug"&&(d=to(u,Qn(Zx()))),await bt(async()=>{let m=await an(d),h=[];m.docs.forEach(g=>{let _=g.data(),x=g.id,b=`${t}/${x}`,y={..._,id:b,slug:x};h.push(y),Lp(b,y)}),o(h)}),a(!1)};return L(()=>{a(!0),c()},[t,e.orderBy]),[n,c,r]}function Bp(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}function oo(t,e){let r=e.split("."),o=t;for(let n of r)o||(o={}),o=o[n];return o}function RS(t){let e={};for(let r in t)if(Bp(t[r])){let o=t[r],n=RS(o);for(let a in n)e[`${r}.${a}`]=n[a]}else e[r]=t[r];return e}function Tz(t,e){return t.sort((r,o)=>{let n=r[e],a=o[e];return n<a?-1:n>a?1:0})}function _b(t,e){if(t===e)return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!_b(t[n],e[n]))return!1;return!0}let r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(let n of r)if(!_b(t[n],e[n]))return!1;return!0}var NS="DocPickerModal";function Pz(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(NS,{...e,innerProps:r,size:"700px",overflow:"inside"})},close:()=>{t.closeModal(NS)}}}function qi(t){let{innerProps:e}=t,r=Object.keys(window.__ROOT_CTX.collections);e.collections?.length&&(r=r.filter(s=>e.collections?.includes(s)));let o=[{value:"",label:"Select"}];r.forEach(s=>{o.push({value:s,label:s})});let[n,a]=P(e.initialCollection||(r.length===1?r[0]:""));function i(s){e.onChange&&e.onChange(s.id)}return f("div",{className:"DocPickerModal",children:[r.length===0&&f("div",{className:"DocPickerModal__noCollections",children:"No collections matching schema field definition."}),r.length>1&&f("div",{className:"DocPickerModal__collection__select",children:[f("div",{className:"DocPickerModal__collection__select__label",children:"Content Type:"}),f(Pt,{data:o,value:n,placeholder:"Select",onChange:s=>{a(s||"")},size:"xs",radius:0,dropdownComponent:"div"})]}),n&&f(qi.DocsList,{collection:n,onDocSelected:i})]})}qi.DocsList=t=>{let[e,,r]=Su(t.collection,{orderBy:"slug"});return f("div",{className:"DocPickerModal__DocsList",children:e?f("div",{className:"DocPickerModal__DocsList__loading",children:f(Re,{color:"gray",size:"xl"})}):r.length===0?f("div",{className:"DocPickerModal__DocsList__empty",children:"Collection is empty."}):f("div",{className:"DocPickerModal__DocsList__docs",children:r.map(o=>f(qi.DocCard,{doc:o,onDocSelected:t.onDocSelected},o.id))})})};qi.DocCard=t=>{let e=t.doc,[r,o]=e.id.split("/"),n=e.fields||{},a=window.__ROOT_CTX.collections[r],i=Jn({collectionId:r,slug:o}),s=oo(n,a.preview?.title||"meta.title"),l=oo(n,a.preview?.image||"meta.image")||a.preview?.defaultImage;return f("div",{className:"DocPickerModal__DocCard",children:[f("div",{className:"DocPickerModal__DocCard__image",children:f(Tn,{src:l?.src,width:120,height:90,withPlaceholder:!l?.src})}),f("div",{className:"DocPickerModal__DocCard__content",children:[f("div",{className:"DocPickerModal__DocCard__content__header",children:f("div",{className:"DocPickerModal__DocCard__content__header__docId",children:e.id})}),f("div",{className:"DocPickerModal__DocCard__content__title",children:s||"[UNTITLED]"}),f("div",{className:"DocPickerModal__DocCard__content__url",children:i})]}),f("div",{className:"DocPickerModal__DocCard__controls",children:f(X,{color:"blue",size:"xs",onClick:()=>t.onDocSelected(t.doc),children:"Select"})})]})};qi.id=NS;var MS="DocSelectModal";function Oz(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(MS,{...e,innerProps:r,size:"700px",overflow:"inside"})},close:()=>{t.closeModal(MS)}}}function Gi(t){let{innerProps:e}=t,r=Object.keys(window.__ROOT_CTX.collections);e.collections?.length&&(r=r.filter(l=>e.collections?.includes(l)));let o=[{value:"",label:"Select"}];r.forEach(l=>{o.push({value:l,label:l})});let[n,a]=P(e.initialCollection||(r.length===1?r[0]:""));function i(l){e.onChange&&e.onChange(l.id,!0)}function s(l){e.onChange&&e.onChange(l.id,!1)}return console.log("selected docs:",e.selectedDocIds),f("div",{className:"DocSelectModal",children:[r.length===0&&f("div",{className:"DocSelectModal__noCollections",children:"No collections matching schema field definition."}),r.length>1&&f("div",{className:"DocSelectModal__collection__select",children:[f("div",{className:"DocSelectModal__collection__select__label",children:"Content Type:"}),f(Pt,{data:o,value:n,placeholder:"Select",onChange:l=>{a(l||"")},size:"xs",radius:0,dropdownComponent:"div"})]}),n&&f(Gi.DocsList,{collection:n,onDocSelected:i,onDocUnselected:s,selectedDocIds:e.selectedDocIds})]})}Gi.DocsList=t=>{let[e,,r]=Su(t.collection,{orderBy:"slug"}),o=t.selectedDocIds||[];return f("div",{className:"DocSelectModal__DocsList",children:e?f("div",{className:"DocSelectModal__DocsList__loading",children:f(Re,{color:"gray",size:"xl"})}):r.length===0?f("div",{className:"DocSelectModal__DocsList__empty",children:"Collection is empty."}):f("div",{className:"DocSelectModal__DocsList__docs",children:r.map(n=>f(Gi.DocCard,{doc:n,onDocSelected:t.onDocSelected,onDocUnselected:t.onDocUnselected,selected:o.includes(n.id)},n.id))})})};Gi.DocCard=t=>{let[e,r]=P(!!t.selected),o=t.doc,[n,a]=o.id.split("/"),i=o.fields||{},s=window.__ROOT_CTX.collections[n],l=Jn({collectionId:n,slug:a}),c=oo(i,s.preview?.title||"meta.title"),u=oo(i,s.preview?.image||"meta.image")||s.preview?.defaultImage;return f("div",{className:"DocSelectModal__DocCard",children:[f("div",{className:"DocSelectModal__DocCard__image",children:f(Tn,{src:u?.src,width:120,height:90,withPlaceholder:!u?.src})}),f("div",{className:"DocSelectModal__DocCard__content",children:[f("div",{className:"DocSelectModal__DocCard__content__header",children:f("div",{className:"DocSelectModal__DocCard__content__header__docId",children:o.id})}),f("div",{className:"DocSelectModal__DocCard__content__title",children:c||"[UNTITLED]"}),f("div",{className:"DocSelectModal__DocCard__content__url",children:l})]}),f("div",{className:"DocSelectModal__DocCard__controls",children:e?f(X,{variant:"light",color:"blue",size:"xs",onClick:()=>{r(!1),t.onDocUnselected(t.doc)},children:"Unselect"}):f(X,{variant:"filled",color:"blue",size:"xs",onClick:()=>{r(!0),t.onDocSelected(t.doc)},children:"Select"})})]})};Gi.id=MS;var Az={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var sde=Object.defineProperty,lde=Object.defineProperties,cde=Object.getOwnPropertyDescriptors,xb=Object.getOwnPropertySymbols,Nz=Object.prototype.hasOwnProperty,Mz=Object.prototype.propertyIsEnumerable,Dz=(t,e,r)=>e in t?sde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rz=(t,e)=>{for(var r in e||(e={}))Nz.call(e,r)&&Dz(t,r,e[r]);if(xb)for(var r of xb(e))Mz.call(e,r)&&Dz(t,r,e[r]);return t},ude=(t,e)=>lde(t,cde(e)),dde=(t,e)=>{var r={};for(var o in t)Nz.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&xb)for(var o of xb(t))e.indexOf(o)<0&&Mz.call(t,o)&&(r[o]=t[o]);return r},Y=(t,e,r)=>{let o=n=>{var a=n,{color:i="currentColor",size:s=24,stroke:l=2,children:c}=a,u=dde(a,["color","size","stroke","children"]);return Q("svg",Rz(ude(Rz({},Az),{width:s,height:s,stroke:i,"stroke-width":l,class:`tabler-icon tabler-icon-${t}`}),u),[...r.map(([d,p])=>Q(d,p)),...yo(c)])};return o.displayName=`${e}`,o};var LS=Y("alarm-off","IconAlarmOff",[["path",{d:"M7.587 7.566a7 7 0 1 0 9.833 9.864m1.35 -2.645a7 7 0 0 0 -8.536 -8.56",key:"svg-0"}],["path",{d:"M12 12v1h1",key:"svg-1"}],["path",{d:"M5.261 5.265l-1.011 .735",key:"svg-2"}],["path",{d:"M17 4l2.75 2",key:"svg-3"}],["path",{d:"M3 3l18 18",key:"svg-4"}]]);var BS=Y("arrow-back","IconArrowBack",[["path",{d:"M9 11l-4 4l4 4m-4 -4h11a4 4 0 0 0 0 -8h-1",key:"svg-0"}]]);var FS=Y("arrow-left","IconArrowLeft",[["path",{d:"M5 12l14 0",key:"svg-0"}],["path",{d:"M5 12l6 6",key:"svg-1"}],["path",{d:"M5 12l6 -6",key:"svg-2"}]]);var zS=Y("arrow-roundabout-right","IconArrowRoundaboutRight",[["path",{d:"M21 9h-8a5 5 0 1 0 -5 5v7",key:"svg-0"}],["path",{d:"M17 5l4 4l-4 4",key:"svg-1"}]]);var _l=Y("arrow-up-right","IconArrowUpRight",[["path",{d:"M17 7l-10 10",key:"svg-0"}],["path",{d:"M8 7l9 0l0 9",key:"svg-1"}]]);var Fp=Y("braces","IconBraces",[["path",{d:"M7 4a2 2 0 0 0 -2 2v3a2 3 0 0 1 -2 3a2 3 0 0 1 2 3v3a2 2 0 0 0 2 2",key:"svg-0"}],["path",{d:"M17 4a2 2 0 0 1 2 2v3a2 3 0 0 0 2 3a2 3 0 0 0 -2 3v3a2 2 0 0 1 -2 2",key:"svg-1"}]]);var US=Y("carrot","IconCarrot",[["path",{d:"M3 21s9.834 -3.489 12.684 -6.34a4.487 4.487 0 0 0 0 -6.344a4.483 4.483 0 0 0 -6.342 0c-2.86 2.861 -6.347 12.689 -6.347 12.689z",key:"svg-0"}],["path",{d:"M9 13l-1.5 -1.5",key:"svg-1"}],["path",{d:"M16 14l-2 -2",key:"svg-2"}],["path",{d:"M22 8s-1.14 -2 -3 -2c-1.406 0 -3 2 -3 2s1.14 2 3 2s3 -2 3 -2z",key:"svg-3"}],["path",{d:"M16 2s-2 1.14 -2 3s2 3 2 3s2 -1.577 2 -3c0 -1.86 -2 -3 -2 -3z",key:"svg-4"}]]);var Cu=Y("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);var VS=Y("circle-arrow-down","IconCircleArrowDown",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M8 12l4 4",key:"svg-1"}],["path",{d:"M12 8v8",key:"svg-2"}],["path",{d:"M16 12l-4 4",key:"svg-3"}]]);var HS=Y("circle-arrow-up","IconCircleArrowUp",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8l-4 4",key:"svg-1"}],["path",{d:"M12 8v8",key:"svg-2"}],["path",{d:"M16 12l-4 -4",key:"svg-3"}]]);var ku=Y("circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]);var $S=Y("clipboard-check","IconClipboardCheck",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M9 14l2 2l4 -4",key:"svg-2"}]]);var jS=Y("clipboard-copy","IconClipboardCopy",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h3m9 -9v-5a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M13 17v-1a1 1 0 0 1 1 -1h1m3 0h1a1 1 0 0 1 1 1v1m0 3v1a1 1 0 0 1 -1 1h-1m-3 0h-1a1 1 0 0 1 -1 -1v-1",key:"svg-1"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-2"}]]);var zp=Y("clipboard","IconClipboard",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}]]);var qS=Y("cloud-off","IconCloudOff",[["path",{d:"M9.58 5.548c.24 -.11 .492 -.207 .752 -.286c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 .957 -.383 1.824 -1.003 2.454m-2.997 1.033h-11.343c-2.572 -.004 -4.657 -2.011 -4.657 -4.487c0 -2.475 2.085 -4.482 4.657 -4.482c.13 -.582 .37 -1.128 .7 -1.62",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]]);var Up=Y("copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);var GS=Y("database","IconDatabase",[["path",{d:"M12 6m-8 0a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]]);var WS=Y("device-desktop","IconDeviceDesktop",[["path",{d:"M3 5a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v10a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1v-10z",key:"svg-0"}],["path",{d:"M7 20h10",key:"svg-1"}],["path",{d:"M9 16v4",key:"svg-2"}],["path",{d:"M15 16v4",key:"svg-3"}]]);var Vp=Y("device-floppy","IconDeviceFloppy",[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]]);var KS=Y("device-ipad","IconDeviceIpad",[["path",{d:"M18 2a3 3 0 0 1 2.995 2.824l.005 .176v14a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-14a3 3 0 0 1 2.824 -2.995l.176 -.005h12zm-3 15h-6l-.117 .007a1 1 0 0 0 0 1.986l.117 .007h6l.117 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z",key:"svg-0"}]]);var XS=Y("device-mobile","IconDeviceMobile",[["path",{d:"M6 5a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M11 4h2",key:"svg-1"}],["path",{d:"M12 17v.01",key:"svg-2"}]]);var xl=Y("dots-vertical","IconDotsVertical",[["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);var bl=Y("file-download","IconFileDownload",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17v-6",key:"svg-2"}],["path",{d:"M9.5 14.5l2.5 2.5l2.5 -2.5",key:"svg-3"}]]);var ti=Y("file-upload","IconFileUpload",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11v6",key:"svg-2"}],["path",{d:"M9.5 13.5l2.5 -2.5l2.5 2.5",key:"svg-3"}]]);var yl=Y("folder","IconFolder",[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]]);var Hp=Y("history","IconHistory",[["path",{d:"M12 8l0 4l2 2",key:"svg-0"}],["path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5",key:"svg-1"}]]);var YS=Y("home","IconHome",[["path",{d:"M5 12l-2 0l9 -9l9 9l-2 0",key:"svg-0"}],["path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7",key:"svg-1"}],["path",{d:"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6",key:"svg-2"}]]);var Wi=Y("language","IconLanguage",[["path",{d:"M4 5h7",key:"svg-0"}],["path",{d:"M9 3v2c0 4.418 -2.239 8 -5 8",key:"svg-1"}],["path",{d:"M5 9c0 2.144 2.952 3.908 6.7 4",key:"svg-2"}],["path",{d:"M12 20l4 -9l4 9",key:"svg-3"}],["path",{d:"M19.1 18h-6.2",key:"svg-4"}]]);var $p=Y("lock-open","IconLockOpen",[["path",{d:"M5 11m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M12 16m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-5a4 4 0 0 1 8 0",key:"svg-2"}]]);var vl=Y("lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]);var QS=Y("map-pin","IconMapPin",[["path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-0"}],["path",{d:"M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z",key:"svg-1"}]]);var jp=Y("mood-look-down","IconMoodLookDown",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 13h.01",key:"svg-1"}],["path",{d:"M15 13h.01",key:"svg-2"}],["path",{d:"M11 17h2",key:"svg-3"}]]);var ZS=Y("paperclip","IconPaperclip",[["path",{d:"M15 7l-6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 -6.5a3 3 0 0 0 -6 -6l-6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 -6.5",key:"svg-0"}]]);var JS=Y("photo-up","IconPhotoUp",[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M12.5 21h-6.5a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v6.5",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l3.5 3.5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.679 -.653 1.473 -.829 2.214 -.526",key:"svg-3"}],["path",{d:"M19 22v-6",key:"svg-4"}],["path",{d:"M22 19l-3 -3l-3 3",key:"svg-5"}]]);var eC=Y("photo","IconPhoto",[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]]);var tC=Y("planet","IconPlanet",[["path",{d:"M18.816 13.58c2.292 2.138 3.546 4 3.092 4.9c-.745 1.46 -5.783 -.259 -11.255 -3.838c-5.47 -3.579 -9.304 -7.664 -8.56 -9.123c.464 -.91 2.926 -.444 5.803 .805",key:"svg-0"}],["path",{d:"M12 12m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-1"}]]);var rC=Y("reload","IconReload",[["path",{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747",key:"svg-0"}],["path",{d:"M20 4v5h-5",key:"svg-1"}]]);var Il=Y("robot","IconRobot",[["path",{d:"M6 4m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M12 2v2",key:"svg-1"}],["path",{d:"M9 12v9",key:"svg-2"}],["path",{d:"M15 12v9",key:"svg-3"}],["path",{d:"M5 16l4 -2",key:"svg-4"}],["path",{d:"M15 14l4 2",key:"svg-5"}],["path",{d:"M9 18h6",key:"svg-6"}],["path",{d:"M10 8v.01",key:"svg-7"}],["path",{d:"M14 8v.01",key:"svg-8"}]]);var Tu=Y("rocket","IconRocket",[["path",{d:"M4 13a8 8 0 0 1 7 7a6 6 0 0 0 3 -5a9 9 0 0 0 6 -8a3 3 0 0 0 -3 -3a9 9 0 0 0 -8 6a6 6 0 0 0 -5 3",key:"svg-0"}],["path",{d:"M7 14a6 6 0 0 0 -3 6a6 6 0 0 0 6 -3",key:"svg-1"}],["path",{d:"M15 9m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);var bb=Y("row-insert-bottom","IconRowInsertBottom",[["path",{d:"M20 6v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1z",key:"svg-0"}],["path",{d:"M12 15l0 4",key:"svg-1"}],["path",{d:"M14 17l-4 0",key:"svg-2"}]]);var yb=Y("row-insert-top","IconRowInsertTop",[["path",{d:"M4 18v-4a1 1 0 0 1 1 -1h14a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-14a1 1 0 0 1 -1 -1z",key:"svg-0"}],["path",{d:"M12 9v-4",key:"svg-1"}],["path",{d:"M10 7l4 0",key:"svg-2"}]]);var oC=Y("send-2","IconSend2",[["path",{d:"M4.698 4.034l16.302 7.966l-16.302 7.966a.503 .503 0 0 1 -.546 -.124a.555 .555 0 0 1 -.12 -.568l2.468 -7.274l-2.468 -7.274a.555 .555 0 0 1 .12 -.568a.503 .503 0 0 1 .546 -.124z",key:"svg-0"}],["path",{d:"M6.5 12h14.5",key:"svg-1"}]]);var wl=Y("settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]);var El=Y("table","IconTable",[["path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}]]);var qp=Y("trash-filled","IconTrashFilled",[["path",{d:"M20 6a1 1 0 0 1 .117 1.993l-.117 .007h-.081l-.919 11a3 3 0 0 1 -2.824 2.995l-.176 .005h-8c-1.598 0 -2.904 -1.249 -2.992 -2.75l-.005 -.167l-.923 -11.083h-.08a1 1 0 0 1 -.117 -1.993l.117 -.007h16z",fill:"currentColor",key:"svg-0",strokeWidth:"0"}],["path",{d:"M14 2a2 2 0 0 1 2 2a1 1 0 0 1 -1.993 .117l-.007 -.117h-4l-.007 .117a1 1 0 0 1 -1.993 -.117a2 2 0 0 1 1.85 -1.995l.15 -.005h4z",fill:"currentColor",key:"svg-1",strokeWidth:"0"}]]);var cn=Y("trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);var nC=Y("triangle-filled","IconTriangleFilled",[["path",{d:"M12 1.67a2.914 2.914 0 0 0 -2.492 1.403l-8.11 13.537a2.914 2.914 0 0 0 2.484 4.385h16.225a2.914 2.914 0 0 0 2.503 -4.371l-8.116 -13.546a2.917 2.917 0 0 0 -2.494 -1.408z",fill:"currentColor",key:"svg-0",strokeWidth:"0"}]]);var aC=Y("world","IconWorld",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M3.6 9h16.8",key:"svg-1"}],["path",{d:"M3.6 15h16.8",key:"svg-2"}],["path",{d:"M11.5 3a17 17 0 0 0 0 18",key:"svg-3"}],["path",{d:"M12.5 3a17 17 0 0 1 0 18",key:"svg-4"}]]);var iC=Y("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);var sC="EditJsonModal";function vb(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(sC,{...e,innerProps:r,size:"680px"})},close:()=>{t.closeModal(sC)}}}function Ib(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(JSON.stringify(e.data||{},null,2)),[i,s]=P(!0),[l,c]=P(!1);function u(m){a(m),c(!1);try{JSON.parse(m),s(!0)}catch{s(!1)}}function d(){navigator.clipboard.writeText(n).then(()=>c(!0))}function p(){let m=JSON.parse(n);e.onSave&&e.onSave(m)}return f("div",{className:"EditJsonModal",children:[f("h3",{children:"EditJsonModal"}),f(Mc,{value:n,onChange:u,formatOnBlur:!0,autosize:!0,minRows:4,maxRows:25}),f("div",{className:"EditJsonModal__buttons",children:[f(X,{variant:"default",size:"xs",color:"dark",type:"button",onClick:()=>r.closeModal(o),children:"Cancel"}),f(X,{leftIcon:f(zp,{size:16}),variant:"filled",size:"xs",color:"dark",disabled:!i,type:"button",onClick:d,children:l?"Copied!":"Copy"}),f(X,{leftIcon:f(Vp,{size:16}),variant:"filled",size:"xs",color:"blue",disabled:!i,onClick:p,children:"Save"})]})]})}Ib.id=sC;async function Lz(){let t=window.firebase.db,e=window.__ROOT_CTX.rootConfig.projectId||"default",r=we(t,"Projects",e),o=await vr(r);if(!o.exists)return[];let a=(o.data()||{}).roles||{},i=[];return Object.entries(a).forEach(([s,l])=>{(l==="ADMIN"||l==="EDITOR")&&i.push(s)}),i}var ka=class t{constructor(e){this.spreadsheetId=e}static async create(e){let r={fields:"spreadsheetId"};e?.title&&(r.resource={properties:{title:e.title}});let n=(await gapi.client.sheets.spreadsheets.create(r)).result,a=new t(n.spreadsheetId);a.setSpreadsheet(n);let i=await Lz();return await a.share(i,"writer"),a}getUrl(){return Mn({spreadsheetId:this.spreadsheetId})}async getSheet(e){if(this.sheets||await this.fetchSheets(),this.sheets){for(let r=0;r<this.sheets.length;r++)if(this.sheets[r].gid===e)return this.sheets[r]}return null}async createSheet(e){console.log("createSheet",this.spreadsheetId);let r=await gapi.client.sheets.spreadsheets.batchUpdate({spreadsheetId:this.spreadsheetId,resource:{requests:[{addSheet:{properties:{title:e.title}}}]}}),o=r.result.replies||[];if(o&&o.length>0){let n=o[0].addSheet?.properties?.sheetId;if(typeof n=="number")return new wb(this,n,e.title)}throw console.error(r),new Error("failed to get gid of new tab")}async fetchSheets(){let r=(await gapi.client.sheets.spreadsheets.get({spreadsheetId:this.spreadsheetId,fields:"sheets.properties"})).result;this.setSpreadsheet(r)}setSpreadsheet(e){this.spreadsheet=e,this.spreadsheet.sheets&&this.setSheets(this.spreadsheet.sheets)}setSheets(e){let r=[];e.forEach(o=>{let n=o.properties?.sheetId,a=o.properties?.title,i=new wb(this,n??0,a);r.push(i)}),this.sheets=r}async share(e,r){await Promise.all(e.map(async o=>{let n;o.startsWith("*@")?n={type:"domain",domain:o.slice(2),role:r}:n={type:"user",emailAddress:o,role:r},await gapi.client.drive.permissions.create({fileId:this.spreadsheetId,resource:n,sendNotificationEmail:!1,fields:"id"})}))}},wb=class{constructor(e,r,o){this.spreadsheet=e,this.gid=r,this.title=o}async updateValuesMap(e,r){let o=r.keyedBy,n=r.preserveColumns||[];if(!o)throw new Error('missing "keyedBy" argument');let[a,i]=await this.getValues(),s=[...a],l=[],c=-1,u=new Set;l.push(a.map((y,I)=>(y===o&&(c=I),n.includes(y)&&u.add(I),{hasChanges:!1,value:y})));function d(y){l[0].push({hasChanges:!0,value:y}),s.push(y)}c===-1&&d(o);let p={};i.forEach((y,I)=>{let w=I+1;l.push(y.map((v,T)=>(T===c&&v&&(v in p?console.warn(`multiple rows keyed by "${v}"`):p[v]=w),{hasChanges:!1,value:v})))});function m(y){for(let w in y)s.includes(w)||d(w);return s.map(w=>y[w]??null)}e.forEach(y=>{let I=m(y),w=y[o],v=p[w];if(v){let T=l[v];I.map((O,S)=>{S>=T.length?T.push({hasChanges:!0,value:O||""}):O!==null&&T[S].value!==O&&(!u.has(S)||!T[S].value)&&(T[S]={hasChanges:!0,value:O})})}else l.push(I.map(T=>({hasChanges:!!T,value:T||""})))});let h=s.length,g=l.length,_=a.length,x=i.length+1;(h>_||g>x)&&await this.resizeSheet({numCols:h+2,numRows:g+20});let b=[];l.forEach((y,I)=>{for(;y.length>0&&y.at(-1)?.hasChanges===!1;)y.pop();if(y.length!==0){if(y.every(w=>w.hasChanges)){b.push({range:`${this.title}!A${I+1}`,majorDimension:"ROWS",values:[y.map(w=>w.value||"")]});return}y.forEach((w,v)=>{if(w.hasChanges){let T=Bz(v);b.push({range:`${this.title}!${T}${I+1}`,majorDimension:"ROWS",values:[[w.value||""]]})}})}}),b.length>0&&await gapi.client.sheets.spreadsheets.values.batchUpdate({spreadsheetId:this.spreadsheet.spreadsheetId,resource:{data:b,valueInputOption:"RAW"}})}async replaceSheet(e,r){let o=e.length,n=r.length+1,a=[];a.push(e),a.push(...r.map(s=>e.map(l=>s[l]||""))),await this.resizeSheet({numCols:o+2,numRows:n+20}),console.log("updating cell values");let i=Bz(o-1);await gapi.client.sheets.spreadsheets.values.update({spreadsheetId:this.spreadsheet.spreadsheetId,range:`${this.title}!A1:${i}${n}`,valueInputOption:"RAW",resource:{range:`${this.title}!A1:${i}${n}`,majorDimension:"ROWS",values:a}})}async resizeSheet(e){let r=[];e.numCols&&r.push({updateSheetProperties:{properties:{sheetId:this.gid,gridProperties:{columnCount:e.numCols}},fields:"gridProperties.columnCount"}}),e.numRows&&r.push({updateSheetProperties:{properties:{sheetId:this.gid,gridProperties:{rowCount:e.numRows}},fields:"gridProperties.rowCount"}}),r.length>0&&(console.log("resizing sheet"),await gapi.client.sheets.spreadsheets.batchUpdate({spreadsheetId:this.spreadsheet.spreadsheetId,resource:{requests:r}}))}async getValues(){let r=(await gapi.client.sheets.spreadsheets.values.get({spreadsheetId:this.spreadsheet.spreadsheetId,range:this.title})).result.values;if(!r||r.length===0)return[[],[]];let o=r[0],n=r.slice(1);return[o,n]}async getValuesMap(){let[e,r]=await this.getValues();return r.map(n=>{let a={};return n.forEach((i,s)=>{let l=e[s];l&&(a[l]=String(i||""))}),a})}async setTitle(e){await gapi.client.sheets.spreadsheets.batchUpdate({spreadsheetId:this.spreadsheet.spreadsheetId,resource:{requests:[{updateSheetProperties:{properties:{title:e,sheetId:this.gid},fields:"title"}}]}}),this.title=e}getUrl(){return Mn({spreadsheetId:this.spreadsheet.spreadsheetId,gid:this.gid})}async applyL10nTheme(){await gapi.client.sheets.spreadsheets.batchUpdate({spreadsheetId:this.spreadsheet.spreadsheetId,resource:{requests:[{repeatCell:{range:{sheetId:this.gid,startRowIndex:0},cell:{userEnteredFormat:{textFormat:{fontFamily:"Ubuntu",fontSize:10}}},fields:"userEnteredFormat(textFormat)"}},{repeatCell:{range:{sheetId:this.gid,startRowIndex:0,endRowIndex:1},cell:{userEnteredFormat:{textFormat:{bold:!0,fontFamily:"Ubuntu",fontSize:10}}},fields:"userEnteredFormat(textFormat)"}},{updateSheetProperties:{properties:{sheetId:this.gid,gridProperties:{frozenRowCount:1}},fields:"gridProperties.frozenRowCount"}},{updateDimensionProperties:{range:{sheetId:this.gid,dimension:"COLUMNS",startIndex:0,endIndex:1},properties:{pixelSize:320},fields:"pixelSize"}},{updateDimensionProperties:{range:{sheetId:this.gid,dimension:"COLUMNS",startIndex:1},properties:{pixelSize:320},fields:"pixelSize"}},{repeatCell:{range:{sheetId:this.gid,startRowIndex:1,startColumnIndex:0},cell:{userEnteredFormat:{wrapStrategy:"WRAP"}},fields:"userEnteredFormat(wrapStrategy)"}}]}})}};function Mn(t){let r=[`https://docs.google.com/spreadsheets/d/${t.spreadsheetId}/edit`];return typeof t.gid=="number"&&r.push(`#gid=${t.gid}`),r.join("")}function Ki(t){if(!t.startsWith("https://docs.google.com/spreadsheets/d/"))return null;let e=t.split("/"),r=e[e.length-2],n=t.slice(t.indexOf("#")).match(/gid=(\d+)/),a=0;return n&&n[1]&&(a=parseInt(n[1])),{spreadsheetId:r,gid:a}}function Bz(t){let e=[];for(;t>=0;){let r=t%26;e.push(String.fromCharCode(r+65)),t=(t-r-1)/26}return e.reverse().join("")}function Te(t){let{className:e,as:r,size:o,weight:n,color:a,children:i,...s}=t;return f(r||"h2",{...s,className:ke(e,"heading",o&&`size:${o}`,n&&`weight:${n}`,a&&`color:${a}`),children:i})}var lC="EditTranslationsModal";function Fz(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(lC,{...e,innerProps:r,size:"900px",title:"Edit translations",overflow:"inside",className:"EditTranslationsModalWrap"})},close:()=>{t.closeModal(lC)}}}function Pu(t){let{innerProps:e,context:r,id:o}=t,n=e.strings||[],i=(window.__ROOT_CTX.rootConfig.i18n||{}).locales||["en"],[s,l]=P({}),[c,u]=P([]),[d,p]=P(!1),[m,h]=P(!1),[g,_]=P(!0);L(()=>{ji({tags:[e.docId]}).then(y=>{let I={};Object.values(y).forEach(w=>{I[w.source]=w}),l(I),_(!1)})},[e.docId]);async function x(){h(!0),await bt(async()=>{console.log("EditTranslationsModal.onSave()");let y=`edit-translations-${e.docId}`;pe({id:y,loading:!0,title:"Saving translations",message:`Updating for ${e.docId}...`,autoClose:!1,disallowClose:!0});let I=[];c.forEach(w=>{let v=s[w];I.push(v)}),await gl(e.docId,I),at({id:y,title:"Saved translations",message:`Updated translations for ${e.docId}!`,autoClose:!1})}),h(!1)}function b(y){l(I=>{let w={...I};return w[y.source]=y,w}),u(I=>{let w=new Set(I);return w.add(y.source),Array.from(w)}),p(!0)}return f("div",{className:"EditTranslationsModal",children:[f("div",{className:"EditTranslationsModal__header",children:f(X,{component:"a",href:`/cms/translations/${e.docId}`,target:"_blank",variant:"default",size:"xs",children:"Open Translations Editor"})}),g?f(Re,{}):f("table",{className:"EditTranslationsModal__table",children:[f("thead",{children:f("tr",{children:[f("th",{children:f(Te,{size:"h4",weight:"semi-bold",children:"SOURCE"})}),f("th",{children:f(Te,{size:"h4",weight:"semi-bold",children:"TRANSLATIONS"})})]})}),f("tbody",{children:n.map(y=>f("tr",{children:[f("td",{children:f("div",{className:"EditTranslationsModal__table__source",children:y})}),f("td",{children:f(Pu.StringsEditor,{source:y,locales:i,translations:s[y]||{},onChange:b})})]}))})]}),f("div",{className:"EditTranslationsModal__footer",children:[e.l10nSheet&&f("div",{className:"EditTranslationsModal__footer__gsheet",children:[f("strong",{children:"NOTE:"})," Translations for this doc are managed in"," ",f("a",{href:Mn(e.l10nSheet),target:"_blank",rel:"noopener noreferrer",children:"Google Sheets"})]}),f("div",{className:"EditTranslationsModal__footer__buttons",children:[f(X,{variant:"default",size:"xs",color:"dark",type:"button",onClick:()=>r.closeModal(o),children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",onClick:()=>x(),disabled:!d,loading:m,children:"Save"})]})]})]})}Pu.StringsEditor=t=>{let e=t.locales,[r,o]=P(t.translations||{}),[n,a]=P(!1);function i(s,l){a(!0),o(c=>{let u={...c,source:t.source};return u[s]=l,u})}return L(()=>{n&&t.onChange(r)},[n,r]),f("div",{className:"EditTranslationsModal__StringsEditor",children:e.map(s=>f("div",{className:"EditTranslationsModal__StringsEditor__row",children:[f("div",{className:"EditTranslationsModal__StringsEditor__row__locale",children:s}),f("div",{className:ke("EditTranslationsModal__StringsEditor__row__translation",r[s]?"hasValue":"empty"),children:f(Zt,{size:"xs",radius:0,autosize:!0,minRows:1,maxRows:10,value:r[s],onChange:l=>{i(s,l.currentTarget.value)}})})]}))})};Pu.id=lC;var fC=["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/spreadsheets"],fde=["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest","https://sheets.googleapis.com/$discovery/rest?version=v4"];function Xi(){let t=window.__ROOT_CTX.rootConfig.projectId,e=!!(window.__ROOT_CTX.gapi?.apiKey&&window.__ROOT_CTX.gapi?.clientId),[r,o]=P(e),[n,a]=P(0),[i,s]=uI({key:`root-cms::${t}::gapi-user-consent`,defaultValue:{}});async function l(){await Promise.all([mde(),hde()]),o(!1)}L(()=>{e&&l()},[]);function c(){return new Promise(d=>{let p=window.__ROOT_CTX.gapi.clientId,m=google.accounts.oauth2.initTokenClient({client_id:p,scope:fC.join(" "),callback:async h=>{let g=cC()+parseInt(h.expires_in);a(g),s({at:cC(),clientId:p,scopes:fC}),d()}});i&&pde(i)?(console.log("requesting token without prompt"),m.requestAccessToken({prompt:""})):(console.log("requesting token with prompt"),m.requestAccessToken({prompt:"consent"}))})}function u(){return cC()<n}return{enabled:e,loading:r,isLoggedIn:u,login:c}}function pde(t){if(!t||!t.at)return!1;let e=window.__ROOT_CTX.gapi?.clientId;if(t.clientId!==e)return!1;let r=t.scopes||[];return fC.every(o=>r.includes(o))}function cC(){return Math.floor(new Date().getTime()/1e3)}var uC=null;async function mde(){return uC||(uC=new Promise((t,e)=>{let r=document.createElement("script");r.src="https://apis.google.com/js/api.js",r.onload=()=>{gapi.load("client",async()=>{try{await gapi.client.init({}),await Promise.all(fde.map(o=>gapi.client.load(o))),console.log("gapi loaded"),t()}catch(o){console.error("Error initializing gapi:",o),e(o)}})},r.onerror=()=>{console.error("gapi script failed to load"),e(new Error("gapi script failed to load"))},document.head.appendChild(r)})),uC}var dC=null;async function hde(){return dC||(dC=new Promise((t,e)=>{let r=document.createElement("script");r.src="https://accounts.google.com/gsi/client",r.onload=()=>{t()},r.onerror=()=>{console.error("gis script failed to load"),e(new Error("gis script failed to load"))},document.head.appendChild(r)})),dC}var zz="ExportSheetModal";function Uz(){let t=Ye(),e=xt();return{open:r=>{t.openContextModal(zz,{...e,title:"Export to Google Sheet",innerProps:r,size:"650px"})}}}function Ou(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(!1),[i,s]=P("new-sheet"),[l,c]=P(""),[u,d]=P(!1),p=Xi(),m=[{value:"new-sheet",label:"Create Google Sheet",help:"Creates a new Google Sheet and exports strings to the sheet."},{value:"add-tab",label:"Add tab in Google Sheet",help:"Adds a new tab in an existing Google Sheet and exports strings to the sheet."},{value:"link-sheet",label:"Link Google Sheet",help:"Links an existing Google Sheet without exporting strings."}],h=!1;(i==="add-tab"||i==="link-sheet")&&(h=!0,l&&Ki(l)?.spreadsheetId&&(h=!1));async function g(I,w){let v=w?.isNew||!1,{headers:T,rows:O}=e.csvData;v?(await I.replaceSheet(T,O),await I.applyL10nTheme()):await I.updateValuesMap(O,{keyedBy:"source",preserveColumns:e.locales})}async function _(){p.isLoggedIn()||await p.login();let I=window.__ROOT_CTX.rootConfig,w=I.projectName||I.projectId||"Root CMS",v,T,O="create-google-sheet";try{if(pe({id:O,loading:!0,title:"Creating Google Sheet...",message:"Creating Google Sheet for localization.",autoClose:!1,disallowClose:!0}),v=await ka.create({title:`${w} Localization`}),T=await v.getSheet(0),!T)throw new Error("could not find sheet gid=0");T.setTitle(e.docId)}catch(S){console.error(S);let C=S;typeof S=="object"&&S.body&&(C=String(S.body)),at({id:O,title:"Failed to create Google Sheet",message:String(C),color:"red",autoClose:!1});return}try{at({id:O,loading:!0,title:"Created Google Sheet!",message:`Linking sheet to ${e.docId}...`,autoClose:!1,disallowClose:!0});let S={spreadsheetId:v.spreadsheetId,gid:0};await pb(e.docId,S),c(T.getUrl())}catch(S){console.error(S),at({id:O,title:"Failed to link Google Sheet",message:String(S),color:"red",autoClose:!1});return}try{at({id:O,loading:!0,title:"Linked Google Sheet!",message:"Exporting strings to sheet...",autoClose:!1,disallowClose:!0}),await g(T,{isNew:!0})}catch(S){console.error(S);let C=S;typeof S=="object"&&S.body&&(C=String(S.body)),at({id:O,title:"Failed to export strings to Google Sheet",message:C,color:"red",autoClose:!1});return}d(!0),at({id:O,title:"Done! Exported strings to Google Sheet.",message:v.getUrl(),autoClose:!1})}async function x(){p.isLoggedIn()||await p.login();let I=Ki(l);if(!I?.spreadsheetId)throw new Error("failed to parse spreadsheet id");let w=new ka(I.spreadsheetId),v,T="add-tab-google-sheet";try{pe({id:T,loading:!0,title:"Creating tab in Google Sheet...",message:"Adding tab in existing Google Sheet",autoClose:!1,disallowClose:!0}),v=await w.createSheet({title:e.docId})}catch(O){console.error(O);let S=O;typeof O=="object"&&O.body&&(S=String(O.body)),at({id:T,title:"Failed to create Google Sheet",message:String(S),color:"red",autoClose:!1});return}try{at({id:T,loading:!0,title:"Created Google Sheet!",message:`Linking sheet to ${e.docId}...`,autoClose:!1,disallowClose:!0});let O={spreadsheetId:w.spreadsheetId,gid:v.gid};await pb(e.docId,O)}catch(O){console.error(O),at({id:T,title:"Failed to link Google Sheet",message:String(O),color:"red",autoClose:!1});return}try{at({id:T,loading:!0,title:"Linked Google Sheet!",message:"Exporting strings to sheet...",autoClose:!1,disallowClose:!0}),await g(v,{isNew:!0})}catch(O){console.error(O);let S=O;typeof O=="object"&&O.body&&(S=String(O.body)),at({id:T,title:"Failed to export strings to Google Sheet",message:S,color:"red",autoClose:!1});return}d(!0),at({id:T,title:"Done! Exported strings to Google Sheet.",message:v.getUrl(),autoClose:!1})}async function b(){let I="link-google-sheet",w=Ki(l);if(!w?.spreadsheetId)throw new Error("failed to parse spreadsheet id");try{pe({id:I,loading:!0,title:"Link Google Sheet",message:`Linking sheet to ${e.docId}...`,autoClose:!1,disallowClose:!0}),await pb(e.docId,w)}catch(v){console.error(v),at({id:I,title:"Failed to link Google Sheet",message:String(v),color:"red",autoClose:!1});return}d(!0),at({id:I,title:`Done! Linked ${e.docId} to Google Sheet.`,message:Mn(w),autoClose:!1})}async function y(){console.log(i),a(!0),i==="new-sheet"?await bt(_):i==="add-tab"?await bt(x):i==="link-sheet"&&await bt(b),a(!1)}return f("div",{className:"ExportSheetModal",children:f("div",{className:"ExportSheetModal__content",children:[f("div",{className:"ExportSheetModal__content__body",children:"Export strings to Google Sheet or link an existing Google Sheet for managing translations."}),f("form",{className:"ExportSheetModal__form",children:[f("div",{className:"ExportSheetModal__form__section",children:[f("div",{className:"ExportSheetModal__form__description",children:"Export options:"}),f(Pt,{itemComponent:Ou.SelectItem,data:m,onChange:I=>{s(I),I==="new-sheet"&&c("")},value:i})]}),f("div",{className:"ExportSheetModal__form__section",children:[f("div",{className:"ExportSheetModal__form__description",children:"Google Sheet URL:"}),f(gt,{disabled:i==="new-sheet",value:l,onChange:I=>c(I.currentTarget.value)})]}),f("div",{className:"ExportSheetModal__form__buttons",children:u?f(Ae,{children:[f(X,{component:"a",target:"_blank",rel:"noopener noreferrer",href:l,variant:"default",size:"xs",color:"dark",children:"Open Google Sheet"}),f(X,{variant:"filled",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"primary",children:"Done"})]}):f(Ae,{children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"primary",loading:n,disabled:h,onClick:()=>y(),children:i==="link-sheet"?"Link Google Sheet":"Export to Google Sheet"})]})})]})]})})}Ou.SelectItem=K(t=>{let{label:e,help:r,...o}=t;return f("div",{className:"ExportSheetModal__SelectItem",...o,children:[f(Me,{className:"ExportSheetModal__SelectItem__label",size:"body",children:e}),f(Me,{className:"ExportSheetModal__SelectItem__help",size:"body-sm",children:r})]})});Ou.id=zz;async function Au(t){if(!window.__ROOT_CTX.collections[t])throw new Error(`collection not found: ${t}`);let r=await window.fetch("/cms/api/collection.get",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collectionId:t})});if(r.status!==200){let n=await r.text();throw new Error(n)}return(await r.json()).data}async function Eb(t){let e=window.firebase.db,r=window.__ROOT_CTX.rootConfig.projectId,[o,n]=t.split("/",2),a=await Au(o),i=we(e,"Projects",r,"Collections",o,"Drafts",n),l=(await vr(i)).data()||{},c=new Set;return Gp(c,a.fields,l.fields||{}),Array.from(c)}function Gp(t,e,r){e.forEach(o=>{if(!o.id)return;let n=r[o.id];Sb(t,o,n)})}function Sb(t,e,r){if(!r)return;function o(n){let a=ei(n);a&&t.add(a)}if(e.type==="object")Gp(t,e.fields||[],r);else if(e.type==="array"){let n=r._array||[];for(let a of n)Sb(t,e.of,r[a])}else if(e.type==="string"||e.type==="select")e.translate&&o(r);else if(e.type==="image")e.translate&&r&&r.alt&&o(r.alt);else if(e.type==="multiselect"){if(e.translate&&Array.isArray(r))for(let n of r)o(n)}else if(e.type==="oneof"){let a=(e.types||[]).find(i=>i.name===r._type);a&&Gp(t,a.fields||[],r)}else e.type==="richtext"?e.translate&&gde(t,r):console.log(`extract: ignoring field, id=${e.id}, type=${e.type}`)}function gde(t,e){(e?.blocks||[]).forEach(o=>{_de(t,o)})}function _de(t,e){if(!e?.type)return;function r(n){if(!n)return;let a=ei(n);a&&t.add(a)}function o(n){n&&n.forEach(a=>{r(a.content),o(a.items)})}e.type==="heading"||e.type==="paragraph"?r(e.data?.text):e.type==="orderedList"||e.type==="unorderedList"?o(e.data?.items):e.type==="html"&&r(e.data?.html)}var Vz="LocalizationModal";function Hz(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(Vz,{...r,innerProps:t,size:"clamp(80%, 1024px, 1280px)",onClose:()=>{t.draft.flush()}})}}}function un(t){let e=t.innerProps;return f("div",{className:"LocalizationModal",children:f("div",{className:"LocalizationModal__layout",children:[f(un.ConfigLocales,{...e}),f(un.Translations,{...e})]})})}un.id=Vz;un.ConfigLocales=t=>{let[e,r]=P(()=>t.draft?t.draft.getLocales():["en"]),o=window.__ROOT_CTX.rootConfig.i18n||{},n=o.locales||["en"],a=o.groups||{default:{label:"",locales:n}};function i(c){return e.filter(u=>(a[c].locales||[]).includes(u))}function s(c,u){let d=new Set(e),p=a[c].locales||[];for(let h of p)u.includes(h)?d.add(h):d.delete(h);let m=Array.from(d.values()).sort();l(m)}function l(c){r(c),t.draft.setLocales(c)}return f("div",{className:"LocalizationModal__locales",children:f(Fc,{spacing:30,children:[f(Gn,{children:[f(Te,{className:"LocalizationModal__iconTitle LocalizationModal__locales__title",size:"h2",children:[f(QS,{strokeWidth:1.5}),f("span",{children:"Locales"})]}),f(un.AllNoneButtons,{onAllClicked:()=>l(n),onNoneClicked:()=>l([])})]}),f(Fc,{spacing:40,children:Object.keys(a).map(c=>{let u=a[c],d=i(c);return f(un.LocaleGroup,{group:u,groupEnabledLocales:d,allEnabledLocales:e,onChange:p=>s(c,p)})})})]})})};un.LocaleGroup=t=>{let e=t.groupEnabledLocales||[],r=t.group.locales||[],o=t.allEnabledLocales||[];function n(i){t.onChange&&t.onChange(i)}function a(i){let s=e.indexOf(i);s===-1?e.push(i):e.splice(s,1),n(e)}return f(Fc,{spacing:16,children:[t.group.label&&f(Gn,{position:"apart",children:[f(Te,{size:"h4",weight:"semi-bold",children:t.group.label}),f(un.AllNoneButtons,{onAllClicked:()=>n(r),onNoneClicked:()=>n([])})]}),f(Gn,{children:r.map(i=>{let s=e.includes(i),l=o.length<=1&&s;return f(Rc,{value:i,checked:s,disabled:l,label:$z(i),onChange:()=>a(i),size:"xs"})})})]})};un.AllNoneButtons=t=>f(Gn,{spacing:"8px",children:[f(X,{variant:"subtle",size:"xs",compact:!0,onClick:t.onAllClicked,sx:e=>({"&:hover":{backgroundColor:e.colors.gray[0]}}),children:"All"}),"/",f(X,{variant:"subtle",size:"xs",compact:!0,onClick:t.onNoneClicked,sx:e=>({"&:hover":{backgroundColor:e.colors.gray[0]}}),children:"None"})]});un.Translations=t=>{let[e,r]=P(!0),[o,n]=P([]),[a,i]=P("en"),[s,l]=P({}),[c,u]=P({}),d=Xi(),[p,m]=P(null),h=Uz(),g=Tt(()=>{let N={};return Object.values(c).forEach(R=>{N[R.source]=R}),N},[c]),_=window.__ROOT_CTX.rootConfig.i18n?.locales||[],x=_.map(N=>({value:N,label:$z(N)}));L(()=>{r(!0),Promise.all([Eb(t.docId),ji(),mb(t.docId)]).then(([N,R,z])=>{n(N),u(R),m(z),r(!1)})},[t.docId]),L(()=>{if(!a){l({});return}let N={};Object.values(c).forEach(R=>{N[R.source]=R[a]||""}),l(N)},[a,c]);function b(N,R){let z=g[N];return z&&z[R]||""}function y(){let N=_.filter(B=>B!=="en"),R=["source","en",...N],z=[];return o.forEach(B=>{let M={source:B,en:b(B,"en")||B};N.forEach(V=>{M[V]=b(B,V)}),z.push(M)}),{headers:R,rows:z}}async function I(){let{headers:N,rows:R}=y(),z=await window.fetch("/cms/api/csv.download",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({headers:N,rows:R})});if(z.status!==200){console.error("csv.download failed:");let V=await z.text();console.error(V)}let B=await z.blob(),M=window.URL.createObjectURL(B);window.location.assign(M),window.URL.revokeObjectURL(M)}async function w(){let N=document.createElement("input");N.type="file",N.accept=".csv",N.addEventListener("change",async()=>{let R=N.files?.[0];if(R){let z=new FormData;z.append("file",R);try{let B=await fetch("/cms/api/csv.import",{method:"POST",body:z});if(B.status!==200){let U=await B.text();throw new Error(`RPCError: ${U}`)}let M=(await B.json()).data,V=await gl(t.docId,M);u(U=>Object.assign({},U,V)),pe({title:"Saved!",message:`Imported translations for ${t.docId}.`,autoClose:5e3})}catch(B){console.error(B),pe({title:"Failed to import CSV",message:String(B),color:"red",autoClose:!1})}}}),N.click()}async function v(){if(d.isLoggedIn()||await d.login(),!p?.spreadsheetId)throw new Error("no sheet linked");let R=await new ka(p.spreadsheetId).getSheet(p.gid??0);if(!R)throw new Error(`sheet not found: ${JSON.stringify(p)}`);await T(R),pe({title:"Exported strings to Google Sheet",message:R.getUrl(),autoClose:!1})}async function T(N,R){let z=R?.isNew||!1,{headers:B,rows:M}=y();z?(await N.replaceSheet(B,M),await N.applyL10nTheme()):await N.updateValuesMap(M,{keyedBy:"source",preserveColumns:_}),Je("doc.export_to_sheet",{metadata:{docId:t.docId,sheetId:{spreadsheetId:N.spreadsheet.spreadsheetId,gid:N.gid}}})}async function O(){if(d.isLoggedIn()||await d.login(),!p?.spreadsheetId)throw new Error("no sheet linked");let R=await new ka(p.spreadsheetId).getSheet(p.gid??0);if(!R)throw new Error(`sheet not found: ${JSON.stringify(p)}`);console.log("importing google sheet");let z=await R.getValuesMap(),B=await gl(t.docId,z);u(M=>Object.assign({},M,B)),pe({title:"Saved!",message:`Imported translations for ${t.docId}.`,autoClose:5e3})}async function S(){await wz(t.docId),m(null),pe({title:"Unlinked Google Sheet",message:`${t.docId} is no longer connected to a Google Sheet.`,autoClose:5e3})}async function C(N){try{await N()}catch(R){console.error(R);let z;typeof R=="object"&&R.body?z=String(R.body):z=String(R),pe({title:"Error",message:z,color:"red",autoClose:!1})}}function F(N){switch(N){case"EXPORT_DOWNLOAD_CSV":{C(I);return}case"EXPORT_GOOGLE_SHEET_LINKED":{C(v);return}case"EXPORT_GOOGLE_SHEET_SHOW_OPTIONS":{h.open({docId:t.docId,csvData:y(),locales:_});return}case"IMPORT_CSV":{C(w);return}case"IMPORT_GOOGLE_SHEET_LINKED":{C(O);return}case"UNLINK_GOOGLE_SHEET":{C(S);return}default:console.log("unhandled action: "+N)}}return e?f("div",{className:"LocalizationModal__translations__loading",children:f(Re,{color:"gray",size:"xl"})}):f("div",{className:"LocalizationModal__translations",children:[f("div",{className:"LocalizationModal__translations__header",children:[f("div",{className:"LocalizationModal__translations__titleWrap",children:[f(Te,{className:"LocalizationModal__translations__title LocalizationModal__iconTitle",size:"h2",children:[f(Wi,{strokeWidth:1.5})," ",f("span",{children:"Translations"})]}),f(X,{component:"a",href:`/cms/translations/${t.docId}`,target:"_blank",variant:"default",size:"xs",children:"Open Translations Editor"})]}),f("div",{className:"LocalizationModal__translations__header__buttons",children:[d.enabled&&p?.spreadsheetId&&f(xe,{label:"Open Google Sheet",children:f(Fe,{component:"a",href:Mn(p),target:"_blank",variant:"filled",color:"green",size:"sm",children:f(El,{size:16,strokeWidth:2.25})})}),f(xde,{onAction:F,gapiClient:d,linkedSheet:p}),f(bde,{onAction:F,gapiClient:d,linkedSheet:p})]})]}),f("table",{className:"LocalizationModal__translations__table",children:[f("tr",{className:"LocalizationModal__translations__table__row LocalizationModal__translations__table__row--header",children:[f("th",{className:"LocalizationModal__translations__table__header",children:f(Te,{size:"h4",weight:"semi-bold",children:"SOURCE STRING"})}),f("th",{className:"LocalizationModal__translations__table__header",children:f(Te,{className:"LocalizationModal__translations__localeSelect",size:"h4",weight:"semi-bold",children:[f("span",{children:"LOCALE: "})," ",f(Pt,{data:x,size:"xs",placeholder:"select locale",allowDeselect:!0,value:a,onChange:N=>i(N)})]})})]}),o.map((N,R)=>f("tr",{className:"LocalizationModal__translations__table__row",children:[f("td",{className:"LocalizationModal__translations__table__col",children:f(ne,{sx:z=>({backgroundColor:z.colors.gray[0],border:`1px solid ${z.colors.gray[3]}`,padding:"10px 20px",borderRadius:4,height:"100%"}),children:f(jt,{size:"xs",sx:{whiteSpace:"pre-wrap"},children:N})})}),f("td",{className:"LocalizationModal__translations__table__col",children:f(ne,{sx:z=>({backgroundColor:z.colors.gray[0],border:`1px solid ${z.colors.gray[3]}`,padding:"10px 20px",borderRadius:4,height:"100%"}),children:f(jt,{size:"xs",sx:{whiteSpace:"pre-wrap"},children:s[N]||" "})})})]},R))]})]})};function xde(t){function e(o){t.onAction&&t.onAction(o)}let r=t.linkedSheet;return f(ze,{className:"LocalizationModal__translations__menu",position:"bottom",placement:"end",control:f(X,{variant:"default",color:"dark",size:"xs",leftIcon:f(ti,{size:16,strokeWidth:1.75}),rightIcon:f(Cu,{size:16,strokeWidth:1.75}),children:"Import"}),children:[t.gapiClient.enabled&&f(Ae,{children:[f(ze.Label,{children:"Google Sheets"}),f(ze.Item,{className:"LocalizationModal__translations__menu__item",disabled:!r?.spreadsheetId,onClick:()=>e("IMPORT_GOOGLE_SHEET_LINKED"),children:"Import Google Sheet"}),f(ja,{})]}),f(ze.Label,{children:"File"}),f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("IMPORT_CSV"),children:"Import .csv"})]})}function bde(t){async function e(n){t.onAction&&t.onAction(n)}let o=!!t.linkedSheet?.spreadsheetId;return f(ze,{className:"LocalizationModal__translations__menu",position:"bottom",placement:"start",control:f(X,{variant:"default",color:"dark",size:"xs",leftIcon:f(bl,{size:16,strokeWidth:1.75}),rightIcon:f(Cu,{size:16,strokeWidth:1.75}),children:"Export"}),children:[t.gapiClient.enabled&&f(Ae,{children:[f(ze.Label,{children:"Google Sheets"}),o?f(Ae,{children:f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("EXPORT_GOOGLE_SHEET_LINKED"),children:"Export to Google Sheet"})}):f(Ae,{children:f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("EXPORT_GOOGLE_SHEET_SHOW_OPTIONS"),children:"Export to Google Sheet"})}),f(ja,{})]}),f(ze.Label,{children:"File"}),f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("EXPORT_DOWNLOAD_CSV"),children:"Download .csv"}),o&&f(Ae,{children:[f(ja,{}),f(ze.Label,{children:"Danger zone"}),f(ze.Item,{className:"LocalizationModal__translations__menu__item",onClick:()=>e("UNLINK_GOOGLE_SHEET"),color:"red",children:"Unlink Google Sheet"})]})]})}function $z(t){let e=t.split("_"),r=e[0];if(r==="ALL"){let a=String(e[1]).toUpperCase();return`${new Intl.DisplayNames(["en"],{type:"region"}).of(a)||t} (${t})`}return`${new Intl.DisplayNames(["en"],{type:"language"}).of(r)||t} (${t})`}var jz="LockPublishingModal";function qz(t){let e=Ye(),r=xt();return{open:o=>{let a={...t,...o}.unlock?`Unlock publishing for ${t.docId}`:`Lock publishing for ${t.docId}`;e.openContextModal(jz,{...r,title:a,innerProps:{...t,...o},size:"600px"})}}}function Yi(t){let{innerProps:e}=t;return e.unlock?f(Yi.Unlock,{...t}):f(Yi.Lock,{...t})}Yi.Lock=t=>{let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(0),[l,c]=P(!1),u=Ye();function d(m){return m?Math.floor(new Date(m).getTime()):0}async function p(m){m.preventDefault(),c(!0),await bt(async()=>{await xz(e.docId,{reason:n,until:i}),pe({title:"Locked!",message:`Publishing is locked for ${e.docId}.`,autoClose:1e4}),u.closeModal(o)})}return f("div",{className:"LockPublishingModal LockPublishingModal--lock",children:[f(Me,{className:"LockPublishingModal__body",children:"Are you sure you want to lock publishing? Content editors will not be able to publish until publishing is unlocked."}),f("form",{className:"LockPublishingModal__form",onSubmit:m=>p(m),children:[f("div",{className:"LockPublishingModal__form__section",children:f(gt,{name:"reason",label:"Reason",description:"Specify a short reason so other content editors know why publishing is locked.",size:"xs",radius:0,onChange:m=>{a(m.currentTarget.value)}})}),f("div",{className:"LockPublishingModal__form__section",children:f(Ho,{label:"Lock until",description:"Optional. Publishing is unlocked at the specified time. If not provided, publishing will be locked indefinitely.",size:"xs",children:f("div",{className:"DocEditor__DateTimeField",children:[f("input",{name:"until",type:"datetime-local",min:Eu(),onChange:m=>{let g=m.target.value;s(d(g))}}),f("div",{className:"DocEditor__DateTimeField__timezone",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})})}),f("div",{className:"LockPublishingModal__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",leftIcon:f(vl,{size:14}),disabled:!n,type:"submit",loading:l,children:"Lock"})]})]})]})};Yi.Unlock=t=>{let{innerProps:e,context:r,id:o}=t,[n,a]=P(!1),i=Ye();async function s(){a(!0),await bt(async()=>{await bz(e.docId),pe({title:"Unlocked!",message:`Publishing is unlocked for ${e.docId}.`,autoClose:1e4}),i.closeModal(o)})}return f("div",{className:"LockPublishingModal LockPublishingModal--unlock",children:[f(Me,{className:"LockPublishingModal__body",children:["Are you sure you want to unlock publishing for ",e.docId,"? This will re-enable content editors to publish the doc."]}),f("div",{className:"LockPublishingModal__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",leftIcon:f($p,{size:14}),loading:n,onClick:()=>s(),children:"Unlock"})]})]})};Yi.id=jz;var gC=t=>{if(typeof t>"u"||t===null||typeof t=="bigint"||Number.isNaN(t)||t===1/0||t===-1/0)return;if(["string","number","boolean"].includes(typeof t))return t;if(Array.isArray(t))return t.map(gC).filter(r=>typeof r<"u");let e={};for(let[r,o]of Object.entries(t)){let n=gC(o);typeof n<"u"&&(e[r]=n)}return e},Gz=gC,yde=(t,e,r=!1)=>{if(!Array.isArray(t)||!Array.isArray(e))throw new Error("Both arguments should be arrays.");let o=t.length,n=e.length,a=o+n,i=new Array(a);if(r){for(let s=0;s<n;s++)i[s]=e[n-s-1];for(let s=0;s<o;s++)i[s+n]=t[s];return i}for(let s=0;s<o;s++)i[s]=t[s];for(let s=0;s<n;s++)i[s+o]=e[s];return i},Ot=yde,_C=(t,e=new Map)=>{if(typeof t!="object"||t===null)return!1;if(e.has(t))return!0;if(e.set(t,!0),Array.isArray(t)){for(let r=0;r<t.length;r++)if(_C(t[r],e))return!0;return!1}for(let r in t)if(_C(t[r],e))return!0;return!1},vde=_C,xC=(t,e,r,o=1/0,n)=>{if(!t||typeof t!="object"){let i;if(!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&typeof t!="bigint"&&(i=JSON.stringify(t,e,r)),i===void 0)switch(n){case Xp.throw:throw new Error(`Value is not valid in JSON, got ${String(t)}`);case Xp.stringify:return Ide(t);default:throw new Error("Should not reach here, please report this bug.")}return i}let a=o<1?'"..."':Array.isArray(t)?`[${t.map(i=>xC(i,e,r,o-1,n)).join(",")}]`:`{${Object.keys(t).map(i=>`"${i}": ${xC(t[i],e,r,o-1,n)}`).join(", ")}}`;return JSON.stringify(JSON.parse(a),e,r)},Ide=t=>t===void 0?"undefined":t===1/0?"Infinity":t===-1/0?"-Infinity":Number.isNaN(t)?"NaN":typeof t=="bigint"?`${t}n`:String(t),Ur=xC,wde=(t,e=1/0,r=!1,o=Xp.stringify)=>t===null?"null":Array.isArray(t)||typeof t=="object"?Ur(t,void 0,r?1:void 0,e,o):Ur(t,void 0,void 0,void 0,o),Ln=wde,Wz=t=>typeof t=="boolean"?0:typeof t=="number"?1:typeof t=="string"?2:t===null?3:Array.isArray(t)?4:typeof t=="object"?5:typeof t=="symbol"?6:typeof t=="function"?7:typeof t=="bigint"?8:-1,Ede=(t,e,r)=>{let o=r.keyOrdersMap?.get(t),n=r.keyOrdersMap?.get(e);if(o!==void 0&&n!==void 0)return o-n;let a=Wz(t),i=Wz(e);if(a!==i)return a-i;if(t===null&&e===null||Array.isArray(t)&&Array.isArray(e)||a===5&&i===5)return 0;switch(typeof t){case"number":return Number.isNaN(t)&&Number.isNaN(e)||t===1/0&&e===1/0||t===-1/0&&e===-1/0?0:t-e;case"string":return r.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t<e?-1:t>e?1:0;case"boolean":return+t-+e;case"symbol":case"function":return String(t).localeCompare(String(e))}if(typeof t=="bigint"&&typeof e=="bigint"){let s=BigInt(t)-BigInt(e);return s<0?-1:s>0?1:0}return String(t).localeCompare(String(e))},Yp=Ede,Sde=t=>Array.isArray(t)?"array":t===null?"null":typeof t,ea=Sde,Cde=(t,e,r,o,n,a,i,s)=>{let l={ignoreCase:s.ignoreCase},c=Ln(n,s.maxDepth,!0,s.undefinedBehavior).split(`
|
|
38
38
|
`),u=Ln(a,s.maxDepth,!0,s.undefinedBehavior).split(`
|
|
39
39
|
`);if(Yp(n,a,l)!==0)if(s.showModifications){let d=Math.max(c.length,u.length);for(let p=c.length;p<d;p++)c.push("");for(let p=u.length;p<d;p++)u.push("");t.push({level:i,type:"modify",text:r?`"${r}": ${c[0]}`:c[0]});for(let p=1;p<c.length;p++)t.push({level:i+(c[p].match(/^\s+/)?.[0]?.length||0),type:"modify",text:c[p].replace(/^\s+/,"").replace(/,$/g,"")});for(let p=c.length;p<d;p++)t.push({level:i,type:"equal",text:""});e.push({level:i,type:"modify",text:o?`"${o}": ${u[0]}`:u[0]});for(let p=1;p<u.length;p++)e.push({level:i+(u[p].match(/^\s+/)?.[0]?.length||0),type:"modify",text:u[p].replace(/^\s+/,"").replace(/,$/g,"")});for(let p=u.length;p<d;p++)e.push({level:i,type:"equal",text:""})}else{t.push({level:i,type:"remove",text:r?`"${r}": ${c[0]}`:c[0]});for(let d=1;d<c.length;d++)t.push({level:i+(c[d].match(/^\s+/)?.[0]?.length||0),type:"remove",text:c[d].replace(/^\s+/,"").replace(/,$/g,"")});for(let d=0;d<u.length;d++)t.push({level:i,type:"equal",text:""});for(let d=0;d<c.length;d++)e.push({level:i,type:"equal",text:""});e.push({level:i,type:"add",text:o?`"${o}": ${u[0]}`:u[0]});for(let d=1;d<u.length;d++)e.push({level:i+(u[d].match(/^\s+/)?.[0]?.length||0),type:"add",text:u[d].replace(/^\s+/,"").replace(/,$/g,"")})}else{let d=Math.max(c.length,u.length);for(let p=c.length;p<d;p++)c.push("");for(let p=u.length;p<d;p++)u.push("");t.push({level:i,type:"equal",text:r?`"${r}": ${c[0]}`:c[0]});for(let p=1;p<c.length;p++)t.push({level:i+(c[p].match(/^\s+/)?.[0]?.length||0),type:"equal",text:c[p].replace(/^\s+/,"").replace(/,$/g,"")});e.push({level:i,type:"equal",text:o?`"${o}": ${u[0]}`:u[0]});for(let p=1;p<u.length;p++)e.push({level:i+(u[p].match(/^\s+/)?.[0]?.length||0),type:"equal",text:u[p].replace(/^\s+/,"").replace(/,$/g,"")})}},Cl=Cde,kde=(t,e)=>t.sort((r,o)=>Yp(r,o,{ignoreCase:e.ignoreCaseForKey})),Kz=kde,EU=(t,e,r=1,o,n)=>{if(r>(o.maxDepth||1/0))return[[{level:r,type:"equal",text:"..."}],[{level:r,type:"equal",text:"..."}]];let a=[],i=[];if(t===null&&e===null||t===void 0&&e===void 0)return[a,i];if(t==null){let d=Ur(e,void 0,1,void 0,o.undefinedBehavior).split(`
|
|
40
40
|
`);for(let p=0;p<d.length;p++)a.push({level:r,type:"equal",text:""}),i.push({level:r+(d[p].match(/^\s+/)?.[0]?.length||0),type:"add",text:d[p].replace(/^\s+/,"").replace(/,$/g,"")});return[a,i]}else if(e==null){let d=Ur(t,void 0,1,void 0,o.undefinedBehavior).split(`
|
|
@@ -48,9 +48,9 @@ Content-Type: `+c.contentType+`\r
|
|
|
48
48
|
`);for(let m=0;m<p.length;m++)i.push({level:n+1+(p[m].match(/^\s+/)?.[0]?.length||0),type:"remove",text:p[m].replace(/^\s+/,"").replace(/,$/g,"")}),s.push({level:n+1,type:"equal",text:""});t.shift()}else if(e.length){let p=Ln(c,void 0,!0,a.undefinedBehavior).split(`
|
|
49
49
|
`);for(let m=0;m<p.length;m++)i.push({level:n+1,type:"equal",text:""}),s.push({level:n+1+(p[m].match(/^\s+/)?.[0]?.length||0),type:"add",text:p[m].replace(/^\s+/,"").replace(/,$/g,"")});e.shift()}}return i.push({level:n,type:"equal",text:"]"}),s.push({level:n,type:"equal",text:"]"}),[i,s]},axe=SC,CC=(t,e)=>{if(!t||typeof t!="object")return t;if(Array.isArray(t)){let o=[...t];return o.sort((n,a)=>Yp(n,a,{ignoreCase:e?.ignoreCase})),o.map(n=>CC(n,e))}let r={...t};for(let o in r)r[o]=CC(r[o],e);return r},vU=CC,Xp;(function(t){t.stringify="stringify",t.ignore="ignore",t.throw="throw"})(Xp||(Xp={}));var Tb={level:0,type:"equal",text:""},IU={level:0,type:"equal",text:"{"},wU={level:0,type:"equal",text:"}"},OC=class{detectCircular(e){if(this.options.detectCircular&&vde(e))throw new Error(`Circular reference detected in object (with keys ${Object.keys(e).map(r=>`"${r}"`).join(", ")})`)}sortResultLines(e,r){for(let o=0;o<e.length;o++){let n=!1;for(let a=1;a<e.length;a++)if(e[a].type==="remove"&&e[a-1].type==="equal"&&r[a].type==="equal"&&r[a-1].type==="add"){let i=e[a-1];e[a-1]=e[a],e[a]=i;let s=r[a-1];r[a-1]=r[a],r[a]=s,n=!0}if(!n)break}}calculateLineNumbers(e){let r=0;for(let o of e)o.text&&(o.lineNumber=++r)}calculateCommas(e){let r=Array(e.length).fill(0);for(let o=e.length-1;o>0;o--)e[o].text?r[o-1]=o:r[o-1]=r[o];for(let o=0;o<e.length;o++)!e[o].text.endsWith("{")&&!e[o].text.endsWith("[")&&e[o].text&&r[o]&&e[o].level<=e[r[o]].level&&(e[o].comma=!0)}diff(e,r){this.detectCircular(e),this.detectCircular(r),(this.options.arrayDiffMethod==="unorder-normal"||this.options.arrayDiffMethod==="unorder-lcs")&&(e=vU(e,this.options),r=vU(r,this.options)),this.options.undefinedBehavior==="ignore"&&(e=Gz(e)??null,r=Gz(r)??null);let o=[],n=[],a=ea(e),i=ea(r);if(a!==i){o=Ur(e,void 0,1,this.options.maxDepth,this.options.undefinedBehavior).split(`
|
|
50
50
|
`).map(d=>({level:d.match(/^\s+/)?.[0]?.length||0,type:"remove",text:d.replace(/^\s+/,"").replace(/,$/g,""),comma:d.endsWith(",")})),n=Ur(r,void 0,1,this.options.maxDepth,this.options.undefinedBehavior).split(`
|
|
51
|
-
`).map(d=>({level:d.match(/^\s+/)?.[0]?.length||0,type:"add",text:d.replace(/^\s+/,"").replace(/,$/g,""),comma:d.endsWith(",")}));let c=o.length,u=n.length;o=Ot(o,Array(u).fill(0).map(()=>({...Tb}))),n=Ot(n,Array(c).fill(0).map(()=>({...Tb})),!0)}else a==="object"?([o,n]=Ob(e,r,1,this.options,this.arrayDiffFunc),o.unshift({...IU}),o.push({...wU}),n.unshift({...IU}),n.push({...wU})):a==="array"?[o,n]=this.arrayDiffFunc(e,r,"","",0,this.options):e!==r?this.options.ignoreCase?typeof e=="string"&&typeof r=="string"&&e.toLowerCase()===r.toLowerCase()&&(o=[{level:0,type:"equal",text:e}],n=[{level:0,type:"equal",text:r}]):this.options.showModifications?(o=[{level:0,type:"modify",text:Ur(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],n=[{level:0,type:"modify",text:Ur(r,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(o=[{level:0,type:"remove",text:Ur(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)},{...Tb}],n=[{...Tb},{level:0,type:"add",text:Ur(r,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(o=[{level:0,type:"equal",text:Ur(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],n=[{level:0,type:"equal",text:Ur(r,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]);return this.sortResultLines(o,n),this.calculateLineNumbers(o),this.calculateLineNumbers(n),this.calculateCommas(o),this.calculateCommas(n),[o,n]}constructor({detectCircular:e=!0,maxDepth:r=1/0,showModifications:o=!0,arrayDiffMethod:n="normal",ignoreCase:a=!1,ignoreCaseForKey:i=!1,recursiveEqual:s=!1,preserveKeyOrder:l,undefinedBehavior:c="stringify"}={}){this.options={detectCircular:e,maxDepth:r,showModifications:o,arrayDiffMethod:n,ignoreCase:a,ignoreCaseForKey:i,recursiveEqual:s,preserveKeyOrder:l,undefinedBehavior:c},this.arrayDiffFunc=n==="lcs"||n==="unorder-lcs"?nxe:axe}};var Qi=t=>"hasLinesBefore"in t||"hasLinesAfter"in t,ixe=(t,e,r)=>Qi(t)?r:e*(t.end-t.start+1),FU=(t,e)=>{let r=[],o,n;if(t.length&&e.length)for(t=[...t],e=[...e],o={...t.shift()},n={...e.shift()};;){if(o.start===n.start){let a=Math.min(o.end,n.end);r.push({...o,...n,end:a}),o.start=n.start=a}else if(o.start<n.start){let a=Math.min(o.end,n.start);r.push({...n,...o,end:a}),o.start=a}else{let a=Math.min(o.start,n.end);r.push({...o,...n,end:a}),n.start=a}if(!t.length||!e.length)break;o.start===o.end&&(o={...t.shift()}),n.start===n.end&&(n={...e.shift()})}return t.length||r.push(...e.map(a=>({...a,token:o.token||"plain"}))),e.length||r.push(...t),r},sxe=(t,e,r,o,n,a,i,s,l)=>{if(!e.length)return[0,0];let c=0,u=0,d=t[r];Qi(d)?c=e[r]:c=e[r]+(o-d.start)*i;let p=t[n];return Qi(p)?u=l-e[n]-s:u=l-e[n]-(a-p.start)*i,[c,u]},lxe=sxe,cxe=(t,e,r,o,n,a)=>{if(!e.length)return[0,0,0,0];let i=0,s=0,l=0,c=0,u=0,d=t.length-1;for(;;){let h=Math.floor((u+d)/2);if(e[h]+ixe(t[h],n,a)<=r?u=h+1:d=h,u===d){i=u;break}}let p=t[i];for(Qi(p)?l=p.start:l=p.start+Math.floor((r-e[i])/n),u=0,d=t.length-1;;){let h=Math.floor((u+d+1)/2);if(e[h]>=o?d=h-1:u=h,u===d){s=u;break}}let m=t[s];return Qi(m)?c=m.end:c=m.start+Math.ceil((o-e[s])/n),[i,l,s,c]},uxe=cxe,ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.applyPatch=ta.calcPatch=AC=ta.lcs=ta.diff=ta.diff_core=void 0;function dxe(t,e){let{b:r,eq:o,stack_base:n}=t,{i:a,N:i,j:s,M:l,Z:c,stack_top:u}=t;for(;;)switch(e){case 0:{e:for(;i>0&&l>0;){r.fill(0,0,2*c);let d=i-l,p=i+l,m=p&1,h=a+i-1,g=s+l-1,_=(p+m)/2,x;t:for(let b=0;b<=_;b++){let y=2*Math.max(0,b-l)-b,I=b-2*Math.max(0,b-i);for(let w=y;w<=I;w+=2){let v=r[w-1-c*Math.floor((w-1)/c)],T=r[w+1-c*Math.floor((w+1)/c)],O=w===-b||w!==b&&v<T?T:v+1,S=O-w,C=O,F=S;for(;C<i&&F<l&&o(a+C,s+F);)C++,F++;if(r[w-c*Math.floor(w/c)]=C,m===1&&(x=d-w)>=1-b&&x<b&&C+r[c+x-c*Math.floor(x/c)]>=i)if(b>1||C!==O){n[u++]=a+C,n[u++]=i-C,n[u++]=s+F,n[u++]=l-F,i=O,l=S,c=2*(Math.min(i,l)+1);continue e}else break t}for(let w=y;w<=I;w+=2){let v=r[c+w-1-c*Math.floor((w-1)/c)],T=r[c+w+1-c*Math.floor((w+1)/c)],O=w===-b||w!==b&&v<T?T:v+1,S=O-w,C=O,F=S;for(;C<i&&F<l&&o(h-C,g-F);)C++,F++;if(r[c+w-c*Math.floor(w/c)]=C,m===0&&(x=d-w)>=-b&&x<=b&&C+r[x-c*Math.floor(x/c)]>=i)if(b>0||C!==O){n[u++]=a+i-O,n[u++]=O,n[u++]=s+l-S,n[u++]=S,i=i-C,l=l-F,c=2*(Math.min(i,l)+1);continue e}else break t}}if(i!==l){l>i?(a+=i,s+=i,l-=i,i=0):(a+=l,s+=l,i-=l,l=0);break}}if(i+l!==0)if(t.pxe===a||t.pye===s)t.pxe=a+i,t.pye=s+l;else{let d=t.pxs;if(t.oxs=t.pxs,t.oxe=t.pxe,t.oys=t.pys,t.oye=t.pye,t.pxs=a,t.pxe=a+i,t.pys=s,t.pye=s+l,d>=0)return t.i=a,t.N=i,t.j=s,t.M=l,t.Z=c,t.stack_top=u,1}}case 1:{if(u===0)return 2;l=n[--u],s=n[--u],i=n[--u],a=n[--u],c=2*(Math.min(i,l)+1),e=0}}}var fxe=class{[Symbol.iterator](){return this}next(){let{state:e,result:r}=this;if(this.c>1)return r.done=!0,r.value=void 0,r;let o=dxe(e,this.c);return this.c=o,o===1?(r.value=[e.oxs,e.oxe,e.oys,e.oye],r):e.pxs>=0?(r.value=[e.pxs,e.pxe,e.pys,e.pye],r):(r.done=!0,r.value=void 0,r)}constructor(e){this.state=e,this.c=0,this.result={value:null,done:!1}}};function jU(t,e,r,o,n){let a=(Math.min(e,o)+1)*2,i=e+o,s=new(i<256?Uint8Array:i<65536?Uint16Array:Uint32Array)(2*a);return new fxe({i:t,N:e,j:r,M:o,Z:a,b:s,eq:n,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}ta.diff_core=jU;function DC(t,e){let[r,o,n]=[0,t.length,e.length];for(;r<o&&r<n&&t[r]===e[r];)r++;if(r===o&&r===n)return[][Symbol.iterator]();for(;t[--o]===e[--n]&&o>r&&n>r;);let a=(i,s)=>t[i]===e[s];return jU(r,o+1-r,r,n+1-r,a)}ta.diff=DC;var pxe=class{[Symbol.iterator](){return this}next(){let e=this.diff.next();if(e.done){let{i:l,j:c,N:u}=this;return l<u&&(e.done=!1,e.value=[l,c,u-l],this.i=u),e}let r=e.value,o=r[0],n=r[1],a=r[3],{i,j:s}=this;return i!==o&&(r.length--,r[0]=i,r[1]=s,r[2]=o-i),this.i=n,this.j=a,e}constructor(e,r){this.diff=e,this.N=r,this.i=0,this.j=0}};function mxe(t,e){return new pxe(DC(t,e),t.length)}var AC=ta.lcs=mxe;function*hxe(t,e){let r=ArrayBuffer.isView(t)?Uint8Array.prototype.subarray:t.slice;for(let o of DC(t,e))o[2]=r.call(e,o[2],o[3]),yield o}ta.calcPatch=hxe;function*gxe(t,e){let r=0,o=ArrayBuffer.isView(t)?Uint8Array.prototype.subarray:t.slice;for(let[n,a,i]of e)r<n&&(yield o.call(t,r,n)),i.length>0&&(yield i),r=a;r<t.length&&(yield o.call(t,r))}ta.applyPatch=gxe;var zU=(t,e)=>{let r=[],o=0;for(let n of t)r.push(o),o+=n.length+e;return r.push(o-e),r},zb=t=>t.filter(e=>e.end>e.start),_xe=(t,e,r)=>{let o=[],n=[],a=0,i=0;if(r.mode==="word"){let l=r.wordSeparator||" ",c=t.split(l),u=e.split(l),d=[...AC(c,u)],p=l.length,m=zU(c,p),h=zU(u,p);for(let[g,_,x]of d)g>a&&o.push({type:"remove",start:m[a],end:m[g]}),_>i&&n.push({type:"add",start:h[i],end:h[_]}),a=g+x,i=_+x,o.push({start:m[g],end:m[a]}),n.push({start:h[_],end:h[i]});return t.length>a&&o.push({type:"remove",start:m[a],end:t.length}),e.length>i&&n.push({type:"add",start:h[i],end:e.length}),o=zb(o),n=zb(n),[o,n]}let s=AC(t,e);for(let[l,c,u]of s)l>a&&o.push({type:"remove",start:a,end:l}),c>i&&n.push({type:"add",start:i,end:c}),a=l+u,i=c+u,o.push({start:l,end:a}),n.push({start:c,end:i});return t.length>a&&o.push({type:"remove",start:a,end:t.length}),e.length>i&&n.push({type:"add",start:i,end:e.length}),o=zb(o),n=zb(n),[o,n]},xxe=_xe,qU=(t,e,r)=>{if(!t)return[{token:"plain",start:r,end:e.length+r}];if(e==="undefined"||e==="Infinity"||e==="-Infinity"||e==="NaN"||/^\d+n$/i.test(e)||e.startsWith("Symbol(")||e.startsWith("function")||e.startsWith("("))return[{token:"invalid",start:r,end:e.length+r}];if(!Number.isNaN(Number(e)))return[{token:"number",start:r,end:e.length+r}];if(e==="true"||e==="false")return[{token:"boolean",start:r,end:e.length+r}];if(e==="null")return[{token:"null",start:r,end:e.length+r}];if(e.startsWith('"')){if(e.endsWith(": [")||e.endsWith(": {"))return[{token:"key",start:r,end:e.length-3+r},{token:"punctuation",start:e.length-3,end:e.length-2+r},{token:"plain",start:e.length-2,end:e.length-1+r},{token:"punctuation",start:e.length-1,end:e.length+r}];let o=1;for(;o<e.length&&e[o]!=='"';)e[o]==="\\"&&++o,++o;return o===e.length-1?[{token:"string",start:r,end:e.length+r}]:[{token:"key",start:r,end:o+1+r},{token:"punctuation",start:o+1,end:o+2+r},{token:"plain",start:o+2,end:o+3+r},...qU(t,e.substring(o+3),r+o+3)]}return e==="{"||e==="}"||e==="["||e==="]"?[{token:"punctuation",start:r,end:e.length+r}]:[{token:"plain",start:r,end:e.length+r}]},UU=qU,VU={threshold:8,margin:3},bxe=(t,e,r,o)=>{if(!r||o)return[{start:0,end:t.length,isEqual:!1}];let n=[];for(let c=0;c<t.length;c++)t[c].type==="equal"&&e[c].type==="equal"?n.length&&n[n.length-1].isEqual?n[n.length-1].end++:n.push({start:c,end:c+1,isEqual:!0}):n.length&&!n[n.length-1].isEqual?n[n.length-1].end++:n.push({start:c,end:c+1,isEqual:!1});let a=r===!0?VU:{...VU,...r},{threshold:i,margin:s}=a;i<s*2+1&&console.warn(`Threshold (${i}) is no more than 2 margins + 1 "expand" line (${s} * 2 + 1), it's not necessary to hide unchanged areas which have less than ${s*2+1} lines.`);let l=[];for(let c=0;c<n.length;c++){let u=n[c];if(!u.isEqual||u.end-u.start<i||u.end-u.start<=s*2+1){l.push(u);continue}c?c===n.length-1?(l.push({start:u.start,end:u.start+s,isEqual:!0}),l.push({hasLinesBefore:!1,hasLinesAfter:!0,start:u.start+s,end:t.length,isEqual:!0})):(l.push({start:u.start,end:u.start+s,isEqual:!0}),l.push({hasLinesBefore:!0,hasLinesAfter:!0,start:u.start+s,end:u.end-s,isEqual:!0}),l.push({start:u.end-s,end:u.end,isEqual:!0})):(l.push({hasLinesBefore:!0,hasLinesAfter:!1,start:0,end:u.end-s,isEqual:!0}),l.push({start:u.end-s,end:u.end,isEqual:!0}))}return l},HU=bxe,yxe=2,$U=20,vxe={noChangeDetected:"No change detected"},Ub=t=>{let[e,r]=t.diff,o=Tt(()=>e.length===r.length&&e.every(U=>U.type==="equal")&&r.every(U=>U.type==="equal"),[e,r]),n={...vxe,...t.texts},a=t.lineNumbers?`calc(${String(e.length).length}ch + 16px)`:0,i=t.indent??yxe,s=i==="tab"?" ":" ",l=i==="tab"?1:i,c={mode:t.inlineDiffOptions?.mode||"char",wordSeparator:t.inlineDiffOptions?.wordSeparator||""},u=t.hideUnchangedLines??!1,{scrollContainer:d="body",itemHeight:p=18,expandLineHeight:m=26}=!t.virtual||t.virtual===!0?{}:t.virtual,h=d==="body"?document.body:document.querySelector(d),g=H(e),_=H(r),x=H(HU(e,r,u,o)),b=H([]),y=H(0),I=H(null),[,w]=P({}),v=()=>{if(b.current=[],t.virtual){let U=0;for(let G of x.current)Qi(G)?(b.current.push(U),U+=m):(b.current.push(U),U+=p*(G.end-G.start));y.current=x.current.reduce((G,k)=>Qi(k)?G+m:G+(k.end-k.start)*p,0)}w({})};L(()=>{g.current=e,_.current=r,x.current=HU(e,r,u,o),v()},[u,e,r]),L(()=>{if(!t.virtual||!h)return;let U=()=>w({});return h.addEventListener("scroll",U),()=>{h.removeEventListener("scroll",U)}},[t.virtual,h]);let T=U=>G=>{let k=[...x.current],Z=k[U];k[U]={...Z,end:Math.max(Z.end-G,Z.start)},U+1<x.current.length-1&&(k[U+1]={...k[U+1],start:Math.max(Z.end-G,Z.start)}),x.current=k,v()},O=U=>G=>{let k=[...x.current],Z=k[U];k[U]={...Z,start:Math.min(Z.start+G,Z.end)},U>1&&(k[U-1]={...k[U-1],end:Math.min(Z.start+G,Z.end)}),x.current=k,v()},S=U=>()=>{let G=[...x.current],k=G[U];G[U]={...k,start:k.start,end:k.start},U+1<x.current.length-1?G[U+1]={...G[U+1],start:k.start}:G[U-1]={...G[U-1],end:k.end},x.current=G,v()},C=(U,G=[],k=!1,Z=!1)=>Q(Ae,null,G.map((te,A)=>{let ce=U.slice(te.start,te.end);if(!te.type&&!te.token)return ce;let Se=[te.type?`inline-diff-${te.type}`:"",te.token?`token ${te.token}`:""].filter(Boolean).join(" ");return Q("span",{key:`${A}-${te.type}-${ce}`,className:Se},ce)}),k&&(Z?Q("span",{className:"token punctuation"},","):",")),F=(U,G)=>{let k=g.current[U],Z=_.current[U],[te,A]=t.highlightInlineDiff&&k.type==="modify"&&Z.type==="modify"?xxe(k.text,Z.text,c):[[],[]],ce=UU(G,k.text,0),Se=UU(G,Z.text,0),Ge=FU(ce,te),et=FU(Se,A),Oe=k.type!=="equal"?t.bgColour?.[k.type]??"":"",be=Z.type!=="equal"?t.bgColour?.[Z.type]??"":"";return Q("tr",{key:U},t.lineNumbers&&Q("td",{className:`line-${k.type} line-number`,style:{backgroundColor:Oe}},k.lineNumber),Q("td",{className:`line-${k.type}`,style:{backgroundColor:Oe}},Q("pre",null,k.text&&s.repeat(k.level*l),C(k.text,Ge,k.comma,G))),t.lineNumbers&&Q("td",{className:`line-${Z.type} line-number`,style:{backgroundColor:be}},Z.lineNumber),Q("td",{className:`line-${Z.type}`,style:{backgroundColor:be}},Q("pre",null,Z.text&&s.repeat(Z.level*l),C(Z.text,et,Z.comma,G))))},N=(U,G,k,Z)=>Q(Ae,null,U&&Q("button",{onClick:()=>T(Z)(k)},"\u2B61 Show ",k," lines before"),Q("button",{onClick:()=>S(Z)()},"\u2B65 Show all unchanged lines"),G&&Q("button",{onClick:()=>O(Z)(k)},"\u2B63 Show ",k," lines after")),R=(U,G,k,Z,te)=>{let{start:A,end:ce}=U;if(A=Math.max(A,k),ce=Math.min(ce,Z),A===ce)return null;if(!Qi(U))return Array(ce-A).fill(0).map((Oe,be)=>F(A+be,te));let{hasLinesBefore:Se,hasLinesAfter:Ge}=U,et=typeof u=="boolean"?$U:u.expandMoreLinesLimit||$U;return[Q("tr",{key:`expand-line-${G}`,className:"expand-line"},Q("td",{colSpan:4,className:`${Se?"has-lines-before":""} ${Ge?"has-lines-after":""}`},typeof u!="boolean"&&u.expandLineRenderer?u.expandLineRenderer({hasLinesBefore:Se,hasLinesAfter:Ge,onExpandBefore:T(G),onExpandAfter:O(G),onExpandAll:S(G)}):N(Se,Ge,et,G)))]},z=U=>{if(o&&u)return Q("tr",{key:"message-line",className:"message-line"},Q("td",{colSpan:4},n.noChangeDetected));if(!t.virtual)return x.current.map((zt,ot)=>R(zt,ot,0,g.current.length,U));let G=h?.clientHeight??0,k=h?.scrollTop??0,Z=k+G,te=I.current,A=te?.offsetTop??0;for(;te?.offsetParent&&te?.offsetParent!==h;)te=te.offsetParent,A+=te.offsetTop;if(A>Z||A+y.current<k)return Q("tr",null,Q("td",{colSpan:4,style:{height:`${y.current}px`}}));let ce=k-A,Se=Z-A,[Ge,et,Oe,be]=uxe(x.current,b.current,ce,Se,p,m),[st,wt]=lxe(x.current,b.current,Ge,et,Oe,be,p,m,y.current),mt=x.current.slice(Ge,Oe+1);return mt.length?Q(Ae,null,Q("tr",null,Q("td",{colSpan:4,style:{height:st,padding:0}})),mt.map((zt,ot)=>R(zt,ot,et,be,U)),Q("tr",null,Q("td",{colSpan:4,style:{height:wt,padding:0}}))):Q("tr",null,Q("td",{colSpan:4,style:{height:`${y.current}px`}}))},B=()=>Q("colgroup",{className:"measure-line"},t.lineNumbers&&Q("col",{style:{width:a}}),Q("col",null),t.lineNumbers&&Q("col",{style:{width:a}}),Q("col",null)),M=["json-diff-viewer",t.virtual&&"json-diff-viewer-virtual",t.syntaxHighlight&&`json-diff-viewer-theme-${t.syntaxHighlight.theme||"monokai"}`,t.className].filter(Boolean).join(" "),V=!!t.syntaxHighlight;return Q("table",{className:M,style:t.style},B(),Q("tbody",{ref:I},z(V)))};Ub.displayName="Viewer";function Vb(t){let e=t.left,r=t.right,[o,n]=P(!1),[a,i]=P(null),[s,l]=P(null),c=WU(a?.fields||{}),u=WU(s?.fields||{}),p=new OC({}).diff(c,u),m=`/cms/compare?left=${KU(e)}&right=${KU(r)}`;async function h(){n(!0);let[g,_]=await Promise.all([PS(e.docId,e.versionId),PS(r.docId,r.versionId)]);i(g),l(_),n(!1)}return L(()=>{h()},[]),o?f(Re,{size:"md",color:"gray"}):f("div",{className:ke(t.className,"DocDiffViewer"),children:[t.showExpandButton&&f("div",{className:"DocDiffViewer__expand",children:f(X,{component:"a",variant:"default",size:"xs",compact:!0,href:m,target:"_blank",children:"Open in new tab"})}),f("div",{className:"DocDiffViewer__header",children:[f("div",{className:"DocDiffViewer__header__label",children:[t.left.docId,"@",t.left.versionId," - modified"," ",GU(a)]}),f("div",{className:"DocDiffViewer__header__label",children:[t.right.docId,"@",t.right.versionId," - modified"," ",GU(s)]})]}),f(Ub,{diff:p,syntaxHighlight:{theme:"root-cms"},lineNumbers:!0,highlightInlineDiff:!0,hideUnchangedLines:!0,inlineDiffOptions:{mode:"word",wordSeparator:" "}})]})}function GU(t){return t?.sys?.modifiedAt?Rn(t.sys.modifiedAt.toMillis()):"never"}function WU(t){return db(t,{removeArrayKey:!0})}function KU(t){return encodeURIComponent(`${t.docId}@${t.versionId}`).replaceAll("%2F","/").replaceAll("%40","@")}var XU="PublishDocModal";function YU(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(XU,{...r,title:`Publish ${t.docId}`,innerProps:t,size:"850px"})}}}function Hb(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(""),[l,c]=P(!1),u=H(null),d=Ye(),p=xt(),m=n==="scheduled"?"Schedule":"Publish";async function h(){try{c(!0),await pz(e.docId),c(!1),pe({title:"Published!",message:`Succesfully published ${e.docId}.`,autoClose:1e4}),d.closeAll()}catch(b){console.error(b),pe({title:"Publish failed",message:`Failed to publish ${e.docId}.`,color:"red",autoClose:!1})}}async function g(){try{c(!0);let b=Math.floor(new Date(i).getTime());await mz(e.docId,b),c(!1),pe({title:"Scheduled!",message:`${e.docId} will go live ${i}.`,autoClose:1e4}),d.closeAll()}catch(b){console.error(b),pe({title:"Schedule failed",message:`Failed to schedule ${e.docId}.`,color:"red",autoClose:!1})}}function _(){d.openConfirmModal({...p,title:`${m} ${e.docId}`,children:f(Me,{size:"body-sm",weight:"semi-bold",children:["Are you sure you want to publish ",f("code",{children:e.docId}),"? The doc will go live ",n==="now"?"now":`at ${i}`,"."]}),labels:{confirm:m,cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"dark",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!0,onConfirm:()=>{n==="now"?h():n==="scheduled"&&g()}})}let x=!0;return(n==="now"||n==="scheduled"&&i)&&(x=!1),f("div",{className:"PublishDocModal",children:f("div",{className:"PublishDocModal__content",children:[f("form",{className:"PublishDocModal__form",onSubmit:b=>{b.preventDefault(),_()},children:[f("div",{className:"PublishDocModal__form__publishOptions",children:f("div",{className:"PublishDocModal__form__publishOptions__options",children:[f("label",{className:ke("PublishDocModal__form__publishOptions__option",n==="now"&&"PublishDocModal__form__publishOptions__option--selected",n&&n!=="now"&&"PublishDocModal__form__publishOptions__option--unselected"),children:[f("div",{className:"PublishDocModal__form__publishOptions__option__input",children:[f("input",{type:"radio",name:"publish-option",value:"now",checked:n==="now",onChange:()=>a("now")})," ","Now"]}),f("div",{className:"PublishDocModal__form__publishOptions__option__help",children:"Content will go live immediately."})]}),f("label",{className:ke("PublishDocModal__form__publishOptions__option",n==="scheduled"&&"PublishDocModal__form__publishOptions__option--selected",n&&n!=="scheduled"&&"PublishDocModal__form__publishOptions__option--unselected"),children:[f("div",{className:"PublishDocModal__form__publishOptions__option__input",children:[f("input",{type:"radio",name:"publish-option",value:"scheduled",checked:n==="scheduled",onChange:()=>a("scheduled")}),f("div",{children:"Scheduled"})]}),f("div",{className:"PublishDocModal__form__publishOptions__option__help",children:"Content will go live at the date and time specified below."}),f("div",{className:"PublishDocModal__form__publishOptions__option__input2",children:[f("input",{ref:u,type:"datetime-local",disabled:n!=="scheduled",value:i,min:Eu(),onChange:b=>{let y=b.target;s(y.value)}}),f("div",{className:"PublishDocModal__form__publishOptions__option__input2__help",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})]})]})}),f("div",{className:"PublishDocModal__form__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",disabled:x,loading:l,type:"submit",children:m})]})]}),f(Ixe,{docId:e.docId})]})})}function Ixe(t){let e=t.docId,[r,o]=P(!1);function n(){o(!0)}return f("div",{className:"PublishDocModal__ShowChanges",children:f(Ic,{iconPosition:"right",onChange:()=>n(),children:f(Ic.Item,{label:"Show changes",children:r?f(Vb,{left:{docId:e,versionId:"published"},right:{docId:e,versionId:"draft"},showExpandButton:!0}):f(Re,{})})})})}Hb.id=XU;var Zi="Releases";async function QU(t,e){if(!t)throw new Error("missing data source id");let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,Zi,t);await Pp(o,async a=>{if((await a.get(n)).exists())throw new Error(`release exists: ${t}`);await a.set(n,{...e,id:t,createdAt:Ut(),createdBy:window.firebase.user.email})}),Je("release.create",{metadata:{releaseId:t}})}async function ZU(){let t=window.__ROOT_CTX.rootConfig.projectId,e=window.firebase.db,r=nn(e,"Projects",t,Zi),o=to(r,Qn("createdAt","desc")),n=await an(o),a=[];return n.forEach(i=>{a.push(i.data())}),a}async function kl(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,Zi,t),n=await vr(o);return n.exists()?n.data():null}async function JU(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,Zi,t);await rr(n,e),Je("release.save",{metadata:{releaseId:t}})}async function e8(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,Zi,t);await P9(o),console.log(`deleted release ${t}`),Je("release.delete",{metadata:{releaseId:t}})}async function t8(t){let e=await kl(t);if(!e)throw new Error(`release not found: ${t}`);let r=e.docIds||[];if(r.length===0)throw new Error(`no docs to publish for release: ${t}`);let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,a=we(n,"Projects",o,Zi,t),i=sn(n);i.update(a,{publishedAt:Ut(),publishedBy:window.firebase.user.email,scheduledAt:zr(),scheduledBy:zr()}),await CS(r,{batch:i}),console.log(`published release: ${t}`),Je("release.publish",{metadata:{releaseId:t,docIds:r}})}async function r8(t,e){if(!await kl(t))throw new Error(`release not found: ${t}`);typeof e=="number"&&(e=Ze.fromMillis(e));let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,a=we(n,"Projects",o,Zi,t);await rr(a,{scheduledAt:e,scheduledBy:window.firebase.user.email}),Je("release.publish",{metadata:{releaseId:t,scheduledAt:e.toMillis()}})}async function o8(t){if(!await kl(t))throw new Error(`release not found: ${t}`);let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,Zi,t);await rr(n,{scheduledAt:zr(),scheduledBy:zr()}),Je("release.unschedule",{metadata:{releaseId:t}})}var n8="ScheduleReleaseModal";function a8(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(n8,{...r,title:`Schedule release: ${t.releaseId}`,innerProps:t})}}}function $b(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(!1),l=H(null),c=Ye();async function u(){s(!0),await bt(async()=>{let d=Math.floor(new Date(n).getTime());if(Math.floor(new Date().getTime())>=d)throw new Error("bad datetime, please choose a date in the future");let m=Ze.fromMillis(d);await r8(e.releaseId,d),pe({title:"Scheduled!",message:`Release ${e.releaseId} will go live ${n}.`,autoClose:1e4}),c.closeAll(),e.onScheduled&&e.onScheduled(m)}),s(!1)}return f("div",{className:"ScheduleReleaseModal",children:f("div",{className:"ScheduleReleaseModal__content",children:f("form",{className:"ScheduleReleaseModal__form",onSubmit:d=>{d.preventDefault(),u()},children:[f("div",{className:"ScheduleReleaseModal__form__description",children:"Content in the release will go live at the datetime specified below."}),f("div",{className:"ScheduleReleaseModal__form__dateInput",children:[f("input",{ref:l,type:"datetime-local",value:n,min:Eu(),onChange:d=>{let p=d.target;a(p.value)}}),f("div",{className:"ScheduleReleaseModal__form__dateInput__help",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),f("div",{className:"ScheduleReleaseModal__form__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",loading:i,type:"submit",children:"Schedule"})]})]})})})}$b.id=n8;var s8="VersionHistoryModal";function l8(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(s8,{...r,innerProps:t,size:"min(calc(100% - 32px), 720px)"})}}}function jb(t){let{innerProps:e}=t,r=e.docId,[o,n]=P(!0),[a,i]=P([]),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});async function l(){n(!0);let d=await vz(r);n(!1),i(d)}async function c(d){await Iz(r,d),pe({title:"Saved!",message:`Restored ${r} to ${s.format(d.sys.modifiedAt.toDate())}.`,autoClose:5e3}),e.onRestore&&e.onRestore({version:d})}function u(d){let p=i8(r,d._versionId),m=i8(r,"draft");return`/cms/compare?left=${p}&right=${m}`}return L(()=>{l()},[]),o?f(Re,{}):f("div",{className:"VersionHistoryModal",children:[f(Te,{className:"VersionHistoryModal__title",size:"h2",children:[f(Hp,{strokeWidth:1.5}),f("span",{children:"Version history"})]}),f("div",{className:"VersionHistoryModal__docId",children:f("code",{children:r})}),a.length===0?f(Me,{className:"VersionHistoryModal__versionsEmpty",size:"body",children:[f("p",{children:"No versions found."}),f("p",{className:"VersionHistoryModal__versionsEmpty__developer",children:"For developers: Configure the Root CMS cron job to populate versions."})]}):f(kr,{className:"VersionHistoryModal__versions",children:[f("thead",{children:f("tr",{children:[f("th",{children:"modified at"}),f("th",{children:"modified by"}),f("th",{children:"actions"})]})}),f("tbody",{children:a.map((d,p)=>f("tr",{children:[f("td",{children:f(Me,{size:"body-sm",children:s.format(d.sys.modifiedAt.toDate())})}),f("td",{children:f(Me,{size:"body-sm",children:d.sys.modifiedBy})}),f("td",{children:f("div",{className:"VersionHistoryModal__versions__buttons",children:[f(X,{variant:"default",size:"xs",compact:!0,onClick:()=>c(d),children:"restore"}),f(X,{className:"VersionHistoryModal__versions__buttons__compare",component:"a",variant:"default",size:"xs",compact:!0,href:u(d),target:"_blank",rightIcon:f(_l,{size:12}),children:"compare"})]})})]}))})]})]})}function i8(t,e){return encodeURIComponent(`${t}@${e}`).replaceAll("%2F","/").replaceAll("%40","@")}jb.id=s8;var h7=wv(m7(),1);var WC=h7.default;var Sye={};function KC(t,e){let r=e||Sye,o=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return _7(t,o,n)}function _7(t,e,r){if(Cye(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return g7(t.children,e,r)}return Array.isArray(t)?g7(t,e,r):""}function g7(t,e,r){let o=[],n=-1;for(;++n<t.length;)o[n]=_7(t[n],e,r);return o.join("")}function Cye(t){return!!(t&&typeof t=="object")}var x7=document.createElement("i");function Vu(t){let e="&"+t+";";x7.innerHTML=e;let r=x7.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===e?!1:r}function Ir(t,e,r,o){let n=t.length,a=0,i;if(e<0?e=-e>n?0:n+e:e=e>n?n:e,r=r>0?r:0,o.length<1e4)i=Array.from(o),i.unshift(e,r),t.splice(...i);else for(r&&t.splice(e,r);a<o.length;)i=o.slice(a,a+1e4),i.unshift(e,0),t.splice(...i),a+=1e4,e+=1e4}function Mo(t,e){return t.length>0?(Ir(t,t.length,0,e),t):e}var b7={}.hasOwnProperty;function ry(t){let e={},r=-1;for(;++r<t.length;)kye(e,t[r]);return e}function kye(t,e){let r;for(r in e){let n=(b7.call(t,r)?t[r]:void 0)||(t[r]={}),a=e[r],i;if(a)for(i in a){b7.call(n,i)||(n[i]=[]);let s=a[i];Tye(n[i],Array.isArray(s)?s:s?[s]:[])}}}function Tye(t,e){let r=-1,o=[];for(;++r<e.length;)(e[r].add==="after"?t:o).push(e[r]);Ir(t,0,0,o)}function oy(t,e){let r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function mo(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Pr=es(/[A-Za-z]/),Or=es(/[\dA-Za-z]/),y7=es(/[#-'*+\--9=?A-Z^-~]/);function Ol(t){return t!==null&&(t<32||t===127)}var em=es(/\d/),v7=es(/[\dA-Fa-f]/),I7=es(/[!-/:-@[-`{-~]/);function ie(t){return t!==null&&t<-2}function Xe(t){return t!==null&&(t<0||t===32)}function Pe(t){return t===-2||t===-1||t===32}var Al=es(/\p{P}|\p{S}/u),Ta=es(/\s/);function es(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Ee(t,e,r,o){let n=o?o-1:Number.POSITIVE_INFINITY,a=0;return i;function i(l){return Pe(l)?(t.enter(r),s(l)):e(l)}function s(l){return Pe(l)&&a++<n?(t.consume(l),s):(t.exit(r),e(l))}}var w7={tokenize:Pye};function Pye(t){let e=t.attempt(this.parser.constructs.contentInitial,o,n),r;return e;function o(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Ee(t,e,"linePrefix")}function n(s){return t.enter("paragraph"),a(s)}function a(s){let l=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,i(s)}function i(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return ie(s)?(t.consume(s),t.exit("chunkText"),a):(t.consume(s),i)}}var S7={tokenize:Oye},E7={tokenize:Aye};function Oye(t){let e=this,r=[],o=0,n,a,i;return s;function s(y){if(o<r.length){let I=r[o];return e.containerState=I[1],t.attempt(I[0].continuation,l,c)(y)}return c(y)}function l(y){if(o++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,n&&b();let I=e.events.length,w=I,v;for(;w--;)if(e.events[w][0]==="exit"&&e.events[w][1].type==="chunkFlow"){v=e.events[w][1].end;break}x(o);let T=I;for(;T<e.events.length;)e.events[T][1].end=Object.assign({},v),T++;return Ir(e.events,w+1,0,e.events.slice(I)),e.events.length=T,c(y)}return s(y)}function c(y){if(o===r.length){if(!n)return p(y);if(n.currentConstruct&&n.currentConstruct.concrete)return h(y);e.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(E7,u,d)(y)}function u(y){return n&&b(),x(o),p(y)}function d(y){return e.parser.lazy[e.now().line]=o!==r.length,i=e.now().offset,h(y)}function p(y){return e.containerState={},t.attempt(E7,m,h)(y)}function m(y){return o++,r.push([e.currentConstruct,e.containerState]),p(y)}function h(y){if(y===null){n&&b(),x(0),t.consume(y);return}return n=n||e.parser.flow(e.now()),t.enter("chunkFlow",{contentType:"flow",previous:a,_tokenizer:n}),g(y)}function g(y){if(y===null){_(t.exit("chunkFlow"),!0),x(0),t.consume(y);return}return ie(y)?(t.consume(y),_(t.exit("chunkFlow")),o=0,e.interrupt=void 0,s):(t.consume(y),g)}function _(y,I){let w=e.sliceStream(y);if(I&&w.push(null),y.previous=a,a&&(a.next=y),a=y,n.defineSkip(y.start),n.write(w),e.parser.lazy[y.start.line]){let v=n.events.length;for(;v--;)if(n.events[v][1].start.offset<i&&(!n.events[v][1].end||n.events[v][1].end.offset>i))return;let T=e.events.length,O=T,S,C;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(S){C=e.events[O][1].end;break}S=!0}for(x(o),v=T;v<e.events.length;)e.events[v][1].end=Object.assign({},C),v++;Ir(e.events,O+1,0,e.events.slice(T)),e.events.length=v}}function x(y){let I=r.length;for(;I-- >y;){let w=r[I];e.containerState=w[1],w[0].exit.call(e,t)}r.length=y}function b(){n.write([null]),a=void 0,n=void 0,e.containerState._closeFlow=void 0}}function Aye(t,e,r){return Ee(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Hu(t){if(t===null||Xe(t)||Ta(t))return 1;if(Al(t))return 2}function ts(t,e,r){let o=[],n=-1;for(;++n<t.length;){let a=t[n].resolveAll;a&&!o.includes(a)&&(e=a(e,r),o.push(a))}return e}var tm={name:"attention",tokenize:Rye,resolveAll:Dye};function Dye(t,e){let r=-1,o,n,a,i,s,l,c,u;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(o=r;o--;)if(t[o][0]==="exit"&&t[o][1].type==="attentionSequence"&&t[o][1]._open&&e.sliceSerialize(t[o][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[o][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[o][1].end.offset-t[o][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;l=t[o][1].end.offset-t[o][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;let d=Object.assign({},t[o][1].end),p=Object.assign({},t[r][1].start);C7(d,-l),C7(p,l),i={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},t[o][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[r][1].start),end:p},a={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[o][1].end),end:Object.assign({},t[r][1].start)},n={type:l>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},s.end)},t[o][1].end=Object.assign({},i.start),t[r][1].start=Object.assign({},s.end),c=[],t[o][1].end.offset-t[o][1].start.offset&&(c=Mo(c,[["enter",t[o][1],e],["exit",t[o][1],e]])),c=Mo(c,[["enter",n,e],["enter",i,e],["exit",i,e],["enter",a,e]]),c=Mo(c,ts(e.parser.constructs.insideSpan.null,t.slice(o+1,r),e)),c=Mo(c,[["exit",a,e],["enter",s,e],["exit",s,e],["exit",n,e]]),t[r][1].end.offset-t[r][1].start.offset?(u=2,c=Mo(c,[["enter",t[r][1],e],["exit",t[r][1],e]])):u=0,Ir(t,o-1,r-o+3,c),r=o+c.length-u-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function Rye(t,e){let r=this.parser.constructs.attentionMarkers.null,o=this.previous,n=Hu(o),a;return i;function i(l){return a=l,t.enter("attentionSequence"),s(l)}function s(l){if(l===a)return t.consume(l),s;let c=t.exit("attentionSequence"),u=Hu(l),d=!u||u===2&&n||r.includes(l),p=!n||n===2&&u||r.includes(o);return c._open=!!(a===42?d:d&&(n||!p)),c._close=!!(a===42?p:p&&(u||!d)),e(l)}}function C7(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var XC={name:"autolink",tokenize:Nye};function Nye(t,e,r){let o=0;return n;function n(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),a}function a(m){return Pr(m)?(t.consume(m),i):m===64?r(m):c(m)}function i(m){return m===43||m===45||m===46||Or(m)?(o=1,s(m)):c(m)}function s(m){return m===58?(t.consume(m),o=0,l):(m===43||m===45||m===46||Or(m))&&o++<32?(t.consume(m),s):(o=0,c(m))}function l(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):m===null||m===32||m===60||Ol(m)?r(m):(t.consume(m),l)}function c(m){return m===64?(t.consume(m),u):y7(m)?(t.consume(m),c):r(m)}function u(m){return Or(m)?d(m):r(m)}function d(m){return m===46?(t.consume(m),o=0,u):m===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):p(m)}function p(m){if((m===45||Or(m))&&o++<63){let h=m===45?p:d;return t.consume(m),h}return r(m)}}var Pa={tokenize:Mye,partial:!0};function Mye(t,e,r){return o;function o(a){return Pe(a)?Ee(t,n,"linePrefix")(a):n(a)}function n(a){return a===null||ie(a)?e(a):r(a)}}var ny={name:"blockQuote",tokenize:Lye,continuation:{tokenize:Bye},exit:Fye};function Lye(t,e,r){let o=this;return n;function n(i){if(i===62){let s=o.containerState;return s.open||(t.enter("blockQuote",{_container:!0}),s.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(i),t.exit("blockQuoteMarker"),a}return r(i)}function a(i){return Pe(i)?(t.enter("blockQuotePrefixWhitespace"),t.consume(i),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(i))}}function Bye(t,e,r){let o=this;return n;function n(i){return Pe(i)?Ee(t,a,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):a(i)}function a(i){return t.attempt(ny,e,r)(i)}}function Fye(t){t.exit("blockQuote")}var ay={name:"characterEscape",tokenize:zye};function zye(t,e,r){return o;function o(a){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(a),t.exit("escapeMarker"),n}function n(a){return I7(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(a)}}var iy={name:"characterReference",tokenize:Uye};function Uye(t,e,r){let o=this,n=0,a,i;return s;function s(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),l}function l(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),a=31,i=Or,u(d))}function c(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,i=v7,u):(t.enter("characterReferenceValue"),a=7,i=em,u(d))}function u(d){if(d===59&&n){let p=t.exit("characterReferenceValue");return i===Or&&!Vu(o.sliceSerialize(p))?r(d):(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return i(d)&&n++<a?(t.consume(d),u):r(d)}}var k7={tokenize:Hye,partial:!0},sy={name:"codeFenced",tokenize:Vye,concrete:!0};function Vye(t,e,r){let o=this,n={tokenize:w,partial:!0},a=0,i=0,s;return l;function l(v){return c(v)}function c(v){let T=o.events[o.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=v,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(v)}function u(v){return v===s?(i++,t.consume(v),u):i<3?r(v):(t.exit("codeFencedFenceSequence"),Pe(v)?Ee(t,d,"whitespace")(v):d(v))}function d(v){return v===null||ie(v)?(t.exit("codeFencedFence"),o.interrupt?e(v):t.check(k7,g,I)(v)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||ie(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),d(v)):Pe(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ee(t,m,"whitespace")(v)):v===96&&v===s?r(v):(t.consume(v),p)}function m(v){return v===null||ie(v)?d(v):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||ie(v)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),d(v)):v===96&&v===s?r(v):(t.consume(v),h)}function g(v){return t.attempt(n,I,_)(v)}function _(v){return t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),x}function x(v){return a>0&&Pe(v)?Ee(t,b,"linePrefix",a+1)(v):b(v)}function b(v){return v===null||ie(v)?t.check(k7,g,I)(v):(t.enter("codeFlowValue"),y(v))}function y(v){return v===null||ie(v)?(t.exit("codeFlowValue"),b(v)):(t.consume(v),y)}function I(v){return t.exit("codeFenced"),e(v)}function w(v,T,O){let S=0;return C;function C(B){return v.enter("lineEnding"),v.consume(B),v.exit("lineEnding"),F}function F(B){return v.enter("codeFencedFence"),Pe(B)?Ee(v,N,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):N(B)}function N(B){return B===s?(v.enter("codeFencedFenceSequence"),R(B)):O(B)}function R(B){return B===s?(S++,v.consume(B),R):S>=i?(v.exit("codeFencedFenceSequence"),Pe(B)?Ee(v,z,"whitespace")(B):z(B)):O(B)}function z(B){return B===null||ie(B)?(v.exit("codeFencedFence"),T(B)):O(B)}}}function Hye(t,e,r){let o=this;return n;function n(i){return i===null?r(i):(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),a)}function a(i){return o.parser.lazy[o.now().line]?r(i):e(i)}}var rm={name:"codeIndented",tokenize:jye},$ye={tokenize:qye,partial:!0};function jye(t,e,r){let o=this;return n;function n(c){return t.enter("codeIndented"),Ee(t,a,"linePrefix",5)(c)}function a(c){let u=o.events[o.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?i(c):r(c)}function i(c){return c===null?l(c):ie(c)?t.attempt($ye,i,l)(c):(t.enter("codeFlowValue"),s(c))}function s(c){return c===null||ie(c)?(t.exit("codeFlowValue"),i(c)):(t.consume(c),s)}function l(c){return t.exit("codeIndented"),e(c)}}function qye(t,e,r){let o=this;return n;function n(i){return o.parser.lazy[o.now().line]?r(i):ie(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n):Ee(t,a,"linePrefix",5)(i)}function a(i){let s=o.events[o.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(i):ie(i)?n(i):r(i)}}var YC={name:"codeText",tokenize:Kye,resolve:Gye,previous:Wye};function Gye(t){let e=t.length-4,r=3,o,n;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(o=r;++o<e;)if(t[o][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(o=r-1,e++;++o<=e;)n===void 0?o!==e&&t[o][1].type!=="lineEnding"&&(n=o):(o===e||t[o][1].type==="lineEnding")&&(t[n][1].type="codeTextData",o!==n+2&&(t[n][1].end=t[o-1][1].end,t.splice(n+2,o-n-2),e-=o-n-2,o=n+2),n=void 0);return t}function Wye(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Kye(t,e,r){let o=this,n=0,a,i;return s;function s(p){return t.enter("codeText"),t.enter("codeTextSequence"),l(p)}function l(p){return p===96?(t.consume(p),n++,l):(t.exit("codeTextSequence"),c(p))}function c(p){return p===null?r(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),c):p===96?(i=t.enter("codeTextSequence"),a=0,d(p)):ie(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(p))}function u(p){return p===null||p===32||p===96||ie(p)?(t.exit("codeTextData"),c(p)):(t.consume(p),u)}function d(p){return p===96?(t.consume(p),a++,d):a===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(i.type="codeTextData",u(p))}}var ly=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,r){let o=r??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(e,o):e>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(e,r,o){let n=r||0;this.setCursor(Math.trunc(e));let a=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return o&&om(this.left,o),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),om(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),om(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let r=this.left.splice(e,Number.POSITIVE_INFINITY);om(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);om(this.left,r.reverse())}}};function om(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function cy(t){let e={},r=-1,o,n,a,i,s,l,c,u=new ly(t);for(;++r<u.length;){for(;r in e;)r=e[r];if(o=u.get(r),r&&o[1].type==="chunkFlow"&&u.get(r-1)[1].type==="listItemPrefix"&&(l=o[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(o[0]==="enter")o[1].contentType&&(Object.assign(e,Xye(u,r)),r=e[r],c=!0);else if(o[1]._container){for(a=r,n=void 0;a--&&(i=u.get(a),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank");)i[0]==="enter"&&(n&&(u.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=a);n&&(o[1].end=Object.assign({},u.get(n)[1].start),s=u.slice(n,r),s.unshift(o),u.splice(n,r-n+1,s))}}return Ir(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Xye(t,e){let r=t.get(e)[1],o=t.get(e)[2],n=e-1,a=[],i=r._tokenizer||o.parser[r.contentType](r.start),s=i.events,l=[],c={},u,d,p=-1,m=r,h=0,g=0,_=[g];for(;m;){for(;t.get(++n)[1]!==m;);a.push(n),m._tokenizer||(u=o.sliceStream(m),m.next||u.push(null),d&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(u),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=r;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(g=p+1,_.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):_.pop(),p=_.length;p--;){let x=s.slice(_[p],_[p+1]),b=a.pop();l.push([b,b+x.length-1]),t.splice(b,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[h+l[p][0]]=h+l[p][1],h+=l[p][1]-l[p][0]-1;return c}var QC={tokenize:Zye,resolve:Qye},Yye={tokenize:Jye,partial:!0};function Qye(t){return cy(t),t}function Zye(t,e){let r;return o;function o(s){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),n(s)}function n(s){return s===null?a(s):ie(s)?t.check(Yye,i,a)(s):(t.consume(s),n)}function a(s){return t.exit("chunkContent"),t.exit("content"),e(s)}function i(s){return t.consume(s),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}function Jye(t,e,r){let o=this;return n;function n(i){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Ee(t,a,"linePrefix")}function a(i){if(i===null||ie(i))return r(i);let s=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(i):t.interrupt(o.parser.constructs.flow,r,e)(i)}}function uy(t,e,r,o,n,a,i,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return d;function d(x){return x===60?(t.enter(o),t.enter(n),t.enter(a),t.consume(x),t.exit(a),p):x===null||x===32||x===41||Ol(x)?r(x):(t.enter(o),t.enter(i),t.enter(s),t.enter("chunkString",{contentType:"string"}),g(x))}function p(x){return x===62?(t.enter(a),t.consume(x),t.exit(a),t.exit(n),t.exit(o),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(t.exit("chunkString"),t.exit(s),p(x)):x===null||x===60||ie(x)?r(x):(t.consume(x),x===92?h:m)}function h(x){return x===60||x===62||x===92?(t.consume(x),m):m(x)}function g(x){return!u&&(x===null||x===41||Xe(x))?(t.exit("chunkString"),t.exit(s),t.exit(i),t.exit(o),e(x)):u<c&&x===40?(t.consume(x),u++,g):x===41?(t.consume(x),u--,g):x===null||x===32||x===40||Ol(x)?r(x):(t.consume(x),x===92?_:g)}function _(x){return x===40||x===41||x===92?(t.consume(x),g):g(x)}}function dy(t,e,r,o,n,a){let i=this,s=0,l;return c;function c(m){return t.enter(o),t.enter(n),t.consume(m),t.exit(n),t.enter(a),u}function u(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?r(m):m===93?(t.exit(a),t.enter(n),t.consume(m),t.exit(n),t.exit(o),e):ie(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||ie(m)||s++>999?(t.exit("chunkString"),u(m)):(t.consume(m),l||(l=!Pe(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(t.consume(m),s++,d):d(m)}}function fy(t,e,r,o,n,a){let i;return s;function s(p){return p===34||p===39||p===40?(t.enter(o),t.enter(n),t.consume(p),t.exit(n),i=p===40?41:p,l):r(p)}function l(p){return p===i?(t.enter(n),t.consume(p),t.exit(n),t.exit(o),e):(t.enter(a),c(p))}function c(p){return p===i?(t.exit(a),l(i)):p===null?r(p):ie(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ee(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===i||p===null||ie(p)?(t.exit("chunkString"),c(p)):(t.consume(p),p===92?d:u)}function d(p){return p===i||p===92?(t.consume(p),u):u(p)}}function Dl(t,e){let r;return o;function o(n){return ie(n)?(t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),r=!0,o):Pe(n)?Ee(t,o,r?"linePrefix":"lineSuffix")(n):e(n)}}var ZC={name:"definition",tokenize:tve},eve={tokenize:rve,partial:!0};function tve(t,e,r){let o=this,n;return a;function a(m){return t.enter("definition"),i(m)}function i(m){return dy.call(o,t,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return n=mo(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),l):r(m)}function l(m){return Xe(m)?Dl(t,c)(m):c(m)}function c(m){return uy(t,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return t.attempt(eve,d,d)(m)}function d(m){return Pe(m)?Ee(t,p,"whitespace")(m):p(m)}function p(m){return m===null||ie(m)?(t.exit("definition"),o.parser.defined.push(n),e(m)):r(m)}}function rve(t,e,r){return o;function o(s){return Xe(s)?Dl(t,n)(s):r(s)}function n(s){return fy(t,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Pe(s)?Ee(t,i,"whitespace")(s):i(s)}function i(s){return s===null||ie(s)?e(s):r(s)}}var JC={name:"hardBreakEscape",tokenize:ove};function ove(t,e,r){return o;function o(a){return t.enter("hardBreakEscape"),t.consume(a),n}function n(a){return ie(a)?(t.exit("hardBreakEscape"),e(a)):r(a)}}var ek={name:"headingAtx",tokenize:ave,resolve:nve};function nve(t,e){let r=t.length-2,o=3,n,a;return t[o][1].type==="whitespace"&&(o+=2),r-2>o&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(o===r-1||r-4>o&&t[r-2][1].type==="whitespace")&&(r-=o+1===r?2:4),r>o&&(n={type:"atxHeadingText",start:t[o][1].start,end:t[r][1].end},a={type:"chunkText",start:t[o][1].start,end:t[r][1].end,contentType:"text"},Ir(t,o,r-o+1,[["enter",n,e],["enter",a,e],["exit",a,e],["exit",n,e]])),t}function ave(t,e,r){let o=0;return n;function n(u){return t.enter("atxHeading"),a(u)}function a(u){return t.enter("atxHeadingSequence"),i(u)}function i(u){return u===35&&o++<6?(t.consume(u),i):u===null||Xe(u)?(t.exit("atxHeadingSequence"),s(u)):r(u)}function s(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||ie(u)?(t.exit("atxHeading"),e(u)):Pe(u)?Ee(t,s,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Xe(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}var T7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],tk=["pre","script","style","textarea"];var rk={name:"htmlFlow",tokenize:cve,resolveTo:lve,concrete:!0},ive={tokenize:dve,partial:!0},sve={tokenize:uve,partial:!0};function lve(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function cve(t,e,r){let o=this,n,a,i,s,l;return c;function c(A){return u(A)}function u(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),d}function d(A){return A===33?(t.consume(A),p):A===47?(t.consume(A),a=!0,g):A===63?(t.consume(A),n=3,o.interrupt?e:k):Pr(A)?(t.consume(A),i=String.fromCharCode(A),_):r(A)}function p(A){return A===45?(t.consume(A),n=2,m):A===91?(t.consume(A),n=5,s=0,h):Pr(A)?(t.consume(A),n=4,o.interrupt?e:k):r(A)}function m(A){return A===45?(t.consume(A),o.interrupt?e:k):r(A)}function h(A){let ce="CDATA[";return A===ce.charCodeAt(s++)?(t.consume(A),s===ce.length?o.interrupt?e:N:h):r(A)}function g(A){return Pr(A)?(t.consume(A),i=String.fromCharCode(A),_):r(A)}function _(A){if(A===null||A===47||A===62||Xe(A)){let ce=A===47,Se=i.toLowerCase();return!ce&&!a&&tk.includes(Se)?(n=1,o.interrupt?e(A):N(A)):T7.includes(i.toLowerCase())?(n=6,ce?(t.consume(A),x):o.interrupt?e(A):N(A)):(n=7,o.interrupt&&!o.parser.lazy[o.now().line]?r(A):a?b(A):y(A))}return A===45||Or(A)?(t.consume(A),i+=String.fromCharCode(A),_):r(A)}function x(A){return A===62?(t.consume(A),o.interrupt?e:N):r(A)}function b(A){return Pe(A)?(t.consume(A),b):C(A)}function y(A){return A===47?(t.consume(A),C):A===58||A===95||Pr(A)?(t.consume(A),I):Pe(A)?(t.consume(A),y):C(A)}function I(A){return A===45||A===46||A===58||A===95||Or(A)?(t.consume(A),I):w(A)}function w(A){return A===61?(t.consume(A),v):Pe(A)?(t.consume(A),w):y(A)}function v(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(t.consume(A),l=A,T):Pe(A)?(t.consume(A),v):O(A)}function T(A){return A===l?(t.consume(A),l=null,S):A===null||ie(A)?r(A):(t.consume(A),T)}function O(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Xe(A)?w(A):(t.consume(A),O)}function S(A){return A===47||A===62||Pe(A)?y(A):r(A)}function C(A){return A===62?(t.consume(A),F):r(A)}function F(A){return A===null||ie(A)?N(A):Pe(A)?(t.consume(A),F):r(A)}function N(A){return A===45&&n===2?(t.consume(A),M):A===60&&n===1?(t.consume(A),V):A===62&&n===4?(t.consume(A),Z):A===63&&n===3?(t.consume(A),k):A===93&&n===5?(t.consume(A),G):ie(A)&&(n===6||n===7)?(t.exit("htmlFlowData"),t.check(ive,te,R)(A)):A===null||ie(A)?(t.exit("htmlFlowData"),R(A)):(t.consume(A),N)}function R(A){return t.check(sve,z,te)(A)}function z(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),B}function B(A){return A===null||ie(A)?R(A):(t.enter("htmlFlowData"),N(A))}function M(A){return A===45?(t.consume(A),k):N(A)}function V(A){return A===47?(t.consume(A),i="",U):N(A)}function U(A){if(A===62){let ce=i.toLowerCase();return tk.includes(ce)?(t.consume(A),Z):N(A)}return Pr(A)&&i.length<8?(t.consume(A),i+=String.fromCharCode(A),U):N(A)}function G(A){return A===93?(t.consume(A),k):N(A)}function k(A){return A===62?(t.consume(A),Z):A===45&&n===2?(t.consume(A),k):N(A)}function Z(A){return A===null||ie(A)?(t.exit("htmlFlowData"),te(A)):(t.consume(A),Z)}function te(A){return t.exit("htmlFlow"),e(A)}}function uve(t,e,r){let o=this;return n;function n(i){return ie(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),a):r(i)}function a(i){return o.parser.lazy[o.now().line]?r(i):e(i)}}function dve(t,e,r){return o;function o(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),t.attempt(Pa,e,r)}}var ok={name:"htmlText",tokenize:fve};function fve(t,e,r){let o=this,n,a,i;return s;function s(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),l}function l(k){return k===33?(t.consume(k),c):k===47?(t.consume(k),w):k===63?(t.consume(k),y):Pr(k)?(t.consume(k),O):r(k)}function c(k){return k===45?(t.consume(k),u):k===91?(t.consume(k),a=0,h):Pr(k)?(t.consume(k),b):r(k)}function u(k){return k===45?(t.consume(k),m):r(k)}function d(k){return k===null?r(k):k===45?(t.consume(k),p):ie(k)?(i=d,V(k)):(t.consume(k),d)}function p(k){return k===45?(t.consume(k),m):d(k)}function m(k){return k===62?M(k):k===45?p(k):d(k)}function h(k){let Z="CDATA[";return k===Z.charCodeAt(a++)?(t.consume(k),a===Z.length?g:h):r(k)}function g(k){return k===null?r(k):k===93?(t.consume(k),_):ie(k)?(i=g,V(k)):(t.consume(k),g)}function _(k){return k===93?(t.consume(k),x):g(k)}function x(k){return k===62?M(k):k===93?(t.consume(k),x):g(k)}function b(k){return k===null||k===62?M(k):ie(k)?(i=b,V(k)):(t.consume(k),b)}function y(k){return k===null?r(k):k===63?(t.consume(k),I):ie(k)?(i=y,V(k)):(t.consume(k),y)}function I(k){return k===62?M(k):y(k)}function w(k){return Pr(k)?(t.consume(k),v):r(k)}function v(k){return k===45||Or(k)?(t.consume(k),v):T(k)}function T(k){return ie(k)?(i=T,V(k)):Pe(k)?(t.consume(k),T):M(k)}function O(k){return k===45||Or(k)?(t.consume(k),O):k===47||k===62||Xe(k)?S(k):r(k)}function S(k){return k===47?(t.consume(k),M):k===58||k===95||Pr(k)?(t.consume(k),C):ie(k)?(i=S,V(k)):Pe(k)?(t.consume(k),S):M(k)}function C(k){return k===45||k===46||k===58||k===95||Or(k)?(t.consume(k),C):F(k)}function F(k){return k===61?(t.consume(k),N):ie(k)?(i=F,V(k)):Pe(k)?(t.consume(k),F):S(k)}function N(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(t.consume(k),n=k,R):ie(k)?(i=N,V(k)):Pe(k)?(t.consume(k),N):(t.consume(k),z)}function R(k){return k===n?(t.consume(k),n=void 0,B):k===null?r(k):ie(k)?(i=R,V(k)):(t.consume(k),R)}function z(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||Xe(k)?S(k):(t.consume(k),z)}function B(k){return k===47||k===62||Xe(k)?S(k):r(k)}function M(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):r(k)}function V(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),U}function U(k){return Pe(k)?Ee(t,G,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):G(k)}function G(k){return t.enter("htmlTextData"),i(k)}}var Rl={name:"labelEnd",tokenize:xve,resolveTo:_ve,resolveAll:gve},pve={tokenize:bve},mve={tokenize:yve},hve={tokenize:vve};function gve(t){let e=-1;for(;++e<t.length;){let r=t[e][1];(r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd")&&(t.splice(e+1,r.type==="labelImage"?4:2),r.type="data",e++)}return t}function _ve(t,e){let r=t.length,o=0,n,a,i,s;for(;r--;)if(n=t[r][1],a){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;t[r][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(i){if(t[r][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(a=r,n.type!=="labelLink")){o=2;break}}else n.type==="labelEnd"&&(i=r);let l={type:t[a][1].type==="labelLink"?"link":"image",start:Object.assign({},t[a][1].start),end:Object.assign({},t[t.length-1][1].end)},c={type:"label",start:Object.assign({},t[a][1].start),end:Object.assign({},t[i][1].end)},u={type:"labelText",start:Object.assign({},t[a+o+2][1].end),end:Object.assign({},t[i-2][1].start)};return s=[["enter",l,e],["enter",c,e]],s=Mo(s,t.slice(a+1,a+o+3)),s=Mo(s,[["enter",u,e]]),s=Mo(s,ts(e.parser.constructs.insideSpan.null,t.slice(a+o+4,i-3),e)),s=Mo(s,[["exit",u,e],t[i-2],t[i-1],["exit",c,e]]),s=Mo(s,t.slice(i+1)),s=Mo(s,[["exit",l,e]]),Ir(t,a,t.length,s),t}function xve(t,e,r){let o=this,n=o.events.length,a,i;for(;n--;)if((o.events[n][1].type==="labelImage"||o.events[n][1].type==="labelLink")&&!o.events[n][1]._balanced){a=o.events[n][1];break}return s;function s(p){return a?a._inactive?d(p):(i=o.parser.defined.includes(mo(o.sliceSerialize({start:a.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):r(p)}function l(p){return p===40?t.attempt(pve,u,i?u:d)(p):p===91?t.attempt(mve,u,i?c:d)(p):i?u(p):d(p)}function c(p){return t.attempt(hve,u,d)(p)}function u(p){return e(p)}function d(p){return a._balanced=!0,r(p)}}function bve(t,e,r){return o;function o(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),n}function n(d){return Xe(d)?Dl(t,a)(d):a(d)}function a(d){return d===41?u(d):uy(t,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return Xe(d)?Dl(t,l)(d):u(d)}function s(d){return r(d)}function l(d){return d===34||d===39||d===40?fy(t,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Xe(d)?Dl(t,u)(d):u(d)}function u(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):r(d)}}function yve(t,e,r){let o=this;return n;function n(s){return dy.call(o,t,a,i,"reference","referenceMarker","referenceString")(s)}function a(s){return o.parser.defined.includes(mo(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?e(s):r(s)}function i(s){return r(s)}}function vve(t,e,r){return o;function o(a){return t.enter("reference"),t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),n}function n(a){return a===93?(t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),t.exit("reference"),e):r(a)}}var nk={name:"labelStartImage",tokenize:Ive,resolveAll:Rl.resolveAll};function Ive(t,e,r){let o=this;return n;function n(s){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(s),t.exit("labelImageMarker"),a}function a(s){return s===91?(t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelImage"),i):r(s)}function i(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(s):e(s)}}var ak={name:"labelStartLink",tokenize:wve,resolveAll:Rl.resolveAll};function wve(t,e,r){let o=this;return n;function n(i){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(i),t.exit("labelMarker"),t.exit("labelLink"),a}function a(i){return i===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(i):e(i)}}var nm={name:"lineEnding",tokenize:Eve};function Eve(t,e){return r;function r(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Ee(t,e,"linePrefix")}}var Nl={name:"thematicBreak",tokenize:Sve};function Sve(t,e,r){let o=0,n;return a;function a(c){return t.enter("thematicBreak"),i(c)}function i(c){return n=c,s(c)}function s(c){return c===n?(t.enter("thematicBreakSequence"),l(c)):o>=3&&(c===null||ie(c))?(t.exit("thematicBreak"),e(c)):r(c)}function l(c){return c===n?(t.consume(c),o++,l):(t.exit("thematicBreakSequence"),Pe(c)?Ee(t,s,"whitespace")(c):s(c))}}var ho={name:"list",tokenize:Tve,continuation:{tokenize:Pve},exit:Ave},Cve={tokenize:Dve,partial:!0},kve={tokenize:Ove,partial:!0};function Tve(t,e,r){let o=this,n=o.events[o.events.length-1],a=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,i=0;return s;function s(m){let h=o.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!o.containerState.marker||m===o.containerState.marker:em(m)){if(o.containerState.type||(o.containerState.type=h,t.enter(h,{_container:!0})),h==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(Nl,r,c)(m):c(m);if(!o.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(m)}return r(m)}function l(m){return em(m)&&++i<10?(t.consume(m),l):(!o.interrupt||i<2)&&(o.containerState.marker?m===o.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),c(m)):r(m)}function c(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||m,t.check(Pa,o.interrupt?r:u,t.attempt(Cve,p,d))}function u(m){return o.containerState.initialBlankLine=!0,a++,p(m)}function d(m){return Pe(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),p):r(m)}function p(m){return o.containerState.size=a+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function Pve(t,e,r){let o=this;return o.containerState._closeFlow=void 0,t.check(Pa,n,a);function n(s){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Ee(t,e,"listItemIndent",o.containerState.size+1)(s)}function a(s){return o.containerState.furtherBlankLines||!Pe(s)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,i(s)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,t.attempt(kve,e,i)(s))}function i(s){return o.containerState._closeFlow=!0,o.interrupt=void 0,Ee(t,t.attempt(ho,e,r),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Ove(t,e,r){let o=this;return Ee(t,n,"listItemIndent",o.containerState.size+1);function n(a){let i=o.events[o.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===o.containerState.size?e(a):r(a)}}function Ave(t){t.exit(this.containerState.type)}function Dve(t,e,r){let o=this;return Ee(t,n,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(a){let i=o.events[o.events.length-1];return!Pe(a)&&i&&i[1].type==="listItemPrefixWhitespace"?e(a):r(a)}}var py={name:"setextUnderline",tokenize:Nve,resolveTo:Rve};function Rve(t,e){let r=t.length,o,n,a;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){o=r;break}t[r][1].type==="paragraph"&&(n=r)}else t[r][1].type==="content"&&t.splice(r,1),!a&&t[r][1].type==="definition"&&(a=r);let i={type:"setextHeading",start:Object.assign({},t[n][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[n][1].type="setextHeadingText",a?(t.splice(n,0,["enter",i,e]),t.splice(a+1,0,["exit",t[o][1],e]),t[o][1].end=Object.assign({},t[a][1].end)):t[o][1]=i,t.push(["exit",i,e]),t}function Nve(t,e,r){let o=this,n;return a;function a(c){let u=o.events.length,d;for(;u--;)if(o.events[u][1].type!=="lineEnding"&&o.events[u][1].type!=="linePrefix"&&o.events[u][1].type!=="content"){d=o.events[u][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||d)?(t.enter("setextHeadingLine"),n=c,i(c)):r(c)}function i(c){return t.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===n?(t.consume(c),s):(t.exit("setextHeadingLineSequence"),Pe(c)?Ee(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ie(c)?(t.exit("setextHeadingLine"),e(c)):r(c)}}var P7={tokenize:Mve};function Mve(t){let e=this,r=t.attempt(Pa,o,t.attempt(this.parser.constructs.flowInitial,n,Ee(t,t.attempt(this.parser.constructs.flow,n,t.attempt(QC,n)),"linePrefix")));return r;function o(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var O7={resolveAll:N7()},A7=R7("string"),D7=R7("text");function R7(t){return{tokenize:e,resolveAll:N7(t==="text"?Lve:void 0)};function e(r){let o=this,n=this.parser.constructs[t],a=r.attempt(n,i,s);return i;function i(u){return c(u)?a(u):s(u)}function s(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),l}function l(u){return c(u)?(r.exit("data"),a(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;let d=n[u],p=-1;if(d)for(;++p<d.length;){let m=d[p];if(!m.previous||m.previous.call(o,o.previous))return!0}return!1}}}function N7(t){return e;function e(r,o){let n=-1,a;for(;++n<=r.length;)a===void 0?r[n]&&r[n][1].type==="data"&&(a=n,n++):(!r[n]||r[n][1].type!=="data")&&(n!==a+2&&(r[a][1].end=r[n-1][1].end,r.splice(a+2,n-a-2),n=a+2),a=void 0);return t?t(r,o):r}}function Lve(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){let o=t[r-1][1],n=e.sliceStream(o),a=n.length,i=-1,s=0,l;for(;a--;){let c=n[a];if(typeof c=="string"){for(i=c.length;c.charCodeAt(i-1)===32;)s++,i--;if(i)break;i=-1}else if(c===-2)l=!0,s++;else if(c!==-1){a++;break}}if(s){let c={type:r===t.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:o.end.line,column:o.end.column-s,offset:o.end.offset-s,_index:o.start._index+a,_bufferIndex:a?i:o.start._bufferIndex+i},end:Object.assign({},o.end)};o.end=Object.assign({},c.start),o.start.offset===o.end.offset?Object.assign(o,c):(t.splice(r,0,["enter",c,e],["exit",c,e]),r+=2)}r++}return t}function M7(t,e,r){let o=Object.assign(r?Object.assign({},r):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),n={},a=[],i=[],s=[],l=!0,c={consume:I,enter:w,exit:v,attempt:S(T),check:S(O),interrupt:S(O,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:t,sliceStream:g,sliceSerialize:h,now:_,defineSkip:x,write:m},d=e.tokenize.call(u,c),p;return e.resolveAll&&a.push(e),u;function m(R){return i=Mo(i,R),b(),i[i.length-1]!==null?[]:(C(e,0),u.events=ts(a,u.events,u),u.events)}function h(R,z){return Fve(g(R),z)}function g(R){return Bve(i,R)}function _(){let{line:R,column:z,offset:B,_index:M,_bufferIndex:V}=o;return{line:R,column:z,offset:B,_index:M,_bufferIndex:V}}function x(R){n[R.line]=R.column,N()}function b(){let R;for(;o._index<i.length;){let z=i[o._index];if(typeof z=="string")for(R=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===R&&o._bufferIndex<z.length;)y(z.charCodeAt(o._bufferIndex));else y(z)}}function y(R){l=void 0,p=R,d=d(R)}function I(R){ie(R)?(o.line++,o.column=1,o.offset+=R===-3?2:1,N()):R!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===i[o._index].length&&(o._bufferIndex=-1,o._index++)),u.previous=R,l=!0}function w(R,z){let B=z||{};return B.type=R,B.start=_(),u.events.push(["enter",B,u]),s.push(B),B}function v(R){let z=s.pop();return z.end=_(),u.events.push(["exit",z,u]),z}function T(R,z){C(R,z.from)}function O(R,z){z.restore()}function S(R,z){return B;function B(M,V,U){let G,k,Z,te;return Array.isArray(M)?ce(M):"tokenize"in M?ce([M]):A(M);function A(Oe){return be;function be(st){let wt=st!==null&&Oe[st],mt=st!==null&&Oe.null,zt=[...Array.isArray(wt)?wt:wt?[wt]:[],...Array.isArray(mt)?mt:mt?[mt]:[]];return ce(zt)(st)}}function ce(Oe){return G=Oe,k=0,Oe.length===0?U:Se(Oe[k])}function Se(Oe){return be;function be(st){return te=F(),Z=Oe,Oe.partial||(u.currentConstruct=Oe),Oe.name&&u.parser.constructs.disable.null.includes(Oe.name)?et(st):Oe.tokenize.call(z?Object.assign(Object.create(u),z):u,c,Ge,et)(st)}}function Ge(Oe){return l=!0,R(Z,te),V}function et(Oe){return l=!0,te.restore(),++k<G.length?Se(G[k]):U}}}function C(R,z){R.resolveAll&&!a.includes(R)&&a.push(R),R.resolve&&Ir(u.events,z,u.events.length-z,R.resolve(u.events.slice(z),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function F(){let R=_(),z=u.previous,B=u.currentConstruct,M=u.events.length,V=Array.from(s);return{restore:U,from:M};function U(){o=R,u.previous=z,u.currentConstruct=B,u.events.length=M,s=V,N()}}function N(){o.line in n&&o.column<2&&(o.column=n[o.line],o.offset+=n[o.line]-1)}}function Bve(t,e){let r=e.start._index,o=e.start._bufferIndex,n=e.end._index,a=e.end._bufferIndex,i;if(r===n)i=[t[r].slice(o,a)];else{if(i=t.slice(r,n),o>-1){let s=i[0];typeof s=="string"?i[0]=s.slice(o):i.shift()}a>0&&i.push(t[n].slice(0,a))}return i}function Fve(t,e){let r=-1,o=[],n;for(;++r<t.length;){let a=t[r],i;if(typeof a=="string")i=a;else switch(a){case-5:{i="\r";break}case-4:{i=`
|
|
51
|
+
`).map(d=>({level:d.match(/^\s+/)?.[0]?.length||0,type:"add",text:d.replace(/^\s+/,"").replace(/,$/g,""),comma:d.endsWith(",")}));let c=o.length,u=n.length;o=Ot(o,Array(u).fill(0).map(()=>({...Tb}))),n=Ot(n,Array(c).fill(0).map(()=>({...Tb})),!0)}else a==="object"?([o,n]=Ob(e,r,1,this.options,this.arrayDiffFunc),o.unshift({...IU}),o.push({...wU}),n.unshift({...IU}),n.push({...wU})):a==="array"?[o,n]=this.arrayDiffFunc(e,r,"","",0,this.options):e!==r?this.options.ignoreCase?typeof e=="string"&&typeof r=="string"&&e.toLowerCase()===r.toLowerCase()&&(o=[{level:0,type:"equal",text:e}],n=[{level:0,type:"equal",text:r}]):this.options.showModifications?(o=[{level:0,type:"modify",text:Ur(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],n=[{level:0,type:"modify",text:Ur(r,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(o=[{level:0,type:"remove",text:Ur(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)},{...Tb}],n=[{...Tb},{level:0,type:"add",text:Ur(r,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]):(o=[{level:0,type:"equal",text:Ur(e,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}],n=[{level:0,type:"equal",text:Ur(r,void 0,void 0,this.options.maxDepth,this.options.undefinedBehavior)}]);return this.sortResultLines(o,n),this.calculateLineNumbers(o),this.calculateLineNumbers(n),this.calculateCommas(o),this.calculateCommas(n),[o,n]}constructor({detectCircular:e=!0,maxDepth:r=1/0,showModifications:o=!0,arrayDiffMethod:n="normal",ignoreCase:a=!1,ignoreCaseForKey:i=!1,recursiveEqual:s=!1,preserveKeyOrder:l,undefinedBehavior:c="stringify"}={}){this.options={detectCircular:e,maxDepth:r,showModifications:o,arrayDiffMethod:n,ignoreCase:a,ignoreCaseForKey:i,recursiveEqual:s,preserveKeyOrder:l,undefinedBehavior:c},this.arrayDiffFunc=n==="lcs"||n==="unorder-lcs"?nxe:axe}};var Qi=t=>"hasLinesBefore"in t||"hasLinesAfter"in t,ixe=(t,e,r)=>Qi(t)?r:e*(t.end-t.start+1),FU=(t,e)=>{let r=[],o,n;if(t.length&&e.length)for(t=[...t],e=[...e],o={...t.shift()},n={...e.shift()};;){if(o.start===n.start){let a=Math.min(o.end,n.end);r.push({...o,...n,end:a}),o.start=n.start=a}else if(o.start<n.start){let a=Math.min(o.end,n.start);r.push({...n,...o,end:a}),o.start=a}else{let a=Math.min(o.start,n.end);r.push({...o,...n,end:a}),n.start=a}if(!t.length||!e.length)break;o.start===o.end&&(o={...t.shift()}),n.start===n.end&&(n={...e.shift()})}return t.length||r.push(...e.map(a=>({...a,token:o.token||"plain"}))),e.length||r.push(...t),r},sxe=(t,e,r,o,n,a,i,s,l)=>{if(!e.length)return[0,0];let c=0,u=0,d=t[r];Qi(d)?c=e[r]:c=e[r]+(o-d.start)*i;let p=t[n];return Qi(p)?u=l-e[n]-s:u=l-e[n]-(a-p.start)*i,[c,u]},lxe=sxe,cxe=(t,e,r,o,n,a)=>{if(!e.length)return[0,0,0,0];let i=0,s=0,l=0,c=0,u=0,d=t.length-1;for(;;){let h=Math.floor((u+d)/2);if(e[h]+ixe(t[h],n,a)<=r?u=h+1:d=h,u===d){i=u;break}}let p=t[i];for(Qi(p)?l=p.start:l=p.start+Math.floor((r-e[i])/n),u=0,d=t.length-1;;){let h=Math.floor((u+d+1)/2);if(e[h]>=o?d=h-1:u=h,u===d){s=u;break}}let m=t[s];return Qi(m)?c=m.end:c=m.start+Math.ceil((o-e[s])/n),[i,l,s,c]},uxe=cxe,ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.applyPatch=ta.calcPatch=AC=ta.lcs=ta.diff=ta.diff_core=void 0;function dxe(t,e){let{b:r,eq:o,stack_base:n}=t,{i:a,N:i,j:s,M:l,Z:c,stack_top:u}=t;for(;;)switch(e){case 0:{e:for(;i>0&&l>0;){r.fill(0,0,2*c);let d=i-l,p=i+l,m=p&1,h=a+i-1,g=s+l-1,_=(p+m)/2,x;t:for(let b=0;b<=_;b++){let y=2*Math.max(0,b-l)-b,I=b-2*Math.max(0,b-i);for(let w=y;w<=I;w+=2){let v=r[w-1-c*Math.floor((w-1)/c)],T=r[w+1-c*Math.floor((w+1)/c)],O=w===-b||w!==b&&v<T?T:v+1,S=O-w,C=O,F=S;for(;C<i&&F<l&&o(a+C,s+F);)C++,F++;if(r[w-c*Math.floor(w/c)]=C,m===1&&(x=d-w)>=1-b&&x<b&&C+r[c+x-c*Math.floor(x/c)]>=i)if(b>1||C!==O){n[u++]=a+C,n[u++]=i-C,n[u++]=s+F,n[u++]=l-F,i=O,l=S,c=2*(Math.min(i,l)+1);continue e}else break t}for(let w=y;w<=I;w+=2){let v=r[c+w-1-c*Math.floor((w-1)/c)],T=r[c+w+1-c*Math.floor((w+1)/c)],O=w===-b||w!==b&&v<T?T:v+1,S=O-w,C=O,F=S;for(;C<i&&F<l&&o(h-C,g-F);)C++,F++;if(r[c+w-c*Math.floor(w/c)]=C,m===0&&(x=d-w)>=-b&&x<=b&&C+r[x-c*Math.floor(x/c)]>=i)if(b>0||C!==O){n[u++]=a+i-O,n[u++]=O,n[u++]=s+l-S,n[u++]=S,i=i-C,l=l-F,c=2*(Math.min(i,l)+1);continue e}else break t}}if(i!==l){l>i?(a+=i,s+=i,l-=i,i=0):(a+=l,s+=l,i-=l,l=0);break}}if(i+l!==0)if(t.pxe===a||t.pye===s)t.pxe=a+i,t.pye=s+l;else{let d=t.pxs;if(t.oxs=t.pxs,t.oxe=t.pxe,t.oys=t.pys,t.oye=t.pye,t.pxs=a,t.pxe=a+i,t.pys=s,t.pye=s+l,d>=0)return t.i=a,t.N=i,t.j=s,t.M=l,t.Z=c,t.stack_top=u,1}}case 1:{if(u===0)return 2;l=n[--u],s=n[--u],i=n[--u],a=n[--u],c=2*(Math.min(i,l)+1),e=0}}}var fxe=class{[Symbol.iterator](){return this}next(){let{state:e,result:r}=this;if(this.c>1)return r.done=!0,r.value=void 0,r;let o=dxe(e,this.c);return this.c=o,o===1?(r.value=[e.oxs,e.oxe,e.oys,e.oye],r):e.pxs>=0?(r.value=[e.pxs,e.pxe,e.pys,e.pye],r):(r.done=!0,r.value=void 0,r)}constructor(e){this.state=e,this.c=0,this.result={value:null,done:!1}}};function jU(t,e,r,o,n){let a=(Math.min(e,o)+1)*2,i=e+o,s=new(i<256?Uint8Array:i<65536?Uint16Array:Uint32Array)(2*a);return new fxe({i:t,N:e,j:r,M:o,Z:a,b:s,eq:n,pxs:-1,pxe:-1,pys:-1,pye:-1,oxs:-1,oxe:-1,oys:-1,oye:-1,stack_top:0,stack_base:[]})}ta.diff_core=jU;function DC(t,e){let[r,o,n]=[0,t.length,e.length];for(;r<o&&r<n&&t[r]===e[r];)r++;if(r===o&&r===n)return[][Symbol.iterator]();for(;t[--o]===e[--n]&&o>r&&n>r;);let a=(i,s)=>t[i]===e[s];return jU(r,o+1-r,r,n+1-r,a)}ta.diff=DC;var pxe=class{[Symbol.iterator](){return this}next(){let e=this.diff.next();if(e.done){let{i:l,j:c,N:u}=this;return l<u&&(e.done=!1,e.value=[l,c,u-l],this.i=u),e}let r=e.value,o=r[0],n=r[1],a=r[3],{i,j:s}=this;return i!==o&&(r.length--,r[0]=i,r[1]=s,r[2]=o-i),this.i=n,this.j=a,e}constructor(e,r){this.diff=e,this.N=r,this.i=0,this.j=0}};function mxe(t,e){return new pxe(DC(t,e),t.length)}var AC=ta.lcs=mxe;function*hxe(t,e){let r=ArrayBuffer.isView(t)?Uint8Array.prototype.subarray:t.slice;for(let o of DC(t,e))o[2]=r.call(e,o[2],o[3]),yield o}ta.calcPatch=hxe;function*gxe(t,e){let r=0,o=ArrayBuffer.isView(t)?Uint8Array.prototype.subarray:t.slice;for(let[n,a,i]of e)r<n&&(yield o.call(t,r,n)),i.length>0&&(yield i),r=a;r<t.length&&(yield o.call(t,r))}ta.applyPatch=gxe;var zU=(t,e)=>{let r=[],o=0;for(let n of t)r.push(o),o+=n.length+e;return r.push(o-e),r},zb=t=>t.filter(e=>e.end>e.start),_xe=(t,e,r)=>{let o=[],n=[],a=0,i=0;if(r.mode==="word"){let l=r.wordSeparator||" ",c=t.split(l),u=e.split(l),d=[...AC(c,u)],p=l.length,m=zU(c,p),h=zU(u,p);for(let[g,_,x]of d)g>a&&o.push({type:"remove",start:m[a],end:m[g]}),_>i&&n.push({type:"add",start:h[i],end:h[_]}),a=g+x,i=_+x,o.push({start:m[g],end:m[a]}),n.push({start:h[_],end:h[i]});return t.length>a&&o.push({type:"remove",start:m[a],end:t.length}),e.length>i&&n.push({type:"add",start:h[i],end:e.length}),o=zb(o),n=zb(n),[o,n]}let s=AC(t,e);for(let[l,c,u]of s)l>a&&o.push({type:"remove",start:a,end:l}),c>i&&n.push({type:"add",start:i,end:c}),a=l+u,i=c+u,o.push({start:l,end:a}),n.push({start:c,end:i});return t.length>a&&o.push({type:"remove",start:a,end:t.length}),e.length>i&&n.push({type:"add",start:i,end:e.length}),o=zb(o),n=zb(n),[o,n]},xxe=_xe,qU=(t,e,r)=>{if(!t)return[{token:"plain",start:r,end:e.length+r}];if(e==="undefined"||e==="Infinity"||e==="-Infinity"||e==="NaN"||/^\d+n$/i.test(e)||e.startsWith("Symbol(")||e.startsWith("function")||e.startsWith("("))return[{token:"invalid",start:r,end:e.length+r}];if(!Number.isNaN(Number(e)))return[{token:"number",start:r,end:e.length+r}];if(e==="true"||e==="false")return[{token:"boolean",start:r,end:e.length+r}];if(e==="null")return[{token:"null",start:r,end:e.length+r}];if(e.startsWith('"')){if(e.endsWith(": [")||e.endsWith(": {"))return[{token:"key",start:r,end:e.length-3+r},{token:"punctuation",start:e.length-3,end:e.length-2+r},{token:"plain",start:e.length-2,end:e.length-1+r},{token:"punctuation",start:e.length-1,end:e.length+r}];let o=1;for(;o<e.length&&e[o]!=='"';)e[o]==="\\"&&++o,++o;return o===e.length-1?[{token:"string",start:r,end:e.length+r}]:[{token:"key",start:r,end:o+1+r},{token:"punctuation",start:o+1,end:o+2+r},{token:"plain",start:o+2,end:o+3+r},...qU(t,e.substring(o+3),r+o+3)]}return e==="{"||e==="}"||e==="["||e==="]"?[{token:"punctuation",start:r,end:e.length+r}]:[{token:"plain",start:r,end:e.length+r}]},UU=qU,VU={threshold:8,margin:3},bxe=(t,e,r,o)=>{if(!r||o)return[{start:0,end:t.length,isEqual:!1}];let n=[];for(let c=0;c<t.length;c++)t[c].type==="equal"&&e[c].type==="equal"?n.length&&n[n.length-1].isEqual?n[n.length-1].end++:n.push({start:c,end:c+1,isEqual:!0}):n.length&&!n[n.length-1].isEqual?n[n.length-1].end++:n.push({start:c,end:c+1,isEqual:!1});let a=r===!0?VU:{...VU,...r},{threshold:i,margin:s}=a;i<s*2+1&&console.warn(`Threshold (${i}) is no more than 2 margins + 1 "expand" line (${s} * 2 + 1), it's not necessary to hide unchanged areas which have less than ${s*2+1} lines.`);let l=[];for(let c=0;c<n.length;c++){let u=n[c];if(!u.isEqual||u.end-u.start<i||u.end-u.start<=s*2+1){l.push(u);continue}c?c===n.length-1?(l.push({start:u.start,end:u.start+s,isEqual:!0}),l.push({hasLinesBefore:!1,hasLinesAfter:!0,start:u.start+s,end:t.length,isEqual:!0})):(l.push({start:u.start,end:u.start+s,isEqual:!0}),l.push({hasLinesBefore:!0,hasLinesAfter:!0,start:u.start+s,end:u.end-s,isEqual:!0}),l.push({start:u.end-s,end:u.end,isEqual:!0})):(l.push({hasLinesBefore:!0,hasLinesAfter:!1,start:0,end:u.end-s,isEqual:!0}),l.push({start:u.end-s,end:u.end,isEqual:!0}))}return l},HU=bxe,yxe=2,$U=20,vxe={noChangeDetected:"No change detected"},Ub=t=>{let[e,r]=t.diff,o=Tt(()=>e.length===r.length&&e.every(U=>U.type==="equal")&&r.every(U=>U.type==="equal"),[e,r]),n={...vxe,...t.texts},a=t.lineNumbers?`calc(${String(e.length).length}ch + 16px)`:0,i=t.indent??yxe,s=i==="tab"?" ":" ",l=i==="tab"?1:i,c={mode:t.inlineDiffOptions?.mode||"char",wordSeparator:t.inlineDiffOptions?.wordSeparator||""},u=t.hideUnchangedLines??!1,{scrollContainer:d="body",itemHeight:p=18,expandLineHeight:m=26}=!t.virtual||t.virtual===!0?{}:t.virtual,h=d==="body"?document.body:document.querySelector(d),g=H(e),_=H(r),x=H(HU(e,r,u,o)),b=H([]),y=H(0),I=H(null),[,w]=P({}),v=()=>{if(b.current=[],t.virtual){let U=0;for(let G of x.current)Qi(G)?(b.current.push(U),U+=m):(b.current.push(U),U+=p*(G.end-G.start));y.current=x.current.reduce((G,k)=>Qi(k)?G+m:G+(k.end-k.start)*p,0)}w({})};L(()=>{g.current=e,_.current=r,x.current=HU(e,r,u,o),v()},[u,e,r]),L(()=>{if(!t.virtual||!h)return;let U=()=>w({});return h.addEventListener("scroll",U),()=>{h.removeEventListener("scroll",U)}},[t.virtual,h]);let T=U=>G=>{let k=[...x.current],Z=k[U];k[U]={...Z,end:Math.max(Z.end-G,Z.start)},U+1<x.current.length-1&&(k[U+1]={...k[U+1],start:Math.max(Z.end-G,Z.start)}),x.current=k,v()},O=U=>G=>{let k=[...x.current],Z=k[U];k[U]={...Z,start:Math.min(Z.start+G,Z.end)},U>1&&(k[U-1]={...k[U-1],end:Math.min(Z.start+G,Z.end)}),x.current=k,v()},S=U=>()=>{let G=[...x.current],k=G[U];G[U]={...k,start:k.start,end:k.start},U+1<x.current.length-1?G[U+1]={...G[U+1],start:k.start}:G[U-1]={...G[U-1],end:k.end},x.current=G,v()},C=(U,G=[],k=!1,Z=!1)=>Q(Ae,null,G.map((te,A)=>{let ce=U.slice(te.start,te.end);if(!te.type&&!te.token)return ce;let Se=[te.type?`inline-diff-${te.type}`:"",te.token?`token ${te.token}`:""].filter(Boolean).join(" ");return Q("span",{key:`${A}-${te.type}-${ce}`,className:Se},ce)}),k&&(Z?Q("span",{className:"token punctuation"},","):",")),F=(U,G)=>{let k=g.current[U],Z=_.current[U],[te,A]=t.highlightInlineDiff&&k.type==="modify"&&Z.type==="modify"?xxe(k.text,Z.text,c):[[],[]],ce=UU(G,k.text,0),Se=UU(G,Z.text,0),Ge=FU(ce,te),et=FU(Se,A),Oe=k.type!=="equal"?t.bgColour?.[k.type]??"":"",be=Z.type!=="equal"?t.bgColour?.[Z.type]??"":"";return Q("tr",{key:U},t.lineNumbers&&Q("td",{className:`line-${k.type} line-number`,style:{backgroundColor:Oe}},k.lineNumber),Q("td",{className:`line-${k.type}`,style:{backgroundColor:Oe}},Q("pre",null,k.text&&s.repeat(k.level*l),C(k.text,Ge,k.comma,G))),t.lineNumbers&&Q("td",{className:`line-${Z.type} line-number`,style:{backgroundColor:be}},Z.lineNumber),Q("td",{className:`line-${Z.type}`,style:{backgroundColor:be}},Q("pre",null,Z.text&&s.repeat(Z.level*l),C(Z.text,et,Z.comma,G))))},N=(U,G,k,Z)=>Q(Ae,null,U&&Q("button",{onClick:()=>T(Z)(k)},"\u2B61 Show ",k," lines before"),Q("button",{onClick:()=>S(Z)()},"\u2B65 Show all unchanged lines"),G&&Q("button",{onClick:()=>O(Z)(k)},"\u2B63 Show ",k," lines after")),R=(U,G,k,Z,te)=>{let{start:A,end:ce}=U;if(A=Math.max(A,k),ce=Math.min(ce,Z),A===ce)return null;if(!Qi(U))return Array(ce-A).fill(0).map((Oe,be)=>F(A+be,te));let{hasLinesBefore:Se,hasLinesAfter:Ge}=U,et=typeof u=="boolean"?$U:u.expandMoreLinesLimit||$U;return[Q("tr",{key:`expand-line-${G}`,className:"expand-line"},Q("td",{colSpan:4,className:`${Se?"has-lines-before":""} ${Ge?"has-lines-after":""}`},typeof u!="boolean"&&u.expandLineRenderer?u.expandLineRenderer({hasLinesBefore:Se,hasLinesAfter:Ge,onExpandBefore:T(G),onExpandAfter:O(G),onExpandAll:S(G)}):N(Se,Ge,et,G)))]},z=U=>{if(o&&u)return Q("tr",{key:"message-line",className:"message-line"},Q("td",{colSpan:4},n.noChangeDetected));if(!t.virtual)return x.current.map((zt,ot)=>R(zt,ot,0,g.current.length,U));let G=h?.clientHeight??0,k=h?.scrollTop??0,Z=k+G,te=I.current,A=te?.offsetTop??0;for(;te?.offsetParent&&te?.offsetParent!==h;)te=te.offsetParent,A+=te.offsetTop;if(A>Z||A+y.current<k)return Q("tr",null,Q("td",{colSpan:4,style:{height:`${y.current}px`}}));let ce=k-A,Se=Z-A,[Ge,et,Oe,be]=uxe(x.current,b.current,ce,Se,p,m),[st,wt]=lxe(x.current,b.current,Ge,et,Oe,be,p,m,y.current),mt=x.current.slice(Ge,Oe+1);return mt.length?Q(Ae,null,Q("tr",null,Q("td",{colSpan:4,style:{height:st,padding:0}})),mt.map((zt,ot)=>R(zt,ot,et,be,U)),Q("tr",null,Q("td",{colSpan:4,style:{height:wt,padding:0}}))):Q("tr",null,Q("td",{colSpan:4,style:{height:`${y.current}px`}}))},B=()=>Q("colgroup",{className:"measure-line"},t.lineNumbers&&Q("col",{style:{width:a}}),Q("col",null),t.lineNumbers&&Q("col",{style:{width:a}}),Q("col",null)),M=["json-diff-viewer",t.virtual&&"json-diff-viewer-virtual",t.syntaxHighlight&&`json-diff-viewer-theme-${t.syntaxHighlight.theme||"monokai"}`,t.className].filter(Boolean).join(" "),V=!!t.syntaxHighlight;return Q("table",{className:M,style:t.style},B(),Q("tbody",{ref:I},z(V)))};Ub.displayName="Viewer";function Vb(t){let e=t.left,r=t.right,[o,n]=P(!1),[a,i]=P(null),[s,l]=P(null),c=WU(a?.fields||{}),u=WU(s?.fields||{}),p=new OC({}).diff(c,u),m=`/cms/compare?left=${KU(e)}&right=${KU(r)}`;async function h(){n(!0);let[g,_]=await Promise.all([PS(e.docId,e.versionId),PS(r.docId,r.versionId)]);i(g),l(_),n(!1)}return L(()=>{h()},[]),o?f(Re,{size:"md",color:"gray"}):f("div",{className:ke(t.className,"DocDiffViewer"),children:[t.showExpandButton&&f("div",{className:"DocDiffViewer__expand",children:f(X,{component:"a",variant:"default",size:"xs",compact:!0,href:m,target:"_blank",children:"Open in new tab"})}),f("div",{className:"DocDiffViewer__header",children:[f("div",{className:"DocDiffViewer__header__label",children:[t.left.docId,"@",t.left.versionId," - modified"," ",GU(a)]}),f("div",{className:"DocDiffViewer__header__label",children:[t.right.docId,"@",t.right.versionId," - modified"," ",GU(s)]})]}),f(Ub,{diff:p,syntaxHighlight:{theme:"root-cms"},lineNumbers:!0,highlightInlineDiff:!0,hideUnchangedLines:!0,inlineDiffOptions:{mode:"word",wordSeparator:" "}})]})}function GU(t){return t?.sys?.modifiedAt?Rn(t.sys.modifiedAt.toMillis()):"never"}function WU(t){return db(t,{removeArrayKey:!0})}function KU(t){return encodeURIComponent(`${t.docId}@${t.versionId}`).replaceAll("%2F","/").replaceAll("%40","@")}var XU="PublishDocModal";function YU(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(XU,{...r,title:`Publish ${t.docId}`,innerProps:t,size:"850px"})}}}function Hb(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(""),[l,c]=P(!1),u=H(null),d=Ye(),p=xt(),m=n==="scheduled"?"Schedule":"Publish";async function h(){try{c(!0),await pz(e.docId),c(!1),pe({title:"Published!",message:`Succesfully published ${e.docId}.`,autoClose:1e4}),d.closeAll()}catch(b){console.error(b),pe({title:"Publish failed",message:`Failed to publish ${e.docId}.`,color:"red",autoClose:!1})}}async function g(){try{c(!0);let b=Math.floor(new Date(i).getTime());await mz(e.docId,b),c(!1),pe({title:"Scheduled!",message:`${e.docId} will go live ${i}.`,autoClose:1e4}),d.closeAll()}catch(b){console.error(b),pe({title:"Schedule failed",message:`Failed to schedule ${e.docId}.`,color:"red",autoClose:!1})}}function _(){d.openConfirmModal({...p,title:`${m} ${e.docId}`,children:f(Me,{size:"body-sm",weight:"semi-bold",children:["Are you sure you want to publish ",f("code",{children:e.docId}),"? The doc will go live ",n==="now"?"now":`at ${i}`,"."]}),labels:{confirm:m,cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"dark",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!0,onConfirm:()=>{n==="now"?h():n==="scheduled"&&g()}})}let x=!0;return(n==="now"||n==="scheduled"&&i)&&(x=!1),f("div",{className:"PublishDocModal",children:f("div",{className:"PublishDocModal__content",children:[f("form",{className:"PublishDocModal__form",onSubmit:b=>{b.preventDefault(),_()},children:[f("div",{className:"PublishDocModal__form__publishOptions",children:f("div",{className:"PublishDocModal__form__publishOptions__options",children:[f("label",{className:ke("PublishDocModal__form__publishOptions__option",n==="now"&&"PublishDocModal__form__publishOptions__option--selected",n&&n!=="now"&&"PublishDocModal__form__publishOptions__option--unselected"),children:[f("div",{className:"PublishDocModal__form__publishOptions__option__input",children:[f("input",{type:"radio",name:"publish-option",value:"now",checked:n==="now",onChange:()=>a("now")})," ","Now"]}),f("div",{className:"PublishDocModal__form__publishOptions__option__help",children:"Content will go live immediately."})]}),f("label",{className:ke("PublishDocModal__form__publishOptions__option",n==="scheduled"&&"PublishDocModal__form__publishOptions__option--selected",n&&n!=="scheduled"&&"PublishDocModal__form__publishOptions__option--unselected"),children:[f("div",{className:"PublishDocModal__form__publishOptions__option__input",children:[f("input",{type:"radio",name:"publish-option",value:"scheduled",checked:n==="scheduled",onChange:()=>a("scheduled")}),f("div",{children:"Scheduled"})]}),f("div",{className:"PublishDocModal__form__publishOptions__option__help",children:"Content will go live at the date and time specified below."}),f("div",{className:"PublishDocModal__form__publishOptions__option__input2",children:[f("input",{ref:u,type:"datetime-local",disabled:n!=="scheduled",value:i,min:Eu(),onChange:b=>{let y=b.target;s(y.value)}}),f("div",{className:"PublishDocModal__form__publishOptions__option__input2__help",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})]})]})}),f("div",{className:"PublishDocModal__form__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",disabled:x,loading:l,type:"submit",children:m})]})]}),f(Ixe,{docId:e.docId})]})})}function Ixe(t){let e=t.docId,[r,o]=P(!1);function n(){o(!0)}return f("div",{className:"PublishDocModal__ShowChanges",children:f(Ic,{iconPosition:"right",onChange:()=>n(),children:f(Ic.Item,{label:"Show changes",children:r?f(Vb,{left:{docId:e,versionId:"published"},right:{docId:e,versionId:"draft"},showExpandButton:!0}):f(Re,{})})})})}Hb.id=XU;var Zi="Releases";async function QU(t,e){if(!t)throw new Error("missing data source id");let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,Zi,t);await Pp(o,async a=>{if((await a.get(n)).exists())throw new Error(`release exists: ${t}`);await a.set(n,{...e,id:t,createdAt:Ut(),createdBy:window.firebase.user.email})}),Je("release.create",{metadata:{releaseId:t}})}async function ZU(){let t=window.__ROOT_CTX.rootConfig.projectId,e=window.firebase.db,r=nn(e,"Projects",t,Zi),o=to(r,Qn("createdAt","desc")),n=await an(o),a=[];return n.forEach(i=>{a.push(i.data())}),a}async function kl(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,Zi,t),n=await vr(o);return n.exists()?n.data():null}async function JU(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,Zi,t);await rr(n,e),Je("release.save",{metadata:{releaseId:t}})}async function e8(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,Zi,t);await P9(o),console.log(`deleted release ${t}`),Je("release.delete",{metadata:{releaseId:t}})}async function t8(t){let e=await kl(t);if(!e)throw new Error(`release not found: ${t}`);let r=e.docIds||[];if(r.length===0)throw new Error(`no docs to publish for release: ${t}`);let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,a=we(n,"Projects",o,Zi,t),i=sn(n);i.update(a,{publishedAt:Ut(),publishedBy:window.firebase.user.email,scheduledAt:zr(),scheduledBy:zr()}),await CS(r,{batch:i}),console.log(`published release: ${t}`),Je("release.publish",{metadata:{releaseId:t,docIds:r}})}async function r8(t,e){if(!await kl(t))throw new Error(`release not found: ${t}`);typeof e=="number"&&(e=Ze.fromMillis(e));let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,a=we(n,"Projects",o,Zi,t);await rr(a,{scheduledAt:e,scheduledBy:window.firebase.user.email}),Je("release.publish",{metadata:{releaseId:t,scheduledAt:e.toMillis()}})}async function o8(t){if(!await kl(t))throw new Error(`release not found: ${t}`);let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,Zi,t);await rr(n,{scheduledAt:zr(),scheduledBy:zr()}),Je("release.unschedule",{metadata:{releaseId:t}})}var n8="ScheduleReleaseModal";function a8(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(n8,{...r,title:`Schedule release: ${t.releaseId}`,innerProps:t})}}}function $b(t){let{innerProps:e,context:r,id:o}=t,[n,a]=P(""),[i,s]=P(!1),l=H(null),c=Ye();async function u(){s(!0),await bt(async()=>{let d=Math.floor(new Date(n).getTime());if(Math.floor(new Date().getTime())>=d)throw new Error("bad datetime, please choose a date in the future");let m=Ze.fromMillis(d);await r8(e.releaseId,d),pe({title:"Scheduled!",message:`Release ${e.releaseId} will go live ${n}.`,autoClose:1e4}),c.closeAll(),e.onScheduled&&e.onScheduled(m)}),s(!1)}return f("div",{className:"ScheduleReleaseModal",children:f("div",{className:"ScheduleReleaseModal__content",children:f("form",{className:"ScheduleReleaseModal__form",onSubmit:d=>{d.preventDefault(),u()},children:[f("div",{className:"ScheduleReleaseModal__form__description",children:"Content in the release will go live at the datetime specified below."}),f("div",{className:"ScheduleReleaseModal__form__dateInput",children:[f("input",{ref:l,type:"datetime-local",value:n,min:Eu(),onChange:d=>{let p=d.target;a(p.value)}}),f("div",{className:"ScheduleReleaseModal__form__dateInput__help",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),f("div",{className:"ScheduleReleaseModal__form__buttons",children:[f(X,{variant:"outline",onClick:()=>r.closeModal(o),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",size:"xs",color:"dark",loading:i,type:"submit",children:"Schedule"})]})]})})})}$b.id=n8;var s8="VersionHistoryModal";function l8(t){let e=Ye(),r=xt();return{open:()=>{e.openContextModal(s8,{...r,innerProps:t,size:"min(calc(100% - 32px), 720px)"})}}}function jb(t){let{innerProps:e}=t,r=e.docId,[o,n]=P(!0),[a,i]=P([]),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});async function l(){n(!0);let d=await vz(r);n(!1),i(d)}async function c(d){await Iz(r,d),pe({title:"Saved!",message:`Restored ${r} to ${s.format(d.sys.modifiedAt.toDate())}.`,autoClose:5e3}),e.onRestore&&e.onRestore({version:d})}function u(d){let p=i8(r,d._versionId),m=i8(r,"draft");return`/cms/compare?left=${p}&right=${m}`}return L(()=>{l()},[]),o?f(Re,{}):f("div",{className:"VersionHistoryModal",children:[f(Te,{className:"VersionHistoryModal__title",size:"h2",children:[f(Hp,{strokeWidth:1.5}),f("span",{children:"Version history"})]}),f("div",{className:"VersionHistoryModal__docId",children:f("code",{children:r})}),a.length===0?f(Me,{className:"VersionHistoryModal__versionsEmpty",size:"body",children:[f("p",{children:"No versions found."}),f("p",{className:"VersionHistoryModal__versionsEmpty__developer",children:"For developers: Configure the Root CMS cron job to populate versions."})]}):f(kr,{className:"VersionHistoryModal__versions",children:[f("thead",{children:f("tr",{children:[f("th",{children:"modified at"}),f("th",{children:"modified by"}),f("th",{children:"actions"})]})}),f("tbody",{children:a.map((d,p)=>f("tr",{children:[f("td",{children:f(Me,{size:"body-sm",children:s.format(d.sys.modifiedAt.toDate())})}),f("td",{children:f(Me,{size:"body-sm",children:d.sys.modifiedBy})}),f("td",{children:f("div",{className:"VersionHistoryModal__versions__buttons",children:[f(X,{variant:"default",size:"xs",compact:!0,onClick:()=>c(d),children:"restore"}),f(X,{className:"VersionHistoryModal__versions__buttons__compare",component:"a",variant:"default",size:"xs",compact:!0,href:u(d),target:"_blank",rightIcon:f(_l,{size:12}),children:"compare"})]})})]}))})]})]})}function i8(t,e){return encodeURIComponent(`${t}@${e}`).replaceAll("%2F","/").replaceAll("%40","@")}jb.id=s8;var hV=wv(mV(),1);var WC=hV.default;var Sye={};function KC(t,e){let r=e||Sye,o=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,n=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return _V(t,o,n)}function _V(t,e,r){if(Cye(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return gV(t.children,e,r)}return Array.isArray(t)?gV(t,e,r):""}function gV(t,e,r){let o=[],n=-1;for(;++n<t.length;)o[n]=_V(t[n],e,r);return o.join("")}function Cye(t){return!!(t&&typeof t=="object")}var xV=document.createElement("i");function Vu(t){let e="&"+t+";";xV.innerHTML=e;let r=xV.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===e?!1:r}function Ir(t,e,r,o){let n=t.length,a=0,i;if(e<0?e=-e>n?0:n+e:e=e>n?n:e,r=r>0?r:0,o.length<1e4)i=Array.from(o),i.unshift(e,r),t.splice(...i);else for(r&&t.splice(e,r);a<o.length;)i=o.slice(a,a+1e4),i.unshift(e,0),t.splice(...i),a+=1e4,e+=1e4}function Mo(t,e){return t.length>0?(Ir(t,t.length,0,e),t):e}var bV={}.hasOwnProperty;function ry(t){let e={},r=-1;for(;++r<t.length;)kye(e,t[r]);return e}function kye(t,e){let r;for(r in e){let n=(bV.call(t,r)?t[r]:void 0)||(t[r]={}),a=e[r],i;if(a)for(i in a){bV.call(n,i)||(n[i]=[]);let s=a[i];Tye(n[i],Array.isArray(s)?s:s?[s]:[])}}}function Tye(t,e){let r=-1,o=[];for(;++r<e.length;)(e[r].add==="after"?t:o).push(e[r]);Ir(t,0,0,o)}function oy(t,e){let r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function mo(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Pr=es(/[A-Za-z]/),Or=es(/[\dA-Za-z]/),yV=es(/[#-'*+\--9=?A-Z^-~]/);function Ol(t){return t!==null&&(t<32||t===127)}var em=es(/\d/),vV=es(/[\dA-Fa-f]/),IV=es(/[!-/:-@[-`{-~]/);function ie(t){return t!==null&&t<-2}function Xe(t){return t!==null&&(t<0||t===32)}function Pe(t){return t===-2||t===-1||t===32}var Al=es(/\p{P}|\p{S}/u),Ta=es(/\s/);function es(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Ee(t,e,r,o){let n=o?o-1:Number.POSITIVE_INFINITY,a=0;return i;function i(l){return Pe(l)?(t.enter(r),s(l)):e(l)}function s(l){return Pe(l)&&a++<n?(t.consume(l),s):(t.exit(r),e(l))}}var wV={tokenize:Pye};function Pye(t){let e=t.attempt(this.parser.constructs.contentInitial,o,n),r;return e;function o(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),Ee(t,e,"linePrefix")}function n(s){return t.enter("paragraph"),a(s)}function a(s){let l=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,i(s)}function i(s){if(s===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(s);return}return ie(s)?(t.consume(s),t.exit("chunkText"),a):(t.consume(s),i)}}var SV={tokenize:Oye},EV={tokenize:Aye};function Oye(t){let e=this,r=[],o=0,n,a,i;return s;function s(y){if(o<r.length){let I=r[o];return e.containerState=I[1],t.attempt(I[0].continuation,l,c)(y)}return c(y)}function l(y){if(o++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,n&&b();let I=e.events.length,w=I,v;for(;w--;)if(e.events[w][0]==="exit"&&e.events[w][1].type==="chunkFlow"){v=e.events[w][1].end;break}x(o);let T=I;for(;T<e.events.length;)e.events[T][1].end=Object.assign({},v),T++;return Ir(e.events,w+1,0,e.events.slice(I)),e.events.length=T,c(y)}return s(y)}function c(y){if(o===r.length){if(!n)return p(y);if(n.currentConstruct&&n.currentConstruct.concrete)return h(y);e.interrupt=!!(n.currentConstruct&&!n._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(EV,u,d)(y)}function u(y){return n&&b(),x(o),p(y)}function d(y){return e.parser.lazy[e.now().line]=o!==r.length,i=e.now().offset,h(y)}function p(y){return e.containerState={},t.attempt(EV,m,h)(y)}function m(y){return o++,r.push([e.currentConstruct,e.containerState]),p(y)}function h(y){if(y===null){n&&b(),x(0),t.consume(y);return}return n=n||e.parser.flow(e.now()),t.enter("chunkFlow",{contentType:"flow",previous:a,_tokenizer:n}),g(y)}function g(y){if(y===null){_(t.exit("chunkFlow"),!0),x(0),t.consume(y);return}return ie(y)?(t.consume(y),_(t.exit("chunkFlow")),o=0,e.interrupt=void 0,s):(t.consume(y),g)}function _(y,I){let w=e.sliceStream(y);if(I&&w.push(null),y.previous=a,a&&(a.next=y),a=y,n.defineSkip(y.start),n.write(w),e.parser.lazy[y.start.line]){let v=n.events.length;for(;v--;)if(n.events[v][1].start.offset<i&&(!n.events[v][1].end||n.events[v][1].end.offset>i))return;let T=e.events.length,O=T,S,C;for(;O--;)if(e.events[O][0]==="exit"&&e.events[O][1].type==="chunkFlow"){if(S){C=e.events[O][1].end;break}S=!0}for(x(o),v=T;v<e.events.length;)e.events[v][1].end=Object.assign({},C),v++;Ir(e.events,O+1,0,e.events.slice(T)),e.events.length=v}}function x(y){let I=r.length;for(;I-- >y;){let w=r[I];e.containerState=w[1],w[0].exit.call(e,t)}r.length=y}function b(){n.write([null]),a=void 0,n=void 0,e.containerState._closeFlow=void 0}}function Aye(t,e,r){return Ee(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Hu(t){if(t===null||Xe(t)||Ta(t))return 1;if(Al(t))return 2}function ts(t,e,r){let o=[],n=-1;for(;++n<t.length;){let a=t[n].resolveAll;a&&!o.includes(a)&&(e=a(e,r),o.push(a))}return e}var tm={name:"attention",tokenize:Rye,resolveAll:Dye};function Dye(t,e){let r=-1,o,n,a,i,s,l,c,u;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(o=r;o--;)if(t[o][0]==="exit"&&t[o][1].type==="attentionSequence"&&t[o][1]._open&&e.sliceSerialize(t[o][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[o][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[o][1].end.offset-t[o][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;l=t[o][1].end.offset-t[o][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;let d=Object.assign({},t[o][1].end),p=Object.assign({},t[r][1].start);CV(d,-l),CV(p,l),i={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},t[o][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},t[r][1].start),end:p},a={type:l>1?"strongText":"emphasisText",start:Object.assign({},t[o][1].end),end:Object.assign({},t[r][1].start)},n={type:l>1?"strong":"emphasis",start:Object.assign({},i.start),end:Object.assign({},s.end)},t[o][1].end=Object.assign({},i.start),t[r][1].start=Object.assign({},s.end),c=[],t[o][1].end.offset-t[o][1].start.offset&&(c=Mo(c,[["enter",t[o][1],e],["exit",t[o][1],e]])),c=Mo(c,[["enter",n,e],["enter",i,e],["exit",i,e],["enter",a,e]]),c=Mo(c,ts(e.parser.constructs.insideSpan.null,t.slice(o+1,r),e)),c=Mo(c,[["exit",a,e],["enter",s,e],["exit",s,e],["exit",n,e]]),t[r][1].end.offset-t[r][1].start.offset?(u=2,c=Mo(c,[["enter",t[r][1],e],["exit",t[r][1],e]])):u=0,Ir(t,o-1,r-o+3,c),r=o+c.length-u-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function Rye(t,e){let r=this.parser.constructs.attentionMarkers.null,o=this.previous,n=Hu(o),a;return i;function i(l){return a=l,t.enter("attentionSequence"),s(l)}function s(l){if(l===a)return t.consume(l),s;let c=t.exit("attentionSequence"),u=Hu(l),d=!u||u===2&&n||r.includes(l),p=!n||n===2&&u||r.includes(o);return c._open=!!(a===42?d:d&&(n||!p)),c._close=!!(a===42?p:p&&(u||!d)),e(l)}}function CV(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var XC={name:"autolink",tokenize:Nye};function Nye(t,e,r){let o=0;return n;function n(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),a}function a(m){return Pr(m)?(t.consume(m),i):m===64?r(m):c(m)}function i(m){return m===43||m===45||m===46||Or(m)?(o=1,s(m)):c(m)}function s(m){return m===58?(t.consume(m),o=0,l):(m===43||m===45||m===46||Or(m))&&o++<32?(t.consume(m),s):(o=0,c(m))}function l(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):m===null||m===32||m===60||Ol(m)?r(m):(t.consume(m),l)}function c(m){return m===64?(t.consume(m),u):yV(m)?(t.consume(m),c):r(m)}function u(m){return Or(m)?d(m):r(m)}function d(m){return m===46?(t.consume(m),o=0,u):m===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):p(m)}function p(m){if((m===45||Or(m))&&o++<63){let h=m===45?p:d;return t.consume(m),h}return r(m)}}var Pa={tokenize:Mye,partial:!0};function Mye(t,e,r){return o;function o(a){return Pe(a)?Ee(t,n,"linePrefix")(a):n(a)}function n(a){return a===null||ie(a)?e(a):r(a)}}var ny={name:"blockQuote",tokenize:Lye,continuation:{tokenize:Bye},exit:Fye};function Lye(t,e,r){let o=this;return n;function n(i){if(i===62){let s=o.containerState;return s.open||(t.enter("blockQuote",{_container:!0}),s.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(i),t.exit("blockQuoteMarker"),a}return r(i)}function a(i){return Pe(i)?(t.enter("blockQuotePrefixWhitespace"),t.consume(i),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(i))}}function Bye(t,e,r){let o=this;return n;function n(i){return Pe(i)?Ee(t,a,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):a(i)}function a(i){return t.attempt(ny,e,r)(i)}}function Fye(t){t.exit("blockQuote")}var ay={name:"characterEscape",tokenize:zye};function zye(t,e,r){return o;function o(a){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(a),t.exit("escapeMarker"),n}function n(a){return IV(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(a)}}var iy={name:"characterReference",tokenize:Uye};function Uye(t,e,r){let o=this,n=0,a,i;return s;function s(d){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),l}function l(d){return d===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(d),t.exit("characterReferenceMarkerNumeric"),c):(t.enter("characterReferenceValue"),a=31,i=Or,u(d))}function c(d){return d===88||d===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(d),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,i=vV,u):(t.enter("characterReferenceValue"),a=7,i=em,u(d))}function u(d){if(d===59&&n){let p=t.exit("characterReferenceValue");return i===Or&&!Vu(o.sliceSerialize(p))?r(d):(t.enter("characterReferenceMarker"),t.consume(d),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return i(d)&&n++<a?(t.consume(d),u):r(d)}}var kV={tokenize:Hye,partial:!0},sy={name:"codeFenced",tokenize:Vye,concrete:!0};function Vye(t,e,r){let o=this,n={tokenize:w,partial:!0},a=0,i=0,s;return l;function l(v){return c(v)}function c(v){let T=o.events[o.events.length-1];return a=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,s=v,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),u(v)}function u(v){return v===s?(i++,t.consume(v),u):i<3?r(v):(t.exit("codeFencedFenceSequence"),Pe(v)?Ee(t,d,"whitespace")(v):d(v))}function d(v){return v===null||ie(v)?(t.exit("codeFencedFence"),o.interrupt?e(v):t.check(kV,g,I)(v)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||ie(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),d(v)):Pe(v)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ee(t,m,"whitespace")(v)):v===96&&v===s?r(v):(t.consume(v),p)}function m(v){return v===null||ie(v)?d(v):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),h(v))}function h(v){return v===null||ie(v)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),d(v)):v===96&&v===s?r(v):(t.consume(v),h)}function g(v){return t.attempt(n,I,_)(v)}function _(v){return t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),x}function x(v){return a>0&&Pe(v)?Ee(t,b,"linePrefix",a+1)(v):b(v)}function b(v){return v===null||ie(v)?t.check(kV,g,I)(v):(t.enter("codeFlowValue"),y(v))}function y(v){return v===null||ie(v)?(t.exit("codeFlowValue"),b(v)):(t.consume(v),y)}function I(v){return t.exit("codeFenced"),e(v)}function w(v,T,O){let S=0;return C;function C(B){return v.enter("lineEnding"),v.consume(B),v.exit("lineEnding"),F}function F(B){return v.enter("codeFencedFence"),Pe(B)?Ee(v,N,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):N(B)}function N(B){return B===s?(v.enter("codeFencedFenceSequence"),R(B)):O(B)}function R(B){return B===s?(S++,v.consume(B),R):S>=i?(v.exit("codeFencedFenceSequence"),Pe(B)?Ee(v,z,"whitespace")(B):z(B)):O(B)}function z(B){return B===null||ie(B)?(v.exit("codeFencedFence"),T(B)):O(B)}}}function Hye(t,e,r){let o=this;return n;function n(i){return i===null?r(i):(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),a)}function a(i){return o.parser.lazy[o.now().line]?r(i):e(i)}}var rm={name:"codeIndented",tokenize:jye},$ye={tokenize:qye,partial:!0};function jye(t,e,r){let o=this;return n;function n(c){return t.enter("codeIndented"),Ee(t,a,"linePrefix",5)(c)}function a(c){let u=o.events[o.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?i(c):r(c)}function i(c){return c===null?l(c):ie(c)?t.attempt($ye,i,l)(c):(t.enter("codeFlowValue"),s(c))}function s(c){return c===null||ie(c)?(t.exit("codeFlowValue"),i(c)):(t.consume(c),s)}function l(c){return t.exit("codeIndented"),e(c)}}function qye(t,e,r){let o=this;return n;function n(i){return o.parser.lazy[o.now().line]?r(i):ie(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n):Ee(t,a,"linePrefix",5)(i)}function a(i){let s=o.events[o.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(i):ie(i)?n(i):r(i)}}var YC={name:"codeText",tokenize:Kye,resolve:Gye,previous:Wye};function Gye(t){let e=t.length-4,r=3,o,n;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(o=r;++o<e;)if(t[o][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(o=r-1,e++;++o<=e;)n===void 0?o!==e&&t[o][1].type!=="lineEnding"&&(n=o):(o===e||t[o][1].type==="lineEnding")&&(t[n][1].type="codeTextData",o!==n+2&&(t[n][1].end=t[o-1][1].end,t.splice(n+2,o-n-2),e-=o-n-2,o=n+2),n=void 0);return t}function Wye(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Kye(t,e,r){let o=this,n=0,a,i;return s;function s(p){return t.enter("codeText"),t.enter("codeTextSequence"),l(p)}function l(p){return p===96?(t.consume(p),n++,l):(t.exit("codeTextSequence"),c(p))}function c(p){return p===null?r(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),c):p===96?(i=t.enter("codeTextSequence"),a=0,d(p)):ie(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(p))}function u(p){return p===null||p===32||p===96||ie(p)?(t.exit("codeTextData"),c(p)):(t.consume(p),u)}function d(p){return p===96?(t.consume(p),a++,d):a===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(i.type="codeTextData",u(p))}}var ly=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,r){let o=r??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(e,o):e>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(e,r,o){let n=r||0;this.setCursor(Math.trunc(e));let a=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return o&&om(this.left,o),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),om(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),om(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let r=this.left.splice(e,Number.POSITIVE_INFINITY);om(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);om(this.left,r.reverse())}}};function om(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function cy(t){let e={},r=-1,o,n,a,i,s,l,c,u=new ly(t);for(;++r<u.length;){for(;r in e;)r=e[r];if(o=u.get(r),r&&o[1].type==="chunkFlow"&&u.get(r-1)[1].type==="listItemPrefix"&&(l=o[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(o[0]==="enter")o[1].contentType&&(Object.assign(e,Xye(u,r)),r=e[r],c=!0);else if(o[1]._container){for(a=r,n=void 0;a--&&(i=u.get(a),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank");)i[0]==="enter"&&(n&&(u.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=a);n&&(o[1].end=Object.assign({},u.get(n)[1].start),s=u.slice(n,r),s.unshift(o),u.splice(n,r-n+1,s))}}return Ir(t,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Xye(t,e){let r=t.get(e)[1],o=t.get(e)[2],n=e-1,a=[],i=r._tokenizer||o.parser[r.contentType](r.start),s=i.events,l=[],c={},u,d,p=-1,m=r,h=0,g=0,_=[g];for(;m;){for(;t.get(++n)[1]!==m;);a.push(n),m._tokenizer||(u=o.sliceStream(m),m.next||u.push(null),d&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(u),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=r;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(g=p+1,_.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):_.pop(),p=_.length;p--;){let x=s.slice(_[p],_[p+1]),b=a.pop();l.push([b,b+x.length-1]),t.splice(b,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[h+l[p][0]]=h+l[p][1],h+=l[p][1]-l[p][0]-1;return c}var QC={tokenize:Zye,resolve:Qye},Yye={tokenize:Jye,partial:!0};function Qye(t){return cy(t),t}function Zye(t,e){let r;return o;function o(s){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),n(s)}function n(s){return s===null?a(s):ie(s)?t.check(Yye,i,a)(s):(t.consume(s),n)}function a(s){return t.exit("chunkContent"),t.exit("content"),e(s)}function i(s){return t.consume(s),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}function Jye(t,e,r){let o=this;return n;function n(i){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Ee(t,a,"linePrefix")}function a(i){if(i===null||ie(i))return r(i);let s=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(i):t.interrupt(o.parser.constructs.flow,r,e)(i)}}function uy(t,e,r,o,n,a,i,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return d;function d(x){return x===60?(t.enter(o),t.enter(n),t.enter(a),t.consume(x),t.exit(a),p):x===null||x===32||x===41||Ol(x)?r(x):(t.enter(o),t.enter(i),t.enter(s),t.enter("chunkString",{contentType:"string"}),g(x))}function p(x){return x===62?(t.enter(a),t.consume(x),t.exit(a),t.exit(n),t.exit(o),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(t.exit("chunkString"),t.exit(s),p(x)):x===null||x===60||ie(x)?r(x):(t.consume(x),x===92?h:m)}function h(x){return x===60||x===62||x===92?(t.consume(x),m):m(x)}function g(x){return!u&&(x===null||x===41||Xe(x))?(t.exit("chunkString"),t.exit(s),t.exit(i),t.exit(o),e(x)):u<c&&x===40?(t.consume(x),u++,g):x===41?(t.consume(x),u--,g):x===null||x===32||x===40||Ol(x)?r(x):(t.consume(x),x===92?_:g)}function _(x){return x===40||x===41||x===92?(t.consume(x),g):g(x)}}function dy(t,e,r,o,n,a){let i=this,s=0,l;return c;function c(m){return t.enter(o),t.enter(n),t.consume(m),t.exit(n),t.enter(a),u}function u(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?r(m):m===93?(t.exit(a),t.enter(n),t.consume(m),t.exit(n),t.exit(o),e):ie(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),u):(t.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||ie(m)||s++>999?(t.exit("chunkString"),u(m)):(t.consume(m),l||(l=!Pe(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(t.consume(m),s++,d):d(m)}}function fy(t,e,r,o,n,a){let i;return s;function s(p){return p===34||p===39||p===40?(t.enter(o),t.enter(n),t.consume(p),t.exit(n),i=p===40?41:p,l):r(p)}function l(p){return p===i?(t.enter(n),t.consume(p),t.exit(n),t.exit(o),e):(t.enter(a),c(p))}function c(p){return p===i?(t.exit(a),l(i)):p===null?r(p):ie(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ee(t,c,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===i||p===null||ie(p)?(t.exit("chunkString"),c(p)):(t.consume(p),p===92?d:u)}function d(p){return p===i||p===92?(t.consume(p),u):u(p)}}function Dl(t,e){let r;return o;function o(n){return ie(n)?(t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),r=!0,o):Pe(n)?Ee(t,o,r?"linePrefix":"lineSuffix")(n):e(n)}}var ZC={name:"definition",tokenize:tve},eve={tokenize:rve,partial:!0};function tve(t,e,r){let o=this,n;return a;function a(m){return t.enter("definition"),i(m)}function i(m){return dy.call(o,t,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return n=mo(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),l):r(m)}function l(m){return Xe(m)?Dl(t,c)(m):c(m)}function c(m){return uy(t,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return t.attempt(eve,d,d)(m)}function d(m){return Pe(m)?Ee(t,p,"whitespace")(m):p(m)}function p(m){return m===null||ie(m)?(t.exit("definition"),o.parser.defined.push(n),e(m)):r(m)}}function rve(t,e,r){return o;function o(s){return Xe(s)?Dl(t,n)(s):r(s)}function n(s){return fy(t,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Pe(s)?Ee(t,i,"whitespace")(s):i(s)}function i(s){return s===null||ie(s)?e(s):r(s)}}var JC={name:"hardBreakEscape",tokenize:ove};function ove(t,e,r){return o;function o(a){return t.enter("hardBreakEscape"),t.consume(a),n}function n(a){return ie(a)?(t.exit("hardBreakEscape"),e(a)):r(a)}}var ek={name:"headingAtx",tokenize:ave,resolve:nve};function nve(t,e){let r=t.length-2,o=3,n,a;return t[o][1].type==="whitespace"&&(o+=2),r-2>o&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(o===r-1||r-4>o&&t[r-2][1].type==="whitespace")&&(r-=o+1===r?2:4),r>o&&(n={type:"atxHeadingText",start:t[o][1].start,end:t[r][1].end},a={type:"chunkText",start:t[o][1].start,end:t[r][1].end,contentType:"text"},Ir(t,o,r-o+1,[["enter",n,e],["enter",a,e],["exit",a,e],["exit",n,e]])),t}function ave(t,e,r){let o=0;return n;function n(u){return t.enter("atxHeading"),a(u)}function a(u){return t.enter("atxHeadingSequence"),i(u)}function i(u){return u===35&&o++<6?(t.consume(u),i):u===null||Xe(u)?(t.exit("atxHeadingSequence"),s(u)):r(u)}function s(u){return u===35?(t.enter("atxHeadingSequence"),l(u)):u===null||ie(u)?(t.exit("atxHeading"),e(u)):Pe(u)?Ee(t,s,"whitespace")(u):(t.enter("atxHeadingText"),c(u))}function l(u){return u===35?(t.consume(u),l):(t.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Xe(u)?(t.exit("atxHeadingText"),s(u)):(t.consume(u),c)}}var TV=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],tk=["pre","script","style","textarea"];var rk={name:"htmlFlow",tokenize:cve,resolveTo:lve,concrete:!0},ive={tokenize:dve,partial:!0},sve={tokenize:uve,partial:!0};function lve(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function cve(t,e,r){let o=this,n,a,i,s,l;return c;function c(A){return u(A)}function u(A){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(A),d}function d(A){return A===33?(t.consume(A),p):A===47?(t.consume(A),a=!0,g):A===63?(t.consume(A),n=3,o.interrupt?e:k):Pr(A)?(t.consume(A),i=String.fromCharCode(A),_):r(A)}function p(A){return A===45?(t.consume(A),n=2,m):A===91?(t.consume(A),n=5,s=0,h):Pr(A)?(t.consume(A),n=4,o.interrupt?e:k):r(A)}function m(A){return A===45?(t.consume(A),o.interrupt?e:k):r(A)}function h(A){let ce="CDATA[";return A===ce.charCodeAt(s++)?(t.consume(A),s===ce.length?o.interrupt?e:N:h):r(A)}function g(A){return Pr(A)?(t.consume(A),i=String.fromCharCode(A),_):r(A)}function _(A){if(A===null||A===47||A===62||Xe(A)){let ce=A===47,Se=i.toLowerCase();return!ce&&!a&&tk.includes(Se)?(n=1,o.interrupt?e(A):N(A)):TV.includes(i.toLowerCase())?(n=6,ce?(t.consume(A),x):o.interrupt?e(A):N(A)):(n=7,o.interrupt&&!o.parser.lazy[o.now().line]?r(A):a?b(A):y(A))}return A===45||Or(A)?(t.consume(A),i+=String.fromCharCode(A),_):r(A)}function x(A){return A===62?(t.consume(A),o.interrupt?e:N):r(A)}function b(A){return Pe(A)?(t.consume(A),b):C(A)}function y(A){return A===47?(t.consume(A),C):A===58||A===95||Pr(A)?(t.consume(A),I):Pe(A)?(t.consume(A),y):C(A)}function I(A){return A===45||A===46||A===58||A===95||Or(A)?(t.consume(A),I):w(A)}function w(A){return A===61?(t.consume(A),v):Pe(A)?(t.consume(A),w):y(A)}function v(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(t.consume(A),l=A,T):Pe(A)?(t.consume(A),v):O(A)}function T(A){return A===l?(t.consume(A),l=null,S):A===null||ie(A)?r(A):(t.consume(A),T)}function O(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Xe(A)?w(A):(t.consume(A),O)}function S(A){return A===47||A===62||Pe(A)?y(A):r(A)}function C(A){return A===62?(t.consume(A),F):r(A)}function F(A){return A===null||ie(A)?N(A):Pe(A)?(t.consume(A),F):r(A)}function N(A){return A===45&&n===2?(t.consume(A),M):A===60&&n===1?(t.consume(A),V):A===62&&n===4?(t.consume(A),Z):A===63&&n===3?(t.consume(A),k):A===93&&n===5?(t.consume(A),G):ie(A)&&(n===6||n===7)?(t.exit("htmlFlowData"),t.check(ive,te,R)(A)):A===null||ie(A)?(t.exit("htmlFlowData"),R(A)):(t.consume(A),N)}function R(A){return t.check(sve,z,te)(A)}function z(A){return t.enter("lineEnding"),t.consume(A),t.exit("lineEnding"),B}function B(A){return A===null||ie(A)?R(A):(t.enter("htmlFlowData"),N(A))}function M(A){return A===45?(t.consume(A),k):N(A)}function V(A){return A===47?(t.consume(A),i="",U):N(A)}function U(A){if(A===62){let ce=i.toLowerCase();return tk.includes(ce)?(t.consume(A),Z):N(A)}return Pr(A)&&i.length<8?(t.consume(A),i+=String.fromCharCode(A),U):N(A)}function G(A){return A===93?(t.consume(A),k):N(A)}function k(A){return A===62?(t.consume(A),Z):A===45&&n===2?(t.consume(A),k):N(A)}function Z(A){return A===null||ie(A)?(t.exit("htmlFlowData"),te(A)):(t.consume(A),Z)}function te(A){return t.exit("htmlFlow"),e(A)}}function uve(t,e,r){let o=this;return n;function n(i){return ie(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),a):r(i)}function a(i){return o.parser.lazy[o.now().line]?r(i):e(i)}}function dve(t,e,r){return o;function o(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),t.attempt(Pa,e,r)}}var ok={name:"htmlText",tokenize:fve};function fve(t,e,r){let o=this,n,a,i;return s;function s(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),l}function l(k){return k===33?(t.consume(k),c):k===47?(t.consume(k),w):k===63?(t.consume(k),y):Pr(k)?(t.consume(k),O):r(k)}function c(k){return k===45?(t.consume(k),u):k===91?(t.consume(k),a=0,h):Pr(k)?(t.consume(k),b):r(k)}function u(k){return k===45?(t.consume(k),m):r(k)}function d(k){return k===null?r(k):k===45?(t.consume(k),p):ie(k)?(i=d,V(k)):(t.consume(k),d)}function p(k){return k===45?(t.consume(k),m):d(k)}function m(k){return k===62?M(k):k===45?p(k):d(k)}function h(k){let Z="CDATA[";return k===Z.charCodeAt(a++)?(t.consume(k),a===Z.length?g:h):r(k)}function g(k){return k===null?r(k):k===93?(t.consume(k),_):ie(k)?(i=g,V(k)):(t.consume(k),g)}function _(k){return k===93?(t.consume(k),x):g(k)}function x(k){return k===62?M(k):k===93?(t.consume(k),x):g(k)}function b(k){return k===null||k===62?M(k):ie(k)?(i=b,V(k)):(t.consume(k),b)}function y(k){return k===null?r(k):k===63?(t.consume(k),I):ie(k)?(i=y,V(k)):(t.consume(k),y)}function I(k){return k===62?M(k):y(k)}function w(k){return Pr(k)?(t.consume(k),v):r(k)}function v(k){return k===45||Or(k)?(t.consume(k),v):T(k)}function T(k){return ie(k)?(i=T,V(k)):Pe(k)?(t.consume(k),T):M(k)}function O(k){return k===45||Or(k)?(t.consume(k),O):k===47||k===62||Xe(k)?S(k):r(k)}function S(k){return k===47?(t.consume(k),M):k===58||k===95||Pr(k)?(t.consume(k),C):ie(k)?(i=S,V(k)):Pe(k)?(t.consume(k),S):M(k)}function C(k){return k===45||k===46||k===58||k===95||Or(k)?(t.consume(k),C):F(k)}function F(k){return k===61?(t.consume(k),N):ie(k)?(i=F,V(k)):Pe(k)?(t.consume(k),F):S(k)}function N(k){return k===null||k===60||k===61||k===62||k===96?r(k):k===34||k===39?(t.consume(k),n=k,R):ie(k)?(i=N,V(k)):Pe(k)?(t.consume(k),N):(t.consume(k),z)}function R(k){return k===n?(t.consume(k),n=void 0,B):k===null?r(k):ie(k)?(i=R,V(k)):(t.consume(k),R)}function z(k){return k===null||k===34||k===39||k===60||k===61||k===96?r(k):k===47||k===62||Xe(k)?S(k):(t.consume(k),z)}function B(k){return k===47||k===62||Xe(k)?S(k):r(k)}function M(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):r(k)}function V(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),U}function U(k){return Pe(k)?Ee(t,G,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):G(k)}function G(k){return t.enter("htmlTextData"),i(k)}}var Rl={name:"labelEnd",tokenize:xve,resolveTo:_ve,resolveAll:gve},pve={tokenize:bve},mve={tokenize:yve},hve={tokenize:vve};function gve(t){let e=-1;for(;++e<t.length;){let r=t[e][1];(r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd")&&(t.splice(e+1,r.type==="labelImage"?4:2),r.type="data",e++)}return t}function _ve(t,e){let r=t.length,o=0,n,a,i,s;for(;r--;)if(n=t[r][1],a){if(n.type==="link"||n.type==="labelLink"&&n._inactive)break;t[r][0]==="enter"&&n.type==="labelLink"&&(n._inactive=!0)}else if(i){if(t[r][0]==="enter"&&(n.type==="labelImage"||n.type==="labelLink")&&!n._balanced&&(a=r,n.type!=="labelLink")){o=2;break}}else n.type==="labelEnd"&&(i=r);let l={type:t[a][1].type==="labelLink"?"link":"image",start:Object.assign({},t[a][1].start),end:Object.assign({},t[t.length-1][1].end)},c={type:"label",start:Object.assign({},t[a][1].start),end:Object.assign({},t[i][1].end)},u={type:"labelText",start:Object.assign({},t[a+o+2][1].end),end:Object.assign({},t[i-2][1].start)};return s=[["enter",l,e],["enter",c,e]],s=Mo(s,t.slice(a+1,a+o+3)),s=Mo(s,[["enter",u,e]]),s=Mo(s,ts(e.parser.constructs.insideSpan.null,t.slice(a+o+4,i-3),e)),s=Mo(s,[["exit",u,e],t[i-2],t[i-1],["exit",c,e]]),s=Mo(s,t.slice(i+1)),s=Mo(s,[["exit",l,e]]),Ir(t,a,t.length,s),t}function xve(t,e,r){let o=this,n=o.events.length,a,i;for(;n--;)if((o.events[n][1].type==="labelImage"||o.events[n][1].type==="labelLink")&&!o.events[n][1]._balanced){a=o.events[n][1];break}return s;function s(p){return a?a._inactive?d(p):(i=o.parser.defined.includes(mo(o.sliceSerialize({start:a.end,end:o.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):r(p)}function l(p){return p===40?t.attempt(pve,u,i?u:d)(p):p===91?t.attempt(mve,u,i?c:d)(p):i?u(p):d(p)}function c(p){return t.attempt(hve,u,d)(p)}function u(p){return e(p)}function d(p){return a._balanced=!0,r(p)}}function bve(t,e,r){return o;function o(d){return t.enter("resource"),t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),n}function n(d){return Xe(d)?Dl(t,a)(d):a(d)}function a(d){return d===41?u(d):uy(t,i,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function i(d){return Xe(d)?Dl(t,l)(d):u(d)}function s(d){return r(d)}function l(d){return d===34||d===39||d===40?fy(t,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Xe(d)?Dl(t,u)(d):u(d)}function u(d){return d===41?(t.enter("resourceMarker"),t.consume(d),t.exit("resourceMarker"),t.exit("resource"),e):r(d)}}function yve(t,e,r){let o=this;return n;function n(s){return dy.call(o,t,a,i,"reference","referenceMarker","referenceString")(s)}function a(s){return o.parser.defined.includes(mo(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?e(s):r(s)}function i(s){return r(s)}}function vve(t,e,r){return o;function o(a){return t.enter("reference"),t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),n}function n(a){return a===93?(t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),t.exit("reference"),e):r(a)}}var nk={name:"labelStartImage",tokenize:Ive,resolveAll:Rl.resolveAll};function Ive(t,e,r){let o=this;return n;function n(s){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(s),t.exit("labelImageMarker"),a}function a(s){return s===91?(t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelImage"),i):r(s)}function i(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(s):e(s)}}var ak={name:"labelStartLink",tokenize:wve,resolveAll:Rl.resolveAll};function wve(t,e,r){let o=this;return n;function n(i){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(i),t.exit("labelMarker"),t.exit("labelLink"),a}function a(i){return i===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(i):e(i)}}var nm={name:"lineEnding",tokenize:Eve};function Eve(t,e){return r;function r(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Ee(t,e,"linePrefix")}}var Nl={name:"thematicBreak",tokenize:Sve};function Sve(t,e,r){let o=0,n;return a;function a(c){return t.enter("thematicBreak"),i(c)}function i(c){return n=c,s(c)}function s(c){return c===n?(t.enter("thematicBreakSequence"),l(c)):o>=3&&(c===null||ie(c))?(t.exit("thematicBreak"),e(c)):r(c)}function l(c){return c===n?(t.consume(c),o++,l):(t.exit("thematicBreakSequence"),Pe(c)?Ee(t,s,"whitespace")(c):s(c))}}var ho={name:"list",tokenize:Tve,continuation:{tokenize:Pve},exit:Ave},Cve={tokenize:Dve,partial:!0},kve={tokenize:Ove,partial:!0};function Tve(t,e,r){let o=this,n=o.events[o.events.length-1],a=n&&n[1].type==="linePrefix"?n[2].sliceSerialize(n[1],!0).length:0,i=0;return s;function s(m){let h=o.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!o.containerState.marker||m===o.containerState.marker:em(m)){if(o.containerState.type||(o.containerState.type=h,t.enter(h,{_container:!0})),h==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(Nl,r,c)(m):c(m);if(!o.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(m)}return r(m)}function l(m){return em(m)&&++i<10?(t.consume(m),l):(!o.interrupt||i<2)&&(o.containerState.marker?m===o.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),c(m)):r(m)}function c(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||m,t.check(Pa,o.interrupt?r:u,t.attempt(Cve,p,d))}function u(m){return o.containerState.initialBlankLine=!0,a++,p(m)}function d(m){return Pe(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),p):r(m)}function p(m){return o.containerState.size=a+o.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function Pve(t,e,r){let o=this;return o.containerState._closeFlow=void 0,t.check(Pa,n,a);function n(s){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Ee(t,e,"listItemIndent",o.containerState.size+1)(s)}function a(s){return o.containerState.furtherBlankLines||!Pe(s)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,i(s)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,t.attempt(kve,e,i)(s))}function i(s){return o.containerState._closeFlow=!0,o.interrupt=void 0,Ee(t,t.attempt(ho,e,r),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Ove(t,e,r){let o=this;return Ee(t,n,"listItemIndent",o.containerState.size+1);function n(a){let i=o.events[o.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===o.containerState.size?e(a):r(a)}}function Ave(t){t.exit(this.containerState.type)}function Dve(t,e,r){let o=this;return Ee(t,n,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function n(a){let i=o.events[o.events.length-1];return!Pe(a)&&i&&i[1].type==="listItemPrefixWhitespace"?e(a):r(a)}}var py={name:"setextUnderline",tokenize:Nve,resolveTo:Rve};function Rve(t,e){let r=t.length,o,n,a;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){o=r;break}t[r][1].type==="paragraph"&&(n=r)}else t[r][1].type==="content"&&t.splice(r,1),!a&&t[r][1].type==="definition"&&(a=r);let i={type:"setextHeading",start:Object.assign({},t[n][1].start),end:Object.assign({},t[t.length-1][1].end)};return t[n][1].type="setextHeadingText",a?(t.splice(n,0,["enter",i,e]),t.splice(a+1,0,["exit",t[o][1],e]),t[o][1].end=Object.assign({},t[a][1].end)):t[o][1]=i,t.push(["exit",i,e]),t}function Nve(t,e,r){let o=this,n;return a;function a(c){let u=o.events.length,d;for(;u--;)if(o.events[u][1].type!=="lineEnding"&&o.events[u][1].type!=="linePrefix"&&o.events[u][1].type!=="content"){d=o.events[u][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||d)?(t.enter("setextHeadingLine"),n=c,i(c)):r(c)}function i(c){return t.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===n?(t.consume(c),s):(t.exit("setextHeadingLineSequence"),Pe(c)?Ee(t,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ie(c)?(t.exit("setextHeadingLine"),e(c)):r(c)}}var PV={tokenize:Mve};function Mve(t){let e=this,r=t.attempt(Pa,o,t.attempt(this.parser.constructs.flowInitial,n,Ee(t,t.attempt(this.parser.constructs.flow,n,t.attempt(QC,n)),"linePrefix")));return r;function o(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var OV={resolveAll:NV()},AV=RV("string"),DV=RV("text");function RV(t){return{tokenize:e,resolveAll:NV(t==="text"?Lve:void 0)};function e(r){let o=this,n=this.parser.constructs[t],a=r.attempt(n,i,s);return i;function i(u){return c(u)?a(u):s(u)}function s(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),l}function l(u){return c(u)?(r.exit("data"),a(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;let d=n[u],p=-1;if(d)for(;++p<d.length;){let m=d[p];if(!m.previous||m.previous.call(o,o.previous))return!0}return!1}}}function NV(t){return e;function e(r,o){let n=-1,a;for(;++n<=r.length;)a===void 0?r[n]&&r[n][1].type==="data"&&(a=n,n++):(!r[n]||r[n][1].type!=="data")&&(n!==a+2&&(r[a][1].end=r[n-1][1].end,r.splice(a+2,n-a-2),n=a+2),a=void 0);return t?t(r,o):r}}function Lve(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){let o=t[r-1][1],n=e.sliceStream(o),a=n.length,i=-1,s=0,l;for(;a--;){let c=n[a];if(typeof c=="string"){for(i=c.length;c.charCodeAt(i-1)===32;)s++,i--;if(i)break;i=-1}else if(c===-2)l=!0,s++;else if(c!==-1){a++;break}}if(s){let c={type:r===t.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:o.end.line,column:o.end.column-s,offset:o.end.offset-s,_index:o.start._index+a,_bufferIndex:a?i:o.start._bufferIndex+i},end:Object.assign({},o.end)};o.end=Object.assign({},c.start),o.start.offset===o.end.offset?Object.assign(o,c):(t.splice(r,0,["enter",c,e],["exit",c,e]),r+=2)}r++}return t}function MV(t,e,r){let o=Object.assign(r?Object.assign({},r):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1}),n={},a=[],i=[],s=[],l=!0,c={consume:I,enter:w,exit:v,attempt:S(T),check:S(O),interrupt:S(O,{interrupt:!0})},u={previous:null,code:null,containerState:{},events:[],parser:t,sliceStream:g,sliceSerialize:h,now:_,defineSkip:x,write:m},d=e.tokenize.call(u,c),p;return e.resolveAll&&a.push(e),u;function m(R){return i=Mo(i,R),b(),i[i.length-1]!==null?[]:(C(e,0),u.events=ts(a,u.events,u),u.events)}function h(R,z){return Fve(g(R),z)}function g(R){return Bve(i,R)}function _(){let{line:R,column:z,offset:B,_index:M,_bufferIndex:V}=o;return{line:R,column:z,offset:B,_index:M,_bufferIndex:V}}function x(R){n[R.line]=R.column,N()}function b(){let R;for(;o._index<i.length;){let z=i[o._index];if(typeof z=="string")for(R=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===R&&o._bufferIndex<z.length;)y(z.charCodeAt(o._bufferIndex));else y(z)}}function y(R){l=void 0,p=R,d=d(R)}function I(R){ie(R)?(o.line++,o.column=1,o.offset+=R===-3?2:1,N()):R!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===i[o._index].length&&(o._bufferIndex=-1,o._index++)),u.previous=R,l=!0}function w(R,z){let B=z||{};return B.type=R,B.start=_(),u.events.push(["enter",B,u]),s.push(B),B}function v(R){let z=s.pop();return z.end=_(),u.events.push(["exit",z,u]),z}function T(R,z){C(R,z.from)}function O(R,z){z.restore()}function S(R,z){return B;function B(M,V,U){let G,k,Z,te;return Array.isArray(M)?ce(M):"tokenize"in M?ce([M]):A(M);function A(Oe){return be;function be(st){let wt=st!==null&&Oe[st],mt=st!==null&&Oe.null,zt=[...Array.isArray(wt)?wt:wt?[wt]:[],...Array.isArray(mt)?mt:mt?[mt]:[]];return ce(zt)(st)}}function ce(Oe){return G=Oe,k=0,Oe.length===0?U:Se(Oe[k])}function Se(Oe){return be;function be(st){return te=F(),Z=Oe,Oe.partial||(u.currentConstruct=Oe),Oe.name&&u.parser.constructs.disable.null.includes(Oe.name)?et(st):Oe.tokenize.call(z?Object.assign(Object.create(u),z):u,c,Ge,et)(st)}}function Ge(Oe){return l=!0,R(Z,te),V}function et(Oe){return l=!0,te.restore(),++k<G.length?Se(G[k]):U}}}function C(R,z){R.resolveAll&&!a.includes(R)&&a.push(R),R.resolve&&Ir(u.events,z,u.events.length-z,R.resolve(u.events.slice(z),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function F(){let R=_(),z=u.previous,B=u.currentConstruct,M=u.events.length,V=Array.from(s);return{restore:U,from:M};function U(){o=R,u.previous=z,u.currentConstruct=B,u.events.length=M,s=V,N()}}function N(){o.line in n&&o.column<2&&(o.column=n[o.line],o.offset+=n[o.line]-1)}}function Bve(t,e){let r=e.start._index,o=e.start._bufferIndex,n=e.end._index,a=e.end._bufferIndex,i;if(r===n)i=[t[r].slice(o,a)];else{if(i=t.slice(r,n),o>-1){let s=i[0];typeof s=="string"?i[0]=s.slice(o):i.shift()}a>0&&i.push(t[n].slice(0,a))}return i}function Fve(t,e){let r=-1,o=[],n;for(;++r<t.length;){let a=t[r],i;if(typeof a=="string")i=a;else switch(a){case-5:{i="\r";break}case-4:{i=`
|
|
52
52
|
`;break}case-3:{i=`\r
|
|
53
|
-
`;break}case-2:{i=e?" ":" ";break}case-1:{if(!e&&n)continue;i=" ";break}default:i=String.fromCharCode(a)}n=a===-2,o.push(i)}return o.join("")}var ik={};Qj(ik,{attentionMarkers:()=>Gve,contentInitial:()=>Uve,disable:()=>Wve,document:()=>zve,flow:()=>Hve,flowInitial:()=>Vve,insideSpan:()=>qve,string:()=>$ve,text:()=>jve});var zve={42:ho,43:ho,45:ho,48:ho,49:ho,50:ho,51:ho,52:ho,53:ho,54:ho,55:ho,56:ho,57:ho,62:ny},Uve={91:ZC},Vve={[-2]:rm,[-1]:rm,32:rm},Hve={35:ek,42:Nl,45:[py,Nl],60:rk,61:py,95:Nl,96:sy,126:sy},$ve={38:iy,92:ay},jve={[-5]:nm,[-4]:nm,[-3]:nm,33:nk,38:iy,42:tm,60:[XC,ok],91:ak,92:[JC,ay],93:Rl,95:tm,96:YC},qve={null:[tm,O7]},Gve={null:[42,95]},Wve={null:[]};function sk(t){let r=ry([ik,...(t||{}).extensions||[]]),o={defined:[],lazy:{},constructs:r,content:n(w7),document:n(S7),flow:n(P7),string:n(A7),text:n(D7)};return o;function n(a){return i;function i(s){return M7(o,a,s)}}}function lk(t){for(;!cy(t););return t}var L7=/[\0\t\n\r]/g;function ck(){let t=1,e="",r=!0,o;return n;function n(a,i,s){let l=[],c,u,d,p,m;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(i||void 0).decode(a)),d=0,e="",r&&(a.charCodeAt(0)===65279&&d++,r=void 0);d<a.length;){if(L7.lastIndex=d,c=L7.exec(a),p=c&&c.index!==void 0?c.index:a.length,m=a.charCodeAt(p),!c){e=a.slice(d);break}if(m===10&&d===p&&o)l.push(-3),o=void 0;else switch(o&&(l.push(-5),o=void 0),d<p&&(l.push(a.slice(d,p)),t+=p-d),m){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:o=!0,t=1}d=p+1}return s&&(o&&l.push(-5),e&&l.push(e),l.push(null)),l}}var Kve=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function B7(t){return t.replace(Kve,Xve)}function Xve(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let n=r.charCodeAt(1),a=n===120||n===88;return oy(r.slice(a?2:1),a?16:10)}return Vu(r)||t}function $u(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?F7(t.position):"start"in t||"end"in t?F7(t):"line"in t||"column"in t?uk(t):""}function uk(t){return z7(t&&t.line)+":"+z7(t&&t.column)}function F7(t){return uk(t&&t.start)+"-"+uk(t&&t.end)}function z7(t){return t&&typeof t=="number"?t:1}var V7={}.hasOwnProperty;function dk(t,e,r){return typeof e!="string"&&(r=e,e=void 0),Yve(r)(lk(sk(r).document().write(ck()(t,e,!0))))}function Yve(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ft),autolinkProtocol:S,autolinkEmail:S,atxHeading:a(ao),blockQuote:a(st),characterEscape:S,characterReference:S,codeFenced:a(wt),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(wt,i),codeText:a(mt,i),codeTextData:S,data:S,codeFlowValue:S,definition:a(zt),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(ot),hardBreakEscape:a(dt),hardBreakTrailing:a(dt),htmlFlow:a(fe,i),htmlFlowData:S,htmlText:a(fe,i),htmlTextData:S,image:a(go),label:i,link:a(ft),listItem:a(wr),listItemValue:p,listOrdered:a(Be,d),listUnordered:a(Be),paragraph:a(fr),reference:A,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(ao),strong:a(Vr),thematicBreak:a(W)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:be,autolinkProtocol:Oe,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:Ge,characterReference:et,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:C,codeIndented:l(x),codeText:l(B),codeTextData:C,data:C,definition:l(),definitionDestinationString:I,definitionLabelString:b,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(R),htmlFlowData:C,htmlText:l(z),htmlTextData:C,image:l(V),label:G,labelText:U,lineEnding:F,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:k,resourceTitleString:Z,resource:te,setextHeading:l(O),setextHeadingLineSequence:T,setextHeadingText:v,strong:l(),thematicBreak:l()}};H7(e,(t||{}).mdastExtensions||[]);let r={};return o;function o(D){let $={type:"root",children:[]},J={stack:[$],tokenStack:[],config:e,enter:s,exit:c,buffer:i,resume:u,data:r},ye=[],je=-1;for(;++je<D.length;)if(D[je][1].type==="listOrdered"||D[je][1].type==="listUnordered")if(D[je][0]==="enter")ye.push(je);else{let nt=ye.pop();je=n(D,nt,je)}for(je=-1;++je<D.length;){let nt=e[D[je][0]];V7.call(nt,D[je][1].type)&&nt[D[je][1].type].call(Object.assign({sliceSerialize:D[je][2].sliceSerialize},J),D[je][1])}if(J.tokenStack.length>0){let nt=J.tokenStack[J.tokenStack.length-1];(nt[1]||U7).call(J,void 0,nt[0])}for($.position={start:rs(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:rs(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<e.transforms.length;)$=e.transforms[je]($)||$;return $}function n(D,$,J){let ye=$-1,je=-1,nt=!1,Fo,nr,Kt,hn;for(;++ye<=J;){let Hr=D[ye];switch(Hr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Hr[0]==="enter"?je++:je--,hn=void 0;break}case"lineEndingBlank":{Hr[0]==="enter"&&(Fo&&!hn&&!je&&!Kt&&(Kt=ye),hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hn=void 0}if(!je&&Hr[0]==="enter"&&Hr[1].type==="listItemPrefix"||je===-1&&Hr[0]==="exit"&&(Hr[1].type==="listUnordered"||Hr[1].type==="listOrdered")){if(Fo){let _o=ye;for(nr=void 0;_o--;){let xo=D[_o];if(xo[1].type==="lineEnding"||xo[1].type==="lineEndingBlank"){if(xo[0]==="exit")continue;nr&&(D[nr][1].type="lineEndingBlank",nt=!0),xo[1].type="lineEnding",nr=_o}else if(!(xo[1].type==="linePrefix"||xo[1].type==="blockQuotePrefix"||xo[1].type==="blockQuotePrefixWhitespace"||xo[1].type==="blockQuoteMarker"||xo[1].type==="listItemIndent"))break}Kt&&(!nr||Kt<nr)&&(Fo._spread=!0),Fo.end=Object.assign({},nr?D[nr][1].start:Hr[1].end),D.splice(nr||ye,0,["exit",Fo,Hr[2]]),ye++,J++}if(Hr[1].type==="listItemPrefix"){let _o={type:"listItem",_spread:!1,start:Object.assign({},Hr[1].start),end:void 0};Fo=_o,D.splice(ye,0,["enter",_o,Hr[2]]),ye++,J++,Kt=void 0,hn=!0}}}return D[$][1]._spread=nt,J}function a(D,$){return J;function J(ye){s.call(this,D(ye),ye),$&&$.call(this,ye)}}function i(){this.stack.push({type:"fragment",children:[]})}function s(D,$,J){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([$,J]),D.position={start:rs($.start),end:void 0}}function l(D){return $;function $(J){D&&D.call(this,J),c.call(this,J)}}function c(D,$){let J=this.stack.pop(),ye=this.tokenStack.pop();if(ye)ye[0].type!==D.type&&($?$.call(this,D,ye[0]):(ye[1]||U7).call(this,D,ye[0]));else throw new Error("Cannot close `"+D.type+"` ("+$u({start:D.start,end:D.end})+"): it\u2019s not open");J.position.end=rs(D.end)}function u(){return KC(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){let $=this.stack[this.stack.length-2];$.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function m(){let D=this.resume(),$=this.stack[this.stack.length-1];$.lang=D}function h(){let D=this.resume(),$=this.stack[this.stack.length-1];$.meta=D}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/(\r?\n|\r)$/g,"")}function b(D){let $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=mo(this.sliceSerialize(D)).toLowerCase()}function y(){let D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function I(){let D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function w(D){let $=this.stack[this.stack.length-1];if(!$.depth){let J=this.sliceSerialize(D).length;$.depth=J}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function T(D){let $=this.stack[this.stack.length-1];$.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function S(D){let J=this.stack[this.stack.length-1].children,ye=J[J.length-1];(!ye||ye.type!=="text")&&(ye=_e(),ye.position={start:rs(D.start),end:void 0},J.push(ye)),this.stack.push(ye)}function C(D){let $=this.stack.pop();$.value+=this.sliceSerialize(D),$.position.end=rs(D.end)}function F(D){let $=this.stack[this.stack.length-1];if(this.data.atHardBreak){let J=$.children[$.children.length-1];J.position.end=rs(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes($.type)&&(S.call(this,D),C.call(this,D))}function N(){this.data.atHardBreak=!0}function R(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function z(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function B(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function M(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function U(D){let $=this.sliceSerialize(D),J=this.stack[this.stack.length-2];J.label=B7($),J.identifier=mo($).toLowerCase()}function G(){let D=this.stack[this.stack.length-1],$=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){let ye=D.children;J.children=ye}else J.alt=$}function k(){let D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function Z(){let D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function te(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ce(D){let $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=mo(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function Se(D){this.data.characterReferenceType=D.type}function Ge(D){let $=this.sliceSerialize(D),J=this.data.characterReferenceType,ye;J?(ye=oy($,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=Vu($);let je=this.stack[this.stack.length-1];je.value+=ye}function et(D){let $=this.stack.pop();$.position.end=rs(D.end)}function Oe(D){C.call(this,D);let $=this.stack[this.stack.length-1];$.url=this.sliceSerialize(D)}function be(D){C.call(this,D);let $=this.stack[this.stack.length-1];$.url="mailto:"+this.sliceSerialize(D)}function st(){return{type:"blockquote",children:[]}}function wt(){return{type:"code",lang:null,meta:null,value:""}}function mt(){return{type:"inlineCode",value:""}}function zt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ot(){return{type:"emphasis",children:[]}}function ao(){return{type:"heading",depth:0,children:[]}}function dt(){return{type:"break"}}function fe(){return{type:"html",value:""}}function go(){return{type:"image",title:null,url:"",alt:null}}function ft(){return{type:"link",title:null,url:"",children:[]}}function Be(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function wr(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function fr(){return{type:"paragraph",children:[]}}function Vr(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function W(){return{type:"thematicBreak"}}}function rs(t){return{line:t.line,column:t.column,offset:t.offset}}function H7(t,e){let r=-1;for(;++r<e.length;){let o=e[r];Array.isArray(o)?H7(t,o):Qve(t,o)}}function Qve(t,e){let r;for(r in e)if(V7.call(e,r))switch(r){case"canContainEols":{let o=e[r];o&&t[r].push(...o);break}case"transforms":{let o=e[r];o&&t[r].push(...o);break}case"enter":case"exit":{let o=e[r];o&&Object.assign(t[r],o);break}}}function U7(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+$u({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+$u({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+$u({start:e.start,end:e.end})+") is still open")}function fk(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let o=0,n=r.indexOf(e);for(;n!==-1;)o++,n=r.indexOf(e,n+e.length);return o}function pk(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var ju=function(t){if(t==null)return tIe;if(typeof t=="function")return my(t);if(typeof t=="object")return Array.isArray(t)?Zve(t):Jve(t);if(typeof t=="string")return eIe(t);throw new Error("Expected function, string, or object as test")};function Zve(t){let e=[],r=-1;for(;++r<t.length;)e[r]=ju(t[r]);return my(o);function o(...n){let a=-1;for(;++a<e.length;)if(e[a].apply(this,n))return!0;return!1}}function Jve(t){let e=t;return my(r);function r(o){let n=o,a;for(a in t)if(n[a]!==e[a])return!1;return!0}}function eIe(t){return my(e);function e(r){return r&&r.type===t}}function my(t){return e;function e(r,o,n){return!!(rIe(r)&&t.call(this,r,typeof o=="number"?o:void 0,n||void 0))}}function tIe(){return!0}function rIe(t){return t!==null&&typeof t=="object"&&"type"in t}var $7=[],j7=!0,mk=!1,q7="skip";function hk(t,e,r,o){let n;typeof e=="function"&&typeof r!="function"?(o=r,r=e):n=e;let a=ju(n),i=o?-1:1;s(t,void 0,[])();function s(l,c,u){let d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){let m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=$7,h,g,_;if((!e||a(l,c,u[u.length-1]||void 0))&&(m=oIe(r(l,u)),m[0]===mk))return m;if("children"in l&&l.children){let x=l;if(x.children&&m[0]!==q7)for(g=(o?x.children.length:-1)+i,_=u.concat(x);g>-1&&g<x.children.length;){let b=x.children[g];if(h=s(b,g,_)(),h[0]===mk)return h;g=typeof h[1]=="number"?h[1]:g+i}}return m}}}function oIe(t){return Array.isArray(t)?t:typeof t=="number"?[j7,t]:t==null?$7:[t]}function gk(t,e,r){let n=ju((r||{}).ignore||[]),a=nIe(e),i=-1;for(;++i<a.length;)hk(t,"text",s);function s(c,u){let d=-1,p;for(;++d<u.length;){let m=u[d],h=p?p.children:void 0;if(n(m,h?h.indexOf(m):void 0,p))return;p=m}if(p)return l(c,u)}function l(c,u){let d=u[u.length-1],p=a[i][0],m=a[i][1],h=0,_=d.children.indexOf(c),x=!1,b=[];p.lastIndex=0;let y=p.exec(c.value);for(;y;){let I=y.index,w={index:y.index,input:y.input,stack:[...u,c]},v=m(...y,w);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?p.lastIndex=I+1:(h!==I&&b.push({type:"text",value:c.value.slice(h,I)}),Array.isArray(v)?b.push(...v):v&&b.push(v),h=I+y[0].length,x=!0),!p.global)break;y=p.exec(c.value)}return x?(h<c.value.length&&b.push({type:"text",value:c.value.slice(h)}),d.children.splice(_,1,...b)):b=[c],_+b.length}}function nIe(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],o=-1;for(;++o<r.length;){let n=r[o];e.push([aIe(n[0]),iIe(n[1])])}return e}function aIe(t){return typeof t=="string"?new RegExp(pk(t),"g"):t}function iIe(t){return typeof t=="function"?t:function(){return t}}function xk(){return{transforms:[fIe],enter:{literalAutolink:sIe,literalAutolinkEmail:_k,literalAutolinkHttp:_k,literalAutolinkWww:_k},exit:{literalAutolink:dIe,literalAutolinkEmail:uIe,literalAutolinkHttp:lIe,literalAutolinkWww:cIe}}}function sIe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function _k(t){this.config.enter.autolinkProtocol.call(this,t)}function lIe(t){this.config.exit.autolinkProtocol.call(this,t)}function cIe(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function uIe(t){this.config.exit.autolinkEmail.call(this,t)}function dIe(t){this.exit(t)}function fIe(t){gk(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,pIe],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,mIe]],{ignore:["link","linkReference"]})}function pIe(t,e,r,o,n){let a="";if(!G7(n)||(/^w/i.test(e)&&(r=e+r,e="",a="http://"),!hIe(r)))return!1;let i=gIe(r+o);if(!i[0])return!1;let s={type:"link",title:null,url:a+e+i[0],children:[{type:"text",value:e+i[0]}]};return i[1]?[s,{type:"text",value:i[1]}]:s}function mIe(t,e,r,o){return!G7(o,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function hIe(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function gIe(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],o=r.indexOf(")"),n=fk(t,"("),a=fk(t,")");for(;o!==-1&&n>a;)t+=r.slice(0,o+1),r=r.slice(o+1),o=r.indexOf(")"),a++;return[t,r]}function G7(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||Ta(r)||Al(r))&&(!e||r!==47)}CIe.peek=kIe;function bk(){return{enter:{gfmFootnoteDefinition:xIe,gfmFootnoteDefinitionLabelString:bIe,gfmFootnoteCall:IIe,gfmFootnoteCallString:wIe},exit:{gfmFootnoteDefinition:vIe,gfmFootnoteDefinitionLabelString:yIe,gfmFootnoteCall:SIe,gfmFootnoteCallString:EIe}}}function xIe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function bIe(){this.buffer()}function yIe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=mo(this.sliceSerialize(t)).toLowerCase()}function vIe(t){this.exit(t)}function IIe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function wIe(){this.buffer()}function EIe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=mo(this.sliceSerialize(t)).toLowerCase()}function SIe(t){this.exit(t)}function CIe(t,e,r,o){let n=r.createTracker(o),a=n.move("[^"),i=r.enter("footnoteReference"),s=r.enter("reference");return a+=n.move(r.safe(r.associationId(t),{...n.current(),before:a,after:"]"})),s(),i(),a+=n.move("]"),a}function kIe(){return"["}AIe.peek=DIe;function yk(){return{canContainEols:["delete"],enter:{strikethrough:PIe},exit:{strikethrough:OIe}}}function PIe(t){this.enter({type:"delete",children:[]},t)}function OIe(t){this.exit(t)}function AIe(t,e,r,o){let n=r.createTracker(o),a=r.enter("strikethrough"),i=n.move("~~");return i+=r.containerPhrasing(t,{...n.current(),before:i,after:"~"}),i+=n.move("~~"),a(),i}function DIe(){return"~"}function Ik(){return{enter:{table:NIe,tableData:W7,tableHeader:W7,tableRow:LIe},exit:{codeText:BIe,table:MIe,tableData:vk,tableHeader:vk,tableRow:vk}}}function NIe(t){let e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function MIe(t){this.exit(t),this.data.inTable=void 0}function LIe(t){this.enter({type:"tableRow",children:[]},t)}function vk(t){this.exit(t)}function W7(t){this.enter({type:"tableCell",children:[]},t)}function BIe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,FIe));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function FIe(t,e){return e==="|"?e:t}function wk(){return{exit:{taskListCheckValueChecked:K7,taskListCheckValueUnchecked:K7,paragraph:UIe}}}function K7(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function UIe(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let o=r.children[0];if(o&&o.type==="text"){let n=e.children,a=-1,i;for(;++a<n.length;){let s=n[a];if(s.type==="paragraph"){i=s;break}}i===r&&(o.value=o.value.slice(1),o.value.length===0?r.children.shift():r.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,r.position.start=Object.assign({},o.position.start)))}}this.exit(t)}function Ek(){return[xk(),bk(),yk(),Ik(),wk()]}var HIe={tokenize:WIe,partial:!0},X7={tokenize:KIe,partial:!0},Y7={tokenize:XIe,partial:!0},Q7={tokenize:YIe,partial:!0},$Ie={tokenize:QIe,partial:!0},Z7={tokenize:qIe,previous:eH},J7={tokenize:GIe,previous:tH},ni={tokenize:jIe,previous:rH},Oa={};function Ck(){return{text:Oa}}var Ml=48;for(;Ml<123;)Oa[Ml]=ni,Ml++,Ml===58?Ml=65:Ml===91&&(Ml=97);Oa[43]=ni;Oa[45]=ni;Oa[46]=ni;Oa[95]=ni;Oa[72]=[ni,J7];Oa[104]=[ni,J7];Oa[87]=[ni,Z7];Oa[119]=[ni,Z7];function jIe(t,e,r){let o=this,n,a;return i;function i(d){return!Sk(d)||!rH.call(o,o.previous)||kk(o.events)?r(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),s(d))}function s(d){return Sk(d)?(t.consume(d),s):d===64?(t.consume(d),l):r(d)}function l(d){return d===46?t.check($Ie,u,c)(d):d===45||d===95||Or(d)?(a=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),n=!0,l}function u(d){return a&&n&&Pr(o.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):r(d)}}function qIe(t,e,r){let o=this;return n;function n(i){return i!==87&&i!==119||!eH.call(o,o.previous)||kk(o.events)?r(i):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(HIe,t.attempt(X7,t.attempt(Y7,a),r),r)(i))}function a(i){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(i)}}function GIe(t,e,r){let o=this,n="",a=!1;return i;function i(d){return(d===72||d===104)&&tH.call(o,o.previous)&&!kk(o.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),n+=String.fromCodePoint(d),t.consume(d),s):r(d)}function s(d){if(Pr(d)&&n.length<5)return n+=String.fromCodePoint(d),t.consume(d),s;if(d===58){let p=n.toLowerCase();if(p==="http"||p==="https")return t.consume(d),l}return r(d)}function l(d){return d===47?(t.consume(d),a?c:(a=!0,l)):r(d)}function c(d){return d===null||Ol(d)||Xe(d)||Ta(d)||Al(d)?r(d):t.attempt(X7,t.attempt(Y7,u),r)(d)}function u(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function WIe(t,e,r){let o=0;return n;function n(i){return(i===87||i===119)&&o<3?(o++,t.consume(i),n):i===46&&o===3?(t.consume(i),a):r(i)}function a(i){return i===null?r(i):e(i)}}function KIe(t,e,r){let o,n,a;return i;function i(c){return c===46||c===95?t.check(Q7,l,s)(c):c===null||Xe(c)||Ta(c)||c!==45&&Al(c)?l(c):(a=!0,t.consume(c),i)}function s(c){return c===95?o=!0:(n=o,o=void 0),t.consume(c),i}function l(c){return n||o||!a?r(c):e(c)}}function XIe(t,e){let r=0,o=0;return n;function n(i){return i===40?(r++,t.consume(i),n):i===41&&o<r?a(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?t.check(Q7,e,a)(i):i===null||Xe(i)||Ta(i)?e(i):(t.consume(i),n)}function a(i){return i===41&&o++,t.consume(i),n}}function YIe(t,e,r){return o;function o(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(t.consume(s),o):s===38?(t.consume(s),a):s===93?(t.consume(s),n):s===60||s===null||Xe(s)||Ta(s)?e(s):r(s)}function n(s){return s===null||s===40||s===91||Xe(s)||Ta(s)?e(s):o(s)}function a(s){return Pr(s)?i(s):r(s)}function i(s){return s===59?(t.consume(s),o):Pr(s)?(t.consume(s),i):r(s)}}function QIe(t,e,r){return o;function o(a){return t.consume(a),n}function n(a){return Or(a)?r(a):e(a)}}function eH(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Xe(t)}function tH(t){return!Pr(t)}function rH(t){return!(t===47||Sk(t))}function Sk(t){return t===43||t===45||t===46||t===95||Or(t)}function kk(t){let e=t.length,r=!1;for(;e--;){let o=t[e][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){r=!0;break}if(o._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var ZIe={tokenize:awe,partial:!0};function Tk(){return{document:{91:{tokenize:rwe,continuation:{tokenize:owe},exit:nwe}},text:{91:{tokenize:twe},93:{add:"after",tokenize:JIe,resolveTo:ewe}}}}function JIe(t,e,r){let o=this,n=o.events.length,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i;for(;n--;){let l=o.events[n][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!i||!i._balanced)return r(l);let c=mo(o.sliceSerialize({start:i.end,end:o.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?r(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function ewe(t,e){let r=t.length,o;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){o=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",a,e],["exit",a,e],["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...l),t}function twe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a=0,i;return s;function s(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?r(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(d){if(a>999||d===93&&!i||d===null||d===91||Xe(d))return r(d);if(d===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return n.includes(mo(o.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return Xe(d)||(i=!0),a++,t.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(t.consume(d),a++,c):c(d)}}function rwe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a,i=0,s;return l;function l(h){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(h){return h===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",u):r(h)}function u(h){if(i>999||h===93&&!s||h===null||h===91||Xe(h))return r(h);if(h===93){t.exit("chunkString");let g=t.exit("gfmFootnoteDefinitionLabelString");return a=mo(o.sliceSerialize(g)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return Xe(h)||(s=!0),i++,t.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(t.consume(h),i++,u):u(h)}function p(h){return h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),n.includes(a)||n.push(a),Ee(t,m,"gfmFootnoteDefinitionWhitespace")):r(h)}function m(h){return e(h)}}function owe(t,e,r){return t.check(Pa,e,t.attempt(ZIe,e,r))}function nwe(t){t.exit("gfmFootnoteDefinition")}function awe(t,e,r){let o=this;return Ee(t,n,"gfmFootnoteDefinitionIndent",5);function n(a){let i=o.events[o.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?e(a):r(a)}}function Pk(t){let r=(t||{}).singleTilde,o={tokenize:a,resolveAll:n};return r==null&&(r=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function n(i,s){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let c=l;for(;c--;)if(i[c][0]==="exit"&&i[c][1].type==="strikethroughSequenceTemporary"&&i[c][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[c][1].end.offset-i[c][1].start.offset){i[l][1].type="strikethroughSequence",i[c][1].type="strikethroughSequence";let u={type:"strikethrough",start:Object.assign({},i[c][1].start),end:Object.assign({},i[l][1].end)},d={type:"strikethroughText",start:Object.assign({},i[c][1].end),end:Object.assign({},i[l][1].start)},p=[["enter",u,s],["enter",i[c][1],s],["exit",i[c][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&Ir(p,p.length,0,ts(m,i.slice(c+1,l),s)),Ir(p,p.length,0,[["exit",d,s],["enter",i[l][1],s],["exit",i[l][1],s],["exit",u,s]]),Ir(i,c-1,l-c+3,p),l=c+p.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function a(i,s,l){let c=this.previous,u=this.events,d=0;return p;function p(h){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(h):(i.enter("strikethroughSequenceTemporary"),m(h))}function m(h){let g=Hu(c);if(h===126)return d>1?l(h):(i.consume(h),d++,m);if(d<2&&!r)return l(h);let _=i.exit("strikethroughSequenceTemporary"),x=Hu(h);return _._open=!x||x===2&&!!g,_._close=!g||g===2&&!!x,s(h)}}}var hy=class{constructor(){this.map=[]}add(e,r,o){iwe(this,e,r,o)}consume(e){if(this.map.sort(function(a,i){return a[0]-i[0]}),this.map.length===0)return;let r=this.map.length,o=[];for(;r>0;)r-=1,o.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];o.push([...e]),e.length=0;let n=o.pop();for(;n;)e.push(...n),n=o.pop();this.map.length=0}};function iwe(t,e,r,o){let n=0;if(!(r===0&&o.length===0)){for(;n<t.map.length;){if(t.map[n][0]===e){t.map[n][1]+=r,t.map[n][2].push(...o);return}n+=1}t.map.push([e,r,o])}}function oH(t,e){let r=!1,o=[];for(;e<t.length;){let n=t[e];if(r){if(n[0]==="enter")n[1].type==="tableContent"&&o.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let a=o.length-1;o[a]=o[a]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return o}function Ok(){return{flow:{null:{tokenize:swe,resolveAll:lwe}}}}function swe(t,e,r){let o=this,n=0,a=0,i;return s;function s(C){let F=o.events.length-1;for(;F>-1;){let z=o.events[F][1].type;if(z==="lineEnding"||z==="linePrefix")F--;else break}let N=F>-1?o.events[F][1].type:null,R=N==="tableHead"||N==="tableRow"?v:l;return R===v&&o.parser.lazy[o.now().line]?r(C):R(C)}function l(C){return t.enter("tableHead"),t.enter("tableRow"),c(C)}function c(C){return C===124||(i=!0,a+=1),u(C)}function u(C){return C===null?r(C):ie(C)?a>1?(a=0,o.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),m):r(C):Pe(C)?Ee(t,u,"whitespace")(C):(a+=1,i&&(i=!1,n+=1),C===124?(t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),i=!0,u):(t.enter("data"),d(C)))}function d(C){return C===null||C===124||Xe(C)?(t.exit("data"),u(C)):(t.consume(C),C===92?p:d)}function p(C){return C===92||C===124?(t.consume(C),d):d(C)}function m(C){return o.interrupt=!1,o.parser.lazy[o.now().line]?r(C):(t.enter("tableDelimiterRow"),i=!1,Pe(C)?Ee(t,h,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):h(C))}function h(C){return C===45||C===58?_(C):C===124?(i=!0,t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),g):w(C)}function g(C){return Pe(C)?Ee(t,_,"whitespace")(C):_(C)}function _(C){return C===58?(a+=1,i=!0,t.enter("tableDelimiterMarker"),t.consume(C),t.exit("tableDelimiterMarker"),x):C===45?(a+=1,x(C)):C===null||ie(C)?I(C):w(C)}function x(C){return C===45?(t.enter("tableDelimiterFiller"),b(C)):w(C)}function b(C){return C===45?(t.consume(C),b):C===58?(i=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(C),t.exit("tableDelimiterMarker"),y):(t.exit("tableDelimiterFiller"),y(C))}function y(C){return Pe(C)?Ee(t,I,"whitespace")(C):I(C)}function I(C){return C===124?h(C):C===null||ie(C)?!i||n!==a?w(C):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(C)):w(C)}function w(C){return r(C)}function v(C){return t.enter("tableRow"),T(C)}function T(C){return C===124?(t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),T):C===null||ie(C)?(t.exit("tableRow"),e(C)):Pe(C)?Ee(t,T,"whitespace")(C):(t.enter("data"),O(C))}function O(C){return C===null||C===124||Xe(C)?(t.exit("data"),T(C)):(t.consume(C),C===92?S:O)}function S(C){return C===92||C===124?(t.consume(C),O):O(C)}}function lwe(t,e){let r=-1,o=!0,n=0,a=[0,0,0,0],i=[0,0,0,0],s=!1,l=0,c,u,d,p=new hy;for(;++r<t.length;){let m=t[r],h=m[1];m[0]==="enter"?h.type==="tableHead"?(s=!1,l!==0&&(nH(p,e,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(r,0,[["enter",c,e]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(o=!0,d=void 0,a=[0,0,0,0],i=[0,r+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(r,0,[["enter",u,e]])),n=h.type==="tableDelimiterRow"?2:u?3:1):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(o=!1,i[2]===0&&(a[1]!==0&&(i[0]=i[1],d=gy(p,e,a,n,void 0,d),a=[0,0,0,0]),i[2]=r)):h.type==="tableCellDivider"&&(o?o=!1:(a[1]!==0&&(i[0]=i[1],d=gy(p,e,a,n,void 0,d)),a=i,i=[a[1],r,0,0])):h.type==="tableHead"?(s=!0,l=r):h.type==="tableRow"||h.type==="tableDelimiterRow"?(l=r,a[1]!==0?(i[0]=i[1],d=gy(p,e,a,n,r,d)):i[1]!==0&&(d=gy(p,e,i,n,r,d)),n=0):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(i[3]=r)}for(l!==0&&nH(p,e,l,c,u),p.consume(e.events),r=-1;++r<e.events.length;){let m=e.events[r];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=oH(e.events,r))}return t}function gy(t,e,r,o,n,a){let i=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",s="tableContent";r[0]!==0&&(a.end=Object.assign({},qu(e.events,r[0])),t.add(r[0],0,[["exit",a,e]]));let l=qu(e.events,r[1]);if(a={type:i,start:Object.assign({},l),end:Object.assign({},l)},t.add(r[1],0,[["enter",a,e]]),r[2]!==0){let c=qu(e.events,r[2]),u=qu(e.events,r[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(t.add(r[2],0,[["enter",d,e]]),o!==2){let p=e.events[r[2]],m=e.events[r[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let h=r[2]+1,g=r[3]-r[2]-1;t.add(h,g,[])}}t.add(r[3]+1,0,[["exit",d,e]])}return n!==void 0&&(a.end=Object.assign({},qu(e.events,n)),t.add(n,0,[["exit",a,e]]),a=void 0),a}function nH(t,e,r,o,n){let a=[],i=qu(e.events,r);n&&(n.end=Object.assign({},i),a.push(["exit",n,e])),o.end=Object.assign({},i),a.push(["exit",o,e]),t.add(r+1,0,a)}function qu(t,e){let r=t[e],o=r[0]==="enter"?"start":"end";return r[1][o]}var cwe={tokenize:uwe};function Ak(){return{text:{91:cwe}}}function uwe(t,e,r){let o=this;return n;function n(l){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?r(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),a)}function a(l){return Xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),i):r(l)}function i(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),s):r(l)}function s(l){return ie(l)?e(l):Pe(l)?t.check({tokenize:dwe},e,r)(l):r(l)}}function dwe(t,e,r){return Ee(t,o,"whitespace");function o(n){return n===null?r(n):e(n)}}function aH(t){return ry([Ck(),Tk(),Pk(t),Ok(),Ak()])}var iH={name:"@blinkk/root-cms",version:"1.4.5",author:"s@blinkk.com",license:"MIT",engines:{node:">=16.0.0"},repository:{type:"git",url:"git+https://github.com/blinkk/rootjs.git",directory:"packages/root-cms"},files:["dist/**/*"],bin:{"root-cms":"./bin/root-cms.js"},type:"module",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./client":{types:"./dist/client.d.ts",import:"./dist/client.js"},"./core":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./functions":{types:"./dist/functions.d.ts",import:"./dist/functions.js"},"./plugin":{types:"./dist/plugin.d.ts",import:"./dist/plugin.js"},"./project":{types:"./dist/project.d.ts",import:"./dist/project.js"},"./richtext":{types:"./dist/richtext.d.ts",import:"./dist/richtext.js"}},scripts:{build:'rm -rf dist && concurrently -n "core,signin,ui" npm:build:core npm:build:signin npm:build:ui',"build:core":"tsup-node --config=./core/tsup.config.ts","//":"NOTE: esbuild is used here because tsup doesn't currently support aliases.","build:ui":"esbuild ui/ui.tsx --bundle --minify --alias:react=@preact/compat --alias:react-dom=@preact/compat --tsconfig=ui/tsconfig.json --outdir=dist/ui","build:signin":"esbuild signin/signin.tsx --bundle --minify --tsconfig=signin/tsconfig.json --outdir=dist/ui",dev:'rm -rf dist && concurrently -k -n "core,ui" npm:dev:core npm:dev:signin npm:dev:ui',"dev:core":"pnpm build:core --watch","dev:signin":"pnpm build:signin --watch","dev:ui":"pnpm build:ui --watch",test:"pnpm build && firebase emulators:exec 'vitest run'","test:watch":"pnpm build && firebase emulators:exec 'vitest'"},dependencies:{"@genkit-ai/ai":"0.5.2","@genkit-ai/core":"0.5.2","@genkit-ai/vertexai":"0.5.2","body-parser":"1.20.2",commander:"11.0.0","csv-parse":"5.5.2","csv-stringify":"6.4.4","dts-dom":"3.7.0","fnv-plus":"1.3.1",jsonwebtoken:"9.0.2",kleur:"4.1.5",sirv:"2.0.3","tiny-glob":"0.2.9"},"//":"NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",devDependencies:{"@babel/core":"7.17.9","@blinkk/root":"workspace:*","@editorjs/editorjs":"2.30.8","@editorjs/header":"2.8.8","@editorjs/image":"2.10.2","@editorjs/list":"2.0.6","@editorjs/nested-list":"1.4.3","@editorjs/raw":"2.5.1","@editorjs/table":"2.4.4","@editorjs/underline":"1.2.1","@emotion/react":"11.10.5","@firebase/app-compat":"0.2.19","@firebase/app-types":"0.9.0","@firebase/rules-unit-testing":"3.0.1","@mantine/core":"4.2.12","@mantine/hooks":"4.2.12","@mantine/modals":"4.2.12","@mantine/notifications":"4.2.12","@mantine/spotlight":"4.2.12","@preact/compat":"17.1.2","@tabler/icons-preact":"2.47.0","@types/body-parser":"1.19.3","@types/fnv-plus":"1.3.2","@types/gapi":"0.0.47","@types/gapi.client.drive-v3":"0.0.4","@types/gapi.client.sheets-v4":"0.0.4","@types/google.accounts":"0.0.14","@types/jsonwebtoken":"9.0.1","@types/node":"18.11.8",concurrently:"7.6.0",esbuild:"0.19.9",firebase:"10.5.2","firebase-admin":"11.11.1","firebase-functions":"4.8.0","firebase-tools":"12.9.1","highlight.js":"11.6.0","json-diff-kit":"1.0.29",marked:"9.1.1","mdast-util-from-markdown":"2.0.1","mdast-util-gfm":"3.0.0","micromark-extension-gfm":"3.0.0",preact:"10.19.3","preact-render-to-string":"6.3.1","preact-router":"4.1.2",react:"npm:@preact/compat@^17.1.2","react-dom":"npm:@preact/compat@^17.1.2","react-json-view-compare":"2.0.2",tsup:"8.0.1",typescript:"5.2.2",vite:"5.0.8",vitest:"0.34.6"},peerDependencies:{"@blinkk/root":"1.4.5","firebase-admin":">=11","firebase-functions":">=4",preact:">=10","preact-render-to-string":">=5"},peerDependenciesMeta:{"firebase-functions":{optional:!0}}};function sH(){return f("svg",{width:"100",height:"23",viewBox:"0 0 100 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("g",{"clip-path":"url(#clip0_1_318)",children:[f("path",{d:"M7.82998 5.01802C3.12925 5.6479 0.833937 18.1194 2.62578 19.6731C5.64773 22.2934 16.6441 14.1722 15.6786 9.46913C15.3009 6.61371 11.2717 4.28377 7.82998 5.01802Z",fill:"black"}),f("path",{d:"M13.9782 0.720147C12.6553 0.896474 12.0093 4.38767 12.5136 4.8226C13.364 5.55611 16.4587 3.28271 16.187 1.96616C16.0807 1.16683 14.9468 0.514607 13.9782 0.720147Z",fill:"black"}),f("path",{d:"M92.7383 17.6275C90.9681 17.6275 89.3816 17.0263 88.3796 16.0744C87.9955 15.7237 87.8953 15.3396 88.246 14.9555L88.8305 14.2541C89.1645 13.87 89.5486 13.7865 89.9327 14.1205C90.6007 14.6883 91.7029 15.1726 92.5713 15.1726C93.5232 15.1726 94.1244 14.8219 94.1244 14.2875C94.1244 13.5193 93.2059 13.4358 91.9868 13.0684C90.417 12.6008 88.5132 11.7324 88.5132 9.64493C88.5132 7.70773 90.25 6.37173 92.7383 6.37173C94.2413 6.37173 95.5272 6.87273 96.4123 7.57413C96.8131 7.90813 96.9467 8.27553 96.596 8.67633L96.0282 9.37773C95.7109 9.76183 95.3435 9.82863 94.926 9.51133C94.3916 9.09383 93.6568 8.69303 92.7884 8.69303C92.0202 8.69303 91.5192 9.01033 91.5192 9.51133C91.5192 10.1292 92.3041 10.4131 93.1224 10.6636C94.9761 11.2314 97.1304 11.8326 97.1304 14.2708C97.1304 16.4585 95.1264 17.6275 92.7383 17.6275Z",fill:"black"}),f("path",{d:"M87.0008 16.6756C87.0843 17.1766 86.8171 17.4271 86.2994 17.4271H85.097C84.596 17.4271 84.3789 17.1766 84.3121 16.6756L83.7443 11.9161L81.757 16.7424C81.5399 17.2434 81.1892 17.5106 80.6882 17.5106H80.5212C80.0202 17.5106 79.6695 17.2434 79.4524 16.7424L77.4651 11.8994L76.8973 16.6756C76.8472 17.1766 76.6301 17.4271 76.1291 17.4271H74.7263C74.2086 17.4271 73.9414 17.1766 74.0082 16.6756L75.4945 7.24013C75.5613 6.75583 75.8786 6.48863 76.3796 6.48863H76.5466C77.0476 6.48863 77.3315 6.75583 77.5486 7.24013L80.6047 13.8032L83.4938 7.24013C83.7109 6.75583 84.0115 6.48863 84.4958 6.48863H84.6795C85.1638 6.48863 85.4811 6.75583 85.5646 7.24013L87.0008 16.6756Z",fill:"black"}),f("path",{d:"M68.6496 17.6275C65.3096 17.6275 62.7211 15.2227 62.7211 11.9996C62.7211 8.77653 65.3096 6.37173 68.683 6.37173C70.3029 6.37173 71.7558 6.97293 72.7745 7.99163C73.1419 8.34233 73.1419 8.77653 72.7745 9.09383L71.9228 9.81193C71.5554 10.1292 71.2047 10.1125 70.8206 9.79523C70.2361 9.31093 69.5013 9.01033 68.683 9.01033C67.013 9.01033 65.7104 10.2628 65.7104 11.9996C65.7104 13.7364 67.013 14.9889 68.683 14.9889C69.5013 14.9889 70.2528 14.6883 70.8206 14.204C71.2047 13.8867 71.5554 13.87 71.9228 14.1873L72.7745 14.9054C73.1419 15.2227 73.1419 15.6569 72.7745 16.0076C71.7558 17.0263 70.3029 17.6275 68.6496 17.6275Z",fill:"black"}),f("path",{d:"M58.575 16.2915C58.7587 16.6923 58.4581 16.8927 58.241 17.0597C57.7233 17.4271 56.9384 17.6442 56.1201 17.6442C54.4501 17.6442 52.8469 16.6923 52.8469 14.4044V11.0978H52.1121C51.6111 11.0978 51.3439 10.8139 51.3439 10.3296V9.76183C51.3439 9.26083 51.6111 8.99363 52.1121 8.99363H52.8469V7.05643C52.8469 6.57213 53.1308 6.38843 53.6151 6.28823L54.9511 6.05443C55.4521 5.95423 55.7193 6.30493 55.7193 6.80593V8.99363H57.3726C57.8569 8.99363 58.1408 9.26083 58.1408 9.76183V10.3296C58.1408 10.8139 57.8569 11.0978 57.3726 11.0978H55.7193V14.1038C55.7193 14.9221 56.1368 15.1893 56.6545 15.1893C56.905 15.1893 57.1555 15.0724 57.3392 14.9555C57.7567 14.6883 57.9571 14.8887 58.1074 15.206L58.575 16.2915Z",fill:"black"}),f("path",{d:"M46.2592 17.6442C43.5538 17.6442 41.5999 15.7738 41.5999 13.2521C41.5999 10.7304 43.5538 8.86003 46.2592 8.86003C48.9646 8.86003 50.9185 10.7304 50.9185 13.2521C50.9185 15.7738 48.9646 17.6442 46.2592 17.6442ZM46.2592 15.1726C47.3113 15.1726 48.0628 14.3543 48.0628 13.2521C48.0628 12.1499 47.3113 11.3316 46.2592 11.3316C45.2071 11.3316 44.4389 12.1499 44.4389 13.2521C44.4389 14.3543 45.2071 15.1726 46.2592 15.1726Z",fill:"black"}),f("path",{d:"M36.052 17.6442C33.3466 17.6442 31.3927 15.7738 31.3927 13.2521C31.3927 10.7304 33.3466 8.86003 36.052 8.86003C38.7574 8.86003 40.7113 10.7304 40.7113 13.2521C40.7113 15.7738 38.7574 17.6442 36.052 17.6442ZM36.052 15.1726C37.1041 15.1726 37.8556 14.3543 37.8556 13.2521C37.8556 12.1499 37.1041 11.3316 36.052 11.3316C34.9999 11.3316 34.2317 12.1499 34.2317 13.2521C34.2317 14.3543 34.9999 15.1726 36.052 15.1726Z",fill:"black"}),f("path",{d:"M28.7099 13.0851L30.6805 16.6422C30.9644 17.1599 30.6638 17.4271 30.1628 17.4271H28.4594C27.9417 17.4271 27.8081 17.1766 27.5242 16.6589L25.7707 13.4859H24.6351V16.6422C24.6351 17.1432 24.3512 17.4271 23.8502 17.4271H22.4808C21.9798 17.4271 21.6959 17.1432 21.6959 16.6422V7.35703C21.6959 6.85603 21.9798 6.57213 22.4808 6.57213H26.5222C29.3111 6.57213 30.8141 7.92483 30.8141 10.1125C30.8141 11.5654 29.9791 12.5841 28.7099 13.0851ZM24.6351 8.96023V11.5153H26.4721C27.2236 11.5153 27.8248 11.0644 27.8248 10.2628C27.8248 9.44453 27.2236 8.96023 26.4721 8.96023H24.6351Z",fill:"black"})]}),f("defs",{children:f("clipPath",{id:"clip0_1_318",children:f("rect",{width:"99",height:"22",fill:"white",transform:"translate(0.0175781 0.177246)"})})})]})}var ai="1.5";function me(t){return f("div",{className:"Layout",children:[f(me.Top,{}),f(me.Side,{}),f(me.Main,{...t,children:t.children}),f(me.Bottom,{})]})}me.Top=()=>{let t=window.__ROOT_CTX.rootConfig.projectName||window.__ROOT_CTX.rootConfig.projectId;return f("div",{className:"Layout__top",children:[f("a",{className:"Layout__top__logo",href:"/cms",children:f(sH,{})}),f("div",{className:"Layout__top__version",children:["v",iH.version]}),f("div",{className:"Layout__top__project",children:t})]})};me.Side=()=>{let[t]=az(),e=t.url.replace(/\/*$/g,""),r=window.firebase.user,o=window.__ROOT_CTX.sidebar?.tools,n=window.__ROOT_CTX.experiments||{};return f("div",{className:"Layout__side",children:[f("div",{className:"Layout__side__buttons",children:[f(me.SideButton,{label:"Home",url:"/cms",active:e==="/cms",children:f(YS,{stroke:ai})}),f(me.SideButton,{label:"Content",url:"/cms/content",active:e.startsWith("/cms/content"),children:f(yl,{stroke:ai})}),f(me.SideButton,{label:"Releases",url:"/cms/releases",active:e.startsWith("/cms/releases"),children:f(Tu,{stroke:ai})}),f(me.SideButton,{label:"Data",url:"/cms/data",active:e.startsWith("/cms/data"),children:f(GS,{stroke:ai})}),f(me.SideButton,{label:"Assets",url:"/cms/assets",active:e.startsWith("/cms/assets"),children:f(eC,{stroke:ai})}),f(me.SideButton,{label:"Translations",url:"/cms/translations",active:e.startsWith("/cms/translations"),children:f(Wi,{stroke:ai})}),n.ai&&f(me.SideButton,{label:"Root AI (experimental)",url:"/cms/ai",active:e.startsWith("/cms/ai"),children:f(Il,{stroke:ai})}),o&&f(Ae,{children:[f("div",{className:"Layout__side__divider"}),Object.entries(o).map(([a,i])=>f(me.SideButton,{className:"Layout__side__tool",label:i.label||"",url:`/cms/tools/${a}`,active:e.startsWith(`/cms/tools/${a}`),children:i.icon?f("img",{className:"Layout__side__tool__icon",src:i.icon,alt:i.label||""}):f(US,{stroke:ai})})),f("div",{className:"Layout__side__divider"})]}),f(me.SideButton,{label:"Settings",url:"/cms/settings",active:e.startsWith("/cms/settings"),children:f(wl,{stroke:ai})})]}),f("div",{className:"Layout__side__user",children:f(xe,{label:r.email,position:"right",withArrow:!0,children:f(kn,{src:r.photoURL,alt:r.email,size:30,radius:"xl"})})})]})};me.SideButton=t=>f(xe,{className:ke("Layout__side__button",t.className),label:t.label,position:"right",withArrow:!0,children:f("a",{className:ke(t.active&&"active"),href:t.url,children:t.children})});me.Main=t=>f("div",{className:"Layout__main",children:t.children});me.Bottom=()=>f("div",{className:"Layout__bottom"});var lH=["bmp","gif","ico","jpeg","jpg","png","tiff","webp"],Dk=[...lH,"svg"],Rk=["mp4","webm"],cH="https://lh3.googleusercontent.com/";async function Aa(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=await _we(t),n=am(t.name),a=e?.preserveFilename?`${o}/${t.name}`:`${o}.${n}`,i=`${r}/uploads/${a}`,s=tz(window.firebase.storage,i);await J9(s,t),console.log(`uploaded ${i}`);let l={};l.filename=t.name,l.uploadedBy=window.firebase.user.email||"unknown",l.uploadedAt=String(Math.floor(new Date().getTime()));let c=`/${s.bucket}/${s.fullPath}`,u=`https://storage.googleapis.com${c}`;if(Dk.includes(n)){let p=await hwe(t);if(l.width=p.width,l.height=p.height,!e?.disableGci&&lH.includes(n)){let m=await mwe(c);m&&(l.gcsPath=c,u=m)}}else if(Rk.includes(n)){let p=await gwe(u);l.width=p.width,l.height=p.height,console.log("video dimensions:",p)}let d=e?.cacheControl||"public, max-age=3600";return await ez(s,{cacheControl:d,customMetadata:xwe(l)}),console.log("updated meta data: ",l),{...l,src:u}}function am(t){return pwe(t.split(".").at(-1)||"")}function pwe(t){let e=String(t).toLowerCase();return e==="jpeg"&&(e="jpg"),e}async function mwe(t){let e=window.__ROOT_CTX.rootConfig.gci;if(!e)return"";let r=new URLSearchParams({gcs:t}),o=`${e}/_/serving_url?${r.toString()}`,n=await window.fetch(o);if(n.status!==200){let i=await n.text();throw console.error(`failed to get gci url: ${o}`),console.error(i),new Error("failed to get gci url")}return(await n.json()).servingUrl}async function hwe(t){return new Promise((e,r)=>{let o=new FileReader;o.onload=()=>{let n=new Image;n.onload=()=>{e({width:n.width,height:n.height})},n.onerror=r,n.src=String(o.result)},o.onerror=r,o.readAsDataURL(t)})}async function gwe(t){return new Promise((e,r)=>{let o=document.createElement("video");o.addEventListener("loadedmetadata",()=>{let n={width:o.videoWidth,height:o.videoHeight};e(n),document.body.removeChild(o)},!1),o.addEventListener("error",()=>{r(new Error("Failed to load video metadata")),document.body.removeChild(o)},!1),o.className="sr-only",o.src=t,o.preload="metadata",document.body.appendChild(o)})}async function _we(t){let e=await t.arrayBuffer(),r=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(r)).map(a=>a.toString(16).padStart(2,"0")).join("")}function xwe(t){let e={};return Object.entries(t).forEach(([r,o])=>{t[r]=String(o).trim()}),e}function ra(t){t||(t=6);let e=[],r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=r.length;for(let n=0;n<t;n++)e.push(r.charAt(Math.floor(Math.random()*o)));return e.join("")}function uH(t,e){return Math.random()*(e-t)+t}var bwe=!1,ywe=`Lorem ipsum \u{1F955} dolor sit amet.
|
|
53
|
+
`;break}case-2:{i=e?" ":" ";break}case-1:{if(!e&&n)continue;i=" ";break}default:i=String.fromCharCode(a)}n=a===-2,o.push(i)}return o.join("")}var ik={};Qj(ik,{attentionMarkers:()=>Gve,contentInitial:()=>Uve,disable:()=>Wve,document:()=>zve,flow:()=>Hve,flowInitial:()=>Vve,insideSpan:()=>qve,string:()=>$ve,text:()=>jve});var zve={42:ho,43:ho,45:ho,48:ho,49:ho,50:ho,51:ho,52:ho,53:ho,54:ho,55:ho,56:ho,57:ho,62:ny},Uve={91:ZC},Vve={[-2]:rm,[-1]:rm,32:rm},Hve={35:ek,42:Nl,45:[py,Nl],60:rk,61:py,95:Nl,96:sy,126:sy},$ve={38:iy,92:ay},jve={[-5]:nm,[-4]:nm,[-3]:nm,33:nk,38:iy,42:tm,60:[XC,ok],91:ak,92:[JC,ay],93:Rl,95:tm,96:YC},qve={null:[tm,OV]},Gve={null:[42,95]},Wve={null:[]};function sk(t){let r=ry([ik,...(t||{}).extensions||[]]),o={defined:[],lazy:{},constructs:r,content:n(wV),document:n(SV),flow:n(PV),string:n(AV),text:n(DV)};return o;function n(a){return i;function i(s){return MV(o,a,s)}}}function lk(t){for(;!cy(t););return t}var LV=/[\0\t\n\r]/g;function ck(){let t=1,e="",r=!0,o;return n;function n(a,i,s){let l=[],c,u,d,p,m;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(i||void 0).decode(a)),d=0,e="",r&&(a.charCodeAt(0)===65279&&d++,r=void 0);d<a.length;){if(LV.lastIndex=d,c=LV.exec(a),p=c&&c.index!==void 0?c.index:a.length,m=a.charCodeAt(p),!c){e=a.slice(d);break}if(m===10&&d===p&&o)l.push(-3),o=void 0;else switch(o&&(l.push(-5),o=void 0),d<p&&(l.push(a.slice(d,p)),t+=p-d),m){case 0:{l.push(65533),t++;break}case 9:{for(u=Math.ceil(t/4)*4,l.push(-2);t++<u;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:o=!0,t=1}d=p+1}return s&&(o&&l.push(-5),e&&l.push(e),l.push(null)),l}}var Kve=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BV(t){return t.replace(Kve,Xve)}function Xve(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let n=r.charCodeAt(1),a=n===120||n===88;return oy(r.slice(a?2:1),a?16:10)}return Vu(r)||t}function $u(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?FV(t.position):"start"in t||"end"in t?FV(t):"line"in t||"column"in t?uk(t):""}function uk(t){return zV(t&&t.line)+":"+zV(t&&t.column)}function FV(t){return uk(t&&t.start)+"-"+uk(t&&t.end)}function zV(t){return t&&typeof t=="number"?t:1}var VV={}.hasOwnProperty;function dk(t,e,r){return typeof e!="string"&&(r=e,e=void 0),Yve(r)(lk(sk(r).document().write(ck()(t,e,!0))))}function Yve(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ft),autolinkProtocol:S,autolinkEmail:S,atxHeading:a(ao),blockQuote:a(st),characterEscape:S,characterReference:S,codeFenced:a(wt),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(wt,i),codeText:a(mt,i),codeTextData:S,data:S,codeFlowValue:S,definition:a(zt),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(ot),hardBreakEscape:a(dt),hardBreakTrailing:a(dt),htmlFlow:a(fe,i),htmlFlowData:S,htmlText:a(fe,i),htmlTextData:S,image:a(go),label:i,link:a(ft),listItem:a(wr),listItemValue:p,listOrdered:a(Be,d),listUnordered:a(Be),paragraph:a(fr),reference:A,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(ao),strong:a(Vr),thematicBreak:a(W)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:be,autolinkProtocol:Oe,blockQuote:l(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:Ge,characterReference:et,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:C,codeIndented:l(x),codeText:l(B),codeTextData:C,data:C,definition:l(),definitionDestinationString:I,definitionLabelString:b,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(N),hardBreakTrailing:l(N),htmlFlow:l(R),htmlFlowData:C,htmlText:l(z),htmlTextData:C,image:l(V),label:G,labelText:U,lineEnding:F,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:k,resourceTitleString:Z,resource:te,setextHeading:l(O),setextHeadingLineSequence:T,setextHeadingText:v,strong:l(),thematicBreak:l()}};HV(e,(t||{}).mdastExtensions||[]);let r={};return o;function o(D){let $={type:"root",children:[]},J={stack:[$],tokenStack:[],config:e,enter:s,exit:c,buffer:i,resume:u,data:r},ye=[],je=-1;for(;++je<D.length;)if(D[je][1].type==="listOrdered"||D[je][1].type==="listUnordered")if(D[je][0]==="enter")ye.push(je);else{let nt=ye.pop();je=n(D,nt,je)}for(je=-1;++je<D.length;){let nt=e[D[je][0]];VV.call(nt,D[je][1].type)&&nt[D[je][1].type].call(Object.assign({sliceSerialize:D[je][2].sliceSerialize},J),D[je][1])}if(J.tokenStack.length>0){let nt=J.tokenStack[J.tokenStack.length-1];(nt[1]||UV).call(J,void 0,nt[0])}for($.position={start:rs(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:rs(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},je=-1;++je<e.transforms.length;)$=e.transforms[je]($)||$;return $}function n(D,$,J){let ye=$-1,je=-1,nt=!1,Fo,nr,Kt,hn;for(;++ye<=J;){let Hr=D[ye];switch(Hr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Hr[0]==="enter"?je++:je--,hn=void 0;break}case"lineEndingBlank":{Hr[0]==="enter"&&(Fo&&!hn&&!je&&!Kt&&(Kt=ye),hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:hn=void 0}if(!je&&Hr[0]==="enter"&&Hr[1].type==="listItemPrefix"||je===-1&&Hr[0]==="exit"&&(Hr[1].type==="listUnordered"||Hr[1].type==="listOrdered")){if(Fo){let _o=ye;for(nr=void 0;_o--;){let xo=D[_o];if(xo[1].type==="lineEnding"||xo[1].type==="lineEndingBlank"){if(xo[0]==="exit")continue;nr&&(D[nr][1].type="lineEndingBlank",nt=!0),xo[1].type="lineEnding",nr=_o}else if(!(xo[1].type==="linePrefix"||xo[1].type==="blockQuotePrefix"||xo[1].type==="blockQuotePrefixWhitespace"||xo[1].type==="blockQuoteMarker"||xo[1].type==="listItemIndent"))break}Kt&&(!nr||Kt<nr)&&(Fo._spread=!0),Fo.end=Object.assign({},nr?D[nr][1].start:Hr[1].end),D.splice(nr||ye,0,["exit",Fo,Hr[2]]),ye++,J++}if(Hr[1].type==="listItemPrefix"){let _o={type:"listItem",_spread:!1,start:Object.assign({},Hr[1].start),end:void 0};Fo=_o,D.splice(ye,0,["enter",_o,Hr[2]]),ye++,J++,Kt=void 0,hn=!0}}}return D[$][1]._spread=nt,J}function a(D,$){return J;function J(ye){s.call(this,D(ye),ye),$&&$.call(this,ye)}}function i(){this.stack.push({type:"fragment",children:[]})}function s(D,$,J){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([$,J]),D.position={start:rs($.start),end:void 0}}function l(D){return $;function $(J){D&&D.call(this,J),c.call(this,J)}}function c(D,$){let J=this.stack.pop(),ye=this.tokenStack.pop();if(ye)ye[0].type!==D.type&&($?$.call(this,D,ye[0]):(ye[1]||UV).call(this,D,ye[0]));else throw new Error("Cannot close `"+D.type+"` ("+$u({start:D.start,end:D.end})+"): it\u2019s not open");J.position.end=rs(D.end)}function u(){return KC(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){let $=this.stack[this.stack.length-2];$.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function m(){let D=this.resume(),$=this.stack[this.stack.length-1];$.lang=D}function h(){let D=this.resume(),$=this.stack[this.stack.length-1];$.meta=D}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D.replace(/(\r?\n|\r)$/g,"")}function b(D){let $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=mo(this.sliceSerialize(D)).toLowerCase()}function y(){let D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function I(){let D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function w(D){let $=this.stack[this.stack.length-1];if(!$.depth){let J=this.sliceSerialize(D).length;$.depth=J}}function v(){this.data.setextHeadingSlurpLineEnding=!0}function T(D){let $=this.stack[this.stack.length-1];$.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function S(D){let J=this.stack[this.stack.length-1].children,ye=J[J.length-1];(!ye||ye.type!=="text")&&(ye=_e(),ye.position={start:rs(D.start),end:void 0},J.push(ye)),this.stack.push(ye)}function C(D){let $=this.stack.pop();$.value+=this.sliceSerialize(D),$.position.end=rs(D.end)}function F(D){let $=this.stack[this.stack.length-1];if(this.data.atHardBreak){let J=$.children[$.children.length-1];J.position.end=rs(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes($.type)&&(S.call(this,D),C.call(this,D))}function N(){this.data.atHardBreak=!0}function R(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function z(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function B(){let D=this.resume(),$=this.stack[this.stack.length-1];$.value=D}function M(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let $=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=$,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function U(D){let $=this.sliceSerialize(D),J=this.stack[this.stack.length-2];J.label=BV($),J.identifier=mo($).toLowerCase()}function G(){let D=this.stack[this.stack.length-1],$=this.resume(),J=this.stack[this.stack.length-1];if(this.data.inReference=!0,J.type==="link"){let ye=D.children;J.children=ye}else J.alt=$}function k(){let D=this.resume(),$=this.stack[this.stack.length-1];$.url=D}function Z(){let D=this.resume(),$=this.stack[this.stack.length-1];$.title=D}function te(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function ce(D){let $=this.resume(),J=this.stack[this.stack.length-1];J.label=$,J.identifier=mo(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function Se(D){this.data.characterReferenceType=D.type}function Ge(D){let $=this.sliceSerialize(D),J=this.data.characterReferenceType,ye;J?(ye=oy($,J==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=Vu($);let je=this.stack[this.stack.length-1];je.value+=ye}function et(D){let $=this.stack.pop();$.position.end=rs(D.end)}function Oe(D){C.call(this,D);let $=this.stack[this.stack.length-1];$.url=this.sliceSerialize(D)}function be(D){C.call(this,D);let $=this.stack[this.stack.length-1];$.url="mailto:"+this.sliceSerialize(D)}function st(){return{type:"blockquote",children:[]}}function wt(){return{type:"code",lang:null,meta:null,value:""}}function mt(){return{type:"inlineCode",value:""}}function zt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ot(){return{type:"emphasis",children:[]}}function ao(){return{type:"heading",depth:0,children:[]}}function dt(){return{type:"break"}}function fe(){return{type:"html",value:""}}function go(){return{type:"image",title:null,url:"",alt:null}}function ft(){return{type:"link",title:null,url:"",children:[]}}function Be(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function wr(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function fr(){return{type:"paragraph",children:[]}}function Vr(){return{type:"strong",children:[]}}function _e(){return{type:"text",value:""}}function W(){return{type:"thematicBreak"}}}function rs(t){return{line:t.line,column:t.column,offset:t.offset}}function HV(t,e){let r=-1;for(;++r<e.length;){let o=e[r];Array.isArray(o)?HV(t,o):Qve(t,o)}}function Qve(t,e){let r;for(r in e)if(VV.call(e,r))switch(r){case"canContainEols":{let o=e[r];o&&t[r].push(...o);break}case"transforms":{let o=e[r];o&&t[r].push(...o);break}case"enter":case"exit":{let o=e[r];o&&Object.assign(t[r],o);break}}}function UV(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+$u({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+$u({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+$u({start:e.start,end:e.end})+") is still open")}function fk(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let o=0,n=r.indexOf(e);for(;n!==-1;)o++,n=r.indexOf(e,n+e.length);return o}function pk(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var ju=function(t){if(t==null)return tIe;if(typeof t=="function")return my(t);if(typeof t=="object")return Array.isArray(t)?Zve(t):Jve(t);if(typeof t=="string")return eIe(t);throw new Error("Expected function, string, or object as test")};function Zve(t){let e=[],r=-1;for(;++r<t.length;)e[r]=ju(t[r]);return my(o);function o(...n){let a=-1;for(;++a<e.length;)if(e[a].apply(this,n))return!0;return!1}}function Jve(t){let e=t;return my(r);function r(o){let n=o,a;for(a in t)if(n[a]!==e[a])return!1;return!0}}function eIe(t){return my(e);function e(r){return r&&r.type===t}}function my(t){return e;function e(r,o,n){return!!(rIe(r)&&t.call(this,r,typeof o=="number"?o:void 0,n||void 0))}}function tIe(){return!0}function rIe(t){return t!==null&&typeof t=="object"&&"type"in t}var $V=[],jV=!0,mk=!1,qV="skip";function hk(t,e,r,o){let n;typeof e=="function"&&typeof r!="function"?(o=r,r=e):n=e;let a=ju(n),i=o?-1:1;s(t,void 0,[])();function s(l,c,u){let d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){let m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=$V,h,g,_;if((!e||a(l,c,u[u.length-1]||void 0))&&(m=oIe(r(l,u)),m[0]===mk))return m;if("children"in l&&l.children){let x=l;if(x.children&&m[0]!==qV)for(g=(o?x.children.length:-1)+i,_=u.concat(x);g>-1&&g<x.children.length;){let b=x.children[g];if(h=s(b,g,_)(),h[0]===mk)return h;g=typeof h[1]=="number"?h[1]:g+i}}return m}}}function oIe(t){return Array.isArray(t)?t:typeof t=="number"?[jV,t]:t==null?$V:[t]}function gk(t,e,r){let n=ju((r||{}).ignore||[]),a=nIe(e),i=-1;for(;++i<a.length;)hk(t,"text",s);function s(c,u){let d=-1,p;for(;++d<u.length;){let m=u[d],h=p?p.children:void 0;if(n(m,h?h.indexOf(m):void 0,p))return;p=m}if(p)return l(c,u)}function l(c,u){let d=u[u.length-1],p=a[i][0],m=a[i][1],h=0,_=d.children.indexOf(c),x=!1,b=[];p.lastIndex=0;let y=p.exec(c.value);for(;y;){let I=y.index,w={index:y.index,input:y.input,stack:[...u,c]},v=m(...y,w);if(typeof v=="string"&&(v=v.length>0?{type:"text",value:v}:void 0),v===!1?p.lastIndex=I+1:(h!==I&&b.push({type:"text",value:c.value.slice(h,I)}),Array.isArray(v)?b.push(...v):v&&b.push(v),h=I+y[0].length,x=!0),!p.global)break;y=p.exec(c.value)}return x?(h<c.value.length&&b.push({type:"text",value:c.value.slice(h)}),d.children.splice(_,1,...b)):b=[c],_+b.length}}function nIe(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],o=-1;for(;++o<r.length;){let n=r[o];e.push([aIe(n[0]),iIe(n[1])])}return e}function aIe(t){return typeof t=="string"?new RegExp(pk(t),"g"):t}function iIe(t){return typeof t=="function"?t:function(){return t}}function xk(){return{transforms:[fIe],enter:{literalAutolink:sIe,literalAutolinkEmail:_k,literalAutolinkHttp:_k,literalAutolinkWww:_k},exit:{literalAutolink:dIe,literalAutolinkEmail:uIe,literalAutolinkHttp:lIe,literalAutolinkWww:cIe}}}function sIe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function _k(t){this.config.enter.autolinkProtocol.call(this,t)}function lIe(t){this.config.exit.autolinkProtocol.call(this,t)}function cIe(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function uIe(t){this.config.exit.autolinkEmail.call(this,t)}function dIe(t){this.exit(t)}function fIe(t){gk(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,pIe],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,mIe]],{ignore:["link","linkReference"]})}function pIe(t,e,r,o,n){let a="";if(!GV(n)||(/^w/i.test(e)&&(r=e+r,e="",a="http://"),!hIe(r)))return!1;let i=gIe(r+o);if(!i[0])return!1;let s={type:"link",title:null,url:a+e+i[0],children:[{type:"text",value:e+i[0]}]};return i[1]?[s,{type:"text",value:i[1]}]:s}function mIe(t,e,r,o){return!GV(o,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function hIe(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function gIe(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],o=r.indexOf(")"),n=fk(t,"("),a=fk(t,")");for(;o!==-1&&n>a;)t+=r.slice(0,o+1),r=r.slice(o+1),o=r.indexOf(")"),a++;return[t,r]}function GV(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||Ta(r)||Al(r))&&(!e||r!==47)}CIe.peek=kIe;function bk(){return{enter:{gfmFootnoteDefinition:xIe,gfmFootnoteDefinitionLabelString:bIe,gfmFootnoteCall:IIe,gfmFootnoteCallString:wIe},exit:{gfmFootnoteDefinition:vIe,gfmFootnoteDefinitionLabelString:yIe,gfmFootnoteCall:SIe,gfmFootnoteCallString:EIe}}}function xIe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function bIe(){this.buffer()}function yIe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=mo(this.sliceSerialize(t)).toLowerCase()}function vIe(t){this.exit(t)}function IIe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function wIe(){this.buffer()}function EIe(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=mo(this.sliceSerialize(t)).toLowerCase()}function SIe(t){this.exit(t)}function CIe(t,e,r,o){let n=r.createTracker(o),a=n.move("[^"),i=r.enter("footnoteReference"),s=r.enter("reference");return a+=n.move(r.safe(r.associationId(t),{...n.current(),before:a,after:"]"})),s(),i(),a+=n.move("]"),a}function kIe(){return"["}AIe.peek=DIe;function yk(){return{canContainEols:["delete"],enter:{strikethrough:PIe},exit:{strikethrough:OIe}}}function PIe(t){this.enter({type:"delete",children:[]},t)}function OIe(t){this.exit(t)}function AIe(t,e,r,o){let n=r.createTracker(o),a=r.enter("strikethrough"),i=n.move("~~");return i+=r.containerPhrasing(t,{...n.current(),before:i,after:"~"}),i+=n.move("~~"),a(),i}function DIe(){return"~"}function Ik(){return{enter:{table:NIe,tableData:WV,tableHeader:WV,tableRow:LIe},exit:{codeText:BIe,table:MIe,tableData:vk,tableHeader:vk,tableRow:vk}}}function NIe(t){let e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function MIe(t){this.exit(t),this.data.inTable=void 0}function LIe(t){this.enter({type:"tableRow",children:[]},t)}function vk(t){this.exit(t)}function WV(t){this.enter({type:"tableCell",children:[]},t)}function BIe(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,FIe));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function FIe(t,e){return e==="|"?e:t}function wk(){return{exit:{taskListCheckValueChecked:KV,taskListCheckValueUnchecked:KV,paragraph:UIe}}}function KV(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function UIe(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let o=r.children[0];if(o&&o.type==="text"){let n=e.children,a=-1,i;for(;++a<n.length;){let s=n[a];if(s.type==="paragraph"){i=s;break}}i===r&&(o.value=o.value.slice(1),o.value.length===0?r.children.shift():r.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,r.position.start=Object.assign({},o.position.start)))}}this.exit(t)}function Ek(){return[xk(),bk(),yk(),Ik(),wk()]}var HIe={tokenize:WIe,partial:!0},XV={tokenize:KIe,partial:!0},YV={tokenize:XIe,partial:!0},QV={tokenize:YIe,partial:!0},$Ie={tokenize:QIe,partial:!0},ZV={tokenize:qIe,previous:eH},JV={tokenize:GIe,previous:tH},ni={tokenize:jIe,previous:rH},Oa={};function Ck(){return{text:Oa}}var Ml=48;for(;Ml<123;)Oa[Ml]=ni,Ml++,Ml===58?Ml=65:Ml===91&&(Ml=97);Oa[43]=ni;Oa[45]=ni;Oa[46]=ni;Oa[95]=ni;Oa[72]=[ni,JV];Oa[104]=[ni,JV];Oa[87]=[ni,ZV];Oa[119]=[ni,ZV];function jIe(t,e,r){let o=this,n,a;return i;function i(d){return!Sk(d)||!rH.call(o,o.previous)||kk(o.events)?r(d):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),s(d))}function s(d){return Sk(d)?(t.consume(d),s):d===64?(t.consume(d),l):r(d)}function l(d){return d===46?t.check($Ie,u,c)(d):d===45||d===95||Or(d)?(a=!0,t.consume(d),l):u(d)}function c(d){return t.consume(d),n=!0,l}function u(d){return a&&n&&Pr(o.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(d)):r(d)}}function qIe(t,e,r){let o=this;return n;function n(i){return i!==87&&i!==119||!eH.call(o,o.previous)||kk(o.events)?r(i):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(HIe,t.attempt(XV,t.attempt(YV,a),r),r)(i))}function a(i){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(i)}}function GIe(t,e,r){let o=this,n="",a=!1;return i;function i(d){return(d===72||d===104)&&tH.call(o,o.previous)&&!kk(o.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),n+=String.fromCodePoint(d),t.consume(d),s):r(d)}function s(d){if(Pr(d)&&n.length<5)return n+=String.fromCodePoint(d),t.consume(d),s;if(d===58){let p=n.toLowerCase();if(p==="http"||p==="https")return t.consume(d),l}return r(d)}function l(d){return d===47?(t.consume(d),a?c:(a=!0,l)):r(d)}function c(d){return d===null||Ol(d)||Xe(d)||Ta(d)||Al(d)?r(d):t.attempt(XV,t.attempt(YV,u),r)(d)}function u(d){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(d)}}function WIe(t,e,r){let o=0;return n;function n(i){return(i===87||i===119)&&o<3?(o++,t.consume(i),n):i===46&&o===3?(t.consume(i),a):r(i)}function a(i){return i===null?r(i):e(i)}}function KIe(t,e,r){let o,n,a;return i;function i(c){return c===46||c===95?t.check(QV,l,s)(c):c===null||Xe(c)||Ta(c)||c!==45&&Al(c)?l(c):(a=!0,t.consume(c),i)}function s(c){return c===95?o=!0:(n=o,o=void 0),t.consume(c),i}function l(c){return n||o||!a?r(c):e(c)}}function XIe(t,e){let r=0,o=0;return n;function n(i){return i===40?(r++,t.consume(i),n):i===41&&o<r?a(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?t.check(QV,e,a)(i):i===null||Xe(i)||Ta(i)?e(i):(t.consume(i),n)}function a(i){return i===41&&o++,t.consume(i),n}}function YIe(t,e,r){return o;function o(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(t.consume(s),o):s===38?(t.consume(s),a):s===93?(t.consume(s),n):s===60||s===null||Xe(s)||Ta(s)?e(s):r(s)}function n(s){return s===null||s===40||s===91||Xe(s)||Ta(s)?e(s):o(s)}function a(s){return Pr(s)?i(s):r(s)}function i(s){return s===59?(t.consume(s),o):Pr(s)?(t.consume(s),i):r(s)}}function QIe(t,e,r){return o;function o(a){return t.consume(a),n}function n(a){return Or(a)?r(a):e(a)}}function eH(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Xe(t)}function tH(t){return!Pr(t)}function rH(t){return!(t===47||Sk(t))}function Sk(t){return t===43||t===45||t===46||t===95||Or(t)}function kk(t){let e=t.length,r=!1;for(;e--;){let o=t[e][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){r=!0;break}if(o._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var ZIe={tokenize:awe,partial:!0};function Tk(){return{document:{91:{tokenize:rwe,continuation:{tokenize:owe},exit:nwe}},text:{91:{tokenize:twe},93:{add:"after",tokenize:JIe,resolveTo:ewe}}}}function JIe(t,e,r){let o=this,n=o.events.length,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),i;for(;n--;){let l=o.events[n][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!i||!i._balanced)return r(l);let c=mo(o.sliceSerialize({start:i.end,end:o.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?r(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function ewe(t,e){let r=t.length,o;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){o=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;let i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},t[t.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",a,e],["exit",a,e],["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...l),t}function twe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a=0,i;return s;function s(d){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?r(d):(t.enter("gfmFootnoteCallMarker"),t.consume(d),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",c)}function c(d){if(a>999||d===93&&!i||d===null||d===91||Xe(d))return r(d);if(d===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return n.includes(mo(o.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return Xe(d)||(i=!0),a++,t.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(t.consume(d),a++,c):c(d)}}function rwe(t,e,r){let o=this,n=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),a,i=0,s;return l;function l(h){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(h){return h===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",u):r(h)}function u(h){if(i>999||h===93&&!s||h===null||h===91||Xe(h))return r(h);if(h===93){t.exit("chunkString");let g=t.exit("gfmFootnoteDefinitionLabelString");return a=mo(o.sliceSerialize(g)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(h),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return Xe(h)||(s=!0),i++,t.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(t.consume(h),i++,u):u(h)}function p(h){return h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),n.includes(a)||n.push(a),Ee(t,m,"gfmFootnoteDefinitionWhitespace")):r(h)}function m(h){return e(h)}}function owe(t,e,r){return t.check(Pa,e,t.attempt(ZIe,e,r))}function nwe(t){t.exit("gfmFootnoteDefinition")}function awe(t,e,r){let o=this;return Ee(t,n,"gfmFootnoteDefinitionIndent",5);function n(a){let i=o.events[o.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?e(a):r(a)}}function Pk(t){let r=(t||{}).singleTilde,o={tokenize:a,resolveAll:n};return r==null&&(r=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function n(i,s){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let c=l;for(;c--;)if(i[c][0]==="exit"&&i[c][1].type==="strikethroughSequenceTemporary"&&i[c][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[c][1].end.offset-i[c][1].start.offset){i[l][1].type="strikethroughSequence",i[c][1].type="strikethroughSequence";let u={type:"strikethrough",start:Object.assign({},i[c][1].start),end:Object.assign({},i[l][1].end)},d={type:"strikethroughText",start:Object.assign({},i[c][1].end),end:Object.assign({},i[l][1].start)},p=[["enter",u,s],["enter",i[c][1],s],["exit",i[c][1],s],["enter",d,s]],m=s.parser.constructs.insideSpan.null;m&&Ir(p,p.length,0,ts(m,i.slice(c+1,l),s)),Ir(p,p.length,0,[["exit",d,s],["enter",i[l][1],s],["exit",i[l][1],s],["exit",u,s]]),Ir(i,c-1,l-c+3,p),l=c+p.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function a(i,s,l){let c=this.previous,u=this.events,d=0;return p;function p(h){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(h):(i.enter("strikethroughSequenceTemporary"),m(h))}function m(h){let g=Hu(c);if(h===126)return d>1?l(h):(i.consume(h),d++,m);if(d<2&&!r)return l(h);let _=i.exit("strikethroughSequenceTemporary"),x=Hu(h);return _._open=!x||x===2&&!!g,_._close=!g||g===2&&!!x,s(h)}}}var hy=class{constructor(){this.map=[]}add(e,r,o){iwe(this,e,r,o)}consume(e){if(this.map.sort(function(a,i){return a[0]-i[0]}),this.map.length===0)return;let r=this.map.length,o=[];for(;r>0;)r-=1,o.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];o.push([...e]),e.length=0;let n=o.pop();for(;n;)e.push(...n),n=o.pop();this.map.length=0}};function iwe(t,e,r,o){let n=0;if(!(r===0&&o.length===0)){for(;n<t.map.length;){if(t.map[n][0]===e){t.map[n][1]+=r,t.map[n][2].push(...o);return}n+=1}t.map.push([e,r,o])}}function oH(t,e){let r=!1,o=[];for(;e<t.length;){let n=t[e];if(r){if(n[0]==="enter")n[1].type==="tableContent"&&o.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let a=o.length-1;o[a]=o[a]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return o}function Ok(){return{flow:{null:{tokenize:swe,resolveAll:lwe}}}}function swe(t,e,r){let o=this,n=0,a=0,i;return s;function s(C){let F=o.events.length-1;for(;F>-1;){let z=o.events[F][1].type;if(z==="lineEnding"||z==="linePrefix")F--;else break}let N=F>-1?o.events[F][1].type:null,R=N==="tableHead"||N==="tableRow"?v:l;return R===v&&o.parser.lazy[o.now().line]?r(C):R(C)}function l(C){return t.enter("tableHead"),t.enter("tableRow"),c(C)}function c(C){return C===124||(i=!0,a+=1),u(C)}function u(C){return C===null?r(C):ie(C)?a>1?(a=0,o.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),m):r(C):Pe(C)?Ee(t,u,"whitespace")(C):(a+=1,i&&(i=!1,n+=1),C===124?(t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),i=!0,u):(t.enter("data"),d(C)))}function d(C){return C===null||C===124||Xe(C)?(t.exit("data"),u(C)):(t.consume(C),C===92?p:d)}function p(C){return C===92||C===124?(t.consume(C),d):d(C)}function m(C){return o.interrupt=!1,o.parser.lazy[o.now().line]?r(C):(t.enter("tableDelimiterRow"),i=!1,Pe(C)?Ee(t,h,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):h(C))}function h(C){return C===45||C===58?_(C):C===124?(i=!0,t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),g):w(C)}function g(C){return Pe(C)?Ee(t,_,"whitespace")(C):_(C)}function _(C){return C===58?(a+=1,i=!0,t.enter("tableDelimiterMarker"),t.consume(C),t.exit("tableDelimiterMarker"),x):C===45?(a+=1,x(C)):C===null||ie(C)?I(C):w(C)}function x(C){return C===45?(t.enter("tableDelimiterFiller"),b(C)):w(C)}function b(C){return C===45?(t.consume(C),b):C===58?(i=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(C),t.exit("tableDelimiterMarker"),y):(t.exit("tableDelimiterFiller"),y(C))}function y(C){return Pe(C)?Ee(t,I,"whitespace")(C):I(C)}function I(C){return C===124?h(C):C===null||ie(C)?!i||n!==a?w(C):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(C)):w(C)}function w(C){return r(C)}function v(C){return t.enter("tableRow"),T(C)}function T(C){return C===124?(t.enter("tableCellDivider"),t.consume(C),t.exit("tableCellDivider"),T):C===null||ie(C)?(t.exit("tableRow"),e(C)):Pe(C)?Ee(t,T,"whitespace")(C):(t.enter("data"),O(C))}function O(C){return C===null||C===124||Xe(C)?(t.exit("data"),T(C)):(t.consume(C),C===92?S:O)}function S(C){return C===92||C===124?(t.consume(C),O):O(C)}}function lwe(t,e){let r=-1,o=!0,n=0,a=[0,0,0,0],i=[0,0,0,0],s=!1,l=0,c,u,d,p=new hy;for(;++r<t.length;){let m=t[r],h=m[1];m[0]==="enter"?h.type==="tableHead"?(s=!1,l!==0&&(nH(p,e,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(r,0,[["enter",c,e]])):h.type==="tableRow"||h.type==="tableDelimiterRow"?(o=!0,d=void 0,a=[0,0,0,0],i=[0,r+1,0,0],s&&(s=!1,u={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(r,0,[["enter",u,e]])),n=h.type==="tableDelimiterRow"?2:u?3:1):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")?(o=!1,i[2]===0&&(a[1]!==0&&(i[0]=i[1],d=gy(p,e,a,n,void 0,d),a=[0,0,0,0]),i[2]=r)):h.type==="tableCellDivider"&&(o?o=!1:(a[1]!==0&&(i[0]=i[1],d=gy(p,e,a,n,void 0,d)),a=i,i=[a[1],r,0,0])):h.type==="tableHead"?(s=!0,l=r):h.type==="tableRow"||h.type==="tableDelimiterRow"?(l=r,a[1]!==0?(i[0]=i[1],d=gy(p,e,a,n,r,d)):i[1]!==0&&(d=gy(p,e,i,n,r,d)),n=0):n&&(h.type==="data"||h.type==="tableDelimiterMarker"||h.type==="tableDelimiterFiller")&&(i[3]=r)}for(l!==0&&nH(p,e,l,c,u),p.consume(e.events),r=-1;++r<e.events.length;){let m=e.events[r];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=oH(e.events,r))}return t}function gy(t,e,r,o,n,a){let i=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",s="tableContent";r[0]!==0&&(a.end=Object.assign({},qu(e.events,r[0])),t.add(r[0],0,[["exit",a,e]]));let l=qu(e.events,r[1]);if(a={type:i,start:Object.assign({},l),end:Object.assign({},l)},t.add(r[1],0,[["enter",a,e]]),r[2]!==0){let c=qu(e.events,r[2]),u=qu(e.events,r[3]),d={type:s,start:Object.assign({},c),end:Object.assign({},u)};if(t.add(r[2],0,[["enter",d,e]]),o!==2){let p=e.events[r[2]],m=e.events[r[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let h=r[2]+1,g=r[3]-r[2]-1;t.add(h,g,[])}}t.add(r[3]+1,0,[["exit",d,e]])}return n!==void 0&&(a.end=Object.assign({},qu(e.events,n)),t.add(n,0,[["exit",a,e]]),a=void 0),a}function nH(t,e,r,o,n){let a=[],i=qu(e.events,r);n&&(n.end=Object.assign({},i),a.push(["exit",n,e])),o.end=Object.assign({},i),a.push(["exit",o,e]),t.add(r+1,0,a)}function qu(t,e){let r=t[e],o=r[0]==="enter"?"start":"end";return r[1][o]}var cwe={tokenize:uwe};function Ak(){return{text:{91:cwe}}}function uwe(t,e,r){let o=this;return n;function n(l){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?r(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),a)}function a(l){return Xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),i):r(l)}function i(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),s):r(l)}function s(l){return ie(l)?e(l):Pe(l)?t.check({tokenize:dwe},e,r)(l):r(l)}}function dwe(t,e,r){return Ee(t,o,"whitespace");function o(n){return n===null?r(n):e(n)}}function aH(t){return ry([Ck(),Tk(),Pk(t),Ok(),Ak()])}var iH={name:"@blinkk/root-cms",version:"1.4.7",author:"s@blinkk.com",license:"MIT",engines:{node:">=16.0.0"},repository:{type:"git",url:"git+https://github.com/blinkk/rootjs.git",directory:"packages/root-cms"},files:["dist/**/*"],bin:{"root-cms":"./bin/root-cms.js"},type:"module",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./client":{types:"./dist/client.d.ts",import:"./dist/client.js"},"./core":{types:"./dist/core.d.ts",import:"./dist/core.js"},"./functions":{types:"./dist/functions.d.ts",import:"./dist/functions.js"},"./plugin":{types:"./dist/plugin.d.ts",import:"./dist/plugin.js"},"./project":{types:"./dist/project.d.ts",import:"./dist/project.js"},"./richtext":{types:"./dist/richtext.d.ts",import:"./dist/richtext.js"}},scripts:{build:'rm -rf dist && concurrently -n "core,signin,ui" npm:build:core npm:build:signin npm:build:ui',"build:core":"tsup-node --config=./core/tsup.config.ts","//":"NOTE: esbuild is used here because tsup doesn't currently support aliases.","build:ui":"esbuild ui/ui.tsx --bundle --minify --alias:react=@preact/compat --alias:react-dom=@preact/compat --tsconfig=ui/tsconfig.json --outdir=dist/ui","build:signin":"esbuild signin/signin.tsx --bundle --minify --tsconfig=signin/tsconfig.json --outdir=dist/ui",dev:'rm -rf dist && concurrently -k -n "core,ui" npm:dev:core npm:dev:signin npm:dev:ui',"dev:core":"pnpm build:core --watch","dev:signin":"pnpm build:signin --watch","dev:ui":"pnpm build:ui --watch",test:"pnpm build && firebase emulators:exec 'vitest run'","test:watch":"pnpm build && firebase emulators:exec 'vitest'"},dependencies:{"@genkit-ai/ai":"0.5.2","@genkit-ai/core":"0.5.2","@genkit-ai/vertexai":"0.5.2","body-parser":"1.20.2",commander:"11.0.0","csv-parse":"5.5.2","csv-stringify":"6.4.4","dts-dom":"3.7.0","fnv-plus":"1.3.1",jsonwebtoken:"9.0.2",kleur:"4.1.5",sirv:"2.0.3","tiny-glob":"0.2.9"},"//":"NOTE(stevenle): due to compat issues with mantine and preact, mantine is pinned to v4.2.12",devDependencies:{"@babel/core":"7.17.9","@blinkk/root":"workspace:*","@editorjs/editorjs":"2.30.8","@editorjs/header":"2.8.8","@editorjs/image":"2.10.2","@editorjs/list":"2.0.6","@editorjs/nested-list":"1.4.3","@editorjs/raw":"2.5.1","@editorjs/table":"2.4.4","@editorjs/underline":"1.2.1","@emotion/react":"11.10.5","@firebase/app-compat":"0.2.19","@firebase/app-types":"0.9.0","@firebase/rules-unit-testing":"3.0.1","@mantine/core":"4.2.12","@mantine/hooks":"4.2.12","@mantine/modals":"4.2.12","@mantine/notifications":"4.2.12","@mantine/spotlight":"4.2.12","@preact/compat":"17.1.2","@tabler/icons-preact":"2.47.0","@types/body-parser":"1.19.3","@types/fnv-plus":"1.3.2","@types/gapi":"0.0.47","@types/gapi.client.drive-v3":"0.0.4","@types/gapi.client.sheets-v4":"0.0.4","@types/google.accounts":"0.0.14","@types/jsonwebtoken":"9.0.1","@types/node":"18.11.8",concurrently:"7.6.0",esbuild:"0.19.9",firebase:"10.5.2","firebase-admin":"11.11.1","firebase-functions":"4.8.0","firebase-tools":"12.9.1","highlight.js":"11.6.0","json-diff-kit":"1.0.29",marked:"9.1.1","mdast-util-from-markdown":"2.0.1","mdast-util-gfm":"3.0.0","micromark-extension-gfm":"3.0.0",preact:"10.19.3","preact-render-to-string":"6.3.1","preact-router":"4.1.2",react:"npm:@preact/compat@^17.1.2","react-dom":"npm:@preact/compat@^17.1.2","react-json-view-compare":"2.0.2",tsup:"8.0.1",typescript:"5.2.2",vite:"5.0.8",vitest:"0.34.6"},peerDependencies:{"@blinkk/root":"1.4.7","firebase-admin":">=11","firebase-functions":">=4",preact:">=10","preact-render-to-string":">=5"},peerDependenciesMeta:{"firebase-functions":{optional:!0}}};function sH(){return f("svg",{width:"100",height:"23",viewBox:"0 0 100 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("g",{"clip-path":"url(#clip0_1_318)",children:[f("path",{d:"M7.82998 5.01802C3.12925 5.6479 0.833937 18.1194 2.62578 19.6731C5.64773 22.2934 16.6441 14.1722 15.6786 9.46913C15.3009 6.61371 11.2717 4.28377 7.82998 5.01802Z",fill:"black"}),f("path",{d:"M13.9782 0.720147C12.6553 0.896474 12.0093 4.38767 12.5136 4.8226C13.364 5.55611 16.4587 3.28271 16.187 1.96616C16.0807 1.16683 14.9468 0.514607 13.9782 0.720147Z",fill:"black"}),f("path",{d:"M92.7383 17.6275C90.9681 17.6275 89.3816 17.0263 88.3796 16.0744C87.9955 15.7237 87.8953 15.3396 88.246 14.9555L88.8305 14.2541C89.1645 13.87 89.5486 13.7865 89.9327 14.1205C90.6007 14.6883 91.7029 15.1726 92.5713 15.1726C93.5232 15.1726 94.1244 14.8219 94.1244 14.2875C94.1244 13.5193 93.2059 13.4358 91.9868 13.0684C90.417 12.6008 88.5132 11.7324 88.5132 9.64493C88.5132 7.70773 90.25 6.37173 92.7383 6.37173C94.2413 6.37173 95.5272 6.87273 96.4123 7.57413C96.8131 7.90813 96.9467 8.27553 96.596 8.67633L96.0282 9.37773C95.7109 9.76183 95.3435 9.82863 94.926 9.51133C94.3916 9.09383 93.6568 8.69303 92.7884 8.69303C92.0202 8.69303 91.5192 9.01033 91.5192 9.51133C91.5192 10.1292 92.3041 10.4131 93.1224 10.6636C94.9761 11.2314 97.1304 11.8326 97.1304 14.2708C97.1304 16.4585 95.1264 17.6275 92.7383 17.6275Z",fill:"black"}),f("path",{d:"M87.0008 16.6756C87.0843 17.1766 86.8171 17.4271 86.2994 17.4271H85.097C84.596 17.4271 84.3789 17.1766 84.3121 16.6756L83.7443 11.9161L81.757 16.7424C81.5399 17.2434 81.1892 17.5106 80.6882 17.5106H80.5212C80.0202 17.5106 79.6695 17.2434 79.4524 16.7424L77.4651 11.8994L76.8973 16.6756C76.8472 17.1766 76.6301 17.4271 76.1291 17.4271H74.7263C74.2086 17.4271 73.9414 17.1766 74.0082 16.6756L75.4945 7.24013C75.5613 6.75583 75.8786 6.48863 76.3796 6.48863H76.5466C77.0476 6.48863 77.3315 6.75583 77.5486 7.24013L80.6047 13.8032L83.4938 7.24013C83.7109 6.75583 84.0115 6.48863 84.4958 6.48863H84.6795C85.1638 6.48863 85.4811 6.75583 85.5646 7.24013L87.0008 16.6756Z",fill:"black"}),f("path",{d:"M68.6496 17.6275C65.3096 17.6275 62.7211 15.2227 62.7211 11.9996C62.7211 8.77653 65.3096 6.37173 68.683 6.37173C70.3029 6.37173 71.7558 6.97293 72.7745 7.99163C73.1419 8.34233 73.1419 8.77653 72.7745 9.09383L71.9228 9.81193C71.5554 10.1292 71.2047 10.1125 70.8206 9.79523C70.2361 9.31093 69.5013 9.01033 68.683 9.01033C67.013 9.01033 65.7104 10.2628 65.7104 11.9996C65.7104 13.7364 67.013 14.9889 68.683 14.9889C69.5013 14.9889 70.2528 14.6883 70.8206 14.204C71.2047 13.8867 71.5554 13.87 71.9228 14.1873L72.7745 14.9054C73.1419 15.2227 73.1419 15.6569 72.7745 16.0076C71.7558 17.0263 70.3029 17.6275 68.6496 17.6275Z",fill:"black"}),f("path",{d:"M58.575 16.2915C58.7587 16.6923 58.4581 16.8927 58.241 17.0597C57.7233 17.4271 56.9384 17.6442 56.1201 17.6442C54.4501 17.6442 52.8469 16.6923 52.8469 14.4044V11.0978H52.1121C51.6111 11.0978 51.3439 10.8139 51.3439 10.3296V9.76183C51.3439 9.26083 51.6111 8.99363 52.1121 8.99363H52.8469V7.05643C52.8469 6.57213 53.1308 6.38843 53.6151 6.28823L54.9511 6.05443C55.4521 5.95423 55.7193 6.30493 55.7193 6.80593V8.99363H57.3726C57.8569 8.99363 58.1408 9.26083 58.1408 9.76183V10.3296C58.1408 10.8139 57.8569 11.0978 57.3726 11.0978H55.7193V14.1038C55.7193 14.9221 56.1368 15.1893 56.6545 15.1893C56.905 15.1893 57.1555 15.0724 57.3392 14.9555C57.7567 14.6883 57.9571 14.8887 58.1074 15.206L58.575 16.2915Z",fill:"black"}),f("path",{d:"M46.2592 17.6442C43.5538 17.6442 41.5999 15.7738 41.5999 13.2521C41.5999 10.7304 43.5538 8.86003 46.2592 8.86003C48.9646 8.86003 50.9185 10.7304 50.9185 13.2521C50.9185 15.7738 48.9646 17.6442 46.2592 17.6442ZM46.2592 15.1726C47.3113 15.1726 48.0628 14.3543 48.0628 13.2521C48.0628 12.1499 47.3113 11.3316 46.2592 11.3316C45.2071 11.3316 44.4389 12.1499 44.4389 13.2521C44.4389 14.3543 45.2071 15.1726 46.2592 15.1726Z",fill:"black"}),f("path",{d:"M36.052 17.6442C33.3466 17.6442 31.3927 15.7738 31.3927 13.2521C31.3927 10.7304 33.3466 8.86003 36.052 8.86003C38.7574 8.86003 40.7113 10.7304 40.7113 13.2521C40.7113 15.7738 38.7574 17.6442 36.052 17.6442ZM36.052 15.1726C37.1041 15.1726 37.8556 14.3543 37.8556 13.2521C37.8556 12.1499 37.1041 11.3316 36.052 11.3316C34.9999 11.3316 34.2317 12.1499 34.2317 13.2521C34.2317 14.3543 34.9999 15.1726 36.052 15.1726Z",fill:"black"}),f("path",{d:"M28.7099 13.0851L30.6805 16.6422C30.9644 17.1599 30.6638 17.4271 30.1628 17.4271H28.4594C27.9417 17.4271 27.8081 17.1766 27.5242 16.6589L25.7707 13.4859H24.6351V16.6422C24.6351 17.1432 24.3512 17.4271 23.8502 17.4271H22.4808C21.9798 17.4271 21.6959 17.1432 21.6959 16.6422V7.35703C21.6959 6.85603 21.9798 6.57213 22.4808 6.57213H26.5222C29.3111 6.57213 30.8141 7.92483 30.8141 10.1125C30.8141 11.5654 29.9791 12.5841 28.7099 13.0851ZM24.6351 8.96023V11.5153H26.4721C27.2236 11.5153 27.8248 11.0644 27.8248 10.2628C27.8248 9.44453 27.2236 8.96023 26.4721 8.96023H24.6351Z",fill:"black"})]}),f("defs",{children:f("clipPath",{id:"clip0_1_318",children:f("rect",{width:"99",height:"22",fill:"white",transform:"translate(0.0175781 0.177246)"})})})]})}var ai="1.5";function me(t){return f("div",{className:"Layout",children:[f(me.Top,{}),f(me.Side,{}),f(me.Main,{...t,children:t.children}),f(me.Bottom,{})]})}me.Top=()=>{let t=window.__ROOT_CTX.rootConfig.projectName||window.__ROOT_CTX.rootConfig.projectId;return f("div",{className:"Layout__top",children:[f("a",{className:"Layout__top__logo",href:"/cms",children:f(sH,{})}),f("div",{className:"Layout__top__version",children:["v",iH.version]}),f("div",{className:"Layout__top__project",children:t})]})};me.Side=()=>{let[t]=az(),e=t.url.replace(/\/*$/g,""),r=window.firebase.user,o=window.__ROOT_CTX.sidebar?.tools,n=window.__ROOT_CTX.experiments||{};return f("div",{className:"Layout__side",children:[f("div",{className:"Layout__side__buttons",children:[f(me.SideButton,{label:"Home",url:"/cms",active:e==="/cms",children:f(YS,{stroke:ai})}),f(me.SideButton,{label:"Content",url:"/cms/content",active:e.startsWith("/cms/content"),children:f(yl,{stroke:ai})}),f(me.SideButton,{label:"Releases",url:"/cms/releases",active:e.startsWith("/cms/releases"),children:f(Tu,{stroke:ai})}),f(me.SideButton,{label:"Data",url:"/cms/data",active:e.startsWith("/cms/data"),children:f(GS,{stroke:ai})}),f(me.SideButton,{label:"Assets",url:"/cms/assets",active:e.startsWith("/cms/assets"),children:f(eC,{stroke:ai})}),f(me.SideButton,{label:"Translations",url:"/cms/translations",active:e.startsWith("/cms/translations"),children:f(Wi,{stroke:ai})}),n.ai&&f(me.SideButton,{label:"Root AI (experimental)",url:"/cms/ai",active:e.startsWith("/cms/ai"),children:f(Il,{stroke:ai})}),o&&f(Ae,{children:[f("div",{className:"Layout__side__divider"}),Object.entries(o).map(([a,i])=>f(me.SideButton,{className:"Layout__side__tool",label:i.label||"",url:`/cms/tools/${a}`,active:e.startsWith(`/cms/tools/${a}`),children:i.icon?f("img",{className:"Layout__side__tool__icon",src:i.icon,alt:i.label||""}):f(US,{stroke:ai})})),f("div",{className:"Layout__side__divider"})]}),f(me.SideButton,{label:"Settings",url:"/cms/settings",active:e.startsWith("/cms/settings"),children:f(wl,{stroke:ai})})]}),f("div",{className:"Layout__side__user",children:f(xe,{label:r.email,position:"right",withArrow:!0,children:f(kn,{src:r.photoURL,alt:r.email,size:30,radius:"xl"})})})]})};me.SideButton=t=>f(xe,{className:ke("Layout__side__button",t.className),label:t.label,position:"right",withArrow:!0,children:f("a",{className:ke(t.active&&"active"),href:t.url,children:t.children})});me.Main=t=>f("div",{className:"Layout__main",children:t.children});me.Bottom=()=>f("div",{className:"Layout__bottom"});var lH=["bmp","gif","ico","jpeg","jpg","png","tiff","webp"],Dk=[...lH,"svg"],Rk=["mp4","webm"],cH="https://lh3.googleusercontent.com/";async function Aa(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=await _we(t),n=am(t.name),a=e?.preserveFilename?`${o}/${t.name}`:`${o}.${n}`,i=`${r}/uploads/${a}`,s=tz(window.firebase.storage,i);await J9(s,t),console.log(`uploaded ${i}`);let l={};l.filename=t.name,l.uploadedBy=window.firebase.user.email||"unknown",l.uploadedAt=String(Math.floor(new Date().getTime()));let c=`/${s.bucket}/${s.fullPath}`,u=`https://storage.googleapis.com${c}`;if(Dk.includes(n)){let p=await hwe(t);if(l.width=p.width,l.height=p.height,!e?.disableGci&&lH.includes(n)){let m=await mwe(c);m&&(l.gcsPath=c,u=m)}}else if(Rk.includes(n)){let p=await gwe(u);l.width=p.width,l.height=p.height,console.log("video dimensions:",p)}let d=e?.cacheControl||"public, max-age=3600";return await ez(s,{cacheControl:d,customMetadata:xwe(l)}),console.log("updated meta data: ",l),{...l,src:u}}function am(t){return pwe(t.split(".").at(-1)||"")}function pwe(t){let e=String(t).toLowerCase();return e==="jpeg"&&(e="jpg"),e}async function mwe(t){let e=window.__ROOT_CTX.rootConfig.gci;if(!e)return"";let r=new URLSearchParams({gcs:t}),o=`${e}/_/serving_url?${r.toString()}`,n=await window.fetch(o);if(n.status!==200){let i=await n.text();throw console.error(`failed to get gci url: ${o}`),console.error(i),new Error("failed to get gci url")}return(await n.json()).servingUrl}async function hwe(t){return new Promise((e,r)=>{let o=new FileReader;o.onload=()=>{let n=new Image;n.onload=()=>{e({width:n.width,height:n.height})},n.onerror=r,n.src=String(o.result)},o.onerror=r,o.readAsDataURL(t)})}async function gwe(t){return new Promise((e,r)=>{let o=document.createElement("video");o.addEventListener("loadedmetadata",()=>{let n={width:o.videoWidth,height:o.videoHeight};e(n),document.body.removeChild(o)},!1),o.addEventListener("error",()=>{r(new Error("Failed to load video metadata")),document.body.removeChild(o)},!1),o.className="sr-only",o.src=t,o.preload="metadata",document.body.appendChild(o)})}async function _we(t){let e=await t.arrayBuffer(),r=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(r)).map(a=>a.toString(16).padStart(2,"0")).join("")}function xwe(t){let e={};return Object.entries(t).forEach(([r,o])=>{t[r]=String(o).trim()}),e}function ra(t){t||(t=6);let e=[],r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=r.length;for(let n=0;n<t;n++)e.push(r.charAt(Math.floor(Math.random()*o)));return e.join("")}function uH(t,e){return Math.random()*(e-t)+t}var bwe=!1,ywe=`Lorem ipsum \u{1F955} dolor sit amet.
|
|
54
54
|
|
|
55
55
|
\`\`\`jsx
|
|
56
56
|
import React, { useState, useEffect } from 'react';
|
|
@@ -140,7 +140,7 @@ ${e}</tr>
|
|
|
140
140
|
`}tablecell(e,r){let o=r.header?"th":"td";return(r.align?`<${o} align="${r.align}">`:`<${o}>`)+e+`</${o}>
|
|
141
141
|
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,r,o){let n=yH(e);if(n===null)return o;e=n;let a='<a href="'+e+'"';return r&&(a+=' title="'+r+'"'),a+=">"+o+"</a>",a}image(e,r,o){let n=yH(e);if(n===null)return o;e=n;let a=`<img src="${e}" alt="${o}"`;return r&&(a+=` title="${r}"`),a+=">",a}text(e){return e}},im=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,r,o){return""+o}image(e,r,o){return""+o}br(){return""}},si=class t{options;renderer;textRenderer;constructor(e){this.options=e||Fl,this.options.renderer=this.options.renderer||new Yu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new im}static parse(e,r){return new t(r).parse(e)}static parseInline(e,r){return new t(r).parseInline(e)}parse(e,r=!0){let o="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){let i=a,s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(i.type)){o+=s||"";continue}}switch(a.type){case"space":continue;case"hr":{o+=this.renderer.hr();continue}case"heading":{let i=a;o+=this.renderer.heading(this.parseInline(i.tokens),i.depth,Lwe(this.parseInline(i.tokens,this.textRenderer)));continue}case"code":{let i=a;o+=this.renderer.code(i.text,i.lang,!!i.escaped);continue}case"table":{let i=a,s="",l="";for(let u=0;u<i.header.length;u++)l+=this.renderer.tablecell(this.parseInline(i.header[u].tokens),{header:!0,align:i.align[u]});s+=this.renderer.tablerow(l);let c="";for(let u=0;u<i.rows.length;u++){let d=i.rows[u];l="";for(let p=0;p<d.length;p++)l+=this.renderer.tablecell(this.parseInline(d[p].tokens),{header:!1,align:i.align[p]});c+=this.renderer.tablerow(l)}o+=this.renderer.table(s,c);continue}case"blockquote":{let i=a,s=this.parse(i.tokens);o+=this.renderer.blockquote(s);continue}case"list":{let i=a,s=i.ordered,l=i.start,c=i.loose,u="";for(let d=0;d<i.items.length;d++){let p=i.items[d],m=p.checked,h=p.task,g="";if(p.task){let _=this.renderer.checkbox(!!m);c?p.tokens.length>0&&p.tokens[0].type==="paragraph"?(p.tokens[0].text=_+" "+p.tokens[0].text,p.tokens[0].tokens&&p.tokens[0].tokens.length>0&&p.tokens[0].tokens[0].type==="text"&&(p.tokens[0].tokens[0].text=_+" "+p.tokens[0].tokens[0].text)):p.tokens.unshift({type:"text",text:_+" "}):g+=_+" "}g+=this.parse(p.tokens,c),u+=this.renderer.listitem(g,h,!!m)}o+=this.renderer.list(u,s,l);continue}case"html":{let i=a;o+=this.renderer.html(i.text,i.block);continue}case"paragraph":{let i=a;o+=this.renderer.paragraph(this.parseInline(i.tokens));continue}case"text":{let i=a,s=i.tokens?this.parseInline(i.tokens):i.text;for(;n+1<e.length&&e[n+1].type==="text";)i=e[++n],s+=`
|
|
142
142
|
`+(i.tokens?this.parseInline(i.tokens):i.text);o+=r?this.renderer.paragraph(s):s;continue}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return o}parseInline(e,r){r=r||this.renderer;let o="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){let i=this.options.extensions.renderers[a.type].call({parser:this},a);if(i!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){o+=i||"";continue}}switch(a.type){case"escape":{let i=a;o+=r.text(i.text);break}case"html":{let i=a;o+=r.html(i.text);break}case"link":{let i=a;o+=r.link(i.href,i.title,this.parseInline(i.tokens,r));break}case"image":{let i=a;o+=r.image(i.href,i.title,i.text);break}case"strong":{let i=a;o+=r.strong(this.parseInline(i.tokens,r));break}case"em":{let i=a;o+=r.em(this.parseInline(i.tokens,r));break}case"codespan":{let i=a;o+=r.codespan(i.text);break}case"br":{o+=r.br();break}case"del":{let i=a;o+=r.del(this.parseInline(i.tokens,r));break}case"text":{let i=a;o+=r.text(i.text);break}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return o}},Ku=class{options;constructor(e){this.options=e||Fl}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}},Mk=class{defaults=Lk();options=this.setOptions;parse=this.#e(ii.lex,si.parse);parseInline=this.#e(ii.lexInline,si.parseInline);Parser=si;parser=si.parse;Renderer=Yu;TextRenderer=im;Lexer=ii;lexer=ii.lex;Tokenizer=Xu;Hooks=Ku;constructor(...e){this.use(...e)}walkTokens(e,r){let o=[];for(let n of e)switch(o=o.concat(r.call(this,n)),n.type){case"table":{let a=n;for(let i of a.header)o=o.concat(this.walkTokens(i.tokens,r));for(let i of a.rows)for(let s of i)o=o.concat(this.walkTokens(s.tokens,r));break}case"list":{let a=n;o=o.concat(this.walkTokens(a.items,r));break}default:{let a=n;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(i=>{o=o.concat(this.walkTokens(a[i],r))}):a.tokens&&(o=o.concat(this.walkTokens(a.tokens,r)))}}return o}use(...e){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(o=>{let n={...o};if(n.async=this.defaults.async||n.async||!1,o.extensions&&(o.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let i=r.renderers[a.name];i?r.renderers[a.name]=function(...s){let l=a.renderer.apply(this,s);return l===!1&&(l=i.apply(this,s)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=r[a.level];i?i.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),n.extensions=r),o.renderer){let a=this.defaults.renderer||new Yu(this.defaults);for(let i in o.renderer){let s=o.renderer[i],l=i,c=a[l];a[l]=(...u)=>{let d=s.apply(a,u);return d===!1&&(d=c.apply(a,u)),d||""}}n.renderer=a}if(o.tokenizer){let a=this.defaults.tokenizer||new Xu(this.defaults);for(let i in o.tokenizer){let s=o.tokenizer[i],l=i,c=a[l];a[l]=(...u)=>{let d=s.apply(a,u);return d===!1&&(d=c.apply(a,u)),d}}n.tokenizer=a}if(o.hooks){let a=this.defaults.hooks||new Ku;for(let i in o.hooks){let s=o.hooks[i],l=i,c=a[l];Ku.passThroughHooks.has(i)?a[l]=u=>{if(this.defaults.async)return Promise.resolve(s.call(a,u)).then(p=>c.call(a,p));let d=s.call(a,u);return c.call(a,d)}:a[l]=(...u)=>{let d=s.apply(a,u);return d===!1&&(d=c.apply(a,u)),d}}n.hooks=a}if(o.walkTokens){let a=this.defaults.walkTokens,i=o.walkTokens;n.walkTokens=function(s){let l=[];return l.push(i.call(this,s)),a&&(l=l.concat(a.call(this,s))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}#e(e,r){return(o,n)=>{let a={...n},i={...this.defaults,...a};this.defaults.async===!0&&a.async===!1&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);let s=this.#t(!!i.silent,!!i.async);if(typeof o>"u"||o===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(o):o).then(l=>e(l,i)).then(l=>i.walkTokens?Promise.all(this.walkTokens(l,i.walkTokens)).then(()=>l):l).then(l=>r(l,i)).then(l=>i.hooks?i.hooks.postprocess(l):l).catch(s);try{i.hooks&&(o=i.hooks.preprocess(o));let l=e(o,i);i.walkTokens&&this.walkTokens(l,i.walkTokens);let c=r(l,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(l){return s(l)}}}#t(e,r){return o=>{if(o.message+=`
|
|
143
|
-
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+dn(o.message+"",!0)+"</pre>";return r?Promise.resolve(n):n}if(r)return Promise.reject(o);throw o}}},Bl=new Mk;function yt(t,e){return Bl.parse(t,e)}yt.options=yt.setOptions=function(t){return Bl.setOptions(t),yt.defaults=Bl.defaults,wH(yt.defaults),yt};yt.getDefaults=Lk;yt.defaults=Fl;yt.use=function(...t){return Bl.use(...t),yt.defaults=Bl.defaults,wH(yt.defaults),yt};yt.walkTokens=function(t,e){return Bl.walkTokens(t,e)};yt.parseInline=Bl.parseInline;yt.Parser=si;yt.parser=si.parse;yt.Renderer=Yu;yt.TextRenderer=im;yt.Lexer=ii;yt.lexer=ii.lex;yt.Tokenizer=Xu;yt.Hooks=Ku;yt.parse=yt;var trt=yt.options,rrt=yt.setOptions,ort=yt.use,nrt=yt.walkTokens,art=yt.parseInline;var irt=si.parse,srt=ii.lex;function CH(t){let e=t.code||"",r=t.inline?yt.parseInline(e):yt.parse(e);return f("div",{className:ke("Markdown",t.className),dangerouslySetInnerHTML:{__html:r}})}function by(t){let[e,r]=P(!0),[o,n]=P(null),a=Ht(async()=>{try{let i=await Au(t);n(i)}catch(i){console.error(i),pe({title:`Failed to load collection: ${t}`,message:String(i),color:"red",autoClose:!1})}r(!1)},[t]);return L(()=>{a()},[t]),{loading:e,schema:o}}function kH(t){let e={_array:[]};return t.forEach(r=>{let o=Uwe();e._array.push(o),e[o]=r}),e}function Uwe(){let t=[],e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=e.length;for(let o=0;o<6;o++)t.push(e.charAt(Math.floor(Math.random()*r)));return t.join("")}function sm(t){let e={};return t.fields.forEach(r=>{r.id&&(r.type==="array"&&r.default&&Array.isArray(r.default)?e[r.id]=kH(r.default):r.default?e[r.id]=r.default:r.type==="object"&&(e[r.id]=sm(r)))}),e}function TH(t){let[e,r]=P(""),[o,n]=P(!1),[a,i]=P(""),s=Lt(),l=t.collection,c=window.__ROOT_CTX.collections[l];if(!c)throw new Error(`collection not found: ${l}`);let u=by(l);function d(){t.onClose&&t.onClose()}async function p(m){m.preventDefault(),n(!0),i("");let h=$i(e),g=c.slugRegex;if(!Ca(h,g)){i('Please enter a valid slug (e.g. "foo-bar-123").'),n(!1);return}let _=`${l}/${h}`;try{let x={};!u.loading&&u.schema&&(x=await sm(u.schema)),await kS(_,{fields:x})}catch(x){i(String(x)),n(!1);return}n(!1),ur(`/cms/content/${t.collection}/${h}?new=true`)}return f(Lc,{className:"NewDocModal",opened:t.opened||!1,onClose:()=>d(),title:"New",size:"500px",overlayColor:s.colorScheme==="dark"?s.colors.dark[9]:s.colors.gray[2],children:[f("div",{className:"NewDocModal__body",children:"Enter a slug for the new doc. The slug is the ID of the page and is what's used in the URL. Use only lowercase letters, numbers, and dashes."}),f("form",{onSubmit:m=>p(m),children:[f(hb,{className:"NewDocModal__slug",collectionId:l,onChange:m=>{r(m.slug)}}),a&&f("div",{className:"NewDocModal__slugError",children:a}),f("div",{className:"NewDocModal__buttons",children:[f(X,{variant:"outline",onClick:()=>d(),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",type:"submit",size:"xs",color:"dark",loading:u.loading||o,children:"Submit"})]})]})]})}function Qu(t,e){let[r,o]=P(()=>{try{let a=window.localStorage.getItem(t);return a?JSON.parse(a):e}catch(a){return console.error(a),e}});return[r,a=>{typeof a=="function"&&(a=a(r)),window.localStorage.setItem(t,JSON.stringify(a)),o(a)}]}function li(t){let{className:e,localStorageId:r,children:o}=t,[n,a]=Qu(`root::SplitPanel:${r}`,350),[i,s]=P(!1),[l,c]=P(0),u=H(null),d=H(null);if(L(()=>{let m=()=>s(!1);window.addEventListener("mouseup",m);let h=u.current;return h&&c(h.getBoundingClientRect().left),()=>window.removeEventListener("mouseup",m)},[]),L(()=>{let m=h=>{let g=h.clientX-l;a(g)};return i&&window.addEventListener("mousemove",m),()=>window.removeEventListener("mousemove",m)},[i]),o?.length!==2)throw new Error("SplitPanel should have two <SplitPanel.Item> children.");let p={"--panel-size":`${n}px`};return f("div",{className:ke(e,"SplitPanel",i&&"dragging"),ref:u,style:p,children:[o[0],f("div",{className:"SplitPanel__divider",ref:d,onMouseDown:()=>s(!0)}),o[1]]})}li.Item=t=>f("div",{className:ke("SplitPanel__item",t.className,t.fluid?"fluid":"static"),children:t.children});function Zu(t){let[e,r]=P("");L(()=>{let a=window.__ROOT_CTX.rootConfig.projectId,i=window.__ROOT_CTX.collections,s=`root-cms::${a}::last_collection`;if(t.collection)window.localStorage.setItem(s,t.collection);else{let l=window.localStorage.getItem(s);if(l&&i[l]){ur(`/cms/content/${l}`);return}if(window.__ROOT_CTX.collections.Pages){ur("/cms/content/Pages");return}let c=Object.keys(window.__ROOT_CTX.collections)||[];if(c.length>0){let u=c[0];ur(`/cms/content/${u}`);return}console.warn("no collections")}},[t.collection]);let n=Object.keys(window.__ROOT_CTX.collections).filter(a=>e?a.toLowerCase().includes(e.toLowerCase()):!0).map(a=>({...window.__ROOT_CTX.collections[a],id:a}));return f(me,{children:f(li,{className:"CollectionPage",localStorageId:"CollectionPage",children:[f(li.Item,{className:"CollectionPage__side",children:[f("div",{className:"CollectionPage__side__title",children:"Content"}),f("div",{className:"CollectionPage__side__search",children:f("input",{type:"text",placeholder:"Search",onChange:a=>r(a.target.value)})}),f("div",{className:"CollectionPage__side__collections",children:[n.map(a=>f("a",{className:ke("CollectionPage__side__collection",a.id===t.collection&&"active"),href:`/cms/content/${a.id}`,children:[f("div",{className:"CollectionPage__side__collection__icon",children:f(yl,{size:20,strokeWidth:"1.75"})}),f("div",{className:"CollectionPage__side__collection__name",children:a.name||a.id}),a.description&&f("div",{className:"CollectionPage__side__collection__desc",children:a.description})]},a.id)),n.length===0&&f("div",{className:"CollectionPage__side__collections__empty",children:"No collections match your query."})]})]}),f(li.Item,{className:"CollectionPage__main",fluid:!0,children:t.collection?f(Zu.Collection,{collection:t.collection},t.collection):f("div",{className:"CollectionPage__main__unselected",children:[f(zS,{size:24,strokeWidth:1.75}),f("div",{className:"CollectionPage__main__unselected__title",children:"Select a collection to get started."})]})})]})})}Zu.Collection=t=>{let[e,r]=Qu(`root::CollectionPage:${t.collection}:orderBy`,"modifiedAt"),[o,n]=P(!1),a=window.__ROOT_CTX.collections[t.collection];if(!a)return ur("/cms/content"),f(Ae,{});let[i,s,l]=Su(t.collection,{orderBy:e});return f(Ae,{children:[f(TH,{collection:t.collection,opened:o,onClose:()=>n(!1)}),f("div",{className:"CollectionPage__collection",children:[f("div",{className:"CollectionPage__collection__header",children:[f("div",{className:"CollectionPage__collection__header__title",children:a.name}),a.description&&f(CH,{className:"CollectionPage__collection__header__description",code:a.description})]}),f(zc,{className:"CollectionPage__collection__tabs",active:1,children:f(zc.Tab,{label:"Docs",children:f("div",{className:"CollectionPage__collection__docsTab",children:[!i&&l.length>0&&f("div",{className:"CollectionPage__collection__docsTab__header",children:[f(Te,{className:"CollectionPage__collection__docsTab__header__title",children:a.name||t.collection}),f("div",{className:"CollectionPage__collection__docsTab__controls",children:[f("div",{className:"CollectionPage__collection__docsTab__controls__sort",children:[f("div",{className:"CollectionPage__collection__docsTab__controls__sort__label",children:"Sort:"}),f(Pt,{size:"xs",value:e,onChange:c=>r(c||"modifiedAt"),data:[{value:"slug",label:"A-Z"},{value:"newest",label:"Newest"},{value:"oldest",label:"Oldest"},{value:"modifiedAt",label:"Last modified"}]})]}),f("div",{className:"CollectionPage__collection__docsTab__controls__newDoc",children:f(X,{color:"dark",size:"xs",leftIcon:f(ku,{size:16}),onClick:()=>n(!0),children:"New"})})]})]}),f("div",{className:"CollectionPage__collection__docsTab__content",children:i?f("div",{className:"CollectionPage__collection__docsTab__content__loading",children:f(Re,{color:"gray",size:"xl"})}):l.length===0?f("div",{class:"CollectionPage__collection__docsEmpty",children:[f("div",{class:"CollectionPage__collection__docsEmpty__icon",children:f(Vwe,{})}),f("div",{class:"CollectionPage__collection__docsEmpty__title",children:"Collection is empty."}),f("div",{class:"CollectionPage__collection__docsEmpty__button",children:f(X,{color:"dark",size:"xs",leftIcon:f(ku,{size:16}),onClick:()=>n(!0),children:"New"})})]}):f(Zu.DocsList,{collection:t.collection,docs:l,reloadDocs:()=>s()})})]})})})]})]})};Zu.DocsList=t=>{let e=t.collection,r=window.__ROOT_CTX.collections[t.collection];if(!r)throw new Error(`could not find collection: ${e}`);let o=t.docs||[];function n(a){return Jn({collectionId:e,slug:a})}return f("div",{className:"CollectionPage__collection__docsList",children:o.map(a=>{let i=`/cms/content/${e}/${a.slug}`,s=n(a.slug),l=a.fields||{},c=oo(l,r.preview?.title||"meta.title"),u=oo(l,r.preview?.image||"meta.image")||r.preview?.defaultImage;return f("div",{className:"CollectionPage__collection__docsList__doc",children:[f("div",{className:"CollectionPage__collection__docsList__doc__image",children:f("a",{href:i,children:f(Tn,{src:u?.src,width:120,height:90,withPlaceholder:!u?.src})})}),f("a",{className:"CollectionPage__collection__docsList__doc__content",href:i,children:[f("div",{className:"CollectionPage__collection__docsList__doc__content__header",children:[f("div",{className:"CollectionPage__collection__docsList__doc__content__header__docId",children:a.id}),f(Wu,{doc:a})]}),f("div",{className:"CollectionPage__collection__docsList__doc__content__title",children:c||"[UNTITLED]"}),f("div",{className:"CollectionPage__collection__docsList__doc__content__url",children:s})]}),f("div",{className:"CollectionPage__collection__docsList__doc__controls",children:f(_y,{docId:a.id,data:a,onAction:d=>{(d.action==="delete"||d.action==="unpublish")&&t.reloadDocs()}})})]},a.id)})})};function Vwe(){return f("svg",{width:"165",height:"142",viewBox:"0 0 165 142",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("path",{d:"M85.3227 123.613C119.114 123.613 146.509 96.2184 146.509 62.3067C146.509 28.3949 118.993 1 85.3227 1C51.5316 1 24.1367 28.3949 24.1367 62.3067C24.1367 96.2184 51.5316 123.613 85.3227 123.613Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M154.276 42.8823C157.009 42.8823 159.224 40.667 159.224 37.9343C159.224 35.2016 157.009 32.9863 154.276 32.9863C151.543 32.9863 149.328 35.2016 149.328 37.9343C149.328 40.667 151.543 42.8823 154.276 42.8823Z",fill:"#f5f5f5"}),f("path",{d:"M161.516 23.5733C163.383 23.5733 164.895 22.0604 164.895 20.1942C164.895 18.3279 163.383 16.8151 161.516 16.8151C159.65 16.8151 158.137 18.3279 158.137 20.1942C158.137 22.0604 159.65 23.5733 161.516 23.5733Z",fill:"#f5f5f5"}),f("path",{d:"M26.9123 22.1192C28.7785 22.1192 30.2914 20.6064 30.2914 18.7401C30.2914 16.8739 28.7785 15.361 26.9123 15.361C25.0461 15.361 23.5332 16.8739 23.5332 18.7401C23.5332 20.6064 25.0461 22.1192 26.9123 22.1192Z",fill:"#f5f5f5"}),f("path",{d:"M6.27549 87.288C9.74134 87.288 12.551 84.4784 12.551 81.0126C12.551 77.5467 9.74134 74.7371 6.27549 74.7371C2.80963 74.7371 0 77.5467 0 81.0126C0 84.4784 2.80963 87.288 6.27549 87.288Z",fill:"#f5f5f5"}),f("path",{d:"M121.099 107.854H138.619C140.82 107.854 142.706 105.969 142.706 103.769V22.0726C142.706 19.873 140.82 17.9877 138.619 17.9877H121.643",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M51.5361 107.854H34.5596C32.3589 107.854 30.4727 105.969 30.4727 103.769V22.0726C30.4727 19.873 32.3589 17.9877 34.5596 17.9877H51.1864",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M42.2832 34.327H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M42.2832 45.3246H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M42.2832 56.6365H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M42.2832 67.9485H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M42.2832 89.9436H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M129.816 34.327H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M129.816 45.3246H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M129.816 56.6365H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M129.816 67.9485H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M129.816 89.9436H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M117.556 114.767H55.3086C53.108 114.767 51.2217 112.881 51.2217 110.682V15.7883C51.2217 13.5888 53.108 11.7035 55.3086 11.7035H117.556C119.756 11.7035 121.643 13.5888 121.643 15.7883V110.682C121.643 112.881 119.756 114.767 117.556 114.767Z",fill:"white",stroke:"#e5e5e5","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M110.01 42.4468H66.6261C65.683 42.4468 65.0542 41.8773 65.0542 41.0231V37.3217C65.0542 36.4675 65.683 35.898 66.6261 35.898H110.01C110.954 35.898 111.582 36.4675 111.582 37.3217V41.0231C111.582 41.5926 110.954 42.4468 110.01 42.4468Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M110.01 59.4146H66.6261C65.683 59.4146 65.0542 58.8451 65.0542 57.9909V54.2894C65.0542 53.4352 65.683 52.8658 66.6261 52.8658H110.01C110.954 52.8658 111.582 53.4352 111.582 54.2894V57.9909C111.582 58.8451 110.954 59.4146 110.01 59.4146Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M110.01 76.6964H66.6261C65.683 76.6964 65.0542 76.127 65.0542 75.2728V71.5713C65.0542 70.7171 65.683 70.1476 66.6261 70.1476H110.01C110.954 70.1476 111.582 70.7171 111.582 71.5713V75.2728C111.582 76.127 110.954 76.6964 110.01 76.6964Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M110.011 94.2926H92.7198C91.7767 94.2926 91.1479 93.7231 91.1479 92.8689V89.1674C91.1479 88.3132 91.7767 87.7438 92.7198 87.7438H110.011C110.954 87.7438 111.583 88.3132 111.583 89.1674V92.8689C111.583 93.7231 110.954 94.2926 110.011 94.2926Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M105.548 125.569C105.155 127.237 104.566 129.003 103.879 130.475C102.015 134.106 99.0712 136.952 95.4405 138.816C91.7116 140.681 87.2959 141.466 82.8801 140.484C72.4786 138.326 65.8059 128.12 67.9647 117.719C70.1235 107.317 80.2307 100.546 90.6322 102.803C94.3611 103.588 97.5993 105.453 100.347 108.004C104.959 112.616 106.921 119.289 105.548 125.569Z",fill:"#d4d4d4",stroke:"#a3a3a3","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M92.8892 118.976H89.4735V115.56C89.4735 114.163 88.377 112.892 86.8053 112.892C85.4087 112.892 84.1371 113.988 84.1371 115.56V118.976H80.7214C79.3248 118.976 78.0532 120.072 78.0532 121.644C78.0532 122.374 78.3129 123.054 78.8122 123.553C79.3116 124.052 79.9912 124.312 80.7214 124.312H84.1371V127.728C84.1371 129.124 85.2337 130.396 86.8053 130.396C88.2019 130.396 89.4735 129.299 89.4735 127.728V124.312H92.8892C94.2858 124.312 95.5574 123.215 95.5574 121.644C95.5574 120.072 94.2858 118.976 92.8892 118.976Z",fill:"white",stroke:"#a3a3a3","stroke-width":"2"})]})}function OH(){let[t,e]=P(!0),[r,o]=P(null),[n,a]=P(null);return L(()=>{let i=new URLSearchParams(window.location.search),s=PH(i.get("left")||""),l=PH(i.get("right")||"");o(s),a(l),e(!1)},[]),f(me,{children:f("div",{className:"ComparePage",children:t?f(Re,{}):r&&n?f(Vb,{className:"ComparePage__diff",left:r,right:n}):f("div",{className:"ComparePage__error",children:"Invalid params, double check query params."})})})}function PH(t){let[e,r]=String(t).split("@");return e&&r?{docId:e,versionId:r}:null}async function AH(t,e){if(!t)throw new Error("missing data source id");let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,"DataSources",t);await vu(n,{...e,id:t,createdAt:Ut(),createdBy:window.firebase.user.email}),Je("datasource.create",{metadata:{datasourceId:t}})}async function DH(){let t=window.__ROOT_CTX.rootConfig.projectId,e=window.firebase.db,r=nn(e,"Projects",t,"DataSources"),o=to(r),n=await an(o),a=[];return n.forEach(i=>{a.push(i.data())}),a}async function Ju(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,"DataSources",t),n=await vr(o);return n.exists()?n.data():null}async function Bk(t,e){let r=e?.mode||"draft",o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,a=we(n,"Projects",o,"DataSources",t,"Data",r),i=await vr(a);return i.exists()?i.data():null}async function RH(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,"DataSources",t);await rr(n,e),Je("datasource.save",{metadata:{datasourceId:t}})}async function NH(t){let e=await Ju(t);if(!e)throw new Error(`data source not found: ${t}`);if(e.type==="http"&&e.url&&!BH(e.url)){let r=await fetch("/cms/api/data.sync",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:e.id})});if(r.status!==200){let o=await r.text();throw new Error(`sync failed: ${o}`)}}else{let r=await Hwe(e),o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,a=we(n,"Projects",o,"DataSources",t),i=we(n,"Projects",o,"DataSources",t,"Data","draft"),s={...e,syncedAt:Ze.now(),syncedBy:window.firebase.user.email},l=sn(n);l.set(i,{dataSource:s,data:r}),l.update(a,{syncedAt:Ze.now(),syncedBy:window.firebase.user.email}),await l.commit()}console.log(`synced data source: ${t}`),Je("datasource.sync",{metadata:{datasourceId:t}})}async function MH(t){let e=await Ju(t);if(!e)throw new Error(`data source not found: ${t}`);let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,"DataSources",t),a=we(o,"Projects",r,"DataSources",t,"Data","draft"),i=we(o,"Projects",r,"DataSources",t,"Data","published"),s=await Bk(t,{mode:"draft"}),l={...e,publishedAt:Ze.now(),publishedBy:window.firebase.user.email},c=sn(o);c.set(i,{dataSource:l,data:s?.data||null}),c.update(a,{dataSource:l}),c.update(n,{publishedAt:Ze.now(),publishedBy:window.firebase.user.email}),await c.commit(),console.log(`published data ${t}`),Je("datasource.publish",{metadata:{datasourceId:t}})}async function LH(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,"DataSources",t),n=we(r,"Projects",e,"DataSources",t,"Data","draft"),a=we(r,"Projects",e,"DataSources",t,"Data","published"),i=sn(r);i.delete(n),i.delete(a),i.delete(o),await i.commit(),console.log(`deleted data source ${t}`),Je("datasource.delete",{metadata:{datasourceId:t}})}async function Hwe(t){if(t.type==="http")return await jwe(t);if(t.type==="gsheet")return await $we(t);throw new Error(`unsupported data source: ${t.type}`)}async function $we(t){let e=Ki(t.url);if(!e?.spreadsheetId)throw new Error(`failed to parse google sheet url: ${t.url}`);let o=await new ka(e.spreadsheetId).getSheet(e.gid??0);if(!o)throw new Error(`could not find sheet: ${t.url}`);return(t.dataFormat||"map")==="array"?await o.getValues():await o.getValuesMap()}async function jwe(t){if(!BH(t.url))throw new Error(`unsupported url: ${t.url}`);let e=await fetch(t.url,{method:t.httpOptions?.method||"GET",headers:t.httpOptions?.headers||[],body:t.httpOptions?.body||void 0});if(e.status!==200){let o=await e.text();throw new Error(`req failed: ${o}`)}return String(e.headers.get("content-type")).includes("application/json")?await e.json():e.text()}function BH(t){return t&&t.startsWith("/")}function FH(t){let e=Gwe(t.timestamp),[r,o]=P(t.timestamp?Rn(e,{style:"short"}):"never");return e?(L(()=>{let n=window.setInterval(()=>{o(Rn(e,{style:"short"}))},6e4);return()=>window.clearInterval(n)},[]),f(xe,{transition:"pop",label:`${qwe(e)} by ${t.email}`,children:Rn(e,{style:"short"})})):f("div",{children:r})}function qwe(t){return new Date(t).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Gwe(t){return typeof t=="number"?t:t?t.toMillis():0}function ed(t){let e=t.dataSource,[r,o]=P(!1),[n,a]=P(t.action==="sync"?e.syncedAt:e.publishedAt),[i,s]=P(t.action==="sync"?e.syncedBy:e.publishedBy),l=Xi();async function c(){o(!0);let d=`data-source-${t.action}-${e.id}`;pe({id:d,loading:!0,title:`Running Data Source ${t.action}`,message:`Updating ${e.id}...`,autoClose:!1,disallowClose:!0});try{t.action==="sync"?(e.type==="gsheet"&&!l.isLoggedIn()&&await l.login(),await NH(e.id)):t.action==="publish"&&await MH(e.id),a(Ze.now()),s(window.firebase.user.email),o(!1),t.onAction&&t.onAction(),at({id:d,title:"Success",message:`Updated Data Source ${e.id}`,autoClose:!1})}catch(p){console.error(p);let m=p;typeof p=="object"&&p.body&&(m=String(p.body)),o(!1),at({id:d,title:`Data Source ${t.action} failed`,message:String(m),color:"red",autoClose:!1})}}let u="";return t.action==="sync"?u="Sync data to a draft state":t.action==="publish"&&(u="Publish synced data to prod"),f("div",{className:"DataSourceStatusButton",children:[f("div",{className:"DataSourceStatusButton__label",children:!r&&f(FH,{timestamp:n,email:i})}),f("div",{className:"DataSourceStatusButton__button",children:f(xe,{transition:"pop",label:u,children:f(X,{variant:"default",size:"xs",compact:!0,onClick:()=>c(),loading:r,children:t.action})})})]})}function yy(){return f(me,{children:f("div",{className:"DataPage",children:[f("div",{className:"DataPage__header",children:[f(Te,{size:"h1",children:"Data Sources"}),f(Me,{as:"p",children:"Add data sources to sync data from external services, like Google Sheets."}),f("div",{className:"DataPage__header__buttons",children:f(X,{component:"a",color:"blue",size:"xs",href:"/cms/data/new",children:"New data source"})})]}),f(yy.DataSourcesTable,{})]})})}yy.DataSourcesTable=()=>{let[t,e]=P(!0),[r,o]=P([]);async function n(){let a=await DH();o(a),e(!1)}return L(()=>{n()},[]),f("div",{className:"DataPage__DataSourcesTable",children:[t&&f(Re,{color:"gray",size:"xl"}),r.length>0&&f(kr,{verticalSpacing:"xs",striped:!0,highlightOnHover:!0,fontSize:"xs",children:[f("thead",{children:f("tr",{children:[f("th",{children:"id"}),f("th",{children:"description"}),f("th",{children:"type"}),f("th",{children:"url"}),f("th",{children:"last synced"}),f("th",{children:"last published"})]})}),f("tbody",{children:r.map(a=>f("tr",{children:[f("td",{children:f("a",{href:`/cms/data/${a.id}`,children:a.id})}),f("td",{children:a.description||""}),f("td",{children:a.type}),f("td",{children:a.url}),f("td",{children:f(ed,{dataSource:a,action:"sync"})}),f("td",{children:f(ed,{dataSource:a,action:"publish"})})]},a.id))})]})]})};function fn(t){let[e,r]=P(!0),[o,n]=P(null),[a,i]=P(null),s=t.id;async function l(){let u=await Ju(s);if(n(u),u){let d=await Bk(s,{mode:"draft"});i(d)}r(!1)}L(()=>{l()},[]);function c(u){u==="sync"&&l()}return f(me,{children:f("div",{className:"DataSourcePage",children:[f("div",{className:"DataSourcePage__header",children:[f(_r,{className:"DataSourcePage__header__breadcrumbs",children:[f("a",{href:"/cms/data",children:"Data"}),f("div",{children:s})]}),f("div",{className:"DataSourcePage__header__titleWrap",children:[f(Te,{size:"h1",children:["Data Source: ",s]}),f("div",{className:"DataSourcePage__header__controls",children:f(xe,{label:"Configure",children:f(Fe,{component:"a",href:`/cms/data/${t.id}/edit`,children:f(wl,{size:24,stroke:"1.5"})})})})]}),o?.description&&f(Me,{as:"p",children:o.description})]}),o&&f(fn.SyncStatus,{dataSource:o,onAction:c}),e?f(Re,{color:"gray",size:"xl"}):o?f(fn.DataSection,{dataSource:o,data:a}):f("div",{className:"DataSourcePage__notFound",children:"Not Found"})]})})}fn.SyncStatus=t=>{let e=t.dataSource;return f("div",{className:"DataSourcePage__SyncStatus",children:[f(Te,{size:"h2",children:"Status"}),f(kr,{verticalSpacing:"xs",striped:!0,highlightOnHover:!0,fontSize:"xs",children:[f("thead",{children:f("tr",{children:[f("th",{children:"last synced"}),f("th",{children:"last published"})]})}),f("tbody",{children:f("tr",{children:[f("td",{children:f(ed,{dataSource:e,action:"sync",onAction:()=>{t.onAction&&t.onAction("sync")}})}),f("td",{children:f(ed,{dataSource:e,action:"publish"})})]})})]})]})};fn.DataSection=t=>{let{data:e}=t.data||{},r=t.dataSource;if(!e)return null;let o=r.dataFormat||"map";if(r.type==="gsheet"){let n,a=[];if(o==="array")a=e;else if(o==="map"){let i=new Set,s=e;s.forEach(l=>{for(let c in l)c&&i.add(c)}),n=Array.from(i),s.forEach(l=>{a.push(n.map(c=>l[c]||""))})}return f(fn.DataSectionWrap,{dataSource:r,children:f(fn.DataTable,{headers:n,rows:a})})}return r.type==="http"?f(fn.DataSectionWrap,{dataSource:r,children:f(fn.DefaultDataDisplay,{data:e})}):(console.log(`unsupported data type: ${r.type}`),null)};fn.DataSectionWrap=t=>f("div",{className:"DataSourcePage__DataSection",children:[f("div",{className:"DataSourcePage__DataSection__header",children:[f(Te,{size:"h2",children:"Data"}),f("div",{className:"DataSourcePage__DataSection__header__actions",children:[t.dataSource.url?.startsWith("https://docs.google.com/spreadsheets/")&&f(xe,{label:"Open spreadsheet",children:f(Fe,{component:"a",href:t.dataSource.url,target:"_blank",variant:"filled",color:"green",children:f(El,{size:16,stroke:"2.25"})})}),t.dataSource.previewUrl&&f(X,{component:"a",variant:"default",size:"xs",href:t.dataSource.previewUrl,target:"_blank",children:"Preview"})]})]}),t.children]});fn.DataTable=t=>{let e=t.headers||[],r=t.rows||[];return f("div",{className:"DataSourcePage__DataTable",children:f(kr,{className:"DataSourcePage__DataTable__table",verticalSpacing:"xs",striped:!0,highlightOnHover:!0,fontSize:"xs",children:[e.length>0&&f("thead",{children:f("tr",{children:e.map(o=>f("th",{children:o},o))})}),f("tbody",{children:r.map((o,n)=>f("tr",{children:o.map((a,i)=>f("td",{children:a},i))},n))})]})})};fn.DefaultDataDisplay=t=>{let e=t.data;return typeof e=="object"?f(Mc,{value:JSON.stringify(e,null,2),minRows:20,maxRows:100}):f(Zt,{value:String(e),minRows:12,maxRows:100})};function os(t){let[e,r]=P(!0),[o,n]=P(!1),[a,i]=P([]),[s,l]=P({}),[c,u]=P(null),[d,p]=P(!1),[m,h]=P({}),[g,_]=P(!1),x=t.collection,b=t.slug,y=`${x}/${b}`,w=(window.__ROOT_CTX.rootConfig.i18n||{}).locales||["en"];async function v(){try{let[S,C,F]=await Promise.all([Eb(y),ji(),mb(y)]);i(S),l(C),u(F),r(!1)}catch(S){console.error(S),r(!1),n(!0)}}if(L(()=>{v()},[]),o)return f(os.NotFound,{docId:y});function T(S,C,F){p(!0),h(N=>{let R={...N},z=R[S]??{};return z.source=S,z[C]=F,R[S]=z,R})}async function O(){_(!0),await bt(async()=>{console.log("EditTranslationsModal.onSave()");let S=`edit-translations-${y}`;pe({id:S,loading:!0,title:"Saving translations",message:`Updating for ${y}...`,autoClose:!1,disallowClose:!0});let C=Object.values(m);console.log(C),await gl(y,C),at({id:S,title:"Saved translations",message:`Updated translations for ${y}!`,autoClose:!0}),h({}),p(!1)}),_(!1)}return f(me,{children:f("div",{className:"DocTranslationsPage",children:[f("div",{className:"DocTranslationsPage__header",children:[f(_r,{className:"DocTranslationsPage__header__breadcrumbs",children:[f("a",{href:`/cms/content/${x}`,children:x}),f("a",{href:`/cms/content/${x}/${b}`,children:b}),f("div",{children:"translations"})]}),f("div",{className:"DocTranslationsPage__header__titleWrap",children:f(Te,{size:"h1",children:["Translations: ",y]})}),c&&f("div",{className:"DocTranslationsPage__header__linkedSheet",children:[f("div",{className:"DocTranslationsPage__header__linkedSheet__label",children:[f("strong",{children:"NOTE:"})," Translations for this doc are managed in Google Sheets."]}),f("div",{className:"DocTranslationsPage__header__linkedSheet__controls",children:[f(xe,{label:"Open Google Sheet",children:f(Fe,{component:"a",href:Mn(c),target:"_blank",variant:"filled",color:"green",size:"sm",children:f(El,{size:16,strokeWidth:2.25})})}),f(X,{variant:"default",size:"xs",leftIcon:f(ti,{size:16,strokeWidth:1.75}),children:"Import from Sheet"}),f(X,{variant:"default",size:"xs",leftIcon:f(bl,{size:16,strokeWidth:1.75}),children:"Export to Sheet"})]})]})]}),f("div",{className:ke("DocTranslationsPage__content",e&&"DocTranslationsPage__content--loading"),children:e?f(Re,{color:"gray",size:"xl"}):f(os.Table,{locales:w,sourceStrings:a,translationsMap:s,onChange:T,changesMap:m})}),f("div",{className:"DocTranslationsPage__footer",children:f("div",{className:"DocTranslationsPage__footer__buttons",children:f(X,{variant:"filled",color:"dark",disabled:!d,loading:g,onClick:()=>O(),children:"Save"})})})]})})}os.NotFound=t=>f(me,{children:f("div",{className:"DocTranslationsPage DocTranslationsPage--error",children:f("div",{className:"DocTranslationsPage__error",children:[f("div",{className:"DocTranslationsPage__error__icon",children:f(jp,{size:60})}),f("div",{className:"DocTranslationsPage__error__title",children:["Not found: ",t.docId]})]})})});os.Table=t=>{let e=Tt(()=>{let o={};return Object.values(t.translationsMap).forEach(n=>{o[n.source]=n}),o},[t.translationsMap]);function r(o,n){return{translation:(e[o]||{})[n]||"",hasChanges:!1}}return f("div",{className:"DocTranslationsPage__TableWrap",children:f("table",{className:"DocTranslationsPage__Table",children:[f("thead",{children:f("tr",{children:[f("th",{children:"source"}),t.locales.map(o=>f("th",{children:o},o))]})}),f("tbody",{children:t.sourceStrings.map(o=>f("tr",{children:[f("td",{className:"DocTranslationsPage__Table__sourceCellWrap",children:f("div",{className:"DocTranslationsPage__Table__sourceCell",children:o})}),t.locales.map(n=>{let a=r(o,n);return f("td",{children:f(os.Textarea,{source:o,locale:n,value:a.translation,onChange:t.onChange,changesMap:t.changesMap})},n)})]},o))})]})})};os.Textarea=t=>{let e=H(null),[r,o]=P(t.value),n=null;t.locale in(t.changesMap[t.source]||{})&&(n=t.changesMap[t.source][t.locale]);let a=n!==null&&n!==t.value;function i(){window.requestAnimationFrame(()=>{let s=e.current;s.style.minHeight="auto";let l=s.scrollHeight;s.style.minHeight=`${l}px`})}return L(()=>{i()},[r]),f("textarea",{ref:e,className:ke("DocTranslationsPage__Textarea",a&&"DocTranslationsPage__Textarea--hasChanges",!r&&"DocTranslationsPage__Textarea--empty"),onFocus:()=>i(),rows:1,onChange:s=>{let l=s.target.value;o(l),t.onChange(t.source,t.locale,l)},value:r})};function zH(t,e){let r;return(...o)=>{window.clearTimeout(r),r=window.setTimeout(()=>{t(...o)},e)}}var ns=class{constructor(){this.events=new Map}on(e,r){let o=this.events.get(e)??[];return this.events.set(e,[...o,r]),()=>{this.off(e,r)}}off(e,r){let o=this.events.get(e)??[],n=o.indexOf(r);n>=0&&o.splice(n,1)}dispatch(e,...r){(this.events.get(e)??[]).forEach(n=>n(...r))}dispose(){this.events.clear()}};var UH=3*Tr.second,Wwe=5*Tr.minute;var Fk=class extends ns{constructor(r){super();this.pendingUpdates=new Map;this.cachedData={};this.subscribers={};this.saveState="NO_CHANGES";this.autolock=!1;this.autolockReason="autolock";this.autolockApplied=!1;this.started=!1;this.queueChanges=zH(()=>this.flush(),UH);this.projectId=window.__ROOT_CTX.rootConfig.projectId;let[o,n]=r.split("/");this.docId=r,this.collectionId=o,this.slug=n,this.db=window.firebase.db,this.docRef=we(this.db,"Projects",this.projectId,"Collections",o,"Drafts",n);let a=window.__ROOT_CTX.collections[o];a&&(this.autolock=!!a.autolock,a.autolockReason&&(this.autolockReason=a.autolockReason))}async start(){this.started||(this.started=!0,this.dbUnsubscribe=tb(this.docRef,r=>{let o=r.data();this.pendingUpdates.size>0&&vy(o,Object.fromEntries(this.pendingUpdates)),this.cachedData=o,this.notifySubscribers()}))}stop(){this.started&&(this.dbUnsubscribe&&this.dbUnsubscribe(),this.flush(),this.started=!1)}onChange(r){return this.on("CHANGE",r)}onSaveStateChange(r){return this.on("SAVE_STATE_CHANGE",r)}onFlush(r){return this.on("FLUSH",r)}subscribe(r,o){return this.subscribers[r]??=new Set,this.subscribers[r].add(o),o(this.getValue(r)),()=>{this.subscribers[r].delete(o),this.subscribers[r].size===0&&delete this.subscribers[r]}}notifySubscribers(){let r=this.cachedData;this.dispatch("CHANGE",r),VH(this.subscribers,r)}getValue(r){return oo(this.cachedData,r)}async updateKey(r,o){await this.updateKeys({[r]:o})}async updateKeys(r){for(let o in r)this.pendingUpdates.set(o,r[o]);vy(this.cachedData,r),this.dispatch("CHANGE",this.cachedData),this.setSaveState("UPDATE_PENDING"),this.queueChanges()}async removeKey(r){this.pendingUpdates.set(r,zr()),vy(this.cachedData,{[r]:void 0}),this.dispatch("CHANGE",this.cachedData),this.setSaveState("UPDATE_PENDING"),this.queueChanges()}setSaveState(r){let o=this.saveState;r==="SAVED"&&o!=="SAVING"||(this.saveState=r,r==="SAVED"&&window.setTimeout(()=>{this.saveState==="SAVED"&&this.setSaveState("NO_CHANGES")},UH),this.dispatch("SAVE_STATE_CHANGE",r))}async flush(){if(this.pendingUpdates.size===0)return;let r=Object.fromEntries(this.pendingUpdates);r["sys.modifiedAt"]=Ut(),r["sys.modifiedBy"]=window.firebase.user.email,this.autolock&&!this.autolockApplied&&!this.cachedData?.sys?.publishingLocked&&(this.autolockApplied=!0,r["sys.publishingLocked"]={lockedAt:Ut(),lockedBy:window.firebase.user.email,reason:this.autolockReason}),this.pendingUpdates.clear();try{this.setSaveState("SAVING"),await rr(this.docRef,r),this.setSaveState("SAVED"),this.dispatch("FLUSH"),Je("doc.save",{metadata:{docId:this.docId},throttle:Wwe,throttleId:this.docId})}catch(o){console.error("failed to update doc"),console.error(o),this.setSaveState("ERROR"),pe({title:"Failed to save",message:`Failed to save changes to ${this.slug}`,color:"red",autoClose:!1});for(let n in r)n.startsWith("sys.")||this.pendingUpdates.has(n)||(this.pendingUpdates.set(n,r[n]),this.queueChanges(),console.log("re-queued updates"))}}getLocales(){return this.cachedData&&this.cachedData.sys?.locales?this.cachedData.sys.locales:["en"]}setLocales(r){this.updateKey("sys.locales",r)}async dispose(){super.dispose(),this.stop()}};function vy(t,e){for(let r in e){let o=e[r];if(r.includes(".")){let[n,a]=Kwe(r);t[n]??={},vy(t[n],{[a]:o})}else typeof o>"u"?delete t[r]:t[r]=o}}function VH(t,e,r){r||(r=[]);for(let o in e){let n=[...r,o],a=n.join("."),i=t[a],s=e[o];i&&Array.from(i).forEach(l=>{l(s)}),Bp(s)&&VH(t,s,n)}}function Kwe(t){let e=t.indexOf("."),r=t.substring(0,e),o=t.substring(e+1);return[r,o]}function HH(t){let[e,r]=P(!0),[o,n]=P({}),a=Tt(()=>new Fk(t),[t]),[i,s]=P("NO_CHANGES");return L(()=>{a.onChange(c=>{n(c),r(!1),Lp(t,c)}),a.onSaveStateChange(c=>s(c)),a.start();let l=()=>{document.hidden||document.visibilityState!=="visible"?a.stop():a.started||(r(!0),a.start())};return document.addEventListener("visibilitychange",l),()=>{a.dispose(),document.removeEventListener("visibilitychange",l)}},[t]),{loading:e,saveState:i,controller:a,data:o}}function $H(t,e){let r=zk(t);for(let o of r)if(e[o]){let n=String(e[o]);t=t.replaceAll(`{${o}}`,n)}return t}function zk(t){return Array.from(t.matchAll(/\{(.+?)\}/g)).map(e=>e[1])}var Uk=class{constructor(){this.value=null}set(e){this.value=e}},Xwe=new Uk;function jH(){return Xwe}function qH(t,e){let r=!1;return(...o)=>{r||(t(...o),r=!0,setTimeout(()=>{r=!1},e))}}var lm=class extends ns{constructor(r){super();this.interval=0;this.timeout=0;this.interval=r}start(){this.timeout=window.setTimeout(()=>{this.tick()},this.interval)}tick(){this.dispatch("tick"),this.start()}reset(){this.stop(),this.start()}stop(){this.timeout&&(window.clearTimeout(this.timeout),this.timeout=0)}};var Ywe=30*Tr.second,GH=5*Tr.minute,Vk=class extends ns{constructor(r){super();this.started=!1;this.timer=new lm(Ywe);this.idleTimer=new lm(GH);this.onUserInteraction=qH(()=>{this.idleTimer.reset()},5e3);this.id=r;let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db;this.docRef=we(n,"Projects",o,"Viewers",r),this.timer.on("tick",()=>this.onTick()),this.idleTimer.on("tick",()=>this.onIdle()),window.addEventListener("mousemove",this.onUserInteraction),window.addEventListener("keypress",this.onUserInteraction)}async start(){this.started||(this.started=!0,this.dbUnsubscribe=tb(this.docRef,r=>{let o=r.data();this.onData(o)}),this.onTick(),this.timer.start())}onData(r){let o=window.firebase.user,n=Ze.now(),a=Object.values(r).filter(i=>!(i.email===o.email||n.toMillis()-i.lastViewedAt.toMillis()>GH));this.dispatch("change",a)}async onTick(){let r=window.firebase.user;if(!r.email){console.log("no user email:",r);return}console.log(`updating lastViewedAt for ${r.email}`),await vu(this.docRef,{[r.email]:{email:r.email,photoURL:r.photoURL,lastViewedAt:Ut()}},{merge:!0})}async onIdle(){this.stop()}stop(){this.started&&(this.dbUnsubscribe&&this.dbUnsubscribe(),this.timer.stop(),this.idleTimer.stop(),this.onDisconnect(),this.started=!1)}async onDisconnect(){let r=window.firebase.user;if(!r.email){console.log("no user email:",r);return}let o=new No(r.email,"disconnectedAt");await rr(this.docRef,o,Ut())}async dispose(){super.dispose(),this.stop(),this.timer.dispose(),this.idleTimer.dispose()}};function WH(t){let e=$i(t.id),[r,o]=P([]);if(L(()=>{let a=new Vk(e);a.on("change",s=>o(s)),a.start();let i=()=>{document.hidden||document.visibilityState!=="visible"?a.stop():a.started||a.start()};return document.addEventListener("visibilitychange",i),()=>{a.dispose(),document.removeEventListener("visibilitychange",i)}},[e]),r.length===0)return null;function n(a){return a.disconnectedAt?a.disconnectedAt>a.lastViewedAt:!1}return f(ig,{className:"Viewers",limit:3,size:30,children:r.map(a=>{if(!a.photoURL){let i=a.email[0].toUpperCase();return f(kn,{alt:a.email,size:24,radius:"xl",children:i})}return f(kn,{className:ke("Viewers__viewer",n(a)&&"Viewers__viewer--disconnected"),src:a.photoURL,alt:a.email,size:24,radius:"xl"},a.email)})})}function KH(t){let r=t.field.checkboxLabel||"Enabled",[o,n]=P(!1);function a(i){n(i),t.draft.updateKey(t.deepKey,i)}return L(()=>t.draft.subscribe(t.deepKey,s=>{n(s)}),[]),f("div",{className:"DocEditor__BooleanField",children:f(Rc,{label:r,onChange:i=>{let s=i.currentTarget;a(s.checked)},checked:o,size:"xs"})})}function XH(t){let[e,r]=P("");function o(a){if(a){let i=Math.floor(new Date(a).getTime()),s=Ze.fromMillis(i);r(n(s)),t.draft.updateKey(t.deepKey,s)}else r(""),t.draft.removeKey(t.deepKey)}function n(a){let i=a.toDate();return i.setMinutes(i.getMinutes()-i.getTimezoneOffset()),i.toISOString().slice(0,16)}return L(()=>t.draft.subscribe(t.deepKey,i=>{r(i?n(i):"")}),[]),f("div",{className:"DocEditor__DateTimeField",children:[f("input",{type:"datetime-local",value:e,onChange:a=>{let s=a.target.value;o(s)}}),f("div",{className:"DocEditor__DateTimeField__timezone",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})}function QH(t){let e=t.field,[r,o]=P({}),[n,a]=P(!1),[i,s]=P(!1),l=H(null),c=H(null),u;e.exts&&(u=e.exts.join(","));async function d(){o({}),t.draft.removeKey(t.deepKey)}async function p(b){a(!0);try{let y=await Aa(b,{cacheControl:e.cacheControl,preserveFilename:e.preserveFilename});o(I=>{let w={...y};return I?.src&&YH(I.src)&&(w.alt=I?.alt||""),t.draft.updateKey(t.deepKey,w),w}),a(!1)}catch(y){console.error("file upload failed"),console.error(y),a(!1),pe({title:"File upload failed",message:"Failed to upload file: "+String(y),color:"red",autoClose:!1})}if(l.current){let y=l.current;y.value=""}}function m(b){let w=(b.target.files||[])[0];w&&p(w)}function h(b){o(y=>Object.assign({},y,{alt:b})),t.draft.updateKey(`${t.deepKey}.alt`,b)}let g=b=>{b.preventDefault(),s(!0)},_=b=>{b.preventDefault(),s(!1)},x=b=>{b.preventDefault(),s(!1);let I=(b.dataTransfer?.files||[])[0];I&&(console.log(`file dropped ("${t.deepKey}"):`,I),p(I))};return L(()=>{let b=t.draft.subscribe(t.deepKey,I=>{o(I)}),y=c.current;return document.addEventListener("dragenter",g),document.addEventListener("dragover",g),document.addEventListener("dragleave",_),document.addEventListener("drop",_),y&&y.addEventListener("drop",x),()=>{b(),document.removeEventListener("dragenter",g),document.removeEventListener("dragover",g),document.removeEventListener("dragleave",_),document.removeEventListener("drop",_),y&&y.removeEventListener("drop",x)}},[]),f("div",{className:ke("DocEditor__FileField",i&&"dragging"),ref:c,children:[r&&r.src&&f("div",{className:"DocEditor__FileField__controls",children:f(xe,{label:"Remove file",children:f(Fe,{className:"DocEditor__FileField__controls__trash",onClick:()=>d(),children:f(cn,{size:16})})})}),r&&r.src&&ZH(r.src)&&f(Qwe,{...r},r.src),r&&r.src&&JH(r.src)&&f(Zwe,{...r},r.src),r&&r.src?f(Ae,{children:[f("div",{className:"DocEditor__FileField__file",children:f(gt,{className:"DocEditor__FileField__file__url",size:"xs",radius:0,value:r.src,disabled:!0})}),YH(r.src)&&f(gt,{className:"DocEditor__FileField__file__alt",size:"xs",radius:0,value:r.alt||"",onChange:b=>{h(b.currentTarget.value)},label:"Alt text"})]}):f("div",{className:"DocEditor__FileField__noFile",children:"No file"}),f("label",{className:"DocEditor__FileField__uploadButton",role:"button","aria-disabled":n,children:[f("input",{type:"file",accept:u,onChange:m,ref:l}),f("div",{className:"DocEditor__FileField__uploadButton__icon",children:f(ti,{size:16})}),f("div",{className:"DocEditor__FileField__uploadButton__label",children:n?"Uploading...":"Upload file"})]})]})}function Qwe(t){return f("div",{className:"DocEditor__FileField__ImagePreview",children:[f("img",{src:t.src,width:t.width,height:t.height,loading:"lazy"}),t.width&&t.height&&f("div",{className:"DocEditor__FileField__ImagePreview__dimens",children:`${t.width}x${t.height}`})]})}function Zwe(t){let e={};return t.width&&t.height&&(e["--video-aspect-ratio"]=`${t.width} / ${t.height}`),f("div",{className:"DocEditor__FileField__VideoPreview",style:e,children:[f("video",{className:"DocEditor__FileField__VideoPreview__video",controls:!0,preload:"metadata",children:f("source",{src:t.src,type:`video/${am(t.src)}`})}),t.width&&t.height&&f("div",{className:"DocEditor__FileField__VideoPreview__dimens",children:`${t.width}x${t.height}`})]})}function ZH(t){if(!t)return!1;if(t.startsWith(cH))return!0;let e=am(t);return Dk.includes(e)}function JH(t){if(!t)return!1;let e=am(t);return Rk.includes(e)}function YH(t){return ZH(t)||JH(t)}var Jwe=["image/gif","image/jpeg","image/png","image/svg+xml","image/webp"];function e0e(t){return(t??Jwe).join(", ")}function e$(t){let e=t.field,[r,o]=P({}),[n,a]=P(!1),[i,s]=P(!1),l=H(null),c=H(null),u=e0e(e.exts);async function d(b){a(!0);try{let y=await Aa(b,{cacheControl:e.cacheControl});o(I=>{let w=Object.assign({},y,{alt:I?.alt||""});return t.draft.updateKey(t.deepKey,w),w}),a(!1)}catch(y){console.error("image upload failed"),console.error(y),a(!1),pe({title:"Image upload failed",message:"Failed to upload image: "+String(y),color:"red",autoClose:!1})}if(l.current){let y=l.current;y.value=""}}function p(b){let w=(b.target.files||[])[0];w&&d(w)}function m(b){o(y=>Object.assign({},y,{alt:b})),t.draft.updateKey(`${t.deepKey}.alt`,b)}function h(){o({}),t.draft.removeKey(t.deepKey)}let g=b=>{b.preventDefault(),s(!0)},_=b=>{b.preventDefault(),s(!1)},x=b=>{b.preventDefault(),s(!1);let I=(b.dataTransfer?.files||[])[0];I&&(console.log(`file dropped ("${t.deepKey}"):`,I),d(I))};return L(()=>{let b=t.draft.subscribe(t.deepKey,I=>{o(I)}),y=c.current;return document.addEventListener("dragenter",g),document.addEventListener("dragover",g),document.addEventListener("dragleave",_),document.addEventListener("drop",_),y&&y.addEventListener("drop",x),()=>{b(),document.removeEventListener("dragenter",g),document.removeEventListener("dragover",g),document.removeEventListener("dragleave",_),document.removeEventListener("drop",_),y&&y.removeEventListener("drop",x)}},[]),f("div",{className:ke("DocEditor__ImageField",i&&"dragging"),ref:c,children:[r&&r.src?f("div",{className:"DocEditor__ImageField__imagePreview",children:[f("div",{className:"DocEditor__ImageField__imagePreview__controls",children:f(xe,{label:"Remove image",children:f(Fe,{className:"DocEditor__ImageField__imagePreview__controls__trash",onClick:()=>h(),children:f(cn,{size:16})})})}),f("div",{className:"DocEditor__ImageField__imagePreview__image",children:[f("img",{src:r.gciUrl||r.src,width:r.width,height:r.height,loading:"lazy"}),f("div",{className:"DocEditor__ImageField__imagePreview__dimens",children:`${r.width}x${r.height}`})]}),f(gt,{className:"DocEditor__ImageField__imagePreview__image__url",size:"xs",radius:0,value:r.gciUrl||r.src,disabled:!0}),f(gt,{className:"DocEditor__ImageField__imagePreview__image__alt",size:"xs",radius:0,value:r.alt,label:"Alt text",onChange:b=>{m(b.currentTarget.value)}})]}):f("div",{className:"DocEditor__ImageField__noImage",children:"No image"}),f("label",{className:"DocEditor__ImageField__uploadButton",role:"button","aria-disabled":n,children:[f("input",{type:"file",accept:u,onChange:p,ref:l}),f("div",{className:"DocEditor__ImageField__uploadButton__icon",children:f(JS,{size:16})}),f("div",{className:"DocEditor__ImageField__uploadButton__label",children:n?"Uploading...":"Upload image"})]})]})}function t$(t){let e=t.field,[r,o]=P([]),n=(e.options||[]).map(i=>typeof i=="string"?{label:i,value:i}:{label:i.label??i.value??"",value:i.value??i.label??""});function a(i){t.draft.updateKey(t.deepKey,i||[]),o(i)}return L(()=>t.draft.subscribe(t.deepKey,s=>{o(s||[])}),[]),f("div",{className:"DocEditor__MultiSelectField",children:f(Og,{data:n,size:"xs",radius:0,placeholder:e.placeholder,value:r,searchable:!0,creatable:e.creatable||!1,getCreateLabel:i=>`+ Add "${i}"`,onChange:i=>a(i),dropdownComponent:"div"})})}function td(t){let e=t.field,[r,o]=P("");function n(l){if(l){let[c,u]=l.split("/");t.draft.updateKey(t.deepKey,{id:l,collection:c,slug:u})}else t.draft.removeKey(t.deepKey);o(l)}L(()=>t.draft.subscribe(t.deepKey,c=>{o(c?.id||"")}),[]);let a=Pz();function i(){let l=r?r.split("/")[0]:e.initialCollection;a.open({collections:e.collections,initialCollection:l,onChange:c=>{n(c),a.close()}})}function s(){n("")}return f("div",{className:"ReferenceField",children:[r?f("div",{className:"ReferenceField__ref",children:[f(td.Preview,{id:r}),f("div",{className:"ReferenceField__remove",children:f(xe,{label:"Remove",children:f(Fe,{className:"ReferenceField__remove__icon",onClick:()=>s(),children:f(cn,{size:16})})})})]}):f("div",{className:"ReferenceField__none",children:"None selected"}),f(X,{color:"dark",size:"xs",onClick:()=>i(),children:e.buttonLabel||"Select"})]})}td.Preview=t=>{let[e,r]=P(!0),[o,n]=P(null);async function a(){r(!0),await bt(async()=>{let i=await cb(t.id);n(i)}),r(!1)}return L(()=>{a()},[t.id]),f("div",{className:"ReferenceField__Preview",children:e?f("div",{className:"ReferenceField__Preview__loading",children:f(Re,{color:"gray",size:"sm"})}):o?f(td.DocCard,{doc:o}):f("div",{className:"ReferenceField__Preview__notfound",children:['Doc Not found: "',t.id,'" (was it deleted?). Select a new doc or remove using the trash icon to the right.']})})};td.DocCard=t=>{let e=t.doc,r=e.id||e.sys?.id||"";if(!r)return f("div",{className:"ReferenceField__DocCard ReferenceField__DocCard--error",children:JSON.stringify(e)});let o=r.split("/")[0],n=e.fields||{},a=window.__ROOT_CTX.collections[o];if(!a)throw new Error(`could not find collection: ${o}`);let i=oo(n,a.preview?.title||"meta.title"),s=oo(n,a.preview?.image||"meta.image")||a.preview?.defaultImage;return f("div",{className:"ReferenceField__DocCard",children:[f("div",{className:"ReferenceField__DocCard__image",children:f(Tn,{src:s?.src,width:80,height:60,withPlaceholder:!s?.src})}),f("div",{className:"ReferenceField__DocCard__content",children:[f("div",{className:"ReferenceField__DocCard__content__header",children:f("div",{className:"ReferenceField__DocCard__content__header__docId",children:r})}),f("div",{className:"ReferenceField__DocCard__content__title",children:i||"[UNTITLED]"})]})]})};(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ce-hint--align-start{text-align:left}.ce-hint--align-center{text-align:center}.ce-hint__description{opacity:.6;margin-top:3px}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var hm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function t0e(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:function(){return t[o]}})}),r}function Hk(){}Object.assign(Hk,{default:Hk,register:Hk,revert:function(){},__esModule:!0});Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){let e=(this.document||this.ownerDocument).querySelectorAll(t),r=e.length;for(;--r>=0&&e.item(r)!==this;);return r>-1});Element.prototype.closest||(Element.prototype.closest=function(t){let e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(e!==null);return null});Element.prototype.prepend||(Element.prototype.prepend=function(t){let e=document.createDocumentFragment();Array.isArray(t)||(t=[t]),t.forEach(r=>{let o=r instanceof Node;e.appendChild(o?r:document.createTextNode(r))}),this.insertBefore(e,this.firstChild)});Element.prototype.scrollIntoViewIfNeeded||(Element.prototype.scrollIntoViewIfNeeded=function(t){t=arguments.length===0?!0:!!t;let e=this.parentNode,r=window.getComputedStyle(e,null),o=parseInt(r.getPropertyValue("border-top-width")),n=parseInt(r.getPropertyValue("border-left-width")),a=this.offsetTop-e.offsetTop<e.scrollTop,i=this.offsetTop-e.offsetTop+this.clientHeight-o>e.scrollTop+e.clientHeight,s=this.offsetLeft-e.offsetLeft<e.scrollLeft,l=this.offsetLeft-e.offsetLeft+this.clientWidth-n>e.scrollLeft+e.clientWidth,c=a&&!i;(a||i)&&t&&(e.scrollTop=this.offsetTop-e.offsetTop-e.clientHeight/2-o+this.clientHeight/2),(s||l)&&t&&(e.scrollLeft=this.offsetLeft-e.offsetLeft-e.clientWidth/2-n+this.clientWidth/2),(a||i||s||l)&&!t&&this.scrollIntoView(c)});window.requestIdleCallback=window.requestIdleCallback||function(t){let e=Date.now();return setTimeout(function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})},1)};window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)};var r0e=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),""),h$=(t=>(t.VERBOSE="VERBOSE",t.INFO="INFO",t.WARN="WARN",t.ERROR="ERROR",t))(h$||{}),He={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,LEFT:37,UP:38,DOWN:40,RIGHT:39,DELETE:46,META:91,SLASH:191},o0e={LEFT:0,WHEEL:1,RIGHT:2,BACKWARD:3,FORWARD:4};function wm(t,e,r="log",o,n="color: inherit"){if(!("console"in window)||!window.console[r])return;let a=["info","log","warn","error"].includes(r),i=[];switch(wm.logLevel){case"ERROR":if(r!=="error")return;break;case"WARN":if(!["error","warn"].includes(r))return;break;case"INFO":if(!a||t)return;break}o&&i.push(o);let s="Editor.js 2.31.0-rc.7",l=`line-height: 1em;
|
|
143
|
+
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+dn(o.message+"",!0)+"</pre>";return r?Promise.resolve(n):n}if(r)return Promise.reject(o);throw o}}},Bl=new Mk;function yt(t,e){return Bl.parse(t,e)}yt.options=yt.setOptions=function(t){return Bl.setOptions(t),yt.defaults=Bl.defaults,wH(yt.defaults),yt};yt.getDefaults=Lk;yt.defaults=Fl;yt.use=function(...t){return Bl.use(...t),yt.defaults=Bl.defaults,wH(yt.defaults),yt};yt.walkTokens=function(t,e){return Bl.walkTokens(t,e)};yt.parseInline=Bl.parseInline;yt.Parser=si;yt.parser=si.parse;yt.Renderer=Yu;yt.TextRenderer=im;yt.Lexer=ii;yt.lexer=ii.lex;yt.Tokenizer=Xu;yt.Hooks=Ku;yt.parse=yt;var trt=yt.options,rrt=yt.setOptions,ort=yt.use,nrt=yt.walkTokens,art=yt.parseInline;var irt=si.parse,srt=ii.lex;function CH(t){let e=t.code||"",r=t.inline?yt.parseInline(e):yt.parse(e);return f("div",{className:ke("Markdown",t.className),dangerouslySetInnerHTML:{__html:r}})}function by(t){let[e,r]=P(!0),[o,n]=P(null),a=Ht(async()=>{try{let i=await Au(t);n(i)}catch(i){console.error(i),pe({title:`Failed to load collection: ${t}`,message:String(i),color:"red",autoClose:!1})}r(!1)},[t]);return L(()=>{a()},[t]),{loading:e,schema:o}}function kH(t){let e={_array:[]};return t.forEach(r=>{let o=Uwe();e._array.push(o),e[o]=r}),e}function Uwe(){let t=[],e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=e.length;for(let o=0;o<6;o++)t.push(e.charAt(Math.floor(Math.random()*r)));return t.join("")}function sm(t){let e={};return t.fields.forEach(r=>{r.id&&(r.type==="array"&&r.default&&Array.isArray(r.default)?e[r.id]=kH(r.default):r.default?e[r.id]=r.default:r.type==="object"&&(e[r.id]=sm(r)))}),e}function TH(t){let[e,r]=P(""),[o,n]=P(!1),[a,i]=P(""),s=Lt(),l=t.collection,c=window.__ROOT_CTX.collections[l];if(!c)throw new Error(`collection not found: ${l}`);let u=by(l);function d(){t.onClose&&t.onClose()}async function p(m){m.preventDefault(),n(!0),i("");let h=$i(e),g=c.slugRegex;if(!Ca(h,g)){i('Please enter a valid slug (e.g. "foo-bar-123").'),n(!1);return}let _=`${l}/${h}`;try{let x={};!u.loading&&u.schema&&(x=await sm(u.schema)),await kS(_,{fields:x})}catch(x){i(String(x)),n(!1);return}n(!1),ur(`/cms/content/${t.collection}/${h}?new=true`)}return f(Lc,{className:"NewDocModal",opened:t.opened||!1,onClose:()=>d(),title:"New",size:"500px",overlayColor:s.colorScheme==="dark"?s.colors.dark[9]:s.colors.gray[2],children:[f("div",{className:"NewDocModal__body",children:"Enter a slug for the new doc. The slug is the ID of the page and is what's used in the URL. Use only lowercase letters, numbers, and dashes."}),f("form",{onSubmit:m=>p(m),children:[f(hb,{className:"NewDocModal__slug",collectionId:l,onChange:m=>{r(m.slug)}}),a&&f("div",{className:"NewDocModal__slugError",children:a}),f("div",{className:"NewDocModal__buttons",children:[f(X,{variant:"outline",onClick:()=>d(),type:"button",size:"xs",color:"dark",children:"Cancel"}),f(X,{variant:"filled",type:"submit",size:"xs",color:"dark",loading:u.loading||o,children:"Submit"})]})]})]})}function Qu(t,e){let[r,o]=P(()=>{try{let a=window.localStorage.getItem(t);return a?JSON.parse(a):e}catch(a){return console.error(a),e}});return[r,a=>{typeof a=="function"&&(a=a(r)),window.localStorage.setItem(t,JSON.stringify(a)),o(a)}]}function li(t){let{className:e,localStorageId:r,children:o}=t,[n,a]=Qu(`root::SplitPanel:${r}`,350),[i,s]=P(!1),[l,c]=P(0),u=H(null),d=H(null);if(L(()=>{let m=()=>s(!1);window.addEventListener("mouseup",m);let h=u.current;return h&&c(h.getBoundingClientRect().left),()=>window.removeEventListener("mouseup",m)},[]),L(()=>{let m=h=>{let g=h.clientX-l;a(g)};return i&&window.addEventListener("mousemove",m),()=>window.removeEventListener("mousemove",m)},[i]),o?.length!==2)throw new Error("SplitPanel should have two <SplitPanel.Item> children.");let p={"--panel-size":`${n}px`};return f("div",{className:ke(e,"SplitPanel",i&&"dragging"),ref:u,style:p,children:[o[0],f("div",{className:"SplitPanel__divider",ref:d,onMouseDown:()=>s(!0)}),o[1]]})}li.Item=t=>f("div",{className:ke("SplitPanel__item",t.className,t.fluid?"fluid":"static"),children:t.children});function Zu(t){let[e,r]=P("");L(()=>{let a=window.__ROOT_CTX.rootConfig.projectId,i=window.__ROOT_CTX.collections,s=`root-cms::${a}::last_collection`;if(t.collection)window.localStorage.setItem(s,t.collection);else{let l=window.localStorage.getItem(s);if(l&&i[l]){ur(`/cms/content/${l}`);return}if(window.__ROOT_CTX.collections.Pages){ur("/cms/content/Pages");return}let c=Object.keys(window.__ROOT_CTX.collections)||[];if(c.length>0){let u=c[0];ur(`/cms/content/${u}`);return}console.warn("no collections")}},[t.collection]);let n=Object.keys(window.__ROOT_CTX.collections).filter(a=>e?a.toLowerCase().includes(e.toLowerCase()):!0).map(a=>({...window.__ROOT_CTX.collections[a],id:a}));return f(me,{children:f(li,{className:"CollectionPage",localStorageId:"CollectionPage",children:[f(li.Item,{className:"CollectionPage__side",children:[f("div",{className:"CollectionPage__side__title",children:"Content"}),f("div",{className:"CollectionPage__side__search",children:f("input",{type:"text",placeholder:"Search",onChange:a=>r(a.target.value)})}),f("div",{className:"CollectionPage__side__collections",children:[n.map(a=>f("a",{className:ke("CollectionPage__side__collection",a.id===t.collection&&"active"),href:`/cms/content/${a.id}`,children:[f("div",{className:"CollectionPage__side__collection__icon",children:f(yl,{size:20,strokeWidth:"1.75"})}),f("div",{className:"CollectionPage__side__collection__name",children:a.name||a.id}),a.description&&f("div",{className:"CollectionPage__side__collection__desc",children:a.description})]},a.id)),n.length===0&&f("div",{className:"CollectionPage__side__collections__empty",children:"No collections match your query."})]})]}),f(li.Item,{className:"CollectionPage__main",fluid:!0,children:t.collection?f(Zu.Collection,{collection:t.collection},t.collection):f("div",{className:"CollectionPage__main__unselected",children:[f(zS,{size:24,strokeWidth:1.75}),f("div",{className:"CollectionPage__main__unselected__title",children:"Select a collection to get started."})]})})]})})}Zu.Collection=t=>{let[e,r]=Qu(`root::CollectionPage:${t.collection}:orderBy`,"modifiedAt"),[o,n]=P(!1),a=window.__ROOT_CTX.collections[t.collection];if(!a)return ur("/cms/content"),f(Ae,{});let[i,s,l]=Su(t.collection,{orderBy:e});return f(Ae,{children:[f(TH,{collection:t.collection,opened:o,onClose:()=>n(!1)}),f("div",{className:"CollectionPage__collection",children:[f("div",{className:"CollectionPage__collection__header",children:[f("div",{className:"CollectionPage__collection__header__title",children:a.name}),a.description&&f(CH,{className:"CollectionPage__collection__header__description",code:a.description})]}),f(zc,{className:"CollectionPage__collection__tabs",active:1,children:f(zc.Tab,{label:"Docs",children:f("div",{className:"CollectionPage__collection__docsTab",children:[!i&&l.length>0&&f("div",{className:"CollectionPage__collection__docsTab__header",children:[f(Te,{className:"CollectionPage__collection__docsTab__header__title",children:a.name||t.collection}),f("div",{className:"CollectionPage__collection__docsTab__controls",children:[f("div",{className:"CollectionPage__collection__docsTab__controls__sort",children:[f("div",{className:"CollectionPage__collection__docsTab__controls__sort__label",children:"Sort:"}),f(Pt,{size:"xs",value:e,onChange:c=>r(c||"modifiedAt"),data:[{value:"slug",label:"A-Z"},{value:"newest",label:"Newest"},{value:"oldest",label:"Oldest"},{value:"modifiedAt",label:"Last modified"}]})]}),f("div",{className:"CollectionPage__collection__docsTab__controls__newDoc",children:f(X,{color:"dark",size:"xs",leftIcon:f(ku,{size:16}),onClick:()=>n(!0),children:"New"})})]})]}),f("div",{className:"CollectionPage__collection__docsTab__content",children:i?f("div",{className:"CollectionPage__collection__docsTab__content__loading",children:f(Re,{color:"gray",size:"xl"})}):l.length===0?f("div",{class:"CollectionPage__collection__docsEmpty",children:[f("div",{class:"CollectionPage__collection__docsEmpty__icon",children:f(Vwe,{})}),f("div",{class:"CollectionPage__collection__docsEmpty__title",children:"Collection is empty."}),f("div",{class:"CollectionPage__collection__docsEmpty__button",children:f(X,{color:"dark",size:"xs",leftIcon:f(ku,{size:16}),onClick:()=>n(!0),children:"New"})})]}):f(Zu.DocsList,{collection:t.collection,docs:l,reloadDocs:()=>s()})})]})})})]})]})};Zu.DocsList=t=>{let e=t.collection,r=window.__ROOT_CTX.collections[t.collection];if(!r)throw new Error(`could not find collection: ${e}`);let o=t.docs||[];function n(a){return Jn({collectionId:e,slug:a})}return f("div",{className:"CollectionPage__collection__docsList",children:o.map(a=>{let i=`/cms/content/${e}/${a.slug}`,s=n(a.slug),l=a.fields||{},c=oo(l,r.preview?.title||"meta.title"),u=oo(l,r.preview?.image||"meta.image")||r.preview?.defaultImage;return f("div",{className:"CollectionPage__collection__docsList__doc",children:[f("div",{className:"CollectionPage__collection__docsList__doc__image",children:f("a",{href:i,children:f(Tn,{src:u?.src,width:120,height:90,withPlaceholder:!u?.src})})}),f("a",{className:"CollectionPage__collection__docsList__doc__content",href:i,children:[f("div",{className:"CollectionPage__collection__docsList__doc__content__header",children:[f("div",{className:"CollectionPage__collection__docsList__doc__content__header__docId",children:a.id}),f(Wu,{doc:a})]}),f("div",{className:"CollectionPage__collection__docsList__doc__content__title",children:c||"[UNTITLED]"}),f("div",{className:"CollectionPage__collection__docsList__doc__content__url",children:s})]}),f("div",{className:"CollectionPage__collection__docsList__doc__controls",children:f(_y,{docId:a.id,data:a,onAction:d=>{(d.action==="delete"||d.action==="unpublish")&&t.reloadDocs()}})})]},a.id)})})};function Vwe(){return f("svg",{width:"165",height:"142",viewBox:"0 0 165 142",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f("path",{d:"M85.3227 123.613C119.114 123.613 146.509 96.2184 146.509 62.3067C146.509 28.3949 118.993 1 85.3227 1C51.5316 1 24.1367 28.3949 24.1367 62.3067C24.1367 96.2184 51.5316 123.613 85.3227 123.613Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M154.276 42.8823C157.009 42.8823 159.224 40.667 159.224 37.9343C159.224 35.2016 157.009 32.9863 154.276 32.9863C151.543 32.9863 149.328 35.2016 149.328 37.9343C149.328 40.667 151.543 42.8823 154.276 42.8823Z",fill:"#f5f5f5"}),f("path",{d:"M161.516 23.5733C163.383 23.5733 164.895 22.0604 164.895 20.1942C164.895 18.3279 163.383 16.8151 161.516 16.8151C159.65 16.8151 158.137 18.3279 158.137 20.1942C158.137 22.0604 159.65 23.5733 161.516 23.5733Z",fill:"#f5f5f5"}),f("path",{d:"M26.9123 22.1192C28.7785 22.1192 30.2914 20.6064 30.2914 18.7401C30.2914 16.8739 28.7785 15.361 26.9123 15.361C25.0461 15.361 23.5332 16.8739 23.5332 18.7401C23.5332 20.6064 25.0461 22.1192 26.9123 22.1192Z",fill:"#f5f5f5"}),f("path",{d:"M6.27549 87.288C9.74134 87.288 12.551 84.4784 12.551 81.0126C12.551 77.5467 9.74134 74.7371 6.27549 74.7371C2.80963 74.7371 0 77.5467 0 81.0126C0 84.4784 2.80963 87.288 6.27549 87.288Z",fill:"#f5f5f5"}),f("path",{d:"M121.099 107.854H138.619C140.82 107.854 142.706 105.969 142.706 103.769V22.0726C142.706 19.873 140.82 17.9877 138.619 17.9877H121.643",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M51.5361 107.854H34.5596C32.3589 107.854 30.4727 105.969 30.4727 103.769V22.0726C30.4727 19.873 32.3589 17.9877 34.5596 17.9877H51.1864",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M42.2832 34.327H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M42.2832 45.3246H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M42.2832 56.6365H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M42.2832 67.9485H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M42.2832 89.9436H50.7714",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M129.816 34.327H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M129.816 45.3246H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M129.816 56.6365H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M129.816 67.9485H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M129.816 89.9436H121.643",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10","stroke-linecap":"round"}),f("path",{d:"M117.556 114.767H55.3086C53.108 114.767 51.2217 112.881 51.2217 110.682V15.7883C51.2217 13.5888 53.108 11.7035 55.3086 11.7035H117.556C119.756 11.7035 121.643 13.5888 121.643 15.7883V110.682C121.643 112.881 119.756 114.767 117.556 114.767Z",fill:"white",stroke:"#e5e5e5","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M110.01 42.4468H66.6261C65.683 42.4468 65.0542 41.8773 65.0542 41.0231V37.3217C65.0542 36.4675 65.683 35.898 66.6261 35.898H110.01C110.954 35.898 111.582 36.4675 111.582 37.3217V41.0231C111.582 41.5926 110.954 42.4468 110.01 42.4468Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M110.01 59.4146H66.6261C65.683 59.4146 65.0542 58.8451 65.0542 57.9909V54.2894C65.0542 53.4352 65.683 52.8658 66.6261 52.8658H110.01C110.954 52.8658 111.582 53.4352 111.582 54.2894V57.9909C111.582 58.8451 110.954 59.4146 110.01 59.4146Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M110.01 76.6964H66.6261C65.683 76.6964 65.0542 76.127 65.0542 75.2728V71.5713C65.0542 70.7171 65.683 70.1476 66.6261 70.1476H110.01C110.954 70.1476 111.582 70.7171 111.582 71.5713V75.2728C111.582 76.127 110.954 76.6964 110.01 76.6964Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M110.011 94.2926H92.7198C91.7767 94.2926 91.1479 93.7231 91.1479 92.8689V89.1674C91.1479 88.3132 91.7767 87.7438 92.7198 87.7438H110.011C110.954 87.7438 111.583 88.3132 111.583 89.1674V92.8689C111.583 93.7231 110.954 94.2926 110.011 94.2926Z",fill:"#f5f5f5",stroke:"#d4d4d4","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M105.548 125.569C105.155 127.237 104.566 129.003 103.879 130.475C102.015 134.106 99.0712 136.952 95.4405 138.816C91.7116 140.681 87.2959 141.466 82.8801 140.484C72.4786 138.326 65.8059 128.12 67.9647 117.719C70.1235 107.317 80.2307 100.546 90.6322 102.803C94.3611 103.588 97.5993 105.453 100.347 108.004C104.959 112.616 106.921 119.289 105.548 125.569Z",fill:"#d4d4d4",stroke:"#a3a3a3","stroke-width":"2","stroke-miterlimit":"10"}),f("path",{d:"M92.8892 118.976H89.4735V115.56C89.4735 114.163 88.377 112.892 86.8053 112.892C85.4087 112.892 84.1371 113.988 84.1371 115.56V118.976H80.7214C79.3248 118.976 78.0532 120.072 78.0532 121.644C78.0532 122.374 78.3129 123.054 78.8122 123.553C79.3116 124.052 79.9912 124.312 80.7214 124.312H84.1371V127.728C84.1371 129.124 85.2337 130.396 86.8053 130.396C88.2019 130.396 89.4735 129.299 89.4735 127.728V124.312H92.8892C94.2858 124.312 95.5574 123.215 95.5574 121.644C95.5574 120.072 94.2858 118.976 92.8892 118.976Z",fill:"white",stroke:"#a3a3a3","stroke-width":"2"})]})}function OH(){let[t,e]=P(!0),[r,o]=P(null),[n,a]=P(null);return L(()=>{let i=new URLSearchParams(window.location.search),s=PH(i.get("left")||""),l=PH(i.get("right")||"");o(s),a(l),e(!1)},[]),f(me,{children:f("div",{className:"ComparePage",children:t?f(Re,{}):r&&n?f(Vb,{className:"ComparePage__diff",left:r,right:n}):f("div",{className:"ComparePage__error",children:"Invalid params, double check query params."})})})}function PH(t){let[e,r]=String(t).split("@");return e&&r?{docId:e,versionId:r}:null}async function AH(t,e){if(!t)throw new Error("missing data source id");let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,"DataSources",t);await vu(n,{...e,id:t,createdAt:Ut(),createdBy:window.firebase.user.email}),Je("datasource.create",{metadata:{datasourceId:t}})}async function DH(){let t=window.__ROOT_CTX.rootConfig.projectId,e=window.firebase.db,r=nn(e,"Projects",t,"DataSources"),o=to(r),n=await an(o),a=[];return n.forEach(i=>{a.push(i.data())}),a}async function Ju(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,"DataSources",t),n=await vr(o);return n.exists()?n.data():null}async function Bk(t,e){let r=e?.mode||"draft",o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db,a=we(n,"Projects",o,"DataSources",t,"Data",r),i=await vr(a);return i.exists()?i.data():null}async function RH(t,e){let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,"DataSources",t);await rr(n,e),Je("datasource.save",{metadata:{datasourceId:t}})}async function NH(t){let e=await Ju(t);if(!e)throw new Error(`data source not found: ${t}`);if(e.type==="http"&&e.url&&!BH(e.url)){let r=await fetch("/cms/api/data.sync",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:e.id})});if(r.status!==200){let o=await r.text();throw new Error(`sync failed: ${o}`)}}else{let{data:r,headers:o}=await Hwe(e),n=window.__ROOT_CTX.rootConfig.projectId,a=window.firebase.db,i=we(a,"Projects",n,"DataSources",t),s=we(a,"Projects",n,"DataSources",t,"Data","draft"),l={...e,syncedAt:Ze.now(),syncedBy:window.firebase.user.email},c=sn(a);c.set(s,{dataSource:l,data:r,...o?{headers:o}:{}}),c.update(i,{syncedAt:Ze.now(),syncedBy:window.firebase.user.email}),await c.commit()}console.log(`synced data source: ${t}`),Je("datasource.sync",{metadata:{datasourceId:t}})}async function MH(t){let e=await Ju(t);if(!e)throw new Error(`data source not found: ${t}`);let r=window.__ROOT_CTX.rootConfig.projectId,o=window.firebase.db,n=we(o,"Projects",r,"DataSources",t),a=we(o,"Projects",r,"DataSources",t,"Data","draft"),i=we(o,"Projects",r,"DataSources",t,"Data","published"),s=await Bk(t,{mode:"draft"}),l={...e,publishedAt:Ze.now(),publishedBy:window.firebase.user.email},c=sn(o);c.set(i,{dataSource:l,data:s?.data||null,...s?.headers?{headers:s.headers}:{}}),c.update(a,{dataSource:l}),c.update(n,{publishedAt:Ze.now(),publishedBy:window.firebase.user.email}),await c.commit(),console.log(`published data ${t}`),Je("datasource.publish",{metadata:{datasourceId:t}})}async function LH(t){let e=window.__ROOT_CTX.rootConfig.projectId,r=window.firebase.db,o=we(r,"Projects",e,"DataSources",t),n=we(r,"Projects",e,"DataSources",t,"Data","draft"),a=we(r,"Projects",e,"DataSources",t,"Data","published"),i=sn(r);i.delete(n),i.delete(a),i.delete(o),await i.commit(),console.log(`deleted data source ${t}`),Je("datasource.delete",{metadata:{datasourceId:t}})}async function Hwe(t){if(t.type==="http")return{data:await jwe(t)};if(t.type==="gsheet")return await $we(t);throw new Error(`unsupported data source: ${t.type}`)}async function $we(t){let e=Ki(t.url);if(!e?.spreadsheetId)throw new Error(`failed to parse google sheet url: ${t.url}`);let o=await new ka(e.spreadsheetId).getSheet(e.gid??0);if(!o)throw new Error(`could not find sheet: ${t.url}`);let n=t.dataFormat||"map",[a,i]=await o.getValues();return n==="array"?{data:[a,i],headers:a}:{data:i.map(l=>{let c={};return l.forEach((u,d)=>{let p=a[d];p&&(c[p]=String(u||""))}),c}),headers:a}}async function jwe(t){if(!BH(t.url))throw new Error(`unsupported url: ${t.url}`);let e=await fetch(t.url,{method:t.httpOptions?.method||"GET",headers:t.httpOptions?.headers||[],body:t.httpOptions?.body||void 0});if(e.status!==200){let o=await e.text();throw new Error(`req failed: ${o}`)}return String(e.headers.get("content-type")).includes("application/json")?await e.json():e.text()}function BH(t){return t&&t.startsWith("/")}function FH(t){let e=Gwe(t.timestamp),[r,o]=P(t.timestamp?Rn(e,{style:"short"}):"never");return e?(L(()=>{let n=window.setInterval(()=>{o(Rn(e,{style:"short"}))},6e4);return()=>window.clearInterval(n)},[]),f(xe,{transition:"pop",label:`${qwe(e)} by ${t.email}`,children:Rn(e,{style:"short"})})):f("div",{children:r})}function qwe(t){return new Date(t).toLocaleDateString("en",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Gwe(t){return typeof t=="number"?t:t?t.toMillis():0}function ed(t){let e=t.dataSource,[r,o]=P(!1),[n,a]=P(t.action==="sync"?e.syncedAt:e.publishedAt),[i,s]=P(t.action==="sync"?e.syncedBy:e.publishedBy),l=Xi();async function c(){o(!0);let d=`data-source-${t.action}-${e.id}`;pe({id:d,loading:!0,title:`Running Data Source ${t.action}`,message:`Updating ${e.id}...`,autoClose:!1,disallowClose:!0});try{t.action==="sync"?(e.type==="gsheet"&&!l.isLoggedIn()&&await l.login(),await NH(e.id)):t.action==="publish"&&await MH(e.id),a(Ze.now()),s(window.firebase.user.email),o(!1),t.onAction&&t.onAction(),at({id:d,title:"Success",message:`Updated Data Source ${e.id}`,autoClose:!1})}catch(p){console.error(p);let m=p;typeof p=="object"&&p.body&&(m=String(p.body)),o(!1),at({id:d,title:`Data Source ${t.action} failed`,message:String(m),color:"red",autoClose:!1})}}let u="";return t.action==="sync"?u="Sync data to a draft state":t.action==="publish"&&(u="Publish synced data to prod"),f("div",{className:"DataSourceStatusButton",children:[f("div",{className:"DataSourceStatusButton__label",children:!r&&f(FH,{timestamp:n,email:i})}),f("div",{className:"DataSourceStatusButton__button",children:f(xe,{transition:"pop",label:u,children:f(X,{variant:"default",size:"xs",compact:!0,onClick:()=>c(),loading:r,children:t.action})})})]})}function yy(){return f(me,{children:f("div",{className:"DataPage",children:[f("div",{className:"DataPage__header",children:[f(Te,{size:"h1",children:"Data Sources"}),f(Me,{as:"p",children:"Add data sources to sync data from external services, like Google Sheets."}),f("div",{className:"DataPage__header__buttons",children:f(X,{component:"a",color:"blue",size:"xs",href:"/cms/data/new",children:"New data source"})})]}),f(yy.DataSourcesTable,{})]})})}yy.DataSourcesTable=()=>{let[t,e]=P(!0),[r,o]=P([]);async function n(){let a=await DH();o(a),e(!1)}return L(()=>{n()},[]),f("div",{className:"DataPage__DataSourcesTable",children:[t&&f(Re,{color:"gray",size:"xl"}),r.length>0&&f(kr,{verticalSpacing:"xs",striped:!0,highlightOnHover:!0,fontSize:"xs",children:[f("thead",{children:f("tr",{children:[f("th",{children:"id"}),f("th",{children:"description"}),f("th",{children:"type"}),f("th",{children:"url"}),f("th",{children:"last synced"}),f("th",{children:"last published"})]})}),f("tbody",{children:r.map(a=>f("tr",{children:[f("td",{children:f("a",{href:`/cms/data/${a.id}`,children:a.id})}),f("td",{children:a.description||""}),f("td",{children:a.type}),f("td",{children:a.url}),f("td",{children:f(ed,{dataSource:a,action:"sync"})}),f("td",{children:f(ed,{dataSource:a,action:"publish"})})]},a.id))})]})]})};function fn(t){let[e,r]=P(!0),[o,n]=P(null),[a,i]=P(null),s=t.id;async function l(){let u=await Ju(s);if(n(u),u){let d=await Bk(s,{mode:"draft"});i(d)}r(!1)}L(()=>{l()},[]);function c(u){u==="sync"&&l()}return f(me,{children:f("div",{className:"DataSourcePage",children:[f("div",{className:"DataSourcePage__header",children:[f(_r,{className:"DataSourcePage__header__breadcrumbs",children:[f("a",{href:"/cms/data",children:"Data"}),f("div",{children:s})]}),f("div",{className:"DataSourcePage__header__titleWrap",children:[f(Te,{size:"h1",children:["Data Source: ",s]}),f("div",{className:"DataSourcePage__header__controls",children:f(xe,{label:"Configure",children:f(Fe,{component:"a",href:`/cms/data/${t.id}/edit`,children:f(wl,{size:24,stroke:"1.5"})})})})]}),o?.description&&f(Me,{as:"p",children:o.description})]}),o&&f(fn.SyncStatus,{dataSource:o,onAction:c}),e?f(Re,{color:"gray",size:"xl"}):o?f(fn.DataSection,{dataSource:o,data:a}):f("div",{className:"DataSourcePage__notFound",children:"Not Found"})]})})}fn.SyncStatus=t=>{let e=t.dataSource;return f("div",{className:"DataSourcePage__SyncStatus",children:[f(Te,{size:"h2",children:"Status"}),f(kr,{verticalSpacing:"xs",striped:!0,highlightOnHover:!0,fontSize:"xs",children:[f("thead",{children:f("tr",{children:[f("th",{children:"last synced"}),f("th",{children:"last published"})]})}),f("tbody",{children:f("tr",{children:[f("td",{children:f(ed,{dataSource:e,action:"sync",onAction:()=>{t.onAction&&t.onAction("sync")}})}),f("td",{children:f(ed,{dataSource:e,action:"publish"})})]})})]})]})};fn.DataSection=t=>{let{data:e,headers:r}=t.data||{},o=t.dataSource;if(!e)return null;let n=o.dataFormat||"map";if(o.type==="gsheet"){let a=r,i=[];if(n==="array")i=e;else if(n==="map"){let s=e;if(!a){let l=new Set;s.forEach(c=>{for(let u in c)u&&l.add(u)}),a=Array.from(l)}s.forEach(l=>{i.push(a.map(c=>l[c]||""))})}return f(fn.DataSectionWrap,{dataSource:o,children:f(fn.DataTable,{headers:a,rows:i})})}return o.type==="http"?f(fn.DataSectionWrap,{dataSource:o,children:f(fn.DefaultDataDisplay,{data:e})}):(console.log(`unsupported data type: ${o.type}`),null)};fn.DataSectionWrap=t=>f("div",{className:"DataSourcePage__DataSection",children:[f("div",{className:"DataSourcePage__DataSection__header",children:[f(Te,{size:"h2",children:"Data"}),f("div",{className:"DataSourcePage__DataSection__header__actions",children:[t.dataSource.url?.startsWith("https://docs.google.com/spreadsheets/")&&f(xe,{label:"Open spreadsheet",children:f(Fe,{component:"a",href:t.dataSource.url,target:"_blank",variant:"filled",color:"green",children:f(El,{size:16,stroke:"2.25"})})}),t.dataSource.previewUrl&&f(X,{component:"a",variant:"default",size:"xs",href:t.dataSource.previewUrl,target:"_blank",children:"Preview"})]})]}),t.children]});fn.DataTable=t=>{let e=t.headers||[],r=t.rows||[];return f("div",{className:"DataSourcePage__DataTable",children:f(kr,{className:"DataSourcePage__DataTable__table",verticalSpacing:"xs",striped:!0,highlightOnHover:!0,fontSize:"xs",children:[e.length>0&&f("thead",{children:f("tr",{children:e.map(o=>f("th",{children:o},o))})}),f("tbody",{children:r.map((o,n)=>f("tr",{children:o.map((a,i)=>f("td",{children:a},i))},n))})]})})};fn.DefaultDataDisplay=t=>{let e=t.data;return typeof e=="object"?f(Mc,{value:JSON.stringify(e,null,2),minRows:20,maxRows:100}):f(Zt,{value:String(e),minRows:12,maxRows:100})};function os(t){let[e,r]=P(!0),[o,n]=P(!1),[a,i]=P([]),[s,l]=P({}),[c,u]=P(null),[d,p]=P(!1),[m,h]=P({}),[g,_]=P(!1),x=t.collection,b=t.slug,y=`${x}/${b}`,w=(window.__ROOT_CTX.rootConfig.i18n||{}).locales||["en"];async function v(){try{let[S,C,F]=await Promise.all([Eb(y),ji(),mb(y)]);i(S),l(C),u(F),r(!1)}catch(S){console.error(S),r(!1),n(!0)}}if(L(()=>{v()},[]),o)return f(os.NotFound,{docId:y});function T(S,C,F){p(!0),h(N=>{let R={...N},z=R[S]??{};return z.source=S,z[C]=F,R[S]=z,R})}async function O(){_(!0),await bt(async()=>{console.log("EditTranslationsModal.onSave()");let S=`edit-translations-${y}`;pe({id:S,loading:!0,title:"Saving translations",message:`Updating for ${y}...`,autoClose:!1,disallowClose:!0});let C=Object.values(m);console.log(C),await gl(y,C),at({id:S,title:"Saved translations",message:`Updated translations for ${y}!`,autoClose:!0}),h({}),p(!1)}),_(!1)}return f(me,{children:f("div",{className:"DocTranslationsPage",children:[f("div",{className:"DocTranslationsPage__header",children:[f(_r,{className:"DocTranslationsPage__header__breadcrumbs",children:[f("a",{href:`/cms/content/${x}`,children:x}),f("a",{href:`/cms/content/${x}/${b}`,children:b}),f("div",{children:"translations"})]}),f("div",{className:"DocTranslationsPage__header__titleWrap",children:f(Te,{size:"h1",children:["Translations: ",y]})}),c&&f("div",{className:"DocTranslationsPage__header__linkedSheet",children:[f("div",{className:"DocTranslationsPage__header__linkedSheet__label",children:[f("strong",{children:"NOTE:"})," Translations for this doc are managed in Google Sheets."]}),f("div",{className:"DocTranslationsPage__header__linkedSheet__controls",children:[f(xe,{label:"Open Google Sheet",children:f(Fe,{component:"a",href:Mn(c),target:"_blank",variant:"filled",color:"green",size:"sm",children:f(El,{size:16,strokeWidth:2.25})})}),f(X,{variant:"default",size:"xs",leftIcon:f(ti,{size:16,strokeWidth:1.75}),children:"Import from Sheet"}),f(X,{variant:"default",size:"xs",leftIcon:f(bl,{size:16,strokeWidth:1.75}),children:"Export to Sheet"})]})]})]}),f("div",{className:ke("DocTranslationsPage__content",e&&"DocTranslationsPage__content--loading"),children:e?f(Re,{color:"gray",size:"xl"}):f(os.Table,{locales:w,sourceStrings:a,translationsMap:s,onChange:T,changesMap:m})}),f("div",{className:"DocTranslationsPage__footer",children:f("div",{className:"DocTranslationsPage__footer__buttons",children:f(X,{variant:"filled",color:"dark",disabled:!d,loading:g,onClick:()=>O(),children:"Save"})})})]})})}os.NotFound=t=>f(me,{children:f("div",{className:"DocTranslationsPage DocTranslationsPage--error",children:f("div",{className:"DocTranslationsPage__error",children:[f("div",{className:"DocTranslationsPage__error__icon",children:f(jp,{size:60})}),f("div",{className:"DocTranslationsPage__error__title",children:["Not found: ",t.docId]})]})})});os.Table=t=>{let e=Tt(()=>{let o={};return Object.values(t.translationsMap).forEach(n=>{o[n.source]=n}),o},[t.translationsMap]);function r(o,n){return{translation:(e[o]||{})[n]||"",hasChanges:!1}}return f("div",{className:"DocTranslationsPage__TableWrap",children:f("table",{className:"DocTranslationsPage__Table",children:[f("thead",{children:f("tr",{children:[f("th",{children:"source"}),t.locales.map(o=>f("th",{children:o},o))]})}),f("tbody",{children:t.sourceStrings.map(o=>f("tr",{children:[f("td",{className:"DocTranslationsPage__Table__sourceCellWrap",children:f("div",{className:"DocTranslationsPage__Table__sourceCell",children:o})}),t.locales.map(n=>{let a=r(o,n);return f("td",{children:f(os.Textarea,{source:o,locale:n,value:a.translation,onChange:t.onChange,changesMap:t.changesMap})},n)})]},o))})]})})};os.Textarea=t=>{let e=H(null),[r,o]=P(t.value),n=null;t.locale in(t.changesMap[t.source]||{})&&(n=t.changesMap[t.source][t.locale]);let a=n!==null&&n!==t.value;function i(){window.requestAnimationFrame(()=>{let s=e.current;s.style.minHeight="auto";let l=s.scrollHeight;s.style.minHeight=`${l}px`})}return L(()=>{i()},[r]),f("textarea",{ref:e,className:ke("DocTranslationsPage__Textarea",a&&"DocTranslationsPage__Textarea--hasChanges",!r&&"DocTranslationsPage__Textarea--empty"),onFocus:()=>i(),rows:1,onChange:s=>{let l=s.target.value;o(l),t.onChange(t.source,t.locale,l)},value:r})};function zH(t,e){let r;return(...o)=>{window.clearTimeout(r),r=window.setTimeout(()=>{t(...o)},e)}}var ns=class{constructor(){this.events=new Map}on(e,r){let o=this.events.get(e)??[];return this.events.set(e,[...o,r]),()=>{this.off(e,r)}}off(e,r){let o=this.events.get(e)??[],n=o.indexOf(r);n>=0&&o.splice(n,1)}dispatch(e,...r){(this.events.get(e)??[]).forEach(n=>n(...r))}dispose(){this.events.clear()}};var UH=3*Tr.second,Wwe=5*Tr.minute;var Fk=class extends ns{constructor(r){super();this.pendingUpdates=new Map;this.cachedData={};this.subscribers={};this.saveState="NO_CHANGES";this.autolock=!1;this.autolockReason="autolock";this.autolockApplied=!1;this.started=!1;this.queueChanges=zH(()=>this.flush(),UH);this.projectId=window.__ROOT_CTX.rootConfig.projectId;let[o,n]=r.split("/");this.docId=r,this.collectionId=o,this.slug=n,this.db=window.firebase.db,this.docRef=we(this.db,"Projects",this.projectId,"Collections",o,"Drafts",n);let a=window.__ROOT_CTX.collections[o];a&&(this.autolock=!!a.autolock,a.autolockReason&&(this.autolockReason=a.autolockReason))}async start(){this.started||(this.started=!0,this.dbUnsubscribe=tb(this.docRef,r=>{let o=r.data();this.pendingUpdates.size>0&&vy(o,Object.fromEntries(this.pendingUpdates)),this.cachedData=o,this.notifySubscribers()}))}stop(){this.started&&(this.dbUnsubscribe&&this.dbUnsubscribe(),this.flush(),this.started=!1)}onChange(r){return this.on("CHANGE",r)}onSaveStateChange(r){return this.on("SAVE_STATE_CHANGE",r)}onFlush(r){return this.on("FLUSH",r)}subscribe(r,o){return this.subscribers[r]??=new Set,this.subscribers[r].add(o),o(this.getValue(r)),()=>{this.subscribers[r].delete(o),this.subscribers[r].size===0&&delete this.subscribers[r]}}notifySubscribers(){let r=this.cachedData;this.dispatch("CHANGE",r),VH(this.subscribers,r)}getValue(r){return oo(this.cachedData,r)}async updateKey(r,o){await this.updateKeys({[r]:o})}async updateKeys(r){for(let o in r)this.pendingUpdates.set(o,r[o]);vy(this.cachedData,r),this.dispatch("CHANGE",this.cachedData),this.setSaveState("UPDATE_PENDING"),this.queueChanges()}async removeKey(r){this.pendingUpdates.set(r,zr()),vy(this.cachedData,{[r]:void 0}),this.dispatch("CHANGE",this.cachedData),this.setSaveState("UPDATE_PENDING"),this.queueChanges()}setSaveState(r){let o=this.saveState;r==="SAVED"&&o!=="SAVING"||(this.saveState=r,r==="SAVED"&&window.setTimeout(()=>{this.saveState==="SAVED"&&this.setSaveState("NO_CHANGES")},UH),this.dispatch("SAVE_STATE_CHANGE",r))}async flush(){if(this.pendingUpdates.size===0)return;let r=Object.fromEntries(this.pendingUpdates);r["sys.modifiedAt"]=Ut(),r["sys.modifiedBy"]=window.firebase.user.email,this.autolock&&!this.autolockApplied&&!this.cachedData?.sys?.publishingLocked&&(this.autolockApplied=!0,r["sys.publishingLocked"]={lockedAt:Ut(),lockedBy:window.firebase.user.email,reason:this.autolockReason}),this.pendingUpdates.clear();try{this.setSaveState("SAVING"),await rr(this.docRef,r),this.setSaveState("SAVED"),this.dispatch("FLUSH"),Je("doc.save",{metadata:{docId:this.docId},throttle:Wwe,throttleId:this.docId})}catch(o){console.error("failed to update doc"),console.error(o),this.setSaveState("ERROR"),pe({title:"Failed to save",message:`Failed to save changes to ${this.slug}`,color:"red",autoClose:!1});for(let n in r)n.startsWith("sys.")||this.pendingUpdates.has(n)||(this.pendingUpdates.set(n,r[n]),this.queueChanges(),console.log("re-queued updates"))}}getLocales(){return this.cachedData&&this.cachedData.sys?.locales?this.cachedData.sys.locales:["en"]}setLocales(r){this.updateKey("sys.locales",r)}async dispose(){super.dispose(),this.stop()}};function vy(t,e){for(let r in e){let o=e[r];if(r.includes(".")){let[n,a]=Kwe(r);t[n]??={},vy(t[n],{[a]:o})}else typeof o>"u"?delete t[r]:t[r]=o}}function VH(t,e,r){r||(r=[]);for(let o in e){let n=[...r,o],a=n.join("."),i=t[a],s=e[o];i&&Array.from(i).forEach(l=>{l(s)}),Bp(s)&&VH(t,s,n)}}function Kwe(t){let e=t.indexOf("."),r=t.substring(0,e),o=t.substring(e+1);return[r,o]}function HH(t){let[e,r]=P(!0),[o,n]=P({}),a=Tt(()=>new Fk(t),[t]),[i,s]=P("NO_CHANGES");return L(()=>{a.onChange(c=>{n(c),r(!1),Lp(t,c)}),a.onSaveStateChange(c=>s(c)),a.start();let l=()=>{document.hidden||document.visibilityState!=="visible"?a.stop():a.started||(r(!0),a.start())};return document.addEventListener("visibilitychange",l),()=>{a.dispose(),document.removeEventListener("visibilitychange",l)}},[t]),{loading:e,saveState:i,controller:a,data:o}}function $H(t,e){let r=zk(t);for(let o of r)if(e[o]){let n=String(e[o]);t=t.replaceAll(`{${o}}`,n)}return t}function zk(t){return Array.from(t.matchAll(/\{(.+?)\}/g)).map(e=>e[1])}var Uk=class{constructor(){this.value=null}set(e){this.value=e}},Xwe=new Uk;function jH(){return Xwe}function qH(t,e){let r=!1;return(...o)=>{r||(t(...o),r=!0,setTimeout(()=>{r=!1},e))}}var lm=class extends ns{constructor(r){super();this.interval=0;this.timeout=0;this.interval=r}start(){this.timeout=window.setTimeout(()=>{this.tick()},this.interval)}tick(){this.dispatch("tick"),this.start()}reset(){this.stop(),this.start()}stop(){this.timeout&&(window.clearTimeout(this.timeout),this.timeout=0)}};var Ywe=30*Tr.second,GH=5*Tr.minute,Vk=class extends ns{constructor(r){super();this.started=!1;this.timer=new lm(Ywe);this.idleTimer=new lm(GH);this.onUserInteraction=qH(()=>{this.idleTimer.reset()},5e3);this.id=r;let o=window.__ROOT_CTX.rootConfig.projectId,n=window.firebase.db;this.docRef=we(n,"Projects",o,"Viewers",r),this.timer.on("tick",()=>this.onTick()),this.idleTimer.on("tick",()=>this.onIdle()),window.addEventListener("mousemove",this.onUserInteraction),window.addEventListener("keypress",this.onUserInteraction)}async start(){this.started||(this.started=!0,this.dbUnsubscribe=tb(this.docRef,r=>{let o=r.data();this.onData(o)}),this.onTick(),this.timer.start())}onData(r){let o=window.firebase.user,n=Ze.now(),a=Object.values(r).filter(i=>!(i.email===o.email||n.toMillis()-i.lastViewedAt.toMillis()>GH));this.dispatch("change",a)}async onTick(){let r=window.firebase.user;if(!r.email){console.log("no user email:",r);return}console.log(`updating lastViewedAt for ${r.email}`),await vu(this.docRef,{[r.email]:{email:r.email,photoURL:r.photoURL,lastViewedAt:Ut()}},{merge:!0})}async onIdle(){this.stop()}stop(){this.started&&(this.dbUnsubscribe&&this.dbUnsubscribe(),this.timer.stop(),this.idleTimer.stop(),this.onDisconnect(),this.started=!1)}async onDisconnect(){let r=window.firebase.user;if(!r.email){console.log("no user email:",r);return}let o=new No(r.email,"disconnectedAt");await rr(this.docRef,o,Ut())}async dispose(){super.dispose(),this.stop(),this.timer.dispose(),this.idleTimer.dispose()}};function WH(t){let e=$i(t.id),[r,o]=P([]);if(L(()=>{let a=new Vk(e);a.on("change",s=>o(s)),a.start();let i=()=>{document.hidden||document.visibilityState!=="visible"?a.stop():a.started||a.start()};return document.addEventListener("visibilitychange",i),()=>{a.dispose(),document.removeEventListener("visibilitychange",i)}},[e]),r.length===0)return null;function n(a){return a.disconnectedAt?a.disconnectedAt>a.lastViewedAt:!1}return f(ig,{className:"Viewers",limit:3,size:30,children:r.map(a=>{if(!a.photoURL){let i=a.email[0].toUpperCase();return f(kn,{alt:a.email,size:24,radius:"xl",children:i})}return f(kn,{className:ke("Viewers__viewer",n(a)&&"Viewers__viewer--disconnected"),src:a.photoURL,alt:a.email,size:24,radius:"xl"},a.email)})})}function KH(t){let r=t.field.checkboxLabel||"Enabled",[o,n]=P(!1);function a(i){n(i),t.draft.updateKey(t.deepKey,i)}return L(()=>t.draft.subscribe(t.deepKey,s=>{n(s)}),[]),f("div",{className:"DocEditor__BooleanField",children:f(Rc,{label:r,onChange:i=>{let s=i.currentTarget;a(s.checked)},checked:o,size:"xs"})})}function XH(t){let[e,r]=P("");function o(a){if(a){let i=Math.floor(new Date(a).getTime()),s=Ze.fromMillis(i);r(n(s)),t.draft.updateKey(t.deepKey,s)}else r(""),t.draft.removeKey(t.deepKey)}function n(a){let i=a.toDate();return i.setMinutes(i.getMinutes()-i.getTimezoneOffset()),i.toISOString().slice(0,16)}return L(()=>t.draft.subscribe(t.deepKey,i=>{r(i?n(i):"")}),[]),f("div",{className:"DocEditor__DateTimeField",children:[f("input",{type:"datetime-local",value:e,onChange:a=>{let s=a.target.value;o(s)}}),f("div",{className:"DocEditor__DateTimeField__timezone",children:["timezone: ",Intl.DateTimeFormat().resolvedOptions().timeZone]})]})}function QH(t){let e=t.field,[r,o]=P({}),[n,a]=P(!1),[i,s]=P(!1),l=H(null),c=H(null),u;e.exts&&(u=e.exts.join(","));async function d(){o({}),t.draft.removeKey(t.deepKey)}async function p(b){a(!0);try{let y=await Aa(b,{cacheControl:e.cacheControl,preserveFilename:e.preserveFilename});o(I=>{let w={...y};return I?.src&&YH(I.src)&&(w.alt=I?.alt||""),t.draft.updateKey(t.deepKey,w),w}),a(!1)}catch(y){console.error("file upload failed"),console.error(y),a(!1),pe({title:"File upload failed",message:"Failed to upload file: "+String(y),color:"red",autoClose:!1})}if(l.current){let y=l.current;y.value=""}}function m(b){let w=(b.target.files||[])[0];w&&p(w)}function h(b){o(y=>Object.assign({},y,{alt:b})),t.draft.updateKey(`${t.deepKey}.alt`,b)}let g=b=>{b.preventDefault(),s(!0)},_=b=>{b.preventDefault(),s(!1)},x=b=>{b.preventDefault(),s(!1);let I=(b.dataTransfer?.files||[])[0];I&&(console.log(`file dropped ("${t.deepKey}"):`,I),p(I))};return L(()=>{let b=t.draft.subscribe(t.deepKey,I=>{o(I)}),y=c.current;return document.addEventListener("dragenter",g),document.addEventListener("dragover",g),document.addEventListener("dragleave",_),document.addEventListener("drop",_),y&&y.addEventListener("drop",x),()=>{b(),document.removeEventListener("dragenter",g),document.removeEventListener("dragover",g),document.removeEventListener("dragleave",_),document.removeEventListener("drop",_),y&&y.removeEventListener("drop",x)}},[]),f("div",{className:ke("DocEditor__FileField",i&&"dragging"),ref:c,children:[r&&r.src&&f("div",{className:"DocEditor__FileField__controls",children:f(xe,{label:"Remove file",children:f(Fe,{className:"DocEditor__FileField__controls__trash",onClick:()=>d(),children:f(cn,{size:16})})})}),r&&r.src&&ZH(r.src)&&f(Qwe,{...r},r.src),r&&r.src&&JH(r.src)&&f(Zwe,{...r},r.src),r&&r.src?f(Ae,{children:[f("div",{className:"DocEditor__FileField__file",children:f(gt,{className:"DocEditor__FileField__file__url",size:"xs",radius:0,value:r.src,disabled:!0})}),YH(r.src)&&f(gt,{className:"DocEditor__FileField__file__alt",size:"xs",radius:0,value:r.alt||"",onChange:b=>{h(b.currentTarget.value)},label:"Alt text"})]}):f("div",{className:"DocEditor__FileField__noFile",children:"No file"}),f("label",{className:"DocEditor__FileField__uploadButton",role:"button","aria-disabled":n,children:[f("input",{type:"file",accept:u,onChange:m,ref:l}),f("div",{className:"DocEditor__FileField__uploadButton__icon",children:f(ti,{size:16})}),f("div",{className:"DocEditor__FileField__uploadButton__label",children:n?"Uploading...":"Upload file"})]})]})}function Qwe(t){return f("div",{className:"DocEditor__FileField__ImagePreview",children:[f("img",{src:t.src,width:t.width,height:t.height,loading:"lazy"}),t.width&&t.height&&f("div",{className:"DocEditor__FileField__ImagePreview__dimens",children:`${t.width}x${t.height}`})]})}function Zwe(t){let e={};return t.width&&t.height&&(e["--video-aspect-ratio"]=`${t.width} / ${t.height}`),f("div",{className:"DocEditor__FileField__VideoPreview",style:e,children:[f("video",{className:"DocEditor__FileField__VideoPreview__video",controls:!0,preload:"metadata",children:f("source",{src:t.src,type:`video/${am(t.src)}`})}),t.width&&t.height&&f("div",{className:"DocEditor__FileField__VideoPreview__dimens",children:`${t.width}x${t.height}`})]})}function ZH(t){if(!t)return!1;if(t.startsWith(cH))return!0;let e=am(t);return Dk.includes(e)}function JH(t){if(!t)return!1;let e=am(t);return Rk.includes(e)}function YH(t){return ZH(t)||JH(t)}var Jwe=["image/gif","image/jpeg","image/png","image/svg+xml","image/webp"];function e0e(t){return(t??Jwe).join(", ")}function e$(t){let e=t.field,[r,o]=P({}),[n,a]=P(!1),[i,s]=P(!1),l=H(null),c=H(null),u=e0e(e.exts);async function d(b){a(!0);try{let y=await Aa(b,{cacheControl:e.cacheControl});o(I=>{let w=Object.assign({},y,{alt:I?.alt||""});return t.draft.updateKey(t.deepKey,w),w}),a(!1)}catch(y){console.error("image upload failed"),console.error(y),a(!1),pe({title:"Image upload failed",message:"Failed to upload image: "+String(y),color:"red",autoClose:!1})}if(l.current){let y=l.current;y.value=""}}function p(b){let w=(b.target.files||[])[0];w&&d(w)}function m(b){o(y=>Object.assign({},y,{alt:b})),t.draft.updateKey(`${t.deepKey}.alt`,b)}function h(){o({}),t.draft.removeKey(t.deepKey)}let g=b=>{b.preventDefault(),s(!0)},_=b=>{b.preventDefault(),s(!1)},x=b=>{b.preventDefault(),s(!1);let I=(b.dataTransfer?.files||[])[0];I&&(console.log(`file dropped ("${t.deepKey}"):`,I),d(I))};return L(()=>{let b=t.draft.subscribe(t.deepKey,I=>{o(I)}),y=c.current;return document.addEventListener("dragenter",g),document.addEventListener("dragover",g),document.addEventListener("dragleave",_),document.addEventListener("drop",_),y&&y.addEventListener("drop",x),()=>{b(),document.removeEventListener("dragenter",g),document.removeEventListener("dragover",g),document.removeEventListener("dragleave",_),document.removeEventListener("drop",_),y&&y.removeEventListener("drop",x)}},[]),f("div",{className:ke("DocEditor__ImageField",i&&"dragging"),ref:c,children:[r&&r.src?f("div",{className:"DocEditor__ImageField__imagePreview",children:[f("div",{className:"DocEditor__ImageField__imagePreview__controls",children:f(xe,{label:"Remove image",children:f(Fe,{className:"DocEditor__ImageField__imagePreview__controls__trash",onClick:()=>h(),children:f(cn,{size:16})})})}),f("div",{className:"DocEditor__ImageField__imagePreview__image",children:[f("img",{src:r.gciUrl||r.src,width:r.width,height:r.height,loading:"lazy"}),f("div",{className:"DocEditor__ImageField__imagePreview__dimens",children:`${r.width}x${r.height}`})]}),f(gt,{className:"DocEditor__ImageField__imagePreview__image__url",size:"xs",radius:0,value:r.gciUrl||r.src,disabled:!0}),f(gt,{className:"DocEditor__ImageField__imagePreview__image__alt",size:"xs",radius:0,value:r.alt,label:"Alt text",onChange:b=>{m(b.currentTarget.value)}})]}):f("div",{className:"DocEditor__ImageField__noImage",children:"No image"}),f("label",{className:"DocEditor__ImageField__uploadButton",role:"button","aria-disabled":n,children:[f("input",{type:"file",accept:u,onChange:p,ref:l}),f("div",{className:"DocEditor__ImageField__uploadButton__icon",children:f(JS,{size:16})}),f("div",{className:"DocEditor__ImageField__uploadButton__label",children:n?"Uploading...":"Upload image"})]})]})}function t$(t){let e=t.field,[r,o]=P([]),n=(e.options||[]).map(i=>typeof i=="string"?{label:i,value:i}:{label:i.label??i.value??"",value:i.value??i.label??""});function a(i){t.draft.updateKey(t.deepKey,i||[]),o(i)}return L(()=>t.draft.subscribe(t.deepKey,s=>{o(s||[])}),[]),f("div",{className:"DocEditor__MultiSelectField",children:f(Og,{data:n,size:"xs",radius:0,placeholder:e.placeholder,value:r,searchable:!0,creatable:e.creatable||!1,getCreateLabel:i=>`+ Add "${i}"`,onChange:i=>a(i),dropdownComponent:"div"})})}function td(t){let e=t.field,[r,o]=P("");function n(l){if(l){let[c,u]=l.split("/");t.draft.updateKey(t.deepKey,{id:l,collection:c,slug:u})}else t.draft.removeKey(t.deepKey);o(l)}L(()=>t.draft.subscribe(t.deepKey,c=>{o(c?.id||"")}),[]);let a=Pz();function i(){let l=r?r.split("/")[0]:e.initialCollection;a.open({collections:e.collections,initialCollection:l,onChange:c=>{n(c),a.close()}})}function s(){n("")}return f("div",{className:"ReferenceField",children:[r?f("div",{className:"ReferenceField__ref",children:[f(td.Preview,{id:r}),f("div",{className:"ReferenceField__remove",children:f(xe,{label:"Remove",children:f(Fe,{className:"ReferenceField__remove__icon",onClick:()=>s(),children:f(cn,{size:16})})})})]}):f("div",{className:"ReferenceField__none",children:"None selected"}),f(X,{color:"dark",size:"xs",onClick:()=>i(),children:e.buttonLabel||"Select"})]})}td.Preview=t=>{let[e,r]=P(!0),[o,n]=P(null);async function a(){r(!0),await bt(async()=>{let i=await cb(t.id);n(i)}),r(!1)}return L(()=>{a()},[t.id]),f("div",{className:"ReferenceField__Preview",children:e?f("div",{className:"ReferenceField__Preview__loading",children:f(Re,{color:"gray",size:"sm"})}):o?f(td.DocCard,{doc:o}):f("div",{className:"ReferenceField__Preview__notfound",children:['Doc Not found: "',t.id,'" (was it deleted?). Select a new doc or remove using the trash icon to the right.']})})};td.DocCard=t=>{let e=t.doc,r=e.id||e.sys?.id||"";if(!r)return f("div",{className:"ReferenceField__DocCard ReferenceField__DocCard--error",children:JSON.stringify(e)});let o=r.split("/")[0],n=e.fields||{},a=window.__ROOT_CTX.collections[o];if(!a)throw new Error(`could not find collection: ${o}`);let i=oo(n,a.preview?.title||"meta.title"),s=oo(n,a.preview?.image||"meta.image")||a.preview?.defaultImage;return f("a",{className:"ReferenceField__DocCard",href:`/cms/content/${r}`,target:"_blank",children:[f("div",{className:"ReferenceField__DocCard__image",children:f(Tn,{src:s?.src,width:80,height:60,withPlaceholder:!s?.src})}),f("div",{className:"ReferenceField__DocCard__content",children:[f("div",{className:"ReferenceField__DocCard__content__header",children:f("div",{className:"ReferenceField__DocCard__content__header__docId",children:r})}),f("div",{className:"ReferenceField__DocCard__content__title",children:i||"[UNTITLED]"})]})]})};(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".ce-hint--align-start{text-align:left}.ce-hint--align-center{text-align:center}.ce-hint__description{opacity:.6;margin-top:3px}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var hm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function t0e(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:function(){return t[o]}})}),r}function Hk(){}Object.assign(Hk,{default:Hk,register:Hk,revert:function(){},__esModule:!0});Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){let e=(this.document||this.ownerDocument).querySelectorAll(t),r=e.length;for(;--r>=0&&e.item(r)!==this;);return r>-1});Element.prototype.closest||(Element.prototype.closest=function(t){let e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(e!==null);return null});Element.prototype.prepend||(Element.prototype.prepend=function(t){let e=document.createDocumentFragment();Array.isArray(t)||(t=[t]),t.forEach(r=>{let o=r instanceof Node;e.appendChild(o?r:document.createTextNode(r))}),this.insertBefore(e,this.firstChild)});Element.prototype.scrollIntoViewIfNeeded||(Element.prototype.scrollIntoViewIfNeeded=function(t){t=arguments.length===0?!0:!!t;let e=this.parentNode,r=window.getComputedStyle(e,null),o=parseInt(r.getPropertyValue("border-top-width")),n=parseInt(r.getPropertyValue("border-left-width")),a=this.offsetTop-e.offsetTop<e.scrollTop,i=this.offsetTop-e.offsetTop+this.clientHeight-o>e.scrollTop+e.clientHeight,s=this.offsetLeft-e.offsetLeft<e.scrollLeft,l=this.offsetLeft-e.offsetLeft+this.clientWidth-n>e.scrollLeft+e.clientWidth,c=a&&!i;(a||i)&&t&&(e.scrollTop=this.offsetTop-e.offsetTop-e.clientHeight/2-o+this.clientHeight/2),(s||l)&&t&&(e.scrollLeft=this.offsetLeft-e.offsetLeft-e.clientWidth/2-n+this.clientWidth/2),(a||i||s||l)&&!t&&this.scrollIntoView(c)});window.requestIdleCallback=window.requestIdleCallback||function(t){let e=Date.now();return setTimeout(function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})},1)};window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)};var r0e=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),""),h$=(t=>(t.VERBOSE="VERBOSE",t.INFO="INFO",t.WARN="WARN",t.ERROR="ERROR",t))(h$||{}),He={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,LEFT:37,UP:38,DOWN:40,RIGHT:39,DELETE:46,META:91,SLASH:191},o0e={LEFT:0,WHEEL:1,RIGHT:2,BACKWARD:3,FORWARD:4};function wm(t,e,r="log",o,n="color: inherit"){if(!("console"in window)||!window.console[r])return;let a=["info","log","warn","error"].includes(r),i=[];switch(wm.logLevel){case"ERROR":if(r!=="error")return;break;case"WARN":if(!["error","warn"].includes(r))return;break;case"INFO":if(!a||t)return;break}o&&i.push(o);let s="Editor.js 2.31.0-rc.7",l=`line-height: 1em;
|
|
144
144
|
color: #006FEA;
|
|
145
145
|
display: inline-block;
|
|
146
146
|
font-size: 11px;
|