@useorgx/openclaw-plugin 0.4.5 → 0.4.6

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.
Files changed (54) hide show
  1. package/README.md +24 -3
  2. package/dashboard/dist/assets/0tOC3wSN.js +214 -0
  3. package/dashboard/dist/assets/B3ziCA02.js +8 -0
  4. package/dashboard/dist/assets/Bm8QnMJ_.js +1 -0
  5. package/dashboard/dist/assets/CpJsfbXo.js +9 -0
  6. package/dashboard/dist/assets/CyxZio4Y.js +1 -0
  7. package/dashboard/dist/assets/DaAIOik3.css +1 -0
  8. package/dashboard/dist/assets/sAhvFnpk.js +4 -0
  9. package/dashboard/dist/index.html +5 -5
  10. package/dist/activity-store.d.ts +28 -0
  11. package/dist/activity-store.js +250 -0
  12. package/dist/agent-context-store.d.ts +19 -0
  13. package/dist/agent-context-store.js +60 -3
  14. package/dist/agent-suite.d.ts +83 -0
  15. package/dist/agent-suite.js +615 -0
  16. package/dist/contracts/client.d.ts +22 -1
  17. package/dist/contracts/client.js +120 -3
  18. package/dist/contracts/types.d.ts +190 -1
  19. package/dist/entity-comment-store.d.ts +29 -0
  20. package/dist/entity-comment-store.js +190 -0
  21. package/dist/hooks/post-reporting-event.mjs +326 -0
  22. package/dist/http-handler.d.ts +7 -1
  23. package/dist/http-handler.js +3603 -578
  24. package/dist/index.js +936 -62
  25. package/dist/mcp-client-setup.js +156 -24
  26. package/dist/mcp-http-handler.d.ts +17 -0
  27. package/dist/mcp-http-handler.js +144 -3
  28. package/dist/next-up-queue-store.d.ts +31 -0
  29. package/dist/next-up-queue-store.js +169 -0
  30. package/dist/openclaw.plugin.json +1 -1
  31. package/dist/outbox.d.ts +1 -1
  32. package/dist/runtime-instance-store.d.ts +1 -1
  33. package/dist/runtime-instance-store.js +20 -3
  34. package/dist/skill-pack-state.d.ts +69 -0
  35. package/dist/skill-pack-state.js +232 -0
  36. package/dist/worker-supervisor.d.ts +25 -0
  37. package/dist/worker-supervisor.js +62 -0
  38. package/openclaw.plugin.json +1 -1
  39. package/package.json +10 -1
  40. package/skills/orgx-design-agent/SKILL.md +38 -0
  41. package/skills/orgx-engineering-agent/SKILL.md +55 -0
  42. package/skills/orgx-marketing-agent/SKILL.md +40 -0
  43. package/skills/orgx-operations-agent/SKILL.md +40 -0
  44. package/skills/orgx-orchestrator-agent/SKILL.md +45 -0
  45. package/skills/orgx-product-agent/SKILL.md +39 -0
  46. package/skills/orgx-sales-agent/SKILL.md +40 -0
  47. package/skills/ship/SKILL.md +63 -0
  48. package/dashboard/dist/assets/B68j2crt.js +0 -1
  49. package/dashboard/dist/assets/BZZ-fiJx.js +0 -32
  50. package/dashboard/dist/assets/BoXlCHKa.js +0 -9
  51. package/dashboard/dist/assets/Bq9x_Xyh.css +0 -1
  52. package/dashboard/dist/assets/DBhrRVdp.js +0 -1
  53. package/dashboard/dist/assets/DD1jv1Hd.js +0 -8
  54. package/dashboard/dist/assets/DNjbmawF.js +0 -214
@@ -1,32 +0,0 @@
1
- import{g as Ca,h as Ku}from"./DD1jv1Hd.js";var Dr={exports:{}},Mr={};var Rs;function Qu(){return Rs||(Rs=1,(function(t){function e(I,j){var g=I.length;I.push(j);e:for(;0<g;){var X=g-1>>>1,W=I[X];if(0<i(W,j))I[X]=j,I[g]=W,g=X;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var j=I[0],g=I.pop();if(g!==j){I[0]=g;e:for(var X=0,W=I.length,m=W>>>1;X<m;){var re=2*(X+1)-1,ye=I[re],te=re+1,ze=I[te];if(0>i(ye,g))te<W&&0>i(ze,ye)?(I[X]=ze,I[te]=g,X=te):(I[X]=ye,I[re]=g,X=re);else if(te<W&&0>i(ze,g))I[X]=ze,I[te]=g,X=te;else break e}}return j}function i(I,j){var g=I.sortIndex-j.sortIndex;return g!==0?g:I.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,h=null,p=3,f=!1,d=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(I){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=I)r(u),j.sortIndex=j.expirationTime,e(l,j);else break;j=n(u)}}function F(I){if(v=!1,E(I),!d)if(n(l)!==null)d=!0,J(C);else{var j=n(u);j!==null&&ie(F,j.startTime-I)}}function C(I,j){d=!1,v&&(v=!1,_(T),T=-1),f=!0;var g=p;try{for(E(j),h=n(l);h!==null&&(!(h.expirationTime>j)||I&&!D());){var X=h.callback;if(typeof X=="function"){h.callback=null,p=h.priorityLevel;var W=X(h.expirationTime<=j);j=t.unstable_now(),typeof W=="function"?h.callback=W:h===n(l)&&r(l),E(j)}else r(l);h=n(l)}if(h!==null)var m=!0;else{var re=n(u);re!==null&&ie(F,re.startTime-j),m=!1}return m}finally{h=null,p=g,f=!1}}var x=!1,N=null,T=-1,U=5,b=-1;function D(){return!(t.unstable_now()-b<U)}function L(){if(N!==null){var I=t.unstable_now();b=I;var j=!0;try{j=N(!0,I)}finally{j?V():(x=!1,N=null)}}else x=!1}var V;if(typeof w=="function")V=function(){w(L)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,A=B.port2;B.port1.onmessage=L,V=function(){A.postMessage(null)}}else V=function(){y(L,0)};function J(I){N=I,x||(x=!0,V())}function ie(I,j){T=y(function(){I(t.unstable_now())},j)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_continueExecution=function(){d||f||(d=!0,J(C))},t.unstable_forceFrameRate=function(I){0>I||125<I||(U=0<I?Math.floor(1e3/I):5)},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(I){switch(p){case 1:case 2:case 3:var j=3;break;default:j=p}var g=p;p=j;try{return I()}finally{p=g}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(I,j){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var g=p;p=I;try{return j()}finally{p=g}},t.unstable_scheduleCallback=function(I,j,g){var X=t.unstable_now();switch(typeof g=="object"&&g!==null?(g=g.delay,g=typeof g=="number"&&0<g?X+g:X):g=X,I){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=g+W,I={id:c++,callback:j,priorityLevel:I,startTime:g,expirationTime:W,sortIndex:-1},g>X?(I.sortIndex=g,e(u,I),n(l)===null&&I===n(u)&&(v?(_(T),T=-1):v=!0,ie(F,g-X))):(I.sortIndex=W,e(l,I),d||f||(d=!0,J(C))),I},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(I){var j=p;return function(){var g=p;p=j;try{return I.apply(this,arguments)}finally{p=g}}}})(Mr)),Mr}var Os;function Y_(){return Os||(Os=1,Dr.exports=Qu()),Dr.exports}var k=typeof window<"u"?window:void 0,ke=typeof globalThis<"u"?globalThis:k;typeof self>"u"&&(ke.self=ke),typeof File>"u"&&(ke.File=function(){});var Pa=Array.prototype,Ds=Pa.forEach,Ms=Pa.indexOf,Le=ke==null?void 0:ke.navigator,M=ke==null?void 0:ke.document,xe=ke==null?void 0:ke.location,vi=ke==null?void 0:ke.fetch,_i=ke!=null&&ke.XMLHttpRequest&&"withCredentials"in new ke.XMLHttpRequest?ke.XMLHttpRequest:void 0,Ls=ke==null?void 0:ke.AbortController,Ae=Le==null?void 0:Le.userAgent,q=k??{},tt={DEBUG:!1,LIB_VERSION:"1.345.5"};function $s(t,e,n,r,i,s,o){try{var a=t[s](o),l=a.value}catch(u){return void n(u)}a.done?e(l):Promise.resolve(l).then(r,i)}function Nt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var s=t.apply(e,n);function o(l){$s(s,r,i,o,a,"next",l)}function a(l){$s(s,r,i,o,a,"throw",l)}o(void 0)}))}}function z(){return z=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},z.apply(null,arguments)}function Ia(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var Zu=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],ec=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],zs=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return ec.concat(e).some((r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1}))};function K(t,e){return t.indexOf(e)!==-1}var Sr=function(t){return t.trim()},yi=function(t){return t.replace(/^\$/,"")},tc=Array.isArray,Ta=Object.prototype,Aa=Ta.hasOwnProperty,Cr=Ta.toString,se=tc||function(t){return Cr.call(t)==="[object Array]"},gt=t=>typeof t=="function",ve=t=>t===Object(t)&&!se(t),Bt=t=>{if(ve(t)){for(var e in t)if(Aa.call(t,e))return!1;return!0}return!1},O=t=>t===void 0,_e=t=>Cr.call(t)=="[object String]",bi=t=>_e(t)&&t.trim().length===0,Ve=t=>t===null,Z=t=>O(t)||Ve(t),at=t=>Cr.call(t)=="[object Number]"&&t==t,Lt=t=>at(t)&&t>0,ot=t=>Cr.call(t)==="[object Boolean]",nc=t=>t instanceof FormData,rc=t=>K(Zu,t);function xi(t){return t===null||typeof t!="object"}function or(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function Fa(t){return!O(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var ic=[!0,"true",1,"1","yes"],Lr=t=>K(ic,t),sc=[!1,"false",0,"0","no"];function Xe(t,e,n,r,i){return e>n&&(r.warn("min cannot be greater than max."),e=n),at(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),Xe(i||n,e,n,r))}class oc{constructor(e){this.t={},this.i=e.i,this.o=Xe(e.bucketSize,0,100,e.h),this.m=Xe(e.refillRate,0,this.o,e.h),this.$=Xe(e.refillInterval,0,864e5,e.h)}S(e,n){var r=n-e.lastAccess,i=Math.floor(r/this.$);if(i>0){var s=i*this.m;e.tokens=Math.min(e.tokens+s,this.o),e.lastAccess=e.lastAccess+i*this.$}}consumeRateLimit(e){var n,r=Date.now(),i=String(e),s=this.t[i];return s?this.S(s,r):(s={tokens:this.o,lastAccess:r},this.t[i]=s),s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.i)==null||n.call(this,e)),s.tokens===0)}stop(){this.t={}}}var Be="Mobile",ar="iOS",st="Android",On="Tablet",Ra=st+" "+On,Oa="iPad",Da="Apple",Ma=Da+" Watch",Dn="Safari",Vt="BlackBerry",La="Samsung",$a=La+"Browser",za=La+" Internet",St="Chrome",ac=St+" OS",Na=St+" "+ar,ns="Internet Explorer",Ba=ns+" "+Be,rs="Opera",lc=rs+" Mini",is="Edge",ja="Microsoft "+is,qt="Firefox",qa=qt+" "+ar,Mn="Nintendo",Ln="PlayStation",Ht="Xbox",Ha=st+" "+Be,Ua=Be+" "+Dn,_n="Windows",ki=_n+" Phone",Ns="Nokia",wi="Ouya",Va="Generic",uc=Va+" "+Be.toLowerCase(),Wa=Va+" "+On.toLowerCase(),Ei="Konqueror",Pe="(\\d+(\\.\\d+)?)",$r=new RegExp("Version/"+Pe),cc=new RegExp(Ht,"i"),hc=new RegExp(Ln+" \\w+","i"),fc=new RegExp(Mn+" \\w+","i"),ss=new RegExp(Vt+"|PlayBook|BB10","i"),pc={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Yn,Bs,zr,dc=(t,e)=>e&&K(e,Da)||(function(n){return K(n,Dn)&&!K(n,St)&&!K(n,st)})(t),Ga=function(t,e){return e=e||"",K(t," OPR/")&&K(t,"Mini")?lc:K(t," OPR/")?rs:ss.test(t)?Vt:K(t,"IE"+Be)||K(t,"WPDesktop")?Ba:K(t,$a)?za:K(t,is)||K(t,"Edg/")?ja:K(t,"FBIOS")?"Facebook "+Be:K(t,"UCWEB")||K(t,"UCBrowser")?"UC Browser":K(t,"CriOS")?Na:K(t,"CrMo")||K(t,St)?St:K(t,st)&&K(t,Dn)?Ha:K(t,"FxiOS")?qa:K(t.toLowerCase(),Ei.toLowerCase())?Ei:dc(t,e)?K(t,Be)?Ua:Dn:K(t,qt)?qt:K(t,"MSIE")||K(t,"Trident/")?ns:K(t,"Gecko")?qt:""},gc={[Ba]:[new RegExp("rv:"+Pe)],[ja]:[new RegExp(is+"?\\/"+Pe)],[St]:[new RegExp("("+St+"|CrMo)\\/"+Pe)],[Na]:[new RegExp("CriOS\\/"+Pe)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Pe)],[Dn]:[$r],[Ua]:[$r],[rs]:[new RegExp("(Opera|OPR)\\/"+Pe)],[qt]:[new RegExp(qt+"\\/"+Pe)],[qa]:[new RegExp("FxiOS\\/"+Pe)],[Ei]:[new RegExp("Konqueror[:/]?"+Pe,"i")],[Vt]:[new RegExp(Vt+" "+Pe),$r],[Ha]:[new RegExp("android\\s"+Pe,"i")],[za]:[new RegExp($a+"\\/"+Pe)],[ns]:[new RegExp("(rv:|MSIE )"+Pe)],Mozilla:[new RegExp("rv:"+Pe)]},mc=function(t,e){var n=Ga(t,e),r=gc[n];if(O(r))return null;for(var i=0;i<r.length;i++){var s=r[i],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},js=[[new RegExp(Ht+"; "+Ht+" (.*?)[);]","i"),t=>[Ht,t&&t[1]||""]],[new RegExp(Mn,"i"),[Mn,""]],[new RegExp(Ln,"i"),[Ln,""]],[ss,[Vt,""]],[new RegExp(_n,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ki,""];if(new RegExp(Be).test(e)&&!/IEMobile\b/.test(e))return[_n+" "+Be,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],i=pc[r]||"";return/arm/i.test(e)&&(i="RT"),[_n,i]}return[_n,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[ar,e.join(".")]}return[ar,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=O(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+st+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+st+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[st,e.join(".")]}return[st,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ac,""]],[/Linux|debian/i,["Linux",""]]],qs=function(t){return fc.test(t)?Mn:hc.test(t)?Ln:cc.test(t)?Ht:new RegExp(wi,"i").test(t)?wi:new RegExp("("+ki+"|WPDesktop)","i").test(t)?ki:/iPad/.test(t)?Oa:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Ma:ss.test(t)?Vt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ns,"i").test(t)?Ns:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Be).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?st:Ra:new RegExp("(pda|"+Be+")","i").test(t)?uc:new RegExp(On,"i").test(t)&&!new RegExp(On+" pc","i").test(t)?Wa:""},vc=t=>t instanceof Error;function _c(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return zr&&n.length===Bs||(Bs=n.length,zr=n.reduce(((r,i)=>{Yn||(Yn={});var s=Yn[i];if(s)r[s[0]]=s[1];else for(var o=t(i),a=o.length-1;a>=0;a--){var l=o[a],u=l==null?void 0:l.filename,c=e[i];if(u&&c){r[u]=c,Yn[i]=[u,c];break}}return r}),{})),zr}}class yc{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(e),s=this.buildParsingContext(n),o=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(e){var n=this;return Nt((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&se(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,i;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),z({},e,{cause:r,stack:i})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return Nt((function*(){var r=e;for(var i of n.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,n){var r,i,s,o={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(s=e.synthetic)!==null&&s!==void 0&&s}};e.stack&&(o.stacktrace={type:"raw",frames:e.stack});var a=[o];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,z({},n,{handled:!0}))),a}buildParsingContext(e){var n;return{chunkIdMap:_c(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var i=(s,o)=>{if(o<=4){var a=this.buildCoercingContext(e,n,o);return this.applyCoercers(s,a)}};return z({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:s=>i(s,r),next:s=>i(s,r+1)})}}var Wt="?";function Si(t,e,n,r,i){var s={platform:t,filename:e,function:n==="<anonymous>"?Wt:n,in_app:!0};return O(r)||(s.lineno=r),O(i)||(s.colno=i),s}var Ya=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Wt,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},bc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,xc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,kc=/\((\S*)(?::(\d+))(?::(\d+))\)/,wc=(t,e)=>{var n=bc.exec(t);if(n){var[,r,i,s]=n;return Si(e,r,Wt,+i,+s)}var o=xc.exec(t);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=kc.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=Ya(o[1]||Wt,o[2]);return Si(e,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Ec=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Sc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Cc=(t,e)=>{var n=Ec.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Sc.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||Wt;return[s,i]=Ya(s,i),Si(e,i,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Hs=/\(error: (.*)\)/,Us=50;function Pc(){return(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(i,s){s===void 0&&(s=0);for(var o=[],a=i.split(`
2
- `),l=s;l<a.length;l++){var u=a[l];if(!(u.length>1024)){var c=Hs.test(u)?u.replace(Hs,"$1"):u;if(!c.match(/\S*Error: /)){for(var h of n){var p=h(c,t);if(p){o.push(p);break}}if(o.length>=Us)break}}}return(function(f){if(!f.length)return[];var d=Array.from(f);return d.reverse(),d.slice(0,Us).map((v=>{return z({},v,{filename:v.filename||(y=d,y[y.length-1]||{}).filename,function:v.function||Wt});var y}))})(o)}})("web:javascript",wc,Cc)}class Ic{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=_e(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return or(e,"DOMException")}isDOMError(e){return or(e,"DOMError")}}class Tc{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Ac{constructor(){}match(e){return or(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r,i=n.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var Fc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Rc{match(e){return typeof e=="string"}coerce(e,n){var r,[i,s]=this.getInfos(e);return{type:i??"Error",value:s??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,i=e.match(Fc);return i&&(n=i[1],r=i[2]),[n,r]}}var Oc=["fatal","error","warning","log","info","debug"];function Xa(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length||i.length<=e?i:i.slice(0,e)+"..."}return""}class Dc{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Fa(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+Xa(e)}isSeverityLevel(e){return _e(e)&&!bi(e)&&Oc.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(vc(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class Mc{match(e){return Fa(e)}coerce(e,n){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Xa(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class Lc{match(e){return xi(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class $c{match(e){return or(e,"PromiseRejectionEvent")}coerce(e,n){var r,i=this.getUnhandledRejectionReason(e);return xi(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){if(xi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var Ja=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k:function(i){if(k&&(tt.DEBUG||q.POSTHOG_DEBUG||n)&&!O(k.console)&&k.console){for(var s=("__rrweb_original__"in k.console[i])?k.console[i].__rrweb_original__:k.console[i],o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];s(t,...a)}},info:function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];r.k("log",...s)},warn:function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];r.k("warn",...s)},error:function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];r.k("error",...s)},critical:function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o]},uninitializedWarning:i=>{r.error("You must initialize PostHog before calling "+i)},createLogger:(i,s)=>Ja(t+" "+i,s)};return r},$=Ja("[PostHog.js]"),pe=$.createLogger,zc=pe("[ExternalScriptsLoader]"),Vs=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return zc.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=M==null?void 0:M.querySelectorAll("script");if(r){for(var i,s=function(){if(r[o].src===e){var l=r[o];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(u=>{l.__posthog_loading_callback_fired=!0,n(void 0,u)})),l.onerror=u=>n(u),{v:void 0})}},o=0;o<r.length;o++)if(i=s())return i.v}var a=()=>{if(!M)return n("document not found");var l=M.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=h=>{l.__posthog_loading_callback_fired=!0,n(void 0,h)},l.onerror=h=>n(h),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")M.head.appendChild(l);else{var u,c=M.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):M.body.appendChild(l)}};M!=null&&M.body?a():M==null||M.addEventListener("DOMContentLoaded",a)};q.__PosthogExtensions__=q.__PosthogExtensions__||{},q.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var i=3e5;r=r+"&t="+Math.floor(Date.now()/i)*i}var s=t.requestRouter.endpointFor("assets",r);Vs(t,s,n)},q.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);Vs(t,r,n)};var lr={};function mt(t,e,n){if(se(t)){if(Ds&&t.forEach===Ds)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===lr)return}}}function ce(t,e,n){if(!Z(t)){if(se(t))return mt(t,e,n);if(nc(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===lr)return}else for(var i in t)if(Aa.call(t,i)&&e.call(n,t[i],i)===lr)return}}var de=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return mt(n,(function(i){for(var s in i)i[s]!==void 0&&(t[s]=i[s])})),t},Xt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return mt(n,(function(i){mt(i,(function(s){t.push(s)}))})),t};function rr(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var Ws=function(t){try{return t()}catch{return}},Nc=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){$.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$.critical(i)}}},os=function(t){var e={};return ce(t,(function(n,r){(_e(n)&&n.length>0||at(n))&&(e[r]=n)})),e};function Bc(t,e){return n=t,r=s=>_e(s)&&!Ve(e)?s.slice(0,e):s,i=new Set,(function s(o,a){return o!==Object(o)?r?r(o,a):o:i.has(o)?void 0:(i.add(o),se(o)?(l=[],mt(o,(u=>{l.push(s(u))}))):(l={},ce(o,((u,c)=>{i.has(u)||(l[c]=s(u,c))}))),l);var l})(n);var n,r,i}var jc=["herokuapp.com","vercel.app","netlify.app"];function qc(t){var e=t==null?void 0:t.hostname;if(!_e(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of jc)if(n===r)return!1;return!0}function Ka(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function me(t,e,n,r){var{capture:i=!1,passive:s=!0}=r??{};t==null||t.addEventListener(e,n,{capture:i,passive:s})}var Qa="$people_distinct_id",yn="__alias",bn="__timers",Gs="$autocapture_disabled_server_side",Ci="$heatmaps_enabled_server_side",Ys="$exception_capture_enabled_server_side",Pi="$error_tracking_suppression_rules",Xs="$error_tracking_capture_extension_exceptions",Js="$web_vitals_enabled_server_side",Za="$dead_clicks_enabled_server_side",Ks="$product_tours_enabled_server_side",Qs="$web_vitals_allowed_metrics",Nr="$session_recording_remote_config",ur="$sesid",el="$session_is_sampled",jt="$enabled_feature_flags",xn="$early_access_features",Ii="$feature_flag_details",kn="$stored_person_properties",Et="$stored_group_properties",Ti="$surveys",cr="$flag_call_reported",Ai="$feature_flag_errors",nt="$user_state",Fi="$client_session_props",Ri="$capture_rate_limit",Oi="$initial_campaign_params",Di="$initial_referrer_info",hr="$initial_person_info",fr="$epp",tl="__POSTHOG_TOOLBAR__",sn="$posthog_cookieless",Hc=[Qa,yn,"__cmpns",bn,"$session_recording_enabled_server_side",Ci,ur,jt,Pi,nt,xn,Ii,Et,kn,Ti,cr,Ai,Fi,Ri,Oi,Di,fr,hr,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function Zs(t){return t instanceof Element&&(t.id===tl||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Pr(t){return!!t&&t.nodeType===1}function vt(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function nl(t){return!!t&&t.nodeType===3}function rl(t){return!!t&&t.nodeType===11}function as(t){return t?Sr(t).split(/\s+/):[]}function eo(t){var e=k==null?void 0:k.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function pr(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return as(e)}function il(t){return Z(t)?null:Sr(t).split(/(\s+)/).filter((e=>$n(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Bn(t){var e="";return Mi(t)&&!ul(t)&&t.childNodes&&t.childNodes.length&&ce(t.childNodes,(function(n){var r;nl(n)&&n.textContent&&(e+=(r=il(n.textContent))!==null&&r!==void 0?r:"")})),Sr(e)}function sl(t){return O(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var ls=["a","button","form","input","select","textarea","label"];function ol(t,e){if(O(e))return!0;var n,r=function(s){if(e.some((o=>s.matches(o))))return{v:!0}};for(var i of t)if(n=r(i))return n.v;return!1}function al(t){var e=t.parentNode;return!(!e||!Pr(e))&&e}var Uc=["next","previous","prev",">","<"],to=10,no=[".ph-no-rageclick",".ph-no-capture"];function Vc(t,e){if(!k||us(t))return!1;var n,r,i;if(ot(e)?(n=!!e&&no,r=void 0):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:no,r=e==null?void 0:e.content_ignorelist),n===!1)return!1;var{targetElementList:s}=ll(t,!1);return!(function(o,a){if(o===!1||O(o))return!1;var l;if(o===!0)l=Uc;else{if(!se(o))return!1;if(o.length>to)return $.error("[PostHog] content_ignorelist array cannot exceed "+to+" items. Use css_selector_ignorelist for more complex matching."),!1;l=o.map((u=>u.toLowerCase()))}return a.some((u=>{var{safeText:c,ariaLabel:h}=u;return l.some((p=>c.includes(p)||h.includes(p)))}))})(r,s.map((o=>{var a;return{safeText:Bn(o).toLowerCase(),ariaLabel:((a=o.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}})))&&!ol(s,n)}var us=t=>!t||vt(t,"html")||!Pr(t),ll=(t,e)=>{if(!k||us(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],i=t;i.parentNode&&!vt(i,"body");)if(rl(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=al(i);if(!s)break;if(e||ls.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var o=k.getComputedStyle(s);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function Wc(t,e,n,r,i){var s,o,a,l;if(n===void 0&&(n=void 0),!k||us(t)||(s=n)!=null&&s.url_allowlist&&!eo(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&eo(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some((d=>e.type===d)))return!1}var{parentIsUsefulElement:c,targetElementList:h}=ll(t,r);if(!(function(d,v){var y=v==null?void 0:v.element_allowlist;if(O(y))return!0;var _,w=function(F){if(y.some((C=>F.tagName.toLowerCase()===C)))return{v:!0}};for(var E of d)if(_=w(E))return _.v;return!1})(h,n)||!ol(h,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var p=k.getComputedStyle(t);if(p&&p.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var f=t.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return c?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(ls.indexOf(f)>-1||t.getAttribute("contenteditable")==="true")}}function Mi(t){for(var e=t;e.parentNode&&!vt(e,"body");e=e.parentNode){var n=pr(e);if(K(n,"ph-sensitive")||K(n,"ph-no-capture"))return!1}if(K(pr(t),"ph-include"))return!0;var r=t.type||"";if(_e(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(_e(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function ul(t){return!!(vt(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||vt(t,"select")||vt(t,"textarea")||t.getAttribute("contenteditable")==="true")}var cl="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Gc=new RegExp("^(?:"+cl+")$"),Yc=new RegExp(cl),hl="\\d{3}-?\\d{2}-?\\d{4}",Xc=new RegExp("^("+hl+")$"),Jc=new RegExp("("+hl+")");function $n(t,e){return e===void 0&&(e=!0),!(Z(t)||_e(t)&&(t=Sr(t),(e?Gc:Yc).test((t||"").replace(/[- ]/g,""))||(e?Xc:Jc).test(t)))}function fl(t){var e=Bn(t);return $n(e=(e+" "+pl(t)).trim())?e:""}function pl(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ce(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Bn(n);e=(e+" "+i).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+pl(n)).trim())}catch(s){$.error("[AutoCapture]",s)}})),e}function Kc(t){return(function(e){var n=e.map((r=>{var i,s,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))o+="."+a.replace(/"/g,"");var l=z({},r.text?{text:r.text}:{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),u={};return rr(l).sort(((c,h)=>{var[p]=c,[f]=h;return p.localeCompare(f)})).forEach((c=>{var[h,p]=c;return u[ro(h.toString())]=ro(p.toString())})),o+=":",o+=rr(u).map((c=>{var[h,p]=c;return h+'="'+p+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var r,i,s={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)==null?void 0:i.slice(0,2048),attr_class:Qc(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return rr(n).filter((o=>{var[a]=o;return a.indexOf("attr__")===0})).forEach((o=>{var[a,l]=o;return s.attributes[a]=l})),s}))})(t))}function ro(t){return t.replace(/"|\\"/g,'\\"')}function Qc(t){var e=t.attr__class;return e?se(e)?e:as(e):void 0}class dl{constructor(e){this.disabled=e===!1;var n=ve(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var dr=t=>{var e=M==null?void 0:M.createElement("a");return O(e)?null:(e.href=t,e)},Zc=function(t,e){var n,r;e===void 0&&(e="&");var i=[];return ce(t,(function(s,o){O(s)||O(o)||o==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(s)?s.name:s.toString()),r=encodeURIComponent(o),i[i.length]=r+"="+n)})),i.join(e)},gr=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var s=r[i].split("=");if(s[0]===e){n=s;break}}if(!se(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{$.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},jn=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[0]||"",s=r[1],o=i.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),c=[],h=0;h<u.length;h++){var p=u[h].split("=");se(p)&&(e.includes(p[0])?c.push(p[0]+"="+n):c.push(u[h]))}var f=l;return a!=null&&(f+="?"+c.join("&")),s!=null&&(f+="#"+s),f},mr=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Br="$copy_autocapture",io=pe("[AutoCapture]");function jr(t,e){return e.length>t?e.slice(0,t)+"...":e}function eh(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Pr(e));return e}function th(t,e,n,r){var i=t.tagName.toLowerCase(),s={tag_name:i};ls.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?s.$el_text=jr(1024,fl(t)):s.$el_text=jr(1024,Bn(t)));var o=pr(t);o.length>0&&(s.classes=o.filter((function(c){return c!==""}))),ce(t.attributes,(function(c){var h;if((!ul(t)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(r==null||!r.includes(c.name))&&!e&&$n(c.value)&&(h=c.name,!_e(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var p=c.value;c.name==="class"&&(p=as(p).join(" ")),s["attr__"+c.name]=jr(1024,p)}}));for(var a=1,l=1,u=t;u=eh(u);)a++,u.tagName===t.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}function nh(t,e){for(var n,r,{e:i,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,u=[t],c=t;c.parentNode&&!vt(c,"body");)rl(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var h,p=[],f={},d=!1,v=!1;if(ce(u,(F=>{var C=Mi(F);F.tagName.toLowerCase()==="a"&&(d=F.getAttribute("href"),d=C&&d&&$n(d)&&d),K(pr(F),"ph-no-capture")&&(v=!0),p.push(th(F,s,o,a));var x=(function(N){if(!Mi(N))return{};var T={};return ce(N.attributes,(function(U){if(U.name&&U.name.indexOf("data-ph-capture-attribute")===0){var b=U.name.replace("data-ph-capture-attribute-",""),D=U.value;b&&D&&$n(D)&&(T[b]=D)}})),T})(F);de(f,x)})),v)return{props:{},explicitNoCapture:v};if(o||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?p[0].$el_text=fl(t):p[0].$el_text=Bn(t)),d){var y,_;p[0].attr__href=d;var w=(y=dr(d))==null?void 0:y.host,E=k==null||(_=k.location)==null?void 0:_.host;w&&E&&w!==E&&(h=d)}return{props:de({$event_type:i.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:Kc(p)},(n=p[0])!=null&&n.$el_text?{$el_text:(r=p[0])==null?void 0:r.$el_text}:{},h&&i.type==="click"?{$external_click_url:h}:{},f)}}class rh{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new dl(e.config.rageclick),this.C=null}get R(){var e,n,r=ve(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((i=>new RegExp(i))),r.url_ignorelist=(n=r.url_ignorelist)==null?void 0:n.map((i=>new RegExp(i))),r}F(){if(this.isBrowserSupported()){if(k&&M){var e=r=>{r=r||(k==null?void 0:k.event);try{this.O(r)}catch(i){io.error("Failed to capture event",i)}};if(me(M,"submit",e,{capture:!0}),me(M,"change",e,{capture:!0}),me(M,"click",e,{capture:!0}),this.R.capture_copied_text){var n=r=>{r=r||(k==null?void 0:k.event),this.O(r,Br)};me(M,"copy",n,{capture:!0}),me(M,"cut",n,{capture:!0})}}}else io.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Gs]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var n,r=[];return(n=this.C)==null||n.forEach((i=>{var s=M==null?void 0:M.querySelectorAll(i);s==null||s.forEach((o=>{e===o&&r.push(i)}))})),r}get isEnabled(){var e,n,r=(e=this.instance.persistence)==null?void 0:e.props[Gs],i=this.T;if(Ve(i)&&!ot(r)&&!this.instance.M())return!1;var s=(n=this.T)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!s}O(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,i=sl(e);nl(i)&&(i=i.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&Vc(i,this.instance.config.rageclick)&&this.O(e,"$rageclick");var s=n===Br;if(i&&Wc(i,e,this.R,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=nh(i,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(a)return!1;var l=this.getElementSelectors(i);if(l&&l.length>0&&(o.$element_selectors=l),n===Br){var u,c=il(k==null||(u=k.getSelection())==null?void 0:u.toString()),h=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=h}return this.instance.capture(n,o),!0}}}isBrowserSupported(){return gt(M==null?void 0:M.querySelectorAll)}}Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return at(t)&&isFinite(t)&&Math.floor(t)===t});var so="0123456789abcdef";class vr{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||n<0||r<0||i<0||e>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new vr(s)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+so.charAt(this.bytes[n]>>>4)+so.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new vr(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class ih{constructor(){this.A=0,this.j=0,this.D=new sh}generate(){var e=this.generateOrAbort();if(O(e)){this.A=0;var n=this.generateOrAbort();if(O(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.j++,this.j>4398046511103&&(this.A++,this.L())}return vr.fromFieldsV7(this.A,Math.trunc(this.j/Math.pow(2,30)),this.j&Math.pow(2,30)-1,this.D.nextUint32())}L(){this.j=1024*this.D.nextUint32()+(1023&this.D.nextUint32())}}var oo,gl=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};k&&!O(k.crypto)&&crypto.getRandomValues&&(gl=t=>crypto.getRandomValues(t));class sh{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(gl(this.N),this.U=0),this.N[this.U++]}}var dt=()=>oh().toString(),oh=()=>(oo||(oo=new ih)).generate(),on="",ah=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function lh(t,e){if(e){var n=(function(i,s){if(s===void 0&&(s=M),on)return on;if(!s||["localhost","127.0.0.1"].includes(i))return"";for(var o=i.split("."),a=Math.min(o.length,8),l="dmn_chk_"+dt();!on&&a--;){var u=o.slice(a).join("."),c=l+"=1;domain=."+u+";path=/";s.cookie=c+";max-age=3",s.cookie.includes(l)&&(s.cookie=c+";max-age=0",on=u)}return on})(t);if(!n){var r=(i=>{var s=i.match(ah);return s?s[0]:""})(t);r!==n&&$.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var Ye={H:()=>!!M,B:function(t){$.error("cookieStore error: "+t)},q:function(t){if(M){try{for(var e=t+"=",n=M.cookie.split(";").filter((s=>s.length)),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(Ye.q(t))||{}}catch{}return e},G:function(t,e,n,r,i){if(M)try{var s="",o="",a=lh(M.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}i&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&$.warn("cookieStore warning: large cookie, len="+u.length),M.cookie=u,u}catch{return}},V:function(t,e){if(M!=null&&M.cookie)try{Ye.G(t,"",-1,e)}catch{return}}},qr=null,fe={H:function(){if(!Ve(qr))return qr;var t=!0;if(O(k))t=!1;else try{var e="__mplssupport__";fe.G(e,"xyz"),fe.q(e)!=='"xyz"'&&(t=!1),fe.V(e)}catch{t=!1}return t||$.error("localStorage unsupported; falling back to cookie store"),qr=t,t},B:function(t){$.error("localStorage error: "+t)},q:function(t){try{return k==null?void 0:k.localStorage.getItem(t)}catch(e){fe.B(e)}return null},W:function(t){try{return JSON.parse(fe.q(t))||{}}catch{}return null},G:function(t,e){try{k==null||k.localStorage.setItem(t,JSON.stringify(e))}catch(n){fe.B(n)}},V:function(t){try{k==null||k.localStorage.removeItem(t)}catch(e){fe.B(e)}}},uh=["$device_id","distinct_id",ur,el,fr,hr],Xn={},ch={H:function(){return!0},B:function(t){$.error("memoryStorage error: "+t)},q:function(t){return Xn[t]||null},W:function(t){return Xn[t]||null},G:function(t,e){Xn[t]=e},V:function(t){delete Xn[t]}},bt=null,be={H:function(){if(!Ve(bt))return bt;if(bt=!0,O(k))bt=!1;else try{var t="__support__";be.G(t,"xyz"),be.q(t)!=='"xyz"'&&(bt=!1),be.V(t)}catch{bt=!1}return bt},B:function(t){$.error("sessionStorage error: ",t)},q:function(t){try{return k==null?void 0:k.sessionStorage.getItem(t)}catch(e){be.B(e)}return null},W:function(t){try{return JSON.parse(be.q(t))||null}catch{}return null},G:function(t,e){try{k==null||k.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){be.B(n)}},V:function(t){try{k==null||k.sessionStorage.removeItem(t)}catch(e){be.B(e)}}},rt=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({});class hh{constructor(e){this._instance=e}get R(){return this._instance.config}get consent(){return this.J()?rt.DENIED:this.K}isOptedOut(){return this.R.cookieless_mode==="always"||this.consent===rt.DENIED||this.consent===rt.PENDING&&(this.R.opt_out_capturing_by_default||this.R.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===rt.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie)}reset(){this.Y.V(this.X,this.R.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Lr(e)?rt.GRANTED:K(sc,e)?rt.DENIED:rt.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?fe:Ye;var n=e==="localStorage"?Ye:fe;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Lr(n.q(this.X))),n.V(this.X,this.R.cross_subdomain_cookie))}return this.Z}J(){return!!this.R.respect_dnt&&!!Ka([Le==null?void 0:Le.doNotTrack,Le==null?void 0:Le.msDoNotTrack,q.doNotTrack],(e=>Lr(e)))}}var Jn=pe("[Dead Clicks]"),fh=()=>!0,ph=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Za)),r=t.instance.config.capture_dead_clicks;return ot(r)?r:!!ve(r)||n};class ml{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Za]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabledOrStop()}startIfEnabledOrStop(){this.isEnabled(this)?this.it((()=>{this.et()})):this.stop()}it(e){var n,r;(n=q.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?Jn.error("failed to load script",i):e()}))}et(){var e;if(M){if(!this.tt&&(e=q.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=ve(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=q.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(M),Jn.info("starting...")}}else Jn.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Jn.info("stopping..."))}}var an=pe("[ExceptionAutocapture]");class dh{constructor(e){var n,r,i;this.rt=()=>{var s;if(k&&this.isEnabled&&(s=q.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var o=q.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=q.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=q.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=o(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=a(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){an.error("failed to start",u),this.ut()}}},this._instance=e,this.ht=!((n=this._instance.persistence)==null||!n.props[Ys]),this.dt=new oc({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10,refillInterval:1e4,h:an}),this.R=this.vt(),this.startIfEnabledOrStop()}vt(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ve(e)?n=z({},n,e):(O(e)?this.ht:e)&&(n=z({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(an.info("enabled"),this.ut(),this.it(this.rt)):this.ut()}it(e){var n,r;(n=q.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(r=q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return an.error("failed to load script",i);e()}))}ut(){var e,n,r;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ht=!!n||!1,this._instance.persistence&&this._instance.persistence.register({[Ys]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop()}onConfigChange(){this.R=this.vt()}captureException(e){var n,r,i=(n=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&n!==void 0?n:"Exception";this.dt.consumeRateLimit(i)?an.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}}function ao(t,e,n){try{if(!(e in t))return()=>{};var r=t[e],i=n(r);return gt(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}class gh{constructor(e){var n;this._instance=e,this.ct=(k==null||(n=k.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&($.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ft&&this.ft(),this.ft=void 0,$.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(k&&k.history){var r=this;(e=k.history.pushState)!=null&&e.__posthog_wrapped__||ao(k.history,"pushState",(i=>function(s,o,a){i.call(this,s,o,a),r._t("pushState")})),(n=k.history.replaceState)!=null&&n.__posthog_wrapped__||ao(k.history,"replaceState",(i=>function(s,o,a){i.call(this,s,o,a),r._t("replaceState")})),this.bt()}}_t(e){try{var n,r=k==null||(n=k.location)==null?void 0:n.pathname;if(!r)return;r!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=r}catch(i){$.error("Error capturing "+e+" pageview",i)}}bt(){if(!this.ft){var e=()=>{this._t("popstate")};me(k,"popstate",e),this.ft=()=>{k&&k.removeEventListener("popstate",e)}}}}var Hr=pe("[SegmentIntegration]");function mh(t,e){var n=t.config.segment;if(!n)return e();(function(r,i){var s=r.config.segment;if(!s)return i();var o=l=>{var u=()=>l.anonymousId()||dt();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(nt,"identified")),i()},a=s.user();"then"in a&&gt(a.then)?a.then(o):o(a)})(t,(()=>{n.register((r=>{Promise&&Promise.resolve||Hr.warn("This browser does not have Promise support, and can not use the segment integration");var i=(s,o)=>{if(!o)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(Hr.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(Hr.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var a=r.calculateEventProperties(o,s.event.properties);return s.event.properties=Object.assign({},a,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>i(s,s.event.event),page:s=>i(s,"$pageview"),identify:s=>i(s,"$identify"),screen:s=>i(s,"$screen")}})(t)).then((()=>{e()}))}))}var vl="posthog-js";function _l(t,e){var{organization:n,projectId:r,prefix:i,severityAllowList:s=["error"],sendExceptionsToPostHog:o=!0}=e===void 0?{}:e;return a=>{var l,u,c,h,p;if(!(s==="*"||s.includes(a.level))||!t.__loaded)return a;a.tags||(a.tags={});var f=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());a.tags["PostHog Person URL"]=f,t.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var d=((l=a.exception)==null?void 0:l.values)||[],v=d.map((_=>z({},_,{stacktrace:_.stacktrace?z({},_.stacktrace,{type:"raw",frames:(_.stacktrace.frames||[]).map((w=>z({},w,{platform:"web:javascript"})))}):void 0}))),y={$exception_message:((u=d[0])==null?void 0:u.value)||a.message,$exception_type:(c=d[0])==null?void 0:c.type,$exception_level:a.level,$exception_list:v,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((h=d[0])==null?void 0:h.value)||a.message,$sentry_exception_type:(p=d[0])==null?void 0:p.type,$sentry_tags:a.tags};return n&&r&&(y.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),o&&t.exceptions.sendExceptionEvent(y),a}}class vh{constructor(e,n,r,i,s,o){this.name=vl,this.setupOnce=function(a){a(_l(e,{organization:n,projectId:r,prefix:i,severityAllowList:s,sendExceptionsToPostHog:o==null||o}))}}}var _h=k!=null&&k.location?mr(k.location.hash,"__posthog")||mr(location.hash,"state"):null,lo="_postHogToolbarParams",uo=pe("[Toolbar]"),pt=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(pt||{});class yh{constructor(e){this.instance=e}yt(e){q.ph_toolbar_state=e}wt(){var e;return(e=q.ph_toolbar_state)!==null&&e!==void 0?e:pt.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.instance.config.name&&this.instance.config.name==="ph_toolbar_internal"||!k||!M)return!1;e=e??k.location,r=r??k.history;try{if(!n){try{k.localStorage.setItem("test","test"),k.localStorage.removeItem("test")}catch{return!1}n=k==null?void 0:k.localStorage}var i,s=_h||mr(e.hash,"__posthog")||mr(e.hash,"state"),o=s?Ws((()=>JSON.parse(atob(decodeURIComponent(s)))))||Ws((()=>JSON.parse(decodeURIComponent(s)))):null;return o&&o.action==="ph_authorize"?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?e.hash=o.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(n.getItem(lo)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}xt(e){var n=q.ph_load_toolbar||q.ph_load_editor;!Z(n)&&gt(n)?n(e,this.instance):uo.warn("No toolbar load function found")}loadToolbar(e){var n=!(M==null||!M.getElementById(tl));if(!k||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=z({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(k.localStorage.setItem(lo,JSON.stringify(z({},i,{source:void 0}))),this.wt()===pt.LOADED)this.xt(i);else if(this.wt()===pt.UNINITIALIZED){var s;this.yt(pt.LOADING),(s=q.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(o=>{if(o)return uo.error("[Toolbar] Failed to load",o),void this.yt(pt.UNINITIALIZED);this.yt(pt.LOADED),this.xt(i)})),me(k,"turbolinks:load",(()=>{this.yt(pt.UNINITIALIZED),this.loadToolbar(i)}))}return!0}Et(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,r){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,n,r)}}var bh=pe("[TracingHeaders]");class xh{constructor(e){this.$t=void 0,this.St=void 0,this.rt=()=>{var n,r;O(this.$t)&&((n=q.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),O(this.St)&&((r=q.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,r;(n=q.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(r=q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return bh.error("failed to load script",i);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.$t)==null||e.call(this),(n=this.St)==null||n.call(this),this.$t=void 0,this.St=void 0)}}var Kn="https?://(.*)",Jt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],kh=Xt(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Jt),qn="<masked>",wh=["li_fat_id"];function yl(t,e,n){if(!M)return{};var r,i=e?Xt([],Jt,n||[]):[],s=bl(jn(M.URL,i,qn),t),o=(r={},ce(wh,(function(a){var l=Ye.q(a);r[a]=l||null})),r);return de(o,s)}function bl(t,e){var n=kh.concat(e||[]),r={};return ce(n,(function(i){var s=gr(t,i);r[i]=s||null})),r}function xl(t){var e=(function(s){return s?s.search(Kn+"google.([^/?]*)")===0?"google":s.search(Kn+"bing.com")===0?"bing":s.search(Kn+"yahoo.com")===0?"yahoo":s.search(Kn+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!Ve(e)){r.$search_engine=e;var i=M?gr(M.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function co(){return navigator.language||navigator.userLanguage}function kl(){return(M==null?void 0:M.referrer)||"$direct"}function wl(t,e){var n=t?Xt([],Jt,e||[]):[],r=xe==null?void 0:xe.href.substring(0,1e3);return{r:kl().substring(0,1e3),u:r?jn(r,n,qn):void 0}}function El(t){var e,{r:n,u:r}=t,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=dr(n))==null?void 0:e.host};if(r){i.$current_url=r;var s=dr(r);i.$host=s==null?void 0:s.host,i.$pathname=s==null?void 0:s.pathname;var o=bl(r);de(i,o)}if(n){var a=xl(n);de(i,a)}return i}function Sl(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Eh(){try{return new Date().getTimezoneOffset()}catch{return}}function Sh(t,e){if(!Ae)return{};var n,r,i,s=t?Xt([],Jt,e||[]):[],[o,a]=(function(l){for(var u=0;u<js.length;u++){var[c,h]=js[u],p=c.exec(l),f=p&&(gt(h)?h(p,l):h);if(f)return f}return["",""]})(Ae);return de(os({$os:o,$os_version:a,$browser:Ga(Ae,navigator.vendor),$device:qs(Ae),$device_type:(r=Ae,i=qs(r),i===Oa||i===Ra||i==="Kobo"||i==="Kindle Fire"||i===Wa?On:i===Mn||i===Ht||i===Ln||i===wi?"Console":i===Ma?"Wearable":i?Be:"Desktop"),$timezone:Sl(),$timezone_offset:Eh()}),{$current_url:jn(xe==null?void 0:xe.href,s,qn),$host:xe==null?void 0:xe.host,$pathname:xe==null?void 0:xe.pathname,$raw_user_agent:Ae.length>1e3?Ae.substring(0,997)+"...":Ae,$browser_version:mc(Ae,navigator.vendor),$browser_language:co(),$browser_language_prefix:(n=co(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:k==null?void 0:k.screen.height,$screen_width:k==null?void 0:k.screen.width,$viewport_height:k==null?void 0:k.innerHeight,$viewport_width:k==null?void 0:k.innerWidth,$lib:"web",$lib_version:tt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ct=pe("[Web Vitals]"),ho=9e5;class Ch{constructor(e){var n;this.kt=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((r,i)=>z({},r,{["$web_vitals_"+i.name+"_event"]:z({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.It=r=>{var i,s=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(!0);if(O(s))ct.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this.Ct();O(o)||(Z(r==null?void 0:r.name)||Z(r==null?void 0:r.value)?ct.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?ct.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==o&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),O(this.N.url)&&(this.N.url=o),this.N.firstMetricTimestamp=O(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(z({},r,{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()))}},this.rt=()=>{if(!this.P){var r,i,s,o,a=q.__PosthogExtensions__;O(a)||O(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:s,onINP:o}=a.postHogWebVitalsCallbacks),r&&i&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this.It.bind(this)),this.P=!0):ct.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.kt=!((n=this._instance.persistence)==null||!n.props[Js]),this.startIfEnabled()}get allowedMetrics(){var e,n,r=ve(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return Z(r)?((n=this._instance.persistence)==null?void 0:n.props[Qs])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(ve(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=ve(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get Rt(){var e=ve(this._instance.config.capture_performance)&&at(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:ho;return 0<e&&e<=6e4?ho:e}get isEnabled(){var e=xe==null?void 0:xe.protocol;if(e!=="http:"&&e!=="https:")return ct.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=ve(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ot(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ot(n)?n:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(ct.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=ve(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=ve(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Js]:n}),this._instance.persistence.register({[Qs]:r})),this.kt=n,this.startIfEnabled()}it(e){var n,r;if((n=q.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks)e();else{var i=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(r=q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,i,(s=>{s?ct.error("failed to load script",s):e()}))}}Ct(){var e=k?k.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=n?Xt([],Jt,r||[]):[];return jn(e,i,qn)}ct.error("Could not determine current URL")}}var Ph=pe("[Heatmaps]");function fo(t){return ve(t)&&"clientX"in t&&"clientY"in t&&at(t.clientX)&&at(t.clientY)}class Ih{constructor(e){var n;this.kt=!1,this.P=!1,this.Ft=null,this.instance=e,this.kt=!((n=this.instance.persistence)==null||!n.props[Ci]),this.rageclicks=new dl(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return ve(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Z(this.instance.config.capture_heatmaps)?Z(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;Ph.info("starting..."),this.Ot(),this.Mt()}else{var e;clearInterval((e=this.Ft)!==null&&e!==void 0?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ci]:n}),this.kt=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}jt(e){this.Dt(e.originalEvent,"deadclick")}Mt(){this.Ft&&clearInterval(this.Ft),this.Ft=(function(e){return(e==null?void 0:e.visibilityState)==="visible"})(M)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null}Ot(){k&&M&&(this.Nt=this.Lt.bind(this),me(k,"beforeunload",this.Nt),this.Ut=e=>this.Dt(e||(k==null?void 0:k.event)),me(M,"click",this.Ut,{capture:!0}),this.zt=e=>this.Ht(e||(k==null?void 0:k.event)),me(M,"mousemove",this.zt,{capture:!0}),this.Bt=new ml(this.instance,fh,this.jt.bind(this)),this.Bt.startIfEnabledOrStop(),this.qt=this.Mt.bind(this),me(M,"visibilitychange",this.qt),this.P=!0)}At(){var e;k&&M&&(this.Nt&&k.removeEventListener("beforeunload",this.Nt),this.Ut&&M.removeEventListener("click",this.Ut,{capture:!0}),this.zt&&M.removeEventListener("mousemove",this.zt,{capture:!0}),this.qt&&M.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),(e=this.Bt)==null||e.stop(),this.P=!1)}Gt(e,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=(function(a,l,u){for(var c=a;c&&Pr(c)&&!vt(c,"body");){if(c===u)return!1;if(K(l,k==null?void 0:k.getComputedStyle(c).position))return!0;c=al(c)}return!1})(sl(e),["fixed","sticky"],s);return{x:e.clientX+(o?0:i),y:e.clientY+(o?0:r),target_fixed:o,type:n}}Dt(e,n){var r;if(n===void 0&&(n="click"),!Zs(e.target)&&fo(e)){var i=this.Gt(e,n);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Vt(z({},i,{type:"rageclick"})),this.Vt(i)}}Ht(e){!Zs(e.target)&&fo(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout((()=>{this.Vt(this.Gt(e,"mousemove"))}),500))}Vt(e){if(k){var n=k.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,s=r?Xt([],Jt,i||[]):[],o=jn(n,s,qn);this.N=this.N||{},this.N[o]||(this.N[o]=[]),this.N[o].push(e)}}Lt(){this.N&&!Bt(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class po{constructor(e){this.Jt=(n,r,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&($.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:i}),this.Kt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Yt()}Yt(){var e;this.Xt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Jt)}destroy(){var e;(e=this.Xt)==null||e.call(this),this.Xt=void 0}doPageView(e,n){var r,i=this.Qt(e,n);return this.Kt={pathname:(r=k==null?void 0:k.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.Qt(e,(n=this.Kt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Kt)==null?void 0:e.pageViewId}}Qt(e,n){var r=this.Kt;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:a,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:h}=s;if(!(O(o)||O(a)||O(l)||O(u)||O(c)||O(h))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),h=Math.ceil(h);var p=o<=1?1:Xe(a/o,0,1,$),f=o<=1?1:Xe(l/o,0,1,$),d=u<=1?1:Xe(c/u,0,1,$),v=u<=1?1:Xe(h/u,0,1,$);i=de(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:d,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:v})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}}var it=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),je=Uint8Array,Fe=Uint16Array,Gt=Uint32Array,cs=new je([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),hs=new je([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),go=new je([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cl=function(t,e){for(var n=new Fe(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new Gt(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},Pl=Cl(cs,2),Th=Pl[0],Li=Pl[1];Th[28]=258,Li[258]=28;for(var mo=Cl(hs,0)[1],Il=new Fe(32768),he=0;he<32768;++he){var xt=(43690&he)>>>1|(21845&he)<<1;xt=(61680&(xt=(52428&xt)>>>2|(13107&xt)<<2))>>>4|(3855&xt)<<4,Il[he]=((65280&xt)>>>8|(255&xt)<<8)>>>1}var In=function(t,e,n){for(var r=t.length,i=0,s=new Fe(e);i<r;++i)++s[t[i]-1];var o,a=new Fe(e);for(i=0;i<e;++i)a[i]=a[i-1]+s[i-1]<<1;for(o=new Fe(r),i=0;i<r;++i)o[i]=Il[a[t[i]-1]++]>>>15-t[i];return o},Ct=new je(288);for(he=0;he<144;++he)Ct[he]=8;for(he=144;he<256;++he)Ct[he]=9;for(he=256;he<280;++he)Ct[he]=7;for(he=280;he<288;++he)Ct[he]=8;var _r=new je(32);for(he=0;he<32;++he)_r[he]=5;var Ah=In(Ct,9),Fh=In(_r,5),Tl=function(t){return(t/8>>0)+(7&t&&1)},Al=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Fe?Fe:t instanceof Gt?Gt:je)(n-e);return r.set(t.subarray(e,n)),r},Ze=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},ln=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Ur=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,s=n.slice();if(!i)return[new je(0),0];if(i==1){var o=new je(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(C,x){return C.f-x.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[h].f?u++:h++],l=n[u!=c&&n[u].f<n[h].f?u++:h++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var p=s[0].s;for(r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var f=new Fe(p+1),d=$i(n[c-1],f,0);if(d>e){r=0;var v=0,y=d-e,_=1<<y;for(s.sort((function(C,x){return f[x.s]-f[C.s]||C.f-x.f}));r<i;++r){var w=s[r].s;if(!(f[w]>e))break;v+=_-(1<<d-f[w]),f[w]=e}for(v>>>=y;v>0;){var E=s[r].s;f[E]<e?v-=1<<e-f[E]++-1:++r}for(;r>=0&&v;--r){var F=s[r].s;f[F]==e&&(--f[F],++v)}d=e}return[new je(f),d]},$i=function(t,e,n){return t.s==-1?Math.max($i(t.l,e,n+1),$i(t.r,e,n+1)):e[t.s]=n},vo=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Fe(++e),r=0,i=t[0],s=1,o=function(l){n[r++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=t[a]}return[n.subarray(0,r),e]},un=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},zi=function(t,e,n){var r=n.length,i=Tl(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<r;++s)t[i+s+4]=n[s];return 8*(i+4+r)},_o=function(t,e,n,r,i,s,o,a,l,u,c){Ze(e,c++,n),++i[256];for(var h=Ur(i,15),p=h[0],f=h[1],d=Ur(s,15),v=d[0],y=d[1],_=vo(p),w=_[0],E=_[1],F=vo(v),C=F[0],x=F[1],N=new Fe(19),T=0;T<w.length;++T)N[31&w[T]]++;for(T=0;T<C.length;++T)N[31&C[T]]++;for(var U=Ur(N,7),b=U[0],D=U[1],L=19;L>4&&!b[go[L-1]];--L);var V,B,A,J,ie=u+5<<3,I=un(i,Ct)+un(s,_r)+o,j=un(i,p)+un(s,v)+o+14+3*L+un(N,b)+(2*N[16]+3*N[17]+7*N[18]);if(ie<=I&&ie<=j)return zi(e,c,t.subarray(l,l+u));if(Ze(e,c,1+(j<I)),c+=2,j<I){V=In(p,f),B=p,A=In(v,y),J=v;var g=In(b,D);for(Ze(e,c,E-257),Ze(e,c+5,x-1),Ze(e,c+10,L-4),c+=14,T=0;T<L;++T)Ze(e,c+3*T,b[go[T]]);c+=3*L;for(var X=[w,C],W=0;W<2;++W){var m=X[W];for(T=0;T<m.length;++T){var re=31&m[T];Ze(e,c,g[re]),c+=b[re],re>15&&(Ze(e,c,m[T]>>>5&127),c+=m[T]>>>12)}}}else V=Ah,B=Ct,A=Fh,J=_r;for(T=0;T<a;++T)if(r[T]>255){re=r[T]>>>18&31,ln(e,c,V[re+257]),c+=B[re+257],re>7&&(Ze(e,c,r[T]>>>23&31),c+=cs[re]);var ye=31&r[T];ln(e,c,A[ye]),c+=J[ye],ye>3&&(ln(e,c,r[T]>>>5&8191),c+=hs[ye])}else ln(e,c,V[r[T]]),c+=B[r[T]];return ln(e,c,V[256]),c+B[256]},Rh=new Gt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Oh=(function(){for(var t=new Gt(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),Dh=function(t,e,n,r,i){return(function(s,o,a,l,u,c){var h=s.length,p=new je(l+h+5*(1+Math.floor(h/7e3))+u),f=p.subarray(l,p.length-u),d=0;if(!o||h<8)for(var v=0;v<=h;v+=65535){var y=v+65535;y<h?d=zi(f,d,s.subarray(v,y)):(f[v]=c,d=zi(f,d,s.subarray(v,h)))}else{for(var _=Rh[o-1],w=_>>>13,E=8191&_,F=(1<<a)-1,C=new Fe(32768),x=new Fe(F+1),N=Math.ceil(a/3),T=2*N,U=function(At){return(s[At]^s[At+1]<<N^s[At+2]<<T)&F},b=new Gt(25e3),D=new Fe(288),L=new Fe(32),V=0,B=0,A=(v=0,0),J=0,ie=0;v<h;++v){var I=U(v),j=32767&v,g=x[I];if(C[j]=g,x[I]=j,J<=v){var X=h-v;if((V>7e3||A>24576)&&X>423){d=_o(s,f,0,b,D,L,B,A,ie,v-ie,d),A=V=B=0,ie=v;for(var W=0;W<286;++W)D[W]=0;for(W=0;W<30;++W)L[W]=0}var m=2,re=0,ye=E,te=j-g&32767;if(X>2&&I==U(v-te))for(var ze=Math.min(w,X)-1,We=Math.min(32767,v),ut=Math.min(258,X);te<=We&&--ye&&j!=g;){if(s[v+m]==s[v+m-te]){for(var Ce=0;Ce<ut&&s[v+Ce]==s[v+Ce-te];++Ce);if(Ce>m){if(m=Ce,re=te,Ce>ze)break;var Tt=Math.min(te,Ce-2),Wn=0;for(W=0;W<Tt;++W){var Zt=v-te+W+32768&32767,Gn=Zt-C[Zt]+32768&32767;Gn>Wn&&(Wn=Gn,g=Zt)}}}te+=(j=g)-(g=C[j])+32768&32767}if(re){b[A++]=268435456|Li[m]<<18|mo[re];var en=31&Li[m],tn=31&mo[re];B+=cs[en]+hs[tn],++D[257+en],++L[tn],J=v+m,++V}else b[A++]=s[v],++D[s[v]]}}d=_o(s,f,c,b,D,L,B,A,ie,v-ie,d)}return Al(p,0,l+Tl(d)+u)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!0)},Vr=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function Mh(t,e){e===void 0&&(e={});var n=(function(){var a=4294967295;return{p:function(l){for(var u=a,c=0;c<l.length;++c)u=Oh[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}})(),r=t.length;n.p(t);var i,s=Dh(t,e,10+((i=e).filename&&i.filename.length+1||0),8),o=s.length;return(function(a,l){var u=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&Vr(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){a[3]=8;for(var c=0;c<=u.length;++c)a[c+10]=u.charCodeAt(c)}})(s,e),Vr(s,o-8,n.d()),Vr(s,o-4,r),s}var Lh=function(t){var e,n,r,i,s="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
3
- `).replace(/\r/g,`
4
- `)).length,i=0;i<r;i++){var o=t.charCodeAt(i),a=null;o<128?n++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Ve(a)||(n>e&&(s+=t.substring(e,n)),s+=a,e=n=i+1)}return n>e&&(s+=t.substring(e,t.length)),s},$h=!!_i||!!vi,yo="text/plain",yr=function(t,e,n){var r;n===void 0&&(n=!0);var[i,s]=t.split("?"),o=z({},e),a=(r=s==null?void 0:s.split("&").map((u=>{var c,[h,p]=u.split("="),f=n&&(c=o[h])!==null&&c!==void 0?c:p;return delete o[h],h+"="+f})))!==null&&r!==void 0?r:[],l=Zc(o);return l&&a.push(l),i+"?"+a.join("&")},wn=(t,e)=>JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e),Wr=t=>{var{data:e,compression:n}=t;if(e){if(n===it.GZipJS){var r=Mh((function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var h=new je(l.length+(l.length>>>1)),p=0,f=function(_){h[p++]=_},d=0;d<c;++d){if(p+5>h.length){var v=new je(p+8+(c-d<<1));v.set(h),h=v}var y=l.charCodeAt(d);y<128||u?f(y):y<2048?(f(192|y>>>6),f(128|63&y)):y>55295&&y<57344?(f(240|(y=65536+(1047552&y)|1023&l.charCodeAt(++d))>>>18),f(128|y>>>12&63),f(128|y>>>6&63),f(128|63&y)):(f(224|y>>>12),f(128|y>>>6&63),f(128|63&y))}return Al(h,0,p)})(wn(e)),{mtime:0}),i=new Blob([r],{type:yo});return{contentType:yo,body:i,estimatedSize:i.size}}if(n===it.Base64){var s=(function(l){var u,c,h,p,f,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",v=0,y=0,_="",w=[];if(!l)return l;l=Lh(l);do u=(f=l.charCodeAt(v++)<<16|l.charCodeAt(v++)<<8|l.charCodeAt(v++))>>18&63,c=f>>12&63,h=f>>6&63,p=63&f,w[y++]=d.charAt(u)+d.charAt(c)+d.charAt(h)+d.charAt(p);while(v<l.length);switch(_=w.join(""),l.length%3){case 1:_=_.slice(0,-2)+"==";break;case 2:_=_.slice(0,-1)+"="}return _})(wn(e)),o=(l=>"data="+encodeURIComponent(typeof l=="string"?l:wn(l)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=wn(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},ir=[];vi&&ir.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:i,estimatedSize:s}=(e=Wr(t))!==null&&e!==void 0?e:{},o=new Headers;ce(t.headers,(function(c,h){o.append(h,c)})),r&&o.append("Content-Type",r);var a=t.url,l=null;if(Ls){var u=new Ls;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),t.timeout)}}vi(a,z({method:(t==null?void 0:t.method)||"GET",headers:o,keepalive:t.method==="POST"&&(s||0)<52428.8,body:i,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((c=>c.text().then((h=>{var p={statusCode:c.status,text:h};if(c.status===200)try{p.json=JSON.parse(h)}catch(f){$.error(f)}t.callback==null||t.callback(p)})))).catch((c=>{$.error(c),t.callback==null||t.callback({statusCode:0,error:c})})).finally((()=>l?clearTimeout(l.timeout):null))}}),_i&&ir.push({transport:"XHR",method:t=>{var e,n=new _i;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:i}=(e=Wr(t))!==null&&e!==void 0?e:{};ce(t.headers,(function(s,o){n.setRequestHeader(o,s)})),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(s)}},n.send(i)}}),Le!=null&&Le.sendBeacon&&ir.push({transport:"sendBeacon",method:t=>{var e=yr(t.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=Wr(t))!==null&&n!==void 0?n:{},s=typeof i=="string"?new Blob([i],{type:r}):i;Le.sendBeacon(e,s)}catch{}}});var br=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function bo(t,e,n){return wn({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var Fl={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>br(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!br(n,r))))),icontains:(t,e)=>e.map(Qn).some((n=>t.map(Qn).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Qn).every((n=>t.map(Qn).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((i=>r>parseFloat(i)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((i=>r<parseFloat(i)))}))},Qn=t=>t.toLowerCase();function Rl(t,e){return!t||Object.entries(t).every((n=>{var[r,i]=n,s=e==null?void 0:e[r];if(O(s)||Ve(s))return!1;var o=[String(s)],a=Fl[i.operator];return!!a&&a(i.values,o)}))}var Gr=pe("[Error tracking]");class zh{constructor(e){var n,r;this.Zt=[],this.ti=new yc([new Ic,new $c,new Ac,new Tc,new Mc,new Dc,new Rc,new Lc],Pc()),this._instance=e,this.Zt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(Pi))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,i,s=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],o=(i=e.errorTracking)==null?void 0:i.captureExtensionExceptions;this.Zt=s,this._instance.persistence&&this._instance.persistence.register({[Pi]:this.Zt,[Xs]:o})}get ii(){var e,n=!!this._instance.get_property(Xs),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.ti.buildFromUnknown(e,{syntheticException:n==null?void 0:n.syntheticException,mechanism:{handled:n==null?void 0:n.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.ei(n)){if(this.ri(n))return void Gr.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(n))return void Gr.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(n))return void Gr.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ri(e){if(e.length===0)return!1;var n=e.reduce(((r,i)=>{var{type:s,value:o}=i;return _e(s)&&s.length>0&&r.$exception_types.push(s),_e(o)&&o.length>0&&r.$exception_values.push(o),r}),{$exception_types:[],$exception_values:[]});return this.Zt.some((r=>{var i=r.values.map((s=>{var o,a=Fl[s.operator],l=se(s.value)?s.value:[s.value],u=(o=n[s.key])!==null&&o!==void 0?o:[];return l.length>0&&a(l,u)}));return r.type==="OR"?i.some(Boolean):i.every(Boolean)}))}si(e){return e.flatMap((n=>{var r,i;return(r=(i=n.stacktrace)==null?void 0:i.frames)!==null&&r!==void 0?r:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ni(e){if(e.length>0){var n,r,i,s,o=(n=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],a=o[o.length-1];return(i=a==null||(s=a.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}ei(e){return!Z(e)&&se(e)}}var De=pe("[FeatureFlags]"),cn=pe("[FeatureFlags]",{debugEnabled:!0}),Nh="errors_while_computing_flags",Bh="flag_missing",jh="quota_limited",qh="timeout",Hh="connection_error",Uh="unknown_error",Vh=t=>"api_error_"+t,Yr="$active_feature_flags",Rt="$override_feature_flags",xo="$feature_flag_payloads",hn="$override_feature_flag_payloads",ko="$feature_flag_request_id",wo="$feature_flag_evaluated_at",Eo=t=>{var e={};for(var[n,r]of rr(t||{}))r&&(e[n]=r);return e},Wh=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var r;return[n,(r=e[n].variant)!==null&&r!==void 0?r:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var r;return(r=e[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=e[n].metadata)==null?void 0:r.payload]})))):De.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},Gh=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({});class Yh{constructor(e){this.oi=!1,this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.ci=!1,this._instance=e,this.featureFlagEventHandlers=[]}fi(){var e,n=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ci||(De.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ci=!0),n!=null&&n.length?n.filter((r=>{var i=r&&typeof r=="string"&&r.trim().length>0;return i||De.error("Invalid evaluation context found:",r,"Expected non-empty string"),i})):[]}pi(){return this.fi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.di=!0;else{var e=!this.gi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.mi({disableFlags:e})}}get hasLoadedFlags(){return this.ai}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Ii),n=this._instance.get_property(Rt),r=this._instance.get_property(hn);if(!r&&!n)return e||{};var i=de({},e||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var o of s){var a,l,u=i[o],c=n==null?void 0:n[o],h=O(c)?(a=u==null?void 0:u.enabled)!==null&&a!==void 0&&a:!!c,p=O(c)?u.variant:typeof c=="string"?c:void 0,f=r==null?void 0:r[o],d=z({},u,{enabled:h,variant:h?p??(u==null?void 0:u.variant):void 0});h!==(u==null?void 0:u.enabled)&&(d.original_enabled=u==null?void 0:u.enabled),p!==(u==null?void 0:u.variant)&&(d.original_variant=u==null?void 0:u.variant),f&&(d.metadata=z({},u==null?void 0:u.metadata,{payload:f,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),i[o]=d}return this.oi||(De.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}),this.oi=!0),i}getFlagVariants(){var e=this._instance.get_property(jt),n=this._instance.get_property(Rt);if(!n)return e||{};for(var r=de({},e),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this.oi||(De.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this.oi=!0),r}getFlagPayloads(){var e=this._instance.get_property(xo),n=this._instance.get_property(hn);if(!n)return e||{};for(var r=de({},e||{}),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this.oi||(De.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:r}),this.oi=!0),r}reloadFeatureFlags(){this.ui||this._instance.config.advanced_disable_feature_flags||this.gi||(this._instance.bi.emit("featureFlagsReloading",!0),this.gi=setTimeout((()=>{this.mi()}),5))}yi(){clearTimeout(this.gi),this.gi=void 0}ensureFlagsLoaded(){this.ai||this.li||this.gi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ui=e}mi(e){var n;if(this.yi(),!this._instance.M())if(this.li)this.hi=!0;else{var r=this._instance.config.token,i=this._instance.get_property("$device_id"),s={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:z({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(kn)||{}),group_properties:this._instance.get_property(Et)};Ve(i)||O(i)||(s.$device_id=i),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.pi()&&(s.evaluation_contexts=this.fi());var o=this._instance.config.__preview_remote_config,a=o?"/flags/?v=2":"/flags/?v=2&config=true",l=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",u=this._instance.requestRouter.endpointFor("flags",a+l);o&&(s.timezone=Sl()),this.li=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this._instance.config.disable_compression?void 0:it.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:c=>{var h,p,f,d,v=!0;if(c.statusCode===200&&(this.hi||(this.$anon_distinct_id=void 0),v=!1),this.li=!1,this.di||(this.di=!0,this._instance.wi((d=c.json)!==null&&d!==void 0?d:{})),!s.disable_flags||this.hi){this.vi=!v;var y=[];c.error?c.error instanceof Error?y.push(c.error.name==="AbortError"?qh:Hh):y.push(Uh):c.statusCode!==200&&y.push(Vh(c.statusCode)),(h=c.json)!=null&&h.errorsWhileComputingFlags&&y.push(Nh);var _=!((p=c.json)==null||(p=p.quotaLimited)==null||!p.includes(Gh.FeatureFlags));if(_&&y.push(jh),(f=this._instance.persistence)==null||f.register({[Ai]:y}),_)De.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var w;s.disable_flags||this.receivedFeatureFlags((w=c.json)!==null&&w!==void 0?w:{},v),this.hi&&(this.hi=!1,this.mi())}}}})}}getFeatureFlag(e,n){var r;if(n===void 0&&(n={}),this.ai||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlagResult(e,n);return(r=i==null?void 0:i.variant)!==null&&r!==void 0?r:i==null?void 0:i.enabled}De.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var n=this.getFeatureFlagResult(e,{send_event:!1});return n==null?void 0:n.payload}getFeatureFlagResult(e,n){if(n===void 0&&(n={}),this.ai||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants(),i=e in r,s=r[e],o=this.getFlagPayloads()[e],a=String(s),l=this._instance.get_property(ko)||void 0,u=this._instance.get_property(wo)||void 0,c=this._instance.get_property(cr)||{};if((n.send_event||!("send_event"in n))&&(!(e in c)||!c[e].includes(a))){var h,p,f,d,v,y,_,w,E,F;se(c[e])?c[e].push(a):c[e]=[a],(h=this._instance.persistence)==null||h.register({[cr]:c});var C=this.getFeatureFlagDetails(e),x=[...(p=this._instance.get_property(Ai))!==null&&p!==void 0?p:[]];O(s)&&x.push(Bh);var N={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:o||null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((f=this._instance.config.bootstrap)==null||(f=f.featureFlags)==null?void 0:f[e])||null,$feature_flag_bootstrapped_payload:((d=this._instance.config.bootstrap)==null||(d=d.featureFlagPayloads)==null?void 0:d[e])||null,$used_bootstrap_value:!this.vi};O(C==null||(v=C.metadata)==null?void 0:v.version)||(N.$feature_flag_version=C.metadata.version);var T,U=(y=C==null||(_=C.reason)==null?void 0:_.description)!==null&&y!==void 0?y:C==null||(w=C.reason)==null?void 0:w.code;U&&(N.$feature_flag_reason=U),C!=null&&(E=C.metadata)!=null&&E.id&&(N.$feature_flag_id=C.metadata.id),O(C==null?void 0:C.original_variant)&&O(C==null?void 0:C.original_enabled)||(N.$feature_flag_original_response=O(C.original_variant)?C.original_enabled:C.original_variant),C!=null&&(F=C.metadata)!=null&&F.original_payload&&(N.$feature_flag_original_payload=C==null||(T=C.metadata)==null?void 0:T.original_payload),x.length&&(N.$feature_flag_error=x.join(",")),this._instance.capture("$feature_flag_called",N)}if(i){var b=o;if(!O(o))try{b=JSON.parse(o)}catch{}return{key:e,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:b}}}else De.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,n){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.pi()&&(i.evaluation_contexts=this.fi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:it.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:s=>{var o,a=(o=s.json)==null?void 0:o.featureFlagPayloads;n((a==null?void 0:a[e])||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ai||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return O(r)?void 0:!!r}De.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ai=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(o,a,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var h=Wh(o),p=h.flags,f=h.featureFlags,d=h.featureFlagPayloads;if(f){var v=o.requestId,y=o.evaluatedAt;if(se(f)){De.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(f)for(var w=0;w<f.length;w++)_[f[w]]=!0;a&&a.register({[Yr]:f,[jt]:_})}else{var E=f,F=d,C=p;if(o.errorsWhileComputingFlags)if(p){var x=new Set(Object.keys(p).filter((N=>{var T;return!((T=p[N])!=null&&T.failed)})));E=z({},l,Object.fromEntries(Object.entries(E).filter((N=>{var[T]=N;return x.has(T)})))),F=z({},u,Object.fromEntries(Object.entries(F||{}).filter((N=>{var[T]=N;return x.has(T)})))),C=z({},c,Object.fromEntries(Object.entries(C||{}).filter((N=>{var[T]=N;return x.has(T)}))))}else E=z({},l,E),F=z({},u,F),C=z({},c,C);a&&a.register(z({[Yr]:Object.keys(Eo(E)),[jt]:E||{},[xo]:F||{},[Ii]:C||{}},v?{[ko]:v}:{},y?{[wo]:y}:{}))}}})(e,this._instance.persistence,r,i,s),this.xi(n)}}override(e,n){n===void 0&&(n=!1),De.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return De.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Rt),this._instance.persistence.unregister(hn),this.xi(),cn.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.oi=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Rt),cn.info("Flag overrides cleared");else if(r.flags){if(se(r.flags)){for(var i={},s=0;s<r.flags.length;s++)i[r.flags[s]]=!0;this._instance.persistence.register({[Rt]:i})}else this._instance.persistence.register({[Rt]:r.flags});cn.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(hn),cn.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[hn]:r.payloads}),cn.info("Payload overrides set",{payloads:r.payloads}))),void this.xi()}this.xi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ai){var{flags:n,flagVariants:r}=this.Ei();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var i,s=(this._instance.get_property(xn)||[]).find((u=>u.flagKey===e)),o={["$feature_enrollment/"+e]:n},a={$feature_flag:e,$feature_enrollment:n,$set:o};s&&(a.$early_access_feature_name=s.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(o,!1);var l=z({},this.getFlagVariants(),{[e]:n});(i=this._instance.persistence)==null||i.register({[Yr]:Object.keys(Eo(l)),[jt]:l}),this.xi()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var i=this._instance.get_property(xn),s=r?"&"+r.map((o=>"stage="+o)).join("&"):"";if(i&&!n)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:o=>{var a,l;if(o.json){var u=o.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(xn),(l=this._instance.persistence)==null||l.register({[xn]:u}),e(u)}}})}Ei(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((r=>n[r])),flagVariants:Object.keys(n).filter((r=>n[r])).reduce(((r,i)=>(r[i]=n[i],r)),{})}}xi(e){var{flags:n,flagVariants:r}=this.Ei();this.featureFlagEventHandlers.forEach((i=>i(n,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(kn)||{};this._instance.register({[kn]:z({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(kn)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(Et)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((i=>{r[i]=z({},r[i],e[i]),delete e[i]})),this._instance.register({[Et]:z({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(Et)||{};this._instance.register({[Et]:z({},n,{[e]:{}})})}else this._instance.unregister(Et)}reset(){this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.$anon_distinct_id=void 0,this.yi(),this.oi=!1}}var Xh=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Xr{constructor(e,n){this.R=e,this.props={},this.$i=!1,this.Si=(r=>{var i="";return r.token&&(i=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+i+"_posthog"})(e),this.Y=this.ki(e),this.load(),e.debug&&$.info("Persistence loaded",e.persistence,z({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.Pi}ki(e){Xh.indexOf(e.persistence.toLowerCase())===-1&&($.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=(function(i){i===void 0&&(i=[]);var s=[...uh,...i];return z({},fe,{W:function(o){try{var a={};try{a=Ye.W(o)||{}}catch{}var l=de(a,JSON.parse(fe.q(o)||"{}"));return fe.G(o,l),l}catch{}return null},G:function(o,a,l,u,c,h){try{fe.G(o,a,void 0,void 0,h);var p={};s.forEach((f=>{a[f]&&(p[f]=a[f])})),Object.keys(p).length&&Ye.G(o,p,l,u,c,h)}catch(f){fe.B(f)}},V:function(o,a){try{k==null||k.localStorage.removeItem(o),Ye.V(o,a)}catch(l){fe.B(l)}}})})(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r==="localstorage"&&fe.H()?fe:r==="localstorage+cookie"&&n.H()?n:r==="sessionstorage"&&be.H()?be:r==="memory"?ch:r==="cookie"?Ye:n.H()?n:Ye}properties(){var e={};return ce(this.props,(function(n,r){if(r===jt&&ve(n))for(var i=Object.keys(n),s=0;s<i.length;s++)e["$feature/"+i[s]]=n[i[s]];else a=r,l=!1,(Ve(o=Hc)?l:Ms&&o.indexOf===Ms?o.indexOf(a)!=-1:(ce(o,(function(u){if(l||(l=u===a))return lr})),l))||(e[r]=n);var o,a,l})),e}load(){if(!this.Pi){var e=this.Y.W(this.Si);e&&(this.props=de({},e))}}save(){this.Pi||this.Y.G(this.Si,this.props,this.Ti,this.Ii,this.Ci,this.R.debug)}remove(){this.Y.V(this.Si,!1),this.Y.V(this.Si,!0)}clear(){this.remove(),this.props={}}register_once(e,n,r){if(ve(e)){O(n)&&(n="None"),this.Ti=O(r)?this.Ri:r;var i=!1;if(ce(e,((s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=s,i=!0)})),i)return this.save(),!0}return!1}register(e,n){if(ve(e)){this.Ti=O(n)?this.Ri:n;var r=!1;if(ce(e,((i,s)=>{e.hasOwnProperty(s)&&this.props[s]!==i&&(this.props[s]=i,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.$i){var e=yl(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);Bt(os(e))||this.register(e),this.$i=!0}}update_search_keyword(){var e;this.register((e=M==null?void 0:M.referrer)?xl(e):{})}update_referrer_info(){var e;this.register_once({$referrer:kl(),$referring_domain:M!=null&&M.referrer&&((e=dr(M.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Oi]||this.props[Di]||this.register_once({[hr]:wl(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};ce([Di,Oi],(o=>{var a=this.props[o];a&&ce(a,(function(l,u){e["$initial_"+yi(u)]=l}))}));var n,r,i=this.props[hr];if(i){var s=(n=El(i),r={},ce(n,(function(o,a){r["$initial_"+yi(a)]=o})),r);de(e,s)}return e}safe_merge(e){return ce(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){if(this.Ri=this.Ti=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence||!((o,a)=>{if(o.length!==a.length)return!1;var l=[...o].sort(),u=[...a].sort();return l.every(((c,h)=>c===u[h]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var i=this.ki(e),s=this.props;this.clear(),this.Y=i,this.props=s,this.save()}}set_disabled(e){this.Pi=e,this.Pi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ii&&(this.Ii=e,this.remove(),this.save())}set_secure(e){e!==this.Ci&&(this.Ci=e,this.remove(),this.save())}set_event_timer(e,n){var r=this.props[bn]||{};r[e]=n,this.props[bn]=r,this.save()}remove_event_timer(e){var n=(this.props[bn]||{})[e];return O(n)||(delete this.props[bn][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}}var So=pe("[Product Tours]"),Jr="ph_product_tours";class Jh{constructor(e){this.Fi=null,this.Oi=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[Ks]:!(e==null||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,n;this.Fi||(e=this._instance).config.disable_product_tours||(n=e.persistence)==null||!n.get_property(Ks)||this.it((()=>this.Mi()))}it(e){var n,r;(n=q.__PosthogExtensions__)!=null&&n.generateProductTours?e():(r=q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"product-tours",(i=>{i?So.error("Could not load product tours script",i):e()}))}Mi(){var e;!this.Fi&&(e=q.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Fi=q.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,n){if(n===void 0&&(n=!1),!se(this.Oi)||n){var r=this._instance.persistence;if(r){var i=r.props[Jr];if(se(i)&&!n)return this.Oi=i,void e(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{var o=s.statusCode;if(o!==200||!s.json){var a="Product Tours API could not be loaded, status: "+o;return So.error(a),void e([],{isLoaded:!1,error:a})}var l=se(s.json.product_tours)?s.json.product_tours:[];this.Oi=l,r&&r.register({[Jr]:l}),e(l,{isLoaded:!0})}})}else e(this.Oi,{isLoaded:!0})}getActiveProductTours(e){Z(this.Fi)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Fi.getActiveProductTours(e)}showProductTour(e){var n;(n=this.Fi)==null||n.showTourById(e)}previewTour(e){this.Fi?this.Fi.previewTour(e):this.it((()=>{var n;this.Mi(),(n=this.Fi)==null||n.previewTour(e)}))}dismissProductTour(){var e;(e=this.Fi)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Fi)==null||e.nextStep()}previousStep(){var e;(e=this.Fi)==null||e.previousStep()}clearCache(){var e;this.Oi=null,(e=this._instance.persistence)==null||e.unregister(Jr)}resetTour(e){var n;(n=this.Fi)==null||n.resetTour(e)}resetAllTours(){var e;(e=this.Fi)==null||e.resetAllTours()}cancelPendingTour(e){var n;(n=this.Fi)==null||n.cancelPendingTour(e)}}var fn=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({});(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({});(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({});(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({});var Kr=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({});(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({});(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({});(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({});var En=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t})({}),Qr=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t})({}),Ni=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),ae=pe("[Surveys]"),Ol="seenSurvey_",Kh=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},Co=t=>((e,n)=>{var r=""+e+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+e+n.id+"_"+n.current_iteration),r})(Ol,t),Qh=[Kr.Popover,Kr.Widget,Kr.API],Zh={ignoreConditions:!1,ignoreDelay:!1,displayType:Ni.Popover};class fs{constructor(){this.Ai={},this.Ai={}}on(e,n){return this.Ai[e]||(this.Ai[e]=[]),this.Ai[e].push(n),()=>{this.Ai[e]=this.Ai[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.Ai[e]||[])r(n);for(var i of this.Ai["*"]||[])i(e,n)}}function Ot(t,e,n){if(Z(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class ef{constructor(e){this.ji=new fs,this.Di=(n,r)=>this.Li(n,r)&&this.Ni(n,r)&&this.Ui(n,r)&&this.zi(n,r),this.Li=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.Hi=new Set,this.Bi=new Set}init(){var e;if(!O((e=this._instance)==null?void 0:e._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook(((r,i)=>{this.on(r,i)}))}}register(e){var n,r;if(!O((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((o=>{var a,l;(a=this.Bi)==null||a.add(o),(l=o.steps)==null||l.forEach((u=>{var c;(c=this.Hi)==null||c.add((u==null?void 0:u.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var i,s=new Set;e.forEach((o=>{var a;(a=o.steps)==null||a.forEach((l=>{l!=null&&l.selector&&s.add(l==null?void 0:l.selector)}))})),(i=this._instance)==null||i.autocapture.setElementSelectors(s)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Hi.has(e)||this.Hi.has(n==null?void 0:n.event))&&this.Bi&&((r=this.Bi)==null?void 0:r.size)>0&&this.Bi.forEach((i=>{this.qi(n,i)&&this.ji.emit("actionCaptured",i.name)}))}Wi(e){this.onAction("actionCaptured",(n=>e(n)))}qi(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Di(e,r))return!0;return!1}onAction(e,n){return this.ji.on(e,n)}Ni(e,n){if(n!=null&&n.url){var r,i=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!Ot(i,n.url,n.url_matching||"contains"))return!1}return!0}Ui(e,n){return!!this.Gi(e,n)&&!!this.Vi(e,n)&&!!this.Ji(e,n)}Gi(e,n){var r;if(n==null||!n.href)return!0;var i=this.Ki(e);if(i.length>0)return i.some((a=>Ot(a.href,n.href,n.href_matching||"exact")));var s,o=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!o&&Ot((s=o.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}Vi(e,n){var r;if(n==null||!n.text)return!0;var i=this.Ki(e);if(i.length>0)return i.some((u=>Ot(u.text,n.text,n.text_matching||"exact")||Ot(u.$el_text,n.text,n.text_matching||"exact")));var s,o,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(s=(function(u){for(var c,h=[],p=/(?::|")text="(.*?)"/g;!Z(c=p.exec(u));)h.includes(c[1])||h.push(c[1]);return h})(l),o=n.text,a=n.text_matching||"exact",s.some((u=>Ot(u,o,a))))}Ji(e,n){var r,i;if(n==null||!n.selector)return!0;var s=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var o=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}Ki(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}zi(e,n){return n==null||!n.properties||n.properties.length===0||Rl(n.properties.reduce(((r,i)=>{var s=se(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:s,operator:i.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class tf{constructor(e){this._instance=e,this.Yi=new Map,this.Xi=new Map,this.Qi=new Map}Zi(e,n){return!!e&&Rl(e.propertyFilters,n==null?void 0:n.properties)}te(e,n){var r=new Map;return e.forEach((i=>{var s;(s=i.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach((o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(i.id),r.set(o.name,a)}}))})),r}ie(e,n,r){var i=(r===fn.Activation?this.Yi:this.Xi).get(e),s=[];return this.ee((o=>{s=o.filter((a=>i==null?void 0:i.includes(a.id)))})),s.filter((o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find((u=>u.name===e));return this.Zi(l,n)}))}register(e){var n;O((n=this._instance)==null?void 0:n._addCaptureHook)||(this.re(e),this.se(e))}se(e){var n=e.filter((r=>{var i,s;return((i=r.conditions)==null?void 0:i.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0}));n.length!==0&&(this.ne==null&&(this.ne=new ef(this._instance),this.ne.init(),this.ne.Wi((r=>{this.onAction(r)}))),n.forEach((r=>{var i,s,o,a,l;r.conditions&&(i=r.conditions)!=null&&i.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.ne)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((u=>{if(u&&u.name){var c=this.Qi.get(u.name);c&&c.push(r.id),this.Qi.set(u.name,c||[r.id])}})))})))}re(e){var n,r=e.filter((s=>{var o,a;return((o=s.conditions)==null?void 0:o.events)&&((a=s.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0})),i=e.filter((s=>{var o,a;return((o=s.conditions)==null?void 0:o.cancelEvents)&&((a=s.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0}));(r.length!==0||i.length!==0)&&((n=this._instance)==null||n._addCaptureHook(((s,o)=>{this.onEvent(s,o)})),this.Yi=this.te(e,fn.Activation),this.Xi=this.te(e,fn.Cancellation))}onEvent(e,n){var r,i=this.oe(),s=this.ae(),o=this.le(),a=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];if(o===e&&n&&a.length>0){var l,u;i.info("event matched, removing item from activated items",{event:e,eventPayload:n,existingActivatedItems:a});var c=(n==null||(l=n.properties)==null?void 0:l.$survey_id)||(n==null||(u=n.properties)==null?void 0:u.$product_tour_id);if(c){var h=a.indexOf(c);h>=0&&(a.splice(h,1),this.ue(a))}}else{if(this.Xi.has(e)){var p=this.ie(e,n,fn.Cancellation);p.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:p.map((d=>d.id))}),p.forEach((d=>{var v=a.indexOf(d.id);v>=0&&a.splice(v,1),this.he(d.id)})),this.ue(a))}if(this.Yi.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.Yi.get(e)});var f=this.ie(e,n,fn.Activation);this.ue(a.concat(f.map((d=>d.id))||[]))}}}onAction(e){var n,r=this.ae(),i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.Qi.has(e)&&this.ue(i.concat(this.Qi.get(e)||[]))}ue(e){var n,r=this.oe(),i=this.ae(),s=[...new Set(e)].filter((o=>!this.de(o)));r.info("updating activated items",{activatedItems:s}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[i]:s})}getActivatedIds(){var e,n=this.ae(),r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r||[]}getEventToItemsMap(){return this.Yi}ve(){return this.ne}}class nf extends tf{constructor(e){super(e)}ae(){return"$surveys_activated"}le(){return En.SHOWN}ee(e){var n;(n=this._instance)==null||n.getSurveys(e)}he(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}oe(){return ae}de(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class rf{constructor(e){this.ce=void 0,this._surveyManager=null,this.fe=!1,this.pe=[],this.ge=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(Z(n))return ae.warn("Flags not loaded yet. Not loading surveys.");var r=se(n);this.ce=r?n.length>0:n,ae.info("flags response received, isSurveysEnabled: "+this.ce),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Ol)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((i=>localStorage.removeItem(i)))}loadIfEnabled(){if(!this._surveyManager)if(this.fe)ae.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ae.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ae.info("Not loading surveys in cookieless mode without consent.");else{var e=q==null?void 0:q.__PosthogExtensions__;if(e){if(!O(this.ce)||this._instance.config.advanced_enable_surveys){var n=this.ce||this._instance.config.advanced_enable_surveys;this.fe=!0;try{var r=e.generateSurveys;if(r)return void this._e(r,n);var i=e.loadExternalDependency;if(!i)return void this.me("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(s=>{s||!e.generateSurveys?this.me("Could not load surveys script",s):this._e(e.generateSurveys,n)}))}catch(s){throw this.me("Error initializing surveys",s),s}finally{this.fe=!1}}}else ae.error("PostHog Extensions not found.")}}_e(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new nf(this._instance),ae.info("Surveys loaded successfully"),this.be({isLoaded:!0})}me(e,n){ae.error(e,n),this.be({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.pe.push(e),this._surveyManager&&this.be({isLoaded:!0}),()=>{this.pe=this.pe.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return ae.info("Disabled. Not loading surveys."),e([]);var r,i=this._instance.get_property(Ti);if(i&&!n)return e(i,{isLoaded:!0});typeof Promise<"u"&&this.ge?this.ge.then((s=>{var{surveys:o,context:a}=s;return e(o,a)})):(typeof Promise<"u"&&(this.ge=new Promise((s=>{r=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var o;this.ge=null;var a=s.statusCode;if(a!==200||!s.json){var l="Surveys API could not be loaded, status: "+a;ae.error(l);var u={isLoaded:!1,error:l};return e([],u),void(r==null||r({surveys:[],context:u}))}var c,h=s.json.surveys||[],p=h.filter((d=>(function(v){return!(!v.start_date||v.end_date)})(d)&&((function(v){var y;return!((y=v.conditions)==null||(y=y.events)==null||(y=y.values)==null||!y.length)})(d)||(function(v){var y;return!((y=v.conditions)==null||(y=y.actions)==null||(y=y.values)==null||!y.length)})(d))));p.length>0&&((c=this._surveyEventReceiver)==null||c.register(p)),(o=this._instance.persistence)==null||o.register({[Ti]:h});var f={isLoaded:!0};e(h,f),r==null||r({surveys:h,context:f})}}))}be(e){for(var n of this.pe)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){ae.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!Z(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);ae.warn("init was not called")}ye(e){var n=null;return this.getSurveys((r=>{var i;n=(i=r.find((s=>s.id===e)))!==null&&i!==void 0?i:null})),n}we(e){if(Z(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.ye(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Z(this._surveyManager))return ae.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.we(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return Z(this._surveyManager)?(ae.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((i=>{var s,o=(s=i.find((l=>l.id===e)))!==null&&s!==void 0?s:null;if(o){var a=this.we(o);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n,r){var i;if(Z(this._surveyManager))ae.warn("init was not called");else{var s=typeof e=="string"?this.ye(e):e;if(s!=null&&s.id)if(Qh.includes(s.type)){var o=M==null?void 0:M.querySelector(n);if(o)return(i=s.appearance)!=null&&i.surveyPopupDelaySeconds?(ae.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,l;ae.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(l=this._surveyManager)==null||l.renderSurvey(s,o,r),ae.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,o,r);ae.warn("Survey element not found")}else ae.warn("Surveys of type "+s.type+" cannot be rendered in the app");else ae.warn("Survey not found")}}displaySurvey(e,n){var r;if(Z(this._surveyManager))ae.warn("init was not called");else{var i=this.ye(e);if(i){var s=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(s=z({},i,{appearance:z({},i.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==Ni.Popover&&n.initialResponses&&ae.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.canRenderSurvey(i);if(!o.visible)return void ae.warn("Survey is not eligible to be displayed: ",o.disabledReason)}n.displayType!==Ni.Inline?this._surveyManager.handlePopoverSurvey(s,n):this.renderSurvey(s,n.selector,n.properties)}else ae.warn("Survey not found")}}cancelPendingSurvey(e){Z(this._surveyManager)?ae.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}var et=pe("[Conversations]");class sf{constructor(e){this.xe=void 0,this._conversationsManager=null,this.Ee=!1,this.$e=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var n=e.conversations;Z(n)||(ot(n)?this.xe=n:(this.xe=n.enabled,this.$e=n),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.xe=void 0,this.$e=null}loadIfEnabled(){if(!this._conversationsManager&&!this.Ee&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=q==null?void 0:q.__PosthogExtensions__;if(e&&!O(this.xe)&&this.xe)if(this.$e&&this.$e.token){this.Ee=!0;try{var n=e.initConversations;if(n)return this.Se(n),void(this.Ee=!1);var r=e.loadExternalDependency;if(!r)return void this.ke("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(i=>{i||!e.initConversations?this.ke("Could not load conversations script",i):this.Se(e.initConversations),this.Ee=!1}))}catch(i){this.ke("Error initializing conversations",i),this.Ee=!1}}else et.error("Conversations enabled but missing token in remote config.")}}Se(e){if(this.$e)try{this._conversationsManager=e(this.$e,this._instance),et.info("Conversations loaded successfully")}catch(n){this.ke("Error completing conversations initialization",n)}else et.error("Cannot complete initialization: remote config is null")}ke(e,n){et.error(e,n),this._conversationsManager=null,this.Ee=!1}show(){this._conversationsManager?this._conversationsManager.show():et.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.xe===!0&&!Ve(this._conversationsManager)}isVisible(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.isVisible())!==null&&e!==void 0&&e}sendMessage(e,n,r){var i=this;return Nt((function*(){return i._conversationsManager?i._conversationsManager.sendMessage(e,n,r):(et.warn("Conversations not available yet."),null)}))()}getMessages(e,n){var r=this;return Nt((function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,n):(et.warn("Conversations not available yet."),null)}))()}markAsRead(e){var n=this;return Nt((function*(){return n._conversationsManager?n._conversationsManager.markAsRead(e):(et.warn("Conversations not available yet."),null)}))()}getTickets(e){var n=this;return Nt((function*(){return n._conversationsManager?n._conversationsManager.getTickets(e):(et.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getWidgetSessionId())!==null&&e!==void 0?e:null}}class of{constructor(e){var n;this.Pe=!1,this.Te=!1,this._instance=e,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.Pe=!0)}onRemoteConfig(e){var n,r=(n=e.logs)==null?void 0:n.captureConsoleLogs;!Z(r)&&r&&(this.Pe=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Pe&&!this.Te){var e=pe("[logs]"),n=q==null?void 0:q.__PosthogExtensions__;if(n){var r=n.loadExternalDependency;r?r(this._instance,"logs",(i=>{var s;i||(s=n.logs)==null||!s.initializeLogs?e.error("Could not load logs script",i):(n.logs.initializeLogs(this._instance),this.Te=!0)})):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var Po=pe("[RateLimiter]");class af{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((i=>{Po.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void Po.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,i;e===void 0&&(e=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:o}=this,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Ri))!==null&&n!==void 0?n:{tokens:s,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>s&&(l.tokens=s);var u=l.tokens<1;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(i=this.instance.persistence)==null||i.set_property(Ri,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var kt=pe("[RemoteConfig]");class lf{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Ie(e){var n,r;(n=q.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(kt.error("PostHog Extensions not found. Cannot load remote config."),e())}Ce(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return kt.info("Using preloaded remote config",this.remoteConfig),void this.wi(this.remoteConfig);if(this._instance.M())return void kt.warn("Remote config is disabled. Falling back to local config.");this.Ie((e=>{if(!e)return kt.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ce((n=>{this.wi(n)}));this.wi(e)}))}catch(e){kt.error("Error loading remote config",e)}}wi(e){e?this._instance.config.__preview_remote_config?(this._instance.wi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):kt.info("__preview_remote_config is disabled. Logging config instead",e):kt.error("Failed to fetch remote config from PostHog.")}}var Bi=3e3;class uf{constructor(e,n){this.Re=!0,this.Fe=[],this.Oe=Xe((n==null?void 0:n.flush_interval_ms)||Bi,250,5e3,$.createLogger("flush interval"),Bi),this.Me=e}enqueue(e){this.Fe.push(e),this.Ae||this.je()}unload(){this.De();var e=this.Fe.length>0?this.Le():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Me(z({},r,{transport:"sendBeacon"}))}))}enable(){this.Re=!1,this.je()}je(){var e=this;this.Re||(this.Ae=setTimeout((()=>{if(this.De(),this.Fe.length>0){var n=this.Le(),r=function(){var s=n[i],o=new Date().getTime();s.data&&se(s.data)&&ce(s.data,(a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp})),e.Me(s)};for(var i in n)r()}}),this.Oe))}De(){clearTimeout(this.Ae),this.Ae=void 0}Le(){var e={};return ce(this.Fe,(n=>{var r,i=n,s=(i?i.batchKey:null)||i.url;O(e[s])&&(e[s]=z({},i,{data:[]})),(r=e[s].data)==null||r.push(i.data)})),this.Fe=[],e}}var cf=["retriesPerformedSoFar"];class hf{constructor(e){this.Ne=!1,this.Ue=3e3,this.Fe=[],this._instance=e,this.Fe=[],this.ze=!0,!O(k)&&"onLine"in k.navigator&&(this.ze=k.navigator.onLine,this.He=()=>{this.ze=!0,this.Lt()},this.Be=()=>{this.ze=!1},me(k,"online",this.He),me(k,"offline",this.Be))}get length(){return this.Fe.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=Ia(e,cf);Lt(n)&&(r.url=yr(r.url,{retry_count:n})),this._instance._send_request(z({},r,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.qe(z({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(i)}}))}qe(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)})(n),i=Date.now()+r;this.Fe.push({retryAt:i,requestOptions:e});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),$.warn(s),this.Ne||(this.Ne=!0,this.We())}We(){if(this.Ge&&clearTimeout(this.Ge),this.Fe.length===0)return this.Ne=!1,void(this.Ge=void 0);this.Ge=setTimeout((()=>{this.ze&&this.Fe.length>0&&this.Lt(),this.We()}),this.Ue)}Lt(){var e=Date.now(),n=[],r=this.Fe.filter((s=>s.retryAt<e||(n.push(s),!1)));if(this.Fe=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.Ge&&(clearTimeout(this.Ge),this.Ge=void 0),this.Ne=!1,O(k)||(this.He&&(k.removeEventListener("online",this.He),this.He=void 0),this.Be&&(k.removeEventListener("offline",this.Be),this.Be=void 0)),this.Fe))try{this._instance._send_request(z({},e,{transport:"sendBeacon"}))}catch(n){$.error(n)}this.Fe=[]}}class ff{constructor(e){this.Ve=()=>{var n,r,i,s;this.Je||(this.Je={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((o==null?void 0:o.clientHeight)||0),c=(o==null?void 0:o.scrollHeight)||0;this.Je.lastScrollY=Math.ceil(a),this.Je.maxScrollY=Math.max(a,(n=this.Je.maxScrollY)!==null&&n!==void 0?n:0),this.Je.maxScrollHeight=Math.max(l,(r=this.Je.maxScrollHeight)!==null&&r!==void 0?r:0),this.Je.lastContentY=u,this.Je.maxContentY=Math.max(u,(i=this.Je.maxContentY)!==null&&i!==void 0?i:0),this.Je.maxContentHeight=Math.max(c,(s=this.Je.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=e}getContext(){return this.Je}resetContext(){var e=this.Je;return setTimeout(this.Ve,0),e}startMeasuringScrollPosition(){me(k,"scroll",this.Ve,{capture:!0}),me(k,"scrollend",this.Ve,{capture:!0}),me(k,"resize",this.Ve)}scrollElement(){if(!this._instance.config.scroll_root_selector)return k==null?void 0:k.document.documentElement;var e=se(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var r=k==null?void 0:k.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return k&&(k.scrollY||k.pageYOffset||k.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return k&&(k.scrollX||k.pageXOffset||k.document.documentElement.scrollLeft)||0}}var pf=t=>wl(t==null?void 0:t.config.mask_personal_data_properties,t==null?void 0:t.config.custom_personal_data_properties);class Io{constructor(e,n,r,i){this.Ke=s=>{var o=this.Ye();if(!o||o.sessionId!==s){var a={sessionId:s,props:this.Xe(this._instance)};this.Qe.register({[Fi]:a})}},this._instance=e,this.Ze=n,this.Qe=r,this.Xe=i||pf,this.Ze.onSessionId(this.Ke)}Ye(){return this.Qe.props[Fi]}getSetOnceProps(){var e,n=(e=this.Ye())==null?void 0:e.props;return n?"r"in n?El(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return ce(os(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+yi(r)]=n})),e}}var Zr=pe("[SessionId]");class To{on(e,n){return this.tr.on(e,n)}constructor(e,n,r){var i;if(this.ir=[],this.er=void 0,this.tr=new fs,this.rr=(c,h)=>!(!Lt(c)||!Lt(h))&&Math.abs(c-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.R=e.config,this.Qe=e.persistence,this.sr=void 0,this.nr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ar=n||dt,this.lr=r||dt;var s=this.R.persistence_name||this.R.token,o=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Xe(o,60,36e3,Zr.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ur(),this.hr="ph_"+s+"_window_id",this.dr="ph_"+s+"_primary_window_exists",this.vr()){var a=be.W(this.hr),l=be.W(this.dr);a&&!l?this.sr=a:be.V(this.hr),be.G(this.dr,!0)}if((i=this.R.bootstrap)!=null&&i.sessionID)try{var u=(c=>{var h=c.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.R.bootstrap.sessionID);this.cr(this.R.bootstrap.sessionID,new Date().getTime(),u)}catch(c){Zr.error("Invalid sessionID in bootstrap",c)}this.pr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return O(this.ir)&&(this.ir=[]),this.ir.push(e),this.nr&&e(this.nr,this.sr),()=>{this.ir=this.ir.filter((n=>n!==e))}}vr(){return this.R.persistence!=="memory"&&!this.Qe.Pi&&be.H()}gr(e){e!==this.sr&&(this.sr=e,this.vr()&&be.G(this.hr,e))}_r(){return this.sr?this.sr:this.vr()?be.W(this.hr):null}cr(e,n,r){e===this.nr&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.nr=e,this.Qe.register({[ur]:[n,e,r]}))}mr(){var e=this.Qe.props[ur];return se(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.cr(null,null,null)}destroy(){clearTimeout(this.br),this.br=void 0,this.er&&k&&(k.removeEventListener("beforeunload",this.er,{capture:!1}),this.er=void 0),this.ir=[]}pr(){this.er=()=>{this.vr()&&be.V(this.dr)},me(k,"beforeunload",this.er,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.R.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[i,s,o]=this.mr(),a=this._r(),l=Lt(o)&&Math.abs(r-o)>864e5,u=!1,c=!s,h=!c&&!e&&this.rr(r,i);c||h||l?(s=this.ar(),a=this.lr(),Zr.info("new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:c,activityTimeout:h,sessionPastMaximumLength:l}}),o=r,u=!0):a||(a=this.lr(),u=!0);var p=Lt(i)&&e&&!l?i:r,f=Lt(o)?o:new Date().getTime();return this.gr(a),this.cr(s,p,f),e||this.ur(),u&&this.ir.forEach((d=>d(s,a,u?{noSessionId:c,activityTimeout:h,sessionPastMaximumLength:l}:void 0))),{sessionId:s,windowId:a,sessionStartTimestamp:f,changeReason:u?{noSessionId:c,activityTimeout:h,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:i}}ur(){clearTimeout(this.br),this.br=setTimeout((()=>{var[e]=this.mr();if(this.rr(new Date().getTime(),e)){var n=this.nr;this.resetSessionId(),this.tr.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var df=["$set_once","$set"],ht=pe("[SiteApps]");class gf{constructor(e){this._instance=e,this.yr=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}wr(e,n){if(n){var r=this.globalsForEvent(n);this.yr.push(r),this.yr.length>1e3&&(this.yr=this.yr.slice(10))}}get siteAppLoaders(){var e;return(e=q._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.wr.bind(this));this.Er=()=>{e(),this.yr=[],this.Er=void 0}}}globalsForEvent(e){var n,r,i,s,o,a,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[p,f]of Object.entries(h))u[p]={id:c[p],type:p,properties:f};var{$set_once:d,$set:v}=e;return{event:z({},Ia(e,df),{properties:z({},e.properties,v?{$set:z({},(n=(r=e.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},v)}:{},d?{$set_once:z({},(i=(s=e.properties)==null?void 0:s.$set_once)!==null&&i!==void 0?i:{},d)}:{}),elements_chain:(o=(a=e.properties)==null?void 0:a.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var n=this.apps[e.id],r=()=>{var a;!n.errored&&this.yr.length&&(ht.info("Processing "+this.yr.length+" events for site app with id "+e.id),this.yr.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((a=this.Er)==null||a.call(this))},i=!1,s=a=>{n.errored=!a,n.loaded=!0,ht.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),i&&r()};try{var{processEvent:o}=e.init({posthog:this._instance,callback:a=>{s(a)}});o&&(n.processEvent=o),i=!0}catch(a){ht.error("Error while initializing PostHog app with config id "+e.id,a),s(!1)}if(i&&n.loaded)try{r()}catch(a){ht.error("Error while processing buffered events PostHog app with config id "+e.id,a),n.errored=!0}}$r(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}Sr(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(n)}catch(i){ht.error("Error while processing event "+e.event+" for site app "+r.id,i)}}}onRemoteConfig(e){var n,r,i,s=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.$r(),void this._instance.on("eventCaptured",(u=>this.Sr(u)))):void ht.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Er)==null||r.call(this),(i=e.siteApps)!=null&&i.length)if(this.isEnabled){var o=function(u){var c;q["__$$ph_site_app_"+u]=s._instance,(c=q.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,l,(h=>{if(h)return ht.error("Error while initializing PostHog app with config id "+u,h)}))};for(var{id:a,url:l}of e.siteApps)o(a)}else ht.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Dl=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&zs(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((i=>zs(i==null?void 0:i.brand,e))))return!0}catch{}return!!t.webdriver},Sn=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),Ao="i.posthog.com";class mf{constructor(e){this.kr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+Ao,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.kr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.kr[this.apiHost]=Sn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.kr[this.apiHost]=Sn.EU:this.kr[this.apiHost]=Sn.CUSTOM),this.kr[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Sn.CUSTOM)return this.apiHost+n;var r=Ao+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var vf={icontains:(t,e)=>!!k&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!k&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!k&&br(e.href,t),not_regex:(t,e)=>!!k&&!br(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class we{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((i=>{we.Pr("retrieved web experiments from the server"),n.Tr=new Map,i.forEach((s=>{if(s.feature_flag_key){var o;n.Tr&&(we.Pr("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=n.Tr)==null||o.set(s.feature_flag_key,s));var a=n._instance.getFeatureFlag(s.feature_flag_key);_e(a)&&s.variants[a]&&n.Ir(s.name,a,s.variants[a].transforms)}else if(s.variants)for(var l in s.variants){var u=s.variants[l];we.Cr(u)&&n.Ir(s.name,l,u.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(e){if(this._is_bot())we.Pr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(Z(this.Tr))return this.Tr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();we.Pr("applying feature flags",e),e.forEach((n=>{var r;if(this.Tr&&(r=this.Tr)!=null&&r.has(n)){var i,s=this._instance.getFeatureFlag(n),o=(i=this.Tr)==null?void 0:i.get(n);s&&o!=null&&o.variants[s]&&this.Ir(o.name,s,o.variants[s].transforms)}}))}}previewWebExperiment(){var e=we.getWindowLocation();if(e!=null&&e.search){var n=gr(e==null?void 0:e.search,"__experiment_id"),r=gr(e==null?void 0:e.search,"__experiment_variant");n&&r&&(we.Pr("previewing web experiments "+n+" && "+r),this.getWebExperiments((i=>{this.Rr(parseInt(n),r,i)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:s=>{if(s.statusCode!==200||!s.json)return e([]);var o=s.json.experiments||[];return e(o)}})}Rr(e,n,r){var i=r.filter((s=>s.id===e));i&&i.length>0&&(we.Pr("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.Ir(i[0].name,n,i[0].variants[n].transforms))}static Cr(e){return!Z(e.conditions)&&we.Fr(e)&&we.Or(e)}static Fr(e){var n;if(Z(e.conditions)||Z((n=e.conditions)==null?void 0:n.url))return!0;var r,i,s,o=we.getWindowLocation();return!!o&&((r=e.conditions)==null||!r.url||vf[(i=(s=e.conditions)==null?void 0:s.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,o))}static getWindowLocation(){return k==null?void 0:k.location}static Or(e){var n;if(Z(e.conditions)||Z((n=e.conditions)==null?void 0:n.utm))return!0;var r=yl();if(r.utm_source){var i,s,o,a,l,u,c,h,p=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,d=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,v=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==r.utm_term;return p&&d&&v&&f}return!1}static Pr(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];$.info("[WebExperiments] "+e,r)}Ir(e,n,r){this._is_bot()?we.Pr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((i=>{if(i.selector){var s;we.Pr("applying transform of variant "+n+" for experiment "+e+" ",i);var o=(s=document)==null?void 0:s.querySelectorAll(i.selector);o==null||o.forEach((a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)}))}})):we.Pr("Control variants leave the page unmodified.")}_is_bot(){return Le&&this._instance?Dl(Le,this._instance.config.custom_blocked_useragents):void 0}}var _f=pe("[PostHog ExternalIntegrations]"),yf={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class bf{constructor(e){this._instance=e}it(e,n){var r;(r=q.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(i=>{if(i)return _f.error("failed to load script",i);n()}))}startIfEnabledOrStop(){var e=this,n=function(o){var a,l,u;!i||(a=q.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[o]||e.it(yf[o],(()=>{var c;(c=q.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.start(e._instance)})),!i&&(l=q.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]&&((u=q.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.stop())};for(var[r,i]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var ji="[SessionRecording]",pn=pe(ji);class Fo{get started(){var e;return!((e=this.Mr)==null||!e.isStarted)}get status(){return this.Mr?this.Mr.status:this.Ar&&!this.jr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ar=!1,this.Dr=void 0,this._instance=e,!this._instance.sessionManager)throw pn.error("started without valid sessionManager"),new Error(ji+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(ji+' cannot be used with cookieless_mode="always"')}get jr(){var e,n=!((e=this._instance.get_property(Nr))==null||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return k&&n&&r&&!i}startIfEnabledOrStop(e){var n;if(!this.jr||(n=this.Mr)==null||!n.isStarted){var r=!O(Object.assign)&&!O(Array.from);this.jr&&r?(this.Lr(e),pn.info("starting")):this.stopRecording()}}Lr(e){var n,r,i;this.jr&&(q!=null&&(n=q.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(r=q.__PosthogExtensions__)!=null&&r.initSessionRecording?this.Nr(e):(i=q.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.Ur,(s=>{if(s)return pn.error("could not load recorder",s);this.Nr(e)})))}stopRecording(){var e,n;(e=this.Dr)==null||e.call(this),this.Dr=void 0,(n=this.Mr)==null||n.stop()}zr(){var e;(e=this._instance.persistence)==null||e.unregister(el)}Hr(e){if(this._instance.persistence){var n,r,i=this._instance.persistence,s=()=>{var o=e.sessionRecording===!1?void 0:e.sessionRecording,a=o==null?void 0:o.sampleRate,l=Z(a)?null:parseFloat(a);Z(l)&&this.zr();var u=o==null?void 0:o.minimumDurationMilliseconds;i.register({[Nr]:z({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:z({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:l,minimumDurationMilliseconds:O(u)?null:u,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers})})};s(),(n=this.Dr)==null||n.call(this),this.Dr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.Hr(e),this.Ar=!0,this.startIfEnabledOrStop()):this.Ar=!0:pn.info("skipping remote config with no sessionRecording",e)}log(e,n){var r;n===void 0&&(n="log"),(r=this.Mr)!=null&&r.log?this.Mr.log(e,n):pn.warn("log called before recorder was ready")}get Ur(){var e,n,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Nr);return(r==null||(n=r.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}Nr(e){var n,r;if((n=q.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Mr||(this.Mr=(r=q.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.Mr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Mr.start(e)}onRRwebEmit(e){var n;(n=this.Mr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.Mr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.Mr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.Mr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.Mr)==null||e.overrideSampling()}overrideTrigger(e){var n,r;this.Mr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.Mr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.Mr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var r;return!((r=this.Mr)==null||!r.tryAddCustomEvent(e,n))}}var Tn={},qi=()=>{},$t="posthog",Ml=!$h&&(Ae==null?void 0:Ae.indexOf("MSIE"))===-1&&(Ae==null?void 0:Ae.indexOf("Mozilla"))===-1,Ro=t=>{var e;return z({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:qc(M==null?void 0:M.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:qi,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:xe&&_e(xe==null?void 0:xe.search)&&xe.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(k==null||(e=k.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;$.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Bi},error_tracking:{},_onCapture:qi,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},Oo=t=>{var e={};O(t.process_person)||(e.person_profiles=t.process_person),O(t.xhr_headers)||(e.request_headers=t.xhr_headers),O(t.cookie_name)||(e.persistence_name=t.cookie_name),O(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),O(t.store_google)||(e.save_campaign_params=t.store_google),O(t.verbose)||(e.debug=t.verbose);var n=de({},e,t);return se(t.property_blacklist)&&(O(t.property_denylist)?n.property_denylist=t.property_blacklist:se(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:$.error("Invalid value for property_denylist config: "+t.property_denylist)),n};class xf{constructor(){this.__forceAllowLocalhost=!1}get Br(){return this.__forceAllowLocalhost}set Br(e){$.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Ir{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new xf,this.qr=!1,this.version=tt.LIB_VERSION,this.bi=new fs,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Ro(),this.SentryIntegration=vh,this.sentryIntegration=e=>(function(n,r){var i=_l(n,r);return{name:vl,processEvent:s=>i(s)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wr=!1,this.Gr=null,this.Vr=null,this.Jr=null,this.featureFlags=new Yh(this),this.toolbar=new yh(this),this.scrollManager=new ff(this),this.pageViewManager=new po(this),this.surveys=new rf(this),this.conversations=new sf(this),this.logs=new of(this),this.experiments=new we(this),this.exceptions=new zh(this),this.rateLimiter=new af(this),this.requestRouter=new mf(this),this.consent=new hh(this),this.externalIntegrations=new bf(this),this.people={set:(e,n,r)=>{var i=_e(e)?{[e]:n}:e;this.setPersonProperties(i),r==null||r({})},set_once:(e,n,r)=>{var i=_e(e)?{[e]:n}:e;this.setPersonProperties(void 0,i),r==null||r({})}},this.on("eventCaptured",(e=>$.info('send "'+(e==null?void 0:e.event)+'"',e)))}init(e,n,r){if(r&&r!==$t){var i,s=(i=Tn[r])!==null&&i!==void 0?i:new Ir;return s._init(e,n,r),Tn[r]=s,Tn[$t][r]=s,s}return this._init(e,n,r)}_init(e,n,r){var i;if(n===void 0&&(n={}),O(e)||bi(e))return $.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return this;this.__loaded=!0,this.config={},n.debug=this.Kr(n.debug),this.Yr=n,this.Xr=[],n.person_profiles&&(this.Vr=n.person_profiles),this.set_config(de({},Ro(n.defaults),Oo(n),{name:r,token:e})),this.config.on_xhr_error&&$.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:it.GZipJS;var s=this.Qr();this.persistence=new Xr(this.config,s),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Xr(z({},this.config,{persistence:"sessionStorage"}),s);var o=z({},this.persistence.props),a=z({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zr=new uf((w=>this.ts(w)),this.config.request_queue_config),this.es=new hf(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new To(this),this.sessionPropsManager=new Io(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.rs(l)}),0)):($.info("Initializing extensions synchronously"),this.rs(l)),tt.DEBUG=tt.DEBUG||this.config.debug,tt.DEBUG&&$.info("Starting in debug mode",{this:this,config:n,thisC:z({},this.config),p:o,s:a}),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var u,c,h=this.config.get_device_id(dt()),p=(u=n.bootstrap)!=null&&u.isIdentifiedID?h:n.bootstrap.distinctID;this.persistence.set_property(nt,(c=n.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:p})}if(this.ss()){var f,d,v=Object.keys(((f=n.bootstrap)==null?void 0:f.featureFlags)||{}).filter((w=>{var E;return!((E=n.bootstrap)==null||(E=E.featureFlags)==null||!E[w])})).reduce(((w,E)=>{var F;return w[E]=((F=n.bootstrap)==null||(F=F.featureFlags)==null?void 0:F[E])||!1,w}),{}),y=Object.keys(((d=n.bootstrap)==null?void 0:d.featureFlagPayloads)||{}).filter((w=>v[w])).reduce(((w,E)=>{var F,C;return(F=n.bootstrap)!=null&&(F=F.featureFlagPayloads)!=null&&F[E]&&(w[E]=(C=n.bootstrap)==null||(C=C.featureFlagPayloads)==null?void 0:C[E]),w}),{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:y})}if(l)this.register_once({distinct_id:sn,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(dt());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(nt,"anonymous")}return me(k,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?mh(this,(()=>this.ns())):this.ns(),gt(this.config._onCapture)&&this.config._onCapture!==qi&&($.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(w=>this.config._onCapture(w.event,w)))),this.config.ip&&$.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}rs(e){var n=performance.now();this.historyAutocapture=new gh(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new xh(this).startIfEnabledOrStop()})),r.push((()=>{var i;this.siteApps=new gf(this),(i=this.siteApps)==null||i.init()})),e||r.push((()=>{this.sessionRecording=new Fo(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new rh(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.logs.loadIfEnabled()})),r.push((()=>{this.conversations.loadIfEnabled()})),r.push((()=>{this.productTours=new Jh(this),this.productTours.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Ih(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Ch(this)})),r.push((()=>{this.exceptionObserver=new dh(this),this.exceptionObserver.startIfEnabledOrStop()})),r.push((()=>{this.deadClicksAutocapture=new ml(this,ph),this.deadClicksAutocapture.startIfEnabledOrStop()})),r.push((()=>{if(this.os){var i=this.os;this.os=void 0,this.wi(i)}})),this.ls(r,n)}ls(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.ls(e,n)}),0);var r=e.shift();if(r)try{r()}catch(s){$.error("Error initializing extension:",s)}}var i=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&$.info("PostHog extensions initialized ("+i+"ms)")}wi(e){var n,r,i,s,o,a,l,u,c;if(!M||!M.body)return $.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.wi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.os=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=K(e.supportedCompression,it.GZipJS)?it.GZipJS:K(e.supportedCompression,it.Base64)?it.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Vr?this.Vr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(i=this.sessionRecording)==null||i.onRemoteConfig(e),(s=this.autocapture)==null||s.onRemoteConfig(e),(o=this.heatmaps)==null||o.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),(a=this.productTours)==null||a.onRemoteConfig(e),(l=this.webVitalsAutocapture)==null||l.onRemoteConfig(e),(u=this.exceptionObserver)==null||u.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}ns(){try{this.config.loaded(this)}catch(r){$.critical("`loaded` function failed",r)}if(this.us(),this.config.internal_or_test_user_hostname&&xe!=null&&xe.hostname){var e=xe.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.hs()}),1),new lf(this).load(),this.featureFlags.flags()}us(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Zr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&mt(this.__request_queue,(e=>this.ts(e))),this.__request_queue=[],this.us()}_handle_unload(){var e,n;this.surveys.handlePageUnload(),this.config.request_batching?(this.ds()&&this.capture("$pageleave"),(e=this.Zr)==null||e.unload(),(n=this.es)==null||n.unload()):this.ds()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Ml?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=yr(e.url,{ip:this.config.ip?1:0}),e.headers=z({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,i,s,o=z({},n);o.timeout=o.timeout||6e4,o.url=yr(o.url,{_:new Date().getTime().toString(),ver:tt.LIB_VERSION,compression:o.compression});var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",l=ir.filter((c=>!o.disableTransport||!c.transport||!o.disableTransport.includes(c.transport))),u=(i=(s=Ka(l,(c=>c.transport===a)))==null?void 0:s.method)!==null&&i!==void 0?i:l[0].method;if(!u)throw new Error("No available transport method");u(o)})(z({},e,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(i=this.config).on_request_error)==null||r.call(i,n)),e.callback==null||e.callback(n)}}))))}ts(e){this.es?this.es.retriableRequest(e):this._send_request(e)}_execute_array(e){var n,r=[],i=[],s=[];mt(e,(a=>{a&&(n=a[0],se(n)?s.push(a):gt(a)?a.call(this):se(a)&&n==="alias"?r.push(a):se(a)&&n.indexOf("capture")!==-1&&gt(this[n])?s.push(a):i.push(a))}));var o=function(a,l){mt(a,(function(u){if(se(u[0])){var c=l;ce(u,(function(h){c=c[h[0]].apply(c,h.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};o(r,this),o(i,this),o(s,this)}ss(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zr){if(this.is_capturing())if(!O(e)&&_e(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(s&&!this.config.__preview_capture_bot_pageviews)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!_e(n==null?void 0:n.$current_url)&&($.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,l=(r==null?void 0:r.timestamp)||a,u=dt(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,n||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&s&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(c.$set=r==null?void 0:r.$set);var h,p=e!=="$groupidentify",f=this.vs(r==null?void 0:r.$set_once,p);if(f&&(c.$set_once=f),(c=Bc(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,O(r==null?void 0:r.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===En.DISMISSED||e===En.SENT){var d=n==null?void 0:n[Qr.SURVEY_ID],v=n==null?void 0:n[Qr.SURVEY_ITERATION];h={id:d,current_iteration:v},localStorage.getItem(Co(h))||localStorage.setItem(Co(h),"true"),c.$set=z({},c.$set,{[Kh({id:d,current_iteration:v},e===En.SENT?"responded":"dismissed")]:!0})}else e===En.SHOWN&&(c.$set=z({},c.$set,{[Qr.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var y=z({},c.properties.$set,c.$set);if(Bt(y)||this.setPersonPropertiesForFlags(y),!Z(this.config.before_send)){var _=this.cs(c);if(!_)return;c=_}this.bi.emit("eventCaptured",c);var w={method:"POST",url:(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.ts(w):this.Zr.enqueue(w),c}$.critical("This capture call is ignored due to client rate limiting.")}}else $.error("No event name provided to posthog.capture")}else $.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,i,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=s?void 0:this.persistence.remove_event_timer(e),a=z({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),e==="$snapshot"){var l=z({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!_e(a.distinct_id)&&!at(a.distinct_id)||bi(a.distinct_id))&&$.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,c=Sh(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());a.$session_id=h,a.$window_id=p}this.sessionPropsManager&&de(a,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&de(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(f=this.es)==null?void 0:f.length}catch(_){a.$sdk_debug_error_capturing_properties=String(_)}if(this.requestRouter.region===Sn.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||s?e!=="$pageleave"||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=de(a,u),e==="$pageview"&&M&&(a.title=M.title),!O(o)){var d=r.getTime()-o;a.$duration=parseFloat((d/1e3).toFixed(3))}Ae&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=de({},c,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),se(this.config.property_denylist)?ce(this.config.property_denylist,(function(_){delete a[_]})):$.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var v=this.config.sanitize_properties;v&&($.error("sanitize_properties is deprecated. Use before_send instead"),a=v(a,e));var y=this.fs();return a.$process_person_profile=y,y&&!s&&this.ps("_calculate_event_properties"),a}vs(e,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.fs()||this.qr)return e;var i=this.persistence.get_initial_props(),s=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=de({},i,s||{},e||{}),a=this.config.sanitize_properties;return a&&($.error("sanitize_properties is deprecated. Use before_send instead"),o=a(o,"$set_once")),n&&(this.qr=!0),Bt(o)?void 0:o}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var i;(i=this.persistence)==null||i.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}gs(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){return this.featureFlags.getFeatureFlagResult(e,n)}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,n,r){var i=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},s=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},o=z({},i,e),a=z({},s,n),l={};for(var[u,c]of Object.entries(o)){var h=typeof c=="string";l[u]={key:u,enabled:!!h||!!c,variant:h?c:void 0,reason:void 0,metadata:O(a==null?void 0:a[u])?void 0:{id:0,version:void 0,description:void 0,payload:a[u]}}}this.featureFlags.receivedFeatureFlags({flags:l})}updateEarlyAccessFeatureEnrollment(e,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.bi.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=Zh),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,r){if(!this.__loaded||!this.persistence)return $.uninitializedWarning("posthog.identify");if(at(e)&&(e=e.toString(),$.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))$.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==sn){if(this.ps("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==i&&e!==this.get_property(yn)&&(this.unregister(yn),this.register({distinct_id:e}));var o=(this.persistence.get_property(nt)||"anonymous")==="anonymous";e!==i&&o?(this.persistence.set_property(nt,"identified"),this.setPersonPropertiesForFlags(z({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.Jr=bo(e,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(cr))}}else $.critical('The string "'+sn+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else $.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.ps("posthog.setPersonProperties")){var r=bo(this.get_distinct_id(),e,n);this.Jr!==r?(this.setPersonPropertiesForFlags(z({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Jr=r):$.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:z({},i,{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}else $.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.ps("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,r,i,s;if($.info("reset"),!this.__loaded)return $.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(nt,"anonymous"),(s=this.sessionManager)==null||s.resetSessionId(),this.Jr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:sn,$device_id:null},"");else{var a=this.config.get_device_id(dt());this.register_once({distinct_id:a,$device_id:e?a:o},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var s,o=(s=e.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return i}alias(e,n){return e===this.get_property(Qa)?($.critical("Attempting to create alias for existing People user - aborting."),-2):this.ps("posthog.alias")?(O(n)&&(n=this.get_distinct_id()),e!==n?(this.gs(yn,e),this.capture("$create_alias",{alias:e,distinct_id:n})):($.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=z({},this.config);if(ve(e)){var r,i,s,o,a,l,u,c;de(this.config,Oo(e));var h=this.Qr();(r=this.persistence)==null||r.update_config(this.config,n,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Xr(z({},this.config,{persistence:"sessionStorage"}),h);var p=this.Kr(this.config.debug);ot(p)&&(this.config.debug=p),ot(this.config.debug)&&(this.config.debug?(tt.DEBUG=!0,fe.H()&&fe.G("ph_debug","true"),$.info("set_config",{config:e,oldConfig:n,newConfig:z({},this.config)})):(tt.DEBUG=!1,fe.H()&&fe.V("ph_debug"))),(i=this.exceptionObserver)==null||i.onConfigChange(),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._s(),(c=this.externalIntegrations)==null||c.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,r={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,s,o,a,l;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(z({},i,n))}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:$t;return n!==$t&&(n=$t+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(nt))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(nt))==="identified"}fs(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Bt(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[yn])&&((n=this.persistence)==null||(n=n.props)==null||!n[fr]))}ds(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.fs()||this.ps("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ps("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ps(e){return this.config.person_profiles==="never"?($.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.gs(fr,!0),!0)}Qr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}_s(){var e,n,r,i,s=this.Qr();return((e=this.persistence)==null?void 0:e.Pi)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.Pi)!==s&&((i=this.sessionPersistence)==null||i.set_disabled(s)),s}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var r,i,s;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new To(this),this.pageViewManager=new po(this),this.persistence&&(this.sessionPropsManager=new Io(this,this.sessionManager,this.persistence)),this.sessionRecording=new Fo(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this._s(),this.us(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(O(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((s=e==null?void 0:e.captureEventName)!==null&&s!==void 0?s:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.hs()}else $.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._s(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:sn,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.hs())):$.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===rt.GRANTED?"granted":e===rt.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._s()}_is_bot(){return Le?Dl(Le,this.config.custom_blocked_useragents):void 0}hs(){M&&(M.visibilityState==="visible"?this.Wr||(this.Wr=!0,this.capture("$pageview",{title:M.title},{send_instantly:!0}),this.Gr&&(M.removeEventListener("visibilitychange",this.Gr),this.Gr=null)):this.Gr||(this.Gr=this.hs.bind(this),me(M,"visibilitychange",this.Gr)))}debug(e){e===!1?(k==null||k.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(k==null||k.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}M(){var e,n,r,i,s,o,a,l=this.Yr||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?($.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,s=$,o=(n="advanced_disable_flags")in(e=l)&&!Z(e[n]),a=r in e&&!Z(e[r]),o?e[n]:a?(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):i)}cs(e){if(Z(this.config.before_send))return e;var n=se(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),Z(r)){var s="Event '"+e.event+"' was rejected in beforeSend function";return rc(e.event)?$.warn(s+". This can cause unexpected behavior."):$.info(s),null}r.properties&&!Bt(r.properties)||$.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Kt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Kr(e){var n=ot(e)&&!e,r=fe.H()&&fe.q("ph_debug")==="true";return!n&&(!!r||e)}}(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=Nc(t.prototype[e[n]])})(Ir,["identify"]);var Do,X_=(Do=Tn[$t]=new Ir,(function(){function t(){t.done||(t.done=!0,Ml=!1,ce(Tn,(function(e){e._dom_loaded()})))}M!=null&&M.addEventListener?M.readyState==="complete"?t():me(M,"DOMContentLoaded",t,{capture:!1}):k&&$.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),Do);const kf=t=>t;let J_=kf;function Ll(t){let e;return()=>(e===void 0&&(e=t()),e)}const wf=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r},K_=t=>t*1e3,Q_=t=>t/1e3,Ef=Ll(()=>window.ScrollTimeline!==void 0);class Sf{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=n}attachTimeline(e,n){const r=this.animations.map(i=>{if(Ef()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Z_ extends Sf{then(e,n){return Promise.all(this.animations).then(e).catch(n)}}function ey(t,e){return t?t[e]||t.default||t:void 0}const Mo=2e4;function ty(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Mo;)e+=n,r=t.next(e);return e>=Mo?1/0:e}function ny(t){return typeof t=="function"}function ry(t,e){t.timeline=e,t.onfinish=null}const $l=t=>Array.isArray(t)&&typeof t[0]=="number",Cf={linearEasing:void 0};function Pf(t,e){const n=Ll(t);return()=>{var r;return(r=Cf[e])!==null&&r!==void 0?r:n()}}const Hi=Pf(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),If=(t,e,n=10)=>{let r="";const i=Math.max(Math.round(e/n),2);for(let s=0;s<i;s++)r+=t(wf(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function Tf(t){return!!(typeof t=="function"&&Hi()||!t||typeof t=="string"&&(t in Ui||Hi())||$l(t)||Array.isArray(t)&&t.every(Tf))}const Cn=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Ui={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Cn([0,.65,.55,1]),circOut:Cn([.55,0,1,.45]),backIn:Cn([.31,.01,.66,-.59]),backOut:Cn([.33,1.53,.69,.99])};function Af(t,e){if(t)return typeof t=="function"&&Hi()?If(t,e):$l(t)?Cn(t):Array.isArray(t)?t.map(n=>Af(n,e)||Ui.easeOut):Ui[t]}const He={x:!1,y:!1};function zl(){return He.x||He.y}function Ff(t,e,n){var r;if(t instanceof Element)return[t];if(typeof t=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}function Nl(t,e){const n=Ff(t),r=new AbortController,i={passive:!0,...e,signal:r.signal};return[n,i,()=>r.abort()]}function Lo(t){return e=>{e.pointerType==="touch"||zl()||t(e)}}function iy(t,e,n={}){const[r,i,s]=Nl(t,n),o=Lo(a=>{const{target:l}=a,u=e(a);if(typeof u!="function"||!l)return;const c=Lo(h=>{u(h),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Bl=(t,e)=>e?t===e?!0:Bl(t,e.parentElement):!1,Rf=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Of=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Df(t){return Of.has(t.tagName)||t.tabIndex!==-1}const Pn=new WeakSet;function $o(t){return e=>{e.key==="Enter"&&t(e)}}function ei(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Mf=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=$o(()=>{if(Pn.has(n))return;ei(n,"down");const i=$o(()=>{ei(n,"up")}),s=()=>ei(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function zo(t){return Rf(t)&&!zl()}function sy(t,e,n={}){const[r,i,s]=Nl(t,n),o=a=>{const l=a.currentTarget;if(!zo(a)||Pn.has(l))return;Pn.add(l);const u=e(a),c=(f,d)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),!(!zo(f)||!Pn.has(l))&&(Pn.delete(l),typeof u=="function"&&u(f,{success:d}))},h=f=>{c(f,n.useGlobalTarget||Bl(l,f.target))},p=f=>{c(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",p,i)};return r.forEach(a=>{!Df(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",u=>Mf(u,i),i)}),s}function oy(t){return t==="x"||t==="y"?He[t]?null:(He[t]=!0,()=>{He[t]=!1}):He.x||He.y?null:(He.x=He.y=!0,()=>{He.x=He.y=!1})}function ay(){}function Lf(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const $f=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zf=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nf={};function No(t,e){return(Nf.jsx?zf:$f).test(t)}const Bf=/[ \t\n\f\r]/g;function jf(t){return typeof t=="object"?t.type==="text"?Bo(t.value):!1:Bo(t)}function Bo(t){return t.replace(Bf,"")===""}class Hn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}Hn.prototype.normal={};Hn.prototype.property={};Hn.prototype.space=void 0;function jl(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new Hn(n,r,e)}function Vi(t){return t.toLowerCase()}class Re{constructor(e,n){this.attribute=n,this.property=e}}Re.prototype.attribute="";Re.prototype.booleanish=!1;Re.prototype.boolean=!1;Re.prototype.commaOrSpaceSeparated=!1;Re.prototype.commaSeparated=!1;Re.prototype.defined=!1;Re.prototype.mustUseProperty=!1;Re.prototype.number=!1;Re.prototype.overloadedBoolean=!1;Re.prototype.property="";Re.prototype.spaceSeparated=!1;Re.prototype.space=void 0;let qf=0;const Y=It(),ge=It(),Wi=It(),P=It(),ue=It(),Ut=It(),Me=It();function It(){return 2**++qf}const Gi=Object.freeze(Object.defineProperty({__proto__:null,boolean:Y,booleanish:ge,commaOrSpaceSeparated:Me,commaSeparated:Ut,number:P,overloadedBoolean:Wi,spaceSeparated:ue},Symbol.toStringTag,{value:"Module"})),ti=Object.keys(Gi);class ps extends Re{constructor(e,n,r,i){let s=-1;if(super(e,n),jo(this,"space",i),typeof r=="number")for(;++s<ti.length;){const o=ti[s];jo(this,ti[s],(r&Gi[o])===Gi[o])}}}ps.prototype.defined=!0;function jo(t,e,n){n&&(t[e]=n)}function Kt(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new ps(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[Vi(r)]=r,n[Vi(s.attribute)]=r}return new Hn(e,n,t.space)}const ql=Kt({properties:{ariaActiveDescendant:null,ariaAtomic:ge,ariaAutoComplete:null,ariaBusy:ge,ariaChecked:ge,ariaColCount:P,ariaColIndex:P,ariaColSpan:P,ariaControls:ue,ariaCurrent:null,ariaDescribedBy:ue,ariaDetails:null,ariaDisabled:ge,ariaDropEffect:ue,ariaErrorMessage:null,ariaExpanded:ge,ariaFlowTo:ue,ariaGrabbed:ge,ariaHasPopup:null,ariaHidden:ge,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ue,ariaLevel:P,ariaLive:null,ariaModal:ge,ariaMultiLine:ge,ariaMultiSelectable:ge,ariaOrientation:null,ariaOwns:ue,ariaPlaceholder:null,ariaPosInSet:P,ariaPressed:ge,ariaReadOnly:ge,ariaRelevant:null,ariaRequired:ge,ariaRoleDescription:ue,ariaRowCount:P,ariaRowIndex:P,ariaRowSpan:P,ariaSelected:ge,ariaSetSize:P,ariaSort:null,ariaValueMax:P,ariaValueMin:P,ariaValueNow:P,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Hl(t,e){return e in t?t[e]:e}function Ul(t,e){return Hl(t,e.toLowerCase())}const Hf=Kt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ut,acceptCharset:ue,accessKey:ue,action:null,allow:null,allowFullScreen:Y,allowPaymentRequest:Y,allowUserMedia:Y,alt:null,as:null,async:Y,autoCapitalize:null,autoComplete:ue,autoFocus:Y,autoPlay:Y,blocking:ue,capture:null,charSet:null,checked:Y,cite:null,className:ue,cols:P,colSpan:null,content:null,contentEditable:ge,controls:Y,controlsList:ue,coords:P|Ut,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Y,defer:Y,dir:null,dirName:null,disabled:Y,download:Wi,draggable:ge,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Y,formTarget:null,headers:ue,height:P,hidden:Wi,high:P,href:null,hrefLang:null,htmlFor:ue,httpEquiv:ue,id:null,imageSizes:null,imageSrcSet:null,inert:Y,inputMode:null,integrity:null,is:null,isMap:Y,itemId:null,itemProp:ue,itemRef:ue,itemScope:Y,itemType:ue,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Y,low:P,manifest:null,max:null,maxLength:P,media:null,method:null,min:null,minLength:P,multiple:Y,muted:Y,name:null,nonce:null,noModule:Y,noValidate:Y,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Y,optimum:P,pattern:null,ping:ue,placeholder:null,playsInline:Y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Y,referrerPolicy:null,rel:ue,required:Y,reversed:Y,rows:P,rowSpan:P,sandbox:ue,scope:null,scoped:Y,seamless:Y,selected:Y,shadowRootClonable:Y,shadowRootDelegatesFocus:Y,shadowRootMode:null,shape:null,size:P,sizes:null,slot:null,span:P,spellCheck:ge,src:null,srcDoc:null,srcLang:null,srcSet:null,start:P,step:null,style:null,tabIndex:P,target:null,title:null,translate:null,type:null,typeMustMatch:Y,useMap:null,value:ge,width:P,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ue,axis:null,background:null,bgColor:null,border:P,borderColor:null,bottomMargin:P,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Y,declare:Y,event:null,face:null,frame:null,frameBorder:null,hSpace:P,leftMargin:P,link:null,longDesc:null,lowSrc:null,marginHeight:P,marginWidth:P,noResize:Y,noHref:Y,noShade:Y,noWrap:Y,object:null,profile:null,prompt:null,rev:null,rightMargin:P,rules:null,scheme:null,scrolling:ge,standby:null,summary:null,text:null,topMargin:P,valueType:null,version:null,vAlign:null,vLink:null,vSpace:P,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Y,disableRemotePlayback:Y,prefix:null,property:null,results:P,security:null,unselectable:null},space:"html",transform:Ul}),Uf=Kt({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Me,accentHeight:P,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:P,amplitude:P,arabicForm:null,ascent:P,attributeName:null,attributeType:null,azimuth:P,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:P,by:null,calcMode:null,capHeight:P,className:ue,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:P,diffuseConstant:P,direction:null,display:null,dur:null,divisor:P,dominantBaseline:null,download:Y,dx:null,dy:null,edgeMode:null,editable:null,elevation:P,enableBackground:null,end:null,event:null,exponent:P,externalResourcesRequired:null,fill:null,fillOpacity:P,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ut,g2:Ut,glyphName:Ut,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:P,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:P,horizOriginX:P,horizOriginY:P,id:null,ideographic:P,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:P,k:P,k1:P,k2:P,k3:P,k4:P,kernelMatrix:Me,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:P,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:P,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:P,overlineThickness:P,paintOrder:null,panose1:null,path:null,pathLength:P,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ue,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:P,pointsAtY:P,pointsAtZ:P,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Me,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Me,rev:Me,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Me,requiredFeatures:Me,requiredFonts:Me,requiredFormats:Me,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:P,specularExponent:P,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:P,strikethroughThickness:P,string:null,stroke:null,strokeDashArray:Me,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:P,strokeOpacity:P,strokeWidth:null,style:null,surfaceScale:P,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Me,tabIndex:P,tableValues:null,target:null,targetX:P,targetY:P,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Me,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:P,underlineThickness:P,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:P,values:null,vAlphabetic:P,vMathematical:P,vectorEffect:null,vHanging:P,vIdeographic:P,version:null,vertAdvY:P,vertOriginX:P,vertOriginY:P,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:P,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Hl}),Vl=Kt({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Wl=Kt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ul}),Gl=Kt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Vf=/[A-Z]/g,qo=/-[a-z]/g,Wf=/^data[-\w.:]+$/i;function Gf(t,e){const n=Vi(e);let r=e,i=Re;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Wf.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(qo,Xf);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!qo.test(s)){let o=s.replace(Vf,Yf);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=ps}return new i(r,e)}function Yf(t){return"-"+t.toLowerCase()}function Xf(t){return t.charAt(1).toUpperCase()}const Jf=jl([ql,Hf,Vl,Wl,Gl],"html"),ds=jl([ql,Uf,Vl,Wl,Gl],"svg");function Kf(t){return t.join(" ").trim()}var Dt={},ni,Ho;function Qf(){if(Ho)return ni;Ho=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
5
- `,u="/",c="*",h="",p="comment",f="declaration";function d(y,_){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];_=_||{};var w=1,E=1;function F(B){var A=B.match(e);A&&(w+=A.length);var J=B.lastIndexOf(l);E=~J?B.length-J:E+B.length}function C(){var B={line:w,column:E};return function(A){return A.position=new x(B),U(),A}}function x(B){this.start=B,this.end={line:w,column:E},this.source=_.source}x.prototype.content=y;function N(B){var A=new Error(_.source+":"+w+":"+E+": "+B);if(A.reason=B,A.filename=_.source,A.line=w,A.column=E,A.source=y,!_.silent)throw A}function T(B){var A=B.exec(y);if(A){var J=A[0];return F(J),y=y.slice(J.length),A}}function U(){T(n)}function b(B){var A;for(B=B||[];A=D();)A!==!1&&B.push(A);return B}function D(){var B=C();if(!(u!=y.charAt(0)||c!=y.charAt(1))){for(var A=2;h!=y.charAt(A)&&(c!=y.charAt(A)||u!=y.charAt(A+1));)++A;if(A+=2,h===y.charAt(A-1))return N("End of comment missing");var J=y.slice(2,A-2);return E+=2,F(J),y=y.slice(A),E+=2,B({type:p,comment:J})}}function L(){var B=C(),A=T(r);if(A){if(D(),!T(i))return N("property missing ':'");var J=T(s),ie=B({type:f,property:v(A[0].replace(t,h)),value:J?v(J[0].replace(t,h)):h});return T(o),ie}}function V(){var B=[];b(B);for(var A;A=L();)A!==!1&&(B.push(A),b(B));return B}return U(),V()}function v(y){return y?y.replace(a,h):h}return ni=d,ni}var Uo;function Zf(){if(Uo)return Dt;Uo=1;var t=Dt&&Dt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.default=n;const e=t(Qf());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,e.default)(r),a=typeof i=="function";return o.forEach(l=>{if(l.type!=="declaration")return;const{property:u,value:c}=l;a?i(u,c,l):c&&(s=s||{},s[u]=c)}),s}return Dt}var dn={},Vo;function ep(){if(Vo)return dn;Vo=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(u){return!u||n.test(u)||t.test(u)},o=function(u,c){return c.toUpperCase()},a=function(u,c){return"".concat(c,"-")},l=function(u,c){return c===void 0&&(c={}),s(u)?u:(u=u.toLowerCase(),c.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(e,o))};return dn.camelCase=l,dn}var gn,Wo;function tp(){if(Wo)return gn;Wo=1;var t=gn&&gn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(Zf()),n=ep();function r(i,s){var o={};return!i||typeof i!="string"||(0,e.default)(i,function(a,l){a&&l&&(o[(0,n.camelCase)(a,s)]=l)}),o}return r.default=r,gn=r,gn}var np=tp();const rp=Ca(np),Yl=Xl("end"),gs=Xl("start");function Xl(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ip(t){const e=gs(t),n=Yl(t);if(e&&n)return{start:e,end:n}}function An(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Go(t.position):"start"in t||"end"in t?Go(t):"line"in t||"column"in t?Yi(t):""}function Yi(t){return Yo(t&&t.line)+":"+Yo(t&&t.column)}function Go(t){return Yi(t&&t.start)+"-"+Yi(t&&t.end)}function Yo(t){return t&&typeof t=="number"?t:1}class Se extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(o=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=An(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Se.prototype.file="";Se.prototype.name="";Se.prototype.reason="";Se.prototype.message="";Se.prototype.stack="";Se.prototype.column=void 0;Se.prototype.line=void 0;Se.prototype.ancestors=void 0;Se.prototype.cause=void 0;Se.prototype.fatal=void 0;Se.prototype.place=void 0;Se.prototype.ruleId=void 0;Se.prototype.source=void 0;const ms={}.hasOwnProperty,sp=new Map,op=/[A-Z]/g,ap=new Set(["table","tbody","thead","tfoot","tr"]),lp=new Set(["td","th"]),Jl="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ly(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=mp(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=gp(n,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?ds:Jf,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=Kl(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function Kl(t,e,n){if(e.type==="element")return up(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return cp(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return fp(t,e,n);if(e.type==="mdxjsEsm")return hp(t,e);if(e.type==="root")return pp(t,e,n);if(e.type==="text")return dp(t,e)}function up(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ds,t.schema=i),t.ancestors.push(e);const s=Zl(t,e.tagName,!1),o=vp(t,e);let a=_s(t,e);return ap.has(e.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!jf(l):!0})),Ql(t,o,s,e),vs(o,a),t.ancestors.pop(),t.schema=r,t.create(e,s,o,n)}function cp(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}zn(t,e.position)}function hp(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);zn(t,e.position)}function fp(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=ds,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:Zl(t,e.name,!0),o=_p(t,e),a=_s(t,e);return Ql(t,o,s,e),vs(o,a),t.ancestors.pop(),t.schema=r,t.create(e,s,o,n)}function pp(t,e,n){const r={};return vs(r,_s(t,e)),t.create(e,t.Fragment,r,n)}function dp(t,e){return e.value}function Ql(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function vs(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function gp(t,e,n){return r;function r(i,s,o,a){const u=Array.isArray(o.children)?n:e;return a?u(s,o,a):u(s,o)}}function mp(t,e){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=gs(r);return e(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function vp(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&ms.call(e.properties,i)){const s=yp(t,i,e.properties[i]);if(s){const[o,a]=s;t.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&lp.has(e.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function _p(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,t.evaluater.evaluateExpression(a.argument))}else zn(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const a=r.value.data.estree.body[0];a.type,s=t.evaluater.evaluateExpression(a.expression)}else zn(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function _s(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:sp;for(;++r<e.children.length;){const s=e.children[r];let o;if(t.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;o=l+"-"+u,i.set(l,u+1)}}const a=Kl(t,s,o);a!==void 0&&n.push(a)}return n}function yp(t,e,n){const r=Gf(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Lf(n):Kf(n)),r.property==="style"){let i=typeof n=="object"?n:bp(t,String(n));return t.stylePropertyNameCase==="css"&&(i=xp(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?Ku[r.property]||r.property:r.attribute,n]}}function bp(t,e){try{return rp(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Se("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Jl+"#cannot-parse-style-attribute",i}}function Zl(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,o;for(;++s<i.length;){const a=No(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=No(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return ms.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);zn(t)}function zn(t,e){const n=new Se("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=Jl+"#cannot-handle-mdx-estrees-without-createevaluater",n}function xp(t){const e={};let n;for(n in t)ms.call(t,n)&&(e[kp(n)]=t[n]);return e}function kp(t){let e=t.replace(op,wp);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function wp(t){return"-"+t.toLowerCase()}const uy={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Ep={};function ys(t,e){const n=Ep,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return eu(t,r,i)}function eu(t,e,n){if(Sp(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Xo(t.children,e,n)}return Array.isArray(t)?Xo(t,e,n):""}function Xo(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=eu(t[i],e,n);return r.join("")}function Sp(t){return!!(t&&typeof t=="object")}const Jo=document.createElement("i");function bs(t){const e="&"+t+";";Jo.innerHTML=e;const n=Jo.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function $e(t,e,n,r){const i=t.length;let s=0,o;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(e,0),t.splice(...o),s+=1e4,e+=1e4}function Ne(t,e){return t.length>0?($e(t,t.length,0,e),t):e}const Ko={}.hasOwnProperty;function tu(t){const e={};let n=-1;for(;++n<t.length;)Cp(e,t[n]);return e}function Cp(t,e){let n;for(n in e){const i=(Ko.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let o;if(s)for(o in s){Ko.call(i,o)||(i[o]=[]);const a=s[o];Pp(i[o],Array.isArray(a)?a:a?[a]:[])}}}function Pp(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);$e(t,0,0,r)}function nu(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ue(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ie=_t(/[A-Za-z]/),Ee=_t(/[\dA-Za-z]/),Ip=_t(/[#-'*+\--9=?A-Z^-~]/);function xr(t){return t!==null&&(t<32||t===127)}const Xi=_t(/\d/),Tp=_t(/[\dA-Fa-f]/),Ap=_t(/[!-/:-@[-`{-~]/);function H(t){return t!==null&&t<-2}function le(t){return t!==null&&(t<0||t===32)}function Q(t){return t===-2||t===-1||t===32}const Tr=_t(new RegExp("\\p{P}|\\p{S}","u")),Pt=_t(/\s/);function _t(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Qt(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let o="";if(s===37&&Ee(t.charCodeAt(n+1))&&Ee(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=t.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(e.push(t.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function ne(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return Q(l)?(t.enter(n),a(l)):e(l)}function a(l){return Q(l)&&s++<i?(t.consume(l),a):(t.exit(n),e(l))}}const Fp={tokenize:Rp};function Rp(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ne(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),s(a)}function s(a){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return H(a)?(t.consume(a),t.exit("chunkText"),s):(t.consume(a),o)}}const Op={tokenize:Dp},Qo={tokenize:Mp};function Dp(t){const e=this,n=[];let r=0,i,s,o;return a;function a(E){if(r<n.length){const F=n[r];return e.containerState=F[1],t.attempt(F[0].continuation,l,u)(E)}return u(E)}function l(E){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&w();const F=e.events.length;let C=F,x;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){x=e.events[C][1].end;break}_(r);let N=F;for(;N<e.events.length;)e.events[N][1].end={...x},N++;return $e(e.events,C+1,0,e.events.slice(F)),e.events.length=N,u(E)}return a(E)}function u(E){if(r===n.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return d(E);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Qo,c,h)(E)}function c(E){return i&&w(),_(r),p(E)}function h(E){return e.parser.lazy[e.now().line]=r!==n.length,o=e.now().offset,d(E)}function p(E){return e.containerState={},t.attempt(Qo,f,d)(E)}function f(E){return r++,n.push([e.currentConstruct,e.containerState]),p(E)}function d(E){if(E===null){i&&w(),_(0),t.consume(E);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),v(E)}function v(E){if(E===null){y(t.exit("chunkFlow"),!0),_(0),t.consume(E);return}return H(E)?(t.consume(E),y(t.exit("chunkFlow")),r=0,e.interrupt=void 0,a):(t.consume(E),v)}function y(E,F){const C=e.sliceStream(E);if(F&&C.push(null),E.previous=s,s&&(s.next=E),s=E,i.defineSkip(E.start),i.write(C),e.parser.lazy[E.start.line]){let x=i.events.length;for(;x--;)if(i.events[x][1].start.offset<o&&(!i.events[x][1].end||i.events[x][1].end.offset>o))return;const N=e.events.length;let T=N,U,b;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){if(U){b=e.events[T][1].end;break}U=!0}for(_(r),x=N;x<e.events.length;)e.events[x][1].end={...b},x++;$e(e.events,T+1,0,e.events.slice(N)),e.events.length=x}}function _(E){let F=n.length;for(;F-- >E;){const C=n[F];e.containerState=C[1],C[0].exit.call(e,t)}n.length=E}function w(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function Mp(t,e,n){return ne(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Yt(t){if(t===null||le(t)||Pt(t))return 1;if(Tr(t))return 2}function Ar(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const Ji={name:"attention",resolveAll:Lp,tokenize:$p};function Lp(t,e){let n=-1,r,i,s,o,a,l,u,c;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const h={...t[r][1].end},p={...t[n][1].start};Zo(h,-l),Zo(p,l),o={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...t[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},s={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},t[r][1].end={...o.start},t[n][1].start={...a.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=Ne(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=Ne(u,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",s,e]]),u=Ne(u,Ar(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=Ne(u,[["exit",s,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,u=Ne(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,$e(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function $p(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Yt(r);let s;return o;function o(l){return s=l,t.enter("attentionSequence"),a(l)}function a(l){if(l===s)return t.consume(l),a;const u=t.exit("attentionSequence"),c=Yt(l),h=!c||c===2&&i||n.includes(l),p=!i||i===2&&c||n.includes(r);return u._open=!!(s===42?h:h&&(i||!p)),u._close=!!(s===42?p:p&&(c||!h)),e(l)}}function Zo(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const zp={name:"autolink",tokenize:Np};function Np(t,e,n){let r=0;return i;function i(f){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(f){return Ie(f)?(t.consume(f),o):f===64?n(f):u(f)}function o(f){return f===43||f===45||f===46||Ee(f)?(r=1,a(f)):u(f)}function a(f){return f===58?(t.consume(f),r=0,l):(f===43||f===45||f===46||Ee(f))&&r++<32?(t.consume(f),a):(r=0,u(f))}function l(f){return f===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):f===null||f===32||f===60||xr(f)?n(f):(t.consume(f),l)}function u(f){return f===64?(t.consume(f),c):Ip(f)?(t.consume(f),u):n(f)}function c(f){return Ee(f)?h(f):n(f)}function h(f){return f===46?(t.consume(f),r=0,c):f===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(f),t.exit("autolinkMarker"),t.exit("autolink"),e):p(f)}function p(f){if((f===45||Ee(f))&&r++<63){const d=f===45?p:h;return t.consume(f),d}return n(f)}}const Un={partial:!0,tokenize:Bp};function Bp(t,e,n){return r;function r(s){return Q(s)?ne(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||H(s)?e(s):n(s)}}const ru={continuation:{tokenize:qp},exit:Hp,name:"blockQuote",tokenize:jp};function jp(t,e,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Q(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function qp(t,e,n){const r=this;return i;function i(o){return Q(o)?ne(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return t.attempt(ru,e,n)(o)}}function Hp(t){t.exit("blockQuote")}const iu={name:"characterEscape",tokenize:Up};function Up(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return Ap(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const su={name:"characterReference",tokenize:Vp};function Vp(t,e,n){const r=this;let i=0,s,o;return a;function a(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),l}function l(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),s=31,o=Ee,c(h))}function u(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,o=Tp,c):(t.enter("characterReferenceValue"),s=7,o=Xi,c(h))}function c(h){if(h===59&&i){const p=t.exit("characterReferenceValue");return o===Ee&&!bs(r.sliceSerialize(p))?n(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(h)&&i++<s?(t.consume(h),c):n(h)}}const ea={partial:!0,tokenize:Gp},ta={concrete:!0,name:"codeFenced",tokenize:Wp};function Wp(t,e,n){const r=this,i={partial:!0,tokenize:C};let s=0,o=0,a;return l;function l(x){return u(x)}function u(x){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,a=x,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(x)}function c(x){return x===a?(o++,t.consume(x),c):o<3?n(x):(t.exit("codeFencedFenceSequence"),Q(x)?ne(t,h,"whitespace")(x):h(x))}function h(x){return x===null||H(x)?(t.exit("codeFencedFence"),r.interrupt?e(x):t.check(ea,v,F)(x)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||H(x)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(x)):Q(x)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ne(t,f,"whitespace")(x)):x===96&&x===a?n(x):(t.consume(x),p)}function f(x){return x===null||H(x)?h(x):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),d(x))}function d(x){return x===null||H(x)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(x)):x===96&&x===a?n(x):(t.consume(x),d)}function v(x){return t.attempt(i,F,y)(x)}function y(x){return t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),_}function _(x){return s>0&&Q(x)?ne(t,w,"linePrefix",s+1)(x):w(x)}function w(x){return x===null||H(x)?t.check(ea,v,F)(x):(t.enter("codeFlowValue"),E(x))}function E(x){return x===null||H(x)?(t.exit("codeFlowValue"),w(x)):(t.consume(x),E)}function F(x){return t.exit("codeFenced"),e(x)}function C(x,N,T){let U=0;return b;function b(A){return x.enter("lineEnding"),x.consume(A),x.exit("lineEnding"),D}function D(A){return x.enter("codeFencedFence"),Q(A)?ne(x,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):L(A)}function L(A){return A===a?(x.enter("codeFencedFenceSequence"),V(A)):T(A)}function V(A){return A===a?(U++,x.consume(A),V):U>=o?(x.exit("codeFencedFenceSequence"),Q(A)?ne(x,B,"whitespace")(A):B(A)):T(A)}function B(A){return A===null||H(A)?(x.exit("codeFencedFence"),N(A)):T(A)}}}function Gp(t,e,n){const r=this;return i;function i(o){return o===null?n(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}const ri={name:"codeIndented",tokenize:Xp},Yp={partial:!0,tokenize:Jp};function Xp(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),ne(t,s,"linePrefix",5)(u)}function s(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):H(u)?t.attempt(Yp,o,l)(u):(t.enter("codeFlowValue"),a(u))}function a(u){return u===null||H(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),a)}function l(u){return t.exit("codeIndented"),e(u)}}function Jp(t,e,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):H(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):ne(t,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):H(o)?i(o):n(o)}}const Kp={name:"codeText",previous:Zp,resolve:Qp,tokenize:ed};function Qp(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function Zp(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ed(t,e,n){let r=0,i,s;return o;function o(h){return t.enter("codeText"),t.enter("codeTextSequence"),a(h)}function a(h){return h===96?(t.consume(h),r++,a):(t.exit("codeTextSequence"),l(h))}function l(h){return h===null?n(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),l):h===96?(s=t.enter("codeTextSequence"),i=0,c(h)):H(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),l):(t.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||H(h)?(t.exit("codeTextData"),l(h)):(t.consume(h),u)}function c(h){return h===96?(t.consume(h),i++,c):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(h)):(s.type="codeTextData",u(h))}}class td{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,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&mn(this.left,r),s.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),mn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),mn(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){const n=this.left.splice(e,Number.POSITIVE_INFINITY);mn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);mn(this.left,n.reverse())}}}function mn(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function ou(t){const e={};let n=-1,r,i,s,o,a,l,u;const c=new td(t);for(;++n<c.length;){for(;n in e;)n=e[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,nd(c,n)),n=e[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=c.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return $e(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function nd(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],u={};let c,h,p=-1,f=n,d=0,v=0;const y=[v];for(;f;){for(;t.get(++i)[1]!==f;);s.push(i),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),h&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(v=p+1,y.push(v),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),p=y.length;p--;){const _=a.slice(y[p],y[p+1]),w=s.pop();l.push([w,w+_.length-1]),t.splice(w,2,_)}for(l.reverse(),p=-1;++p<l.length;)u[d+l[p][0]]=d+l[p][1],d+=l[p][1]-l[p][0]-1;return u}const rd={resolve:sd,tokenize:od},id={partial:!0,tokenize:ad};function sd(t){return ou(t),t}function od(t,e){let n;return r;function r(a){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):H(a)?t.check(id,o,s)(a):(t.consume(a),i)}function s(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function o(a){return t.consume(a),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ad(t,e,n){const r=this;return i;function i(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),ne(t,s,"linePrefix")}function s(o){if(o===null||H(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):t.interrupt(r.parser.constructs.flow,n,e)(o)}}function au(t,e,n,r,i,s,o,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return h;function h(_){return _===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(_),t.exit(s),p):_===null||_===32||_===41||xr(_)?n(_):(t.enter(r),t.enter(o),t.enter(a),t.enter("chunkString",{contentType:"string"}),v(_))}function p(_){return _===62?(t.enter(s),t.consume(_),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),f(_))}function f(_){return _===62?(t.exit("chunkString"),t.exit(a),p(_)):_===null||_===60||H(_)?n(_):(t.consume(_),_===92?d:f)}function d(_){return _===60||_===62||_===92?(t.consume(_),f):f(_)}function v(_){return!c&&(_===null||_===41||le(_))?(t.exit("chunkString"),t.exit(a),t.exit(o),t.exit(r),e(_)):c<u&&_===40?(t.consume(_),c++,v):_===41?(t.consume(_),c--,v):_===null||_===32||_===40||xr(_)?n(_):(t.consume(_),_===92?y:v)}function y(_){return _===40||_===41||_===92?(t.consume(_),v):v(_)}}function lu(t,e,n,r,i,s){const o=this;let a=0,l;return u;function u(f){return t.enter(r),t.enter(i),t.consume(f),t.exit(i),t.enter(s),c}function c(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(t.exit(s),t.enter(i),t.consume(f),t.exit(i),t.exit(r),e):H(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||H(f)||a++>999?(t.exit("chunkString"),c(f)):(t.consume(f),l||(l=!Q(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(t.consume(f),a++,h):h(f)}}function uu(t,e,n,r,i,s){let o;return a;function a(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),o=p===40?41:p,l):n(p)}function l(p){return p===o?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(s),u(p))}function u(p){return p===o?(t.exit(s),l(o)):p===null?n(p):H(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),ne(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===o||p===null||H(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?h:c)}function h(p){return p===o||p===92?(t.consume(p),c):c(p)}}function Fn(t,e){let n;return r;function r(i){return H(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Q(i)?ne(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const ld={name:"definition",tokenize:cd},ud={partial:!0,tokenize:hd};function cd(t,e,n){const r=this;let i;return s;function s(f){return t.enter("definition"),o(f)}function o(f){return lu.call(r,t,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Ue(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(t.enter("definitionMarker"),t.consume(f),t.exit("definitionMarker"),l):n(f)}function l(f){return le(f)?Fn(t,u)(f):u(f)}function u(f){return au(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function c(f){return t.attempt(ud,h,h)(f)}function h(f){return Q(f)?ne(t,p,"whitespace")(f):p(f)}function p(f){return f===null||H(f)?(t.exit("definition"),r.parser.defined.push(i),e(f)):n(f)}}function hd(t,e,n){return r;function r(a){return le(a)?Fn(t,i)(a):n(a)}function i(a){return uu(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Q(a)?ne(t,o,"whitespace")(a):o(a)}function o(a){return a===null||H(a)?e(a):n(a)}}const fd={name:"hardBreakEscape",tokenize:pd};function pd(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return H(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const dd={name:"headingAtx",resolve:gd,tokenize:md};function gd(t,e){let n=t.length-2,r=3,i,s;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},$e(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function md(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),s(c)}function s(c){return t.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(t.consume(c),o):c===null||le(c)?(t.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||H(c)?(t.exit("atxHeading"),e(c)):Q(c)?ne(t,a,"whitespace")(c):(t.enter("atxHeadingText"),u(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||le(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),u)}}const vd=["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"],na=["pre","script","style","textarea"],_d={concrete:!0,name:"htmlFlow",resolveTo:xd,tokenize:kd},yd={partial:!0,tokenize:Ed},bd={partial:!0,tokenize:wd};function xd(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 kd(t,e,n){const r=this;let i,s,o,a,l;return u;function u(m){return c(m)}function c(m){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(m),h}function h(m){return m===33?(t.consume(m),p):m===47?(t.consume(m),s=!0,v):m===63?(t.consume(m),i=3,r.interrupt?e:g):Ie(m)?(t.consume(m),o=String.fromCharCode(m),y):n(m)}function p(m){return m===45?(t.consume(m),i=2,f):m===91?(t.consume(m),i=5,a=0,d):Ie(m)?(t.consume(m),i=4,r.interrupt?e:g):n(m)}function f(m){return m===45?(t.consume(m),r.interrupt?e:g):n(m)}function d(m){const re="CDATA[";return m===re.charCodeAt(a++)?(t.consume(m),a===re.length?r.interrupt?e:L:d):n(m)}function v(m){return Ie(m)?(t.consume(m),o=String.fromCharCode(m),y):n(m)}function y(m){if(m===null||m===47||m===62||le(m)){const re=m===47,ye=o.toLowerCase();return!re&&!s&&na.includes(ye)?(i=1,r.interrupt?e(m):L(m)):vd.includes(o.toLowerCase())?(i=6,re?(t.consume(m),_):r.interrupt?e(m):L(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(m):s?w(m):E(m))}return m===45||Ee(m)?(t.consume(m),o+=String.fromCharCode(m),y):n(m)}function _(m){return m===62?(t.consume(m),r.interrupt?e:L):n(m)}function w(m){return Q(m)?(t.consume(m),w):b(m)}function E(m){return m===47?(t.consume(m),b):m===58||m===95||Ie(m)?(t.consume(m),F):Q(m)?(t.consume(m),E):b(m)}function F(m){return m===45||m===46||m===58||m===95||Ee(m)?(t.consume(m),F):C(m)}function C(m){return m===61?(t.consume(m),x):Q(m)?(t.consume(m),C):E(m)}function x(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(t.consume(m),l=m,N):Q(m)?(t.consume(m),x):T(m)}function N(m){return m===l?(t.consume(m),l=null,U):m===null||H(m)?n(m):(t.consume(m),N)}function T(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||le(m)?C(m):(t.consume(m),T)}function U(m){return m===47||m===62||Q(m)?E(m):n(m)}function b(m){return m===62?(t.consume(m),D):n(m)}function D(m){return m===null||H(m)?L(m):Q(m)?(t.consume(m),D):n(m)}function L(m){return m===45&&i===2?(t.consume(m),J):m===60&&i===1?(t.consume(m),ie):m===62&&i===4?(t.consume(m),X):m===63&&i===3?(t.consume(m),g):m===93&&i===5?(t.consume(m),j):H(m)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(yd,W,V)(m)):m===null||H(m)?(t.exit("htmlFlowData"),V(m)):(t.consume(m),L)}function V(m){return t.check(bd,B,W)(m)}function B(m){return t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),A}function A(m){return m===null||H(m)?V(m):(t.enter("htmlFlowData"),L(m))}function J(m){return m===45?(t.consume(m),g):L(m)}function ie(m){return m===47?(t.consume(m),o="",I):L(m)}function I(m){if(m===62){const re=o.toLowerCase();return na.includes(re)?(t.consume(m),X):L(m)}return Ie(m)&&o.length<8?(t.consume(m),o+=String.fromCharCode(m),I):L(m)}function j(m){return m===93?(t.consume(m),g):L(m)}function g(m){return m===62?(t.consume(m),X):m===45&&i===2?(t.consume(m),g):L(m)}function X(m){return m===null||H(m)?(t.exit("htmlFlowData"),W(m)):(t.consume(m),X)}function W(m){return t.exit("htmlFlow"),e(m)}}function wd(t,e,n){const r=this;return i;function i(o){return H(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}function Ed(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Un,e,n)}}const Sd={name:"htmlText",tokenize:Cd};function Cd(t,e,n){const r=this;let i,s,o;return a;function a(g){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(g),l}function l(g){return g===33?(t.consume(g),u):g===47?(t.consume(g),C):g===63?(t.consume(g),E):Ie(g)?(t.consume(g),T):n(g)}function u(g){return g===45?(t.consume(g),c):g===91?(t.consume(g),s=0,d):Ie(g)?(t.consume(g),w):n(g)}function c(g){return g===45?(t.consume(g),f):n(g)}function h(g){return g===null?n(g):g===45?(t.consume(g),p):H(g)?(o=h,ie(g)):(t.consume(g),h)}function p(g){return g===45?(t.consume(g),f):h(g)}function f(g){return g===62?J(g):g===45?p(g):h(g)}function d(g){const X="CDATA[";return g===X.charCodeAt(s++)?(t.consume(g),s===X.length?v:d):n(g)}function v(g){return g===null?n(g):g===93?(t.consume(g),y):H(g)?(o=v,ie(g)):(t.consume(g),v)}function y(g){return g===93?(t.consume(g),_):v(g)}function _(g){return g===62?J(g):g===93?(t.consume(g),_):v(g)}function w(g){return g===null||g===62?J(g):H(g)?(o=w,ie(g)):(t.consume(g),w)}function E(g){return g===null?n(g):g===63?(t.consume(g),F):H(g)?(o=E,ie(g)):(t.consume(g),E)}function F(g){return g===62?J(g):E(g)}function C(g){return Ie(g)?(t.consume(g),x):n(g)}function x(g){return g===45||Ee(g)?(t.consume(g),x):N(g)}function N(g){return H(g)?(o=N,ie(g)):Q(g)?(t.consume(g),N):J(g)}function T(g){return g===45||Ee(g)?(t.consume(g),T):g===47||g===62||le(g)?U(g):n(g)}function U(g){return g===47?(t.consume(g),J):g===58||g===95||Ie(g)?(t.consume(g),b):H(g)?(o=U,ie(g)):Q(g)?(t.consume(g),U):J(g)}function b(g){return g===45||g===46||g===58||g===95||Ee(g)?(t.consume(g),b):D(g)}function D(g){return g===61?(t.consume(g),L):H(g)?(o=D,ie(g)):Q(g)?(t.consume(g),D):U(g)}function L(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(t.consume(g),i=g,V):H(g)?(o=L,ie(g)):Q(g)?(t.consume(g),L):(t.consume(g),B)}function V(g){return g===i?(t.consume(g),i=void 0,A):g===null?n(g):H(g)?(o=V,ie(g)):(t.consume(g),V)}function B(g){return g===null||g===34||g===39||g===60||g===61||g===96?n(g):g===47||g===62||le(g)?U(g):(t.consume(g),B)}function A(g){return g===47||g===62||le(g)?U(g):n(g)}function J(g){return g===62?(t.consume(g),t.exit("htmlTextData"),t.exit("htmlText"),e):n(g)}function ie(g){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),I}function I(g){return Q(g)?ne(t,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(g):j(g)}function j(g){return t.enter("htmlTextData"),o(g)}}const xs={name:"labelEnd",resolveAll:Ad,resolveTo:Fd,tokenize:Rd},Pd={tokenize:Od},Id={tokenize:Dd},Td={tokenize:Md};function Ad(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&$e(t,0,t.length,n),t}function Fd(t,e){let n=t.length,r=0,i,s,o,a;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[s][1].start},end:{...t[o][1].end}},c={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[o-2][1].start}};return a=[["enter",l,e],["enter",u,e]],a=Ne(a,t.slice(s+1,s+r+3)),a=Ne(a,[["enter",c,e]]),a=Ne(a,Ar(e.parser.constructs.insideSpan.null,t.slice(s+r+4,o-3),e)),a=Ne(a,[["exit",c,e],t[o-2],t[o-1],["exit",u,e]]),a=Ne(a,t.slice(o+1)),a=Ne(a,[["exit",l,e]]),$e(t,s,t.length,a),t}function Rd(t,e,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(p){return s?s._inactive?h(p):(o=r.parser.defined.includes(Ue(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):n(p)}function l(p){return p===40?t.attempt(Pd,c,o?c:h)(p):p===91?t.attempt(Id,c,o?u:h)(p):o?c(p):h(p)}function u(p){return t.attempt(Td,c,h)(p)}function c(p){return e(p)}function h(p){return s._balanced=!0,n(p)}}function Od(t,e,n){return r;function r(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),i}function i(h){return le(h)?Fn(t,s)(h):s(h)}function s(h){return h===41?c(h):au(t,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return le(h)?Fn(t,l)(h):c(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?uu(t,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):c(h)}function u(h){return le(h)?Fn(t,c)(h):c(h)}function c(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),e):n(h)}}function Dd(t,e,n){const r=this;return i;function i(a){return lu.call(r,t,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Ue(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(a):n(a)}function o(a){return n(a)}}function Md(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const Ld={name:"labelStartImage",resolveAll:xs.resolveAll,tokenize:$d};function $d(t,e,n){const r=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),s}function s(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const zd={name:"labelStartLink",resolveAll:xs.resolveAll,tokenize:Nd};function Nd(t,e,n){const r=this;return i;function i(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const ii={name:"lineEnding",tokenize:Bd};function Bd(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),ne(t,e,"linePrefix")}}const sr={name:"thematicBreak",tokenize:jd};function jd(t,e,n){let r=0,i;return s;function s(u){return t.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(t.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||H(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),Q(u)?ne(t,a,"whitespace")(u):a(u))}}const Te={continuation:{tokenize:Vd},exit:Gd,name:"list",tokenize:Ud},qd={partial:!0,tokenize:Yd},Hd={partial:!0,tokenize:Wd};function Ud(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(f){const d=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Xi(f)){if(r.containerState.type||(r.containerState.type=d,t.enter(d,{_container:!0})),d==="listUnordered")return t.enter("listItemPrefix"),f===42||f===45?t.check(sr,n,u)(f):u(f);if(!r.interrupt||f===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(f)}return n(f)}function l(f){return Xi(f)&&++o<10?(t.consume(f),l):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(t.exit("listItemValue"),u(f)):n(f)}function u(f){return t.enter("listItemMarker"),t.consume(f),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,t.check(Un,r.interrupt?n:c,t.attempt(qd,p,h))}function c(f){return r.containerState.initialBlankLine=!0,s++,p(f)}function h(f){return Q(f)?(t.enter("listItemPrefixWhitespace"),t.consume(f),t.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(f)}}function Vd(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Un,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ne(t,e,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Q(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Hd,e,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ne(t,t.attempt(Te,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Wd(t,e,n){const r=this;return ne(t,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?e(s):n(s)}}function Gd(t){t.exit(this.containerState.type)}function Yd(t,e,n){const r=this;return ne(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Q(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const ra={name:"setextUnderline",resolveTo:Xd,tokenize:Jd};function Xd(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",o,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=o,t.push(["exit",o,e]),t}function Jd(t,e,n){const r=this;let i;return s;function s(u){let c=r.events.length,h;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){h=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(t.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return t.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(t.consume(u),a):(t.exit("setextHeadingLineSequence"),Q(u)?ne(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||H(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Kd={tokenize:Qd};function Qd(t){const e=this,n=t.attempt(Un,r,t.attempt(this.parser.constructs.flowInitial,i,ne(t,t.attempt(this.parser.constructs.flow,i,t.attempt(rd,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Zd={resolveAll:hu()},eg=cu("string"),tg=cu("text");function cu(t){return{resolveAll:hu(t==="text"?ng:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,o,a);return o;function o(c){return u(c)?s(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const h=i[c];let p=-1;if(h)for(;++p<h.length;){const f=h[p];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function hu(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function ng(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],i=e.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)l=!0,a++;else if(u!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(a=0),a){const u={type:n===t.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(t.splice(n,0,["enter",u,e],["exit",u,e]),n+=2)}n++}return t}const rg={42:Te,43:Te,45:Te,48:Te,49:Te,50:Te,51:Te,52:Te,53:Te,54:Te,55:Te,56:Te,57:Te,62:ru},ig={91:ld},sg={[-2]:ri,[-1]:ri,32:ri},og={35:dd,42:sr,45:[ra,sr],60:_d,61:ra,95:sr,96:ta,126:ta},ag={38:su,92:iu},lg={[-5]:ii,[-4]:ii,[-3]:ii,33:Ld,38:su,42:Ji,60:[zp,Sd],91:zd,92:[fd,iu],93:xs,95:Ji,96:Kp},ug={null:[Ji,Zd]},cg={null:[42,95]},hg={null:[]},fg=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:cg,contentInitial:ig,disable:hg,document:rg,flow:og,flowInitial:sg,insideSpan:ug,string:ag,text:lg},Symbol.toStringTag,{value:"Module"}));function pg(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:N(C),check:N(x),consume:w,enter:E,exit:F,interrupt:N(x,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:d,parser:t,previous:null,sliceSerialize:p,sliceStream:f,write:h};let c=e.tokenize.call(u,l);return e.resolveAll&&s.push(e),u;function h(D){return o=Ne(o,D),y(),o[o.length-1]!==null?[]:(T(e,0),u.events=Ar(s,u.events,u),u.events)}function p(D,L){return gg(f(D),L)}function f(D){return dg(o,D)}function d(){const{_bufferIndex:D,_index:L,line:V,column:B,offset:A}=r;return{_bufferIndex:D,_index:L,line:V,column:B,offset:A}}function v(D){i[D.line]=D.column,b()}function y(){let D;for(;r._index<o.length;){const L=o[r._index];if(typeof L=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<L.length;)_(L.charCodeAt(r._bufferIndex));else _(L)}}function _(D){c=c(D)}function w(D){H(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,b()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=D}function E(D,L){const V=L||{};return V.type=D,V.start=d(),u.events.push(["enter",V,u]),a.push(V),V}function F(D){const L=a.pop();return L.end=d(),u.events.push(["exit",L,u]),L}function C(D,L){T(D,L.from)}function x(D,L){L.restore()}function N(D,L){return V;function V(B,A,J){let ie,I,j,g;return Array.isArray(B)?W(B):"tokenize"in B?W([B]):X(B);function X(te){return ze;function ze(We){const ut=We!==null&&te[We],Ce=We!==null&&te.null,Tt=[...Array.isArray(ut)?ut:ut?[ut]:[],...Array.isArray(Ce)?Ce:Ce?[Ce]:[]];return W(Tt)(We)}}function W(te){return ie=te,I=0,te.length===0?J:m(te[I])}function m(te){return ze;function ze(We){return g=U(),j=te,te.partial||(u.currentConstruct=te),te.name&&u.parser.constructs.disable.null.includes(te.name)?ye():te.tokenize.call(L?Object.assign(Object.create(u),L):u,l,re,ye)(We)}}function re(te){return D(j,g),A}function ye(te){return g.restore(),++I<ie.length?m(ie[I]):J}}}function T(D,L){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&$e(u.events,L,u.events.length-L,D.resolve(u.events.slice(L),u)),D.resolveTo&&(u.events=D.resolveTo(u.events,u))}function U(){const D=d(),L=u.previous,V=u.currentConstruct,B=u.events.length,A=Array.from(a);return{from:B,restore:J};function J(){r=D,u.previous=L,u.currentConstruct=V,u.events.length=B,a=A,b()}}function b(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function dg(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let o;if(n===i)o=[t[n].slice(r,s)];else{if(o=t.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(t[i].slice(0,s))}return o}function gg(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
6
- `;break}case-3:{o=`\r
7
- `;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function mg(t){const r={constructs:tu([fg,...(t||{}).extensions||[]]),content:i(Fp),defined:[],document:i(Op),flow:i(Kd),lazy:{},string:i(eg),text:i(tg)};return r;function i(s){return o;function o(a){return pg(r,s,a)}}}function vg(t){for(;!ou(t););return t}const ia=/[\0\t\n\r]/g;function _g(){let t=1,e="",n=!0,r;return i;function i(s,o,a){const l=[];let u,c,h,p,f;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),h=0,e="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(ia.lastIndex=h,u=ia.exec(s),p=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(p),!u){e=s.slice(h);break}if(f===10&&h===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),h<p&&(l.push(s.slice(h,p)),t+=p-h),f){case 0:{l.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,l.push(-2);t++<c;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}h=p+1}return a&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const yg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bg(t){return t.replace(yg,xg)}function xg(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return nu(n.slice(s?2:1),s?16:10)}return bs(n)||t}const fu={}.hasOwnProperty;function kg(t,e,n){return typeof e!="string"&&(n=e,e=void 0),wg(n)(vg(mg(n).document().write(_g()(t,e,!0))))}function wg(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(As),autolinkProtocol:U,autolinkEmail:U,atxHeading:s(en),blockQuote:s(Ce),characterEscape:U,characterReference:U,codeFenced:s(Tt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Tt,o),codeText:s(Wn,o),codeTextData:U,data:U,codeFlowValue:U,definition:s(Zt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Gn),hardBreakEscape:s(tn),hardBreakTrailing:s(tn),htmlFlow:s(At,o),htmlFlowData:U,htmlText:s(At,o),htmlTextData:U,image:s(Vu),label:o,link:s(As),listItem:s(Wu),listItemValue:p,listOrdered:s(Fs,h),listUnordered:s(Fs),paragraph:s(Gu),reference:m,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(en),strong:s(Yu),thematicBreak:s(Ju)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:ut,autolinkProtocol:We,blockQuote:l(),characterEscapeValue:b,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:te,characterReference:ze,codeFenced:l(y),codeFencedFence:v,codeFencedFenceInfo:f,codeFencedFenceMeta:d,codeFlowValue:b,codeIndented:l(_),codeText:l(A),codeTextData:b,data:b,definition:l(),definitionDestinationString:F,definitionLabelString:w,definitionTitleString:E,emphasis:l(),hardBreakEscape:l(L),hardBreakTrailing:l(L),htmlFlow:l(V),htmlFlowData:b,htmlText:l(B),htmlTextData:b,image:l(ie),label:j,labelText:I,lineEnding:D,link:l(J),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:re,resourceDestinationString:g,resourceTitleString:X,resource:W,setextHeading:l(T),setextHeadingLineSequence:N,setextHeadingText:x,strong:l(),thematicBreak:l()}};pu(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(S){let R={type:"root",children:[]};const G={stack:[R],tokenStack:[],config:e,enter:a,exit:u,buffer:o,resume:c,data:n},ee=[];let oe=-1;for(;++oe<S.length;)if(S[oe][1].type==="listOrdered"||S[oe][1].type==="listUnordered")if(S[oe][0]==="enter")ee.push(oe);else{const qe=ee.pop();oe=i(S,qe,oe)}for(oe=-1;++oe<S.length;){const qe=e[S[oe][0]];fu.call(qe,S[oe][1].type)&&qe[S[oe][1].type].call(Object.assign({sliceSerialize:S[oe][2].sliceSerialize},G),S[oe][1])}if(G.tokenStack.length>0){const qe=G.tokenStack[G.tokenStack.length-1];(qe[1]||sa).call(G,void 0,qe[0])}for(R.position={start:ft(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:ft(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},oe=-1;++oe<e.transforms.length;)R=e.transforms[oe](R)||R;return R}function i(S,R,G){let ee=R-1,oe=-1,qe=!1,yt,Ke,nn,rn;for(;++ee<=G;){const Oe=S[ee];switch(Oe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Oe[0]==="enter"?oe++:oe--,rn=void 0;break}case"lineEndingBlank":{Oe[0]==="enter"&&(yt&&!rn&&!oe&&!nn&&(nn=ee),rn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:rn=void 0}if(!oe&&Oe[0]==="enter"&&Oe[1].type==="listItemPrefix"||oe===-1&&Oe[0]==="exit"&&(Oe[1].type==="listUnordered"||Oe[1].type==="listOrdered")){if(yt){let Ft=ee;for(Ke=void 0;Ft--;){const Qe=S[Ft];if(Qe[1].type==="lineEnding"||Qe[1].type==="lineEndingBlank"){if(Qe[0]==="exit")continue;Ke&&(S[Ke][1].type="lineEndingBlank",qe=!0),Qe[1].type="lineEnding",Ke=Ft}else if(!(Qe[1].type==="linePrefix"||Qe[1].type==="blockQuotePrefix"||Qe[1].type==="blockQuotePrefixWhitespace"||Qe[1].type==="blockQuoteMarker"||Qe[1].type==="listItemIndent"))break}nn&&(!Ke||nn<Ke)&&(yt._spread=!0),yt.end=Object.assign({},Ke?S[Ke][1].start:Oe[1].end),S.splice(Ke||ee,0,["exit",yt,Oe[2]]),ee++,G++}if(Oe[1].type==="listItemPrefix"){const Ft={type:"listItem",_spread:!1,start:Object.assign({},Oe[1].start),end:void 0};yt=Ft,S.splice(ee,0,["enter",Ft,Oe[2]]),ee++,G++,nn=void 0,rn=!0}}}return S[R][1]._spread=qe,G}function s(S,R){return G;function G(ee){a.call(this,S(ee),ee),R&&R.call(this,ee)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(S,R,G){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([R,G||void 0]),S.position={start:ft(R.start),end:void 0}}function l(S){return R;function R(G){S&&S.call(this,G),u.call(this,G)}}function u(S,R){const G=this.stack.pop(),ee=this.tokenStack.pop();if(ee)ee[0].type!==S.type&&(R?R.call(this,S,ee[0]):(ee[1]||sa).call(this,S,ee[0]));else throw new Error("Cannot close `"+S.type+"` ("+An({start:S.start,end:S.end})+"): it’s not open");G.position.end=ft(S.end)}function c(){return ys(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(S){if(this.data.expectingFirstListItemValue){const R=this.stack[this.stack.length-2];R.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function f(){const S=this.resume(),R=this.stack[this.stack.length-1];R.lang=S}function d(){const S=this.resume(),R=this.stack[this.stack.length-1];R.meta=S}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const S=this.resume(),R=this.stack[this.stack.length-1];R.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const S=this.resume(),R=this.stack[this.stack.length-1];R.value=S.replace(/(\r?\n|\r)$/g,"")}function w(S){const R=this.resume(),G=this.stack[this.stack.length-1];G.label=R,G.identifier=Ue(this.sliceSerialize(S)).toLowerCase()}function E(){const S=this.resume(),R=this.stack[this.stack.length-1];R.title=S}function F(){const S=this.resume(),R=this.stack[this.stack.length-1];R.url=S}function C(S){const R=this.stack[this.stack.length-1];if(!R.depth){const G=this.sliceSerialize(S).length;R.depth=G}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function N(S){const R=this.stack[this.stack.length-1];R.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function U(S){const G=this.stack[this.stack.length-1].children;let ee=G[G.length-1];(!ee||ee.type!=="text")&&(ee=Xu(),ee.position={start:ft(S.start),end:void 0},G.push(ee)),this.stack.push(ee)}function b(S){const R=this.stack.pop();R.value+=this.sliceSerialize(S),R.position.end=ft(S.end)}function D(S){const R=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=R.children[R.children.length-1];G.position.end=ft(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(R.type)&&(U.call(this,S),b.call(this,S))}function L(){this.data.atHardBreak=!0}function V(){const S=this.resume(),R=this.stack[this.stack.length-1];R.value=S}function B(){const S=this.resume(),R=this.stack[this.stack.length-1];R.value=S}function A(){const S=this.resume(),R=this.stack[this.stack.length-1];R.value=S}function J(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=R,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function ie(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const R=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=R,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function I(S){const R=this.sliceSerialize(S),G=this.stack[this.stack.length-2];G.label=bg(R),G.identifier=Ue(R).toLowerCase()}function j(){const S=this.stack[this.stack.length-1],R=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const ee=S.children;G.children=ee}else G.alt=R}function g(){const S=this.resume(),R=this.stack[this.stack.length-1];R.url=S}function X(){const S=this.resume(),R=this.stack[this.stack.length-1];R.title=S}function W(){this.data.inReference=void 0}function m(){this.data.referenceType="collapsed"}function re(S){const R=this.resume(),G=this.stack[this.stack.length-1];G.label=R,G.identifier=Ue(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function ye(S){this.data.characterReferenceType=S.type}function te(S){const R=this.sliceSerialize(S),G=this.data.characterReferenceType;let ee;G?(ee=nu(R,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ee=bs(R);const oe=this.stack[this.stack.length-1];oe.value+=ee}function ze(S){const R=this.stack.pop();R.position.end=ft(S.end)}function We(S){b.call(this,S);const R=this.stack[this.stack.length-1];R.url=this.sliceSerialize(S)}function ut(S){b.call(this,S);const R=this.stack[this.stack.length-1];R.url="mailto:"+this.sliceSerialize(S)}function Ce(){return{type:"blockquote",children:[]}}function Tt(){return{type:"code",lang:null,meta:null,value:""}}function Wn(){return{type:"inlineCode",value:""}}function Zt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Gn(){return{type:"emphasis",children:[]}}function en(){return{type:"heading",depth:0,children:[]}}function tn(){return{type:"break"}}function At(){return{type:"html",value:""}}function Vu(){return{type:"image",title:null,url:"",alt:null}}function As(){return{type:"link",title:null,url:"",children:[]}}function Fs(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function Wu(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function Gu(){return{type:"paragraph",children:[]}}function Yu(){return{type:"strong",children:[]}}function Xu(){return{type:"text",value:""}}function Ju(){return{type:"thematicBreak"}}}function ft(t){return{line:t.line,column:t.column,offset:t.offset}}function pu(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?pu(t,r):Eg(t,r)}}function Eg(t,e){let n;for(n in e)if(fu.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function sa(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+An({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+An({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+An({start:e.start,end:e.end})+") is still open")}function cy(t){const e=this;e.parser=n;function n(r){return kg(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Sg(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function Cg(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
8
- `}]}function Pg(t,e){const n=e.value?e.value+`
9
- `:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function Ig(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Tg(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Ag(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Qt(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let o,a=t.footnoteCounts.get(r);a===void 0?(a=0,t.footnoteOrder.push(r),o=t.footnoteOrder.length):o=s+1,a+=1,t.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function Fg(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Rg(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function du(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Og(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return du(t,e);const i={src:Qt(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function Dg(t,e){const n={src:Qt(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function Mg(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function Lg(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return du(t,e);const i={href:Qt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function $g(t,e){const n={href:Qt(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function zg(t,e,n){const r=t.all(e),i=n?Ng(n):gu(e),s={},o=[];if(typeof e.checked=="boolean"){const c=r[0];let h;c&&c.type==="element"&&c.tagName==="p"?h=c:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
10
- `}),c.type==="element"&&c.tagName==="p"&&!i?o.push(...c.children):o.push(c)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
11
- `});const u={type:"element",tagName:"li",properties:s,children:o};return t.patch(e,u),t.applyData(e,u)}function Ng(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=gu(n[r])}return e}function gu(t){const e=t.spread;return e??t.children.length>1}function Bg(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function jg(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function qg(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Hg(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Ug(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},a=gs(e.children[1]),l=Yl(e.children[e.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function Vg(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:e.children.length;let l=-1;const u=[];for(;++l<a;){const h=e.children[l],p={},f=o?o[l]:void 0;f&&(p.align=f);let d={type:"element",tagName:s,properties:p,children:[]};h&&(d.children=t.all(h),t.patch(h,d),d=t.applyData(h,d)),u.push(d)}const c={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(e,c),t.applyData(e,c)}function Wg(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const oa=9,aa=32;function Gg(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(la(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(la(e.slice(i),i>0,!1)),s.join("")}function la(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===oa||s===aa;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===oa||s===aa;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Yg(t,e){const n={type:"text",value:Gg(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Xg(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Jg={blockquote:Sg,break:Cg,code:Pg,delete:Ig,emphasis:Tg,footnoteReference:Ag,heading:Fg,html:Rg,imageReference:Og,image:Dg,inlineCode:Mg,linkReference:Lg,link:$g,listItem:zg,list:Bg,paragraph:jg,root:qg,strong:Hg,table:Ug,tableCell:Wg,tableRow:Vg,text:Yg,thematicBreak:Xg,toml:Zn,yaml:Zn,definition:Zn,footnoteDefinition:Zn};function Zn(){}const mu=-1,Fr=0,Rn=1,kr=2,ks=3,ws=4,Es=5,Ss=6,vu=7,_u=8,ua=typeof self=="object"?self:globalThis,Kg=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,o]=e[i];switch(s){case Fr:case mu:return n(o,i);case Rn:{const a=n([],i);for(const l of o)a.push(r(l));return a}case kr:{const a=n({},i);for(const[l,u]of o)a[r(l)]=r(u);return a}case ks:return n(new Date(o),i);case ws:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case Es:{const a=n(new Map,i);for(const[l,u]of o)a.set(r(l),r(u));return a}case Ss:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case vu:{const{name:a,message:l}=o;return n(new ua[a](l),i)}case _u:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new ua[s](o),i)};return r},ca=t=>Kg(new Map,t)(0),Mt="",{toString:Qg}={},{keys:Zg}=Object,vn=t=>{const e=typeof t;if(e!=="object"||!t)return[Fr,e];const n=Qg.call(t).slice(8,-1);switch(n){case"Array":return[Rn,Mt];case"Object":return[kr,Mt];case"Date":return[ks,Mt];case"RegExp":return[ws,Mt];case"Map":return[Es,Mt];case"Set":return[Ss,Mt];case"DataView":return[Rn,n]}return n.includes("Array")?[Rn,n]:n.includes("Error")?[vu,n]:[kr,n]},er=([t,e])=>t===Fr&&(e==="function"||e==="symbol"),em=(t,e,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=vn(o);switch(a){case Fr:{let c=o;switch(l){case"bigint":a=_u,c=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([mu],o)}return i([a,c],o)}case Rn:{if(l){let p=o;return l==="DataView"?p=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(o)),i([l,[...p]],o)}const c=[],h=i([a,c],o);for(const p of o)c.push(s(p));return h}case kr:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(e&&"toJSON"in o)return s(o.toJSON());const c=[],h=i([a,c],o);for(const p of Zg(o))(t||!er(vn(o[p])))&&c.push([s(p),s(o[p])]);return h}case ks:return i([a,o.toISOString()],o);case ws:{const{source:c,flags:h}=o;return i([a,{source:c,flags:h}],o)}case Es:{const c=[],h=i([a,c],o);for(const[p,f]of o)(t||!(er(vn(p))||er(vn(f))))&&c.push([s(p),s(f)]);return h}case Ss:{const c=[],h=i([a,c],o);for(const p of o)(t||!er(vn(p)))&&c.push(s(p));return h}}const{message:u}=o;return i([a,{name:l,message:u}],o)};return s},ha=(t,{json:e,lossy:n}={})=>{const r=[];return em(!(e||n),!!e,new Map,r)(t),r},wr=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?ca(ha(t,e)):structuredClone(t):(t,e)=>ca(ha(t,e));function tm(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function nm(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function rm(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||tm,r=t.options.footnoteBackLabel||nm,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[l]);if(!u)continue;const c=t.all(u),h=String(u.identifier).toUpperCase(),p=Qt(h.toLowerCase());let f=0;const d=[],v=t.footnoteCounts.get(h);for(;v!==void 0&&++f<=v;){d.length>0&&d.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,f);typeof w=="string"&&(w={type:"text",value:w}),d.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const y=c[c.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const w=y.children[y.children.length-1];w&&w.type==="text"?w.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...d)}else c.push(...d);const _={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,_),a.push(_)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...wr(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
12
- `},{type:"element",tagName:"ol",properties:{},children:t.wrap(a,!0)},{type:"text",value:`
13
- `}]}}const Rr=(function(t){if(t==null)return am;if(typeof t=="function")return Or(t);if(typeof t=="object")return Array.isArray(t)?im(t):sm(t);if(typeof t=="string")return om(t);throw new Error("Expected function, string, or object as test")});function im(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Rr(t[n]);return Or(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function sm(t){const e=t;return Or(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function om(t){return Or(e);function e(n){return n&&n.type===t}}function Or(t){return e;function e(n,r,i){return!!(lm(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function am(){return!0}function lm(t){return t!==null&&typeof t=="object"&&"type"in t}const yu=[],um=!0,Ki=!1,cm="skip";function bu(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=Rr(i),o=r?-1:1;a(t,void 0,[])();function a(l,u,c){const h=l&&typeof l=="object"?l:{};if(typeof h.type=="string"){const f=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return p;function p(){let f=yu,d,v,y;if((!e||s(l,u,c[c.length-1]||void 0))&&(f=hm(n(l,c)),f[0]===Ki))return f;if("children"in l&&l.children){const _=l;if(_.children&&f[0]!==cm)for(v=(r?_.children.length:-1)+o,y=c.concat(_);v>-1&&v<_.children.length;){const w=_.children[v];if(d=a(w,v,y)(),d[0]===Ki)return d;v=typeof d[1]=="number"?d[1]:v+o}}return f}}}function hm(t){return Array.isArray(t)?t:typeof t=="number"?[um,t]:t==null?yu:[t]}function xu(t,e,n,r){let i,s,o;typeof e=="function"&&typeof n!="function"?(s=void 0,o=e,i=n):(s=e,o=n,i=r),bu(t,s,a,i);function a(l,u){const c=u[u.length-1],h=c?c.children.indexOf(l):void 0;return o(l,h,c)}}const Qi={}.hasOwnProperty,fm={};function pm(t,e){const n=e||fm,r=new Map,i=new Map,s=new Map,o={...Jg,...n.handlers},a={all:u,applyData:gm,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:dm,wrap:vm};return xu(t,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const h=c.type==="definition"?r:i,p=String(c.identifier).toUpperCase();h.has(p)||h.set(p,c)}}),a;function l(c,h){const p=c.type,f=a.handlers[p];if(Qi.call(a.handlers,p)&&f)return f(a,c,h);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in c){const{children:v,...y}=c,_=wr(y);return _.children=a.all(c),_}return wr(c)}return(a.options.unknownHandler||mm)(a,c,h)}function u(c){const h=[];if("children"in c){const p=c.children;let f=-1;for(;++f<p.length;){const d=a.one(p[f],c);if(d){if(f&&p[f-1].type==="break"&&(!Array.isArray(d)&&d.type==="text"&&(d.value=fa(d.value)),!Array.isArray(d)&&d.type==="element")){const v=d.children[0];v&&v.type==="text"&&(v.value=fa(v.value))}Array.isArray(d)?h.push(...d):h.push(d)}}}return h}}function dm(t,e){t.position&&(e.position=ip(t))}function gm(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,wr(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function mm(t,e){const n=e.data||{},r="value"in e&&!(Qi.call(n,"hProperties")||Qi.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function vm(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
14
- `});++r<t.length;)r&&n.push({type:"text",value:`
15
- `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
16
- `}),n}function fa(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function pa(t,e){const n=pm(t,e),r=n.one(t,void 0),i=rm(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
17
- `},i),s}function hy(t,e){return t&&"run"in t?async function(n,r){const i=pa(n,{file:r,...e});await t.run(i,r)}:function(n,r){return pa(n,{file:r,...t||e})}}function da(t){if(t)throw t}var si,ga;function _m(){if(ga)return si;ga=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},s=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=t.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!h)return!1;var p;for(p in u);return typeof p>"u"||t.call(u,p)},o=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},a=function(u,c){if(c==="__proto__")if(t.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return si=function l(){var u,c,h,p,f,d,v=arguments[0],y=1,_=arguments.length,w=!1;for(typeof v=="boolean"&&(w=v,v=arguments[1]||{},y=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});y<_;++y)if(u=arguments[y],u!=null)for(c in u)h=a(v,c),p=a(u,c),v!==p&&(w&&p&&(s(p)||(f=i(p)))?(f?(f=!1,d=h&&i(h)?h:[]):d=h&&s(h)?h:{},o(v,{name:c,newValue:l(w,d,p)})):typeof p<"u"&&o(v,{name:c,newValue:p}));return v},si}var ym=_m();const oi=Ca(ym);function Zi(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function bm(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...u){const c=t[++s];let h=-1;if(l){o(l);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,c?xm(c,a)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function xm(t,e){let n;return r;function r(...o){const a=t.length>o.length;let l;a&&o.push(i);try{l=t.apply(this,o)}catch(u){const c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,e(o,...a))}function s(o){i(null,o)}}const Ge={basename:km,dirname:wm,extname:Em,join:Sm,sep:"/"};function km(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Vn(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let o=-1,a=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(t.codePointAt(i)===e.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=t.length),t.slice(n,r)}function wm(t){if(Vn(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Em(t){Vn(t);let e=t.length,n=-1,r=0,i=-1,s=0,o;for(;e--;){const a=t.codePointAt(e);if(a===47){if(o){r=e+1;break}continue}n<0&&(o=!0,n=e+1),a===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Sm(...t){let e=-1,n;for(;++e<t.length;)Vn(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Cm(n)}function Cm(t){Vn(t);const e=t.codePointAt(0)===47;let n=Pm(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Pm(t,e){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=t.length;){if(o<t.length)a=t.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,o):n=t.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Vn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Im={cwd:Tm};function Tm(){return"/"}function es(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Am(t){if(typeof t=="string")t=new URL(t);else if(!es(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Fm(t)}function Fm(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const ai=["history","path","basename","stem","extname","dirname"];class Rm{constructor(e){let n;e?es(e)?n={path:e}:typeof e=="string"||Om(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":Im.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ai.length;){const s=ai[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)ai.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ge.basename(this.path):void 0}set basename(e){ui(e,"basename"),li(e,"basename"),this.path=Ge.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?Ge.dirname(this.path):void 0}set dirname(e){ma(this.basename,"dirname"),this.path=Ge.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?Ge.extname(this.path):void 0}set extname(e){if(li(e,"extname"),ma(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ge.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){es(e)&&(e=Am(e)),ui(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?Ge.basename(this.path,this.extname):void 0}set stem(e){ui(e,"stem"),li(e,"stem"),this.path=Ge.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Se(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function li(t,e){if(t&&t.includes(Ge.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+Ge.sep+"`")}function ui(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function ma(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Om(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Dm=(function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),Mm={}.hasOwnProperty;class Cs extends Dm{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=bm()}copy(){const e=new Cs;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(oi(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(fi("data",this.frozen),this.namespace[e]=n,this):Mm.call(this.namespace,e)&&this.namespace[e]||void 0:e?(fi("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=tr(e),r=this.parser||this.Parser;return ci("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),ci("process",this.parser||this.Parser),hi("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=tr(e),l=r.parse(a);r.run(l,a,function(c,h,p){if(c||!h||!p)return u(c);const f=h,d=r.stringify(f,p);$m(d)?p.value=d:p.result=d,u(c,p)});function u(c,h){c||!h?o(c):s?s(h):n(void 0,h)}}}processSync(e){let n=!1,r;return this.freeze(),ci("processSync",this.parser||this.Parser),hi("processSync",this.compiler||this.Compiler),this.process(e,i),_a("processSync","process",n),r;function i(s,o){n=!0,da(s),r=o}}run(e,n,r){va(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=tr(n);i.run(e,l,u);function u(c,h,p){const f=h||e;c?a(c):o?o(f):r(void 0,f,p)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),_a("runSync","run",r),i;function s(o,a){da(o),i=a,r=!0}}stringify(e,n){this.freeze();const r=tr(n),i=this.compiler||this.Compiler;return hi("stringify",i),va(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(fi("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?a(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...h]=u;l(c,h)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=oi(!0,i.settings,u.settings))}function a(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const h=u[c];s(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===u){p=h;break}if(p===-1)r.push([u,...c]);else if(c.length>0){let[f,...d]=c;const v=r[p][1];Zi(v)&&Zi(f)&&(f=oi(!0,v,f)),r[p]=[u,f,...d]}}}}const fy=new Cs().freeze();function ci(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function hi(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function fi(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function va(t){if(!Zi(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function _a(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function tr(t){return Lm(t)?t:new Rm(t)}function Lm(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function $m(t){return typeof t=="string"||zm(t)}function zm(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function ya(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function Nm(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Bm(t,e,n){const i=Rr((n||{}).ignore||[]),s=jm(e);let o=-1;for(;++o<s.length;)bu(t,"text",a);function a(u,c){let h=-1,p;for(;++h<c.length;){const f=c[h],d=p?p.children:void 0;if(i(f,d?d.indexOf(f):void 0,p))return;p=f}if(p)return l(u,c)}function l(u,c){const h=c[c.length-1],p=s[o][0],f=s[o][1];let d=0;const y=h.children.indexOf(u);let _=!1,w=[];p.lastIndex=0;let E=p.exec(u.value);for(;E;){const F=E.index,C={index:E.index,input:E.input,stack:[...c,u]};let x=f(...E,C);if(typeof x=="string"&&(x=x.length>0?{type:"text",value:x}:void 0),x===!1?p.lastIndex=F+1:(d!==F&&w.push({type:"text",value:u.value.slice(d,F)}),Array.isArray(x)?w.push(...x):x&&w.push(x),d=F+E[0].length,_=!0),!p.global)break;E=p.exec(u.value)}return _?(d<u.value.length&&w.push({type:"text",value:u.value.slice(d)}),h.children.splice(y,1,...w)):w=[u],y+w.length}}function jm(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const i=n[r];e.push([qm(i[0]),Hm(i[1])])}return e}function qm(t){return typeof t=="string"?new RegExp(Nm(t),"g"):t}function Hm(t){return typeof t=="function"?t:function(){return t}}const pi="phrasing",di=["autolink","link","image","label"];function Um(){return{transforms:[Km],enter:{literalAutolink:Wm,literalAutolinkEmail:gi,literalAutolinkHttp:gi,literalAutolinkWww:gi},exit:{literalAutolink:Jm,literalAutolinkEmail:Xm,literalAutolinkHttp:Gm,literalAutolinkWww:Ym}}}function Vm(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pi,notInConstruct:di},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pi,notInConstruct:di},{character:":",before:"[ps]",after:"\\/",inConstruct:pi,notInConstruct:di}]}}function Wm(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function gi(t){this.config.enter.autolinkProtocol.call(this,t)}function Gm(t){this.config.exit.autolinkProtocol.call(this,t)}function Ym(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function Xm(t){this.config.exit.autolinkEmail.call(this,t)}function Jm(t){this.exit(t)}function Km(t){Bm(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Qm],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Zm]],{ignore:["link","linkReference"]})}function Qm(t,e,n,r,i){let s="";if(!ku(i)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!ev(n)))return!1;const o=tv(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+e+o[0],children:[{type:"text",value:e+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function Zm(t,e,n,r){return!ku(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function ev(t){const 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 tv(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const i=ya(t,"(");let s=ya(t,")");for(;r!==-1&&i>s;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[t,n]}function ku(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||Pt(n)||Tr(n))&&(!e||n!==47)}wu.peek=cv;function nv(){this.buffer()}function rv(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function iv(){this.buffer()}function sv(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function ov(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ue(this.sliceSerialize(t)).toLowerCase(),n.label=e}function av(t){this.exit(t)}function lv(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ue(this.sliceSerialize(t)).toLowerCase(),n.label=e}function uv(t){this.exit(t)}function cv(){return"["}function wu(t,e,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(t),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function hv(){return{enter:{gfmFootnoteCallString:nv,gfmFootnoteCall:rv,gfmFootnoteDefinitionLabelString:iv,gfmFootnoteDefinition:sv},exit:{gfmFootnoteCallString:ov,gfmFootnoteCall:av,gfmFootnoteDefinitionLabelString:lv,gfmFootnoteDefinition:uv}}}function fv(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:wu},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const u=s.enter("footnoteDefinition"),c=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),c(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((e?`
18
- `:" ")+s.indentLines(s.containerFlow(r,a.current()),e?Eu:pv))),u(),l}}function pv(t,e,n){return e===0?t:Eu(t,e,n)}function Eu(t,e,n){return(n?"":" ")+t}const dv=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Su.peek=yv;function gv(){return{canContainEols:["delete"],enter:{strikethrough:vv},exit:{strikethrough:_v}}}function mv(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:dv}],handlers:{delete:Su}}}function vv(t){this.enter({type:"delete",children:[]},t)}function _v(t){this.exit(t)}function Su(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(t,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function yv(){return"~"}function bv(t){return t.length}function xv(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||bv,s=[],o=[],a=[],l=[];let u=0,c=-1;for(;++c<t.length;){const v=[],y=[];let _=-1;for(t[c].length>u&&(u=t[c].length);++_<t[c].length;){const w=kv(t[c][_]);if(n.alignDelimiters!==!1){const E=i(w);y[_]=E,(l[_]===void 0||E>l[_])&&(l[_]=E)}v.push(w)}o[c]=v,a[c]=y}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<u;)s[h]=ba(r[h]);else{const v=ba(r);for(;++h<u;)s[h]=v}h=-1;const p=[],f=[];for(;++h<u;){const v=s[h];let y="",_="";v===99?(y=":",_=":"):v===108?y=":":v===114&&(_=":");let w=n.alignDelimiters===!1?1:Math.max(1,l[h]-y.length-_.length);const E=y+"-".repeat(w)+_;n.alignDelimiters!==!1&&(w=y.length+w+_.length,w>l[h]&&(l[h]=w),f[h]=w),p[h]=E}o.splice(1,0,p),a.splice(1,0,f),c=-1;const d=[];for(;++c<o.length;){const v=o[c],y=a[c];h=-1;const _=[];for(;++h<u;){const w=v[h]||"";let E="",F="";if(n.alignDelimiters!==!1){const C=l[h]-(y[h]||0),x=s[h];x===114?E=" ".repeat(C):x===99?C%2?(E=" ".repeat(C/2+.5),F=" ".repeat(C/2-.5)):(E=" ".repeat(C/2),F=E):F=" ".repeat(C)}n.delimiterStart!==!1&&!h&&_.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&w==="")&&(n.delimiterStart!==!1||h)&&_.push(" "),n.alignDelimiters!==!1&&_.push(E),_.push(w),n.alignDelimiters!==!1&&_.push(F),n.padding!==!1&&_.push(" "),(n.delimiterEnd!==!1||h!==u-1)&&_.push("|")}d.push(n.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return d.join(`
19
- `)}function kv(t){return t==null?"":String(t)}function ba(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function wv(t,e,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(t,s.current()),Ev);return i(),o}function Ev(t,e,n){return">"+(n?"":" ")+t}function Sv(t,e){return xa(t,e.inConstruct,!0)&&!xa(t,e.notInConstruct,!1)}function xa(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function ka(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
20
- `&&Sv(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
21
- `}function Cv(t,e){const n=String(t);let r=n.indexOf(e),i=r,s=0,o=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+e.length,r=n.indexOf(e,i);return o}function Pv(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Iv(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Tv(t,e,n,r){const i=Iv(n),s=t.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Pv(t,n)){const h=n.enter("codeIndented"),p=n.indentLines(s,Av);return h(),p}const a=n.createTracker(r),l=i.repeat(Math.max(Cv(s,i)+1,3)),u=n.enter("codeFenced");let c=a.move(l);if(t.lang){const h=n.enter(`codeFencedLang${o}`);c+=a.move(n.safe(t.lang,{before:c,after:" ",encode:["`"],...a.current()})),h()}if(t.lang&&t.meta){const h=n.enter(`codeFencedMeta${o}`);c+=a.move(" "),c+=a.move(n.safe(t.meta,{before:c,after:`
22
- `,encode:["`"],...a.current()})),h()}return c+=a.move(`
23
- `),s&&(c+=a.move(s+`
24
- `)),c+=a.move(l),u(),c}function Av(t,e,n){return(n?"":" ")+t}function Ps(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function Fv(t,e,n,r){const i=Ps(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(t),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(t.url,{before:u,after:t.title?" ":`
25
- `,...l.current()}))),a(),t.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(t.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),o(),u}function Rv(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Nn(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Er(t,e,n){const r=Yt(t),i=Yt(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Cu.peek=Ov;function Cu(t,e,n,r){const i=Rv(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(t,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),c=Er(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=Nn(u)+l.slice(1));const h=l.charCodeAt(l.length-1),p=Er(r.after.charCodeAt(0),h,i);p.inside&&(l=l.slice(0,-1)+Nn(h));const f=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+l+f}function Ov(t,e,n){return n.options.emphasis||"*"}function Dv(t,e){let n=!1;return xu(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ki}),!!((!t.depth||t.depth<3)&&ys(t)&&(e.options.setext||n))}function Mv(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(r);if(Dv(t,n)){const c=n.enter("headingSetext"),h=n.enter("phrasing"),p=n.containerPhrasing(t,{...s.current(),before:`
26
- `,after:`
27
- `});return h(),c(),p+`
28
- `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
29
- `))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(t,{before:"# ",after:`
30
- `,...s.current()});return/^[\t ]/.test(u)&&(u=Nn(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),l(),a(),u}Pu.peek=Lv;function Pu(t){return t.value||""}function Lv(){return"<"}Iu.peek=$v;function Iu(t,e,n,r){const i=Ps(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(t.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(t.url,{before:u,after:t.title?" ":")",...l.current()}))),a(),t.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(t.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),o(),u}function $v(){return"!"}Tu.peek=zv;function Tu(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(t.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(t),{before:l,after:"]",...a.current()});return o(),n.stack=c,s(),i==="full"||!u||u!==h?l+=a.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function zv(){return"!"}Au.peek=Nv;function Au(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function Nv(){return"`"}function Fu(t,e){const n=ys(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Ru.peek=Bv;function Ru(t,e,n,r){const i=Ps(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(Fu(t,n)){const c=n.stack;n.stack=[],a=n.enter("autolink");let h=o.move("<");return h+=o.move(n.containerPhrasing(t,{before:h,after:">",...o.current()})),h+=o.move(">"),a(),n.stack=c,h}a=n.enter("link"),l=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(t,{before:u,after:"](",...o.current()})),u+=o.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(t.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(l=n.enter("destinationRaw"),u+=o.move(n.safe(t.url,{before:u,after:t.title?" ":")",...o.current()}))),l(),t.title&&(l=n.enter(`title${s}`),u+=o.move(" "+i),u+=o.move(n.safe(t.title,{before:u,after:i,...o.current()})),u+=o.move(i),l()),u+=o.move(")"),a(),u}function Bv(t,e,n){return Fu(t,n)?"<":"["}Ou.peek=jv;function Ou(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(t,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const c=n.stack;n.stack=[],o=n.enter("reference");const h=n.safe(n.associationId(t),{before:l,after:"]",...a.current()});return o(),n.stack=c,s(),i==="full"||!u||u!==h?l+=a.move(h+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function jv(){return"["}function Is(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function qv(t){const e=Is(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Hv(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function Du(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function Uv(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=t.ordered?Hv(n):Is(n);const a=t.ordered?o==="."?")":".":qv(n);let l=e&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!t.ordered){const c=t.children?t.children[0]:void 0;if((o==="*"||o==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Du(n)===o&&c){let h=-1;for(;++h<t.children.length;){const p=t.children[h];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const u=n.containerFlow(t,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),u}function Vv(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function Wv(t,e,n,r){const i=Vv(n);let s=n.bulletCurrent||Is(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(t,a.current()),c);return l(),u;function c(h,p,f){return p?(f?"":" ".repeat(o))+h:(f?s:s+" ".repeat(o-s.length))+h}}function Gv(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(t,r);return s(),i(),o}const Yv=Rr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xv(t,e,n,r){return(t.children.some(function(o){return Yv(o)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function Jv(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Mu.peek=Kv;function Mu(t,e,n,r){const i=Jv(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(t,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),c=Er(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=Nn(u)+l.slice(1));const h=l.charCodeAt(l.length-1),p=Er(r.after.charCodeAt(0),h,i);p.inside&&(l=l.slice(0,-1)+Nn(h));const f=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+l+f}function Kv(t,e,n){return n.options.strong||"*"}function Qv(t,e,n,r){return n.safe(t.value,r)}function Zv(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function e_(t,e,n){const r=(Du(n)+(n.options.ruleSpaces?" ":"")).repeat(Zv(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Lu={blockquote:wv,break:ka,code:Tv,definition:Fv,emphasis:Cu,hardBreak:ka,heading:Mv,html:Pu,image:Iu,imageReference:Tu,inlineCode:Au,link:Ru,linkReference:Ou,list:Uv,listItem:Wv,paragraph:Gv,root:Xv,strong:Mu,text:Qv,thematicBreak:e_};function t_(){return{enter:{table:n_,tableData:wa,tableHeader:wa,tableRow:i_},exit:{codeText:s_,table:r_,tableData:mi,tableHeader:mi,tableRow:mi}}}function n_(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function r_(t){this.exit(t),this.data.inTable=void 0}function i_(t){this.enter({type:"tableRow",children:[]},t)}function mi(t){this.exit(t)}function wa(t){this.enter({type:"tableCell",children:[]},t)}function s_(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,o_));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function o_(t,e){return e==="|"?e:t}function a_(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
31
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:l,tableRow:a}};function o(f,d,v,y){return u(c(f,v,y),f.align)}function a(f,d,v,y){const _=h(f,v,y),w=u([_]);return w.slice(0,w.indexOf(`
32
- `))}function l(f,d,v,y){const _=v.enter("tableCell"),w=v.enter("phrasing"),E=v.containerPhrasing(f,{...y,before:s,after:s});return w(),_(),E}function u(f,d){return xv(f,{align:d,alignDelimiters:r,padding:n,stringLength:i})}function c(f,d,v){const y=f.children;let _=-1;const w=[],E=d.enter("table");for(;++_<y.length;)w[_]=h(y[_],d,v);return E(),w}function h(f,d,v){const y=f.children;let _=-1;const w=[],E=d.enter("tableRow");for(;++_<y.length;)w[_]=l(y[_],f,d,v);return E(),w}function p(f,d,v){let y=Lu.inlineCode(f,d,v);return v.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function l_(){return{exit:{taskListCheckValueChecked:Ea,taskListCheckValueUnchecked:Ea,paragraph:c_}}}function u_(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:h_}}}function Ea(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function c_(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function h_(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",o="["+(t.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Lu.listItem(t,e,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+o}}function f_(){return[Um(),hv(),gv(),t_(),l_()]}function p_(t){return{extensions:[Vm(),fv(t),mv(),a_(t),u_()]}}const d_={tokenize:b_,partial:!0},$u={tokenize:x_,partial:!0},zu={tokenize:k_,partial:!0},Nu={tokenize:w_,partial:!0},g_={tokenize:E_,partial:!0},Bu={name:"wwwAutolink",tokenize:__,previous:qu},ju={name:"protocolAutolink",tokenize:y_,previous:Hu},lt={name:"emailAutolink",tokenize:v_,previous:Uu},Je={};function m_(){return{text:Je}}let wt=48;for(;wt<123;)Je[wt]=lt,wt++,wt===58?wt=65:wt===91&&(wt=97);Je[43]=lt;Je[45]=lt;Je[46]=lt;Je[95]=lt;Je[72]=[lt,ju];Je[104]=[lt,ju];Je[87]=[lt,Bu];Je[119]=[lt,Bu];function v_(t,e,n){const r=this;let i,s;return o;function o(h){return!ts(h)||!Uu.call(r,r.previous)||Ts(r.events)?n(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(h))}function a(h){return ts(h)?(t.consume(h),a):h===64?(t.consume(h),l):n(h)}function l(h){return h===46?t.check(g_,c,u)(h):h===45||h===95||Ee(h)?(s=!0,t.consume(h),l):c(h)}function u(h){return t.consume(h),i=!0,l}function c(h){return s&&i&&Ie(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(h)):n(h)}}function __(t,e,n){const r=this;return i;function i(o){return o!==87&&o!==119||!qu.call(r,r.previous)||Ts(r.events)?n(o):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(d_,t.attempt($u,t.attempt(zu,s),n),n)(o))}function s(o){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(o)}}function y_(t,e,n){const r=this;let i="",s=!1;return o;function o(h){return(h===72||h===104)&&Hu.call(r,r.previous)&&!Ts(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),t.consume(h),a):n(h)}function a(h){if(Ie(h)&&i.length<5)return i+=String.fromCodePoint(h),t.consume(h),a;if(h===58){const p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(h),l}return n(h)}function l(h){return h===47?(t.consume(h),s?u:(s=!0,l)):n(h)}function u(h){return h===null||xr(h)||le(h)||Pt(h)||Tr(h)?n(h):t.attempt($u,t.attempt(zu,c),n)(h)}function c(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(h)}}function b_(t,e,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,t.consume(o),i):o===46&&r===3?(t.consume(o),s):n(o)}function s(o){return o===null?n(o):e(o)}}function x_(t,e,n){let r,i,s;return o;function o(u){return u===46||u===95?t.check(Nu,l,a)(u):u===null||le(u)||Pt(u)||u!==45&&Tr(u)?l(u):(s=!0,t.consume(u),o)}function a(u){return u===95?r=!0:(i=r,r=void 0),t.consume(u),o}function l(u){return i||r||!s?n(u):e(u)}}function k_(t,e){let n=0,r=0;return i;function i(o){return o===40?(n++,t.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?t.check(Nu,e,s)(o):o===null||le(o)||Pt(o)?e(o):(t.consume(o),i)}function s(o){return o===41&&r++,t.consume(o),i}}function w_(t,e,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),r):a===38?(t.consume(a),s):a===93?(t.consume(a),i):a===60||a===null||le(a)||Pt(a)?e(a):n(a)}function i(a){return a===null||a===40||a===91||le(a)||Pt(a)?e(a):r(a)}function s(a){return Ie(a)?o(a):n(a)}function o(a){return a===59?(t.consume(a),r):Ie(a)?(t.consume(a),o):n(a)}}function E_(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Ee(s)?n(s):e(s)}}function qu(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||le(t)}function Hu(t){return!Ie(t)}function Uu(t){return!(t===47||ts(t))}function ts(t){return t===43||t===45||t===46||t===95||Ee(t)}function Ts(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const S_={tokenize:O_,partial:!0};function C_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:A_,continuation:{tokenize:F_},exit:R_}},text:{91:{name:"gfmFootnoteCall",tokenize:T_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:P_,resolveTo:I_}}}}function P_(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const u=Ue(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function I_(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",o,e],["exit",o,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...a),t}function T_(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),l}function l(h){return h!==94?n(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(h){if(s>999||h===93&&!o||h===null||h===91||le(h))return n(h);if(h===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return i.includes(Ue(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(h)}return le(h)||(o=!0),s++,t.consume(h),h===92?c:u}function c(h){return h===91||h===92||h===93?(t.consume(h),s++,u):u(h)}}function A_(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(d){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(d),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(d){return d===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(d),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",c):n(d)}function c(d){if(o>999||d===93&&!a||d===null||d===91||le(d))return n(d);if(d===93){t.exit("chunkString");const v=t.exit("gfmFootnoteDefinitionLabelString");return s=Ue(r.sliceSerialize(v)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(d),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return le(d)||(a=!0),o++,t.consume(d),d===92?h:c}function h(d){return d===91||d===92||d===93?(t.consume(d),o++,c):c(d)}function p(d){return d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),i.includes(s)||i.push(s),ne(t,f,"gfmFootnoteDefinitionWhitespace")):n(d)}function f(d){return e(d)}}function F_(t,e,n){return t.check(Un,e,t.attempt(S_,e,n))}function R_(t){t.exit("gfmFootnoteDefinition")}function O_(t,e,n){const r=this;return ne(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(s):n(s)}}function D_(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let u=l;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[l][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[l][1].end)},h={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[l][1].start)},p=[["enter",c,a],["enter",o[u][1],a],["exit",o[u][1],a],["enter",h,a]],f=a.parser.constructs.insideSpan.null;f&&$e(p,p.length,0,Ar(f,o.slice(u+1,l),a)),$e(p,p.length,0,[["exit",h,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",c,a]]),$e(o,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const u=this.previous,c=this.events;let h=0;return p;function p(d){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(d):(o.enter("strikethroughSequenceTemporary"),f(d))}function f(d){const v=Yt(u);if(d===126)return h>1?l(d):(o.consume(d),h++,f);if(h<2&&!n)return l(d);const y=o.exit("strikethroughSequenceTemporary"),_=Yt(d);return y._open=!_||_===2&&!!v,y._close=!v||v===2&&!!_,a(d)}}}class M_{constructor(){this.map=[]}add(e,n,r){L_(this,e,n,r)}consume(e){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function L_(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function $_(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function z_(){return{flow:{null:{name:"table",tokenize:N_,resolveAll:B_}}}}function N_(t,e,n){const r=this;let i=0,s=0,o;return a;function a(b){let D=r.events.length-1;for(;D>-1;){const B=r.events[D][1].type;if(B==="lineEnding"||B==="linePrefix")D--;else break}const L=D>-1?r.events[D][1].type:null,V=L==="tableHead"||L==="tableRow"?x:l;return V===x&&r.parser.lazy[r.now().line]?n(b):V(b)}function l(b){return t.enter("tableHead"),t.enter("tableRow"),u(b)}function u(b){return b===124||(o=!0,s+=1),c(b)}function c(b){return b===null?n(b):H(b)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),f):n(b):Q(b)?ne(t,c,"whitespace")(b):(s+=1,o&&(o=!1,i+=1),b===124?(t.enter("tableCellDivider"),t.consume(b),t.exit("tableCellDivider"),o=!0,c):(t.enter("data"),h(b)))}function h(b){return b===null||b===124||le(b)?(t.exit("data"),c(b)):(t.consume(b),b===92?p:h)}function p(b){return b===92||b===124?(t.consume(b),h):h(b)}function f(b){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(b):(t.enter("tableDelimiterRow"),o=!1,Q(b)?ne(t,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):d(b))}function d(b){return b===45||b===58?y(b):b===124?(o=!0,t.enter("tableCellDivider"),t.consume(b),t.exit("tableCellDivider"),v):C(b)}function v(b){return Q(b)?ne(t,y,"whitespace")(b):y(b)}function y(b){return b===58?(s+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(b),t.exit("tableDelimiterMarker"),_):b===45?(s+=1,_(b)):b===null||H(b)?F(b):C(b)}function _(b){return b===45?(t.enter("tableDelimiterFiller"),w(b)):C(b)}function w(b){return b===45?(t.consume(b),w):b===58?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(b),t.exit("tableDelimiterMarker"),E):(t.exit("tableDelimiterFiller"),E(b))}function E(b){return Q(b)?ne(t,F,"whitespace")(b):F(b)}function F(b){return b===124?d(b):b===null||H(b)?!o||i!==s?C(b):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(b)):C(b)}function C(b){return n(b)}function x(b){return t.enter("tableRow"),N(b)}function N(b){return b===124?(t.enter("tableCellDivider"),t.consume(b),t.exit("tableCellDivider"),N):b===null||H(b)?(t.exit("tableRow"),e(b)):Q(b)?ne(t,N,"whitespace")(b):(t.enter("data"),T(b))}function T(b){return b===null||b===124||le(b)?(t.exit("data"),N(b)):(t.consume(b),b===92?U:T)}function U(b){return b===92||b===124?(t.consume(b),T):T(b)}}function B_(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,u,c,h;const p=new M_;for(;++n<t.length;){const f=t[n],d=f[1];f[0]==="enter"?d.type==="tableHead"?(a=!1,l!==0&&(Sa(p,e,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},d.start),end:Object.assign({},d.end)},p.add(n,0,[["enter",u,e]])):d.type==="tableRow"||d.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},d.start),end:Object.assign({},d.end)},p.add(n,0,[["enter",c,e]])),i=d.type==="tableDelimiterRow"?2:c?3:1):i&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],h=nr(p,e,s,i,void 0,h),s=[0,0,0,0]),o[2]=n)):d.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],h=nr(p,e,s,i,void 0,h)),s=o,o=[s[1],n,0,0])):d.type==="tableHead"?(a=!0,l=n):d.type==="tableRow"||d.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],h=nr(p,e,s,i,n,h)):o[1]!==0&&(h=nr(p,e,o,i,n,h)),i=0):i&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Sa(p,e,l,u,c),p.consume(e.events),n=-1;++n<e.events.length;){const f=e.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=$_(e.events,n))}return t}function nr(t,e,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},zt(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const l=zt(e.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const u=zt(e.events,n[2]),c=zt(e.events,n[3]),h={type:a,start:Object.assign({},u),end:Object.assign({},c)};if(t.add(n[2],0,[["enter",h,e]]),r!==2){const p=e.events[n[2]],f=e.events[n[3]];if(p[1].end=Object.assign({},f[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const d=n[2]+1,v=n[3]-n[2]-1;t.add(d,v,[])}}t.add(n[3]+1,0,[["exit",h,e]])}return i!==void 0&&(s.end=Object.assign({},zt(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function Sa(t,e,n,r,i){const s=[],o=zt(e.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,e])),r.end=Object.assign({},o),s.push(["exit",r,e]),t.add(n+1,0,s)}function zt(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const j_={name:"tasklistCheck",tokenize:H_};function q_(){return{text:{91:j_}}}function H_(t,e,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),s)}function s(l){return le(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):n(l)}function a(l){return H(l)?e(l):Q(l)?t.check({tokenize:U_},e,n)(l):n(l)}}function U_(t,e,n){return ne(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function V_(t){return tu([m_(),C_(),D_(t),z_(),q_()])}const W_={};function py(t){const e=this,n=t||W_,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(V_(n)),s.push(f_()),o.push(p_(n))}export{iy as A,sy as B,X_ as C,py as D,Z_ as G,Rm as V,cy as a,hy as b,ay as c,uy as d,ty as e,Mo as f,If as g,$l as h,ny as i,J_ as j,Af as k,Ll as l,Q_ as m,kf as n,Hi as o,wf as p,ry as q,Y_ as r,K_ as s,ly as t,fy as u,xu as v,Tf as w,ey as x,Rf as y,oy as z};