@minimalcorp/tsunagi 0.1.32 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/apps/web/.next/BUILD_ID +1 -1
- package/.next/standalone/apps/web/.next/build-manifest.json +3 -3
- package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
- package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +13 -13
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.rsc +15 -16
- package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -5
- package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +15 -16
- package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +8 -8
- package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +2 -3
- package/.next/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.rsc +15 -15
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +15 -15
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +8 -8
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page.js.nft.json +1 -1
- package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__08c7fz~._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0h4wzcb._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__0tq9wv6._.js → [root-of-the-server]__0mct.7z._.js} +2 -2
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0nhzci6._.js +14 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ome304._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0vi01rl._.js +14 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{_0836rl_._.js → _02dcd~k._.js} +2 -2
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{_03hz06e._.js → _0dar4c0._.js} +2 -2
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0g.cd6a._.js +17 -17
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0lpms0u._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0owas.l._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{_0amxree._.js → _0sxye4q._.js} +2 -2
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_109pmo2._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_settings_page_tsx_0i6itlb._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_tasks_[id]_page_tsx_0jshsm2._.js +23 -2
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0dmu62y._.js → node_modules_07-e6tb._.js} +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0z0orm9._.js → node_modules_0b6fjwn._.js} +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_046ca89._.js → node_modules_0bix9lu._.js} +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0vm.f2d._.js → node_modules_0fpqbi2._.js} +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0v86kpj._.js → node_modules_0k8xmjr._.js} +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0jcrj-2._.js → node_modules_0r9vehj._.js} +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_065xsw3._.js → node_modules_0w48uk8._.js} +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/{node_modules_0c_-8tt._.js → node_modules_0yoat72._.js} +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0zerlct._.js +3 -0
- package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_next_dist_0xdsm99._.js +1 -1
- package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
- package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
- package/.next/standalone/apps/web/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/apps/web/.next/static/chunks/00e8eue.21.8h.css +4 -0
- package/.next/standalone/apps/web/.next/static/chunks/08u0u06ip_aj0.js +5 -0
- package/.next/standalone/apps/web/.next/static/chunks/0e8u7rqrqfiiy.js +1 -0
- package/.next/standalone/apps/web/.next/static/chunks/0gfpx.h8alews.js +11 -0
- package/.next/standalone/apps/web/.next/static/chunks/0j3485~p9pn9n.js +1 -0
- package/.next/standalone/apps/web/.next/static/chunks/0k9kik1oc11wc.js +1 -0
- package/.next/standalone/apps/web/.next/static/chunks/0kmlu-0djf-rx.js +1 -0
- package/.next/standalone/apps/web/.next/static/chunks/0vlse5ga2r0n7.js +24 -0
- package/.next/standalone/apps/web/.next/static/chunks/0w-rozhi-~746.js +11 -0
- package/.next/standalone/apps/web/.next/static/chunks/0x3kp2s554oy5.js +64 -0
- package/.next/standalone/apps/web/.next/static/chunks/13f6kj~4r5x0p.js +1 -0
- package/dist/server/generated/prisma/browser.d.ts +0 -5
- package/dist/server/generated/prisma/client.d.ts +0 -5
- package/dist/server/generated/prisma/commonInputTypes.d.ts +52 -52
- package/dist/server/generated/prisma/internal/class.d.ts +0 -11
- package/dist/server/generated/prisma/internal/class.js +4 -4
- package/dist/server/generated/prisma/internal/prismaNamespace.d.ts +7 -91
- package/dist/server/generated/prisma/internal/prismaNamespace.js +2 -10
- package/dist/server/generated/prisma/internal/prismaNamespaceBrowser.d.ts +2 -11
- package/dist/server/generated/prisma/internal/prismaNamespaceBrowser.js +2 -10
- package/dist/server/generated/prisma/models/EnvironmentVariable.d.ts +0 -3
- package/dist/server/generated/prisma/models/Repository.d.ts +82 -1
- package/dist/server/generated/prisma/models/Tab.d.ts +39 -1
- package/dist/server/generated/prisma/models/Task.d.ts +0 -7
- package/dist/server/generated/prisma/models.d.ts +0 -1
- package/dist/server/index.js +0 -2
- package/dist/server/lib/repositories/repository.d.ts +7 -1
- package/dist/server/lib/repositories/repository.js +27 -29
- package/dist/server/lib/repositories/task.d.ts +5 -0
- package/dist/server/lib/repositories/task.js +13 -0
- package/dist/server/lib/worktree-manager.js +14 -2
- package/dist/server/routes/hooks.js +21 -1
- package/dist/server/routes/repos.js +93 -19
- package/dist/server/routes/tasks.js +20 -0
- package/npm-shrinkwrap.json +85 -76
- package/package.json +1 -1
- package/prisma/migrations/20260915000000_drop_planner_tabs/migration.sql +3 -0
- package/prisma/migrations/20260916000000_add_repository_order/migration.sql +12 -0
- package/prisma/migrations/20260918000000_add_tab_unread/migration.sql +4 -0
- package/prisma/schema.prisma +3 -13
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__053-iaj._.js +0 -3
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__07kf5h-._.js +0 -35
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_gamc9._.js +0 -35
- package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0w0y9fd._.js +0 -3
- package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0_.o928._.js +0 -3
- package/.next/standalone/apps/web/.next/static/chunks/0.1pdl3yo~xet.js +0 -5
- package/.next/standalone/apps/web/.next/static/chunks/001oo2jah4cv9.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/05b63w8.ny19p.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/08dtfekvxgpfu.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/0dpeys_k2-mrk.js +0 -32
- package/.next/standalone/apps/web/.next/static/chunks/0hvtxos.brr01.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/0nh1-0lee-1pk.js +0 -32
- package/.next/standalone/apps/web/.next/static/chunks/0nhpg19g1rl_7.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/0tggf01u1vugi.js +0 -3
- package/.next/standalone/apps/web/.next/static/chunks/0wxrfu5la_s94.js +0 -64
- package/.next/standalone/apps/web/.next/static/chunks/0zu48yvkl8pyj.css +0 -4
- package/.next/standalone/apps/web/.next/static/chunks/13twvr.qg3khh.js +0 -1
- package/.next/standalone/apps/web/.next/static/chunks/164p.6qr5~-7x.js +0 -1
- package/dist/server/generated/prisma/models/PlannerTab.d.ts +0 -1089
- package/dist/server/generated/prisma/models/PlannerTab.js +0 -1
- package/dist/server/routes/planner.d.ts +0 -2
- package/dist/server/routes/planner.js +0 -86
- /package/.next/standalone/apps/web/.next/static/{70bPr4pgLIE7loeTg62ih → mWBhkmlLJfxVxMeoAXXc3}/_buildManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{70bPr4pgLIE7loeTg62ih → mWBhkmlLJfxVxMeoAXXc3}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{70bPr4pgLIE7loeTg62ih → mWBhkmlLJfxVxMeoAXXc3}/_ssgManifest.js +0 -0
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26568,(e,i,r)=>{"use strict";var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,s=/\n/g,o=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,h=/^[;\s]*/,u=/^\s+|\s+$/g;function d(e){return e?e.replace(u,""):""}i.exports=function(e,i){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];i=i||{};var r=1,u=1;function f(e){var i=e.match(s);i&&(r+=i.length);var n=e.lastIndexOf("\n");u=~n?e.length-n:u+e.length}function p(){var e={line:r,column:u};return function(i){return i.position=new g(e),_(o),i}}function g(e){this.start=e,this.end={line:r,column:u},this.source=i.source}function m(n){var s=Error(i.source+":"+r+":"+u+": "+n);if(s.reason=n,s.filename=i.source,s.line=r,s.column=u,s.source=e,i.silent);else throw s}function _(i){var r=i.exec(e);if(r){var n=r[0];return f(n),e=e.slice(n.length),r}}function v(e){var i;for(e=e||[];i=y();)!1!==i&&e.push(i);return e}function y(){var i=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return m("End of comment missing");var n=e.slice(2,r-2);return u+=2,f(n),e=e.slice(r),u+=2,i({type:"comment",comment:n})}}g.prototype.content=e,_(o);var b,S=[];for(v(S);b=function(){var e=p(),i=_(a);if(i){if(y(),!_(l))return m("property missing ':'");var r=_(c),s=e({type:"declaration",property:d(i[0].replace(n,"")),value:r?d(r[0].replace(n,"")):""});return _(h),s}}();)!1!==b&&(S.push(b),v(S));return S}},70454,(e,i,r)=>{"use strict";var n=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,i){let r=null;if(!e||"string"!=typeof e)return r;let n=(0,s.default)(e),o="function"==typeof i;return n.forEach(e=>{if("declaration"!==e.type)return;let{property:n,value:s}=e;o?i(n,s,e):s&&((r=r||{})[n]=s)}),r};let s=n(e.r(26568))},65185,(e,i,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,s=/-([a-z])/g,o=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,c=function(e,i){return i.toUpperCase()},h=function(e,i){return"".concat(i,"-")};r.camelCase=function(e,i){var r;return(void 0===i&&(i={}),!(r=e)||o.test(r)||n.test(r))?e:(e=e.toLowerCase(),(e=i.reactCompat?e.replace(l,h):e.replace(a,h)).replace(s,c))}},15511,(e,i,r)=>{"use strict";var n=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(70454)),s=e.r(65185);function o(e,i){var r={};return e&&"string"==typeof e&&(0,n.default)(e,function(e,n){e&&n&&(r[(0,s.camelCase)(e,i)]=n)}),r}o.default=o,i.exports=o},4100,(e,i,r)=>{"use strict";var n=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===s.call(e)},c=function(e){if(!e||"[object Object]"!==s.call(e))return!1;var i,r=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||n.call(e,i)},h=function(e,i){o&&"__proto__"===i.name?o(e,i.name,{enumerable:!0,configurable:!0,value:i.newValue,writable:!0}):e[i.name]=i.newValue},u=function(e,i){if("__proto__"===i){if(!n.call(e,i))return;else if(a)return a(e,i).value}return e[i]};i.exports=function e(){var i,r,n,s,o,a,d=arguments[0],f=1,p=arguments.length,g=!1;for("boolean"==typeof d&&(g=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(i=arguments[f],null!=i)for(r in i)n=u(d,r),d!==(s=u(i,r))&&(g&&s&&(c(s)||(o=l(s)))?(o?(o=!1,a=n&&l(n)?n:[]):a=n&&c(n)?n:{},h(d,{name:r,newValue:e(g,a,s)})):void 0!==s&&h(d,{name:r,newValue:s}));return d}},10483,74886,76165,37287,97254,79144,67569,56590,18847,61896,60752,12666,54943,78784,e=>{"use strict";let i,r,n;var s,o,a,l,c,h,u,d,f,p,g=e.i(18050),m=e.i(71645),_=e.i(88784);function v(){}function y(){}let b=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,S=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w={};function x(e,i){return((i||w).jsx?S:b).test(e)}let C=/[ \t\n\f\r]/g;function k(e){return""===e.replace(C,"")}class E{constructor(e,i){this.attribute=i,this.property=e}}E.prototype.attribute="",E.prototype.booleanish=!1,E.prototype.boolean=!1,E.prototype.commaOrSpaceSeparated=!1,E.prototype.commaSeparated=!1,E.prototype.defined=!1,E.prototype.mustUseProperty=!1,E.prototype.number=!1,E.prototype.overloadedBoolean=!1,E.prototype.property="",E.prototype.spaceSeparated=!1,E.prototype.space=void 0;let R=0,T=B(),D=B(),L=B(),A=B(),P=B(),M=B(),O=B();function B(){return 2**++R}e.s(["boolean",0,T,"booleanish",0,D,"commaOrSpaceSeparated",0,O,"commaSeparated",0,M,"number",0,A,"overloadedBoolean",0,L,"spaceSeparated",0,P],744);var N=e.i(744);let I=Object.keys(N);class F extends E{constructor(e,i,r,n){let s=-1;if(super(e,i),function(e,i,r){r&&(e[i]=r)}(this,"space",n),"number"==typeof r)for(;++s<I.length;){const e=I[s];!function(e,i,r){r&&(e[i]=r)}(this,I[s],(r&N[e])===N[e])}}}function z(e){return e.toLowerCase()}F.prototype.defined=!0;let H=/[A-Z]/g,j=/-[a-z]/g,W=/^data[-\w.:]+$/i;function $(e){return"-"+e.toLowerCase()}function U(e){return e.charAt(1).toUpperCase()}let q={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class V{constructor(e,i,r){this.normal=i,this.property=e,r&&(this.space=r)}}function K(e,i){let r={},n={};for(let i of e)Object.assign(r,i.property),Object.assign(n,i.normal);return new V(r,n,i)}function Y(e){let i={},r={};for(let[n,s]of Object.entries(e.properties)){let o=new F(n,e.transform(e.attributes||{},n),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),i[n]=o,r[z(n)]=n,r[z(o.attribute)]=n}return new V(i,r,e.space)}V.prototype.normal={},V.prototype.property={},V.prototype.space=void 0;let X=Y({properties:{ariaActiveDescendant:null,ariaAtomic:D,ariaAutoComplete:null,ariaBusy:D,ariaChecked:D,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:D,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:D,ariaFlowTo:P,ariaGrabbed:D,ariaHasPopup:null,ariaHidden:D,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:A,ariaLive:null,ariaModal:D,ariaMultiLine:D,ariaMultiSelectable:D,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:D,ariaReadOnly:D,ariaRelevant:null,ariaRequired:D,ariaRoleDescription:P,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:D,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform:(e,i)=>"role"===i?i:"aria-"+i.slice(4).toLowerCase()});function G(e,i){return i in e?e[i]:i}function J(e,i){return G(e,i.toLowerCase())}let Z=Y({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:M,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:T,allowPaymentRequest:T,allowUserMedia:T,alt:null,as:null,async:T,autoCapitalize:null,autoComplete:P,autoFocus:T,autoPlay:T,blocking:P,capture:null,charSet:null,checked:T,cite:null,className:P,cols:A,colSpan:null,content:null,contentEditable:D,controls:T,controlsList:P,coords:A|M,crossOrigin:null,data:null,dateTime:null,decoding:null,default:T,defer:T,dir:null,dirName:null,disabled:T,download:L,draggable:D,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:T,formTarget:null,headers:P,height:A,hidden:L,high:A,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:T,inputMode:null,integrity:null,is:null,isMap:T,itemId:null,itemProp:P,itemRef:P,itemScope:T,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:T,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:T,muted:T,name:null,nonce:null,noModule:T,noValidate:T,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:T,optimum:A,pattern:null,ping:P,placeholder:null,playsInline:T,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:T,referrerPolicy:null,rel:P,required:T,reversed:T,rows:A,rowSpan:A,sandbox:P,scope:null,scoped:T,seamless:T,selected:T,shadowRootClonable:T,shadowRootDelegatesFocus:T,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:D,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:T,useMap:null,value:D,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:T,declare:T,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:T,noHref:T,noShade:T,noWrap:T,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:D,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:T,disableRemotePlayback:T,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:J}),Q=Y({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:O,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:P,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:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:T,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,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:M,g2:M,glyphName:M,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:O,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,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:A,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:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:O,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:O,rev:O,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:O,requiredFeatures:O,requiredFonts:O,requiredFormats:O,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:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:O,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:O,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:O,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:G}),ee=Y({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,i)=>"xlink:"+i.slice(5).toLowerCase()}),et=Y({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:J}),ei=Y({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,i)=>"xml:"+i.slice(3).toLowerCase()}),er=K([X,Z,ee,et,ei],"html"),en=K([X,Q,ee,et,ei],"svg");var es=e.i(15511);let eo=el("end"),ea=el("start");function el(e){return function(i){let r=i&&i.position&&i.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function ec(e){return e&&"object"==typeof e?"position"in e||"type"in e?eu(e.position):"start"in e||"end"in e?eu(e):"line"in e||"column"in e?eh(e):"":""}function eh(e){return ed(e&&e.line)+":"+ed(e&&e.column)}function eu(e){return eh(e&&e.start)+"-"+eh(e&&e.end)}function ed(e){return e&&"number"==typeof e?e:1}class ef extends Error{constructor(e,i,r){super(),"string"==typeof i&&(r=i,i=void 0);let n="",s={},o=!1;if(i&&(s="line"in i&&"column"in i||"start"in i&&"end"in i?{place:i}:"type"in i?{ancestors:[i],place:i.position}:{...i}),"string"==typeof e?n=e:!s.cause&&e&&(o=!0,n=e.message,s.cause=e),!s.ruleId&&!s.source&&"string"==typeof r){const e=r.indexOf(":");-1===e?s.ruleId=r:(s.source=r.slice(0,e),s.ruleId=r.slice(e+1))}if(!s.place&&s.ancestors&&s.ancestors){const e=s.ancestors[s.ancestors.length-1];e&&(s.place=e.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=n,this.line=a?a.line:void 0,this.name=ec(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&&"string"==typeof s.cause.stack?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ef.prototype.file="",ef.prototype.name="",ef.prototype.reason="",ef.prototype.message="",ef.prototype.stack="",ef.prototype.column=void 0,ef.prototype.line=void 0,ef.prototype.ancestors=void 0,ef.prototype.cause=void 0,ef.prototype.fatal=void 0,ef.prototype.place=void 0,ef.prototype.ruleId=void 0,ef.prototype.source=void 0;let ep={}.hasOwnProperty,eg=new Map,em=/[A-Z]/g,e_=new Set(["table","tbody","thead","tfoot","tr"]),ev=new Set(["td","th"]),ey="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eb(e,i,r){var n,s,o,a,l,c,h,u,d;let f,p,g,m,_,y,b,S,w,x,C;return"element"===i.type?(n=e,s=i,o=r,p=f=n.schema,"svg"===s.tagName.toLowerCase()&&"html"===f.space&&(n.schema=en),n.ancestors.push(s),g=eC(n,s.tagName,!1),m=function(e,i){let r,n,s={};for(n in i.properties)if("children"!==n&&ep.call(i.properties,n)){let o=function(e,i,r){let n=function(e,i){let r=z(i),n=i,s=E;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&W.test(i)){if("-"===i.charAt(4)){let e=i.slice(5).replace(j,U);n="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=i.slice(4);if(!j.test(e)){let r=e.replace(H,$);"-"!==r.charAt(0)&&(r="-"+r),i="data"+r}}s=F}return new s(n,i)}(e.schema,i);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){var s;let i;if(Array.isArray(r)&&(r=n.commaSeparated?(i={},(""===(s=r)[s.length-1]?[...s,""]:s).join((i.padRight?" ":"")+","+(!1===i.padLeft?"":" ")).trim()):r.join(" ").trim()),"style"===n.property){let i="object"==typeof r?r:function(e,i){try{return(0,es.default)(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let i=new ef("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ey+"#cannot-parse-style-attribute",i}}(e,String(r));return"css"===e.stylePropertyNameCase&&(i=function(e){let i,r={};for(i in e)ep.call(e,i)&&(r[function(e){let i=e.replace(em,eE);return"ms-"===i.slice(0,3)&&(i="-"+i),i}(i)]=e[i]);return r}(i)),["style",i]}return["react"===e.elementAttributeNameCase&&n.space?q[n.property]||n.property:n.attribute,r]}}(e,n,i.properties[n]);if(o){let[n,a]=o;e.tableCellAlignToStyle&&"align"===n&&"string"==typeof a&&ev.has(i.tagName)?r=a:s[n]=a}}return r&&((s.style||(s.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),s}(n,s),_=ex(n,s),e_.has(s.tagName)&&(_=_.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&k(e.value):k(e))})),eS(n,m,g,s),ew(m,_),n.ancestors.pop(),n.schema=f,n.create(s,g,m,o)):"mdxFlowExpression"===i.type||"mdxTextExpression"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater){let r=i.data.estree.body[0];return v("ExpressionStatement"===r.type),e.evaluater.evaluateExpression(r.expression)}ek(e,i.position)}(e,i):"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?(a=e,l=i,c=r,b=y=a.schema,"svg"===l.name&&"html"===y.space&&(a.schema=en),a.ancestors.push(l),S=null===l.name?a.Fragment:eC(a,l.name,!0),w=function(e,i){let r={};for(let n of i.attributes)if("mdxJsxExpressionAttribute"===n.type)if(n.data&&n.data.estree&&e.evaluater){let i=n.data.estree.body[0];v("ExpressionStatement"===i.type);let s=i.expression;v("ObjectExpression"===s.type);let o=s.properties[0];v("SpreadElement"===o.type),Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else ek(e,i.position);else{let s,o=n.name;if(n.value&&"object"==typeof n.value)if(n.value.data&&n.value.data.estree&&e.evaluater){let i=n.value.data.estree.body[0];v("ExpressionStatement"===i.type),s=e.evaluater.evaluateExpression(i.expression)}else ek(e,i.position);else s=null===n.value||n.value;r[o]=s}return r}(a,l),x=ex(a,l),eS(a,w,S,l),ew(w,x),a.ancestors.pop(),a.schema=y,a.create(l,S,w,c)):"mdxjsEsm"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);ek(e,i.position)}(e,i):"root"===i.type?(h=e,u=i,d=r,ew(C={},ex(h,u)),h.create(u,h.Fragment,C,d)):"text"===i.type?i.value:void 0}function eS(e,i,r,n){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(i.node=n)}function ew(e,i){if(i.length>0){let r=i.length>1?i:i[0];r&&(e.children=r)}}function ex(e,i){let r=[],n=-1,s=e.passKeys?new Map:eg;for(;++n<i.children.length;){let o,a=i.children[n];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let i=s.get(e)||0;o=e+"-"+i,s.set(e,i+1)}}let l=eb(e,a,o);void 0!==l&&r.push(l)}return r}function eC(e,i,r){let n;if(r)if(i.includes(".")){let e,r=i.split("."),s=-1;for(;++s<r.length;){let i=x(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};e=e?{type:"MemberExpression",object:e,property:i,computed:!!(s&&"Literal"===i.type),optional:!1}:i}v(e,"always a result"),n=e}else n=x(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};else n={type:"Literal",value:i};if("Literal"===n.type){let i=n.value;return ep.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(n);ek(e)}function ek(e,i){let r=new ef("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=ey+"#cannot-handle-mdx-estrees-without-createevaluater",r}function eE(e){return"-"+e.toLowerCase()}let eR={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"]},eT={};function eD(e,i){let r=i||eT;return eL(e,"boolean"!=typeof r.includeImageAlt||r.includeImageAlt,"boolean"!=typeof r.includeHtml||r.includeHtml)}function eL(e,i,r){var n;if((n=e)&&"object"==typeof n){if("value"in e)return"html"!==e.type||r?e.value:"";if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eA(e.children,i,r)}return Array.isArray(e)?eA(e,i,r):""}function eA(e,i,r){let n=[],s=-1;for(;++s<e.length;)n[s]=eL(e[s],i,r);return n.join("")}function eP(e,i,r,n){let s,o=e.length,a=0;if(i=i<0?-i>o?0:o+i:i>o?o:i,r=r>0?r:0,n.length<1e4)(s=Array.from(n)).unshift(i,r),e.splice(...s);else for(r&&e.splice(i,r);a<n.length;)(s=n.slice(a,a+1e4)).unshift(i,0),e.splice(...s),a+=1e4,i+=1e4}function eM(e,i){return e.length>0?(eP(e,e.length,0,i),e):i}let eO={}.hasOwnProperty;function eB(e){let i={},r=-1;for(;++r<e.length;)!function(e,i){let r;for(r in i){let n,s=(eO.call(e,r)?e[r]:void 0)||(e[r]={}),o=i[r];if(o)for(n in o){eO.call(s,n)||(s[n]=[]);let e=o[n];!function(e,i){let r=-1,n=[];for(;++r<i.length;)("after"===i[r].add?e:n).push(i[r]);eP(e,0,0,n)}(s[n],Array.isArray(e)?e:e?[e]:[])}}}(i,e[r]);return i}let eN=eY(/[A-Za-z]/),eI=eY(/[\dA-Za-z]/),eF=eY(/[#-'*+\--9=?A-Z^-~]/);function ez(e){return null!==e&&(e<32||127===e)}let eH=eY(/\d/),ej=eY(/[\dA-Fa-f]/),eW=eY(/[!-/:-@[-`{-~]/);function e$(e){return null!==e&&e<-2}function eU(e){return null!==e&&(e<0||32===e)}function eq(e){return -2===e||-1===e||32===e}let eV=eY(/\p{P}|\p{S}/u),eK=eY(/\s/);function eY(e){return function(i){return null!==i&&i>-1&&e.test(String.fromCharCode(i))}}function eX(e,i,r,n){let s=n?n-1:1/0,o=0;return function(n){return eq(n)?(e.enter(r),function n(a){return eq(a)&&o++<s?(e.consume(a),n):(e.exit(r),i(a))}(n)):i(n)}}let eG={tokenize:function(e){let i,r=e.attempt(this.parser.constructs.contentInitial,function(i){return null===i?void e.consume(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),eX(e,r,"linePrefix"))},function(r){return e.enter("paragraph"),function r(n){let s=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=s),i=s,function i(n){if(null===n){e.exit("chunkText"),e.exit("paragraph"),e.consume(n);return}return e$(n)?(e.consume(n),e.exit("chunkText"),r):(e.consume(n),i)}(n)}(r)});return r}},eJ={tokenize:function(e){let i,r,n,s=this,o=[],a=0;return l;function l(i){if(a<o.length){let r=o[a];return s.containerState=r[1],e.attempt(r[0].continuation,c,h)(i)}return h(i)}function c(e){if(a++,s.containerState._closeFlow){let r;s.containerState._closeFlow=void 0,i&&v();let n=s.events.length,o=n;for(;o--;)if("exit"===s.events[o][0]&&"chunkFlow"===s.events[o][1].type){r=s.events[o][1].end;break}_(a);let l=n;for(;l<s.events.length;)s.events[l][1].end={...r},l++;return eP(s.events,o+1,0,s.events.slice(n)),s.events.length=l,h(e)}return l(e)}function h(r){if(a===o.length){if(!i)return f(r);if(i.currentConstruct&&i.currentConstruct.concrete)return g(r);s.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return s.containerState={},e.check(eZ,u,d)(r)}function u(e){return i&&v(),_(a),f(e)}function d(e){return s.parser.lazy[s.now().line]=a!==o.length,n=s.now().offset,g(e)}function f(i){return s.containerState={},e.attempt(eZ,p,g)(i)}function p(e){return a++,o.push([s.currentConstruct,s.containerState]),f(e)}function g(n){if(null===n){i&&v(),_(0),e.consume(n);return}return i=i||s.parser.flow(s.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:r}),function i(r){if(null===r){m(e.exit("chunkFlow"),!0),_(0),e.consume(r);return}return e$(r)?(e.consume(r),m(e.exit("chunkFlow")),a=0,s.interrupt=void 0,l):(e.consume(r),i)}(n)}function m(e,o){let l=s.sliceStream(e);if(o&&l.push(null),e.previous=r,r&&(r.next=e),r=e,i.defineSkip(e.start),i.write(l),s.parser.lazy[e.start.line]){let e,r,o=i.events.length;for(;o--;)if(i.events[o][1].start.offset<n&&(!i.events[o][1].end||i.events[o][1].end.offset>n))return;let l=s.events.length,c=l;for(;c--;)if("exit"===s.events[c][0]&&"chunkFlow"===s.events[c][1].type){if(e){r=s.events[c][1].end;break}e=!0}for(_(a),o=l;o<s.events.length;)s.events[o][1].end={...r},o++;eP(s.events,c+1,0,s.events.slice(l)),s.events.length=o}}function _(i){let r=o.length;for(;r-- >i;){let i=o[r];s.containerState=i[1],i[0].exit.call(s,e)}o.length=i}function v(){i.write([null]),r=void 0,i=void 0,s.containerState._closeFlow=void 0}}},eZ={tokenize:function(e,i,r){return eX(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},eQ={partial:!0,tokenize:function(e,i,r){return function(i){return eq(i)?eX(e,n,"linePrefix")(i):n(i)};function n(e){return null===e||e$(e)?i(e):r(e)}}};class e0{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw 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,i){let r=null==i?1/0:i;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,i,r){this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-(i||0),1/0);return r&&e1(this.left,r),n.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),e1(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),e1(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let i=this.left.splice(e,1/0);e1(this.right,i.reverse())}else{let i=this.right.splice(this.left.length+this.right.length-e,1/0);e1(this.left,i.reverse())}}}function e1(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function e2(e){let i,r,n,s,o,a,l,c={},h=-1,u=new e0(e);for(;++h<u.length;){for(;h in c;)h=c[h];if(i=u.get(h),h&&"chunkFlow"===i[1].type&&"listItemPrefix"===u.get(h-1)[1].type&&((n=0)<(a=i[1]._tokenizer.events).length&&"lineEndingBlank"===a[n][1].type&&(n+=2),n<a.length&&"content"===a[n][1].type))for(;++n<a.length&&"content"!==a[n][1].type;)"chunkText"===a[n][1].type&&(a[n][1]._isInFirstContentOfListItem=!0,n++);if("enter"===i[0])i[1].contentType&&(Object.assign(c,function(e,i){let r,n,s=e.get(i)[1],o=e.get(i)[2],a=i-1,l=[],c=s._tokenizer;!c&&(c=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));let h=c.events,u=[],d={},f=-1,p=s,g=0,m=0,_=[0];for(;p;){for(;e.get(++a)[1]!==p;);l.push(a),!p._tokenizer&&(r=o.sliceStream(p),p.next||r.push(null),n&&c.defineSkip(p.start),p._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(r),p._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),n=p,p=p.next}for(p=s;++f<h.length;)"exit"===h[f][0]&&"enter"===h[f-1][0]&&h[f][1].type===h[f-1][1].type&&h[f][1].start.line!==h[f][1].end.line&&(m=f+1,_.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(c.events=[],p?(p._tokenizer=void 0,p.previous=void 0):_.pop(),f=_.length;f--;){let i=h.slice(_[f],_[f+1]),r=l.pop();u.push([r,r+i.length-1]),e.splice(r,2,i)}for(u.reverse(),f=-1;++f<u.length;)d[g+u[f][0]]=g+u[f][1],g+=u[f][1]-u[f][0]-1;return d}(u,h)),h=c[h],l=!0);else if(i[1]._container){for(n=h,r=void 0;n--;)if("lineEnding"===(s=u.get(n))[1].type||"lineEndingBlank"===s[1].type)"enter"===s[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=n);else if("linePrefix"===s[1].type||"listItemIndent"===s[1].type);else break;r&&(i[1].end={...u.get(r)[1].start},(o=u.slice(r,h)).unshift(i),u.splice(r,h-r+1,o))}}return eP(e,0,1/0,u.slice(0)),!l}let e5={resolve:function(e){return e2(e),e},tokenize:function(e,i){let r;return function(i){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(i)};function n(i){return null===i?s(i):e$(i)?e.check(e3,o,s)(i):(e.consume(i),n)}function s(r){return e.exit("chunkContent"),e.exit("content"),i(r)}function o(i){return e.consume(i),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}},e3={partial:!0,tokenize:function(e,i,r){let n=this;return function(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),eX(e,s,"linePrefix")};function s(s){if(null===s||e$(s))return r(s);let o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(s):e.interrupt(n.parser.constructs.flow,r,i)(s)}}},e4={tokenize:function(e){let i=this,r=e.attempt(eQ,function(n){return null===n?void e.consume(n):(e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,n,eX(e,e.attempt(this.parser.constructs.flow,n,e.attempt(e5,n)),"linePrefix")));return r;function n(n){return null===n?void e.consume(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i.currentConstruct=void 0,r)}}},e6={resolveAll:te()},e9=e7("string"),e8=e7("text");function e7(e){return{resolveAll:te("text"===e?tt:void 0),tokenize:function(i){let r=this,n=this.parser.constructs[e],s=i.attempt(n,o,a);return o;function o(e){return c(e)?s(e):a(e)}function a(e){return null===e?void i.consume(e):(i.enter("data"),i.consume(e),l)}function l(e){return c(e)?(i.exit("data"),s(e)):(i.consume(e),l)}function c(e){if(null===e)return!0;let i=n[e],s=-1;if(i)for(;++s<i.length;){let e=i[s];if(!e.previous||e.previous.call(r,r.previous))return!0}return!1}}}}function te(e){return function(i,r){let n,s=-1;for(;++s<=i.length;)void 0===n?i[s]&&"data"===i[s][1].type&&(n=s,s++):i[s]&&"data"===i[s][1].type||(s!==n+2&&(i[n][1].end=i[s-1][1].end,i.splice(n+2,s-n-2),s=n+2),n=void 0);return e?e(i,r):i}}function tt(e,i){let r=0;for(;++r<=e.length;)if((r===e.length||"lineEnding"===e[r][1].type)&&"data"===e[r-1][1].type){let n,s=e[r-1][1],o=i.sliceStream(s),a=o.length,l=-1,c=0;for(;a--;){let e=o[a];if("string"==typeof e){for(l=e.length;32===e.charCodeAt(l-1);)c++,l--;if(l)break;l=-1}else if(-2===e)n=!0,c++;else if(-1===e);else{a++;break}}if(i._contentTypeTextTrailing&&r===e.length&&(c=0),c){let o={type:r===e.length||n||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:s.start._bufferIndex+l,_index:s.start._index+a,line:s.end.line,column:s.end.column-c,offset:s.end.offset-c},end:{...s.end}};s.end={...o.start},s.start.offset===s.end.offset?Object.assign(s,o):(e.splice(r,0,["enter",o,i],["exit",o,i]),r+=2)}r++}return e}function ti(e){return null===e||eU(e)||eK(e)?1:eV(e)?2:void 0}function tr(e,i,r){let n=[],s=-1;for(;++s<e.length;){let o=e[s].resolveAll;o&&!n.includes(o)&&(i=o(i,r),n.push(o))}return i}let tn={name:"attention",resolveAll:function(e,i){let r,n,s,o,a,l,c,h,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(r=u;r--;)if("exit"===e[r][0]&&"attentionSequence"===e[r][1].type&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[r][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[u][1].start};ts(d,-l),ts(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[u][1].start}},n={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[u][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=eM(c,[["enter",e[r][1],i],["exit",e[r][1],i]])),c=eM(c,[["enter",n,i],["enter",o,i],["exit",o,i],["enter",s,i]]),c=eM(c,tr(i.parser.constructs.insideSpan.null,e.slice(r+1,u),i)),c=eM(c,[["exit",s,i],["enter",a,i],["exit",a,i],["exit",n,i]]),e[u][1].end.offset-e[u][1].start.offset?(h=2,c=eM(c,[["enter",e[u][1],i],["exit",e[u][1],i]])):h=0,eP(e,r-1,u-r+3,c),u=r+c.length-h-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,i){let r,n=this.parser.constructs.attentionMarkers.null,s=this.previous,o=ti(s);return function(a){return r=a,e.enter("attentionSequence"),function a(l){if(l===r)return e.consume(l),a;let c=e.exit("attentionSequence"),h=ti(l),u=!h||2===h&&o||n.includes(l),d=!o||2===o&&h||n.includes(s);return c._open=!!(42===r?u:u&&(o||!d)),c._close=!!(42===r?d:d&&(h||!u)),i(l)}(a)}}};function ts(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}let to={continuation:{tokenize:function(e,i,r){let n=this;return function(i){return eq(i)?eX(e,s,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):s(i)};function s(n){return e.attempt(to,i,r)(n)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,i,r){let n=this;return function(i){if(62===i){let r=n.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),s}return r(i)};function s(r){return eq(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(r))}}},ta={name:"characterEscape",tokenize:function(e,i,r){return function(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),n};function n(n){return eW(n)?(e.enter("characterEscapeValue"),e.consume(n),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(n)}}},tl=document.createElement("i");function tc(e){let i="&"+e+";";tl.innerHTML=i;let r=tl.textContent;return(59!==r.charCodeAt(r.length-1)||"semi"===e)&&r!==i&&r}let th={name:"characterReference",tokenize:function(e,i,r){let n,s,o=this,a=0;return function(i){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(i),e.exit("characterReferenceMarker"),l};function l(i){return 35===i?(e.enter("characterReferenceMarkerNumeric"),e.consume(i),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),n=31,s=eI,h(i))}function c(i){return 88===i||120===i?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(i),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,s=ej,h):(e.enter("characterReferenceValue"),n=7,s=eH,h(i))}function h(l){if(59===l&&a){let n=e.exit("characterReferenceValue");return s!==eI||tc(o.sliceSerialize(n))?(e.enter("characterReferenceMarker"),e.consume(l),e.exit("characterReferenceMarker"),e.exit("characterReference"),i):r(l)}return s(l)&&a++<n?(e.consume(l),h):r(l)}}},tu={partial:!0,tokenize:function(e,i,r){let n=this;return function(i){return null===i?r(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s)};function s(e){return n.parser.lazy[n.now().line]?r(e):i(e)}}},td={concrete:!0,name:"codeFenced",tokenize:function(e,i,r){let n,s=this,o={partial:!0,tokenize:function(e,i,r){let o=0;return function(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a};function a(i){return e.enter("codeFencedFence"),eq(i)?eX(e,c,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):c(i)}function c(i){return i===n?(e.enter("codeFencedFenceSequence"),function i(s){return s===n?(o++,e.consume(s),i):o>=l?(e.exit("codeFencedFenceSequence"),eq(s)?eX(e,h,"whitespace")(s):h(s)):r(s)}(i)):r(i)}function h(n){return null===n||e$(n)?(e.exit("codeFencedFence"),i(n)):r(n)}}},a=0,l=0;return function(i){var o;let h;return o=i,a=(h=s.events[s.events.length-1])&&"linePrefix"===h[1].type?h[2].sliceSerialize(h[1],!0).length:0,n=o,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function i(s){return s===n?(l++,e.consume(s),i):l<3?r(s):(e.exit("codeFencedFenceSequence"),eq(s)?eX(e,c,"whitespace")(s):c(s))}(o)};function c(o){return null===o||e$(o)?(e.exit("codeFencedFence"),s.interrupt?i(o):e.check(tu,u,g)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function i(s){return null===s||e$(s)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(s)):eq(s)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),eX(e,h,"whitespace")(s)):96===s&&s===n?r(s):(e.consume(s),i)}(o))}function h(i){return null===i||e$(i)?c(i):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function i(s){return null===s||e$(s)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(s)):96===s&&s===n?r(s):(e.consume(s),i)}(i))}function u(i){return e.attempt(o,g,d)(i)}function d(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),f}function f(i){return a>0&&eq(i)?eX(e,p,"linePrefix",a+1)(i):p(i)}function p(i){return null===i||e$(i)?e.check(tu,u,g)(i):(e.enter("codeFlowValue"),function i(r){return null===r||e$(r)?(e.exit("codeFlowValue"),p(r)):(e.consume(r),i)}(i))}function g(r){return e.exit("codeFenced"),i(r)}}},tf={name:"codeIndented",tokenize:function(e,i,r){let n=this;return function(i){return e.enter("codeIndented"),eX(e,s,"linePrefix",5)(i)};function s(i){let s=n.events[n.events.length-1];return s&&"linePrefix"===s[1].type&&s[2].sliceSerialize(s[1],!0).length>=4?function i(r){return null===r?o(r):e$(r)?e.attempt(tp,i,o)(r):(e.enter("codeFlowValue"),function r(n){return null===n||e$(n)?(e.exit("codeFlowValue"),i(n)):(e.consume(n),r)}(r))}(i):r(i)}function o(r){return e.exit("codeIndented"),i(r)}}},tp={partial:!0,tokenize:function(e,i,r){let n=this;return s;function s(i){return n.parser.lazy[n.now().line]?r(i):e$(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s):eX(e,o,"linePrefix",5)(i)}function o(e){let o=n.events[n.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(e):e$(e)?s(e):r(e)}}};function tg(e,i,r,n,s,o,a,l,c){let h=c||1/0,u=0;return function(i){return 60===i?(e.enter(n),e.enter(s),e.enter(o),e.consume(i),e.exit(o),d):null===i||32===i||41===i||ez(i)?r(i):(e.enter(n),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(i))};function d(r){return 62===r?(e.enter(o),e.consume(r),e.exit(o),e.exit(s),e.exit(n),i):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(r))}function f(i){return 62===i?(e.exit("chunkString"),e.exit(l),d(i)):null===i||60===i||e$(i)?r(i):(e.consume(i),92===i?p:f)}function p(i){return 60===i||62===i||92===i?(e.consume(i),f):f(i)}function g(s){return!u&&(null===s||41===s||eU(s))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(n),i(s)):u<h&&40===s?(e.consume(s),u++,g):41===s?(e.consume(s),u--,g):null===s||32===s||40===s||ez(s)?r(s):(e.consume(s),92===s?m:g)}function m(i){return 40===i||41===i||92===i?(e.consume(i),g):g(i)}}function tm(e,i,r,n,s,o){let a,l=this,c=0;return function(i){return e.enter(n),e.enter(s),e.consume(i),e.exit(s),e.enter(o),h};function h(d){return c>999||null===d||91===d||93===d&&!a||94===d&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?r(d):93===d?(e.exit(o),e.enter(s),e.consume(d),e.exit(s),e.exit(n),i):e$(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(i){return null===i||91===i||93===i||e$(i)||c++>999?(e.exit("chunkString"),h(i)):(e.consume(i),a||(a=!eq(i)),92===i?d:u)}function d(i){return 91===i||92===i||93===i?(e.consume(i),c++,u):u(i)}}function t_(e,i,r,n,s,o){let a;return function(i){return 34===i||39===i||40===i?(e.enter(n),e.enter(s),e.consume(i),e.exit(s),a=40===i?41:i,l):r(i)};function l(r){return r===a?(e.enter(s),e.consume(r),e.exit(s),e.exit(n),i):(e.enter(o),c(r))}function c(i){return i===a?(e.exit(o),l(a)):null===i?r(i):e$(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),eX(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(i))}function h(i){return i===a||null===i||e$(i)?(e.exit("chunkString"),c(i)):(e.consume(i),92===i?u:h)}function u(i){return i===a||92===i?(e.consume(i),h):h(i)}}function tv(e,i){let r;return function n(s){return e$(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r=!0,n):eq(s)?eX(e,n,r?"linePrefix":"lineSuffix")(s):i(s)}}function ty(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let tb={partial:!0,tokenize:function(e,i,r){return function(i){return eU(i)?tv(e,n)(i):r(i)};function n(i){return t_(e,s,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function s(i){return eq(i)?eX(e,o,"whitespace")(i):o(i)}function o(e){return null===e||e$(e)?i(e):r(e)}}},tS=["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"],tw=["pre","script","style","textarea"],tx={partial:!0,tokenize:function(e,i,r){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(eQ,i,r)}}},tC={partial:!0,tokenize:function(e,i,r){let n=this;return function(i){return e$(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s):r(i)};function s(e){return n.parser.lazy[n.now().line]?r(e):i(e)}}},tk={name:"labelEnd",resolveAll:function(e){let i=-1,r=[];for(;++i<e.length;){let n=e[i][1];if(r.push(e[i]),"labelImage"===n.type||"labelLink"===n.type||"labelEnd"===n.type){let e="labelImage"===n.type?4:2;n.type="data",i+=e}}return e.length!==r.length&&eP(e,0,e.length,r),e},resolveTo:function(e,i){let r,n,s,o,a=e.length,l=0;for(;a--;)if(r=e[a][1],n){if("link"===r.type||"labelLink"===r.type&&r._inactive)break;"enter"===e[a][0]&&"labelLink"===r.type&&(r._inactive=!0)}else if(s){if("enter"===e[a][0]&&("labelImage"===r.type||"labelLink"===r.type)&&!r._balanced&&(n=a,"labelLink"!==r.type)){l=2;break}}else"labelEnd"===r.type&&(s=a);let c={type:"labelLink"===e[n][1].type?"link":"image",start:{...e[n][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[n][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[n+l+2][1].end},end:{...e[s-2][1].start}};return o=eM(o=[["enter",c,i],["enter",h,i]],e.slice(n+1,n+l+3)),o=eM(o,[["enter",u,i]]),o=eM(o,tr(i.parser.constructs.insideSpan.null,e.slice(n+l+4,s-3),i)),o=eM(o,[["exit",u,i],e[s-2],e[s-1],["exit",h,i]]),o=eM(o,e.slice(s+1)),o=eM(o,[["exit",c,i]]),eP(e,n,e.length,o),e},tokenize:function(e,i,r){let n,s,o=this,a=o.events.length;for(;a--;)if(("labelImage"===o.events[a][1].type||"labelLink"===o.events[a][1].type)&&!o.events[a][1]._balanced){n=o.events[a][1];break}return function(i){return n?n._inactive?u(i):(s=o.parser.defined.includes(ty(o.sliceSerialize({start:n.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelEnd"),l):r(i)};function l(i){return 40===i?e.attempt(tE,h,s?h:u)(i):91===i?e.attempt(tR,h,s?c:u)(i):s?h(i):u(i)}function c(i){return e.attempt(tT,h,u)(i)}function h(e){return i(e)}function u(e){return n._balanced=!0,r(e)}}},tE={tokenize:function(e,i,r){return function(i){return e.enter("resource"),e.enter("resourceMarker"),e.consume(i),e.exit("resourceMarker"),n};function n(i){return eU(i)?tv(e,s)(i):s(i)}function s(i){return 41===i?h(i):tg(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(i)}function o(i){return eU(i)?tv(e,l)(i):h(i)}function a(e){return r(e)}function l(i){return 34===i||39===i||40===i?t_(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(i):h(i)}function c(i){return eU(i)?tv(e,h)(i):h(i)}function h(n){return 41===n?(e.enter("resourceMarker"),e.consume(n),e.exit("resourceMarker"),e.exit("resource"),i):r(n)}}},tR={tokenize:function(e,i,r){let n=this;return function(i){return tm.call(n,e,s,o,"reference","referenceMarker","referenceString")(i)};function s(e){return n.parser.defined.includes(ty(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?i(e):r(e)}function o(e){return r(e)}}},tT={tokenize:function(e,i,r){return function(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),n};function n(n){return 93===n?(e.enter("referenceMarker"),e.consume(n),e.exit("referenceMarker"),e.exit("reference"),i):r(n)}}},tD={name:"labelStartImage",resolveAll:tk.resolveAll,tokenize:function(e,i,r){let n=this;return function(i){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(i),e.exit("labelImageMarker"),s};function s(i){return 91===i?(e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelImage"),o):r(i)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in n.parser.constructs?r(e):i(e)}}},tL={name:"labelStartLink",resolveAll:tk.resolveAll,tokenize:function(e,i,r){let n=this;return function(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),s};function s(e){return 94===e&&"_hiddenFootnoteSupport"in n.parser.constructs?r(e):i(e)}}},tA={name:"lineEnding",tokenize:function(e,i){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),eX(e,i,"linePrefix")}}},tP={name:"thematicBreak",tokenize:function(e,i,r){let n,s=0;return function(o){var a;return e.enter("thematicBreak"),n=a=o,function o(a){return a===n?(e.enter("thematicBreakSequence"),function i(r){return r===n?(e.consume(r),s++,i):(e.exit("thematicBreakSequence"),eq(r)?eX(e,o,"whitespace")(r):o(r))}(a)):s>=3&&(null===a||e$(a))?(e.exit("thematicBreak"),i(a)):r(a)}(a)}}},tM={continuation:{tokenize:function(e,i,r){let n=this;return n.containerState._closeFlow=void 0,e.check(eQ,function(r){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,eX(e,i,"listItemIndent",n.containerState.size+1)(r)},function(r){return n.containerState.furtherBlankLines||!eq(r)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(r)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(tB,i,s)(r))});function s(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,eX(e,e.attempt(tM,i,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,i,r){let n=this,s=n.events[n.events.length-1],o=s&&"linePrefix"===s[1].type?s[2].sliceSerialize(s[1],!0).length:0,a=0;return function(i){let s=n.containerState.type||(42===i||43===i||45===i?"listUnordered":"listOrdered");if("listUnordered"===s?!n.containerState.marker||i===n.containerState.marker:eH(i)){if(n.containerState.type||(n.containerState.type=s,e.enter(s,{_container:!0})),"listUnordered"===s)return e.enter("listItemPrefix"),42===i||45===i?e.check(tP,r,l)(i):l(i);if(!n.interrupt||49===i)return e.enter("listItemPrefix"),e.enter("listItemValue"),function i(s){return eH(s)&&++a<10?(e.consume(s),i):(!n.interrupt||a<2)&&(n.containerState.marker?s===n.containerState.marker:41===s||46===s)?(e.exit("listItemValue"),l(s)):r(s)}(i)}return r(i)};function l(i){return e.enter("listItemMarker"),e.consume(i),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||i,e.check(eQ,n.interrupt?r:c,e.attempt(tO,u,h))}function c(e){return n.containerState.initialBlankLine=!0,o++,u(e)}function h(i){return eq(i)?(e.enter("listItemPrefixWhitespace"),e.consume(i),e.exit("listItemPrefixWhitespace"),u):r(i)}function u(r){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(r)}}},tO={partial:!0,tokenize:function(e,i,r){let n=this;return eX(e,function(e){let s=n.events[n.events.length-1];return!eq(e)&&s&&"listItemPrefixWhitespace"===s[1].type?i(e):r(e)},"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},tB={partial:!0,tokenize:function(e,i,r){let n=this;return eX(e,function(e){let s=n.events[n.events.length-1];return s&&"listItemIndent"===s[1].type&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?i(e):r(e)},"listItemIndent",n.containerState.size+1)}},tN={name:"setextUnderline",resolveTo:function(e,i){let r,n,s,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){r=o;break}"paragraph"===e[o][1].type&&(n=o)}else"content"===e[o][1].type&&e.splice(o,1),s||"definition"!==e[o][1].type||(s=o);let a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[n][1].type="setextHeadingText",s?(e.splice(n,0,["enter",a,i]),e.splice(s+1,0,["exit",e[r][1],i]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,i]),e},tokenize:function(e,i,r){let n,s=this;return function(i){var a;let l,c=s.events.length;for(;c--;)if("lineEnding"!==s.events[c][1].type&&"linePrefix"!==s.events[c][1].type&&"content"!==s.events[c][1].type){l="paragraph"===s.events[c][1].type;break}return!s.parser.lazy[s.now().line]&&(s.interrupt||l)?(e.enter("setextHeadingLine"),n=i,a=i,e.enter("setextHeadingLineSequence"),function i(r){return r===n?(e.consume(r),i):(e.exit("setextHeadingLineSequence"),eq(r)?eX(e,o,"lineSuffix")(r):o(r))}(a)):r(i)};function o(n){return null===n||e$(n)?(e.exit("setextHeadingLine"),i(n)):r(n)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,i,r){let n,s=this;return function(i){var n;return e.enter("definition"),n=i,tm.call(s,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(n)};function o(i){return(n=ty(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),58===i)?(e.enter("definitionMarker"),e.consume(i),e.exit("definitionMarker"),a):r(i)}function a(i){return eU(i)?tv(e,l)(i):l(i)}function l(i){return tg(e,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(i)}function c(i){return e.attempt(tb,h,h)(i)}function h(i){return eq(i)?eX(e,u,"whitespace")(i):u(i)}function u(o){return null===o||e$(o)?(e.exit("definition"),s.parser.defined.push(n),i(o)):r(o)}}}},"disable",0,{null:[]},"document",0,{42:tM,43:tM,45:tM,48:tM,49:tM,50:tM,51:tM,52:tM,53:tM,54:tM,55:tM,56:tM,57:tM,62:to},"flow",0,{35:{name:"headingAtx",resolve:function(e,i){let r,n,s=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),s-2>o&&"whitespace"===e[s][1].type&&(s-=2),"atxHeadingSequence"===e[s][1].type&&(o===s-1||s-4>o&&"whitespace"===e[s-2][1].type)&&(s-=o+1===s?2:4),s>o&&(r={type:"atxHeadingText",start:e[o][1].start,end:e[s][1].end},n={type:"chunkText",start:e[o][1].start,end:e[s][1].end,contentType:"text"},eP(e,o,s-o+1,[["enter",r,i],["enter",n,i],["exit",n,i],["exit",r,i]])),e},tokenize:function(e,i,r){let n=0;return function(s){var o;return e.enter("atxHeading"),o=s,e.enter("atxHeadingSequence"),function s(o){return 35===o&&n++<6?(e.consume(o),s):null===o||eU(o)?(e.exit("atxHeadingSequence"),function r(n){return 35===n?(e.enter("atxHeadingSequence"),function i(n){return 35===n?(e.consume(n),i):(e.exit("atxHeadingSequence"),r(n))}(n)):null===n||e$(n)?(e.exit("atxHeading"),i(n)):eq(n)?eX(e,r,"whitespace")(n):(e.enter("atxHeadingText"),function i(n){return null===n||35===n||eU(n)?(e.exit("atxHeadingText"),r(n)):(e.consume(n),i)}(n))}(o)):r(o)}(o)}}},42:tP,45:[tN,tP],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let i=e.length;for(;i--&&("enter"!==e[i][0]||"htmlFlow"!==e[i][1].type););return i>1&&"linePrefix"===e[i-2][1].type&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e},tokenize:function(e,i,r){let n,s,o,a,l,c=this;return function(i){var r;return r=i,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),h};function h(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),s=!0,p):63===a?(e.consume(a),n=3,c.interrupt?i:M):eN(a)?(e.consume(a),o=String.fromCharCode(a),g):r(a)}function u(s){return 45===s?(e.consume(s),n=2,d):91===s?(e.consume(s),n=5,a=0,f):eN(s)?(e.consume(s),n=4,c.interrupt?i:M):r(s)}function d(n){return 45===n?(e.consume(n),c.interrupt?i:M):r(n)}function f(n){let s="CDATA[";return n===s.charCodeAt(a++)?(e.consume(n),a===s.length)?c.interrupt?i:k:f:r(n)}function p(i){return eN(i)?(e.consume(i),o=String.fromCharCode(i),g):r(i)}function g(a){if(null===a||47===a||62===a||eU(a)){let l=47===a,h=o.toLowerCase();return!l&&!s&&tw.includes(h)?(n=1,c.interrupt?i(a):k(a)):tS.includes(o.toLowerCase())?(n=6,l)?(e.consume(a),m):c.interrupt?i(a):k(a):(n=7,c.interrupt&&!c.parser.lazy[c.now().line]?r(a):s?function i(r){return eq(r)?(e.consume(r),i):x(r)}(a):_(a))}return 45===a||eI(a)?(e.consume(a),o+=String.fromCharCode(a),g):r(a)}function m(n){return 62===n?(e.consume(n),c.interrupt?i:k):r(n)}function _(i){return 47===i?(e.consume(i),x):58===i||95===i||eN(i)?(e.consume(i),v):eq(i)?(e.consume(i),_):x(i)}function v(i){return 45===i||46===i||58===i||95===i||eI(i)?(e.consume(i),v):y(i)}function y(i){return 61===i?(e.consume(i),b):eq(i)?(e.consume(i),y):_(i)}function b(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),l=i,S):eq(i)?(e.consume(i),b):function i(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||eU(r)?y(r):(e.consume(r),i)}(i)}function S(i){return i===l?(e.consume(i),l=null,w):null===i||e$(i)?r(i):(e.consume(i),S)}function w(e){return 47===e||62===e||eq(e)?_(e):r(e)}function x(i){return 62===i?(e.consume(i),C):r(i)}function C(i){return null===i||e$(i)?k(i):eq(i)?(e.consume(i),C):r(i)}function k(i){return 45===i&&2===n?(e.consume(i),D):60===i&&1===n?(e.consume(i),L):62===i&&4===n?(e.consume(i),O):63===i&&3===n?(e.consume(i),M):93===i&&5===n?(e.consume(i),P):e$(i)&&(6===n||7===n)?(e.exit("htmlFlowData"),e.check(tx,B,E)(i)):null===i||e$(i)?(e.exit("htmlFlowData"),E(i)):(e.consume(i),k)}function E(i){return e.check(tC,R,B)(i)}function R(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),T}function T(i){return null===i||e$(i)?E(i):(e.enter("htmlFlowData"),k(i))}function D(i){return 45===i?(e.consume(i),M):k(i)}function L(i){return 47===i?(e.consume(i),o="",A):k(i)}function A(i){if(62===i){let r=o.toLowerCase();return tw.includes(r)?(e.consume(i),O):k(i)}return eN(i)&&o.length<8?(e.consume(i),o+=String.fromCharCode(i),A):k(i)}function P(i){return 93===i?(e.consume(i),M):k(i)}function M(i){return 62===i?(e.consume(i),O):45===i&&2===n?(e.consume(i),M):k(i)}function O(i){return null===i||e$(i)?(e.exit("htmlFlowData"),B(i)):(e.consume(i),O)}function B(r){return e.exit("htmlFlow"),i(r)}}},61:tN,95:tP,96:td,126:td},"flowInitial",0,{[-2]:tf,[-1]:tf,32:tf},"insideSpan",0,{null:[tn,e6]},"string",0,{38:th,92:ta},"text",0,{[-5]:tA,[-4]:tA,[-3]:tA,33:tD,38:th,42:tn,60:[{name:"autolink",tokenize:function(e,i,r){let n=0;return function(i){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s};function s(i){return eN(i)?(e.consume(i),o):64===i?r(i):l(i)}function o(i){return 43===i||45===i||46===i||eI(i)?(n=1,function i(r){return 58===r?(e.consume(r),n=0,a):(43===r||45===r||46===r||eI(r))&&n++<32?(e.consume(r),i):(n=0,l(r))}(i)):l(i)}function a(n){return 62===n?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),i):null===n||32===n||60===n||ez(n)?r(n):(e.consume(n),a)}function l(i){return 64===i?(e.consume(i),c):eF(i)?(e.consume(i),l):r(i)}function c(s){return eI(s)?function s(o){return 46===o?(e.consume(o),n=0,c):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),i):function i(o){if((45===o||eI(o))&&n++<63){let r=45===o?i:s;return e.consume(o),r}return r(o)}(o)}(s):r(s)}}},{name:"htmlText",tokenize:function(e,i,r){let n,s,o,a=this;return function(i){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(i),l};function l(i){return 33===i?(e.consume(i),c):47===i?(e.consume(i),S):63===i?(e.consume(i),y):eN(i)?(e.consume(i),x):r(i)}function c(i){return 45===i?(e.consume(i),h):91===i?(e.consume(i),s=0,p):eN(i)?(e.consume(i),v):r(i)}function h(i){return 45===i?(e.consume(i),f):r(i)}function u(i){return null===i?r(i):45===i?(e.consume(i),d):e$(i)?(o=u,A(i)):(e.consume(i),u)}function d(i){return 45===i?(e.consume(i),f):u(i)}function f(e){return 62===e?L(e):45===e?d(e):u(e)}function p(i){let n="CDATA[";return i===n.charCodeAt(s++)?(e.consume(i),s===n.length?g:p):r(i)}function g(i){return null===i?r(i):93===i?(e.consume(i),m):e$(i)?(o=g,A(i)):(e.consume(i),g)}function m(i){return 93===i?(e.consume(i),_):g(i)}function _(i){return 62===i?L(i):93===i?(e.consume(i),_):g(i)}function v(i){return null===i||62===i?L(i):e$(i)?(o=v,A(i)):(e.consume(i),v)}function y(i){return null===i?r(i):63===i?(e.consume(i),b):e$(i)?(o=y,A(i)):(e.consume(i),y)}function b(e){return 62===e?L(e):y(e)}function S(i){return eN(i)?(e.consume(i),w):r(i)}function w(i){return 45===i||eI(i)?(e.consume(i),w):function i(r){return e$(r)?(o=i,A(r)):eq(r)?(e.consume(r),i):L(r)}(i)}function x(i){return 45===i||eI(i)?(e.consume(i),x):47===i||62===i||eU(i)?C(i):r(i)}function C(i){return 47===i?(e.consume(i),L):58===i||95===i||eN(i)?(e.consume(i),k):e$(i)?(o=C,A(i)):eq(i)?(e.consume(i),C):L(i)}function k(i){return 45===i||46===i||58===i||95===i||eI(i)?(e.consume(i),k):function i(r){return 61===r?(e.consume(r),E):e$(r)?(o=i,A(r)):eq(r)?(e.consume(r),i):C(r)}(i)}function E(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),n=i,R):e$(i)?(o=E,A(i)):eq(i)?(e.consume(i),E):(e.consume(i),T)}function R(i){return i===n?(e.consume(i),n=void 0,D):null===i?r(i):e$(i)?(o=R,A(i)):(e.consume(i),R)}function T(i){return null===i||34===i||39===i||60===i||61===i||96===i?r(i):47===i||62===i||eU(i)?C(i):(e.consume(i),T)}function D(e){return 47===e||62===e||eU(e)?C(e):r(e)}function L(n){return 62===n?(e.consume(n),e.exit("htmlTextData"),e.exit("htmlText"),i):r(n)}function A(i){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),P}function P(i){return eq(i)?eX(e,M,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):M(i)}function M(i){return e.enter("htmlTextData"),o(i)}}}],91:tL,92:[{name:"hardBreakEscape",tokenize:function(e,i,r){return function(i){return e.enter("hardBreakEscape"),e.consume(i),n};function n(n){return e$(n)?(e.exit("hardBreakEscape"),i(n)):r(n)}}},ta],93:tk,95:tn,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let i,r,n=e.length-4,s=3;if(("lineEnding"===e[3][1].type||"space"===e[s][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(i=s;++i<n;)if("codeTextData"===e[i][1].type){e[s][1].type="codeTextPadding",e[n][1].type="codeTextPadding",s+=2,n-=2;break}}for(i=s-1,n++;++i<=n;)void 0===r?i!==n&&"lineEnding"!==e[i][1].type&&(r=i):(i===n||"lineEnding"===e[i][1].type)&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),n-=i-r-2,i=r+2),r=void 0);return e},tokenize:function(e,i,r){let n,s,o=0;return function(i){return e.enter("codeText"),e.enter("codeTextSequence"),function i(r){return 96===r?(e.consume(r),o++,i):(e.exit("codeTextSequence"),a(r))}(i)};function a(c){return null===c?r(c):32===c?(e.enter("space"),e.consume(c),e.exit("space"),a):96===c?(s=e.enter("codeTextSequence"),n=0,function r(a){return 96===a?(e.consume(a),n++,r):n===o?(e.exit("codeTextSequence"),e.exit("codeText"),i(a)):(s.type="codeTextData",l(a))}(c)):e$(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(c))}function l(i){return null===i||32===i||96===i||e$(i)?(e.exit("codeTextData"),a(i)):(e.consume(i),l)}}}}],4127);var tI=e.i(4127);let tF=/[\0\t\n\r]/g;function tz(e,i){let r=Number.parseInt(e,i);return r<9||11===r||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}let tH=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tj(e,i,r){if(i)return i;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),i=120===e||88===e;return tz(r.slice(i?2:1),i?16:10)}return tc(r)||e}let tW={}.hasOwnProperty;function t$(e){return{line:e.line,column:e.column,offset:e.offset}}function tU(e,i){if(e)throw Error("Cannot close `"+e.type+"` ("+ec({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+ec({start:i.start,end:i.end})+") is open");throw Error("Cannot close document, a token (`"+i.type+"`, "+ec({start:i.start,end:i.end})+") is still open")}function tq(e){let i=this;i.parser=function(r){var n,s;let o,a,l,c;return"object"==typeof(n={...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})&&(s=n,n=void 0),(function(e){let i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:n(v),autolinkProtocol:h,autolinkEmail:h,atxHeading:n(g),blockQuote:n(function(){return{type:"blockquote",children:[]}}),characterEscape:h,characterReference:h,codeFenced:n(p),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:n(p,s),codeText:n(function(){return{type:"inlineCode",value:""}},s),codeTextData:h,data:h,codeFlowValue:h,definition:n(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:n(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:n(m),hardBreakTrailing:n(m),htmlFlow:n(_,s),htmlFlowData:h,htmlText:n(_,s),htmlTextData:h,image:n(function(){return{type:"image",title:null,url:"",alt:null}}),label:s,link:n(v),listItem:n(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:n(y,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:n(y),paragraph:n(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:n(g),strong:n(function(){return{type:"strong",children:[]}}),thematicBreak:n(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let i=this.stack[this.stack.length-1];i.depth||(i.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let i,r=this.sliceSerialize(e),n=this.data.characterReferenceType;n?(i=tz(r,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):i=tc(r);let s=this.stack[this.stack.length-1];s.value+=i},characterReference:function(e){this.stack.pop().position.end=t$(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=ty(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],i=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=i},labelText:function(e){let i=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=i.replace(tH,tj),r.identifier=ty(i).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=t$(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(r.type)&&(h.call(this,e),u.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=ty(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(i,r){let n=-1;for(;++n<r.length;){let s=r[n];Array.isArray(s)?e(i,s):function(e,i){let r;for(r in i)if(tW.call(i,r))switch(r){case"canContainEols":{let n=i[r];n&&e[r].push(...n);break}case"transforms":{let n=i[r];n&&e[r].push(...n);break}case"enter":case"exit":{let n=i[r];n&&Object.assign(e[r],n)}}}(i,s)}}(i,(e||{}).mdastExtensions||[]);let r={};return function(e){let n={type:"root",children:[]},a={stack:[n],tokenStack:[],config:i,enter:o,exit:l,buffer:s,resume:c,data:r},h=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?h.push(u):u=function(e,i,r){let n,s,o,a,l=i-1,c=-1,h=!1;for(;++l<=r;){let i=e[l];switch(i[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===i[0]?c++:c--,a=void 0;break;case"lineEndingBlank":"enter"===i[0]&&(!n||a||c||o||(o=l),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!c&&"enter"===i[0]&&"listItemPrefix"===i[1].type||-1===c&&"exit"===i[0]&&("listUnordered"===i[1].type||"listOrdered"===i[1].type)){if(n){let a=l;for(s=void 0;a--;){let i=e[a];if("lineEnding"===i[1].type||"lineEndingBlank"===i[1].type){if("exit"===i[0])continue;s&&(e[s][1].type="lineEndingBlank",h=!0),i[1].type="lineEnding",s=a}else if("linePrefix"===i[1].type||"blockQuotePrefix"===i[1].type||"blockQuotePrefixWhitespace"===i[1].type||"blockQuoteMarker"===i[1].type||"listItemIndent"===i[1].type);else break}o&&(!s||o<s)&&(n._spread=!0),n.end=Object.assign({},s?e[s][1].start:i[1].end),e.splice(s||l,0,["exit",n,i[2]]),l++,r++}if("listItemPrefix"===i[1].type){let s={type:"listItem",_spread:!1,start:Object.assign({},i[1].start),end:void 0};n=s,e.splice(l,0,["enter",s,i[2]]),l++,r++,o=void 0,a=!0}}}return e[i][1]._spread=h,r}(e,h.pop(),u));for(u=-1;++u<e.length;){let r=i[e[u][0]];tW.call(r,e[u][1].type)&&r[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},a),e[u][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||tU).call(a,void 0,e[0])}for(n.position={start:t$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:t$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<i.transforms.length;)n=i.transforms[u](n)||n;return n};function n(e,i){return function(r){o.call(this,e(r),r),i&&i.call(this,r)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(e,i,r){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([i,r||void 0]),e.position={start:t$(i.start),end:void 0}}function a(e){return function(i){e&&e.call(this,i),l.call(this,i)}}function l(e,i){let r=this.stack.pop(),n=this.tokenStack.pop();if(n)n[0].type!==e.type&&(i?i.call(this,e,n[0]):(n[1]||tU).call(this,e,n[0]));else throw Error("Cannot close `"+e.type+"` ("+ec({start:e.start,end:e.end})+"): it’s not open");r.position.end=t$(e.end)}function c(){return eD(this.stack.pop())}function h(e){let i=this.stack[this.stack.length-1].children,r=i[i.length-1];r&&"text"===r.type||((r={type:"text",value:""}).position={start:t$(e.start),end:void 0},i.push(r)),this.stack.push(r)}function u(e){let i=this.stack.pop();i.value+=this.sliceSerialize(e),i.position.end=t$(e.end)}function d(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function g(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function _(){return{type:"html",value:""}}function v(){return{type:"link",title:null,url:"",children:[]}}function y(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(s)(function(e){for(;!e2(e););return e}((function(e){let i={constructs:eB([tI,...(e||{}).extensions||[]]),content:r(eG),defined:[],document:r(eJ),flow:r(e4),lazy:{},string:r(e9),text:r(e8)};return i;function r(e){return function(r){return function(e,i,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},s={},o=[],a=[],l=[],c={attempt:g(function(e,i){m(e,i.from)}),check:g(p),consume:function(e){e$(e)?(n.line++,n.column=1,n.offset+=-3===e?2:1,_()):-1!==e&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===a[n._index].length&&(n._bufferIndex=-1,n._index++)),h.previous=e},enter:function(e,i){let r=i||{};return r.type=e,r.start=f(),h.events.push(["enter",r,h]),l.push(r),r},exit:function(e){let i=l.pop();return i.end=f(),h.events.push(["exit",i,h]),i},interrupt:g(p,{interrupt:!0})},h={code:null,containerState:{},defineSkip:function(e){s[e.line]=e.column,_()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,i){return function(e,i){let r,n=-1,s=[];for(;++n<e.length;){let o,a=e[n];if("string"==typeof a)o=a;else switch(a){case -5:o="\r";break;case -4:o="\n";break;case -3:o="\r\n";break;case -2:o=i?" ":" ";break;case -1:if(!i&&r)continue;o=" ";break;default:o=String.fromCharCode(a)}r=-2===a,s.push(o)}return s.join("")}(d(e),i)},sliceStream:d,write:function(e){return(a=eM(a,e),function(){let e;for(;n._index<a.length;){let r=a[n._index];if("string"==typeof r)for(e=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===e&&n._bufferIndex<r.length;){var i;i=r.charCodeAt(n._bufferIndex),u=u(i)}else u=u(r)}}(),null!==a[a.length-1])?[]:(m(i,0),h.events=tr(o,h.events,h),h.events)}},u=i.tokenize.call(h,c);return i.resolveAll&&o.push(i),h;function d(e){return function(e,i){let r,n=i.start._index,s=i.start._bufferIndex,o=i.end._index,a=i.end._bufferIndex;if(n===o)r=[e[n].slice(s,a)];else{if(r=e.slice(n,o),s>-1){let e=r[0];"string"==typeof e?r[0]=e.slice(s):r.shift()}a>0&&r.push(e[o].slice(0,a))}return r}(a,e)}function f(){let{_bufferIndex:e,_index:i,line:r,column:s,offset:o}=n;return{_bufferIndex:e,_index:i,line:r,column:s,offset:o}}function p(e,i){i.restore()}function g(e,i){return function(r,s,o){var a;let u,d,p,g;return Array.isArray(r)?m(r):"tokenize"in r?m([r]):(a=r,function(e){let i=null!==e&&a[e],r=null!==e&&a.null;return m([...Array.isArray(i)?i:i?[i]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?o:v(e[d])}function v(e){return function(r){let s,o,a,u,d;return(s=f(),o=h.previous,a=h.currentConstruct,u=h.events.length,d=Array.from(l),g={from:u,restore:function(){n=s,h.previous=o,h.currentConstruct=a,h.events.length=u,l=d,_()}},p=e,e.partial||(h.currentConstruct=e),e.name&&h.parser.constructs.disable.null.includes(e.name))?b(r):e.tokenize.call(i?Object.assign(Object.create(h),i):h,c,y,b)(r)}}function y(i){return e(p,g),s}function b(e){return(g.restore(),++d<u.length)?v(u[d]):o}}}function m(e,i){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&eP(h.events,i,h.events.length-i,e.resolve(h.events.slice(i),h)),e.resolveTo&&(h.events=e.resolveTo(h.events,h))}function _(){n.line in s&&n.column<2&&(n.column=s[n.line],n.offset+=s[n.line]-1)}}(i,e,r)}}})(s).document().write((a=1,l="",c=!0,function(e,i,r){let n,s,h,u,d,f=[];for(e=l+("string"==typeof e?e.toString():new TextDecoder(i||void 0).decode(e)),h=0,l="",c&&(65279===e.charCodeAt(0)&&h++,c=void 0);h<e.length;){if(tF.lastIndex=h,u=(n=tF.exec(e))&&void 0!==n.index?n.index:e.length,d=e.charCodeAt(u),!n){l=e.slice(h);break}if(10===d&&h===u&&o)f.push(-3),o=void 0;else switch(o&&(f.push(-5),o=void 0),h<u&&(f.push(e.slice(h,u)),a+=u-h),d){case 0:f.push(65533),a++;break;case 9:for(s=4*Math.ceil(a/4),f.push(-2);a++<s;)f.push(-1);break;case 10:f.push(-4),a=1;break;default:o=!0,a=1}h=u+1}return r&&(o&&f.push(-5),l&&f.push(l),f.push(null)),f})(r,n,!0))))}}let tV="object"==typeof self?self:globalThis,tK=e=>{var i;let r,n;return(i=new Map,r=(e,r)=>(i.set(r,e),e),n=s=>{if(i.has(s))return i.get(s);let[o,a]=e[s];switch(o){case 0:case -1:return r(a,s);case 1:{let e=r([],s);for(let i of a)e.push(n(i));return e}case 2:{let e=r({},s);for(let[i,r]of a)e[n(i)]=n(r);return e}case 3:return r(new Date(a),s);case 4:{let{source:e,flags:i}=a;return r(new RegExp(e,i),s)}case 5:{let e=r(new Map,s);for(let[i,r]of a)e.set(n(i),n(r));return e}case 6:{let e=r(new Set,s);for(let i of a)e.add(n(i));return e}case 7:{let{name:e,message:i}=a;return r(new tV[e](i),s)}case 8:return r(BigInt(a),s);case"BigInt":return r(Object(BigInt(a)),s);case"ArrayBuffer":return r(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return r(new DataView(e),a)}}return r(new tV[o](a),s)})(0)},{toString:tY}={},{keys:tX}=Object,tG=e=>{let i=typeof e;if("object"!==i||!e)return[0,i];let r=tY.call(e).slice(8,-1);switch(r){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},tJ=([e,i])=>0===e&&("function"===i||"symbol"===i),tZ=(e,{json:i,lossy:r}={})=>{var n,s,o;let a,l,c=[];return(n=!(i||r),s=!!i,o=new Map,a=(e,i)=>{let r=c.push(e)-1;return o.set(i,r),r},l=e=>{if(o.has(e))return o.get(e);let[i,r]=tG(e);switch(i){case 0:{let s=e;switch(r){case"bigint":i=8,s=e.toString();break;case"function":case"symbol":if(n)throw TypeError("unable to serialize "+r);s=null;break;case"undefined":return a([-1],e)}return a([i,s],e)}case 1:{if(r){let i=e;return"DataView"===r?i=new Uint8Array(e.buffer):"ArrayBuffer"===r&&(i=new Uint8Array(e)),a([r,[...i]],e)}let n=[],s=a([i,n],e);for(let i of e)n.push(l(i));return s}case 2:{if(r)switch(r){case"BigInt":return a([r,e.toString()],e);case"Boolean":case"Number":case"String":return a([r,e.valueOf()],e)}if(s&&"toJSON"in e)return l(e.toJSON());let o=[],c=a([i,o],e);for(let i of tX(e))(n||!tJ(tG(e[i])))&&o.push([l(i),l(e[i])]);return c}case 3:return a([i,e.toISOString()],e);case 4:{let{source:r,flags:n}=e;return a([i,{source:r,flags:n}],e)}case 5:{let r=[],s=a([i,r],e);for(let[i,s]of e)(n||!(tJ(tG(i))||tJ(tG(s))))&&r.push([l(i),l(s)]);return s}case 6:{let r=[],s=a([i,r],e);for(let i of e)(n||!tJ(tG(i)))&&r.push(l(i));return s}}let{message:c}=e;return a([i,{name:r,message:c}],e)})(e),c},tQ="function"==typeof structuredClone?(e,i)=>i&&("json"in i||"lossy"in i)?tK(tZ(e,i)):structuredClone(e):(e,i)=>tK(tZ(e,i));function t0(e){let i=[],r=-1,n=0,s=0;for(;++r<e.length;){let o=e.charCodeAt(r),a="";if(37===o&&eI(e.charCodeAt(r+1))&&eI(e.charCodeAt(r+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){let i=e.charCodeAt(r+1);o<56320&&i>56319&&i<57344?(a=String.fromCharCode(o,i),s=1):a="�"}else a=String.fromCharCode(o);a&&(i.push(e.slice(n,r),encodeURIComponent(a)),n=r+s+1,a=""),s&&(r+=s,s=0)}return i.join("")+e.slice(n)}function t1(e,i){let r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function t2(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}let t5=function(e){var i,r;if(null==e)return t4;if("function"==typeof e)return t3(e);if("object"==typeof e){return Array.isArray(e)?function(e){let i=[],r=-1;for(;++r<e.length;)i[r]=t5(e[r]);return t3(function(...e){let r=-1;for(;++r<i.length;)if(i[r].apply(this,e))return!0;return!1})}(e):(i=e,t3(function(e){let r;for(r in i)if(e[r]!==i[r])return!1;return!0}))}if("string"==typeof e){return r=e,t3(function(e){return e&&e.type===r})}throw Error("Expected function, string, or object as test")};function t3(e){return function(i,r,n){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(i)&&e.call(this,i,"number"==typeof r?r:void 0,n||void 0))}}function t4(){return!0}let t6=[];function t9(e,i,r,n){let s;"function"==typeof i&&"function"!=typeof r?(n=r,r=i):s=i;let o=t5(s),a=n?-1:1;(function e(s,l,c){let h=s&&"object"==typeof s?s:{};if("string"==typeof h.type){let e="string"==typeof h.tagName?h.tagName:"string"==typeof h.name?h.name:void 0;Object.defineProperty(u,"name",{value:"node ("+s.type+(e?"<"+e+">":"")+")"})}return u;function u(){var h;let u,d,f,p=t6;if((!i||o(s,l,c[c.length-1]||void 0))&&!1===(p=Array.isArray(h=r(s,c))?h:"number"==typeof h?[!0,h]:null==h?t6:[h])[0])return p;if("children"in s&&s.children&&s.children&&"skip"!==p[0])for(d=(n?s.children.length:-1)+a,f=c.concat(s);d>-1&&d<s.children.length;){if(!1===(u=e(s.children[d],d,f)())[0])return u;d="number"==typeof u[1]?u[1]:d+a}return p}})(e,void 0,[])()}function t8(e,i,r,n){let s,o,a;"function"==typeof i&&"function"!=typeof r?(o=void 0,a=i,s=r):(o=i,a=r,s=n),t9(e,o,function(e,i){let r=i[i.length-1],n=r?r.children.indexOf(e):void 0;return a(e,n,r)},s)}function t7(e,i){let r=i.referenceType,n="]";if("collapsed"===r?n+="[]":"full"===r&&(n+="["+(i.label||i.identifier)+"]"),"imageReference"===i.type)return[{type:"text",value:"!["+i.alt+n}];let s=e.all(i),o=s[0];o&&"text"===o.type?o.value="["+o.value:s.unshift({type:"text",value:"["});let a=s[s.length-1];return a&&"text"===a.type?a.value+=n:s.push({type:"text",value:n}),s}function ie(e){let i=e.spread;return null==i?e.children.length>1:i}function it(e,i,r){let n=0,s=e.length;if(i){let i=e.codePointAt(n);for(;9===i||32===i;)n++,i=e.codePointAt(n)}if(r){let i=e.codePointAt(s-1);for(;9===i||32===i;)s--,i=e.codePointAt(s-1)}return s>n?e.slice(n,s):""}let ii={blockquote:function(e,i){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)},break:function(e,i){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:"\n"}]},code:function(e,i){let r=i.value?i.value+"\n":"",n={},s=i.lang?i.lang.split(/\s+/):[];s.length>0&&(n.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return i.meta&&(o.data={meta:i.meta}),e.patch(i,o),o={type:"element",tagName:"pre",properties:{},children:[o=e.applyData(i,o)]},e.patch(i,o),o},delete:function(e,i){let r={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},emphasis:function(e,i){let r={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},footnoteReference:function(e,i){let r,n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",s=String(i.identifier).toUpperCase(),o=t0(s.toLowerCase()),a=e.footnoteOrder.indexOf(s),l=e.footnoteCounts.get(s);void 0===l?(l=0,e.footnoteOrder.push(s),r=e.footnoteOrder.length):r=a+1,l+=1,e.footnoteCounts.set(s,l);let c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(i,c);let h={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(i,h),e.applyData(i,h)},heading:function(e,i){let r={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},html:function(e,i){if(e.options.allowDangerousHtml){let r={type:"raw",value:i.value};return e.patch(i,r),e.applyData(i,r)}},imageReference:function(e,i){let r=String(i.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return t7(e,i);let s={src:t0(n.url||""),alt:i.alt};null!==n.title&&void 0!==n.title&&(s.title=n.title);let o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(i,o),e.applyData(i,o)},image:function(e,i){let r={src:t0(i.url)};null!==i.alt&&void 0!==i.alt&&(r.alt=i.alt),null!==i.title&&void 0!==i.title&&(r.title=i.title);let n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(i,n),e.applyData(i,n)},inlineCode:function(e,i){let r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(i,n),e.applyData(i,n)},linkReference:function(e,i){let r=String(i.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return t7(e,i);let s={href:t0(n.url||"")};null!==n.title&&void 0!==n.title&&(s.title=n.title);let o={type:"element",tagName:"a",properties:s,children:e.all(i)};return e.patch(i,o),e.applyData(i,o)},link:function(e,i){let r={href:t0(i.url)};null!==i.title&&void 0!==i.title&&(r.title=i.title);let n={type:"element",tagName:"a",properties:r,children:e.all(i)};return e.patch(i,n),e.applyData(i,n)},listItem:function(e,i,r){let n=e.all(i),s=r?function(e){let i=!1;if("list"===e.type){i=e.spread||!1;let r=e.children,n=-1;for(;!i&&++n<r.length;)i=ie(r[n])}return i}(r):ie(i),o={},a=[];if("boolean"==typeof i.checked){let e,r=n[0];r&&"element"===r.type&&"p"===r.tagName?e=r:(e={type:"element",tagName:"p",properties:{},children:[]},n.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<n.length;){let e=n[l];(s||0!==l||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||s?a.push(e):a.push(...e.children)}let c=n[n.length-1];c&&(s||"element"!==c.type||"p"!==c.tagName)&&a.push({type:"text",value:"\n"});let h={type:"element",tagName:"li",properties:o,children:a};return e.patch(i,h),e.applyData(i,h)},list:function(e,i){let r={},n=e.all(i),s=-1;for("number"==typeof i.start&&1!==i.start&&(r.start=i.start);++s<n.length;){let e=n[s];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}let o={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(i,o),e.applyData(i,o)},paragraph:function(e,i){let r={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},root:function(e,i){let r={type:"root",children:e.wrap(e.all(i))};return e.patch(i,r),e.applyData(i,r)},strong:function(e,i){let r={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},table:function(e,i){let r=e.all(i),n=r.shift(),s=[];if(n){let r={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(i.children[0],r),s.push(r)}if(r.length>0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=ea(i.children[1]),a=eo(i.children[i.children.length-1]);o&&a&&(n.position={start:o,end:a}),s.push(n)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(i,o),e.applyData(i,o)},tableCell:function(e,i){let r={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},tableRow:function(e,i,r){let n=r?r.children:void 0,s=0===(n?n.indexOf(i):1)?"th":"td",o=r&&"table"===r.type?r.align:void 0,a=o?o.length:i.children.length,l=-1,c=[];for(;++l<a;){let r=i.children[l],n={},a=o?o[l]:void 0;a&&(n.align=a);let h={type:"element",tagName:s,properties:n,children:[]};r&&(h.children=e.all(r),e.patch(r,h),h=e.applyData(r,h)),c.push(h)}let h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(i,h),e.applyData(i,h)},text:function(e,i){let r={type:"text",value:function(e){let i=String(e),r=/\r?\n|\r/g,n=r.exec(i),s=0,o=[];for(;n;)o.push(it(i.slice(s,n.index),s>0,!0),n[0]),s=n.index+n[0].length,n=r.exec(i);return o.push(it(i.slice(s),s>0,!1)),o.join("")}(String(i.value))};return e.patch(i,r),e.applyData(i,r)},thematicBreak:function(e,i){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,r),e.applyData(i,r)},toml:ir,yaml:ir,definition:ir,footnoteDefinition:ir};function ir(){}let is={}.hasOwnProperty,io={};function ia(e,i){e.position&&(i.position=function(e){let i=ea(e),r=eo(e);if(i&&r)return{start:i,end:r}}(e))}function il(e,i){let r=i;if(e&&e.data){let i=e.data.hName,n=e.data.hChildren,s=e.data.hProperties;"string"==typeof i&&("element"===r.type?r.tagName=i:r={type:"element",tagName:i,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&s&&Object.assign(r.properties,tQ(s)),"children"in r&&r.children&&null!=n&&(r.children=n)}return r}function ic(e,i){let r=[],n=-1;for(i&&r.push({type:"text",value:"\n"});++n<e.length;)n&&r.push({type:"text",value:"\n"}),r.push(e[n]);return i&&e.length>0&&r.push({type:"text",value:"\n"}),r}function ih(e){let i=0,r=e.charCodeAt(i);for(;9===r||32===r;)i++,r=e.charCodeAt(i);return e.slice(i)}function iu(e,i){let r,n,s,o,a=(r=i||io,n=new Map,s=new Map,o={all:function(e){let i=[];if("children"in e){let r=e.children,n=-1;for(;++n<r.length;){let s=o.one(r[n],e);if(s){if(n&&"break"===r[n-1].type&&(Array.isArray(s)||"text"!==s.type||(s.value=ih(s.value)),!Array.isArray(s)&&"element"===s.type)){let e=s.children[0];e&&"text"===e.type&&(e.value=ih(e.value))}Array.isArray(s)?i.push(...s):i.push(s)}}}return i},applyData:il,definitionById:n,footnoteById:s,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ii,...r.handlers},one:function(e,i){let r=e.type,n=o.handlers[r];if(is.call(o.handlers,r)&&n)return n(o,e,i);if(o.options.passThrough&&o.options.passThrough.includes(r)){if("children"in e){let{children:i,...r}=e,n=tQ(r);return n.children=o.all(e),n}return tQ(e)}return(o.options.unknownHandler||function(e,i){let r=i.data||{},n="value"in i&&!(is.call(r,"hProperties")||is.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,n),e.applyData(i,n)})(o,e,i)},options:r,patch:ia,wrap:ic},t8(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let i="definition"===e.type?n:s,r=String(e.identifier).toUpperCase();i.has(r)||i.set(r,e)}}),o),l=a.one(e,void 0),c=function(e){let i="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||t1,n=e.options.footnoteBackLabel||t2,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[],c=-1;for(;++c<e.footnoteOrder.length;){let s=e.footnoteById.get(e.footnoteOrder[c]);if(!s)continue;let o=e.all(s),a=String(s.identifier).toUpperCase(),h=t0(a.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++u<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof r?r:r(c,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+h+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof n?n:n(c,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...d)}else o.push(...d);let g={type:"element",tagName:"li",properties:{id:i+"fn-"+h},children:e.wrap(o,!0)};e.patch(s,g),l.push(g)}if(0!==l.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...tQ(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:"\n"}]}}(a),h=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return c&&(v("children"in h),h.children.push({type:"text",value:"\n"},c)),h}function id(e,i){return e&&"run"in e?async function(r,n){let s=iu(r,{file:n,...i});await e.run(s,n)}:function(r,n){return iu(r,{file:n,...e||i})}}function ip(e){if(e)throw e}var ig=e.i(4100);function im(e){if("object"!=typeof e||null===e)return!1;let i=Object.getPrototypeOf(e);return(null===i||i===Object.prototype||null===Object.getPrototypeOf(i))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let i_=function(e,i){let r;if(void 0!==i&&"string"!=typeof i)throw TypeError('"ext" argument must be a string');iS(e);let n=0,s=-1,o=e.length;if(void 0===i||0===i.length||i.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(r){n=o+1;break}}else s<0&&(r=!0,s=o+1);return s<0?"":e.slice(n,s)}if(i===e)return"";let a=-1,l=i.length-1;for(;o--;)if(47===e.codePointAt(o)){if(r){n=o+1;break}}else a<0&&(r=!0,a=o+1),l>-1&&(e.codePointAt(o)===i.codePointAt(l--)?l<0&&(s=o):(l=-1,s=a));return n===s?s=a:s<0&&(s=e.length),e.slice(n,s)},iv=function(e){let i;if(iS(e),0===e.length)return".";let r=-1,n=e.length;for(;--n;)if(47===e.codePointAt(n)){if(i){r=n;break}}else i||(i=!0);return r<0?47===e.codePointAt(0)?"/":".":1===r&&47===e.codePointAt(0)?"//":e.slice(0,r)},iy=function(e){let i;iS(e);let r=e.length,n=-1,s=0,o=-1,a=0;for(;r--;){let l=e.codePointAt(r);if(47===l){if(i){s=r+1;break}continue}n<0&&(i=!0,n=r+1),46===l?o<0?o=r:1!==a&&(a=1):o>-1&&(a=-1)}return o<0||n<0||0===a||1===a&&o===n-1&&o===s+1?"":e.slice(o,n)},ib=function(...e){var i;let r,n,s,o=-1;for(;++o<e.length;)iS(e[o]),e[o]&&(s=void 0===s?e[o]:s+"/"+e[o]);return void 0===s?".":(iS(i=s),r=47===i.codePointAt(0),0!==(n=function(e,i){let r,n,s="",o=0,a=-1,l=0,c=-1;for(;++c<=e.length;){if(c<e.length)r=e.codePointAt(c);else if(47===r)break;else r=47;if(47===r){if(a===c-1||1===l);else if(a!==c-1&&2===l){if(s.length<2||2!==o||46!==s.codePointAt(s.length-1)||46!==s.codePointAt(s.length-2)){if(s.length>2){if((n=s.lastIndexOf("/"))!==s.length-1){n<0?(s="",o=0):o=(s=s.slice(0,n)).length-1-s.lastIndexOf("/"),a=c,l=0;continue}}else if(s.length>0){s="",o=0,a=c,l=0;continue}}i&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+e.slice(a+1,c):s=e.slice(a+1,c),o=c-a-1;a=c,l=0}else 46===r&&l>-1?l++:l=-1}return s}(i,!r)).length||r||(n="."),n.length>0&&47===i.codePointAt(i.length-1)&&(n+="/"),r?"/"+n:n)};function iS(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function iw(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let ix=["history","path","basename","stem","extname","dirname"];class iC{constructor(e){let i,r;i=e?iw(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in i?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<ix.length;){const e=ix[n];e in i&&void 0!==i[e]&&null!==i[e]&&(this[e]="history"===e?[...i[e]]:i[e])}for(r in i)ix.includes(r)||(this[r]=i[r])}get basename(){return"string"==typeof this.path?i_(this.path):void 0}set basename(e){iE(e,"basename"),ik(e,"basename"),this.path=ib(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?iv(this.path):void 0}set dirname(e){iR(this.basename,"dirname"),this.path=ib(e||"",this.basename)}get extname(){return"string"==typeof this.path?iy(this.path):void 0}set extname(e){if(ik(e,"extname"),iR(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=ib(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){iw(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!iw(e)){let i=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let i=e.pathname,r=-1;for(;++r<i.length;)if(37===i.codePointAt(r)&&50===i.codePointAt(r+1)){let e=i.codePointAt(r+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(i)}(e)}(e)),iE(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?i_(this.path,this.extname):void 0}set stem(e){iE(e,"stem"),ik(e,"stem"),this.path=ib(this.dirname||"",e+(this.extname||""))}fail(e,i,r){let n=this.message(e,i,r);throw n.fatal=!0,n}info(e,i,r){let n=this.message(e,i,r);return n.fatal=void 0,n}message(e,i,r){let n=new ef(e,i,r);return this.path&&(n.name=this.path+":"+n.name,n.file=this.path),n.fatal=!1,this.messages.push(n),n}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function ik(e,i){if(e&&e.includes("/"))throw Error("`"+i+"` cannot be a path: did not expect `/`")}function iE(e,i){if(!e)throw Error("`"+i+"` cannot be empty")}function iR(e,i){if(!e)throw Error("Setting `"+i+"` requires `path` to be set too")}let iT=function(e){let i=this.constructor.prototype,r=i[e],n=function(){return r.apply(n,arguments)};return Object.setPrototypeOf(n,i),n},iD={}.hasOwnProperty;class iL extends iT{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=function(){let e=[],i={run:function(...i){let r=-1,n=i.pop();if("function"!=typeof n)throw TypeError("Expected function as last argument, not "+n);!function s(o,...a){let l=e[++r],c=-1;if(o)return void n(o);for(;++c<i.length;)(null===a[c]||void 0===a[c])&&(a[c]=i[c]);i=a,l?(function(e,i){let r;return function(...i){let o,a=e.length>i.length;a&&i.push(n);try{o=e.apply(this,i)}catch(e){if(a&&r)throw e;return n(e)}a||(o&&o.then&&"function"==typeof o.then?o.then(s,n):o instanceof Error?n(o):s(o))};function n(e,...s){r||(r=!0,i(e,...s))}function s(e){n(null,e)}})(l,s)(...a):n(null,...a)}(null,...i)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),i}};return i}()}copy(){let e=new iL,i=-1;for(;++i<this.attachers.length;){let r=this.attachers[i];e.use(...r)}return e.data((0,ig.default)(!0,{},this.namespace)),e}data(e,i){return"string"==typeof e?2==arguments.length?(iO("data",this.frozen),this.namespace[e]=i,this):iD.call(this.namespace,e)&&this.namespace[e]||void 0:e?(iO("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...i]=this.attachers[this.freezeIndex];if(!1===i[0])continue;!0===i[0]&&(i[0]=void 0);let r=e.call(this,...i);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let i=iI(e),r=this.parser||this.Parser;return iP("parse",r),r(String(i),i)}process(e,i){let r=this;return this.freeze(),iP("process",this.parser||this.Parser),iM("process",this.compiler||this.Compiler),i?n(void 0,i):new Promise(n);function n(n,s){let o=iI(e),a=r.parse(o);function l(e,r){e||!r?s(e):n?n(r):(v(i,"`done` is defined if `resolve` is not"),i(void 0,r))}r.run(a,o,function(e,i,n){var s,o;if(e||!i||!n)return l(e);let a=r.stringify(i,n);"string"==typeof(s=a)||(o=s)&&"object"==typeof o&&"byteLength"in o&&"byteOffset"in o?n.value=a:n.result=a,l(e,n)})}}processSync(e){let i,r=!1;return this.freeze(),iP("processSync",this.parser||this.Parser),iM("processSync",this.compiler||this.Compiler),this.process(e,function(e,n){r=!0,ip(e),i=n}),iN("processSync","process",r),v(i,"we either bailed on an error or have a tree"),i}run(e,i,r){iB(e),this.freeze();let n=this.transformers;return r||"function"!=typeof i||(r=i,i=void 0),r?s(void 0,r):new Promise(s);function s(s,o){v("function"!=typeof i,"`file` can’t be a `done` anymore, we checked");let a=iI(i);n.run(e,a,function(i,n,a){let l=n||e;i?o(i):s?s(l):(v(r,"`done` is defined if `resolve` is not"),r(void 0,l,a))})}}runSync(e,i){let r,n=!1;return this.run(e,i,function(e,i){ip(e),r=i,n=!0}),iN("runSync","run",n),v(r,"we either bailed on an error or have a tree"),r}stringify(e,i){this.freeze();let r=iI(i),n=this.compiler||this.Compiler;return iM("stringify",n),iB(e),n(e,r)}use(e,...i){let r=this.attachers,n=this.namespace;if(iO("use",this.frozen),null==e);else if("function"==typeof e)a(e,i);else if("object"==typeof e)Array.isArray(e)?o(e):s(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function s(e){if(!("plugins"in e)&&!("settings"in e))throw 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");o(e.plugins),e.settings&&(n.settings=(0,ig.default)(!0,n.settings,e.settings))}function o(e){let i=-1;if(null==e);else if(Array.isArray(e))for(;++i<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[i,...r]=e;a(i,r)}else s(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[i]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,i){let n=-1,s=-1;for(;++n<r.length;)if(r[n][0]===e){s=n;break}if(-1===s)r.push([e,...i]);else if(i.length>0){let[n,...o]=i,a=r[s][1];im(a)&&im(n)&&(n=(0,ig.default)(!0,a,n)),r[s]=[e,n,...o]}}}}let iA=new iL().freeze();function iP(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `parser`")}function iM(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `compiler`")}function iO(e,i){if(i)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function iB(e){if(!im(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function iN(e,i,r){if(!r)throw Error("`"+e+"` finished async. Use `"+i+"` instead")}function iI(e){var i;return(i=e)&&"object"==typeof i&&"message"in i&&"messages"in i?e:new iC(e)}let iF=[],iz={allowDangerousHtml:!0},iH=/^(https?|ircs?|mailto|xmpp)$/i,ij=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function iW(e){var i;let r,n,s,o,a,l=(r=(i=e).rehypePlugins||iF,n=i.remarkPlugins||iF,s=i.remarkRehypeOptions?{...i.remarkRehypeOptions,...iz}:iz,iA().use(tq).use(n).use(id,s).use(r)),c=(o=e.children||"",a=new iC,"string"==typeof o?a.value=o:y("Unexpected value `"+o+"` for `children` prop, expected `string`"),a);return function(e,i){let r=i.allowedElements,n=i.allowElement,s=i.components,o=i.disallowedElements,a=i.skipHtml,l=i.unwrapDisallowed,c=i.urlTransform||i$;for(let e of ij)Object.hasOwn(i,e.from)&&y("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&o&&y("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),t8(e,function(e,i,s){if("raw"===e.type&&s&&"number"==typeof i)return a?s.children.splice(i,1):s.children[i]={type:"text",value:e.value},i;if("element"===e.type){let i;for(i in eR)if(Object.hasOwn(eR,i)&&Object.hasOwn(e.properties,i)){let r=e.properties[i],n=eR[i];(null===n||n.includes(e.tagName))&&(e.properties[i]=c(String(r||""),i,e))}}if("element"===e.type){let a=r?!r.includes(e.tagName):!!o&&o.includes(e.tagName);if(!a&&n&&"number"==typeof i&&(a=!n(e,i,s)),a&&s&&"number"==typeof i)return l&&e.children?s.children.splice(i,1,...e.children):s.children.splice(i,1),i}}),function(e,i){var r,n,s,o;let a;if(!i||void 0===i.Fragment)throw TypeError("Expected `Fragment` in options");let l=i.filePath||void 0;if(i.development){if("function"!=typeof i.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=l,n=i.jsxDEV,a=function(e,i,s,o){let a=Array.isArray(s.children),l=ea(e);return n(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:r,lineNumber:l?l.line:void 0},void 0)}}else{if("function"!=typeof i.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof i.jsxs)throw TypeError("Expected `jsxs` in production options");s=i.jsx,o=i.jsxs,a=function(e,i,r,n){let a=Array.isArray(r.children)?o:s;return n?a(i,r,n):a(i,r)}}let c={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:a,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:!1!==i.passKeys,passNode:i.passNode||!1,schema:"svg"===i.space?en:er,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==i.tableCellAlignToStyle},h=eb(c,e,void 0);return h&&"string"!=typeof h?h:c.create(e,c.Fragment,{children:h||void 0},void 0)}(e,{Fragment:g.Fragment,components:s,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0})}(l.runSync(l.parse(c),c),e)}function i$(e){let i=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),s=e.indexOf("/");return -1===i||-1!==s&&i>s||-1!==r&&i>r||-1!==n&&i>n||iH.test(e.slice(0,i))?e:""}function iU(e,i){let r=String(e);if("string"!=typeof i)throw TypeError("Expected character");let n=0,s=r.indexOf(i);for(;-1!==s;)n++,s=r.indexOf(i,s+i.length);return n}let iq="phrasing",iV=["autolink","link","image","label"];function iK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function iY(e){this.config.enter.autolinkProtocol.call(this,e)}function iX(e){this.config.exit.autolinkProtocol.call(this,e)}function iG(e){this.config.exit.data.call(this,e);let i=this.stack[this.stack.length-1];v("link"===i.type),i.url="http://"+this.sliceSerialize(e)}function iJ(e){this.config.exit.autolinkEmail.call(this,e)}function iZ(e){this.exit(e)}function iQ(e){!function(e,i,r){let n=t5((r||{}).ignore||[]),s=function(e){let i=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let r=!e[0]||Array.isArray(e[0])?e:[e],n=-1;for(;++n<r.length;){var s;let e=r[n];i.push(["string"==typeof(s=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(s),"g"):s,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return i}(i),o=-1;for(;++o<s.length;)t9(e,"text",a);function a(e,i){let r,a=-1;for(;++a<i.length;){let e=i[a],s=r?r.children:void 0;if(n(e,s?s.indexOf(e):void 0,r))return;r=e}if(r)return function(e,i){let r=i[i.length-1],n=s[o][0],a=s[o][1],l=0,c=r.children.indexOf(e),h=!1,u=[];n.lastIndex=0;let d=n.exec(e.value);for(;d;){let r=d.index,s={index:d.index,input:d.input,stack:[...i,e]},o=a(...d,s);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?n.lastIndex=r+1:(l!==r&&u.push({type:"text",value:e.value.slice(l,r)}),Array.isArray(o)?u.push(...o):o&&u.push(o),l=r+d[0].length,h=!0),!n.global)break;d=n.exec(e.value)}return h?(l<e.value.length&&u.push({type:"text",value:e.value.slice(l)}),r.children.splice(c,1,...u)):u=[e],c+u.length}(e,i)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,i0],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,i1]],{ignore:["link","linkReference"]})}function i0(e,i,r,n,s){let o,a="";if(!i2(s))return!1;if(/^w/i.test(i)&&(r=i+r,i="",a="http://"),(o=r.split(".")).length<2||o[o.length-1]&&(/_/.test(o[o.length-1])||!/[a-zA-Z\d]/.test(o[o.length-1]))||o[o.length-2]&&(/_/.test(o[o.length-2])||!/[a-zA-Z\d]/.test(o[o.length-2])))return!1;let l=function(e){let i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let r=i[0],n=r.indexOf(")"),s=iU(e,"("),o=iU(e,")");for(;-1!==n&&s>o;)e+=r.slice(0,n+1),n=(r=r.slice(n+1)).indexOf(")"),o++;return[e,r]}(r+n);if(!l[0])return!1;let c={type:"link",title:null,url:a+i+l[0],children:[{type:"text",value:i+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function i1(e,i,r,n){return!(!i2(n,!0)||/[-\d_]$/.test(r))&&{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r}]}}function i2(e,i){let r=e.input.charCodeAt(e.index-1);return(0===e.index||eK(r)||eV(r))&&(!i||47!==r)}function i5(){this.buffer()}function i3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function i4(){this.buffer()}function i6(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function i9(e){let i=this.resume(),r=this.stack[this.stack.length-1];v("footnoteReference"===r.type),r.identifier=ty(this.sliceSerialize(e)).toLowerCase(),r.label=i}function i8(e){this.exit(e)}function i7(e){let i=this.resume(),r=this.stack[this.stack.length-1];v("footnoteDefinition"===r.type),r.identifier=ty(this.sliceSerialize(e)).toLowerCase(),r.label=i}function re(e){this.exit(e)}function rt(e,i,r,n){let s=r.createTracker(n),o=s.move("[^"),a=r.enter("footnoteReference"),l=r.enter("reference");return o+=s.move(r.safe(r.associationId(e),{after:"]",before:o})),l(),a(),o+=s.move("]")}function ri(e,i,r){return 0===i?e:rr(e,i,r)}function rr(e,i,r){return(r?"":" ")+e}rt.peek=function(){return"["};let rn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function rs(e){this.enter({type:"delete",children:[]},e)}function ro(e){this.exit(e)}function ra(e,i,r,n){let s=r.createTracker(n),o=r.enter("strikethrough"),a=s.move("~~");return a+=r.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),o(),a}function rl(e){return e.length}function rc(e){let i="string"==typeof e?e.codePointAt(0):0;return 67===i||99===i?99:76===i||108===i?108:114*(82===i||114===i)}ra.peek=function(){return"~"};function rh(e,i,r){let n=e.value||"",s="`",o=-1;for(;RegExp("(^|[^`])"+s+"([^`]|$)").test(n);)s+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<r.unsafe.length;){let e,i=r.unsafe[o],s=r.compilePattern(i);if(i.atBreak)for(;e=s.exec(n);){let i=e.index;10===n.charCodeAt(i)&&13===n.charCodeAt(i-1)&&i--,n=n.slice(0,i)+" "+n.slice(e.index+1)}}return s+n+s}rh.peek=function(){return"`"};t5(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let ru=function(e,i,r,n){let s=function(e){let i=e.options.listItemIndent||"one";if("tab"!==i&&"one"!==i&&"mixed"!==i)throw Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}(r),o=r.bulletCurrent||function(e){let i=e.options.bullet||"*";if("*"!==i&&"+"!==i&&"-"!==i)throw Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}(r);i&&"list"===i.type&&i.ordered&&(o=("number"==typeof i.start&&i.start>-1?i.start:1)+(!1===r.options.incrementListMarker?0:i.children.indexOf(e))+o);let a=o.length+1;("tab"===s||"mixed"===s&&(i&&"list"===i.type&&i.spread||e.spread))&&(a=4*Math.ceil(a/4));let l=r.createTracker(n);l.move(o+" ".repeat(a-o.length)),l.shift(a);let c=r.enter("listItem"),h=r.indentLines(r.containerFlow(e,l.current()),function(e,i,r){return i?(r?"":" ".repeat(a))+e:(r?o:o+" ".repeat(a-o.length))+e});return c(),h};function rd(e){let i=e._align;v(i,"expected `_align` on table"),this.enter({type:"table",align:i.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function rf(e){this.exit(e),this.data.inTable=void 0}function rp(e){this.enter({type:"tableRow",children:[]},e)}function rg(e){this.exit(e)}function rm(e){this.enter({type:"tableCell",children:[]},e)}function r_(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,rv));let r=this.stack[this.stack.length-1];v("inlineCode"===r.type),r.value=i,this.exit(e)}function rv(e,i){return"|"===i?i:e}function ry(e){let i=this.stack[this.stack.length-2];v("listItem"===i.type),i.checked="taskListCheckValueChecked"===e.type}function rb(e){let i=this.stack[this.stack.length-2];if(i&&"listItem"===i.type&&"boolean"==typeof i.checked){let e=this.stack[this.stack.length-1];v("paragraph"===e.type);let r=e.children[0];if(r&&"text"===r.type){let n,s=i.children,o=-1;for(;++o<s.length;){let e=s[o];if("paragraph"===e.type){n=e;break}}n===e&&(r.value=r.value.slice(1),0===r.value.length?e.children.shift():e.position&&r.position&&"number"==typeof r.position.start.offset&&(r.position.start.column++,r.position.start.offset++,e.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function rS(e,i,r,n){let s=e.children[0],o="boolean"==typeof e.checked&&s&&"paragraph"===s.type,a="["+(e.checked?"x":" ")+"] ",l=r.createTracker(n);o&&l.move(a);let c=ru(e,i,r,{...n,...l.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),c}let rw={tokenize:function(e,i,r){let n=0;return function i(o){return(87===o||119===o)&&n<3?(n++,e.consume(o),i):46===o&&3===n?(e.consume(o),s):r(o)};function s(e){return null===e?r(e):i(e)}},partial:!0},rx={tokenize:function(e,i,r){let n,s,o;return a;function a(i){return 46===i||95===i?e.check(rk,c,l)(i):null===i||eU(i)||eK(i)||45!==i&&eV(i)?c(i):(o=!0,e.consume(i),a)}function l(i){return 95===i?n=!0:(s=n,n=void 0),e.consume(i),a}function c(e){return s||n||!o?r(e):i(e)}},partial:!0},rC={tokenize:function(e,i){let r=0,n=0;return s;function s(a){return 40===a?(r++,e.consume(a),s):41===a&&n<r?o(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(rk,i,o)(a):null===a||eU(a)||eK(a)?i(a):(e.consume(a),s)}function o(i){return 41===i&&n++,e.consume(i),s}},partial:!0},rk={tokenize:function(e,i,r){return n;function n(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),n):38===a?(e.consume(a),o):93===a?(e.consume(a),s):60===a||null===a||eU(a)||eK(a)?i(a):r(a)}function s(e){return null===e||40===e||91===e||eU(e)||eK(e)?i(e):n(e)}function o(i){return eN(i)?function i(s){return 59===s?(e.consume(s),n):eN(s)?(e.consume(s),i):r(s)}(i):r(i)}},partial:!0},rE={tokenize:function(e,i,r){return function(i){return e.consume(i),n};function n(e){return eI(e)?r(e):i(e)}},partial:!0},rR={name:"wwwAutolink",tokenize:function(e,i,r){let n=this;return function(i){return 87!==i&&119!==i||!rP.call(n,n.previous)||rN(n.events)?r(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rw,e.attempt(rx,e.attempt(rC,s),r),r)(i))};function s(r){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(r)}},previous:rP},rT={name:"protocolAutolink",tokenize:function(e,i,r){let n=this,s="",o=!1;return function(i){return(72===i||104===i)&&rM.call(n,n.previous)&&!rN(n.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(i),e.consume(i),a):r(i)};function a(i){if(eN(i)&&s.length<5)return s+=String.fromCodePoint(i),e.consume(i),a;if(58===i){let r=s.toLowerCase();if("http"===r||"https"===r)return e.consume(i),l}return r(i)}function l(i){return 47===i?(e.consume(i),o)?c:(o=!0,l):r(i)}function c(i){return null===i||ez(i)||eU(i)||eK(i)||eV(i)?r(i):e.attempt(rx,e.attempt(rC,h),r)(i)}function h(r){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(r)}},previous:rM},rD={name:"emailAutolink",tokenize:function(e,i,r){let n,s,o=this;return function(i){return!rB(i)||!rO.call(o,o.previous)||rN(o.events)?r(i):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function i(n){return rB(n)?(e.consume(n),i):64===n?(e.consume(n),a):r(n)}(i))};function a(i){return 46===i?e.check(rE,c,l)(i):45===i||95===i||eI(i)?(s=!0,e.consume(i),a):c(i)}function l(i){return e.consume(i),n=!0,a}function c(a){return s&&n&&eN(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(a)):r(a)}},previous:rO},rL={},rA=48;for(;rA<123;)rL[rA]=rD,58==++rA?rA=65:91===rA&&(rA=97);function rP(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||eU(e)}function rM(e){return!eN(e)}function rO(e){return!(47===e||rB(e))}function rB(e){return 43===e||45===e||46===e||95===e||eI(e)}function rN(e){let i=e.length,r=!1;for(;i--;){let n=e[i][1];if(("labelLink"===n.type||"labelImage"===n.type)&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}rL[43]=rD,rL[45]=rD,rL[46]=rD,rL[95]=rD,rL[72]=[rD,rT],rL[104]=[rD,rT],rL[87]=[rD,rR],rL[119]=[rD,rR];let rI={tokenize:function(e,i,r){let n=this;return eX(e,function(e){let s=n.events[n.events.length-1];return s&&"gfmFootnoteDefinitionIndent"===s[1].type&&4===s[2].sliceSerialize(s[1],!0).length?i(e):r(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function rF(e,i,r){let n,s=this,o=s.events.length,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);for(;o--;){let e=s.events[o][1];if("labelImage"===e.type){n=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!n||!n._balanced)return r(o);let l=ty(s.sliceSerialize({start:n.end,end:s.now()}));return 94===l.codePointAt(0)&&a.includes(l.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),i(o)):r(o)}}function rz(e,i){let r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";let n={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},l=[e[r+1],e[r+2],["enter",n,i],e[r+3],e[r+4],["enter",s,i],["exit",s,i],["enter",o,i],["enter",a,i],["exit",a,i],["exit",o,i],e[e.length-2],e[e.length-1],["exit",n,i]];return e.splice(r,e.length-r+1,...l),e}function rH(e,i,r){let n,s=this,o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]),a=0;return function(i){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(i),e.exit("gfmFootnoteCallLabelMarker"),l};function l(i){return 94!==i?r(i):(e.enter("gfmFootnoteCallMarker"),e.consume(i),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(l){if(a>999||93===l&&!n||null===l||91===l||eU(l))return r(l);if(93===l){e.exit("chunkString");let n=e.exit("gfmFootnoteCallString");return o.includes(ty(s.sliceSerialize(n)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):r(l)}return eU(l)||(n=!0),a++,e.consume(l),92===l?h:c}function h(i){return 91===i||92===i||93===i?(e.consume(i),a++,c):c(i)}}function rj(e,i,r){let n,s,o=this,a=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),l=0;return function(i){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(i),e.exit("gfmFootnoteDefinitionLabelMarker"),c};function c(i){return 94===i?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(i),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):r(i)}function h(i){if(l>999||93===i&&!s||null===i||91===i||eU(i))return r(i);if(93===i){e.exit("chunkString");let r=e.exit("gfmFootnoteDefinitionLabelString");return n=ty(o.sliceSerialize(r)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(i),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return eU(i)||(s=!0),l++,e.consume(i),92===i?u:h}function u(i){return 91===i||92===i||93===i?(e.consume(i),l++,h):h(i)}function d(i){return 58===i?(e.enter("definitionMarker"),e.consume(i),e.exit("definitionMarker"),a.includes(n)||a.push(n),eX(e,f,"gfmFootnoteDefinitionWhitespace")):r(i)}function f(e){return i(e)}}function rW(e,i,r){return e.check(eQ,i,e.attempt(rI,i,r))}function r$(e){e.exit("gfmFootnoteDefinition")}class rU{constructor(){this.map=[]}add(e,i,r){!function(e,i,r,n){let s=0;if(0!==r||0!==n.length){for(;s<e.map.length;){if(e.map[s][0]===i){e.map[s][1]+=r,e.map[s][2].push(...n);return}s+=1}e.map.push([i,r,n])}}(this,e,i,r)}consume(e){if(this.map.sort(function(e,i){return e[0]-i[0]}),0===this.map.length)return;let i=this.map.length,r=[];for(;i>0;)i-=1,r.push(e.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),e.length=this.map[i][0];r.push(e.slice()),e.length=0;let n=r.pop();for(;n;){for(let i of n)e.push(i);n=r.pop()}this.map.length=0}}function rq(e,i,r){let n,s=this,o=0,a=0;return function(e){let i=s.events.length-1;for(;i>-1;){let e=s.events[i][1].type;if("lineEnding"===e||"linePrefix"===e)i--;else break}let n=i>-1?s.events[i][1].type:null,o="tableHead"===n||"tableRow"===n?y:l;return o===y&&s.parser.lazy[s.now().line]?r(e):o(e)};function l(i){var r;return e.enter("tableHead"),e.enter("tableRow"),124===(r=i)||(n=!0,a+=1),c(r)}function c(i){return null===i?r(i):e$(i)?a>1?(a=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),d):r(i):eq(i)?eX(e,c,"whitespace")(i):(a+=1,n&&(n=!1,o+=1),124===i)?(e.enter("tableCellDivider"),e.consume(i),e.exit("tableCellDivider"),n=!0,c):(e.enter("data"),h(i))}function h(i){return null===i||124===i||eU(i)?(e.exit("data"),c(i)):(e.consume(i),92===i?u:h)}function u(i){return 92===i||124===i?(e.consume(i),h):h(i)}function d(i){return(s.interrupt=!1,s.parser.lazy[s.now().line])?r(i):(e.enter("tableDelimiterRow"),n=!1,eq(i))?eX(e,f,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):f(i)}function f(i){return 45===i||58===i?g(i):124===i?(n=!0,e.enter("tableCellDivider"),e.consume(i),e.exit("tableCellDivider"),p):r(i)}function p(i){return eq(i)?eX(e,g,"whitespace")(i):g(i)}function g(i){return 58===i?(a+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(i),e.exit("tableDelimiterMarker"),m):45===i?(a+=1,m(i)):null===i||e$(i)?v(i):r(i)}function m(i){return 45===i?(e.enter("tableDelimiterFiller"),function i(r){return 45===r?(e.consume(r),i):58===r?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(r),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(r))}(i)):r(i)}function _(i){return eq(i)?eX(e,v,"whitespace")(i):v(i)}function v(s){if(124===s)return f(s);if(null===s||e$(s))return n&&o===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(s)):r(s);return r(s)}function y(i){return e.enter("tableRow"),b(i)}function b(r){return 124===r?(e.enter("tableCellDivider"),e.consume(r),e.exit("tableCellDivider"),b):null===r||e$(r)?(e.exit("tableRow"),i(r)):eq(r)?eX(e,b,"whitespace")(r):(e.enter("data"),S(r))}function S(i){return null===i||124===i||eU(i)?(e.exit("data"),b(i)):(e.consume(i),92===i?w:S)}function w(i){return 92===i||124===i?(e.consume(i),S):S(i)}}function rV(e,i){let r,n,s,o=-1,a=!0,l=0,c=[0,0,0,0],h=[0,0,0,0],u=!1,d=0,f=new rU;for(;++o<e.length;){let p=e[o],g=p[1];"enter"===p[0]?"tableHead"===g.type?(u=!1,0!==d&&(rY(f,i,d,r,n),n=void 0,d=0),r={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",r,i]])):"tableRow"===g.type||"tableDelimiterRow"===g.type?(a=!0,s=void 0,c=[0,0,0,0],h=[0,o+1,0,0],u&&(u=!1,n={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(o,0,[["enter",n,i]])),l="tableDelimiterRow"===g.type?2:n?3:1):l&&("data"===g.type||"tableDelimiterMarker"===g.type||"tableDelimiterFiller"===g.type)?(a=!1,0===h[2]&&(0!==c[1]&&(h[0]=h[1],s=rK(f,i,c,l,void 0,s),c=[0,0,0,0]),h[2]=o)):"tableCellDivider"===g.type&&(a?a=!1:(0!==c[1]&&(h[0]=h[1],s=rK(f,i,c,l,void 0,s)),h=[(c=h)[1],o,0,0])):"tableHead"===g.type?(u=!0,d=o):"tableRow"===g.type||"tableDelimiterRow"===g.type?(d=o,0!==c[1]?(h[0]=h[1],s=rK(f,i,c,l,o,s)):0!==h[1]&&(s=rK(f,i,h,l,o,s)),l=0):l&&("data"===g.type||"tableDelimiterMarker"===g.type||"tableDelimiterFiller"===g.type)&&(h[3]=o)}for(0!==d&&rY(f,i,d,r,n),f.consume(i.events),o=-1;++o<i.events.length;){let e=i.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,i){let r=!1,n=[];for(;i<e.length;){let s=e[i];if(r){if("enter"===s[0])"tableContent"===s[1].type&&n.push("tableDelimiterMarker"===e[i+1][1].type?"left":"none");else if("tableContent"===s[1].type){if("tableDelimiterMarker"===e[i-1][1].type){let e=n.length-1;n[e]="left"===n[e]?"center":"right"}}else if("tableDelimiterRow"===s[1].type)break}else"enter"===s[0]&&"tableDelimiterRow"===s[1].type&&(r=!0);i+=1}return n}(i.events,o))}return e}function rK(e,i,r,n,s,o){0!==r[0]&&(o.end=Object.assign({},rX(i.events,r[0])),e.add(r[0],0,[["exit",o,i]]));let a=rX(i.events,r[1]);if(o={type:1===n?"tableHeader":2===n?"tableDelimiter":"tableData",start:Object.assign({},a),end:Object.assign({},a)},e.add(r[1],0,[["enter",o,i]]),0!==r[2]){let s=rX(i.events,r[2]),o=rX(i.events,r[3]),a={type:"tableContent",start:Object.assign({},s),end:Object.assign({},o)};if(e.add(r[2],0,[["enter",a,i]]),2!==n){let n=i.events[r[2]],s=i.events[r[3]];if(n[1].end=Object.assign({},s[1].end),n[1].type="chunkText",n[1].contentType="text",r[3]>r[2]+1){let i=r[2]+1,n=r[3]-r[2]-1;e.add(i,n,[])}}e.add(r[3]+1,0,[["exit",a,i]])}return void 0!==s&&(o.end=Object.assign({},rX(i.events,s)),e.add(s,0,[["exit",o,i]]),o=void 0),o}function rY(e,i,r,n,s){let o=[],a=rX(i.events,r);s&&(s.end=Object.assign({},a),o.push(["exit",s,i])),n.end=Object.assign({},a),o.push(["exit",n,i]),e.add(r+1,0,o)}function rX(e,i){let r=e[i],n="enter"===r[0]?"start":"end";return r[1][n]}let rG={name:"tasklistCheck",tokenize:function(e,i,r){let n=this;return function(i){return null===n.previous&&n._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(i),e.exit("taskListCheckMarker"),s):r(i)};function s(i){return eU(i)?(e.enter("taskListCheckValueUnchecked"),e.consume(i),e.exit("taskListCheckValueUnchecked"),o):88===i||120===i?(e.enter("taskListCheckValueChecked"),e.consume(i),e.exit("taskListCheckValueChecked"),o):r(i)}function o(i){return 93===i?(e.enter("taskListCheckMarker"),e.consume(i),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(i)}function a(n){return e$(n)?i(n):eq(n)?e.check({tokenize:rJ},i,r)(n):r(n)}}};function rJ(e,i,r){return eX(e,function(e){return null===e?r(e):i(e)},"whitespace")}let rZ={};function rQ(e){let i,r,n,s=e||rZ,o=this.data(),a=o.micromarkExtensions||(o.micromarkExtensions=[]),l=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),c=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);a.push(eB([{text:rL},{document:{91:{name:"gfmFootnoteDefinition",tokenize:rj,continuation:{tokenize:rW},exit:r$}},text:{91:{name:"gfmFootnoteCall",tokenize:rH},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rF,resolveTo:rz}}},(i=(s||{}).singleTilde,r={name:"strikethrough",tokenize:function(e,r,n){let s=this.previous,o=this.events,a=0;return function(l){return 126===s&&"characterEscape"!==o[o.length-1][1].type?n(l):(e.enter("strikethroughSequenceTemporary"),function o(l){let c=ti(s);if(126===l)return a>1?n(l):(e.consume(l),a++,o);if(a<2&&!i)return n(l);let h=e.exit("strikethroughSequenceTemporary"),u=ti(l);return h._open=!u||2===u&&!!c,h._close=!c||2===c&&!!u,r(l)}(l))}},resolveAll:function(e,i){let r=-1;for(;++r<e.length;)if("enter"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._close){let n=r;for(;n--;)if("exit"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._open&&e[r][1].end.offset-e[r][1].start.offset==e[n][1].end.offset-e[n][1].start.offset){e[r][1].type="strikethroughSequence",e[n][1].type="strikethroughSequence";let s={type:"strikethrough",start:Object.assign({},e[n][1].start),end:Object.assign({},e[r][1].end)},o={type:"strikethroughText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[r][1].start)},a=[["enter",s,i],["enter",e[n][1],i],["exit",e[n][1],i],["enter",o,i]],l=i.parser.constructs.insideSpan.null;l&&eP(a,a.length,0,tr(l,e.slice(n+1,r),i)),eP(a,a.length,0,[["exit",o,i],["enter",e[r][1],i],["exit",e[r][1],i],["exit",s,i]]),eP(e,n-1,r-n+3,a),r=n+a.length-2;break}}for(r=-1;++r<e.length;)"strikethroughSequenceTemporary"===e[r][1].type&&(e[r][1].type="data");return e}},null==i&&(i=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:rq,resolveAll:rV}}},{text:{91:rG}}])),l.push([{transforms:[iQ],enter:{literalAutolink:iK,literalAutolinkEmail:iY,literalAutolinkHttp:iY,literalAutolinkWww:iY},exit:{literalAutolink:iZ,literalAutolinkEmail:iJ,literalAutolinkHttp:iX,literalAutolinkWww:iG}},{enter:{gfmFootnoteCallString:i5,gfmFootnoteCall:i3,gfmFootnoteDefinitionLabelString:i4,gfmFootnoteDefinition:i6},exit:{gfmFootnoteCallString:i9,gfmFootnoteCall:i8,gfmFootnoteDefinitionLabelString:i7,gfmFootnoteDefinition:re}},{canContainEols:["delete"],enter:{strikethrough:rs},exit:{strikethrough:ro}},{enter:{table:rd,tableData:rm,tableHeader:rm,tableRow:rp},exit:{codeText:r_,table:rf,tableData:rg,tableHeader:rg,tableRow:rg}},{exit:{taskListCheckValueChecked:ry,taskListCheckValueUnchecked:ry,paragraph:rb}}]),c.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:iq,notInConstruct:iV},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:iq,notInConstruct:iV},{character:":",before:"[ps]",after:"\\/",inConstruct:iq,notInConstruct:iV}]},(n=!1,s&&s.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:function(e,i,r,s){let o=r.createTracker(s),a=o.move("[^"),l=r.enter("footnoteDefinition"),c=r.enter("label");return a+=o.move(r.safe(r.associationId(e),{before:a,after:"]"})),c(),a+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),a+=o.move((n?"\n":" ")+r.indentLines(r.containerFlow(e,o.current()),n?rr:ri))),l(),a},footnoteReference:rt},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rn}],handlers:{delete:ra}},function(e){let i=e||{},r=i.tableCellPadding,n=i.tablePipeAlign,s=i.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,i,r){let n=rh(e,i,r);return r.stack.includes("tableCell")&&(n=n.replace(/\|/g,"\\$&")),n},table:function(e,i,r,n){return l(function(e,i,r){let n=e.children,s=-1,o=[],a=i.enter("table");for(;++s<n.length;)o[s]=c(n[s],i,r);return a(),o}(e,r,n),e.align)},tableCell:a,tableRow:function(e,i,r,n){let s=l([c(e,r,n)]);return s.slice(0,s.indexOf("\n"))}}};function a(e,i,r,n){let s=r.enter("tableCell"),a=r.enter("phrasing"),l=r.containerPhrasing(e,{...n,before:o,after:o});return a(),s(),l}function l(e,i){return function(e,i){let r=i||{},n=(r.align||[]).concat(),s=r.stringLength||rl,o=[],a=[],l=[],c=[],h=0,u=-1;for(;++u<e.length;){let i=[],n=[],o=-1;for(e[u].length>h&&(h=e[u].length);++o<e[u].length;){var d;let a=null==(d=e[u][o])?"":String(d);if(!1!==r.alignDelimiters){let e=s(a);n[o]=e,(void 0===c[o]||e>c[o])&&(c[o]=e)}i.push(a)}a[u]=i,l[u]=n}let f=-1;if("object"==typeof n&&"length"in n)for(;++f<h;)o[f]=rc(n[f]);else{let e=rc(n);for(;++f<h;)o[f]=e}f=-1;let p=[],g=[];for(;++f<h;){let e=o[f],i="",n="";99===e?(i=":",n=":"):108===e?i=":":114===e&&(n=":");let s=!1===r.alignDelimiters?1:Math.max(1,c[f]-i.length-n.length),a=i+"-".repeat(s)+n;!1!==r.alignDelimiters&&((s=i.length+s+n.length)>c[f]&&(c[f]=s),g[f]=s),p[f]=a}a.splice(1,0,p),l.splice(1,0,g),u=-1;let m=[];for(;++u<a.length;){let e=a[u],i=l[u];f=-1;let n=[];for(;++f<h;){let s=e[f]||"",a="",l="";if(!1!==r.alignDelimiters){let e=c[f]-(i[f]||0),r=o[f];114===r?a=" ".repeat(e):99===r?e%2?(a=" ".repeat(e/2+.5),l=" ".repeat(e/2-.5)):l=a=" ".repeat(e/2):l=" ".repeat(e)}!1===r.delimiterStart||f||n.push("|"),!1!==r.padding&&(!1!==r.alignDelimiters||""!==s)&&(!1!==r.delimiterStart||f)&&n.push(" "),!1!==r.alignDelimiters&&n.push(a),n.push(s),!1!==r.alignDelimiters&&n.push(l),!1!==r.padding&&n.push(" "),(!1!==r.delimiterEnd||f!==h-1)&&n.push("|")}m.push(!1===r.delimiterEnd?n.join("").replace(/ +$/,""):n.join(""))}return m.join("\n")}(e,{align:i,alignDelimiters:n,padding:r,stringLength:s})}function c(e,i,r){let n=e.children,s=-1,o=[],l=i.enter("tableRow");for(;++s<n.length;)o[s]=a(n[s],e,i,r);return l(),o}}(s),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rS}}]})}var r0=e.i(75254);let r1=(0,r0.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),r2=(0,r0.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r2],74886);var r5=e.i(43531),r3=e.i(85902);function r4({language:e,code:i,children:r}){let[n,s]=(0,m.useState)(!1),o=async()=>{try{await navigator.clipboard.writeText(i),s(!0),setTimeout(()=>s(!1),2e3)}catch(e){console.error("Failed to copy code:",e)}};return(0,g.jsxs)("div",{className:"relative group",children:[(0,g.jsx)(r3.Button,{variant:"ghost",size:"icon-sm",onClick:o,className:"absolute top-2 right-2 opacity-80 hover:opacity-100",title:n?"Copied!":"Copy code","aria-label":n?"Copied to clipboard":"Copy code to clipboard",children:n?(0,g.jsx)(r5.Check,{className:"w-4 h-4 text-success"}):(0,g.jsx)(r2,{className:"w-4 h-4 text-foreground"})}),(0,g.jsx)("pre",{children:(0,g.jsx)("code",{className:e?`language-${e}`:"",children:r})})]})}var r6=e.i(44917),r9=e.i(60948),r8=e.i(3262);e.i(31360),e.i(9003),e.i(60884),e.i(88147),e.i(11338);var r7=e.i(9796),ne=e.i(29432),nt=e.i(96977),ni=e.i(71206),nr=e.i(40524);e.i(47716);var nn=e.i(23685),ns="comm",no="rule",na="decl",nl=Math.abs,nc=String.fromCharCode;function nh(e,i,r){return e.replace(i,r)}function nu(e,i){return 0|e.charCodeAt(i)}function nd(e,i,r){return e.slice(i,r)}function nf(e){return e.length}function np(e,i){return i.push(e),e}var ng=1,nm=1,n_=0,nv=0,ny=0,nb="";function nS(e,i,r,n,s,o,a,l){return{value:e,root:i,parent:r,type:n,props:s,children:o,line:ng,column:nm,length:a,return:"",siblings:l}}function nw(){return ny=nv<n_?nu(nb,nv++):0,nm++,10===ny&&(nm=1,ng++),ny}function nx(){return nu(nb,nv)}function nC(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function nk(e){var i,r;return(i=nv-1,r=function e(i){for(;nw();)switch(ny){case i:return nv;case 34:case 39:34!==i&&39!==i&&e(ny);break;case 40:41===i&&e(i);break;case 92:nw()}return nv}(91===e?e+2:40===e?e+1:e),nd(nb,i,r)).trim()}function nE(e,i,r,n,s,o,a,l,c,h,u,d){for(var f=s-1,p=0===s?o:[""],g=p.length,m=0,_=0,v=0;m<n;++m)for(var y=0,b=nd(e,f+1,f=nl(_=a[m])),S=e;y<g;++y)(S=(_>0?p[y]+" "+b:nh(b,/&\f/g,p[y])).trim())&&(c[v++]=S);return nS(e,i,r,0===s?no:l,c,h,u,d)}function nR(e,i,r,n,s){return nS(e,i,r,na,nd(e,0,n),nd(e,n+1,-1),n,s)}function nT(e,i){for(var r="",n=0;n<e.length;n++)r+=i(e[n],n,e,i)||"";return r}function nD(e,i,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case na:return e.return=e.return||e.value;case ns:return"";case"@keyframes":return e.return=e.value+"{"+nT(e.children,n)+"}";case no:if(!nf(e.value=e.props.join(",")))return""}return nf(r=nT(e.children,n))?e.return=e.value+"{"+r+"}":""}var nL=e.i(24154),nA=e.i(41241),nP={id:"c4",detector:(0,ni.__name)(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),loader:(0,ni.__name)(async()=>{let{diagram:i}=await e.A(78997);return{id:"c4",diagram:i}},"loader")},nM="flowchart",nO=(0,ni.__name)((e,i)=>i?.flowchart?.defaultRenderer!=="dagre-wrapper"&&i?.flowchart?.defaultRenderer!=="elk"&&/^\s*graph/.test(e),"detector"),nB=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(28146);return{id:nM,diagram:i}},"loader"),nN={id:nM,detector:nO,loader:nB},nI="flowchart-v2",nF=(0,ni.__name)((e,i)=>i?.flowchart?.defaultRenderer!=="dagre-d3"&&(i?.flowchart?.defaultRenderer==="elk"&&(i.layout="elk"),!!/^\s*graph/.test(e)&&i?.flowchart?.defaultRenderer==="dagre-wrapper"||/^\s*flowchart/.test(e)),"detector"),nz=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(28146);return{id:nI,diagram:i}},"loader"),nH={id:nI,detector:nF,loader:nz},nj={id:"er",detector:(0,ni.__name)(e=>/^\s*erDiagram/.test(e),"detector"),loader:(0,ni.__name)(async()=>{let{diagram:i}=await e.A(80472);return{id:"er",diagram:i}},"loader")},nW="gitGraph",n$=(0,ni.__name)(e=>/^\s*gitGraph/.test(e),"detector"),nU=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(83305);return{id:nW,diagram:i}},"loader"),nq={id:nW,detector:n$,loader:nU},nV="gantt",nK=(0,ni.__name)(e=>/^\s*gantt/.test(e),"detector"),nY=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(34606);return{id:nV,diagram:i}},"loader"),nX={id:nV,detector:nK,loader:nY},nG="info",nJ=(0,ni.__name)(e=>/^\s*info/.test(e),"detector"),nZ=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(23526);return{id:nG,diagram:i}},"loader"),nQ={id:nG,detector:nJ,loader:nZ},n0={id:"pie",detector:(0,ni.__name)(e=>/^\s*pie/.test(e),"detector"),loader:(0,ni.__name)(async()=>{let{diagram:i}=await e.A(3931);return{id:"pie",diagram:i}},"loader")},n1="quadrantChart",n2=(0,ni.__name)(e=>/^\s*quadrantChart/.test(e),"detector"),n5=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(67051);return{id:n1,diagram:i}},"loader"),n3={id:n1,detector:n2,loader:n5},n4="xychart",n6=(0,ni.__name)(e=>/^\s*xychart(-beta)?/.test(e),"detector"),n9=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(36080);return{id:n4,diagram:i}},"loader"),n8={id:n4,detector:n6,loader:n9},n7="requirement",se=(0,ni.__name)(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),st=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(3156);return{id:n7,diagram:i}},"loader"),si={id:n7,detector:se,loader:st},sr="sequence",sn=(0,ni.__name)(e=>/^\s*sequenceDiagram/.test(e),"detector"),ss=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(71209);return{id:sr,diagram:i}},"loader"),so={id:sr,detector:sn,loader:ss},sa="class",sl=(0,ni.__name)((e,i)=>i?.class?.defaultRenderer!=="dagre-wrapper"&&/^\s*classDiagram/.test(e),"detector"),sc=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(78922);return{id:sa,diagram:i}},"loader"),sh={id:sa,detector:sl,loader:sc},su="classDiagram",sd=(0,ni.__name)((e,i)=>!!/^\s*classDiagram/.test(e)&&i?.class?.defaultRenderer==="dagre-wrapper"||/^\s*classDiagram-v2/.test(e),"detector"),sf=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(10404);return{id:su,diagram:i}},"loader"),sp={id:su,detector:sd,loader:sf},sg="state",sm=(0,ni.__name)((e,i)=>i?.state?.defaultRenderer!=="dagre-wrapper"&&/^\s*stateDiagram/.test(e),"detector"),s_=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(81283);return{id:sg,diagram:i}},"loader"),sv={id:sg,detector:sm,loader:s_},sy="stateDiagram",sb=(0,ni.__name)((e,i)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&i?.state?.defaultRenderer==="dagre-wrapper"),"detector"),sS=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(41605);return{id:sy,diagram:i}},"loader"),sw={id:sy,detector:sb,loader:sS},sx="journey",sC=(0,ni.__name)(e=>/^\s*journey/.test(e),"detector"),sk=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(78877);return{id:sx,diagram:i}},"loader"),sE={id:sx,detector:sC,loader:sk},sR={draw:(0,ni.__name)((e,i,r)=>{ni.log.debug("rendering svg for syntax error\n");let n=(0,r6.selectSvgElement)(i),s=n.append("g");n.attr("viewBox","0 0 2412 512"),(0,nt.configureSvgSize)(n,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw")},sT={db:{},renderer:sR,parser:{parse:(0,ni.__name)(()=>{},"parse")}},sD="flowchart-elk",sL=(0,ni.__name)((e,i={})=>!!(/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&i?.flowchart?.defaultRenderer==="elk")&&(i.layout="elk",!0),"detector"),sA=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(28146);return{id:sD,diagram:i}},"loader"),sP={id:sD,detector:sL,loader:sA},sM="timeline",sO=(0,ni.__name)(e=>/^\s*timeline/.test(e),"detector"),sB=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(27415);return{id:sM,diagram:i}},"loader"),sN={id:sM,detector:sO,loader:sB},sI="mindmap",sF=(0,ni.__name)(e=>/^\s*mindmap/.test(e),"detector"),sz=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(44319);return{id:sI,diagram:i}},"loader"),sH={id:sI,detector:sF,loader:sz},sj="kanban",sW=(0,ni.__name)(e=>/^\s*kanban/.test(e),"detector"),s$=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(31376);return{id:sj,diagram:i}},"loader"),sU={id:sj,detector:sW,loader:s$},sq="sankey",sV=(0,ni.__name)(e=>/^\s*sankey(-beta)?/.test(e),"detector"),sK=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(34215);return{id:sq,diagram:i}},"loader"),sY={id:sq,detector:sV,loader:sK},sX="packet",sG=(0,ni.__name)(e=>/^\s*packet(-beta)?/.test(e),"detector"),sJ=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(11980);return{id:sX,diagram:i}},"loader"),sZ={id:sX,detector:sG,loader:sJ},sQ="radar",s0=(0,ni.__name)(e=>/^\s*radar-beta/.test(e),"detector"),s1=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(70234);return{id:sQ,diagram:i}},"loader"),s2={id:sQ,detector:s0,loader:s1},s5="block",s3=(0,ni.__name)(e=>/^\s*block(-beta)?/.test(e),"detector"),s4=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(44243);return{id:s5,diagram:i}},"loader"),s6={id:s5,detector:s3,loader:s4},s9="treeView",s8=(0,ni.__name)(e=>/^\s*treeView-beta/.test(e),"detector"),s7=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(51365);return{id:s9,diagram:i}},"loader"),oe={id:s9,detector:s8,loader:s7},ot="architecture",oi=(0,ni.__name)(e=>/^\s*architecture/.test(e),"detector"),or=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(46201);return{id:ot,diagram:i}},"loader"),on={id:ot,detector:oi,loader:or},os="ishikawa",oo=(0,ni.__name)(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),oa=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(48926);return{id:os,diagram:i}},"loader"),ol={id:os,detector:oo,loader:oa},oc="venn",oh=(0,ni.__name)(e=>/^\s*venn-beta/.test(e),"detector"),ou=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(81291);return{id:oc,diagram:i}},"loader"),od={id:oc,detector:oh,loader:ou},of="treemap",op=(0,ni.__name)(e=>/^\s*treemap/.test(e),"detector"),og=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(31656);return{id:of,diagram:i}},"loader"),om={id:of,detector:op,loader:og},o_="wardley-beta",ov=(0,ni.__name)(e=>/^\s*wardley-beta/i.test(e),"detector"),oy=(0,ni.__name)(async()=>{let{diagram:i}=await e.A(22654);return{id:o_,diagram:i}},"loader"),ob={id:o_,detector:ov,loader:oy},oS=!1,ow=(0,ni.__name)(()=>{oS||(oS=!0,(0,nt.registerDiagram)("error",sT,e=>"error"===e.toLowerCase().trim()),(0,nt.registerDiagram)("---",{db:{clear:(0,ni.__name)(()=>{},"clear")},styles:{},renderer:{draw:(0,ni.__name)(()=>{},"draw")},parser:{parse:(0,ni.__name)(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:(0,ni.__name)(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),(0,nt.registerLazyLoadedDiagrams)(sP,sH,on),(0,nt.registerLazyLoadedDiagrams)(nP,sU,sp,sh,nj,nX,nQ,n0,si,so,nH,nN,sN,nq,sw,sv,sE,n3,sY,sZ,n8,s6,oe,s2,ol,om,od,ob))},"addDiagrams"),ox=(0,ni.__name)(async()=>{ni.log.debug("Loading registered diagrams");let e=(await Promise.allSettled(Object.entries(nt.detectors).map(async([e,{detector:i,loader:r}])=>{if(r)try{(0,nt.getDiagram)(e)}catch{try{let{diagram:e,id:n}=await r();(0,nt.registerDiagram)(n,e,i)}catch(i){throw ni.log.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete nt.detectors[e],i}}}))).filter(e=>"rejected"===e.status);if(e.length>0){for(let i of(ni.log.error(`Failed to load ${e.length} external diagrams`),e))ni.log.error(i);throw Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams");function oC(e,i){e.attr("role","graphics-document document"),""!==i&&e.attr("aria-roledescription",i)}function ok(e,i,r,n){if(void 0!==e.insert){if(r){let i=`chart-desc-${n}`;e.attr("aria-describedby",i),e.insert("desc",":first-child").attr("id",i).text(r)}if(i){let r=`chart-title-${n}`;e.attr("aria-labelledby",r),e.insert("title",":first-child").attr("id",r).text(i)}}}(0,ni.__name)(oC,"setA11yDiagramInfo"),(0,ni.__name)(ok,"addSVGa11yTitleDescription");var oE=class e{constructor(e,i,r,n,s){this.type=e,this.text=i,this.db=r,this.parser=n,this.renderer=s}static{(0,ni.__name)(this,"Diagram")}static async fromText(i,r={}){let n=(0,nt.getConfig)(),s=(0,nt.detectType)(i,n);i=(0,ne.encodeEntities)(i)+"\n";try{(0,nt.getDiagram)(s)}catch{let e=(0,nt.getDiagramLoader)(s);if(!e)throw new nt.UnknownDiagramError(`Diagram ${s} not found.`);let{id:i,diagram:r}=await e();(0,nt.registerDiagram)(i,r)}let{db:o,parser:a,renderer:l,init:c}=(0,nt.getDiagram)(s);return a.parser&&(a.parser.yy=o),o.clear?.(),c?.(n),r.title&&o.setDiagramTitle?.(r.title),await a.parse(i),new e(s,i,o,a,l)}async render(e,i){await this.renderer.draw(this.text,e,i,this)}getParser(){return this.parser}getType(){return this.type}},oR=[],oT=(0,ni.__name)(()=>{oR.forEach(e=>{e()}),oR=[]},"attachFunctions"),oD=(0,ni.__name)(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function oL(e){let i=e.match(nt.frontMatterRegex);if(!i)return{text:e,metadata:{}};let r=(0,r9.load)(i[1],{schema:r9.JSON_SCHEMA})??{};r="object"!=typeof r||Array.isArray(r)?{}:r;let n={};return r.displayMode&&(n.displayMode=r.displayMode.toString()),r.title&&(n.title=r.title.toString()),r.config&&(n.config=r.config),{text:e.slice(i[0].length),metadata:n}}(0,ni.__name)(oL,"extractFrontMatter");var oA=(0,ni.__name)(e=>e.replace(/\r\n?/g,"\n").replace(/<(\w+)([^>]*)>/g,(e,i,r)=>"<"+i+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),oP=(0,ni.__name)(e=>{let{text:i,metadata:r}=oL(e),{displayMode:n,title:s,config:o={}}=r;return n&&(o.gantt||(o.gantt={}),o.gantt.displayMode=n),{title:s,config:o,text:i}},"processFrontmatter"),oM=(0,ni.__name)(e=>{let i=ne.utils_default.detectInit(e)??{},r=ne.utils_default.detectDirective(e,"wrap");return Array.isArray(r)?i.wrap=r.some(({type:e})=>"wrap"===e):r?.type==="wrap"&&(i.wrap=!0),{text:(0,ne.removeDirectives)(e),directive:i}},"processDirectives");function oO(e){let i=oP(oA(e)),r=oM(i.text),n=(0,ne.cleanAndMerge)(i.config,r.directive);return{code:e=oD(r.text),title:i.title,config:n}}function oB(e){return btoa(Array.from(new TextEncoder().encode(e),e=>String.fromCodePoint(e)).join(""))}(0,ni.__name)(oO,"preprocessDiagram"),(0,ni.__name)(oB,"toBase64");var oN=["foreignobject"],oI=["dominant-baseline"];function oF(e){let i=oO(e);return(0,nt.reset)(),(0,nt.addDirective)(i.config??{}),i}async function oz(e,i){ow();try{let{code:i,config:r}=oF(e);return{diagramType:(await oG(i)).type,config:r}}catch(e){if(i?.suppressErrors)return!1;throw e}}(0,ni.__name)(oF,"processAndSetConfigs"),(0,ni.__name)(oz,"parse");var oH=(0,ni.__name)((e,i,r=[])=>`
|
|
2
|
-
.${e} ${i} { ${r.join(" !important; ")} !important; }`,"cssImportantStyles"),oj=(0,ni.__name)((e,i=new Map)=>{let r="";if(void 0!==e.themeCSS&&(r+=`
|
|
3
|
-
${e.themeCSS}`),void 0!==e.fontFamily&&(r+=`
|
|
4
|
-
:root { --mermaid-font-family: ${e.fontFamily}}`),void 0!==e.altFontFamily&&(r+=`
|
|
5
|
-
:root { --mermaid-alt-font-family: ${e.altFontFamily}}`),i instanceof Map){let n=(0,nt.getEffectiveHtmlLabels)(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];i.forEach(e=>{(0,nA.default)(e.styles)||n.forEach(i=>{r+=oH(e.id,i,e.styles)}),(0,nA.default)(e.textStyles)||(r+=oH(e.id,"tspan",(e?.textStyles||[]).map(e=>e.replace("color","fill"))))})}return r},"createCssStyles"),oW=(0,ni.__name)((e,i,r,n)=>{var s,o,a;let l=oj(e,r),c=(0,nt.styles_default)(i,l,{...e.themeVariables,theme:e.theme,look:e.look},n);return nT((a=function e(i,r,n,s,o,a,l,c,h){for(var u,d,f,p,g,m,_=0,v=0,y=l,b=0,S=0,w=0,x=1,C=1,k=1,E=0,R="",T=o,D=a,L=s,A=R;C;)switch(w=E,E=nw()){case 40:if(108!=w&&58==nu(A,y-1)){-1!=(g=A+=nh(nk(E),"&","&\f"),m=nl(_?c[_-1]:0),g.indexOf("&\f",m))&&(k=-1);break}case 34:case 39:case 91:A+=nk(E);break;case 9:case 10:case 13:case 32:A+=function(e){for(;ny=nx();)if(ny<33)nw();else break;return nC(e)>2||nC(ny)>3?"":" "}(w);break;case 92:A+=function(e,i){for(var r;--i&&nw()&&!(ny<48)&&!(ny>102)&&(!(ny>57)||!(ny<65))&&(!(ny>70)||!(ny<97)););return r=nv+(i<6&&32==nx()&&32==nw()),nd(nb,e,r)}(nv-1,7);continue;case 47:switch(nx()){case 42:case 47:np((u=function(e,i){for(;nw();)if(e+ny===57)break;else if(e+ny===84&&47===nx())break;return"/*"+nd(nb,i,nv-1)+"*"+nc(47===e?e:nw())}(nw(),nv),d=r,f=n,p=h,nS(u,d,f,ns,nc(ny),nd(u,2,-2),0,p)),h),(5==nC(w||1)||5==nC(nx()||1))&&nf(A)&&" "!==nd(A,-1,void 0)&&(A+=" ");break;default:A+="/"}break;case 123*x:c[_++]=nf(A)*k;case 125*x:case 59:case 0:switch(E){case 0:case 125:C=0;case 59+v:-1==k&&(A=nh(A,/\f/g,"")),S>0&&(nf(A)-y||0===x&&47===w)&&np(S>32?nR(A+";",s,n,y-1,h):nR(nh(A," ","")+";",s,n,y-2,h),h);break;case 59:A+=";";default:if(np(L=nE(A,r,n,_,v,o,c,R,T=[],D=[],y,a),a),123===E)if(0===v)e(A,r,L,L,T,a,y,c,D);else{switch(b){case 99:if(110===nu(A,3))break;case 108:if(97===nu(A,2))break;default:v=0;case 100:case 109:case 115:}v?e(i,L,L,s&&np(nE(i,L,L,0,0,o,c,R,o,T=[],y,D),D),o,D,y,c,s?T:D):e(A,L,L,L,[""],D,0,c,D)}}_=v=S=0,x=k=1,R=A="",y=l;break;case 58:y=1+nf(A),S=w;default:if(x<1){if(123==E)--x;else if(125==E&&0==x++&&125==(ny=nv>0?nu(nb,--nv):0,nm--,10===ny&&(nm=1,ng--),ny))continue}switch(A+=nc(E),E*x){case 38:k=v>0?1:(A+="\f",-1);break;case 44:c[_++]=(nf(A)-1)*k,k=1;break;case 64:45===nx()&&(A+=nk(nw())),b=nx(),v=y=nf(R=A+=function(e){for(;!nC(nx());)nw();return nd(nb,e,nv)}(nv)),E++;break;case 45:45===w&&2==nf(A)&&(x=0)}}return a}("",null,null,null,[""],(o=s=`${n}{${c}}`,ng=nm=1,n_=nf(nb=o),nv=0,s=[]),0,[0],s),nb="",a),nD)},"createUserStyles"),o$=(0,ni.__name)((e="",i,r)=>{let n=e;return r||i||(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=(n=(0,ne.decodeEntities)(n)).replace(/<br>/g,"<br/>")},"cleanUpSvgCode"),oU=(0,ni.__name)((e="",i)=>{let r=i?.viewBox?.baseVal?.height?i.viewBox.baseVal.height+"px":"100%",n=oB(`<body style="margin:0">${e}</body>`);return`<iframe style="width:100%;height:${r};border:0;margin:0;" src="data:text/html;charset=UTF-8;base64,${n}" sandbox="allow-top-navigation-by-user-activation allow-popups">
|
|
6
|
-
The "iframe" tag is not supported by your browser.
|
|
7
|
-
</iframe>`},"putIntoIFrame"),oq=(0,ni.__name)((e,i,r,n,s)=>{let o=e.append("div");o.attr("id",r),n&&o.attr("style",n);let a=o.append("svg").attr("id",i).attr("width","100%").attr("xmlns","http://www.w3.org/2000/svg");return s&&a.attr("xmlns:xlink",s),a.append("g"),e},"appendDivSvgG");function oV(e,i){return e.append("iframe").attr("id",i).attr("style","width: 100%; height: 100%;").attr("sandbox","")}(0,ni.__name)(oV,"sandboxedIframe");var oK=(0,ni.__name)((e,i,r,n)=>{e.getElementById(i)?.remove(),e.getElementById(r)?.remove(),e.getElementById(n)?.remove()},"removeExistingElements"),oY=(0,ni.__name)(async function(e,i,r){let n,s;ow();let o=oF(i);i=o.code;let a=(0,nt.getConfig)();ni.log.debug(a),i.length>(a?.maxTextSize??5e4)&&(i="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa");let l="#"+e,c="i"+e,h="#"+c,u="d"+e,d="#"+u,f=(0,ni.__name)(()=>{let e=g?h:d,i=(0,nn.select)(e).node();i&&"remove"in i&&i.remove()},"removeTempElements"),p=(0,nn.select)("body"),g="sandbox"===a.securityLevel,m="loose"===a.securityLevel,_=a.fontFamily;if(void 0!==r){if(r&&(r.innerHTML=""),g){let e=oV((0,nn.select)(r),c);(p=(0,nn.select)(e.nodes()[0].contentDocument.body)).node().style.margin=0}else p=(0,nn.select)(r);oq(p,e,u,`font-family: ${_}`,"http://www.w3.org/1999/xlink")}else{if(oK(document,e,u,c),g){let e=oV((0,nn.select)("body"),c);(p=(0,nn.select)(e.nodes()[0].contentDocument.body)).node().style.margin=0}else p=(0,nn.select)("body");oq(p,e,u)}try{n=await oE.fromText(i,{title:o.title})}catch(e){if(a.suppressErrorRendering)throw f(),e;n=await oE.fromText("error"),s=e}let v=p.select(d).node(),y=n.type,b=v.firstChild,S=b.firstChild,w=oW(a,y,n.renderer.getClasses?.(i,n),l),x=document.createElement("style");x.innerHTML=w,b.insertBefore(x,S);try{await n.renderer.draw(i,e,"11.14.0",n)}catch(r){throw a.suppressErrorRendering?f():sR.draw(i,e,"11.14.0"),r}oJ(y,p.select(`${d} svg`),n.db.getAccTitle?.(),n.db.getAccDescription?.()),p.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns","http://www.w3.org/1999/xhtml");let C=p.select(d).node().innerHTML;if(ni.log.debug("config.arrowMarkerAbsolute",a.arrowMarkerAbsolute),C=o$(C,g,(0,nt.evaluate)(a.arrowMarkerAbsolute)),g?C=oU(C,p.select(d+" svg").node()):m||(C=nL.default.sanitize(C,{ADD_TAGS:oN,ADD_ATTR:oI,HTML_INTEGRATION_POINTS:{foreignobject:!0}})),oT(),s)throw s;return f(),{diagramType:y,svg:C,bindFunctions:n.db.bindFunctions}},"render");function oX(e={}){let i=(0,nt.assignWithDepth_default)({},e);i?.fontFamily&&!i.themeVariables?.fontFamily&&(i.themeVariables||(i.themeVariables={}),i.themeVariables.fontFamily=i.fontFamily),(0,nt.saveConfigFromInitialize)(i),i?.theme&&i.theme in nt.themes_default?i.themeVariables=nt.themes_default[i.theme].getThemeVariables(i.themeVariables):i&&(i.themeVariables=nt.themes_default.default.getThemeVariables(i.themeVariables));let r="object"==typeof i?(0,nt.setSiteConfig)(i):(0,nt.getSiteConfig)();(0,ni.setLogLevel)(r.logLevel),ow()}(0,ni.__name)(oX,"initialize");var oG=(0,ni.__name)((e,i={})=>{let{code:r}=oO(e);return oE.fromText(r,i)},"getDiagramFromText");function oJ(e,i,r,n){oC(i,e),ok(i,r,n,i.attr("id"))}(0,ni.__name)(oJ,"addA11yInfo");var oZ=Object.freeze({render:oY,parse:oz,getDiagramFromText:oG,initialize:oX,getConfig:nt.getConfig,setConfig:nt.setConfig,getSiteConfig:nt.getSiteConfig,updateSiteConfig:nt.updateSiteConfig,reset:(0,ni.__name)(()=>{(0,nt.reset)()},"reset"),globalReset:(0,ni.__name)(()=>{(0,nt.reset)(nt.defaultConfig)},"globalReset"),defaultConfig:nt.defaultConfig});(0,ni.setLogLevel)((0,nt.getConfig)().logLevel),(0,nt.reset)((0,nt.getConfig)());var oQ=(0,ni.__name)((e,i,r)=>{ni.log.warn(e),(0,ne.isDetailedError)(e)?(r&&r(e.str,e.hash),i.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&i.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),o0=(0,ni.__name)(async function(e={querySelector:".mermaid"}){try{await o1(e)}catch(i){if((0,ne.isDetailedError)(i)&&ni.log.error(i.str),ar.parseError&&ar.parseError(i),!e.suppressErrors)throw ni.log.error("Use the suppressErrors option to suppress these errors"),i}},"run"),o1=(0,ni.__name)(async function({postRenderCallback:e,querySelector:i,nodes:r}={querySelector:".mermaid"}){let n,s,o=oZ.getConfig();if(ni.log.debug(`${!e?"No ":""}Callback function found`),r)n=r;else if(i)n=document.querySelectorAll(i);else throw Error("Nodes and querySelector are both undefined");ni.log.debug(`Found ${n.length} diagrams`),o?.startOnLoad!==void 0&&(ni.log.debug("Start On Load: "+o?.startOnLoad),oZ.updateSiteConfig({startOnLoad:o?.startOnLoad}));let a=new ne.utils_default.InitIDGenerator(o.deterministicIds,o.deterministicIDSeed),l=[];for(let i of Array.from(n)){if(ni.log.info("Rendering diagram: "+i.id),i.getAttribute("data-processed"))continue;i.setAttribute("data-processed","true");let r=`mermaid-${a.next()}`;s=i.innerHTML,s=(0,nr.dedent)(ne.utils_default.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");let n=ne.utils_default.detectInit(s);n&&ni.log.debug("Detected early reinit: ",n);try{let{svg:n,bindFunctions:o}=await at(r,s,i);i.innerHTML=n,e&&await e(r),o&&o(i)}catch(e){oQ(e,l,ar.parseError)}}if(l.length>0)throw l[0]},"runThrowsErrors"),o2=(0,ni.__name)(function(e){oZ.initialize(e)},"initialize"),o5=(0,ni.__name)(async function(e,i,r){ni.log.warn("mermaid.init is deprecated. Please use run instead."),e&&o2(e);let n={postRenderCallback:r,querySelector:".mermaid"};"string"==typeof i?n.querySelector=i:i&&(i instanceof HTMLElement?n.nodes=[i]:n.nodes=i),await o0(n)},"init"),o3=(0,ni.__name)(async(e,{lazyLoad:i=!0}={})=>{ow(),(0,nt.registerLazyLoadedDiagrams)(...e),!1===i&&await ox()},"registerExternalDiagrams"),o4=(0,ni.__name)(function(){if(ar.startOnLoad){let{startOnLoad:e}=oZ.getConfig();e&&ar.run().catch(e=>ni.log.error("Mermaid failed to initialize",e))}},"contentLoaded");"u">typeof document&&window.addEventListener("load",o4,!1);var o6=(0,ni.__name)(function(e){ar.parseError=e},"setParseErrorHandler"),o9=[],o8=!1,o7=(0,ni.__name)(async()=>{if(!o8){for(o8=!0;o9.length>0;){let e=o9.shift();if(e)try{await e()}catch(e){ni.log.error("Error executing queue",e)}}o8=!1}},"executeQueue"),ae=(0,ni.__name)(async(e,i)=>new Promise((r,n)=>{let s=(0,ni.__name)(()=>new Promise((s,o)=>{oZ.parse(e,i).then(e=>{s(e),r(e)},e=>{ni.log.error("Error parsing",e),ar.parseError?.(e),o(e),n(e)})}),"performCall");o9.push(s),o7().catch(n)}),"parse"),at=(0,ni.__name)((e,i,r)=>new Promise((n,s)=>{let o=(0,ni.__name)(()=>new Promise((o,a)=>{oZ.render(e,i,r).then(e=>{o(e),n(e)},e=>{ni.log.error("Error parsing",e),ar.parseError?.(e),a(e),s(e)})}),"performCall");o9.push(o),o7().catch(s)}),"render"),ai=(0,ni.__name)(()=>Object.keys(nt.detectors).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),ar={startOnLoad:!0,mermaidAPI:oZ,parse:ae,render:at,init:o5,run:o0,registerExternalDiagrams:o3,registerLayoutLoaders:r8.registerLayoutLoaders,initialize:o2,parseError:void 0,contentLoaded:o4,setParseErrorHandler:o6,detectType:nt.detectType,registerIconPacks:r7.registerIconPacks,getRegisteredDiagramsMetadata:ai};function an({code:e}){let i=(0,m.useRef)(null),[r,n]=(0,m.useState)(null),s=(0,m.useId)().replace(/:/g,"-");return((0,m.useEffect)(()=>{let r=!1;return async function(){if(i.current)try{let{svg:o}=await ar.render(`mermaid-${s}`,e);!r&&i.current&&(i.current.innerHTML=o,n(null))}catch(e){r||n(e instanceof Error?e.message:"Mermaid rendering failed")}}(),()=>{r=!0}},[e,s]),r)?(0,g.jsxs)("div",{className:"p-3 border border-destructive/50 rounded-md bg-destructive/10 text-destructive text-xs",children:[(0,g.jsx)("p",{className:"font-medium mb-1",children:"Mermaid Error"}),(0,g.jsx)("pre",{className:"whitespace-pre-wrap",children:r})]}):(0,g.jsx)("div",{ref:i,className:"my-2 overflow-x-auto"})}ar.initialize({startOnLoad:!1,theme:"default",securityLevel:"loose"});let as={code:e=>{let{className:i,children:r}=e,n=/language-(\w+)/.exec(i||""),s=n?n[1]:"",o=String(r).replace(/\n$/,""),a=i&&i.startsWith("language-");return"mermaid"===s&&o?(0,g.jsx)(an,{code:o}):a&&o?(0,g.jsx)(r4,{language:s,code:o,children:r}):(0,g.jsx)("code",{...e,children:r})},a:({href:e,children:i})=>(0,g.jsxs)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline break-all",children:[i,(0,g.jsx)(r1,{className:"inline-block flex-shrink-0",style:{width:"1em",height:"1em"}})]}),table:({children:e})=>(0,g.jsx)("div",{className:"overflow-x-auto my-2 w-fit max-w-full",children:(0,g.jsx)("table",{className:"border-collapse border border-border rounded-lg overflow-hidden text-xs",children:e})}),thead:({children:e})=>(0,g.jsx)("thead",{className:"bg-accent",children:e}),tbody:({children:e})=>(0,g.jsx)("tbody",{children:e}),tr:({children:e})=>(0,g.jsx)("tr",{children:e}),th:({children:e})=>(0,g.jsx)("th",{className:"border border-border px-3 py-2 text-left font-semibold",children:e}),td:({children:e})=>(0,g.jsx)("td",{className:"border border-border px-3 py-2",children:e})};var ao=e.i(627),aa=e.i(37870),al=e.i(85699);let ac=()=>({loading:(e,i)=>{let r=crypto.randomUUID();return al.toast.loading(e,{id:r,description:i,duration:1/0}),r},success:(e,i,r)=>{if(e)return al.toast.success(i,{id:e,description:r,duration:5e3}),e;{let e=crypto.randomUUID();return al.toast.success(i,{id:e,description:r,duration:5e3}),e}},error:(e,i,r)=>{if(e)return al.toast.error(i,{id:e,description:r,duration:1/0}),e;{let e=crypto.randomUUID();return al.toast.error(i,{id:e,description:r,duration:1/0}),e}},info:(e,i)=>{let r=crypto.randomUUID();return al.toast.info(e,{id:r,description:i,duration:5e3}),r},dismiss:e=>{al.toast.dismiss(e)}});e.s(["useToast",0,ac],76165);var ah=e.i(68995);let au=(0,r0.default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var ad=e.i(37727);e.s([],93742),e.i(93742);var af=e.i(66196),ap=e.i(58509),ag=e.i(33605),am=e.i(89633),a_=e.i(26665),av=e.i(51665),ay=e.i(6157);e.i(47167);var ab=e.i(67805);let aS=m.createContext(void 0);function aw(e){let i=m.useContext(aS);if(void 0===i&&!e)throw Error((0,ab.default)(47));return i}var ax=e.i(74080),aC=e.i(98263),ak=e.i(83921),aE=e.i(66745),aR=e.i(30628),aT=e.i(94365),aD=e.i(3404),aL=e.i(628),aA=e.i(69375),aP=e.i(7335);let aM={...aL.popupStoreSelectors,disabled:(0,ak.createSelector)(e=>e.disabled),instantType:(0,ak.createSelector)(e=>e.instantType),openMethod:(0,ak.createSelector)(e=>e.openMethod),openChangeReason:(0,ak.createSelector)(e=>e.openChangeReason),modal:(0,ak.createSelector)(e=>e.modal),stickIfOpen:(0,ak.createSelector)(e=>e.stickIfOpen),titleElementId:(0,ak.createSelector)(e=>e.titleElementId),descriptionElementId:(0,ak.createSelector)(e=>e.descriptionElementId),openOnHover:(0,ak.createSelector)(e=>e.openOnHover),closeDelay:(0,ak.createSelector)(e=>e.closeDelay),hasViewport:(0,ak.createSelector)(e=>e.hasViewport)};class aO extends aC.ReactStore{constructor(e){const i={...(0,aL.createInitialPopupStoreState)(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1,...e};i.open&&e?.mounted===void 0&&(i.mounted=!0),super(i,{popupRef:m.createRef(),backdropRef:m.createRef(),internalBackdropRef:m.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:m.createRef(),beforeContentFocusGuardRef:m.createRef(),stickIfOpenTimeout:new aE.Timeout,triggerElements:new aA.PopupTriggerMap},aM)}setOpen=(e,i)=>{let r=i.reason===aD.REASONS.triggerHover,n=i.reason===aD.REASONS.triggerPress&&0===i.event.detail,s=!e&&(i.reason===aD.REASONS.escapeKey||null==i.reason);if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,i),i.isCanceled)return;let o={open:e,nativeEvent:i.event,reason:i.reason,nested:this.state.nested,triggerElement:i.trigger},a=this.state.floatingRootContext.context.events;a?.emit("openchange",o);let l=()=>{let r={open:e,openChangeReason:i.reason},n=i.trigger?.id??null;(n||e)&&(r.activeTriggerId=n,r.activeTriggerElement=i.trigger??null),this.update(r)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(aP.PATIENT_CLICK_THRESHOLD,()=>{this.set("stickIfOpen",!1)}),ax.flushSync(l)):l(),n||s?this.set("instantType",n?"click":"dismiss"):i.reason===aD.REASONS.focusOut?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,i){let r=(0,aR.useRefWithInit)(()=>new aO(i)).current,n=e??r;return(0,aT.useOnMount)(r.disposeEffect),n}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}var aB=e.i(5963),aN=e.i(58642),aI=e.i(50091);function aF({props:e}){let{children:i,open:r,defaultOpen:n=!1,onOpenChange:s,onOpenChangeComplete:o,modal:a=!1,handle:l,triggerId:c,defaultTriggerId:h=null}=e,u=aO.useStore(l?.store,{modal:a,open:n,openProp:r,activeTriggerId:h,triggerIdProp:c});(0,ap.useOnFirstRender)(()=>{void 0===r&&!1===u.state.open&&!0===n&&u.update({open:!0,activeTriggerId:h})}),u.useControlledProp("openProp",r),u.useControlledProp("triggerIdProp",c);let d=u.useState("open"),f=u.useState("positionerElement"),p=u.useState("payload"),_=u.useState("openChangeReason");u.useContextCallback("onOpenChange",s),u.useContextCallback("onOpenChangeComplete",o);let{openMethod:v,triggerProps:y}=(0,aI.useOpenInteractionType)(d);(0,aN.useImplicitActiveTrigger)(u);let{forceUnmount:b}=(0,aN.useOpenStateTransitions)(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});(0,af.useScrollLock)(d&&!0===a&&_!==aD.REASONS.triggerHover&&"touch"!==v,f),m.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let S=m.useCallback(e=>{let i=(0,aB.createChangeEventDetails)(e);return i.preventUnmountOnClose=()=>{u.set("preventUnmountingOnClose",!0)},i},[u]),w=m.useCallback(()=>{u.setOpen(!1,S(aD.REASONS.imperativeAction))},[u,S]);m.useImperativeHandle(e.actionsRef,()=>({unmount:b,close:w}),[b,w]);let x=(0,ay.useSyncedFloatingRootContext)({popupStore:u,onOpenChange:u.setOpen}),C=(0,ag.useDismiss)(x,{outsidePressEvent:{mouse:"trap-focus"===a?"sloppy":"intentional",touch:"sloppy"}}),k=(0,a_.useRole)(x),{getReferenceProps:E,getFloatingProps:R,getTriggerProps:T}=(0,am.useInteractions)([C,k]),D=m.useMemo(()=>E(y),[E,y]),L=m.useMemo(()=>T(y),[T,y]),A=m.useMemo(()=>R(),[R]);u.useSyncedValues({modal:a,openMethod:v,activeTriggerProps:D,inactiveTriggerProps:L,popupProps:A,floatingRootContext:x,nested:null!=(0,av.useFloatingParentNodeId)()});let P=m.useMemo(()=>({store:u}),[u]);return(0,g.jsx)(aS.Provider,{value:P,children:"function"==typeof i?i({payload:p}):i})}var az=e.i(76477),aH=e.i(91730),aj=e.i(83590),aW=e.i(27601),a$=e.i(29315),aU=e.i(47857),aq=e.i(87612);let aV=.1*.1;function aK(e,i,r,n,s,o){return n>=i!=o>=i&&e<=(s-r)*(i-n)/(o-n)+r}function aY(e,i,r,n,s,o,a,l,c,h){let u=!1;return aK(e,i,r,n,s,o)&&(u=!u),aK(e,i,s,o,a,l)&&(u=!u),aK(e,i,a,l,c,h)&&(u=!u),aK(e,i,c,h,r,n)&&(u=!u),u}function aX(e,i,r,n,s,o){let a=Math.min(r,s),l=Math.max(r,s),c=Math.min(n,o),h=Math.max(n,o);return e>=a&&e<=l&&i>=c&&i<=h}function aG(e={}){let{blockPointerEvents:i=!1}=e,r=new aE.Timeout,n=({x:e,y:i,placement:n,elements:s,onClose:o,nodeId:a,tree:l})=>{let c=n?.split("-")[0],h=!1,u=null,d=null,f="u">typeof performance?performance.now():0;return function(n){r.clear();let p=s.domReference,g=s.floating;if(!p||!g||null==c||null==e||null==i)return;let{clientX:m,clientY:_}=n,v=(0,aU.getTarget)(n),y="mouseleave"===n.type,b=(0,aU.contains)(g,v),S=(0,aU.contains)(p,v);if(b&&(h=!0,!y))return;if(S&&(h=!1,!y)){h=!0;return}if(y&&(0,a$.isElement)(n.relatedTarget)&&(0,aU.contains)(g,n.relatedTarget))return;function w(){return!!(l&&(0,aq.getNodeChildren)(l.nodesRef.current,a).length>0)}function x(){w()||(r.clear(),o())}if(w())return;let C=p.getBoundingClientRect(),k=g.getBoundingClientRect(),E=e>k.right-k.width/2,R=i>k.bottom-k.height/2,T=k.width>C.width,D=k.height>C.height,L=(T?C:k).left,A=(T?C:k).right,P=(D?C:k).top,M=(D?C:k).bottom;if("top"===c&&i>=C.bottom-1||"bottom"===c&&i<=C.top+1||"left"===c&&e>=C.right-1||"right"===c&&e<=C.left+1)return void x();let O=!1;switch(c){case"top":O=aX(m,_,L,C.top+1,A,k.bottom-1);break;case"bottom":O=aX(m,_,L,k.top+1,A,C.bottom-1);break;case"left":O=aX(m,_,k.right-1,M,C.left+1,P);break;case"right":O=aX(m,_,C.right-1,M,k.left+1,P)}if(O)return;if(h&&(!(m>=C.x)||!(m<=C.x+C.width)||!(_>=C.y)||!(_<=C.y+C.height))||!y&&function(e,i){let r=performance.now(),n=r-f;if(null===u||null===d||0===n)return u=e,d=i,f=r,!1;let s=e-u,o=i-d;return u=e,d=i,f=r,s*s+o*o<n*n*aV}(m,_))return void x();let B=!1;switch(c){case"top":{let r=T?.25:2,n=i+.5+1,s=E||T?k.bottom-.5:k.top,o=E?T?k.bottom-.5:k.top:k.bottom-.5;B=aY(m,_,T||E?e+r:e-r,n,T?e-r:E?e+r:e-r,n,k.left,s,k.right,o);break}case"bottom":{let r=T?.25:2,n=i-.5,s=E||T?k.top+.5:k.bottom,o=E?T?k.top+.5:k.bottom:k.top+.5;B=aY(m,_,T||E?e+r:e-r,n,T?e-r:E?e+r:e-r,n,k.left,s,k.right,o);break}case"left":{let r=D?.25:2,n=e+.5+1,s=R||D?k.right-.5:k.left,o=R?D?k.right-.5:k.left:k.right-.5;B=aY(m,_,s,k.top,o,k.bottom,n,D||R?i+r:i-r,n,D?i-r:R?i+r:i-r);break}case"right":{let r=D?.25:2,n=e-.5,s=R||D?k.left+.5:k.right,o=R?D?k.left+.5:k.right:k.left+.5;B=aY(m,_,n,D||R?i+r:i-r,n,D?i-r:R?i+r:i-r,s,k.top,o,k.bottom)}}B?h||r.start(40,x):x()}};return n.__options={blockPointerEvents:i},n}e.s(["safePolygon",0,aG],37287);var aJ=e.i(4012),aZ=e.i(231),aQ=e.i(90219),a0=e.i(82033),a1=e.i(494);let a2=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${a1.TYPEABLE_SELECTOR}`;class a5{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new aE.Timeout,this.restTimeout=new aE.Timeout,this.handleCloseOptions=void 0}static create(){return new a5}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function a3(e){e.performedPointerEventsMutation&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function a4(e){let i=(0,aR.useRefWithInit)(a5.create).current,r=e.context.dataRef.current;return r.hoverInteractionState||(r.hoverInteractionState=i),(0,aT.useOnMount)(r.hoverInteractionState.disposeEffect),r.hoverInteractionState}function a6(e,i,r){let n=null==r||(0,a0.isMouseLikePointerType)(r)?"function"==typeof e?e():e:0;return"number"==typeof n?n:n?.[i]}function a9(e){return"function"==typeof e?e():e}function a8(e,i){return i||"click"===e||"mousedown"===e}let a7={current:null};function le(e,i={}){let r="rootStore"in e?e.rootStore:e,{dataRef:n,events:s}=r.context,{enabled:o=!0,delay:a=0,handleClose:l=null,mouseOnly:c=!1,restMs:h=0,move:u=!0,triggerElementRef:d=a7,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:g}=i,_=(0,av.useFloatingTree)(f),v=a4(r),y=(0,aZ.useValueAsRef)(l),b=(0,aZ.useValueAsRef)(a),S=(0,aZ.useValueAsRef)(h),w=(0,aZ.useValueAsRef)(o);p&&(v.handleCloseOptions=y.current?.__options);let x=(0,az.useStableCallback)(()=>a8(n.current.openEvent?.type,v.interactedInside)),C=(0,az.useStableCallback)(e=>(0,aU.isTargetInsideEnabledTrigger)(e,r.context.triggerElements)),k=(0,az.useStableCallback)((e,i,n)=>{let s=r.context.triggerElements;return s.hasElement(i)?!e||!(0,aU.contains)(e,i):!!(0,a$.isElement)(n)&&s.hasMatchingElement(e=>(0,aU.contains)(e,n))&&(!e||!(0,aU.contains)(e,n))}),E=m.useCallback((e,i=!0)=>{let n=a6(b.current,"close",v.pointerType);n?v.openChangeTimeout.start(n,()=>{r.setOpen(!1,(0,aB.createChangeEventDetails)(aD.REASONS.triggerHover,e)),_?.events.emit("floating.closed",e)}):i&&(v.openChangeTimeout.clear(),r.setOpen(!1,(0,aB.createChangeEventDetails)(aD.REASONS.triggerHover,e)),_?.events.emit("floating.closed",e))},[b,r,v,_]),R=(0,az.useStableCallback)(()=>{v.handler&&((0,aQ.ownerDocument)(r.select("domReferenceElement")).removeEventListener("mousemove",v.handler),v.handler=void 0)});m.useEffect(()=>R,[R]);let T=(0,az.useStableCallback)(()=>{a3(v)});return m.useEffect(()=>{if(o)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){e.open||(R(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}},[o,s,v,R]),m.useEffect(()=>{if(!o)return;let e=d.current??(p?r.select("domReferenceElement"):null);if((0,a$.isElement)(e))return u&&e.addEventListener("mousemove",i,{once:!0}),e.addEventListener("mouseenter",i),e.addEventListener("mouseleave",s),()=>{u&&e.removeEventListener("mousemove",i),e.removeEventListener("mouseenter",i),e.removeEventListener("mouseleave",s)};function i(e){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,c&&!(0,a0.isMouseLikePointerType)(v.pointerType)||a9(S.current)>0&&!a6(b.current,"open"))return;let i=a6(b.current,"open",v.pointerType),n=e.currentTarget??null,s=r.select("domReferenceElement"),o=null!=n&&k(s,n,e.target),a=r.select("open"),l=!a||o;o&&a?r.setOpen(!0,(0,aB.createChangeEventDetails)(aD.REASONS.triggerHover,e,n)):i?v.openChangeTimeout.start(i,()=>{l&&r.setOpen(!0,(0,aB.createChangeEventDetails)(aD.REASONS.triggerHover,e,n))}):l&&r.setOpen(!0,(0,aB.createChangeEventDetails)(aD.REASONS.triggerHover,e,n))}function s(e){if(x())return void T();R();let i=r.select("domReferenceElement"),s=(0,aQ.ownerDocument)(i);v.restTimeout.clear(),v.restTimeoutPending=!1;let o=n.current.floatingContext??g?.();if(!C(e.relatedTarget)){if(y.current&&o){r.select("open")||v.openChangeTimeout.clear();let i=d.current;v.handler=y.current({...o,tree:_,x:e.clientX,y:e.clientY,onClose(){T(),R(),w.current&&!x()&&i===r.select("domReferenceElement")&&E(e,!0)}}),s.addEventListener("mousemove",v.handler),v.handler(e);return}"touch"===v.pointerType&&(0,aU.contains)(r.select("floatingElement"),e.relatedTarget)||E(e)}}},[R,T,n,b,E,r,o,y,v,p,k,x,C,c,u,S,d,_,w,g]),m.useMemo(()=>{if(o)return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:i}=e,n=e.currentTarget,s=r.select("domReferenceElement"),o=r.select("open"),a=k(s,n,e.target);if(c&&!(0,a0.isMouseLikePointerType)(v.pointerType))return;let l=a9(S.current);function h(){if(v.restTimeoutPending=!1,x())return;let e=r.select("open");v.blockMouseMove||e&&!a||r.setOpen(!0,(0,aB.createChangeEventDetails)(aD.REASONS.triggerHover,i,n))}(!o||a)&&0!==l&&(!a&&v.restTimeoutPending&&e.movementX**2+e.movementY**2<2||(v.restTimeout.clear(),"touch"===v.pointerType?ax.flushSync(()=>{h()}):a&&o?h():(v.restTimeoutPending=!0,v.restTimeout.start(l,h))))}};function e(e){v.pointerType=e.pointerType}},[o,v,x,k,c,r,S])}e.s(["useHoverReferenceInteraction",0,le],97254);var lt=e.i(89879),li=e.i(72408),lr=e.i(59266);let ln=m.forwardRef(function(e,i){let{render:r,className:n,disabled:s=!1,nativeButton:o=!0,handle:a,payload:l,openOnHover:c=!1,delay:h=300,closeDelay:u=0,id:d,...f}=e,p=aw(!0),_=a?.store??p?.store;if(!_)throw Error((0,ab.default)(74));let v=(0,lt.useBaseUiId)(d),y=_.useState("isTriggerActive",v),b=_.useState("floatingRootContext"),S=_.useState("isOpenedByTrigger",v),w=m.useRef(null),{registerTrigger:x,isMountedByThisTrigger:C}=(0,aN.useTriggerDataForwarding)(v,w,_,{payload:l,disabled:s,openOnHover:c,closeDelay:u}),k=_.useState("openChangeReason"),E=_.useState("stickIfOpen"),R=_.useState("openMethod"),T=le(b,{enabled:null!=b&&c&&("touch"!==R||k!==aD.REASONS.triggerPress),mouseOnly:!0,move:!1,handleClose:aG(),restMs:h,delay:{close:u},triggerElementRef:w,isActiveTrigger:y}),D=(0,aJ.useClick)(b,{enabled:null!=b,stickIfOpen:E}),L=(0,am.useInteractions)([D]),A=_.useState("triggerProps",C),{getButtonProps:P,buttonRef:M}=(0,aH.useButton)({disabled:s,native:o}),O=m.useMemo(()=>({open:e=>e&&k===aD.REASONS.triggerPress?aj.pressableTriggerOpenStateMapping.open(e):aj.triggerOpenStateMapping.open(e)}),[k]),B=(0,aW.useRenderElement)("button",e,{state:{disabled:s,open:S},ref:[M,i,x,w],props:[L.getReferenceProps(),T,A,{[aP.CLICK_TRIGGER_IDENTIFIER]:"",id:v},f,P],stateAttributesMapping:O}),N=m.useRef(null),I=(0,az.useStableCallback)(e=>{ax.flushSync(()=>{_.setOpen(!1,(0,aB.createChangeEventDetails)(aD.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let i=(0,lr.getTabbableBeforeElement)(N.current);i?.focus()}),F=(0,az.useStableCallback)(e=>{let i=_.select("positionerElement");if(i&&(0,lr.isOutsideEvent)(e,i))_.context.beforeContentFocusGuardRef.current?.focus();else{ax.flushSync(()=>{_.setOpen(!1,(0,aB.createChangeEventDetails)(aD.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let r=(0,lr.getTabbableAfterElement)(_.context.triggerFocusTargetRef.current||w.current);for(;null!==r&&(0,aU.contains)(i,r);){let e=r;if((r=(0,lr.getNextTabbable)(r))===e)break}r?.focus()}});return y?(0,g.jsxs)(m.Fragment,{children:[(0,g.jsx)(li.FocusGuard,{ref:N,onFocus:I}),(0,g.jsx)(m.Fragment,{children:B},v),(0,g.jsx)(li.FocusGuard,{ref:_.context.triggerFocusTargetRef,onFocus:F})]}):(0,g.jsx)(m.Fragment,{children:B},v)});var ls=e.i(37692);let lo=m.createContext(void 0),la=m.forwardRef(function(e,i){let{keepMounted:r=!1,...n}=e,{store:s}=aw();return s.useState("mounted")||r?(0,g.jsx)(lo.Provider,{value:r,children:(0,g.jsx)(ls.FloatingPortal,{ref:i,...n})}):null});var ll=e.i(58130),lc=e.i(977);let lh=m.createContext(void 0);function lu(){let e=m.useContext(lh);if(!e)throw Error((0,ab.default)(46));return e}var ld=e.i(43084);function lf(e,i,r){let n,{reference:s,floating:o}=e,a=(0,ld.getSideAxis)(i),l=(0,ld.getAlignmentAxis)(i),c=(0,ld.getAxisLength)(l),h=(0,ld.getSide)(i),u="y"===a,d=s.x+s.width/2-o.width/2,f=s.y+s.height/2-o.height/2,p=s[c]/2-o[c]/2;switch(h){case"top":n={x:d,y:s.y-o.height};break;case"bottom":n={x:d,y:s.y+s.height};break;case"right":n={x:s.x+s.width,y:f};break;case"left":n={x:s.x-o.width,y:f};break;default:n={x:s.x,y:s.y}}switch((0,ld.getAlignment)(i)){case"start":n[l]-=p*(r&&u?-1:1);break;case"end":n[l]+=p*(r&&u?-1:1)}return n}async function lp(e,i){var r;void 0===i&&(i={});let{x:n,y:s,platform:o,rects:a,elements:l,strategy:c}=e,{boundary:h="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=(0,ld.evaluate)(i,e),g=(0,ld.getPaddingObject)(p),m=l[f?"floating"===d?"reference":"floating":d],_=(0,ld.rectToClientRect)(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(m)))||r?m:m.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:h,rootBoundary:u,strategy:c})),v="floating"===d?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=(0,ld.rectToClientRect)(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:y,strategy:c}):v);return{top:(_.top-S.top+g.top)/b.y,bottom:(S.bottom-_.bottom+g.bottom)/b.y,left:(_.left-S.left+g.left)/b.x,right:(S.right-_.right+g.right)/b.x}}let lg=async(e,i,r)=>{let{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=r,l=a.detectOverflow?a:{...a,detectOverflow:lp},c=await (null==a.isRTL?void 0:a.isRTL(i)),h=await a.getElementRects({reference:e,floating:i,strategy:s}),{x:u,y:d}=lf(h,n,c),f=n,p=0,g={};for(let r=0;r<o.length;r++){let m=o[r];if(!m)continue;let{name:_,fn:v}=m,{x:y,y:b,data:S,reset:w}=await v({x:u,y:d,initialPlacement:n,placement:f,strategy:s,middlewareData:g,rects:h,platform:l,elements:{reference:e,floating:i}});u=null!=y?y:u,d=null!=b?b:d,g[_]={...g[_],...S},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(h=!0===w.rects?await a.getElementRects({reference:e,floating:i,strategy:s}):w.rects),{x:u,y:d}=lf(h,f,c)),r=-1)}return{x:u,y:d,placement:f,strategy:s,middlewareData:g}};function lm(e,i){return{top:e.top-i.height,right:e.right-i.width,bottom:e.bottom-i.height,left:e.left-i.width}}function l_(e){return ld.sides.some(i=>e[i]>=0)}let lv=new Set(["left","top"]);async function ly(e,i){let{placement:r,platform:n,elements:s}=e,o=await (null==n.isRTL?void 0:n.isRTL(s.floating)),a=(0,ld.getSide)(r),l=(0,ld.getAlignment)(r),c="y"===(0,ld.getSideAxis)(r),h=lv.has(a)?-1:1,u=o&&c?-1:1,d=(0,ld.evaluate)(i,e),{mainAxis:f,crossAxis:p,alignmentAxis:g}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&"number"==typeof g&&(p="end"===l?-1*g:g),c?{x:p*u,y:f*h}:{x:f*h,y:p*u}}function lb(e){let i=(0,a$.getComputedStyle)(e),r=parseFloat(i.width)||0,n=parseFloat(i.height)||0,s=(0,a$.isHTMLElement)(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n,l=(0,ld.round)(r)!==o||(0,ld.round)(n)!==a;return l&&(r=o,n=a),{width:r,height:n,$:l}}function lS(e){return(0,a$.isElement)(e)?e:e.contextElement}function lw(e){let i=lS(e);if(!(0,a$.isHTMLElement)(i))return(0,ld.createCoords)(1);let r=i.getBoundingClientRect(),{width:n,height:s,$:o}=lb(i),a=(o?(0,ld.round)(r.width):r.width)/n,l=(o?(0,ld.round)(r.height):r.height)/s;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}let lx=(0,ld.createCoords)(0);function lC(e){let i=(0,a$.getWindow)(e);return(0,a$.isWebKit)()&&i.visualViewport?{x:i.visualViewport.offsetLeft,y:i.visualViewport.offsetTop}:lx}function lk(e,i,r,n){var s;void 0===i&&(i=!1),void 0===r&&(r=!1);let o=e.getBoundingClientRect(),a=lS(e),l=(0,ld.createCoords)(1);i&&(n?(0,a$.isElement)(n)&&(l=lw(n)):l=lw(e));let c=(void 0===(s=r)&&(s=!1),n&&(!s||n===(0,a$.getWindow)(a))&&s)?lC(a):(0,ld.createCoords)(0),h=(o.left+c.x)/l.x,u=(o.top+c.y)/l.y,d=o.width/l.x,f=o.height/l.y;if(a){let e=(0,a$.getWindow)(a),i=n&&(0,a$.isElement)(n)?(0,a$.getWindow)(n):n,r=e,s=(0,a$.getFrameElement)(r);for(;s&&n&&i!==r;){let e=lw(s),i=s.getBoundingClientRect(),n=(0,a$.getComputedStyle)(s),o=i.left+(s.clientLeft+parseFloat(n.paddingLeft))*e.x,a=i.top+(s.clientTop+parseFloat(n.paddingTop))*e.y;h*=e.x,u*=e.y,d*=e.x,f*=e.y,h+=o,u+=a,r=(0,a$.getWindow)(s),s=(0,a$.getFrameElement)(r)}}return(0,ld.rectToClientRect)({width:d,height:f,x:h,y:u})}function lE(e,i){let r=(0,a$.getNodeScroll)(e).scrollLeft;return i?i.left+r:lk((0,a$.getDocumentElement)(e)).left+r}function lR(e,i){let r=e.getBoundingClientRect();return{x:r.left+i.scrollLeft-lE(e,r),y:r.top+i.scrollTop}}function lT(e,i,r){var n;let s;if("viewport"===i)s=function(e,i){let r=(0,a$.getWindow)(e),n=(0,a$.getDocumentElement)(e),s=r.visualViewport,o=n.clientWidth,a=n.clientHeight,l=0,c=0;if(s){o=s.width,a=s.height;let e=(0,a$.isWebKit)();(!e||e&&"fixed"===i)&&(l=s.offsetLeft,c=s.offsetTop)}let h=lE(n);if(h<=0){let e=n.ownerDocument,i=e.body,r=getComputedStyle(i),s="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,a=Math.abs(n.clientWidth-i.clientWidth-s);a<=25&&(o-=a)}else h<=25&&(o+=h);return{width:o,height:a,x:l,y:c}}(e,r);else if("document"===i){let i,r,o,a,l,c,h;n=(0,a$.getDocumentElement)(e),i=(0,a$.getDocumentElement)(n),r=(0,a$.getNodeScroll)(n),o=n.ownerDocument.body,a=(0,ld.max)(i.scrollWidth,i.clientWidth,o.scrollWidth,o.clientWidth),l=(0,ld.max)(i.scrollHeight,i.clientHeight,o.scrollHeight,o.clientHeight),c=-r.scrollLeft+lE(n),h=-r.scrollTop,"rtl"===(0,a$.getComputedStyle)(o).direction&&(c+=(0,ld.max)(i.clientWidth,o.clientWidth)-a),s={width:a,height:l,x:c,y:h}}else if((0,a$.isElement)(i)){let e,n,o,a,l,c;n=(e=lk(i,!0,"fixed"===r)).top+i.clientTop,o=e.left+i.clientLeft,a=(0,a$.isHTMLElement)(i)?lw(i):(0,ld.createCoords)(1),l=i.clientWidth*a.x,c=i.clientHeight*a.y,s={width:l,height:c,x:o*a.x,y:n*a.y}}else{let r=lC(e);s={x:i.x-r.x,y:i.y-r.y,width:i.width,height:i.height}}return(0,ld.rectToClientRect)(s)}function lD(e){return"static"===(0,a$.getComputedStyle)(e).position}function lL(e,i){if(!(0,a$.isHTMLElement)(e)||"fixed"===(0,a$.getComputedStyle)(e).position)return null;if(i)return i(e);let r=e.offsetParent;return(0,a$.getDocumentElement)(e)===r&&(r=r.ownerDocument.body),r}function lA(e,i){let r=(0,a$.getWindow)(e);if((0,a$.isTopLayer)(e))return r;if(!(0,a$.isHTMLElement)(e)){let i=(0,a$.getParentNode)(e);for(;i&&!(0,a$.isLastTraversableNode)(i);){if((0,a$.isElement)(i)&&!lD(i))return i;i=(0,a$.getParentNode)(i)}return r}let n=lL(e,i);for(;n&&(0,a$.isTableElement)(n)&&lD(n);)n=lL(n,i);return n&&(0,a$.isLastTraversableNode)(n)&&lD(n)&&!(0,a$.isContainingBlock)(n)?r:n||(0,a$.getContainingBlock)(e)||r}let lP=async function(e){let i=this.getOffsetParent||lA,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,i,r){let n=(0,a$.isHTMLElement)(i),s=(0,a$.getDocumentElement)(i),o="fixed"===r,a=lk(e,!0,o,i),l={scrollLeft:0,scrollTop:0},c=(0,ld.createCoords)(0);if(n||!n&&!o)if(("body"!==(0,a$.getNodeName)(i)||(0,a$.isOverflowElement)(s))&&(l=(0,a$.getNodeScroll)(i)),n){let e=lk(i,!0,o,i);c.x=e.x+i.clientLeft,c.y=e.y+i.clientTop}else s&&(c.x=lE(s));o&&!n&&s&&(c.x=lE(s));let h=!s||n||o?(0,ld.createCoords)(0):lR(s,l);return{x:a.left+l.scrollLeft-c.x-h.x,y:a.top+l.scrollTop-c.y-h.y,width:a.width,height:a.height}}(e.reference,await i(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},lM={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:i,rect:r,offsetParent:n,strategy:s}=e,o="fixed"===s,a=(0,a$.getDocumentElement)(n),l=!!i&&(0,a$.isTopLayer)(i.floating);if(n===a||l&&o)return r;let c={scrollLeft:0,scrollTop:0},h=(0,ld.createCoords)(1),u=(0,ld.createCoords)(0),d=(0,a$.isHTMLElement)(n);if((d||!d&&!o)&&(("body"!==(0,a$.getNodeName)(n)||(0,a$.isOverflowElement)(a))&&(c=(0,a$.getNodeScroll)(n)),d)){let e=lk(n);h=lw(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}let f=!a||d||o?(0,ld.createCoords)(0):lR(a,c);return{width:r.width*h.x,height:r.height*h.y,x:r.x*h.x-c.scrollLeft*h.x+u.x+f.x,y:r.y*h.y-c.scrollTop*h.y+u.y+f.y}},getDocumentElement:a$.getDocumentElement,getClippingRect:function(e){let{element:i,boundary:r,rootBoundary:n,strategy:s}=e,o=[..."clippingAncestors"===r?(0,a$.isTopLayer)(i)?[]:function(e,i){let r=i.get(e);if(r)return r;let n=(0,a$.getOverflowAncestors)(e,[],!1).filter(e=>(0,a$.isElement)(e)&&"body"!==(0,a$.getNodeName)(e)),s=null,o="fixed"===(0,a$.getComputedStyle)(e).position,a=o?(0,a$.getParentNode)(e):e;for(;(0,a$.isElement)(a)&&!(0,a$.isLastTraversableNode)(a);){let i=(0,a$.getComputedStyle)(a),r=(0,a$.isContainingBlock)(a);r||"fixed"!==i.position||(s=null),(o?r||s:!(!r&&"static"===i.position&&s&&("absolute"===s.position||"fixed"===s.position)||(0,a$.isOverflowElement)(a)&&!r&&function e(i,r){let n=(0,a$.getParentNode)(i);return!(n===r||!(0,a$.isElement)(n)||(0,a$.isLastTraversableNode)(n))&&("fixed"===(0,a$.getComputedStyle)(n).position||e(n,r))}(e,a)))?s=i:n=n.filter(e=>e!==a),a=(0,a$.getParentNode)(a)}return i.set(e,n),n}(i,this._c):[].concat(r),n],a=lT(i,o[0],s),l=a.top,c=a.right,h=a.bottom,u=a.left;for(let e=1;e<o.length;e++){let r=lT(i,o[e],s);l=(0,ld.max)(r.top,l),c=(0,ld.min)(r.right,c),h=(0,ld.min)(r.bottom,h),u=(0,ld.max)(r.left,u)}return{width:c-u,height:h-l,x:u,y:l}},getOffsetParent:lA,getElementRects:lP,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:i,height:r}=lb(e);return{width:i,height:r}},getScale:lw,isElement:a$.isElement,isRTL:function(e){return"rtl"===(0,a$.getComputedStyle)(e).direction}};function lO(e,i){return e.x===i.x&&e.y===i.y&&e.width===i.width&&e.height===i.height}function lB(e,i,r,n){let s;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:h=!1}=n,u=lS(e),d=o||a?[...u?(0,a$.getOverflowAncestors)(u):[],...i?(0,a$.getOverflowAncestors)(i):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let f=u&&c?function(e,i){let r,n=null,s=(0,a$.getDocumentElement)(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),o();let h=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=h;if(l||i(),!f||!p)return;let g={rootMargin:-(0,ld.floor)(d)+"px "+-(0,ld.floor)(s.clientWidth-(u+f))+"px "+-(0,ld.floor)(s.clientHeight-(d+p))+"px "+-(0,ld.floor)(u)+"px",threshold:(0,ld.max)(0,(0,ld.min)(1,c))||1},m=!0;function _(i){let n=i[0].intersectionRatio;if(n!==c){if(!m)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||lO(h,e.getBoundingClientRect())||a(),m=!1}try{n=new IntersectionObserver(_,{...g,root:s.ownerDocument})}catch(e){n=new IntersectionObserver(_,g)}n.observe(e)}(!0),o}(u,r):null,p=-1,g=null;l&&(g=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&g&&i&&(g.unobserve(i),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=g)||e.observe(i)})),r()}),u&&!h&&g.observe(u),i&&g.observe(i));let m=h?lk(e):null;return h&&function i(){let n=lk(e);m&&!lO(m,n)&&r(),m=n,s=requestAnimationFrame(i)}(),r(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=g)||e.disconnect(),g=null,h&&cancelAnimationFrame(s)}}var lN="u">typeof document?m.useLayoutEffect:function(){};function lI(e,i){let r,n,s;if(e===i)return!0;if(typeof e!=typeof i)return!1;if("function"==typeof e&&e.toString()===i.toString())return!0;if(e&&i&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==i.length)return!1;for(n=r;0!=n--;)if(!lI(e[n],i[n]))return!1;return!0}if((r=(s=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(i,s[n]))return!1;for(n=r;0!=n--;){let r=s[n];if(("_owner"!==r||!e.$$typeof)&&!lI(e[r],i[r]))return!1}return!0}return e!=e&&i!=i}function lF(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lz(e,i){let r=lF(e);return Math.round(i*r)/r}function lH(e){let i=m.useRef(e);return lN(()=>{i.current=e}),i}var lj=e.i(83799),lW=e.i(24019);let l$=m.createContext(void 0);function lU(){let e=m.useContext(l$);return e?.direction??"ltr"}e.s(["useDirection",0,lU],79144);let lq={name:"hide",async fn(e){var i,r,n;let s,{width:o,height:a,x:l,y:c}=e.rects.reference,h=await (void 0===(n=i)&&(n={}),{name:(s={name:"hide",options:n,async fn(e){let{rects:i,platform:r}=e,{strategy:s="referenceHidden",...o}=(0,ld.evaluate)(n,e);switch(s){case"referenceHidden":{let n=lm(await r.detectOverflow(e,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:n,referenceHidden:l_(n)}}}case"escaped":{let n=lm(await r.detectOverflow(e,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:n,escaped:l_(n)}}}default:return{}}}}).name,fn:s.fn,options:[i,r]}).fn(e);return{data:{referenceHidden:h.data?.referenceHidden||0===o&&0===a&&0===l&&0===c}}}};var lV=e.i(33848);let lK={sideX:"left",sideY:"top"},lY={name:"adaptiveOrigin",async fn(e){let{x:i,y:r,rects:{floating:n},elements:{floating:s},platform:o,strategy:a,placement:l}=e,c=(0,lV.ownerWindow)(s),h=c.getComputedStyle(s);if("0s"===h.transitionDuration||""===h.transitionDuration)return{x:i,y:r,data:lK};let u=await o.getOffsetParent?.(s),d={width:0,height:0};if("fixed"===a&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=(0,aQ.ownerDocument)(s);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await o.isElement?.(u)&&(d=await o.getDimensions(u));let f=(0,ld.getSide)(l),p=i,g=r;return"left"===f&&(p=d.width-(i+n.width)),"top"===f&&(g=d.height-(r+n.height)),{x:p,y:g,data:{sideX:"left"===f?"right":lK.sideX,sideY:"top"===f?"bottom":lK.sideY}}}};function lX(e,i,r){let n="inline-start"===e||"inline-end"===e;return({top:"top",right:n?r?"inline-start":"inline-end":"right",bottom:"bottom",left:n?r?"inline-end":"inline-start":"left"})[i]}function lG(e,i,r){let{rects:n,placement:s}=e;return{side:lX(i,(0,ld.getSide)(s),r),align:(0,ld.getAlignment)(s)||"center",anchor:{width:n.reference.width,height:n.reference.height},positioner:{width:n.floating.width,height:n.floating.height}}}function lJ(e){var i,r,n,s,o,a,l,c,h,u,d,f,p,g;let _,v,y,b,{anchor:S,positionMethod:w="absolute",side:x="bottom",sideOffset:C=0,align:k="center",alignOffset:E=0,collisionBoundary:R,collisionPadding:T=5,sticky:D=!1,arrowPadding:L=5,disableAnchorTracking:A=!1,keepMounted:P=!1,floatingRootContext:M,mounted:O,collisionAvoidance:B,shiftCrossAxis:N=!1,nodeId:I,adaptiveOrigin:F,lazyFlip:z=!1,externalTree:H}=e,[j,W]=m.useState(null);O||null===j||W(null);let $=B.side||"flip",U=B.align||"flip",q=B.fallbackAxisSide||"end",V="function"==typeof S?S:void 0,K=(0,az.useStableCallback)(V),Y=V?K:S,X=(0,aZ.useValueAsRef)(S),G="rtl"===lU(),J=j||({top:"top",right:"right",bottom:"bottom",left:"left","inline-end":G?"left":"right","inline-start":G?"right":"left"})[x],Z="center"===k?J:`${J}-${k}`,Q=T,ee=+("bottom"===x),et=+("top"===x),ei=+("right"===x),er=+("left"===x);"number"==typeof Q?Q={top:Q+ee,right:Q+er,bottom:Q+et,left:Q+ei}:Q&&(Q={top:(Q.top||0)+ee,right:(Q.right||0)+er,bottom:(Q.bottom||0)+et,left:(Q.left||0)+ei});let en={boundary:"clipping-ancestors"===R?"clippingAncestors":R,padding:Q},es=m.useRef(null),eo=(0,aZ.useValueAsRef)(C),ea=(0,aZ.useValueAsRef)(E),el=[(i=e=>{let i=lG(e,x,G),r="function"==typeof eo.current?eo.current(i):eo.current,n="function"==typeof ea.current?ea.current(i):ea.current;return{mainAxis:r,crossAxis:n,alignmentAxis:n}},r=["function"!=typeof C?C:0,"function"!=typeof E?E:0,G,x],void 0===(n=i)&&(n=0),{name:(_={name:"offset",options:n,async fn(e){var i,r;let{x:s,y:o,placement:a,middlewareData:l}=e,c=await ly(e,n);return a===(null==(i=l.offset)?void 0:i.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:s+c.x,y:o+c.y,data:{...c,placement:a}}}}).name,fn:_.fn,options:[i,r]})],ec="none"===U&&"shift"!==$,eh=!ec&&(D||N||"shift"===$),eu="none"===$?null:{name:(v={name:"flip",options:a=s={...en,padding:{top:Q.top+1,right:Q.right+1,bottom:Q.bottom+1,left:Q.left+1},mainAxis:!N&&"flip"===$,crossAxis:"flip"===U&&"alignment",fallbackAxisSideDirection:q},async fn(e){var i,r,n,s,o;let{placement:l,middlewareData:c,rects:h,initialPlacement:u,platform:d,elements:f}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...b}=(0,ld.evaluate)(a,e);if(null!=(i=c.arrow)&&i.alignmentOffset)return{};let S=(0,ld.getSide)(l),w=(0,ld.getSideAxis)(u),x=(0,ld.getSide)(u)===u,C=await (null==d.isRTL?void 0:d.isRTL(f.floating)),k=m||(x||!y?[(0,ld.getOppositePlacement)(u)]:(0,ld.getExpandedPlacements)(u)),E="none"!==v;!m&&E&&k.push(...(0,ld.getOppositeAxisPlacements)(u,y,v,C));let R=[u,...k],T=await d.detectOverflow(e,b),D=[],L=(null==(r=c.flip)?void 0:r.overflows)||[];if(p&&D.push(T[S]),g){let e=(0,ld.getAlignmentSides)(l,h,C);D.push(T[e[0]],T[e[1]])}if(L=[...L,{placement:l,overflows:D}],!D.every(e=>e<=0)){let e=((null==(n=c.flip)?void 0:n.index)||0)+1,i=R[e];if(i&&("alignment"!==g||w===(0,ld.getSideAxis)(i)||L.every(e=>(0,ld.getSideAxis)(e.placement)!==w||e.overflows[0]>0)))return{data:{index:e,overflows:L},reset:{placement:i}};let r=null==(s=L.filter(e=>e.overflows[0]<=0).sort((e,i)=>e.overflows[1]-i.overflows[1])[0])?void 0:s.placement;if(!r)switch(_){case"bestFit":{let e=null==(o=L.filter(e=>{if(E){let i=(0,ld.getSideAxis)(e.placement);return i===w||"y"===i}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,i)=>e+i,0)]).sort((e,i)=>e[1]-i[1])[0])?void 0:o[0];e&&(r=e);break}case"initialPlacement":r=u}if(l!==r)return{reset:{placement:r}}}return{}}}).name,fn:v.fn,options:[s,o]},ed=ec?null:(l=e=>{var i,r,n;let s=(0,aQ.ownerDocument)(e.elements.floating).documentElement;return{...en,rootBoundary:N?{x:0,y:0,width:s.clientWidth,height:s.clientHeight}:void 0,mainAxis:"none"!==U,crossAxis:eh,limiter:D||N?void 0:{fn:(void 0===(n=i=e=>{if(!es.current)return{};let{width:i,height:r}=es.current.getBoundingClientRect(),n=(0,ld.getSideAxis)((0,ld.getSide)(e.placement)),s="y"===n?Q.left+Q.right:Q.top+Q.bottom;return{offset:("y"===n?i:r)/2+s/2}})&&(n={}),{options:n,fn(e){let{x:i,y:r,placement:s,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:c=!0,crossAxis:h=!0}=(0,ld.evaluate)(n,e),u={x:i,y:r},d=(0,ld.getSideAxis)(s),f=(0,ld.getOppositeAxis)(d),p=u[f],g=u[d],m=(0,ld.evaluate)(l,e),_="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){let e="y"===f?"height":"width",i=o.reference[f]-o.floating[e]+_.mainAxis,r=o.reference[f]+o.reference[e]-_.mainAxis;p<i?p=i:p>r&&(p=r)}if(h){var v,y;let e="y"===f?"width":"height",i=lv.has((0,ld.getSide)(s)),r=o.reference[d]-o.floating[e]+(i&&(null==(v=a.offset)?void 0:v[d])||0)+(i?0:_.crossAxis),n=o.reference[d]+o.reference[e]+(i?0:(null==(y=a.offset)?void 0:y[d])||0)-(i?_.crossAxis:0);g<r?g=r:g>n&&(g=n)}return{[f]:p,[d]:g}}}).fn,options:[i,r]}}},c=[en,D,N,Q,U],void 0===(h=l)&&(h={}),{name:(y={name:"shift",options:h,async fn(e){let{x:i,y:r,placement:n,platform:s}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:i,y:r}=e;return{x:i,y:r}}},...c}=(0,ld.evaluate)(h,e),u={x:i,y:r},d=await s.detectOverflow(e,c),f=(0,ld.getSideAxis)((0,ld.getSide)(n)),p=(0,ld.getOppositeAxis)(f),g=u[p],m=u[f];if(o){let e="y"===p?"top":"left",i="y"===p?"bottom":"right",r=g+d[e],n=g-d[i];g=(0,ld.clamp)(r,g,n)}if(a){let e="y"===f?"top":"left",i="y"===f?"bottom":"right",r=m+d[e],n=m-d[i];m=(0,ld.clamp)(r,m,n)}let _=l.fn({...e,[p]:g,[f]:m});return{..._,data:{x:_.x-i,y:_.y-r,enabled:{[p]:o,[f]:a}}}}}).name,fn:y.fn,options:[l,c]});"shift"===$||"shift"===U||"center"===k?el.push(ed,eu):el.push(eu,ed),el.push({name:(b={name:"size",options:f=u={...en,apply({elements:{floating:e},availableWidth:i,availableHeight:r,rects:n}){let s=e.style;s.setProperty("--available-width",`${i}px`),s.setProperty("--available-height",`${r}px`);let o=window.devicePixelRatio||1,{x:a,y:l,width:c,height:h}=n.reference,u=(Math.round((a+c)*o)-Math.round(a*o))/o,d=(Math.round((l+h)*o)-Math.round(l*o))/o;s.setProperty("--anchor-width",`${u}px`),s.setProperty("--anchor-height",`${d}px`)}},async fn(e){var i,r;let n,s,{placement:o,rects:a,platform:l,elements:c}=e,{apply:h=()=>{},...u}=(0,ld.evaluate)(f,e),d=await l.detectOverflow(e,u),p=(0,ld.getSide)(o),g=(0,ld.getAlignment)(o),m="y"===(0,ld.getSideAxis)(o),{width:_,height:v}=a.floating;"top"===p||"bottom"===p?(n=p,s=g===(await (null==l.isRTL?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(s=p,n="end"===g?"top":"bottom");let y=v-d.top-d.bottom,b=_-d.left-d.right,S=(0,ld.min)(v-d[n],y),w=(0,ld.min)(_-d[s],b),x=!e.middlewareData.shift,C=S,k=w;if(null!=(i=e.middlewareData.shift)&&i.enabled.x&&(k=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(C=y),x&&!g){let e=(0,ld.max)(d.left,0),i=(0,ld.max)(d.right,0),r=(0,ld.max)(d.top,0),n=(0,ld.max)(d.bottom,0);m?k=_-2*(0!==e||0!==i?e+i:(0,ld.max)(d.left,d.right)):C=v-2*(0!==r||0!==n?r+n:(0,ld.max)(d.top,d.bottom))}await h({...e,availableWidth:k,availableHeight:C});let E=await l.getDimensions(c.floating);return _!==E.width||v!==E.height?{reset:{rects:!0}}:{}}}).name,fn:b.fn,options:[u,d]},(p=()=>({element:es.current||document.createElement("div"),padding:L,offsetParent:"floating"}),g=[L],{name:"arrow",options:p,async fn(e){let{x:i,y:r,placement:n,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:c,padding:h=0,offsetParent:u="real"}=(0,ld.evaluate)(p,e)||{};if(null==c)return{};let d=(0,ld.getPaddingObject)(h),f={x:i,y:r},g=(0,ld.getAlignmentAxis)(n),m=(0,ld.getAxisLength)(g),_=await o.getDimensions(c),v="y"===g,y=v?"clientHeight":"clientWidth",b=s.reference[m]+s.reference[g]-f[g]-s.floating[m],S=f[g]-s.reference[g],w="real"===u?await o.getOffsetParent?.(c):a.floating,x=a.floating[y]||s.floating[m];x&&await o.isElement?.(w)||(x=a.floating[y]||s.floating[m]);let C=x/2-_[m]/2-1,k=Math.min(d[v?"top":"left"],C),E=Math.min(d[v?"bottom":"right"],C),R=x-_[m]-E,T=x/2-_[m]/2+(b/2-S/2),D=(0,ld.clamp)(k,T,R),L=!l.arrow&&null!=(0,ld.getAlignment)(n)&&T!==D&&s.reference[m]/2-(T<k?k:E)-_[m]/2<0,A=L?T<k?T-k:T-R:0;return{[g]:f[g]+A,data:{[g]:D,centerOffset:T-D-A,...L&&{alignmentOffset:A}},reset:L}},options:[p,g]}),{name:"transformOrigin",fn(e){let{elements:i,middlewareData:r,placement:n,rects:s,y:o}=e,a=(0,ld.getSide)(n),l=(0,ld.getSideAxis)(a),c=es.current,h=r.arrow?.x||0,u=r.arrow?.y||0,d=c?.clientWidth||0,f=c?.clientHeight||0,p=h+d/2,g=u+f/2,m=Math.abs(r.shift?.y||0),_=s.reference.height/2,v="function"==typeof C?C(lG(e,x,G)):C,y=m>v,b={top:`${p}px calc(100% + ${v}px)`,bottom:`${p}px ${-v}px`,left:`calc(100% + ${v}px) ${g}px`,right:`${-v}px ${g}px`}[a],S=`${p}px ${s.reference.y+_-o}px`;return i.floating.style.setProperty("--transform-origin",eh&&"y"===l&&y?S:b),{}}},lq,F),(0,lc.useIsoLayoutEffect)(()=>{!O&&M&&M.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[O,M]);let ef=m.useMemo(()=>({elementResize:!A&&"u">typeof ResizeObserver,layoutShift:!A&&"u">typeof IntersectionObserver}),[A]),{refs:ep,elements:eg,x:em,y:e_,middlewareData:ev,update:ey,placement:eb,context:eS,isPositioned:ew,floatingStyles:ex}=function(e={}){let{nodeId:i,externalTree:r}=e,n=function(e){let{open:i=!1,onOpenChange:r,elements:n={}}=e,s=(0,lj.useId)(),o=null!=(0,av.useFloatingParentNodeId)(),a=(0,aR.useRefWithInit)(()=>new lW.FloatingRootStore({open:i,onOpenChange:r,referenceElement:n.reference??null,floatingElement:n.floating??null,triggerElements:new aA.PopupTriggerMap,floatingId:s,nested:o,noEmit:!1})).current;return(0,lc.useIsoLayoutEffect)(()=>{let e={open:i,floatingId:s};void 0!==n.reference&&(e.referenceElement=n.reference,e.domReferenceElement=(0,a$.isElement)(n.reference)?n.reference:null),void 0!==n.floating&&(e.floatingElement=n.floating),a.update(e)},[i,s,n.reference,n.floating,a]),a.context.onOpenChange=r,a.context.nested=o,a.context.noEmit=!1,a}(e),s=e.rootContext||n,o={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[a,l]=m.useState(null),c=m.useRef(null),h=(0,av.useFloatingTree)(r);(0,lc.useIsoLayoutEffect)(()=>{o.domReference&&(c.current=o.domReference)},[o.domReference]);let u=function(e){void 0===e&&(e={});let{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:a}={},transform:l=!0,whileElementsMounted:c,open:h}=e,[u,d]=m.useState({x:0,y:0,strategy:r,placement:i,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(n);lI(f,n)||p(n);let[g,_]=m.useState(null),[v,y]=m.useState(null),b=m.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),S=m.useCallback(e=>{e!==k.current&&(k.current=e,y(e))},[]),w=o||g,x=a||v,C=m.useRef(null),k=m.useRef(null),E=m.useRef(u),R=null!=c,T=lH(c),D=lH(s),L=lH(h),A=m.useCallback(()=>{var e,n;let s,o,a;if(!C.current||!k.current)return;let l={placement:i,strategy:r,middleware:f};D.current&&(l.platform=D.current),(e=C.current,n=k.current,s=new Map,a={...(o={platform:lM,...l}).platform,_c:s},lg(e,n,{...o,platform:a})).then(e=>{let i={...e,isPositioned:!1!==L.current};P.current&&!lI(E.current,i)&&(E.current=i,ax.flushSync(()=>{d(i)}))})},[f,i,r,D,L]);lN(()=>{!1===h&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[h]);let P=m.useRef(!1);lN(()=>(P.current=!0,()=>{P.current=!1}),[]),lN(()=>{if(w&&(C.current=w),x&&(k.current=x),w&&x){if(T.current)return T.current(w,x,A);A()}},[w,x,A,T,R]);let M=m.useMemo(()=>({reference:C,floating:k,setReference:b,setFloating:S}),[b,S]),O=m.useMemo(()=>({reference:w,floating:x}),[w,x]),B=m.useMemo(()=>{let e={position:r,left:0,top:0};if(!O.floating)return e;let i=lz(O.floating,u.x),n=lz(O.floating,u.y);return l?{...e,transform:"translate("+i+"px, "+n+"px)",...lF(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:i,top:n}},[r,l,O.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:A,refs:M,elements:O,floatingStyles:B}),[u,A,M,O,B])}({...e,elements:{...o,...a&&{reference:a}}}),d=m.useCallback(e=>{let i=(0,a$.isElement)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(i),u.refs.setReference(i)},[u.refs]),[f,p]=m.useState(null),[g,_]=m.useState(null);s.useSyncedValue("referenceElement",f),s.useSyncedValue("domReferenceElement",(0,a$.isElement)(f)?f:null),s.useSyncedValue("floatingElement",g);let v=m.useCallback(e=>{((0,a$.isElement)(e)||null===e)&&(c.current=e,p(e)),((0,a$.isElement)(u.refs.reference.current)||null===u.refs.reference.current||null!==e&&!(0,a$.isElement)(e))&&u.refs.setReference(e)},[u.refs,p]),y=m.useCallback(e=>{_(e),u.refs.setFloating(e)},[u.refs]),b=m.useMemo(()=>({...u.refs,setReference:v,setFloating:y,setPositionReference:d,domReference:c}),[u.refs,v,y,d]),S=m.useMemo(()=>({...u.elements,domReference:o.domReference}),[u.elements,o.domReference]),w=s.useState("open"),x=s.useState("floatingId"),C=m.useMemo(()=>({...u,dataRef:s.context.dataRef,open:w,onOpenChange:s.setOpen,events:s.context.events,floatingId:x,refs:b,elements:S,nodeId:i,rootStore:s}),[u,b,S,i,s,w,x]);return(0,lc.useIsoLayoutEffect)(()=>{s.context.dataRef.current.floatingContext=C;let e=h?.nodesRef.current.find(e=>e.id===i);e&&(e.context=C)}),m.useMemo(()=>({...u,context:C,refs:b,elements:S,rootStore:s}),[u,b,S,C,s])}({rootContext:M,placement:Z,middleware:el,strategy:w,whileElementsMounted:P?void 0:(...e)=>lB(...e,ef),nodeId:I,externalTree:H}),{sideX:eC,sideY:ek}=ev.adaptiveOrigin||lK,eE=ew?w:"fixed",eR=m.useMemo(()=>{let e=F?{position:eE,[eC]:em,[ek]:e_}:{position:eE,...ex};return ew||(e.opacity=0),e},[F,eE,eC,em,ek,e_,ex,ew]),eT=m.useRef(null);(0,lc.useIsoLayoutEffect)(()=>{if(!O)return;let e=X.current,i="function"==typeof e?e():e,r=(lZ(i)?i.current:i)||null;r!==eT.current&&(ep.setPositionReference(r),eT.current=r)},[O,ep,Y,X]),m.useEffect(()=>{if(!O)return;let e=X.current;"function"!=typeof e&&lZ(e)&&e.current!==eT.current&&(ep.setPositionReference(e.current),eT.current=e.current)},[O,ep,Y,X]),m.useEffect(()=>{if(P&&O&&eg.domReference&&eg.floating)return lB(eg.domReference,eg.floating,ey,ef)},[P,O,eg,ey,ef]);let eD=(0,ld.getSide)(eb),eL=lX(x,eD,G),eA=(0,ld.getAlignment)(eb)||"center",eP=!!ev.hide?.referenceHidden;(0,lc.useIsoLayoutEffect)(()=>{z&&O&&ew&&W(eD)},[z,O,ew,eD]);let eM=m.useMemo(()=>({position:"absolute",top:ev.arrow?.y,left:ev.arrow?.x}),[ev.arrow]),eO=ev.arrow?.centerOffset!==0;return m.useMemo(()=>({positionerStyles:eR,arrowStyles:eM,arrowRef:es,arrowUncentered:eO,side:eL,align:eA,physicalSide:eD,anchorHidden:eP,refs:ep,context:eS,isPositioned:ew,update:ey}),[eR,eM,es,eO,eL,eA,eD,eP,ep,eS,ew,ey])}function lZ(e){return null!=e&&"current"in e}e.s(["DEFAULT_SIDES",0,lK,"adaptiveOrigin",0,lY],67569),e.s(["useAnchorPositioning",0,lJ],56590);var lQ=e.i(36893),l0=e.i(77817),l1=e.i(17514);function l2(e){return"starting"===e?aP.DISABLED_TRANSITIONS_STYLE:l1.EMPTY_OBJECT}e.s(["getDisabledMountTransitionStyles",0,l2],18847);let l5=m.forwardRef(function(e,i){let{render:r,className:n,anchor:s,positionMethod:o="absolute",side:a="bottom",align:l="center",sideOffset:c=0,alignOffset:h=0,collisionBoundary:u="clipping-ancestors",collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:_=!1,collisionAvoidance:v=aP.POPUP_COLLISION_AVOIDANCE,...y}=e,{store:b}=aw(),S=function(){let e=m.useContext(lo);if(void 0===e)throw Error((0,ab.default)(45));return e}(),w=(0,av.useFloatingNodeId)(),x=b.useState("floatingRootContext"),C=b.useState("mounted"),k=b.useState("open"),E=b.useState("openChangeReason"),R=b.useState("activeTriggerElement"),T=b.useState("modal"),D=b.useState("positionerElement"),L=b.useState("instantType"),A=b.useState("transitionStatus"),P=b.useState("hasViewport"),M=m.useRef(null),O=(0,l0.useAnimationsFinished)(D,!1,!1),B=lJ({anchor:s,floatingRootContext:x,positionMethod:o,mounted:C,side:a,sideOffset:c,align:l,alignOffset:h,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:_,keepMounted:S,nodeId:w,collisionAvoidance:v,adaptiveOrigin:P?lY:void 0}),N=m.useMemo(()=>{let e={};return k||(e.pointerEvents="none"),{role:"presentation",hidden:!C,style:{...B.positionerStyles,...e}}},[k,C,B.positionerStyles]),I=m.useMemo(()=>({props:N,...B}),[N,B]),F=x.useState("domReferenceElement");(0,lc.useIsoLayoutEffect)(()=>{let e=M.current;if(F&&(M.current=F),e&&F&&F!==e){b.set("instantType",void 0);let e=new AbortController;return O(()=>{b.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[F,O,b]);let z={open:k,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:L},H=m.useCallback(e=>{b.set("positionerElement",e)},[b]),j=(0,aW.useRenderElement)("div",e,{state:z,props:[I.props,l2(A),y],ref:[i,H],stateAttributesMapping:aj.popupStateMapping});return(0,g.jsxs)(lh.Provider,{value:I,children:[C&&!0===T&&E!==aD.REASONS.triggerHover&&(0,g.jsx)(lQ.InternalBackdrop,{ref:b.context.internalBackdropRef,inert:(0,ll.inertValue)(!k),cutout:R}),(0,g.jsx)(av.FloatingNode,{id:w,children:j})]})});var l3=e.i(88306);function l4(e,i={}){let r="rootStore"in e?e.rootStore:e,n=r.useState("open"),s=r.useState("floatingElement"),o=r.useState("domReferenceElement"),{dataRef:a}=r.context,{enabled:l=!0,closeDelay:c=0}=i,h=a4(r),u=(0,av.useFloatingTree)(),d=(0,av.useFloatingParentNodeId)(),f=(0,az.useStableCallback)(()=>a8(a.current.openEvent?.type,h.interactedInside)),p=(0,az.useStableCallback)(()=>{let e=a.current.openEvent?.type;return e?.includes("mouse")&&"mousedown"!==e}),g=(0,az.useStableCallback)(e=>(0,aU.isTargetInsideEnabledTrigger)(e,r.context.triggerElements)),_=m.useCallback(e=>{let i=a6(c,"close",h.pointerType),n=()=>{r.setOpen(!1,(0,aB.createChangeEventDetails)(aD.REASONS.triggerHover,e)),u?.events.emit("floating.closed",e)};i?h.openChangeTimeout.start(i,n):(h.openChangeTimeout.clear(),n())},[c,r,h,u]),v=(0,az.useStableCallback)(()=>{a3(h)}),y=(0,az.useStableCallback)(e=>{let i=(0,aU.getTarget)(e);if(!(i&&i.closest(a2))){h.interactedInside=!1;return}h.interactedInside=i?.closest("[aria-haspopup]")!=null});(0,lc.useIsoLayoutEffect)(()=>{n||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[n,h,v]),m.useEffect(()=>v,[v]),(0,lc.useIsoLayoutEffect)(()=>{if(l&&n&&h.handleCloseOptions?.blockPointerEvents&&p()&&(0,a$.isElement)(o)&&s){let e=(0,aQ.ownerDocument)(s),i=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;i&&(i.style.pointerEvents="");let r=h.handleCloseOptions?.getScope?.()??h.pointerEventsScopeElement??i??o.closest("[data-rootownerid]")??e.body;return!function(e,i){let{scopeElement:r,referenceElement:n,floatingElement:s}=i;a3(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=r,e.pointerEventsReferenceElement=n,e.pointerEventsFloatingElement=s,r.style.pointerEvents="none",n.style.pointerEvents="auto",s.style.pointerEvents="auto"}(h,{scopeElement:r,referenceElement:o,floatingElement:s}),()=>{v()}}},[l,n,o,s,h,p,u,d,v]);let b=(0,aE.useTimeout)();m.useEffect(()=>{if(l)return s&&(s.addEventListener("mouseenter",e),s.addEventListener("mouseleave",i),s.addEventListener("pointerdown",y,!0)),()=>{s&&(s.removeEventListener("mouseenter",e),s.removeEventListener("mouseleave",i),s.removeEventListener("pointerdown",y,!0)),u?.events.off("floating.closed",n)};function e(){h.openChangeTimeout.clear(),b.clear(),u?.events.off("floating.closed",n),v()}function i(e){if(u&&d&&(0,aq.getNodeChildren)(u.nodesRef.current,d).length>0)return void u.events.on("floating.closed",n);if(!g(e.relatedTarget)){if(h.handler)return void h.handler(e);v(),f()||_(e)}}function n(e){u&&d&&!((0,aq.getNodeChildren)(u.nodesRef.current,d).length>0)&&b.start(0,()=>{u.events.off("floating.closed",n),r.setOpen(!1,(0,aB.createChangeEventDetails)(aD.REASONS.triggerHover,e)),u.events.emit("floating.closed",e)})}},[l,s,r,a,f,g,_,v,y,h,u,d,b])}e.s(["useHoverFloatingInteraction",0,l4],61896);var l6=e.i(84759),l9=e.i(89269),l8=e.i(92238);let l7=m.createContext(void 0);function ce(e){let i=m.useContext(l7);if(void 0===i&&!e)throw Error((0,ab.default)(69));return i}e.s(["useToolbarRootContext",0,ce],60752);let ct=m.createContext(void 0);function ci(e){let{value:i,children:r}=e;return(0,g.jsx)(ct.Provider,{value:i,children:r})}let cr={...aj.popupStateMapping,...l6.transitionStatusMapping},cn=m.forwardRef(function(e,i){let{className:r,render:n,initialFocus:s,finalFocus:o,...a}=e,{store:l}=aw(),c=lu(),h=null!=ce(!0),{context:u,hasClosePart:d}=function(){let[e,i]=m.useState(0),r=(0,az.useStableCallback)(()=>(i(e=>e+1),()=>{i(e=>Math.max(0,e-1))}));return{context:m.useMemo(()=>({register:r}),[r]),hasClosePart:e>0}}(),f=l.useState("open"),p=l.useState("openMethod"),_=l.useState("instantType"),v=l.useState("transitionStatus"),y=l.useState("popupProps"),b=l.useState("titleElementId"),S=l.useState("descriptionElementId"),w=l.useState("modal"),x=l.useState("mounted"),C=l.useState("openChangeReason"),k=l.useState("activeTriggerElement"),E=l.useState("floatingRootContext");(0,l9.useOpenChangeComplete)({open:f,ref:l.context.popupRef,onComplete(){f&&l.context.onOpenChangeComplete?.(!0)}});let R=l.useState("disabled");l4(E,{enabled:l.useState("openOnHover")&&!R,closeDelay:l.useState("closeDelay")});let T=void 0===s?function(e){return"touch"!==e||l.context.popupRef.current}:s,D={open:f,side:c.side,align:c.align,instant:_,transitionStatus:v},L=m.useCallback(e=>{l.set("popupElement",e)},[l]),A=(0,aW.useRenderElement)("div",e,{state:D,ref:[i,l.context.popupRef,L],props:[y,{"aria-labelledby":b,"aria-describedby":S,onKeyDown(e){h&&l8.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},l2(v),a],stateAttributesMapping:cr});return(0,g.jsx)(l3.FloatingFocusManager,{context:E,openInteractionType:p,modal:!1!==w&&d,disabled:!x||C===aD.REASONS.triggerHover,initialFocus:T,returnFocus:o,restoreFocus:"popup",previousFocusableElement:(0,a$.isHTMLElement)(k)?k:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:(0,g.jsx)(ci,{value:u,children:A})})}),cs=m.forwardRef(function(e,i){let{className:r,render:n,...s}=e,{store:o}=aw(),a=o.useState("open"),{arrowRef:l,side:c,align:h,arrowUncentered:u,arrowStyles:d}=lu();return(0,aW.useRenderElement)("div",e,{state:{open:a,side:c,align:h,uncentered:u},ref:[i,l],props:[{style:d,"aria-hidden":!0},s],stateAttributesMapping:aj.popupStateMapping})}),co={...aj.popupStateMapping,...l6.transitionStatusMapping},ca=m.forwardRef(function(e,i){let{className:r,render:n,...s}=e,{store:o}=aw(),a=o.useState("open"),l=o.useState("mounted"),c=o.useState("transitionStatus"),h=o.useState("openChangeReason");return(0,aW.useRenderElement)("div",e,{state:{open:a,transitionStatus:c},ref:[o.context.backdropRef,i],props:[{role:"presentation",hidden:!l,style:{pointerEvents:h===aD.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:co})}),cl=m.forwardRef(function(e,i){let{render:r,className:n,...s}=e,{store:o}=aw(),a=(0,lt.useBaseUiId)(s.id);return(0,lc.useIsoLayoutEffect)(()=>(o.set("titleElementId",a),()=>{o.set("titleElementId",void 0)}),[o,a]),(0,aW.useRenderElement)("h2",e,{ref:i,props:[{id:a},s]})}),cc=m.forwardRef(function(e,i){let{render:r,className:n,...s}=e,{store:o}=aw(),a=(0,lt.useBaseUiId)(s.id);return(0,lc.useIsoLayoutEffect)(()=>(o.set("descriptionElementId",a),()=>{o.set("descriptionElementId",void 0)}),[o,a]),(0,aW.useRenderElement)("p",e,{ref:i,props:[{id:a},s]})}),ch=m.forwardRef(function(e,i){let r,{render:n,className:s,disabled:o=!1,nativeButton:a=!0,...l}=e,{buttonRef:c,getButtonProps:h}=(0,aH.useButton)({disabled:o,focusableWhenDisabled:!1,native:a}),{store:u}=aw();return r=m.useContext(ct),(0,lc.useIsoLayoutEffect)(()=>r?.register(),[r]),(0,aW.useRenderElement)("button",e,{ref:[i,c],props:[{onClick(e){u.setOpen(!1,(0,aB.createChangeEventDetails)(aD.REASONS.closePress,e.nativeEvent,e.currentTarget))}},l,h]})}),cu=((s={}).popupWidth="--popup-width",s.popupHeight="--popup-height",s);var cd=e.i(47135);function cf(e){let i=(0,a$.getComputedStyle)(e),r=parseFloat(i.width)||0,n=parseFloat(i.height)||0,s=(0,a$.isHTMLElement)(e),o=s?e.offsetWidth:r,a=s?e.offsetHeight:n;return((0,ld.round)(r)!==o||(0,ld.round)(n)!==a)&&(r=o,n=a),{width:r,height:n}}let cp=()=>!0;function cg(e,i,r){let n=e.style.getPropertyValue(i);return e.style.setProperty(i,r),()=>{e.style.setProperty(i,n)}}function cm(e,i){let r=[];for(let[n,s]of Object.entries(i))r.push(cg(e,n,s));return r.length?()=>{r.forEach(e=>e())}:l1.NOOP}function c_(e,i){let r="auto"===i?"auto":`${i.width}px`,n="auto"===i?"auto":`${i.height}px`;e.style.setProperty("--popup-width",r),e.style.setProperty("--popup-height",n)}function cv(e,i){let r="max-content"===i?"max-content":`${i.width}px`,n="max-content"===i?"max-content":`${i.height}px`;e.style.setProperty("--positioner-width",r),e.style.setProperty("--positioner-height",n)}function cy(e){let i,{store:r,side:n,cssVars:s,children:o}=e,a=lU(),l=r.useState("activeTriggerElement"),c=r.useState("activeTriggerId"),h=r.useState("open"),u=r.useState("payload"),d=r.useState("mounted"),f=r.useState("popupElement"),p=r.useState("positionerElement"),_=function(e){let[i,r]=m.useState({current:e,previous:null});return e!==i.current&&r({current:e,previous:i.current}),i.previous}(h?l:null),v=function(e,i){let[r,n]=m.useState(0),s=m.useRef(e),o=m.useRef(i),a=m.useRef(!1);return(0,lc.useIsoLayoutEffect)(()=>{let r=s.current,l=i!==o.current;e!==r?(n(e=>e+1),a.current=!l):a.current&&l&&(n(e=>e+1),a.current=!1),s.current=e,o.current=i},[e,i]),`${e??"current"}-${r}`}(c,u),y=m.useRef(null),[b,S]=m.useState(null),[w,x]=m.useState(null),C=m.useRef(null),k=m.useRef(null),E=(0,l0.useAnimationsFinished)(C,!0,!1),R=(0,cd.useAnimationFrame)(),[T,D]=m.useState(null),[L,A]=m.useState(!1);(0,lc.useIsoLayoutEffect)(()=>(r.set("hasViewport",!0),()=>{r.set("hasViewport",!1)}),[r]);let P=(0,az.useStableCallback)(()=>{C.current?.style.setProperty("animation","none"),C.current?.style.setProperty("transition","none"),k.current?.style.setProperty("display","none")}),M=(0,az.useStableCallback)(e=>{C.current?.style.removeProperty("animation"),C.current?.style.removeProperty("transition"),k.current?.style.removeProperty("display"),e&&D(e)}),O=m.useRef(null);(0,lc.useIsoLayoutEffect)(()=>{var e,i;let r,n,s,o;l&&_&&l!==_&&O.current!==l&&y.current&&(S(y.current),A(!0),x((e=_,i=l,r=e.getBoundingClientRect(),n=i.getBoundingClientRect(),s={x:r.left+r.width/2,y:r.top+r.height/2},{horizontal:(o={x:n.left+n.width/2,y:n.top+n.height/2}).x-s.x,vertical:o.y-s.y})),R.request(()=>{ax.flushSync(()=>{A(!1)}),E(()=>{S(null),D(null),y.current=null})}),O.current=l)},[l,_,b,E,R]),(0,lc.useIsoLayoutEffect)(()=>{let e=C.current;if(!e)return;let i=document.createElement("div");for(let r of Array.from(e.childNodes))i.appendChild(r.cloneNode(!0));y.current=i});let B=null!=b;return i=B?(0,g.jsxs)(m.Fragment,{children:[(0,g.jsx)("div",{"data-previous":!0,inert:(0,ll.inertValue)(!0),ref:k,style:{...T?{[s.popupWidth]:`${T.width}px`,[s.popupHeight]:`${T.height}px`}:null,position:"absolute"},"data-ending-style":L?void 0:""},"previous"),(0,g.jsx)("div",{"data-current":!0,ref:C,"data-starting-style":L?"":void 0,children:o},v)]}):(0,g.jsx)("div",{"data-current":!0,ref:C,children:o},v),(0,lc.useIsoLayoutEffect)(()=>{let e=k.current;e&&b&&e.replaceChildren(...Array.from(b.childNodes))},[b]),!function(e){let{popupElement:i,positionerElement:r,content:n,mounted:s,enabled:o=cp,onMeasureLayout:a,onMeasureLayoutComplete:l,side:c,direction:h}=e,u=(0,l0.useAnimationsFinished)(i,!0,!1),d=(0,cd.useAnimationFrame)(),f=m.useRef(null),p=m.useRef(null),g=m.useRef(!0),_=m.useRef(l1.NOOP),v=(0,az.useStableCallback)(a),y=(0,az.useStableCallback)(l),b=m.useMemo(()=>{let e="top"===c,i="left"===c;return"rtl"===h?(e=e||"inline-end"===c,i=i||"inline-end"===c):(e=e||"inline-start"===c,i=i||"inline-start"===c),e?{position:"absolute",["top"===c?"bottom":"top"]:"0",[i?"right":"left"]:"0"}:l1.EMPTY_OBJECT},[c,h]);(0,lc.useIsoLayoutEffect)(()=>{if(!s||!o()||"function"!=typeof ResizeObserver){_.current=l1.NOOP,g.current=!0,f.current=null,p.current=null;return}if(!i||!r)return;_.current=cm(i,b);let e=new ResizeObserver(e=>{let i=e[0];i&&(p.current={width:Math.ceil(i.borderBoxSize[0].inlineSize),height:Math.ceil(i.borderBoxSize[0].blockSize)})});e.observe(i),c_(i,"auto");let n=cg(i,"position","static"),a=cg(i,"transform","none"),l=cg(i,"scale","1"),c=cm(r,{"--available-width":"max-content","--available-height":"max-content"});function h(){n(),a(),c(),l()}if(v?.(),g.current||null===f.current){cv(r,"max-content");let n=cf(i);return f.current=n,cv(r,n),h(),y?.(null,n),g.current=!1,()=>{e.disconnect(),_.current(),_.current=l1.NOOP}}c_(i,"auto"),cv(r,"max-content");let m=f.current??p.current,S=cf(i);if(f.current=S,!m)return cv(r,S),h(),y?.(null,S),()=>{e.disconnect(),d.cancel(),_.current(),_.current=l1.NOOP};c_(i,m),h(),y?.(m,S),cv(r,S);let w=new AbortController;return d.request(()=>{c_(i,S),u(()=>{i.style.setProperty("--popup-width","auto"),i.style.setProperty("--popup-height","auto")},w.signal)}),()=>{e.disconnect(),w.abort(),d.cancel(),_.current(),_.current=l1.NOOP}},[n,i,r,u,d,o,s,v,y,b])}({popupElement:f,positionerElement:p,mounted:d,content:u,onMeasureLayout:P,onMeasureLayoutComplete:M,side:n,direction:a}),{children:i,state:{activationDirection:function(e){if(e)return`${function(e,i,r,n){return e>i?r:e<-i?n:""}(e.horizontal,5,"right","left")} ${function(e,i,r,n){return e>i?r:e<-i?n:""}(e.vertical,5,"down","up")}`}(w),transitioning:B}}}e.s(["usePopupViewport",0,cy],12666);let cb={activationDirection:e=>e?{"data-activation-direction":e}:null},cS=m.forwardRef(function(e,i){let{render:r,className:n,children:s,...o}=e,{store:a}=aw(),{side:l}=lu(),c=a.useState("instantType"),{children:h,state:u}=cy({store:a,side:l,cssVars:cu,children:s}),d={activationDirection:u.activationDirection,transitioning:u.transitioning,instant:c};return(0,aW.useRenderElement)("div",e,{state:d,ref:i,props:[o,{children:h}],stateAttributesMapping:cb})});class cw{constructor(){this.store=new aO}open(e){let i=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!i)throw Error((0,ab.default)(80,e));this.store.setOpen(!0,(0,aB.createChangeEventDetails)(aD.REASONS.imperativeAction,void 0,i))}close(){this.store.setOpen(!1,(0,aB.createChangeEventDetails)(aD.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Arrow",0,cs,"Backdrop",0,ca,"Close",0,ch,"Description",0,cc,"Handle",0,cw,"Popup",0,cn,"Portal",0,la,"Positioner",0,l5,"Root",0,function(e){return aw(!0)?(0,g.jsx)(aF,{props:e}):(0,g.jsx)(av.FloatingTree,{children:(0,g.jsx)(aF,{props:e})})},"Title",0,cl,"Trigger",0,ln,"Viewport",0,cS,"createHandle",0,function(){return new cw}],7311);var cx=e.i(7311),cx=cx,cC=e.i(52088);function ck({...e}){return(0,g.jsx)(cx.Root,{"data-slot":"popover",...e})}function cE({...e}){return(0,g.jsx)(cx.Trigger,{"data-slot":"popover-trigger",...e})}function cR({className:e,align:i="center",alignOffset:r=0,side:n="bottom",sideOffset:s=4,...o}){return(0,g.jsx)(cx.Portal,{children:(0,g.jsx)(cx.Positioner,{align:i,alignOffset:r,side:n,sideOffset:s,className:"isolate z-50",children:(0,g.jsx)(cx.Popup,{"data-slot":"popover-content",className:(0,cC.cn)("z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-lg bg-popover p-2.5 text-xs text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o})})})}var cT=/[\\\/_+.#"@\[\(\{&]/,cD=/[\\\/_+.#"@\[\(\{&]/g,cL=/[\s-]/,cA=/[\s-]/g;function cP(e){return e.toLowerCase().replace(cA," ")}function cM(e,i,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return i?.(n)}}function cO(e,i){if("function"==typeof e)return e(i);null!=e&&(e.current=i)}function cB(...e){return i=>{let r=!1,n=e.map(e=>{let n=cO(e,i);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let i=0;i<n.length;i++){let r=n[i];"function"==typeof r?r():cO(e[i],null)}}}}function cN(...e){return m.useCallback(cB(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var cI=globalThis?.document?m.useLayoutEffect:()=>{},cF=m[" useId ".trim().toString()]||(()=>void 0),cz=0;function cH(e){let[i,r]=m.useState(cF());return cI(()=>{e||r(e=>e??String(cz++))},[e]),e||(i?`radix-${i}`:"")}m[" useEffectEvent ".trim().toString()],m[" useInsertionEffect ".trim().toString()];var cj=m[" useInsertionEffect ".trim().toString()]||cI;function cW(e){var i;let r,n=(i=e,(r=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${i}.SlotClone`,r),s=m.forwardRef((e,i)=>{let{children:r,...s}=e,o=m.Children.toArray(r),a=o.find(cU);if(a){let e=a.props.children,r=o.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(n,{...s,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(n,{...s,ref:i,children:r})});return s.displayName=`${e}.Slot`,s}Symbol("RADIX:SYNC_STATE");var c$=Symbol("radix.slottable");function cU(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===c$}var cq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{let r=cW(`Primitive.${i}`),n=m.forwardRef((e,n)=>{let{asChild:s,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(s?r:i,{...o,ref:n})});return n.displayName=`Primitive.${i}`,{...e,[i]:n}},{});function cV(e){let i=m.useRef(e);return m.useEffect(()=>{i.current=e}),m.useMemo(()=>(...e)=>i.current?.(...e),[])}var cK="dismissableLayer.update",cY=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cX=m.forwardRef((e,i)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,h=m.useContext(cY),[u,d]=m.useState(null),p=u?.ownerDocument??globalThis?.document,[,_]=m.useState({}),v=cN(i,e=>d(e)),y=Array.from(h.layers),[b]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),S=y.indexOf(b),w=u?y.indexOf(u):-1,x=h.layersWithOutsidePointerEventsDisabled.size>0,C=w>=S,k=function(e,i=globalThis?.document){let r=cV(e),n=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{let e=e=>{if(e.target&&!n.current){let n=function(){cJ("dismissableLayer.pointerDownOutside",r,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(i.removeEventListener("click",s.current),s.current=n,i.addEventListener("click",s.current,{once:!0})):n()}else i.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{i.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),i.removeEventListener("pointerdown",e),i.removeEventListener("click",s.current)}},[i,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{let i=e.target,r=[...h.branches].some(e=>e.contains(i));C&&!r&&(s?.(e),a?.(e),e.defaultPrevented||l?.())},p),E=function(e,i=globalThis?.document){let r=cV(e),n=m.useRef(!1);return m.useEffect(()=>{let e=e=>{e.target&&!n.current&&cJ("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return i.addEventListener("focusin",e),()=>i.removeEventListener("focusin",e)},[i,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{let i=e.target;![...h.branches].some(e=>e.contains(i))&&(o?.(e),a?.(e),e.defaultPrevented||l?.())},p);return!function(e,i=globalThis?.document){let r=cV(e);m.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return i.addEventListener("keydown",e,{capture:!0}),()=>i.removeEventListener("keydown",e,{capture:!0})},[r,i])}(e=>{w===h.layers.size-1&&(n?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),m.useEffect(()=>{if(u)return r&&(0===h.layersWithOutsidePointerEventsDisabled.size&&(f=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(u)),h.layers.add(u),cG(),()=>{r&&1===h.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=f)}},[u,p,r,h]),m.useEffect(()=>()=>{u&&(h.layers.delete(u),h.layersWithOutsidePointerEventsDisabled.delete(u),cG())},[u,h]),m.useEffect(()=>{let e=()=>_({});return document.addEventListener(cK,e),()=>document.removeEventListener(cK,e)},[]),(0,g.jsx)(cq.div,{...c,ref:v,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:cM(e.onFocusCapture,E.onFocusCapture),onBlurCapture:cM(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:cM(e.onPointerDownCapture,k.onPointerDownCapture)})});function cG(){let e=new CustomEvent(cK);document.dispatchEvent(e)}function cJ(e,i,r,{discrete:n}){let s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(i&&s.addEventListener(e,i,{once:!0}),n)s&&ax.flushSync(()=>s.dispatchEvent(o));else s.dispatchEvent(o)}cX.displayName="DismissableLayer",m.forwardRef((e,i)=>{let r=m.useContext(cY),n=m.useRef(null),s=cN(i,n);return m.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,g.jsx)(cq.div,{...e,ref:s})}).displayName="DismissableLayerBranch";var cZ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{let r=cW(`Primitive.${i}`),n=m.forwardRef((e,n)=>{let{asChild:s,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(s?r:i,{...o,ref:n})});return n.displayName=`Primitive.${i}`,{...e,[i]:n}},{}),cQ="focusScope.autoFocusOnMount",c0="focusScope.autoFocusOnUnmount",c1={bubbles:!1,cancelable:!0},c2=m.forwardRef((e,i)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[l,c]=m.useState(null),h=cV(s),u=cV(o),d=m.useRef(null),f=cN(i,e=>c(e)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let e=function(e){if(p.paused||!l)return;let i=e.target;l.contains(i)?d.current=i:c4(d.current,{select:!0})},i=function(e){if(p.paused||!l)return;let i=e.relatedTarget;null!==i&&(l.contains(i)||c4(d.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",i);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let i of e)i.removedNodes.length>0&&c4(l)});return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",i),r.disconnect()}}},[n,l,p.paused]),m.useEffect(()=>{if(l){c6.add(p);let e=document.activeElement;if(!l.contains(e)){let i=new CustomEvent(cQ,c1);l.addEventListener(cQ,h),l.dispatchEvent(i),i.defaultPrevented||(function(e,{select:i=!1}={}){let r=document.activeElement;for(let n of e)if(c4(n,{select:i}),document.activeElement!==r)return}(c5(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&c4(l))}return()=>{l.removeEventListener(cQ,h),setTimeout(()=>{let i=new CustomEvent(c0,c1);l.addEventListener(c0,u),l.dispatchEvent(i),i.defaultPrevented||c4(e??document.body,{select:!0}),l.removeEventListener(c0,u),c6.remove(p)},0)}}},[l,h,u,p]);let _=m.useCallback(e=>{if(!r&&!n||p.paused)return;let i="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,s=document.activeElement;if(i&&s){var o;let i,n=e.currentTarget,[a,l]=[c3(i=c5(o=n),o),c3(i.reverse(),o)];a&&l?e.shiftKey||s!==l?e.shiftKey&&s===a&&(e.preventDefault(),r&&c4(l,{select:!0})):(e.preventDefault(),r&&c4(a,{select:!0})):s===n&&e.preventDefault()}},[r,n,p.paused]);return(0,g.jsx)(cZ.div,{tabIndex:-1,...a,ref:f,onKeyDown:_})});function c5(e){let i=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let i="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||i?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)i.push(r.currentNode);return i}function c3(e,i){for(let r of e)if(!function(e,{upTo:i}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===i||e!==i);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:i}))return r}function c4(e,{select:i=!1}={}){if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&i&&e.select()}}c2.displayName="FocusScope";var c6=(n=[],{add(e){let i=n[0];e!==i&&i?.pause(),(n=c9(n,e)).unshift(e)},remove(e){n=c9(n,e),n[0]?.resume()}});function c9(e,i){let r=[...e],n=r.indexOf(i);return -1!==n&&r.splice(n,1),r}var c8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{let r=cW(`Primitive.${i}`),n=m.forwardRef((e,n)=>{let{asChild:s,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(s?r:i,{...o,ref:n})});return n.displayName=`Primitive.${i}`,{...e,[i]:n}},{}),c7=m.forwardRef((e,i)=>{let{container:r,...n}=e,[s,o]=m.useState(!1);cI(()=>o(!0),[]);let a=r||s&&globalThis?.document?.body;return a?ax.default.createPortal((0,g.jsx)(c8.div,{...n,ref:i}),a):null});c7.displayName="Portal";var he=e=>{var i;let r,n,{present:s,children:o}=e,a=function(e){var i,r;let[n,s]=m.useState(),o=m.useRef(null),a=m.useRef(e),l=m.useRef("none"),[c,h]=(i=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},m.useReducer((e,i)=>r[e][i]??e,i));return m.useEffect(()=>{let e=ht(o.current);l.current="mounted"===c?e:"none"},[c]),cI(()=>{let i=o.current,r=a.current;if(r!==e){let n=l.current,s=ht(i);e?h("MOUNT"):"none"===s||i?.display==="none"?h("UNMOUNT"):r&&n!==s?h("ANIMATION_OUT"):h("UNMOUNT"),a.current=e}},[e,h]),cI(()=>{if(n){let e,i=n.ownerDocument.defaultView??window,r=r=>{let s=ht(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&s&&(h("ANIMATION_END"),!a.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=i.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(l.current=ht(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{i.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}h("ANIMATION_END")},[n,h]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(e=>{o.current=e?getComputedStyle(e):null,s(e)},[])}}(s),l="function"==typeof o?o({present:a.isPresent}):m.Children.only(o),c=cN(a.ref,(i=l,(n=(r=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?i.ref:(n=(r=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?i.props.ref:i.props.ref||i.ref));return"function"==typeof o||a.isPresent?m.cloneElement(l,{ref:c}):null};function ht(e){return e?.animationName||"none"}he.displayName="Presence";var hi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{let r=cW(`Primitive.${i}`),n=m.forwardRef((e,n)=>{let{asChild:s,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(s?r:i,{...o,ref:n})});return n.displayName=`Primitive.${i}`,{...e,[i]:n}},{}),hr=0;function hn(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var hs=function(){return(hs=Object.assign||function(e){for(var i,r=1,n=arguments.length;r<n;r++)for(var s in i=arguments[r])Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s]);return e}).apply(this,arguments)};function ho(e,i){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>i.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)0>i.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}var ha=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),hl="width-before-scroll-bar";function hc(e,i){return"function"==typeof e?e(i):e&&(e.current=i),e}var hh="u">typeof window?m.useLayoutEffect:m.useEffect,hu=new WeakMap,hd=(void 0===o&&(o={}),(void 0===a&&(a=function(e){return e}),l=[],c=!1,h={read:function(){if(c)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:null},useMedium:function(e){var i=a(e,c);return l.push(i),function(){l=l.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(c=!0;l.length;){var i=l;l=[],i.forEach(e)}l={push:function(i){return e(i)},filter:function(){return l}}},assignMedium:function(e){c=!0;var i=[];if(l.length){var r=l;l=[],r.forEach(e),i=l}var n=function(){var r=i;i=[],r.forEach(e)},s=function(){return Promise.resolve().then(n)};s(),l={push:function(e){i.push(e),s()},filter:function(e){return i=i.filter(e),l}}}}).options=hs({async:!0,ssr:!1},o),h),hf=function(){},hp=m.forwardRef(function(e,i){var r,n,s,o,a=m.useRef(null),l=m.useState({onScrollCapture:hf,onWheelCapture:hf,onTouchMoveCapture:hf}),c=l[0],h=l[1],u=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,g=e.enabled,_=e.shards,v=e.sideCar,y=e.noRelative,b=e.noIsolation,S=e.inert,w=e.allowPinchZoom,x=e.as,C=e.gapMode,k=ho(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=(r=[a,i],n=function(e){return r.forEach(function(i){return hc(i,e)})},(s=(0,m.useState)(function(){return{value:null,callback:n,facade:{get current(){return s.value},set current(value){var e=s.value;e!==value&&(s.value=value,s.callback(value,e))}}}})[0]).callback=n,o=s.facade,hh(function(){var e=hu.get(o);if(e){var i=new Set(e),n=new Set(r),s=o.current;i.forEach(function(e){n.has(e)||hc(e,null)}),n.forEach(function(e){i.has(e)||hc(e,s)})}hu.set(o,r)},[r]),o),R=hs(hs({},k),c);return m.createElement(m.Fragment,null,g&&m.createElement(v,{sideCar:hd,removeScrollBar:p,shards:_,noRelative:y,noIsolation:b,inert:S,setCallbacks:h,allowPinchZoom:!!w,lockRef:a,gapMode:C}),u?m.cloneElement(m.Children.only(d),hs(hs({},R),{ref:E})):m.createElement(void 0===x?"div":x,hs({},R,{className:f,ref:E}),d))});hp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},hp.classNames={fullWidth:hl,zeroRight:ha};var hg=function(e){var i=e.sideCar,r=ho(e,["sideCar"]);if(!i)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=i.read();if(!n)throw Error("Sidecar medium not found");return m.createElement(n,hs({},r))};hg.isSideCarExport=!0;var hm=function(){var e=0,i=null;return{add:function(r){if(0==e&&(i=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var i=p||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return i&&e.setAttribute("nonce",i),e}())){var n,s;(n=i).styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),s=i,(document.head||document.getElementsByTagName("head")[0]).appendChild(s)}e++},remove:function(){--e||!i||(i.parentNode&&i.parentNode.removeChild(i),i=null)}}},h_=function(){var e=hm();return function(i,r){m.useEffect(function(){return e.add(i),function(){e.remove()}},[i&&r])}},hv=function(){var e=h_();return function(i){return e(i.styles,i.dynamic),null}},hy={left:0,top:0,right:0,gap:0},hb=function(e){return parseInt(e||"",10)||0},hS=function(e){var i=window.getComputedStyle(document.body),r=i["padding"===e?"paddingLeft":"marginLeft"],n=i["padding"===e?"paddingTop":"marginTop"],s=i["padding"===e?"paddingRight":"marginRight"];return[hb(r),hb(n),hb(s)]},hw=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return hy;var i=hS(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:i[0],top:i[1],right:i[2],gap:Math.max(0,n-r+i[2]-i[0])}},hx=hv(),hC="data-scroll-locked",hk=function(e,i,r,n){var s=e.left,o=e.top,a=e.right,l=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(l,"px ").concat(n,";\n }\n body[").concat(hC,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([i&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(s,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(ha," {\n right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(hl," {\n margin-right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(ha," .").concat(ha," {\n right: 0 ").concat(n,";\n }\n \n .").concat(hl," .").concat(hl," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(hC,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},hE=function(){var e=parseInt(document.body.getAttribute(hC)||"0",10);return isFinite(e)?e:0},hR=function(){m.useEffect(function(){return document.body.setAttribute(hC,(hE()+1).toString()),function(){var e=hE()-1;e<=0?document.body.removeAttribute(hC):document.body.setAttribute(hC,e.toString())}},[])},hT=function(e){var i=e.noRelative,r=e.noImportant,n=e.gapMode,s=void 0===n?"margin":n;hR();var o=m.useMemo(function(){return hw(s)},[s]);return m.createElement(hx,{styles:hk(o,!i,s,r?"":"!important")})},hD=!1;if("u">typeof window)try{var hL=Object.defineProperty({},"passive",{get:function(){return hD=!0,!0}});window.addEventListener("test",hL,hL),window.removeEventListener("test",hL,hL)}catch(e){hD=!1}var hA=!!hD&&{passive:!1},hP=function(e,i){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[i]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[i])},hM=function(e,i){var r=i.ownerDocument,n=i;do{if("u">typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),hO(e,n)){var s=hB(e,n);if(s[1]>s[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},hO=function(e,i){return"v"===e?hP(i,"overflowY"):hP(i,"overflowX")},hB=function(e,i){return"v"===e?[i.scrollTop,i.scrollHeight,i.clientHeight]:[i.scrollLeft,i.scrollWidth,i.clientWidth]},hN=function(e,i,r,n,s){var o,a=(o=window.getComputedStyle(i).direction,"h"===e&&"rtl"===o?-1:1),l=a*n,c=r.target,h=i.contains(c),u=!1,d=l>0,f=0,p=0;do{if(!c)break;var g=hB(e,c),m=g[0],_=g[1]-g[2]-a*m;(m||_)&&hO(e,c)&&(f+=_,p+=m);var v=c.parentNode;c=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!h&&c!==document.body||h&&(i.contains(c)||i===c))return d&&(s&&1>Math.abs(f)||!s&&l>f)?u=!0:!d&&(s&&1>Math.abs(p)||!s&&-l>p)&&(u=!0),u},hI=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hF=function(e){return[e.deltaX,e.deltaY]},hz=function(e){return e&&"current"in e?e.current:e},hH=0,hj=[];let hW=(u=function(e){var i=m.useRef([]),r=m.useRef([0,0]),n=m.useRef(),s=m.useState(hH++)[0],o=m.useState(hv)[0],a=m.useRef(e);m.useEffect(function(){a.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var i=(function(e,i,r){if(r||2==arguments.length)for(var n,s=0,o=i.length;s<o;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return e.concat(n||Array.prototype.slice.call(i))})([e.lockRef.current],(e.shards||[]).map(hz),!0).filter(Boolean);return i.forEach(function(e){return e.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),i.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(e,i){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var s,o=hI(e),l=r.current,c="deltaX"in e?e.deltaX:l[0]-o[0],h="deltaY"in e?e.deltaY:l[1]-o[1],u=e.target,d=Math.abs(c)>Math.abs(h)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var g=hM(d,u);if(!g)return!0;if(g?s=d:(s="v"===d?"h":"v",g=hM(d,u)),!g)return!1;if(!n.current&&"changedTouches"in e&&(c||h)&&(n.current=s),!s)return!0;var m=n.current||s;return hN(m,i,e,"h"===m?c:h,!0)},[]),c=m.useCallback(function(e){if(hj.length&&hj[hj.length-1]===o){var r="deltaY"in e?hF(e):hI(e),n=i.current.filter(function(i){var n;return i.name===e.type&&(i.target===e.target||e.target===i.shadowParent)&&(n=i.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var s=(a.current.shards||[]).map(hz).filter(Boolean).filter(function(i){return i.contains(e.target)});(s.length>0?l(e,s[0]):!a.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),h=m.useCallback(function(e,r,n,s){var o={name:e,delta:r,target:n,should:s,shadowParent:function(e){for(var i=null;null!==e;)e instanceof ShadowRoot&&(i=e.host,e=e.host),e=e.parentNode;return i}(n)};i.current.push(o),setTimeout(function(){i.current=i.current.filter(function(e){return e!==o})},1)},[]),u=m.useCallback(function(e){r.current=hI(e),n.current=void 0},[]),d=m.useCallback(function(i){h(i.type,hF(i),i.target,l(i,e.lockRef.current))},[]),f=m.useCallback(function(i){h(i.type,hI(i),i.target,l(i,e.lockRef.current))},[]);m.useEffect(function(){return hj.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,hA),document.addEventListener("touchmove",c,hA),document.addEventListener("touchstart",u,hA),function(){hj=hj.filter(function(e){return e!==o}),document.removeEventListener("wheel",c,hA),document.removeEventListener("touchmove",c,hA),document.removeEventListener("touchstart",u,hA)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(o,{styles:"\n .block-interactivity-".concat(s," {pointer-events: none;}\n .allow-interactivity-").concat(s," {pointer-events: all;}\n")}):null,p?m.createElement(hT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},hd.useMedium(u),hg);var h$=m.forwardRef(function(e,i){return m.createElement(hp,hs({},e,{ref:i,sideCar:hW}))});h$.classNames=hp.classNames;var hU=new WeakMap,hq=new WeakMap,hV={},hK=0,hY=function(e){return e&&(e.host||hY(e.parentNode))},hX=function(e,i,r,n){var s=(Array.isArray(e)?e:[e]).map(function(e){if(i.contains(e))return e;var r=hY(e);return r&&i.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",i,". Doing nothing"),null)}).filter(function(e){return!!e});hV[r]||(hV[r]=new WeakMap);var o=hV[r],a=[],l=new Set,c=new Set(s),h=function(e){!e||l.has(e)||(l.add(e),h(e.parentNode))};s.forEach(h);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))u(e);else try{var i=e.getAttribute(n),s=null!==i&&"false"!==i,c=(hU.get(e)||0)+1,h=(o.get(e)||0)+1;hU.set(e,c),o.set(e,h),a.push(e),1===c&&s&&hq.set(e,!0),1===h&&e.setAttribute(r,"true"),s||e.setAttribute(n,"true")}catch(i){console.error("aria-hidden: cannot operate on ",e,i)}})};return u(i),l.clear(),hK++,function(){a.forEach(function(e){var i=hU.get(e)-1,s=o.get(e)-1;hU.set(e,i),o.set(e,s),i||(hq.has(e)||e.removeAttribute(n),hq.delete(e)),s||e.removeAttribute(r)}),--hK||(hU=new WeakMap,hU=new WeakMap,hq=new WeakMap,hV={})}},hG=function(e,i,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=i||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),hX(n,s,r,"aria-hidden")):function(){return null}},hJ="Dialog",[hZ,hQ]=function(e,i=[]){let r=[],n=()=>{let i=r.map(e=>m.createContext(e));return function(r){let n=r?.[e]||i;return m.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(i,n){let s=m.createContext(n),o=r.length;r=[...r,n];let a=i=>{let{scope:r,children:n,...a}=i,l=r?.[e]?.[o]||s,c=m.useMemo(()=>a,Object.values(a));return(0,g.jsx)(l.Provider,{value:c,children:n})};return a.displayName=i+"Provider",[a,function(r,a){let l=a?.[e]?.[o]||s,c=m.useContext(l);if(c)return c;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${i}\``)}]},function(...e){let i=e[0];if(1===e.length)return i;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((i,{useScope:r,scopeName:n})=>{let s=r(e)[`__scope${n}`];return{...i,...s}},{});return m.useMemo(()=>({[`__scope${i.scopeName}`]:n}),[n])}};return r.scopeName=i.scopeName,r}(n,...i)]}(hJ),[h0,h1]=hZ(hJ),h2=e=>{let{__scopeDialog:i,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=m.useRef(null),c=m.useRef(null),[h,u]=function({prop:e,defaultProp:i,onChange:r=()=>{},caller:n}){let[s,o,a]=function({defaultProp:e,onChange:i}){let[r,n]=m.useState(e),s=m.useRef(r),o=m.useRef(i);return cj(()=>{o.current=i},[i]),m.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,n,o]}({defaultProp:i,onChange:r}),l=void 0!==e,c=l?e:s;{let i=m.useRef(void 0!==e);m.useEffect(()=>{let e=i.current;if(e!==l){let i=l?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${i}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}i.current=l},[l,n])}return[c,m.useCallback(i=>{if(l){let r="function"==typeof i?i(e):i;r!==e&&a.current?.(r)}else o(i)},[l,e,o,a])]}({prop:n,defaultProp:s??!1,onChange:o,caller:hJ});return(0,g.jsx)(h0,{scope:i,triggerRef:l,contentRef:c,contentId:cH(),titleId:cH(),descriptionId:cH(),open:h,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:a,children:r})};h2.displayName=hJ;var h5="DialogTrigger";m.forwardRef((e,i)=>{let{__scopeDialog:r,...n}=e,s=h1(h5,r),o=cN(i,s.triggerRef);return(0,g.jsx)(hi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":uh(s.open),...n,ref:o,onClick:cM(e.onClick,s.onOpenToggle)})}).displayName=h5;var h3="DialogPortal",[h4,h6]=hZ(h3,{forceMount:void 0}),h9=e=>{let{__scopeDialog:i,forceMount:r,children:n,container:s}=e,o=h1(h3,i);return(0,g.jsx)(h4,{scope:i,forceMount:r,children:m.Children.map(n,e=>(0,g.jsx)(he,{present:r||o.open,children:(0,g.jsx)(c7,{asChild:!0,container:s,children:e})}))})};h9.displayName=h3;var h8="DialogOverlay",h7=m.forwardRef((e,i)=>{let r=h6(h8,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=h1(h8,e.__scopeDialog);return o.modal?(0,g.jsx)(he,{present:n||o.open,children:(0,g.jsx)(ut,{...s,ref:i})}):null});h7.displayName=h8;var ue=cW("DialogOverlay.RemoveScroll"),ut=m.forwardRef((e,i)=>{let{__scopeDialog:r,...n}=e,s=h1(h8,r);return(0,g.jsx)(h$,{as:ue,allowPinchZoom:!0,shards:[s.contentRef],children:(0,g.jsx)(hi.div,{"data-state":uh(s.open),...n,ref:i,style:{pointerEvents:"auto",...n.style}})})}),ui="DialogContent",ur=m.forwardRef((e,i)=>{let r=h6(ui,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=h1(ui,e.__scopeDialog);return(0,g.jsx)(he,{present:n||o.open,children:o.modal?(0,g.jsx)(un,{...s,ref:i}):(0,g.jsx)(us,{...s,ref:i})})});ur.displayName=ui;var un=m.forwardRef((e,i)=>{let r=h1(ui,e.__scopeDialog),n=m.useRef(null),s=cN(i,r.contentRef,n);return m.useEffect(()=>{let e=n.current;if(e)return hG(e)},[]),(0,g.jsx)(uo,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:cM(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:cM(e.onPointerDownOutside,e=>{let i=e.detail.originalEvent,r=0===i.button&&!0===i.ctrlKey;(2===i.button||r)&&e.preventDefault()}),onFocusOutside:cM(e.onFocusOutside,e=>e.preventDefault())})}),us=m.forwardRef((e,i)=>{let r=h1(ui,e.__scopeDialog),n=m.useRef(!1),s=m.useRef(!1);return(0,g.jsx)(uo,{...e,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,"pointerdown"===i.detail.originalEvent.type&&(s.current=!0));let o=i.target;r.triggerRef.current?.contains(o)&&i.preventDefault(),"focusin"===i.detail.originalEvent.type&&s.current&&i.preventDefault()}})}),uo=m.forwardRef((e,i)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,l=h1(ui,r),c=m.useRef(null),h=cN(i,c);return m.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hn()),document.body.insertAdjacentElement("beforeend",e[1]??hn()),hr++,()=>{1===hr&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),hr--}},[]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c2,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:(0,g.jsx)(cX,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":uh(l.open),...a,ref:h,onDismiss:()=>l.onOpenChange(!1)})}),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(up,{titleId:l.titleId}),(0,g.jsx)(ug,{contentRef:c,descriptionId:l.descriptionId})]})]})}),ua="DialogTitle";m.forwardRef((e,i)=>{let{__scopeDialog:r,...n}=e,s=h1(ua,r);return(0,g.jsx)(hi.h2,{id:s.titleId,...n,ref:i})}).displayName=ua;var ul="DialogDescription";m.forwardRef((e,i)=>{let{__scopeDialog:r,...n}=e,s=h1(ul,r);return(0,g.jsx)(hi.p,{id:s.descriptionId,...n,ref:i})}).displayName=ul;var uc="DialogClose";function uh(e){return e?"open":"closed"}m.forwardRef((e,i)=>{let{__scopeDialog:r,...n}=e,s=h1(uc,r);return(0,g.jsx)(hi.button,{type:"button",...n,ref:i,onClick:cM(e.onClick,()=>s.onOpenChange(!1))})}).displayName=uc;var uu="DialogTitleWarning",[ud,uf]=(d={contentName:ui,titleName:ua,docsSlug:"dialog"},i=m.createContext(d),(r=e=>{let{children:r,...n}=e,s=m.useMemo(()=>n,Object.values(n));return(0,g.jsx)(i.Provider,{value:s,children:r})}).displayName=uu+"Provider",[r,function(e){let r=m.useContext(i);if(r)return r;if(void 0!==d)return d;throw Error(`\`${e}\` must be used within \`${uu}\``)}]),up=({titleId:e})=>{let i=uf(uu),r=`\`${i.contentName}\` requires a \`${i.titleName}\` for the component to be accessible for screen reader users.
|
|
8
|
-
|
|
9
|
-
If you want to hide the \`${i.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
10
|
-
|
|
11
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ug=({contentRef:e,descriptionId:i})=>{let r=uf("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");i&&r&&(document.getElementById(i)||console.warn(n))},[n,e,i]),null},um=Symbol.for("react.lazy"),u_=m[" use ".trim().toString()];function uv(e){var i;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===um&&"_payload"in e&&"object"==typeof(i=e._payload)&&null!==i&&"then"in i}var uy=Symbol("radix.slottable");function ub(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uy}var uS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var r,n;let s,o,a,l=(n=r=`Primitive.${i}`,(s=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(uv(r)&&"function"==typeof u_&&(r=u_(r._payload)),m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${n}.SlotClone`,o=s,(a=m.forwardRef((e,i)=>{let{children:r,...n}=e;uv(r)&&"function"==typeof u_&&(r=u_(r._payload));let s=m.Children.toArray(r),a=s.find(ub);if(a){let e=a.props.children,r=s.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(o,{...n,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(o,{...n,ref:i,children:r})})).displayName=`${r}.Slot`,a),c=m.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(n?l:i,{...s,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),uw='[cmdk-group=""]',ux='[cmdk-group-items=""]',uC='[cmdk-item=""]',uk=`${uC}:not([aria-disabled="true"])`,uE="cmdk-item-select",uR="data-value",uT=(e,i,r)=>{var n;return n=e,function e(i,r,n,s,o,a,l){if(a===r.length)return o===i.length?1:.99;var c=`${o},${a}`;if(void 0!==l[c])return l[c];for(var h,u,d,f,p=s.charAt(a),g=n.indexOf(p,o),m=0;g>=0;)(h=e(i,r,n,s,g+1,a+1,l))>m&&(g===o?h*=1:cT.test(i.charAt(g-1))?(h*=.8,(d=i.slice(o,g-1).match(cD))&&o>0&&(h*=Math.pow(.999,d.length))):cL.test(i.charAt(g-1))?(h*=.9,(f=i.slice(o,g-1).match(cA))&&o>0&&(h*=Math.pow(.999,f.length))):(h*=.17,o>0&&(h*=Math.pow(.999,g-o))),i.charAt(g)!==r.charAt(a)&&(h*=.9999)),(h<.1&&n.charAt(g-1)===s.charAt(a+1)||s.charAt(a+1)===s.charAt(a)&&n.charAt(g-1)!==s.charAt(a))&&.1*(u=e(i,r,n,s,g+1,a+2,l))>h&&(h=.1*u),h>m&&(m=h),g=n.indexOf(p,g+1);return l[c]=m,m}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,i,cP(n),cP(i),0,0,{})},uD=m.createContext(void 0),uL=m.createContext(void 0),uA=m.createContext(void 0),uP=m.forwardRef((e,i)=>{let r=uW(()=>{var i,r;return{search:"",value:null!=(r=null!=(i=e.value)?i:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uW(()=>new Set),s=uW(()=>new Map),o=uW(()=>new Map),a=uW(()=>new Set),l=uH(e),{label:c,children:h,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=cH(),S=cH(),w=cH(),x=m.useRef(null),C=uq();uj(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,k.emit()}},[u]),uj(()=>{C(6,A)},[]);let k=m.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,i,n)=>{var s,o,a,c;if(!Object.is(r.current[e],i)){if(r.current[e]=i,"search"===e)L(),T(),C(1,D);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(b))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=P())?void 0:e.id,k.emit()}),n||C(5,A),(null==(o=l.current)?void 0:o.value)!==void 0){null==(c=(a=l.current).onValueChange)||c.call(a,null!=i?i:"");return}}k.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),E=m.useMemo(()=>({value:(e,i,n)=>{var s;i!==(null==(s=o.current.get(e))?void 0:s.value)&&(o.current.set(e,{value:i,keywords:n}),r.current.filtered.items.set(e,R(i,n)),C(2,()=>{T(),k.emit()}))},item:(e,i)=>(n.current.add(e),i&&(s.current.has(i)?s.current.get(i).add(e):s.current.set(i,new Set([e]))),C(3,()=>{L(),T(),r.current.value||D(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let i=P();C(4,()=>{L(),(null==i?void 0:i.getAttribute("id"))===e&&D(),k.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{o.current.delete(e),s.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:S,listInnerRef:x}),[]);function R(e,i){var n,s;let o=null!=(s=null==(n=l.current)?void 0:n.filter)?s:uT;return e?o(e,r.current.search,i):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,i=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),o=0;n.forEach(i=>{o=Math.max(e.get(i),o)}),i.push([r,o])});let n=x.current;M().sort((i,r)=>{var n,s;let o=i.getAttribute("id"),a=r.getAttribute("id");return(null!=(n=e.get(a))?n:0)-(null!=(s=e.get(o))?s:0)}).forEach(e=>{let i=e.closest(ux);i?i.appendChild(e.parentElement===i?e:e.closest(`${ux} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ux} > *`))}),i.sort((e,i)=>i[1]-e[1]).forEach(e=>{var i;let r=null==(i=x.current)?void 0:i.querySelector(`${uw}[${uR}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function D(){let e=M().find(e=>"true"!==e.getAttribute("aria-disabled")),i=null==e?void 0:e.getAttribute(uR);k.setState("value",i||void 0)}function L(){var e,i,a,c;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let h=0;for(let s of n.current){let n=R(null!=(i=null==(e=o.current.get(s))?void 0:e.value)?i:"",null!=(c=null==(a=o.current.get(s))?void 0:a.keywords)?c:[]);r.current.filtered.items.set(s,n),n>0&&h++}for(let[e,i]of s.current)for(let n of i)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=h}function A(){var e,i,r;let n=P();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(i=n.closest(uw))?void 0:i.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function P(){var e;return null==(e=x.current)?void 0:e.querySelector(`${uC}[aria-selected="true"]`)}function M(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(uk))||[])}function O(e){let i=M()[e];i&&k.setState("value",i.getAttribute(uR))}function B(e){var i;let r=P(),n=M(),s=n.findIndex(e=>e===r),o=n[s+e];null!=(i=l.current)&&i.loop&&(o=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),o&&k.setState("value",o.getAttribute(uR))}function N(e){let i=P(),r=null==i?void 0:i.closest(uw),n;for(;r&&!n;)n=null==(r=e>0?function(e,i){let r=e.nextElementSibling;for(;r;){if(r.matches(i))return r;r=r.nextElementSibling}}(r,uw):function(e,i){let r=e.previousElementSibling;for(;r;){if(r.matches(i))return r;r=r.previousElementSibling}}(r,uw))?void 0:r.querySelector(uk);n?k.setState("value",n.getAttribute(uR)):B(e)}let I=()=>O(M().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?N(1):B(1)},z=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?N(-1):B(-1)};return m.createElement(uS.div,{ref:i,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var i;null==(i=y.onKeyDown)||i.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":v&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let i=P();if(i){let e=new Event(uE);i.dispatchEvent(e)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:uK},c),uV(e,e=>m.createElement(uL.Provider,{value:k},m.createElement(uD.Provider,{value:E},e))))}),uM=m.forwardRef((e,i)=>{var r,n;let s=cH(),o=m.useRef(null),a=m.useContext(uA),l=m.useContext(uD),c=uH(e),h=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;uj(()=>{if(!h)return l.item(s,null==a?void 0:a.id)},[h]);let u=uU(s,o,[e.value,e.children,o],e.keywords),d=m.useContext(uL),f=u$(e=>e.value&&e.value===u.current),p=u$(e=>!!h||!1===l.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,i;_(),null==(i=(e=c.current).onSelect)||i.call(e,u.current)}function _(){d.setState("value",u.current,!0)}if(m.useEffect(()=>{let i=o.current;if(!(!i||e.disabled))return i.addEventListener(uE,g),()=>i.removeEventListener(uE,g)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:S,keywords:w,...x}=e;return m.createElement(uS.div,{ref:cB(o,i),...x,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:_,onClick:v?void 0:g},e.children)}),uO=m.forwardRef((e,i)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=cH(),l=m.useRef(null),c=m.useRef(null),h=cH(),u=m.useContext(uD),d=u$(e=>!!s||!1===u.filter()||!e.search||e.filtered.groups.has(a));uj(()=>u.group(a),[]),uU(a,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:a,forceMount:s}),[s]);return m.createElement(uS.div,{ref:cB(l,i),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),uV(e,e=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},m.createElement(uA.Provider,{value:f},e))))}),uB=m.forwardRef((e,i)=>{let{alwaysRender:r,...n}=e,s=m.useRef(null),o=u$(e=>!e.search);return r||o?m.createElement(uS.div,{ref:cB(s,i),...n,"cmdk-separator":"",role:"separator"}):null}),uN=m.forwardRef((e,i)=>{let{onValueChange:r,...n}=e,s=null!=e.value,o=m.useContext(uL),a=u$(e=>e.search),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),m.createElement(uS.input,{ref:i,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:e=>{s||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),uI=m.forwardRef((e,i)=>{let{children:r,label:n="Suggestions",...s}=e,o=m.useRef(null),a=m.useRef(null),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{if(a.current&&o.current){let e=a.current,i=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;i.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),m.createElement(uS.div,{ref:cB(o,i),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},uV(e,e=>m.createElement("div",{ref:cB(a,c.listInnerRef),"cmdk-list-sizer":""},e)))}),uF=m.forwardRef((e,i)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return m.createElement(h2,{open:r,onOpenChange:n},m.createElement(h9,{container:a},m.createElement(h7,{"cmdk-overlay":"",className:s}),m.createElement(ur,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(uP,{ref:i,...l}))))}),uz=Object.assign(uP,{List:uI,Item:uM,Input:uN,Group:uO,Separator:uB,Dialog:uF,Empty:m.forwardRef((e,i)=>u$(e=>0===e.filtered.count)?m.createElement(uS.div,{ref:i,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:m.forwardRef((e,i)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return m.createElement(uS.div,{ref:i,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uV(e,e=>m.createElement("div",{"aria-hidden":!0},e)))})});function uH(e){let i=m.useRef(e);return uj(()=>{i.current=e}),i}var uj="u"<typeof window?m.useEffect:m.useLayoutEffect;function uW(e){let i=m.useRef();return void 0===i.current&&(i.current=e()),i}function u$(e){let i=m.useContext(uL),r=()=>e(i.snapshot());return m.useSyncExternalStore(i.subscribe,r,r)}function uU(e,i,r,n=[]){let s=m.useRef(),o=m.useContext(uD);return uj(()=>{var a;let l=(()=>{var e;for(let i of r){if("string"==typeof i)return i.trim();if("object"==typeof i&&"current"in i)return i.current?null==(e=i.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());o.value(e,l,c),null==(a=i.current)||a.setAttribute(uR,l),s.current=l}),s}var uq=()=>{let[e,i]=m.useState(),r=uW(()=>new Map);return uj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),i({})}};function uV({asChild:e,children:i},r){let n;return e&&m.isValidElement(i)?m.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},r(i.props.children)):r(i)}var uK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.i(69068);var uY=e.i(25913),uX=e.i(10012),uG=e.i(41247);function uJ({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,cC.cn)("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...i})}let uZ=(0,uY.cva)("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function uQ({className:e,align:i="inline-start",...r}){return(0,g.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:(0,cC.cn)(uZ({align:i}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,uY.cva)("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let u0=(0,r0.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,u0],54943);var u1=e.i(78745);e.s(["CheckIcon",()=>u1.default],78784);var u1=u1;function u2({className:e,...i}){return(0,g.jsx)(uz,{"data-slot":"command",className:(0,cC.cn)("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground",e),...i})}function u5({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,g.jsxs)(uJ,{className:"h-8! bg-input/20 dark:bg-input/30",children:[(0,g.jsx)(uz.Input,{"data-slot":"command-input",className:(0,cC.cn)("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...i}),(0,g.jsx)(uQ,{children:(0,g.jsx)(u0,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function u3({className:e,...i}){return(0,g.jsx)(uz.List,{"data-slot":"command-list",className:(0,cC.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...i})}function u4({className:e,...i}){return(0,g.jsx)(uz.Empty,{"data-slot":"command-empty",className:(0,cC.cn)("py-6 text-center text-xs/relaxed",e),...i})}function u6({className:e,...i}){return(0,g.jsx)(uz.Group,{"data-slot":"command-group",className:(0,cC.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...i})}function u9({className:e,children:i,...r}){return(0,g.jsxs)(uz.Item,{"data-slot":"command-item",className:(0,cC.cn)("group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground",e),...r,children:[i,(0,g.jsx)(u1.default,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function u8({options:e,value:i,onChange:r,placeholder:n="Select option",disabled:s=!1,className:o="",allowCustomValue:a=!1,multiple:l=!1,onClear:c,showClearButton:h=!1}){let[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(""),_=(0,m.useRef)(null),v=(0,m.useMemo)(()=>Array.isArray(i)?i:[i],[i]),y=(0,m.useMemo)(()=>{if(l){if(1===v.length&&"all"===v[0]){let i=e.find(e=>"all"===e.value);return i?.label||""}return v.filter(e=>"all"!==e).map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")}return v.map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")},[v,e,l]),b=(0,m.useMemo)(()=>{let i={};for(let r of e){let e=r.group||"Other";i[e]||(i[e]=[]),i[e].push(r)}return i},[e]),S=(0,m.useMemo)(()=>Object.keys(b).length>1||!b.Other,[b]),w=e=>{if(l){let i=[...v],n=i.indexOf(e);n>=0?i.splice(n,1):i.push(e),r(i.length>0?i:[])}else r(e),d(!1)},x=()=>{a&&f&&!l&&(r(f),d(!1))};return(0,g.jsxs)(ck,{open:u,onOpenChange:e=>{d(e),e||p("")},children:[(0,g.jsxs)("div",{className:`relative ${o}`,children:[(0,g.jsx)(cE,{ref:_,disabled:s,className:`flex h-9 w-full items-center justify-between pl-3 ${h?"pr-16":"pr-10"} border border-input rounded-md text-sm bg-input/20 dark:bg-input/30 text-foreground transition-colors outline-none hover:border-ring focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/30 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-left shadow-xs`,children:(0,g.jsx)("span",{className:"truncate",children:y||(0,g.jsx)("span",{className:"text-muted-foreground",children:n})})}),h&&c&&(0,g.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),c()},className:"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer z-10","aria-label":"Clear selection",children:(0,g.jsx)(ad.X,{className:"w-4 h-4"})}),(0,g.jsx)(au,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),(0,g.jsx)(cR,{className:"w-[var(--anchor-width)] p-0",align:"start",sideOffset:4,children:(0,g.jsxs)(u2,{filter:(i,r)=>{let n=e.find(e=>e.value===i);return n?+!!`${n.label} ${n.group||""}`.toLowerCase().includes(r.toLowerCase()):0},children:[(0,g.jsx)(u5,{placeholder:"Search...",value:f,onValueChange:p,onKeyDown:e=>{"Enter"===e.key&&a&&x()}}),(0,g.jsxs)(u3,{children:[(0,g.jsx)(u4,{children:a&&f?(0,g.jsxs)("button",{type:"button",className:"w-full px-2 py-1.5 text-left text-xs cursor-pointer hover:bg-accent rounded",onClick:x,children:['Use "',f,'"']}):"No options found"}),S?Object.entries(b).map(([e,i])=>(0,g.jsx)(u6,{heading:e,children:i.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))},e)):(0,g.jsx)(u6,{children:e.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))})]})]})})]})}let u7=(0,r0.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var de=e.i(86536),dt=e.i(70935);function di({value:e,onChange:i,editorRef:r,theme:n,activeTab:s,onTabChange:o,disabled:a,onFocusChange:l}){let c=(0,m.useCallback)(e=>{i(e??"")},[i]),h=(0,g.jsx)("div",{className:"border border-border rounded overflow-hidden h-full",children:(0,g.jsx)(_.Editor,{height:"100%",defaultLanguage:"markdown",value:e,onChange:c,onMount:e=>{r.current=e,e.layout(),e.onDidFocusEditorText(()=>l?.(!0)),e.onDidBlurEditorText(()=>l?.(!1))},options:{minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",fontSize:13,scrollBeyondLastLine:!1,readOnly:a},theme:"dark"===n?"vs-dark":"vs-light"})}),u=(0,g.jsx)("div",{className:"border border-border rounded overflow-y-auto h-full p-4 prose prose-sm prose-slate dark:prose-invert max-w-none",children:e?(0,g.jsx)(iW,{remarkPlugins:[rQ],components:as,children:e}):(0,g.jsx)("p",{className:"text-muted-foreground italic",children:"No content"})});return(0,g.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,g.jsxs)("div",{className:"flex gap-1 mb-2 md:hidden flex-shrink-0",children:[(0,g.jsxs)(r3.Button,{type:"button",variant:"editor"===s?"default":"outline",size:"sm",onClick:()=>o("editor"),children:[(0,g.jsx)(u7,{className:"w-4 h-4 mr-1"}),"Editor"]}),(0,g.jsxs)(r3.Button,{type:"button",variant:"preview"===s?"default":"outline",size:"sm",onClick:()=>o("preview"),children:[(0,g.jsx)(de.Eye,{className:"w-4 h-4 mr-1"}),"Preview"]})]}),(0,g.jsxs)("div",{className:"hidden md:grid md:grid-cols-2 md:gap-4 flex-1 min-h-0",children:[h,u]}),(0,g.jsx)("div",{className:"md:hidden flex-1 min-h-0",children:"editor"===s?h:u})]})}e.s(["TaskDialog",0,function({mode:e,isOpen:i,onClose:r,repositories:n=[],task:s,onUpdate:o}){let a=ac(),[l,c]=(0,m.useState)(""),[h,u]=(0,m.useState)([]),[d,f]=(0,m.useState)(""),[p,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[b,S]=(0,m.useState)({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),[w,x]=(0,m.useState)(!1),[C,k]=(0,m.useState)({}),[E,R]=(0,m.useState)("editor"),[T,D]=(0,m.useState)(!1),L=(0,m.useRef)(null),{effectiveTheme:A}=(0,ao.useTheme)();(0,m.useEffect)(()=>{"edit"===e&&s&&S({title:s.title,description:s.description,owner:s.owner,repo:s.repo,branch:s.branch,baseBranch:"",status:s.status,effort:s.effort,order:s.order})},[e,s,i]);let P=(0,m.useMemo)(()=>n.map(e=>({value:`${e.owner}/${e.repo}`,label:`${e.owner}/${e.repo}`})),[n]),M=(0,m.useMemo)(()=>h.map(e=>({value:e,label:e===d?`${e} (default)`:e})),[h,d]);(0,m.useEffect)(()=>{if("create"===e){if(!l){u([]),f(""),S(e=>({...e,baseBranch:""}));return}(async()=>{_(!0),y("");try{let[e,i]=l.split("/"),r=await fetch((0,dt.apiUrl)(`/api/repos/${e}/${i}/branches`));if(!r.ok)throw Error("Failed to fetch branches");let n=await r.json();u(n.data.branches),f(n.data.defaultBranch),S(e=>({...e,baseBranch:n.data.defaultBranch}))}catch(e){console.error("Failed to fetch branches:",e),y("Failed to load branches. Repository may not be initialized."),u([]),f("")}finally{_(!1)}})()}},[l,e]);let O=async i=>{if(i.preventDefault(),k({}),"create"===e){x(!0);try{let e=await fetch((0,dt.apiUrl)("/api/tasks/validate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.title,owner:b.owner,repo:b.repo,branch:b.branch})}),i=await e.json();if(!i.valid){let e={};i.errors.forEach(i=>{e[i.field]=i.message}),k(e),x(!1);return}let n={title:b.title,description:b.description,owner:b.owner,repo:b.repo,branch:b.branch,baseBranch:b.baseBranch};r(),c(""),S({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),x(!1);let s=a.loading("Creating task...",n.title);try{if(!(await fetch((0,dt.apiUrl)("/api/tasks"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create task");a.dismiss(s)}catch(i){let e=i instanceof Error?i.message:"Unknown error";a.error(s,"Failed to create task",e)}}catch(i){x(!1);let e=i instanceof Error?i.message:"Validation failed";a.error(void 0,"Validation failed",e)}}else if("edit"===e&&o&&s){x(!0);try{let e=await o(s.id,{title:b.title,description:b.description,status:b.status,effort:b.effort,order:b.order});if(e.success)r();else if(e.errors){let i={};e.errors.forEach(e=>{i[e.field]=e.message}),k(i)}}catch(e){console.error("Failed to update task:",e),k({global:e instanceof Error?e.message:"Failed to update task. Please try again."})}finally{x(!1)}}},B="create"===e,N=B?"Add New Task":"Edit Task",I=B?"Create":"Save";return(0,g.jsxs)(ah.Dialog,{open:i,onOpenChange:e=>{e.open||w||r()},title:N,maxWidth:B?"2xl":"6xl",fullScreen:!B,showCloseButton:!w,dismissOnEsc:!T,children:[w&&(0,g.jsx)("div",{className:"absolute inset-0 bg-card bg-opacity-90 rounded-lg flex items-center justify-center z-10",children:(0,g.jsx)(aa.LoadingSpinner,{size:"lg",message:B?"Creating task...":"Saving task..."})}),C.global&&(0,g.jsx)("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/50 rounded text-destructive text-sm",children:C.global}),(0,g.jsxs)("form",{onSubmit:O,className:B?"space-y-4":"flex flex-col gap-4 flex-1 min-h-0 overflow-hidden",children:[B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Repository *"}),(0,g.jsx)(u8,{options:P,value:l,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;if(c(i),i){let[e,r]=i.split("/");S(i=>({...i,owner:e,repo:r,baseBranch:""}))}else S(e=>({...e,owner:"",repo:"",baseBranch:""}))},placeholder:"Select repository",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Title *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:200,value:b.title,onChange:e=>S({...b,title:e.target.value}),className:"w-full",disabled:w})]}),!B&&s&&(0,g.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 p-3 bg-muted/50 rounded-md text-sm",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Repository"}),(0,g.jsxs)("p",{className:"text-muted-foreground",children:[s.owner,"/",s.repo]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.branch})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Base Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.baseBranch||"N/A"})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Worktree"}),(0,g.jsx)("p",{className:"text-muted-foreground capitalize",children:s.worktreeStatus})]})]}),(0,g.jsxs)("div",{className:B?"":"flex flex-col flex-1 min-h-0",children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground flex-shrink-0",children:"Description"}),B?(0,g.jsx)(uG.Textarea,{maxLength:5e3,value:b.description,onChange:e=>S({...b,description:e.target.value}),className:"min-h-24 w-full",disabled:w}):(0,g.jsx)(di,{value:b.description,onChange:e=>S(i=>({...i,description:e})),editorRef:L,theme:A,activeTab:E,onTabChange:R,disabled:w,onFocusChange:D})]}),!B&&(0,g.jsxs)("div",{className:"grid grid-cols-3 gap-4 flex-shrink-0",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Status"}),(0,g.jsxs)("select",{value:b.status,onChange:e=>S({...b,status:e.target.value}),className:"w-full h-9 pl-3 pr-10 py-1 rounded-md border border-input bg-transparent text-sm shadow-xs text-foreground",disabled:w,children:[(0,g.jsx)("option",{value:"backlog",children:"Backlog"}),(0,g.jsx)("option",{value:"planning",children:"Planning"}),(0,g.jsx)("option",{value:"tasking",children:"Tasking"}),(0,g.jsx)("option",{value:"coding",children:"Coding"}),(0,g.jsx)("option",{value:"reviewing",children:"Reviewing"}),(0,g.jsx)("option",{value:"done",children:"Done"})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Effort (h)"}),(0,g.jsx)(uX.Input,{type:"number",step:"0.5",min:"0.5",max:"40",value:b.effort??"",onChange:e=>S({...b,effort:parseFloat(e.target.value)||void 0}),className:"w-full",placeholder:"2.5",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Order"}),(0,g.jsx)(uX.Input,{type:"number",min:"0",value:b.order??"",onChange:e=>S({...b,order:parseInt(e.target.value)||void 0}),className:"w-full",placeholder:"0",disabled:w})]})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Base Branch *"}),p?(0,g.jsxs)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-muted-foreground flex items-center gap-2",children:[(0,g.jsx)(aa.LoadingSpinner,{size:"sm"}),(0,g.jsx)("span",{className:"text-xs",children:"Loading branches..."})]}):h.length>0?(0,g.jsx)(u8,{options:M,value:b.baseBranch,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;S({...b,baseBranch:i})},placeholder:"Select base branch",disabled:w}):(0,g.jsx)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-sm text-muted-foreground flex items-center",children:v||"Select repository first"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your new branch will be created from this branch"})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"New Branch Name *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:255,value:b.branch,onChange:e=>S({...b,branch:e.target.value}),className:`w-full ${C.branch?"border-destructive":""}`,placeholder:"feature/new-feature",disabled:w,"aria-invalid":!!C.branch}),C.branch&&(0,g.jsx)("p",{className:"text-xs text-destructive mt-1",children:C.branch}),!C.branch&&(0,g.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Will be created from ",b.baseBranch||"base branch"]})]}),(0,g.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,g.jsx)(r3.Button,{type:"button",variant:"outline",size:"lg",onClick:r,className:"active:scale-95",disabled:w,children:"Cancel"}),(0,g.jsx)(r3.Button,{type:"submit",size:"lg",className:"active:scale-95",disabled:w||B&&p,children:I})]})]})]})}],10483)},86311,e=>{"use strict";let i=(0,e.i(75254).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,i],86311)},73884,e=>{"use strict";let i=(0,e.i(75254).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,i],73884)},48214,e=>{"use strict";let i=(0,e.i(75254).default)("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);e.s(["CirclePause",0,i],48214)},68054,e=>{"use strict";let i=(0,e.i(75254).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,i],68054)},57212,e=>{"use strict";let i=(0,e.i(75254).default)("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["WifiOff",0,i],57212)},30939,99894,93309,e=>{"use strict";let i,r,n,s,o,a,l,c,h,u,d,f;var p=e.i(18050),g=e.i(71645),m=e.i(37727),_=e.i(31278),v=e.i(48214),y=e.i(31245),b=e.i(68054),S=e.i(63209),w=e.i(57212),x=e.i(95468),C=e.i(73884),k=e.i(86311),E=e.i(68995),R=e.i(85902),T=e.i(31449);function D({entry:e}){if(!e||"idle"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]});if("connecting"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"connecting"})]});if("error"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(S.AlertCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"error"})]});if("exited"===e.terminal||"paused"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(w.WifiOff,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:e.terminal})]});switch(e.claude){case"running":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-primary",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"running"})]});case"waiting":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-warning",children:[(0,p.jsx)(k.MessageSquare,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"waiting"})]});case"success":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-success",children:[(0,p.jsx)(x.CheckCircle2,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"success"})]});case"failure":case"error":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(C.XCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"failure"===e.claude?"failure":"error"})]});default:return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]})}}e.s(["SessionTabs",0,function({tabs:e,activeTabId:i,onTabChange:r,onTabCreateTerminal:n,onTabCreateClaude:s,onTabDelete:o,tabStatusMap:a,onVoiceInputTranscribed:l}){let c=(0,g.useRef)([]),[h,u]=(0,g.useState)({left:0,width:0}),[d,f]=(0,g.useState)(null);(0,g.useEffect)(()=>{let r=e.findIndex(e=>e.tab_id===i);if(-1!==r&&c.current[r]){let e=c.current[r];e&&u({left:e.offsetLeft,width:e.offsetWidth})}},[i,e]);let _=new Map,v=0;for(let i of e)"terminal"===i.mode&&(v+=1,_.set(i.tab_id,v));return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(E.ConfirmDialog,{open:null!==d,onOpenChange:e=>{e.open||f(null)},title:"Delete Tab",message:d?.isRunning?"This tab is running. Are you sure you want to delete it?":"Delete this tab?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{d&&o(d.tabId)},variant:"danger"}),(0,p.jsxs)("div",{className:"relative flex items-center gap-2 overflow-x-auto border-b border-border pb-1",children:[e.map((n,s)=>{let o=i===n.tab_id,l=a?.get(n.tab_id),h=(l?.claude==="running"||l?.claude==="waiting")&&l?.terminal==="connected";return(0,p.jsxs)("div",{ref:e=>{c.current[s]=e},onClick:()=>r(n.tab_id),className:`
|
|
12
|
-
flex items-center gap-2 px-4 pt-1 pb-2 h-10 flex-shrink-0 transition-colors cursor-pointer
|
|
13
|
-
${o?"text-primary":h?"text-primary-light":"text-muted-foreground hover:text-foreground"}
|
|
14
|
-
`,children:[(0,p.jsx)("div",{className:"font-medium flex items-center gap-2",children:"terminal"===n.mode?(0,p.jsxs)("span",{className:"text-xs",children:["terminal ",_.get(n.tab_id)]}):(0,p.jsx)(D,{entry:l})}),e.length>1&&(0,p.jsx)(R.Button,{variant:"ghost",size:"icon-xs",onClick:e=>{e.stopPropagation(),f({tabId:n.tab_id,isRunning:h})},children:(0,p.jsx)(m.X,{className:"w-4 h-4"})})]},n.tab_id)}),(0,p.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-auto",children:[l&&(0,p.jsx)(T.VoiceInputButton,{onTranscribed:l}),(0,p.jsx)("div",{className:"w-px self-stretch bg-theme"}),n&&(0,p.jsx)(R.Button,{size:"icon",onClick:n,title:"Open terminal",children:(0,p.jsx)(b.Terminal,{className:"w-4 h-4"})}),(0,p.jsx)(R.Button,{size:"icon",onClick:s,title:"Open terminal with Claude",children:(0,p.jsx)(y.Bot,{className:"w-4 h-4"})})]}),(0,p.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-[left,width]",style:{left:`${h.left}px`,width:`${h.width}px`}})]})]})}],30939);var L=e.i(47167),A=Object.defineProperty,P=Object.getOwnPropertyDescriptor,M=(e,i,r,n)=>{for(var s,o=n>1?void 0:n?P(i,r):i,a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n?s(i,r,o):s(o))||o);return n&&o&&A(i,r,o),o},O=(e,i)=>(r,n)=>i(r,n,e),B="Terminal input",N="Too much output to announce, navigate to rows manually to read";function I(e,i,r,n){var s;s=e=e.replace(/\r?\n/g,"\r"),e=r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+s+"\x1b[201~":s,r.triggerDataEvent(e,!0),i.value=""}function F(e,i,r){let n=r.getBoundingClientRect(),s=e.clientX-n.left-10,o=e.clientY-n.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${s}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function z(e,i,r,n,s){F(e,i,r),s&&n.rightClickSelect(e),i.value=n.selectionText,i.select()}function H(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function j(e,i=0,r=e.length){let n="";for(let s=i;s<r;++s){let i=e[s];i>65535?(i-=65536,n+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):n+=String.fromCharCode(i)}return n}var W=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s=0;if(this._interim){let r=e.charCodeAt(s++);56320<=r&&r<=57343?i[n++]=(this._interim-55296)*1024+r-56320+65536:(i[n++]=this._interim,i[n++]=r),this._interim=0}for(let o=s;o<r;++o){let s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,n;let a=e.charCodeAt(o);56320<=a&&a<=57343?i[n++]=(s-55296)*1024+a-56320+65536:(i[n++]=s,i[n++]=a);continue}65279!==s&&(i[n++]=s)}return n}},$=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s,o,a,l,c=0,h=0;if(this.interim[0]){let s=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let a=0,l;for(;(l=63&this.interim[++a])&&a<4;)o<<=6,o|=l;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-a;for(;h<u;){if(h>=r)return 0;if((192&(l=e[h++]))!=128){h--,s=!0;break}this.interim[a++]=l,o<<=6,o|=63&l}s||(2===c?o<128?h--:i[n++]=o:3===c?o<2048||o>=55296&&o<=57343||65279===o||(i[n++]=o):o<65536||o>1114111||(i[n++]=o)),this.interim.fill(0)}let u=r-4,d=h;for(;d<r;){for(;d<u&&!(128&(s=e[d]))&&!(128&(o=e[d+1]))&&!(128&(a=e[d+2]))&&!(128&(l=e[d+3]));)i[n++]=s,i[n++]=o,i[n++]=a,i[n++]=l,d+=4;if((s=e[d++])<128)i[n++]=s;else if((224&s)==192){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128||(c=(31&s)<<6|63&o)<128){d--;continue}i[n++]=c}else if((240&s)==224){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if((c=(15&s)<<12|(63&o)<<6|63&a)<2048||c>=55296&&c<=57343||65279===c)continue;i[n++]=c}else if((248&s)==240){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=a,n;if((192&(l=e[d++]))!=128){d--;continue}if((c=(7&s)<<18|(63&o)<<12|(63&a)<<6|63&l)<65536||c>1114111)continue;i[n++]=c}}return n}},U=class e{constructor(){this.fg=0,this.bg=0,this.extended=new q}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},q=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},V=class e extends U{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new q,this.combinedData=""}static fromCharData(i){let r=new e;return r.setFromCharData(i),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?H(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let n=e[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(r-55296)*1024+n-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},K="di$target",Y="di$dependencies",X=new Map;function G(e){if(X.has(e))return X.get(e);let i=function(e,r,n){var s,o,a;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");s=i,o=e,a=n,o[K]===o?o[Y].push({id:s,index:a}):(o[Y]=[{id:s,index:a}],o[K]=o)};return i._id=e,X.set(e,i),i}var J=G("BufferService"),Z=G("CoreMouseService"),Q=G("CoreService"),ee=G("CharsetService"),et=G("InstantiationService"),ei=G("LogService"),er=G("OptionsService"),en=G("OscLinkService"),es=G("UnicodeService"),eo=G("DecorationService"),ea=class{constructor(e,i,r){this._bufferService=e,this._optionsService=i,this._oscLinkService=r}provideLinks(e,i){let r=this._bufferService.buffer.lines.get(e-1);if(!r)return void i(void 0);let n=[],s=this._optionsService.rawOptions.linkHandler,o=new V,a=r.getTrimmedLength(),l=-1,c=-1,h=!1;for(let i=0;i<a;i++)if(!(-1===c&&!r.hasContent(i))){if(r.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId)if(-1===c){c=i,l=o.extended.urlId;continue}else h=o.extended.urlId!==l;else -1!==c&&(h=!0);if(h||-1!==c&&i===a-1){let r=this._oscLinkService.getLinkData(l)?.uri;if(r){let o={start:{x:c+1,y:e},end:{x:i+ +(!h&&i===a-1),y:e}},l=!1;if(!s?.allowNonHttpProtocols)try{let e=new URL(r);["http:","https:"].includes(e.protocol)||(l=!0)}catch{l=!0}l||n.push({text:r,range:o,activate:(e,i)=>s?s.activate(e,i,o):function(e){if(confirm(`Do you want to navigate to ${e}?
|
|
15
|
-
|
|
16
|
-
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}(i),hover:(e,i)=>s?.hover?.(e,i,o),leave:(e,i)=>s?.leave?.(e,i,o)})}h=!1,o.hasExtendedAttrs()&&o.extended.urlId?(c=i,l=o.extended.urlId):(c=-1,l=-1)}}i(n)}};ea=M([O(0,J),O(1,er),O(2,en)],ea);var el=G("CharSizeService"),ec=G("CoreBrowserService"),eh=G("MouseService"),eu=G("RenderService"),ed=G("SelectionService"),ef=G("CharacterJoinerService"),ep=G("ThemeService"),eg=G("LinkProviderService"),em=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?eb.isErrorNoTelemetry(e)?new eb(e.message+`
|
|
17
|
-
|
|
18
|
-
`+e.stack):Error(e.message+`
|
|
19
|
-
|
|
20
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function e_(e){var i;(i=e)instanceof ey||i instanceof Error&&i.name===ev&&i.message===ev||em.onUnexpectedError(e)}var ev="Canceled",ey=class extends Error{constructor(){super(ev),this.name=this.message}},eb=class e extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(i){if(i instanceof e)return i;let r=new e;return r.message=i.message,r.stack=i.stack,r}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}},eS=class e extends Error{constructor(i){super(i||"An unexpected bug occurred."),Object.setPrototypeOf(this,e.prototype)}};function ew(e,i=0){return e[e.length-(1+i)]}(ez=eH||={}).isLessThan=function(e){return e<0},ez.isLessThanOrEqual=function(e){return e<=0},ez.isGreaterThan=function(e){return e>0},ez.isNeitherLessOrGreaterThan=function(e){return 0===e},ez.greaterThan=1,ez.lessThan=-1,ez.neitherLessOrGreaterThan=0;var ex=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(i=>(e(i),!0))}toArray(){let e=[];return this.iterate(i=>(e.push(i),!0)),e}filter(i){return new e(e=>this.iterate(r=>!i(r)||e(r)))}map(i){return new e(e=>this.iterate(r=>e(i(r))))}some(e){let i=!1;return this.iterate(r=>!(i=e(r))),i}findFirst(e){let i;return this.iterate(r=>!e(r)||(i=r,!1)),i}findLast(e){let i;return this.iterate(r=>(e(r)&&(i=r),!0)),i}findLastMaxBy(e){let i,r=!0;return this.iterate(n=>((r||eH.isGreaterThan(e(n,i)))&&(r=!1,i=n),!0)),i}};ex.empty=new ex(e=>{});function eC(e){}function ek(e,i){}function eE(e){if(ej.is(e)){let i=[];for(let r of e)if(r)try{r.dispose()}catch(e){i.push(e)}if(1===i.length)throw i[0];if(i.length>1)throw AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function eR(e){let i={dispose:function(e,i){let r=this,n=!1,s;return function(){if(n)return s;if(n=!0,i)try{s=e.apply(r,arguments)}finally{i()}else s=e.apply(r,arguments);return s}}(()=>{eC(i),e()})};return i}(e=>{function i(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=i;let r=Object.freeze([]);function*n(e){yield e}e.empty=function(){return r},e.single=n,e.wrap=function(e){return i(e)?e:n(e)},e.from=function(e){return e||r},e.reverse=function*(e){for(let i=e.length-1;i>=0;i--)yield e[i]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,i){let r=0;for(let n of e)if(i(n,r++))return!0;return!1},e.find=function(e,i){for(let r of e)if(i(r))return r},e.filter=function*(e,i){for(let r of e)i(r)&&(yield r)},e.map=function*(e,i){let r=0;for(let n of e)yield i(n,r++)},e.flatMap=function*(e,i){let r=0;for(let n of e)yield*i(n,r++)},e.concat=function*(...e){for(let i of e)yield*i},e.reduce=function(e,i,r){let n=r;for(let r of e)n=i(n,r);return n},e.slice=function*(e,i,r=e.length){for(i<0&&(i+=e.length),r<0?r+=e.length:r>e.length&&(r=e.length);i<r;i++)yield e[i]},e.consume=function(i,r=1/0){let n=[];if(0===r)return[n,i];let s=i[Symbol.iterator]();for(let i=0;i<r;i++){let i=s.next();if(i.done)return[n,e.empty()];n.push(i.value)}return[n,{[Symbol.iterator]:()=>s}]},e.asyncToArray=async function(e){let i=[];for await(let r of e)i.push(r);return Promise.resolve(i)}})(ej||={});var eT=class e{constructor(){var e;this._toDispose=new Set,this._isDisposed=!1,e=this}dispose(){this._isDisposed||(eC(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{eE(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw Error("Cannot register a disposable on itself!");return ek(i,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}delete(e){if(e){if(e===this)throw Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),ek(e,null))}};eT.DISABLE_DISPOSED_WARNING=!1;var eD=eT,eL=class{constructor(){var e;this._store=new eD,e=this,ek(this._store,this)}dispose(){eC(this),this._store.dispose()}_register(e){if(e===this)throw Error("Cannot register a disposable on itself!");return this._store.add(e)}};eL.None=Object.freeze({dispose(){}});var eA=class{constructor(){var e;this._isDisposed=!1,e=this}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&ek(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,eC(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&ek(e,null),e}},eP="object"==typeof window?window:globalThis,eM=class e{constructor(i){this.element=i,this.next=e.Undefined,this.prev=e.Undefined}};eM.Undefined=new eM(void 0);var eO=class{constructor(){this._first=eM.Undefined,this._last=eM.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===eM.Undefined}clear(){let e=this._first;for(;e!==eM.Undefined;){let i=e.next;e.prev=eM.Undefined,e.next=eM.Undefined,e=i}this._first=eM.Undefined,this._last=eM.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let r=new eM(e);if(this._first===eM.Undefined)this._first=r,this._last=r;else if(i){let e=this._last;this._last=r,r.prev=e,e.next=r}else{let e=this._first;this._first=r,r.next=e,e.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==eM.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==eM.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==eM.Undefined&&e.next!==eM.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===eM.Undefined&&e.next===eM.Undefined?(this._first=eM.Undefined,this._last=eM.Undefined):e.next===eM.Undefined?(this._last=this._last.prev,this._last.next=eM.Undefined):e.prev===eM.Undefined&&(this._first=this._first.next,this._first.prev=eM.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==eM.Undefined;)yield e.element,e=e.next}},eB=globalThis.performance&&"function"==typeof globalThis.performance.now,eN=class e{static create(i){return new e(i)}constructor(e){this._now=eB&&!1===e?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return -1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}};(e=>{function i(e){}function r(e){return(i,r=null,n)=>{let s=!1,o;return o=e(e=>{if(!s)return o?o.dispose():s=!0,i.call(r,e)},null,n),s&&o.dispose(),o}}function n(e,i,r){return o((r,n=null,s)=>e(e=>r.call(n,i(e)),null,s),r)}function s(e,i,r){return o((r,n=null,s)=>e(e=>i(e)&&r.call(n,e),null,s),r)}function o(e,r){let n,s={onWillAddFirstListener(){n=e(o.fire,o)},onDidRemoveLastListener(){n?.dispose()}};r||i(s);let o=new eX(s);return r?.add(o),o.event}function a(e,r,n=100,s=!1,o=!1,l,c){let h,u,d,f=0,p,g={leakWarningThreshold:l,onWillAddFirstListener(){h=e(e=>{f++,u=r(u,e),s&&!d&&(m.fire(u),u=void 0),p=()=>{let e=u;u=void 0,d=void 0,(!s||f>1)&&m.fire(e),f=0},"number"==typeof n?(clearTimeout(d),d=setTimeout(p,n)):void 0===d&&(d=0,queueMicrotask(p))})},onWillRemoveListener(){o&&f>0&&p?.()},onDidRemoveLastListener(){p=void 0,h.dispose()}};c||i(g);let m=new eX(g);return c?.add(m),m.event}e.None=()=>eL.None,e.defer=function(e,i){return a(e,()=>{},0,void 0,!0,void 0,i)},e.once=r,e.map=n,e.forEach=function(e,i,r){return o((r,n=null,s)=>e(e=>{i(e),r.call(n,e)},null,s),r)},e.filter=s,e.signal=function(e){return e},e.any=function(...e){return(i,r=null,n)=>{var s,o;return s=function(...e){let i=eR(()=>eE(e));return i}(...e.map(e=>e(e=>i.call(r,e)))),(o=n)instanceof Array?o.push(s):o&&o.add(s),s}},e.reduce=function(e,i,r,s){let o=r;return n(e,e=>o=i(o,e),s)},e.debounce=a,e.accumulate=function(i,r=0,n){return e.debounce(i,(e,i)=>e?(e.push(i),e):[i],r,void 0,!0,void 0,n)},e.latch=function(e,i=(e,i)=>e===i,r){let n=!0,o;return s(e,e=>{let r=n||!i(e,o);return n=!1,o=e,r},r)},e.split=function(i,r,n){return[e.filter(i,r,n),e.filter(i,e=>!r(e),n)]},e.buffer=function(e,i=!1,r=[],n){let s=r.slice(),o=e(e=>{s?s.push(e):l.fire(e)});n&&n.add(o);let a=()=>{s?.forEach(e=>l.fire(e)),s=null},l=new eX({onWillAddFirstListener(){o||(o=e(e=>l.fire(e)),n&&n.add(o))},onDidAddFirstListener(){s&&(i?setTimeout(a):a())},onDidRemoveLastListener(){o&&o.dispose(),o=null}});return n&&n.add(l),l.event},e.chain=function(e,i){return(r,n,s)=>{let o=i(new c);return e(function(e){let i=o.evaluate(e);i!==l&&r.call(n,i)},void 0,s)}};let l=Symbol("HaltChainable");class c{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(i=>(e(i),i)),this}filter(e){return this.steps.push(i=>e(i)?i:l),this}reduce(e,i){let r=i;return this.steps.push(i=>r=e(r,i)),this}latch(e=(e,i)=>e===i){let i=!0,r;return this.steps.push(n=>{let s=i||!e(n,r);return i=!1,r=n,s?n:l}),this}evaluate(e){for(let i of this.steps)if((e=i(e))===l)break;return e}}e.fromNodeEventEmitter=function(e,i,r=e=>e){let n=(...e)=>s.fire(r(...e)),s=new eX({onWillAddFirstListener:()=>e.on(i,n),onDidRemoveLastListener:()=>e.removeListener(i,n)});return s.event},e.fromDOMEventEmitter=function(e,i,r=e=>e){let n=(...e)=>s.fire(r(...e)),s=new eX({onWillAddFirstListener:()=>e.addEventListener(i,n),onDidRemoveLastListener:()=>e.removeEventListener(i,n)});return s.event},e.toPromise=function(e){return new Promise(i=>r(e)(i))},e.fromPromise=function(e){let i=new eX;return e.then(e=>{i.fire(e)},()=>{i.fire(void 0)}).finally(()=>{i.dispose()}),i.event},e.forward=function(e,i){return e(e=>i.fire(e))},e.runAndSubscribe=function(e,i,r){return i(r),e(e=>i(e))};class h{constructor(e,r){this._observable=e,this._counter=0,this._hasChanged=!1;let n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};r||i(n),this.emitter=new eX(n),r&&r.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,i){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,i){return new h(e,i).emitter.event},e.fromObservableLight=function(e){return(i,r,n)=>{let s=0,o=!1,a={beginUpdate(){s++},endUpdate(){0==--s&&(e.reportChanges(),o&&(o=!1,i.call(r)))},handlePossibleChange(){},handleChange(){o=!0}};e.addObserver(a),e.reportChanges();let l={dispose(){e.removeObserver(a)}};return n instanceof eD?n.add(l):Array.isArray(n)&&n.push(l),l}}})(eW||={});var eI=class e{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new eN,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};eI.all=new Set,eI._idPool=0;var eF=class e{constructor(i,r,n=(e._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){let r=this.threshold;if(r<=0||i<r)return;this._stacks||(this._stacks=new Map);let n=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,n+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=.5*r;let[e,n]=this.getMostFrequentStack(),s=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${n}):`;console.warn(s),console.warn(e);let o=new eq(s,e);this._errorHandler(o)}return()=>{let i=this._stacks.get(e.value)||0;this._stacks.set(e.value,i-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[r,n]of this._stacks)(!e||i<n)&&(e=[r,n],i=n);return e}};eF._idPool=1;var ez,eH,ej,eW,e$,eU=class e{constructor(e){this.value=e}static create(){return new e(Error().stack??"")}print(){console.warn(this.value.split(`
|
|
21
|
-
`).slice(2).join(`
|
|
22
|
-
`))}},eq=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},eV=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},eK=0,eY=class{constructor(e){this.value=e,this.id=eK++}},eX=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new eF(e?.onListenerError??e_,this._options?.leakWarningThreshold??-1):void 0,this._perfMon=this._options?._profName?new eI(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,i,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let i=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],r=new eV(`${e}. HINT: Stack shows most frequent listener (${i[1]}-times)`,i[0]);return(this._options?.onListenerError||e_)(r),eL.None}if(this._disposed)return eL.None;i&&(e=e.bind(i));let n=new eY(e),s;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(n.stack=eU.create(),s=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof eY?(this._deliveryQueue??=new eG,this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=eR(()=>{e$?.unregister(o),s?.(),this._removeListener(n)});if(r instanceof eD?r.add(o):Array.isArray(r)&&r.push(o),e$){let e=Error().stack.split(`
|
|
23
|
-
`).slice(2,3).join(`
|
|
24
|
-
`).trim(),i=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);e$.register(o,i?.[2]??e,o)}return o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,r=i.indexOf(e);if(-1===r)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),Error("Attempted to dispose unknown listener");this._size--,i[r]=void 0;let n=this._deliveryQueue.current===this;if(2*this._size<=i.length){let e=0;for(let r=0;r<i.length;r++)i[r]?i[e++]=i[r]:n&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=e}}_deliver(e,i){if(!e)return;let r=this._options?.onListenerError||e_;try{e.value(i)}catch(e){r(e)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof eY)this._deliver(this._listeners,e);else{let i=this._deliveryQueue;i.enqueue(this,e,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},eG=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,r){this.i=0,this.end=r,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},eJ=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new eX,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new eX,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let r=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(r,e),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let r=this.getWindowId(i);this.mapWindowIdToFullScreen.set(r,e),this._onDidChangeFullscreen.fire(r)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};eJ.INSTANCE=new eJ,eJ.INSTANCE.onDidChangeZoomLevel,eJ.INSTANCE.onDidChangeFullscreen;var eZ="object"==typeof navigator?navigator.userAgent:"",eQ=eZ.indexOf("Firefox")>=0,e0=eZ.indexOf("AppleWebKit")>=0,e1=eZ.indexOf("Chrome")>=0,e2=!e1&&eZ.indexOf("Safari")>=0;eZ.indexOf("Electron/"),eZ.indexOf("Android");var e5=!1;if("function"==typeof eP.matchMedia){let e=eP.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=eP.matchMedia("(display-mode: fullscreen)");e5=e.matches,e3=e,"string"==typeof e3&&(e3=eP.matchMedia(e3)),e3.addEventListener("change",({matches:e})=>{e5&&i.matches||(e5=e)})}var e3,e4,e6,e9=!1,e8=!1,e7=!1,te=!1,tt=!1,ti="en",tr=globalThis;"u">typeof tr.vscode&&"u">typeof tr.vscode.process?e6=tr.vscode.process:"u">typeof L.default&&"string"==typeof L.default?.versions?.node&&(e6=L.default);var tn="string"==typeof e6?.versions?.electron&&e6?.type==="renderer";if("object"==typeof e6){e9="win32"===e6.platform,e8="darwin"===e6.platform,(e7="linux"===e6.platform)&&e6.env.SNAP&&e6.env.SNAP_REVISION,e6.env.CI||e6.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ti="en";let e=e6.env.VSCODE_NLS_CONFIG;if(e)try{let i=JSON.parse(e);i.userLocale,i.osLocale,ti=i.resolvedLanguage||"en",i.languagePack?.translationsConfigFile}catch{}te=!0}else"object"!=typeof navigator||tn?console.error("Unable to resolve platform."):(e9=(e4=navigator.userAgent).indexOf("Windows")>=0,e8=e4.indexOf("Macintosh")>=0,(e4.indexOf("Macintosh")>=0||e4.indexOf("iPad")>=0||e4.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,e7=e4.indexOf("Linux")>=0,e4?.indexOf("Mobi"),tt=!0,ti=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());var ts=e9,to=e8,ta=e7,tl=te;tt&&"function"==typeof tr.importScripts&&tr.origin;var tc,th=e4,tu=ti;(tS=tc||={}).value=function(){return tu},tS.isDefaultVariant=function(){return 2===tu.length?"en"===tu:tu.length>=3&&"e"===tu[0]&&"n"===tu[1]&&"-"===tu[2]},tS.isDefault=function(){return"en"===tu};var td="function"==typeof tr.postMessage&&!tr.importScripts,tf=(()=>{if(td){let e=[];tr.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let r=0,n=e.length;r<n;r++){let n=e[r];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(r,1),n.callback();return}}});let i=0;return r=>{let n=++i;e.push({id:n,callback:r}),tr.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),tp=!!(th&&th.indexOf("Chrome")>=0);th&&th.indexOf("Firefox"),!tp&&th&&th.indexOf("Safari"),th&&th.indexOf("Edg/"),th&&th.indexOf("Android");var tg="object"==typeof navigator?navigator:{};tl||document.queryCommandSupported&&document.queryCommandSupported("copy")||tg&&tg.clipboard&&tg.clipboard.writeText,tl||tg&&tg.clipboard&&tg.clipboard.readText,tl||e5||tg.keyboard,"ontouchstart"in eP||tg.maxTouchPoints,eP.PointerEvent&&("ontouchstart"in eP||navigator.maxTouchPoints);var tm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},t_=new tm,tv=new tm,ty=new tm,tb=Array(230);(tw=tx||={}).toString=function(e){return t_.keyCodeToStr(e)},tw.fromString=function(e){return t_.strToKeyCode(e)},tw.toUserSettingsUS=function(e){return tv.keyCodeToStr(e)},tw.toUserSettingsGeneral=function(e){return ty.keyCodeToStr(e)},tw.fromUserSettings=function(e){return tv.strToKeyCode(e)||ty.strToKeyCode(e)},tw.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return t_.keyCodeToStr(e)};var tS,tw,tx,tC,tk=class e{constructor(e,i,r,n,s){this.ctrlKey=e,this.shiftKey=i,this.altKey=r,this.metaKey=n,this.keyCode=s}equals(i){return i instanceof e&&this.ctrlKey===i.ctrlKey&&this.shiftKey===i.shiftKey&&this.altKey===i.altKey&&this.metaKey===i.metaKey&&this.keyCode===i.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",r=this.altKey?"1":"0",n=this.metaKey?"1":"0";return`K${e}${i}${r}${n}${this.keyCode}`}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}toKeybinding(){return new tE([this])}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}},tE=class{constructor(e){if(0===e.length)throw function(e){return e?Error(`Illegal argument: ${e}`):Error("Illegal argument")}("chords");this.chords=e}getHashCode(){let e="";for(let i=0,r=this.chords.length;i<r;i++)0!==i&&(e+=";"),e+=this.chords[i].getHashCode();return e}equals(e){if(null===e||this.chords.length!==e.chords.length)return!1;for(let i=0;i<this.chords.length;i++)if(!this.chords[i].equals(e.chords[i]))return!1;return!0}},tR=to?256:2048,tT=to?2048:256,tD=class{constructor(e){this._standardKeyboardEventBrand=!0,this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.altGraphKey=e.getModifierState?.("AltGraph"),this.keyCode=function(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return tx.fromString(i)}let i=e.keyCode;if(3===i)return 7;if(eQ)switch(i){case 59:return 85;case 60:if(ta)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(to)return 57}else if(e0&&(to&&93===i||!to&&92===i))return 57;return tb[i]||0}(e),this.code=e.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let i=0;return this.ctrlKey&&(i|=tR),this.altKey&&(i|=512),this.shiftKey&&(i|=1024),this.metaKey&&(i|=tT),i|=e}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new tk(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},tL=new WeakMap,tA=class{static getSameOriginWindowChain(e){let i=tL.get(e);if(!i){i=[],tL.set(e,i);let r=e,n;do(n=function(e){if(!e.parent||e.parent===e)return null;try{let i=e.location,r=e.parent.location;if("null"!==i.origin&&"null"!==r.origin&&i.origin!==r.origin)return null}catch{return null}return e.parent}(r))?i.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):i.push({window:new WeakRef(r),iframeElement:null}),r=n;while(r)}return i.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,i){if(!i||e===i)return{top:0,left:0};let r=0,n=0;for(let s of this.getSameOriginWindowChain(e)){let e=s.window.deref();if(r+=e?.scrollY??0,n+=e?.scrollX??0,e===i||!s.iframeElement)break;let o=s.iframeElement.getBoundingClientRect();r+=o.top,n+=o.left}return{top:r,left:n}}},tP=class{constructor(e,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=0===i.button,this.middleButton=1===i.button,this.rightButton=2===i.button,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,"dblclick"===i.type&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,"number"==typeof i.pageX?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let r=tA.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},tM=class{constructor(e,i=0,r=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=i;let n=!1;if(e1){let e=navigator.userAgent.match(/Chrome\/(\d+)/);n=(e?parseInt(e[1]):123)<=122}if(e){let i=e.view?.devicePixelRatio||1;"u">typeof e.wheelDeltaY?n?this.deltaY=e.wheelDeltaY/(120*i):this.deltaY=e.wheelDeltaY/120:"u">typeof e.VERTICAL_AXIS&&e.axis===e.VERTICAL_AXIS?this.deltaY=-e.detail/3:"wheel"===e.type&&(e.deltaMode===e.DOM_DELTA_LINE?eQ&&!to?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40),"u">typeof e.wheelDeltaX?e2&&ts?this.deltaX=-(e.wheelDeltaX/120):n?this.deltaX=e.wheelDeltaX/(120*i):this.deltaX=e.wheelDeltaX/120:"u">typeof e.HORIZONTAL_AXIS&&e.axis===e.HORIZONTAL_AXIS?this.deltaX=-e.detail/3:"wheel"===e.type&&(e.deltaMode===e.DOM_DELTA_LINE?eQ&&!to?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40),0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*i):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},tO=Object.freeze(function(e,i){let r=setTimeout(e.bind(i),0);return{dispose(){clearTimeout(r)}}});(iE=tC||={}).isCancellationToken=function(e){return e===iE.None||e===iE.Cancelled||e instanceof tB||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},iE.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:eW.None}),iE.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tO});var tB=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tO:(this._emitter||(this._emitter=new eX),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};Symbol("MicrotaskDelay");var tN=class{constructor(e,i){this._isDisposed=!1,this._token=-1,"function"==typeof e&&"number"==typeof i&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new eS("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new eS("Calling 'setIfNotSet' on a disposed TimeoutTimer");-1===this._token&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},tI=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,i,r=globalThis){if(this.isDisposed)throw new eS("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=r.setInterval(()=>{e()},i);this.disposable=eR(()=>{r.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(iR=iT||={}).settled=async function(e){let i,r=await Promise.all(e.map(e=>e.then(e=>e,e=>{i||(i=e)})));if("u">typeof i)throw i;return r},iR.withAsyncBody=function(e){return new Promise(async(i,r)=>{try{await e(i,r)}catch(e){r(e)}})};var tF=class e{static fromArray(i){return new e(e=>{e.emitMany(i)})}static fromPromise(i){return new e(async e=>{e.emitMany(await i)})}static fromPromises(i){return new e(async e=>{await Promise.all(i.map(async i=>e.emitOne(await i)))})}static merge(i){return new e(async e=>{await Promise.all(i.map(async i=>{for await(let r of i)e.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new eX,queueMicrotask(async()=>{let i={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(i)),this.resolve()}catch(e){this.reject(e)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await eW.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(i,r){return new e(async e=>{for await(let n of i)e.emitOne(r(n))})}map(i){return e.map(this,i)}static filter(i,r){return new e(async e=>{for await(let n of i)r(n)&&e.emitOne(n)})}filter(i){return e.filter(this,i)}static coalesce(i){return e.filter(i,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let i=[];for await(let r of e)i.push(r);return i}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};tF.EMPTY=tF.fromArray([]);function tz(e,i){return(i<<5)-i+e|0}function tH(e,i){i=tz(149417,i);for(let r=0,n=e.length;r<n;r++)i=tz(e.charCodeAt(r),i);return i}new DataView(new ArrayBuffer(320));var{registerWindow:tj,getWindow:tW,getDocument:t$,getWindows:tU,getWindowsCount:tq,getWindowId:tV,getWindowById:tK,hasWindow:tY,onDidRegisterWindow:tX,onWillUnregisterWindow:tG,onDidUnregisterWindow:tJ}=(i=new Map,r={window:eP,disposables:new eD},i.set(eP.vscodeWindowId,r),n=new eX,s=new eX,o=new eX,{onDidRegisterWindow:n.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:s.event,registerWindow(e){if(i.has(e.vscodeWindowId))return eL.None;let r=new eD,a={window:e,disposables:r.add(new eD)};return i.set(e.vscodeWindowId,a),r.add(eR(()=>{i.delete(e.vscodeWindowId),s.fire(e)})),r.add(tQ(e,t3.BEFORE_UNLOAD,()=>{o.fire(e)})),n.fire(a),r},getWindows:()=>i.values(),getWindowsCount:()=>i.size,getWindowId:e=>e.vscodeWindowId,hasWindow:e=>i.has(e),getWindowById:function(e,n){return("number"==typeof e?i.get(e):void 0)??(n?r:void 0)},getWindow:e=>e?.ownerDocument?.defaultView?e.ownerDocument.defaultView.window:e?.view?e.view.window:eP,getDocument:e=>tW(e).document}),tZ=class{constructor(e,i,r,n){this._node=e,this._type=i,this._handler=r,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function tQ(e,i,r,n){return new tZ(e,i,r,n)}var t0=function(e,i,r,n){var s;let o=r;return"click"===i||"mousedown"===i||"contextmenu"===i?(s=tW(e),o=function(e){return r(new tP(s,e))}):("keydown"===i||"keypress"===i||"keyup"===i)&&(o=function(e){return r(new tD(e))}),tQ(e,i,o,n)},t1=class extends tI{constructor(e){super(),this.defaultTarget=e&&tW(e)}cancelAndSet(e,i,r){return super.cancelAndSet(e,i,r??this.defaultTarget)}},t2=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){e_(e)}}static sort(e,i){return i.priority-e.priority}};a=new Map,l=new Map,c=new Map,h=new Map,iD=(e,i,r=0)=>{let n=tV(e),s=new t2(i,r),o=a.get(n);return o||(o=[],a.set(n,o)),o.push(s),c.get(n)||(c.set(n,!0),e.requestAnimationFrame(()=>(e=>{c.set(e,!1);let i=a.get(e)??[];for(l.set(e,i),a.set(e,[]),h.set(e,!0);i.length>0;)i.sort(t2.sort),i.shift().execute();h.set(e,!1)})(n))),s};var t5=class e{constructor(e,i){this.width=e,this.height=i}with(i=this.width,r=this.height){return i!==this.width||r!==this.height?new e(i,r):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(i){return i instanceof e?i:new e(i.width,i.height)}static equals(e,i){return e===i||!!e&&!!i&&e.width===i.width&&e.height===i.height}};t5.None=new t5(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,i,r){let n=this.mutationObservers.get(e);n||(n=new Map,this.mutationObservers.set(e,n));let s=function e(i,r){switch(typeof i){case"object":var n,s,o,a;return null===i?tz(349,r):Array.isArray(i)?(n=i,s=tz(104579,s=r),n.reduce((i,r)=>e(r,i),s)):(o=i,a=tz(181387,a=r),Object.keys(o).sort().reduce((i,r)=>(i=tH(r,i),e(o[r],i)),a));case"string":return tH(i,r);case"boolean":return tz(i?433:863,r);case"number":return tz(i,r);case"undefined":return tz(937,r);default:return tz(617,r)}}(r,0),o=n.get(s);if(o)o.users+=1;else{let a=new eX,l=new MutationObserver(e=>a.fire(e));l.observe(e,r);let c=o={users:1,observer:l,onDidMutate:a.event};i.add(eR(()=>{c.users-=1,0===c.users&&(a.dispose(),l.disconnect(),n?.delete(s),n?.size===0&&this.mutationObservers.delete(e))})),n.set(s,o)}return o.onDidMutate}};var t3={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},t4=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let i=t6(e);this._maxWidth!==i&&(this._maxWidth=i,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let i=t6(e);this._width!==i&&(this._width=i,this.domNode.style.width=this._width)}setHeight(e){let i=t6(e);this._height!==i&&(this._height=i,this.domNode.style.height=this._height)}setTop(e){let i=t6(e);this._top!==i&&(this._top=i,this.domNode.style.top=this._top)}setLeft(e){let i=t6(e);this._left!==i&&(this._left=i,this.domNode.style.left=this._left)}setBottom(e){let i=t6(e);this._bottom!==i&&(this._bottom=i,this.domNode.style.bottom=this._bottom)}setRight(e){let i=t6(e);this._right!==i&&(this._right=i,this.domNode.style.right=this._right)}setPaddingTop(e){let i=t6(e);this._paddingTop!==i&&(this._paddingTop=i,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let i=t6(e);this._paddingLeft!==i&&(this._paddingLeft=i,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let i=t6(e);this._paddingBottom!==i&&(this._paddingBottom=i,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let i=t6(e);this._paddingRight!==i&&(this._paddingRight=i,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let i=t6(e);this._fontSize!==i&&(this._fontSize=i,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let i=t6(e);this._lineHeight!==i&&(this._lineHeight=i,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let i=t6(e);this._letterSpacing!==i&&(this._letterSpacing=i,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,i){this.domNode.classList.toggle(e,i),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,i){this.domNode.setAttribute(e,i)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function t6(e){return"number"==typeof e?`${e}px`:e}function t9(e){return new t4(e)}var t8=class{constructor(){this._hooks=new eD,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,r,n,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=s;let o=e;try{e.setPointerCapture(i),this._hooks.add(eR(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{o=tW(e)}this._hooks.add(tQ(o,t3.POINTER_MOVE,e=>{e.buttons!==r?this.stopMonitoring(!0):(e.preventDefault(),this._pointerMoveCallback(e))})),this._hooks.add(tQ(o,t3.POINTER_UP,e=>this.stopMonitoring(!0)))}};(u=iL||={}).Tap="-xterm-gesturetap",u.Change="-xterm-gesturechange",u.Start="-xterm-gesturestart",u.End="-xterm-gesturesend",u.Contextmenu="-xterm-gesturecontextmenu";var t7=class e extends eL{constructor(){super(),this.dispatched=!1,this.targets=new eO,this.ignoreTargets=new eO,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(eW.runAndSubscribe(tX,({window:e,disposables:i})=>{i.add(tQ(e.document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),i.add(tQ(e.document,"touchend",i=>this.onTouchEnd(e,i))),i.add(tQ(e.document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))},{window:eP,disposables:this._store}))}static addTarget(i){return e.isTouchDevice()?(e.INSTANCE||(e.INSTANCE=new e),eR(e.INSTANCE.targets.push(i))):eL.None}static ignoreTarget(i){return e.isTouchDevice()?(e.INSTANCE||(e.INSTANCE=new e),eR(e.INSTANCE.ignoreTargets.push(i))):eL.None}static isTouchDevice(){return"ontouchstart"in eP||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,n=e.targetTouches.length;r<n;r++){let n=e.targetTouches.item(r);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:i,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[i],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};let s=this.newGestureEvent(iL.Start,n.target);s.pageX=n.pageX,s.pageY=n.pageY,this.dispatchEvent(s)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(i,r){let n=Date.now(),s=Object.keys(this.activeTouches).length;for(let o=0,a=r.changedTouches.length;o<a;o++){let a=r.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],c=Date.now()-l.initialTimeStamp;if(c<e.HOLD_DELAY&&30>Math.abs(l.initialPageX-ew(l.rollingPageX))&&30>Math.abs(l.initialPageY-ew(l.rollingPageY))){let e=this.newGestureEvent(iL.Tap,l.initialTarget);e.pageX=ew(l.rollingPageX),e.pageY=ew(l.rollingPageY),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&30>Math.abs(l.initialPageX-ew(l.rollingPageX))&&30>Math.abs(l.initialPageY-ew(l.rollingPageY))){let e=this.newGestureEvent(iL.Contextmenu,l.initialTarget);e.pageX=ew(l.rollingPageX),e.pageY=ew(l.rollingPageY),this.dispatchEvent(e)}else if(1===s){let e=ew(l.rollingPageX),r=ew(l.rollingPageY),s=ew(l.rollingTimestamps)-l.rollingTimestamps[0],o=e-l.rollingPageX[0],a=r-l.rollingPageY[0],c=[...this.targets].filter(e=>l.initialTarget instanceof Node&&e.contains(l.initialTarget));this.inertia(i,c,n,Math.abs(o)/s,o>0?1:-1,e,Math.abs(a)/s,a>0?1:-1,r)}this.dispatchEvent(this.newGestureEvent(iL.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i){let r=document.createEvent("CustomEvent");return r.initEvent(e,!1,!0),r.initialTarget=i,r.tapCount=0,r}dispatchEvent(i){if(i.type===iL.Tap){let r=new Date().getTime(),n=0;n=r-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=r,i.tapCount=n}else(i.type===iL.Change||i.type===iL.Contextmenu)&&(this._lastSetTapCountTime=0);if(i.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(i.initialTarget))return;let e=[];for(let r of this.targets)if(r.contains(i.initialTarget)){let n=0,s=i.initialTarget;for(;s&&s!==r;)n++,s=s.parentElement;e.push([n,r])}for(let[r,n]of(e.sort((e,i)=>e[0]-i[0]),e))n.dispatchEvent(i),this.dispatched=!0}}inertia(i,r,n,s,o,a,l,c,h){this.handle=iD(i,()=>{let u=Date.now(),d=u-n,f=0,p=0,g=!0;s+=e.SCROLL_FRICTION*d,l+=e.SCROLL_FRICTION*d,s>0&&(g=!1,f=o*s*d),l>0&&(g=!1,p=c*l*d);let m=this.newGestureEvent(iL.Change);m.translationX=f,m.translationY=p,r.forEach(e=>e.dispatchEvent(m)),g||this.inertia(i,r,u,s,o,a+f,l,c,h+p)})}onTouchMove(e){let i=Date.now();for(let r=0,n=e.changedTouches.length;r<n;r++){let n=e.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let s=this.activeTouches[n.identifier],o=this.newGestureEvent(iL.Change,s.initialTarget);o.translationX=n.pageX-ew(s.rollingPageX),o.translationY=n.pageY-ew(s.rollingPageY),o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o),s.rollingPageX.length>3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(n.pageX),s.rollingPageY.push(n.pageY),s.rollingTimestamps.push(i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};t7.SCROLL_FRICTION=-.005,t7.HOLD_DELAY=700,t7.CLEAR_TAP_COUNT_TIME=400,M([function(e,i,r){let n=null,s=null;if("function"==typeof r.value?(n="value",0!==(s=r.value).length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof r.get&&(n="get",s=r.get),!s)throw Error("not supported");let o=`$memoize$${i}`;r[n]=function(...e){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,e)}),this[o]}}],t7,"isTouchDevice",1);var ie=class extends eL{onclick(e,i){this._register(tQ(e,t3.CLICK,r=>i(new tP(tW(e),r))))}onmousedown(e,i){this._register(tQ(e,t3.MOUSE_DOWN,r=>i(new tP(tW(e),r))))}onmouseover(e,i){this._register(tQ(e,t3.MOUSE_OVER,r=>i(new tP(tW(e),r))))}onmouseleave(e,i){this._register(tQ(e,t3.MOUSE_LEAVE,r=>i(new tP(tW(e),r))))}onkeydown(e,i){this._register(tQ(e,t3.KEY_DOWN,e=>i(new tD(e))))}onkeyup(e,i){this._register(tQ(e,t3.KEY_UP,e=>i(new tD(e))))}oninput(e,i){this._register(tQ(e,t3.INPUT,i))}onblur(e,i){this._register(tQ(e,t3.BLUR,i))}onfocus(e,i){this._register(tQ(e,t3.FOCUS,i))}onchange(e,i){this._register(tQ(e,t3.CHANGE,i))}ignoreGesture(e){return t7.ignoreTarget(e)}},it=class extends ie{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px","u">typeof e.top&&(this.bgDomNode.style.top="0px"),"u">typeof e.left&&(this.bgDomNode.style.left="0px"),"u">typeof e.bottom&&(this.bgDomNode.style.bottom="0px"),"u">typeof e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px","u">typeof e.top&&(this.domNode.style.top=e.top+"px"),"u">typeof e.left&&(this.domNode.style.left=e.left+"px"),"u">typeof e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),"u">typeof e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new t8),this._register(t0(this.bgDomNode,t3.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(t0(this.domNode,t3.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new t1),this._pointerdownScheduleRepeatTimer=this._register(new tN)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,tW(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(i,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},ii=class e{constructor(e,i,r,n,s,o,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i|=0,r|=0,n|=0,s|=0,o|=0,a|=0),this.rawScrollLeft=n,this.rawScrollTop=a,i<0&&(i=0),n+i>r&&(n=r-i),n<0&&(n=0),s<0&&(s=0),a+s>o&&(a=o-s),a<0&&(a=0),this.width=i,this.scrollWidth=r,this.scrollLeft=n,this.height=s,this.scrollHeight=o,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(i,r){return new e(this._forceIntegerValues,"u">typeof i.width?i.width:this.width,"u">typeof i.scrollWidth?i.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,"u">typeof i.height?i.height:this.height,"u">typeof i.scrollHeight?i.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(i){return new e(this._forceIntegerValues,this.width,this.scrollWidth,"u">typeof i.scrollLeft?i.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,"u">typeof i.scrollTop?i.scrollTop:this.rawScrollTop)}createScrollEvent(e,i){let r=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:i,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:n,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:l}}},ir=class extends eL{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new eX),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new ii(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,i){let r=this._state.withScrollDimensions(e,i);this._setState(r,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let i=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(i,!1)}setScrollPositionSmooth(e,i){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){let r;e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;r=i?new ia(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=ia.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),i=this._state.withScrollPosition(e);if(this._setState(i,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,i){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,i)))}},is=class{constructor(e,i,r){this.scrollLeft=e,this.scrollTop=i,this.isDone=r}};function io(e,i){let r=i-e;return function(i){return e+r*(1-Math.pow(1-i,3))}}var ia=class e{constructor(e,i,r,n){this.from=e,this.to=i,this.duration=n,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,i,r){if(Math.abs(e-i)>2.5*r){var n,s;let o,a;return e<i?(o=e+.75*r,a=i-.75*r):(o=e-.75*r,a=i+.75*r),n=io(e,o),s=io(a,i),function(e){return e<.33?n(e/.33):s((e-.33)/(1-.33))}}return io(e,i)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let i=(e-this.startTime)/this.duration;return i<1?new is(this.scrollLeft(i),this.scrollTop(i),!1):new is(this.to.scrollLeft,this.to.scrollTop,!0)}combine(i,r,n){return e.start(i,r,n)}static start(i,r,n){return n+=10,new e(i,r,Date.now()-10,n)}},il=class extends eL{constructor(e,i,r){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new tN)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||this._rawShouldBeVisible)}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},ic=class extends ie{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new il(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new t8),this._shouldRender=!0,this.domNode=t9(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(tQ(this.domNode.domNode,t3.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let i=this._register(new it(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,r,n){this.slider=t9(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),"number"==typeof r&&this.slider.setWidth(r),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(tQ(this.slider.domNode,t3.POINTER_DOWN,e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,r=i+this._scrollbarState.getSliderPosition(),n=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);r<=s&&s<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,r;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)i=e.offsetX,r=e.offsetY;else{var n;let s,o,a=(s=(n=this.domNode.domNode).getBoundingClientRect(),o=tW(n),{left:s.left+o.scrollX,top:s.top+o.scrollY,width:s.width,height:s.height});i=e.pageX-a.left,r=e.pageY-a.top}let s=this._pointerDownRelativePosition(i,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let s=Math.abs(this._sliderOrthogonalPointerPosition(e)-r);if(ts&&s>140)return void this._setDesiredScrollPositionNow(n.getScrollPosition());let o=this._sliderPointerPosition(e)-i;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},ih=class e{constructor(e,i,r,n,s,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let i=Math.round(e);return this._visibleSize!==i&&(this._visibleSize=i,this._refreshComputedValues(),!0)}setScrollSize(e){let i=Math.round(e);return this._scrollSize!==i&&(this._scrollSize=i,this._refreshComputedValues(),!0)}setScrollPosition(e){let i=Math.round(e);return this._scrollPosition!==i&&(this._scrollPosition=i,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,i,r,n,s){let o=Math.max(0,r-e),a=Math.max(0,o-2*i),l=n>0&&n>r;if(!l)return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(r*a/n))),h=(a-c)/(n-r);return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:h,computedSliderPosition:Math.round(s*h)}}_refreshComputedValues(){let i=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=i.computedAvailableSize,this._computedIsNeeded=i.computedIsNeeded,this._computedSliderSize=i.computedSliderSize,this._computedSliderRatio=i.computedSliderRatio,this._computedSliderPosition=i.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){return this._computedIsNeeded?Math.round((e-this._arrowSize-this._computedSliderSize/2)/this._computedSliderRatio):0}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize,r=this._scrollPosition;return i<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(e){return this._computedIsNeeded?Math.round((this._computedSliderPosition+e)/this._computedSliderRatio):0}},iu=class extends ic{constructor(e,i,r){let n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:r,scrollbarState:new ih(i.horizontalHasArrows?i.arrowSize:0,2===i.horizontal?0:i.horizontalScrollbarSize,2===i.vertical?0:i.verticalScrollbarSize,n.width,n.scrollWidth,s.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},id=class extends ic{constructor(e,i,r){let n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:r,scrollbarState:new ih(i.verticalHasArrows?i.arrowSize:0,2===i.vertical?0:i.verticalScrollbarSize,0,n.height,n.scrollHeight,s.scrollTop),visibility:i.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:i.scrollByPage}),i.verticalHasArrows)throw Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((i.verticalScrollbarSize-i.verticalSliderSize)/2),i.verticalSliderSize,void 0)}_updateSlider(e,i){this.slider.setHeight(e),this.slider.setTop(i)}_renderDomNode(e,i){this.domNode.setWidth(i),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return i}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,i){e.scrollTop=i}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},ip=class{constructor(e,i,r){this.timestamp=e,this.deltaX=i,this.deltaY=r,this.score=0}},ig=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,i=0,r=1,n=this._rear;for(;;){let s=n===this._front?e:Math.pow(2,-r);if(e-=s,i+=this._memory[n].score*s,n===this._front)break;n=(this._capacity+n-1)%this._capacity,r++}return i<=.5}acceptStandardWheelEvent(e){if(e1){var i;let r=(i=tW(e.browserEvent),eJ.INSTANCE.getZoomFactor(i));this.accept(Date.now(),e.deltaX*r,e.deltaY*r)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,i,r){let n=null,s=new ip(e,i,r);-1===this._front&&-1===this._rear?(this._memory[0]=s,this._front=0,this._rear=0):(n=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s),s.score=this._computeScore(s,n)}_computeScore(e,i){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let r=.5;if(this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(r+=.25),i){let n=Math.abs(e.deltaX),s=Math.abs(e.deltaY),o=Math.abs(i.deltaX),a=Math.abs(i.deltaY),l=Math.max(Math.min(n,o),1),c=Math.max(Math.min(s,a),1),h=Math.max(s,a);Math.max(n,o)%l==0&&h%c==0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(e){return .01>Math.abs(Math.round(e)-e)}};ig.INSTANCE=new ig;var im=class extends ie{constructor(e,i,r){super(),this._onScroll=this._register(new eX),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new eX),this.onWillScroll=this._onWillScroll.event,this._options=function(e){let i={lazyRender:"u">typeof e.lazyRender&&e.lazyRender,className:"u">typeof e.className?e.className:"",useShadows:!("u">typeof e.useShadows)||e.useShadows,handleMouseWheel:!("u">typeof e.handleMouseWheel)||e.handleMouseWheel,flipAxes:"u">typeof e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:"u">typeof e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:"u">typeof e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:"u">typeof e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:"u">typeof e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:"u">typeof e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:!("u">typeof e.scrollPredominantAxis)||e.scrollPredominantAxis,mouseWheelSmoothScroll:!("u">typeof e.mouseWheelSmoothScroll)||e.mouseWheelSmoothScroll,arrowSize:"u">typeof e.arrowSize?e.arrowSize:11,listenOnDomNode:"u">typeof e.listenOnDomNode?e.listenOnDomNode:null,horizontal:"u">typeof e.horizontal?e.horizontal:1,horizontalScrollbarSize:"u">typeof e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:"u">typeof e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:"u">typeof e.horizontalHasArrows&&e.horizontalHasArrows,vertical:"u">typeof e.vertical?e.vertical:1,verticalScrollbarSize:"u">typeof e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:"u">typeof e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:"u">typeof e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:"u">typeof e.scrollByPage&&e.scrollByPage};return i.horizontalSliderSize="u">typeof e.horizontalSliderSize?e.horizontalSliderSize:i.horizontalScrollbarSize,i.verticalSliderSize="u">typeof e.verticalSliderSize?e.verticalSliderSize:i.verticalScrollbarSize,to&&(i.className+=" mac"),i}(i),this._scrollable=r,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new id(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new iu(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=t9(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=t9(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=t9(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new tN),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=eE(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,to&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){"u">typeof e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),"u">typeof e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),"u">typeof e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),"u">typeof e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),"u">typeof e.horizontal&&(this._options.horizontal=e.horizontal),"u">typeof e.vertical&&(this._options.vertical=e.vertical),"u">typeof e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),"u">typeof e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),"u">typeof e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new tM(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=eE(this._mouseWheelToDispose),e)){let e=e=>{this._onMouseWheel(new tM(e))};this._mouseWheelToDispose.push(tQ(this._listenOnDomNode,t3.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let i=ig.INSTANCE;i.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,s=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&s+n===0?s=n=0:Math.abs(n)>=Math.abs(s)?s=0:n=0),this._options.flipAxes&&([n,s]=[s,n]);let o=!to&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||o)&&!s&&(s=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(s*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);let a=this._scrollable.getFutureScrollPosition(),l={};if(n){let e=50*n,i=a.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(l,i)}if(s){let e=50*s,i=a.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(l,i)}l=this._scrollable.validateScrollPosition(l),(a.scrollLeft!==l.scrollLeft||a.scrollTop!==l.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),r=!0)}let n=r;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),i=e.scrollTop>0,r=e.scrollLeft>0,n=r?" left":"",s=i?" top":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${r||i?" top-left-corner":""}${s}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet(()=>this._hide(),500)}},i_=class extends im{constructor(e,i,r){super(e,i,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}},iv=class extends eL{constructor(e,i,r,n,s,o,a,l){super(),this._bufferService=r,this._optionsService=a,this._renderService=l,this._onRequestScrollLines=this._register(new eX),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new ir({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>iD(n.window,e)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new i_(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(16&e)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(eW.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(eR(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(eR(()=>this._styleElement.remove())),this._register(eW.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
25
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){void 0!==e&&(this._latestYDisp=e),void 0===this._queuedAnimationFrame&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=i-this._bufferService.buffer.ydisp;0!==r&&(this._latestYDisp=i,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};iv=M([O(2,J),O(3,ec),O(4,Z),O(5,ep),O(6,er),O(7,eu)],iv);var iy=class extends eL{constructor(e,i,r,n,s){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=r,this._decorationService=n,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(eR(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,i=e.element){if(!i)return;let r=e.options.x??0;"right"===(e.options.anchor||"left")?i.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};iy=M([O(1,J),O(2,ec),O(3,eo),O(4,eu)],iy);var ib=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(i,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,r){return i>=e.startBufferLine-this._linePadding[r||"full"]&&i<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},iS={full:0,left:0,center:0,right:0},iw={full:0,left:0,center:0,right:0},ix={full:0,left:0,center:0,right:0},iC=class extends eL{constructor(e,i,r,n,s,o,a,l){super(),this._viewportElement=e,this._screenElement=i,this._bufferService=r,this._decorationService=n,this._renderService=s,this._optionsService=o,this._themeService=a,this._coreBrowserService=l,this._colorZoneStore=new ib,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(eR(()=>this._canvas?.remove()));let c=this._canvas.getContext("2d");if(c)this._ctx=c;else throw Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);iw.full=this._canvas.width,iw.left=e,iw.center=i,iw.right=e,this._refreshDrawHeightConstants(),ix.full=1,ix.left=1,ix.center=1+iw.left,ix.right=1+iw.left+iw.center}_refreshDrawHeightConstants(){iS.full=Math.round(2*this._coreBrowserService.dpr);let e=Math.round(Math.max(Math.min(this._canvas.height/this._bufferService.buffer.lines.length,12),6)*this._coreBrowserService.dpr);iS.left=e,iS.center=e,iS.right=e}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*iS.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*iS.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*iS.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*iS.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){for(let e of(this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear(),this._decorationService.decorations))this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)"full"!==i.position&&this._renderColorZone(i);for(let i of e)"full"===i.position&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(ix[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-iS[e.position||"full"]/2),iw[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+iS[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};iC=M([O(2,J),O(3,eo),O(4,eu),O(5,er),O(6,ep),O(7,ec)],iC),(d=iA||={}).NUL="\0",d.SOH="\x01",d.STX="\x02",d.ETX="\x03",d.EOT="\x04",d.ENQ="\x05",d.ACK="\x06",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
26
|
-
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="\x0e",d.SI="\x0f",d.DLE="\x10",d.DC1="\x11",d.DC2="\x12",d.DC3="\x13",d.DC4="\x14",d.NAK="\x15",d.SYN="\x16",d.ETB="\x17",d.CAN="\x18",d.EM="\x19",d.SUB="\x1a",d.ESC="\x1b",d.FS="\x1c",d.GS="\x1d",d.RS="\x1e",d.US="\x1f",d.SP=" ",d.DEL="",(f=iP||={}).PAD="",f.HOP="",f.BPH="",f.NBH="",f.IND="",f.NEL="
",f.SSA="",f.ESA="",f.HTS="",f.HTJ="",f.VTS="",f.PLD="",f.PLU="",f.RI="",f.SS2="",f.SS3="",f.DCS="",f.PU1="",f.PU2="",f.STS="",f.CCH="",f.MW="",f.SPA="",f.EPA="",f.SOS="",f.SGCI="",f.SCI="",f.CSI="",f.ST="",f.OSC="",f.PM="",f.APC="",(iM||={}).ST=`${iA.ESC}\\`;var ik=class{constructor(e,i,r,n,s,o){this._textarea=e,this._compositionView=i,this._bufferService=r,this._optionsService=n,this._coreService=s,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(20===e.keyCode||229===e.keyCode||16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let i;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,(i=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start)).length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,r=i.replace(e,"");this._dataAlreadySent=r,i.length>e.length?this._coreService.triggerDataEvent(r,!0):i.length<e.length?this._coreService.triggerDataEvent(`${iA.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let s=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};ik=M([O(2,J),O(3,er),O(4,Q),O(5,eu)],ik);var iE,iR,iT,iD,iL,iA,iP,iM,iO,iB=0,iN=0,iI=0,iF=0,iz={css:"#00000000",rgba:0};(np=iO||={}).toCss=function(e,i,r,n){return void 0!==n?`#${iK(e)}${iK(i)}${iK(r)}${iK(n)}`:`#${iK(e)}${iK(i)}${iK(r)}`},np.toRgba=function(e,i,r,n=255){return(e<<24|i<<16|r<<8|n)>>>0},np.toColor=function(e,i,r,n){return{css:np.toCss(e,i,r,n),rgba:np.toRgba(e,i,r,n)}};var iH=ng||={};function ij(e,i){return iF=Math.round(255*i),[iB,iN,iI]=nv.toChannels(e.rgba),{css:iO.toCss(iB,iN,iI,iF),rgba:iO.toRgba(iB,iN,iI,iF)}}iH.blend=function(e,i){if(1==(iF=(255&i.rgba)/255))return{css:i.css,rgba:i.rgba};let r=i.rgba>>24&255,n=i.rgba>>16&255,s=i.rgba>>8&255,o=e.rgba>>24&255,a=e.rgba>>16&255,l=e.rgba>>8&255;return iB=o+Math.round((r-o)*iF),iN=a+Math.round((n-a)*iF),iI=l+Math.round((s-l)*iF),{css:iO.toCss(iB,iN,iI),rgba:iO.toRgba(iB,iN,iI)}},iH.isOpaque=function(e){return(255&e.rgba)==255},iH.ensureContrastRatio=function(e,i,r){let n=nv.ensureContrastRatio(e.rgba,i.rgba,r);if(n)return iO.toColor(n>>24&255,n>>16&255,n>>8&255)},iH.opaque=function(e){let i=(255|e.rgba)>>>0;return[iB,iN,iI]=nv.toChannels(i),{css:iO.toCss(iB,iN,iI),rgba:i}},iH.opacity=ij,iH.multiplyOpacity=function(e,i){return iF=255&e.rgba,ij(e,iF*i/255)},iH.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]},(e=>{let i,r;try{let e=document.createElement("canvas");e.width=1,e.height=1;let n=e.getContext("2d",{willReadFrequently:!0});n&&((i=n).globalCompositeOperation="copy",r=i.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return iB=parseInt(e.slice(1,2).repeat(2),16),iN=parseInt(e.slice(2,3).repeat(2),16),iI=parseInt(e.slice(3,4).repeat(2),16),iO.toColor(iB,iN,iI);case 5:return iB=parseInt(e.slice(1,2).repeat(2),16),iN=parseInt(e.slice(2,3).repeat(2),16),iI=parseInt(e.slice(3,4).repeat(2),16),iF=parseInt(e.slice(4,5).repeat(2),16),iO.toColor(iB,iN,iI,iF);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let n=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return iB=parseInt(n[1]),iN=parseInt(n[2]),iI=parseInt(n[3]),iF=Math.round((void 0===n[5]?1:parseFloat(n[5]))*255),iO.toColor(iB,iN,iI,iF);if(!i||!r||(i.fillStyle=r,i.fillStyle=e,"string"!=typeof i.fillStyle)||(i.fillRect(0,0,1,1),[iB,iN,iI,iF]=i.getImageData(0,0,1,1).data,255!==iF))throw Error("css.toColor: Unsupported css format");return{rgba:iO.toRgba(iB,iN,iI,iF),css:e}}})(nm||={});var iW=n_||={};function i$(e,i,r){let n=e/255,s=i/255,o=r/255;return .2126*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.7152*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}iW.relativeLuminance=function(e){return i$(e>>16&255,e>>8&255,255&e)},iW.relativeLuminance2=i$;var iU=nv||={};function iq(e,i,r){let n=e>>24&255,s=e>>16&255,o=e>>8&255,a=i>>24&255,l=i>>16&255,c=i>>8&255,h=iY(n_.relativeLuminance2(a,l,c),n_.relativeLuminance2(n,s,o));for(;h<r&&(a>0||l>0||c>0);)a-=Math.max(0,Math.ceil(.1*a)),l-=Math.max(0,Math.ceil(.1*l)),c-=Math.max(0,Math.ceil(.1*c)),h=iY(n_.relativeLuminance2(a,l,c),n_.relativeLuminance2(n,s,o));return(a<<24|l<<16|c<<8|255)>>>0}function iV(e,i,r){let n=e>>24&255,s=e>>16&255,o=e>>8&255,a=i>>24&255,l=i>>16&255,c=i>>8&255,h=iY(n_.relativeLuminance2(a,l,c),n_.relativeLuminance2(n,s,o));for(;h<r&&(a<255||l<255||c<255);)a=Math.min(255,a+Math.ceil((255-a)*.1)),l=Math.min(255,l+Math.ceil((255-l)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),h=iY(n_.relativeLuminance2(a,l,c),n_.relativeLuminance2(n,s,o));return(a<<24|l<<16|c<<8|255)>>>0}function iK(e){let i=e.toString(16);return i.length<2?"0"+i:i}function iY(e,i){return e<i?(i+.05)/(e+.05):(e+.05)/(i+.05)}iU.blend=function(e,i){if(1==(iF=(255&i)/255))return i;let r=e>>24&255,n=e>>16&255,s=e>>8&255;return iB=r+Math.round(((i>>24&255)-r)*iF),iN=n+Math.round(((i>>16&255)-n)*iF),iI=s+Math.round(((i>>8&255)-s)*iF),iO.toRgba(iB,iN,iI)},iU.ensureContrastRatio=function(e,i,r){let n=n_.relativeLuminance(e>>8),s=n_.relativeLuminance(i>>8);if(iY(n,s)<r){if(s<n){let s=iq(e,i,r),o=iY(n,n_.relativeLuminance(s>>8));if(o<r){let a=iV(e,i,r);return o>iY(n,n_.relativeLuminance(a>>8))?s:a}return s}let o=iV(e,i,r),a=iY(n,n_.relativeLuminance(o>>8));if(a<r){let s=iq(e,i,r);return a>iY(n,n_.relativeLuminance(s>>8))?o:s}return o}},iU.reduceLuminance=iq,iU.increaseLuminance=iV,iU.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]};var iX=class extends U{constructor(e,i,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},iG=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new V}register(e){let i={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(i),i.id}deregister(e){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===e)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(e){if(0===this._characterJoiners.length)return[];let i=this._bufferService.buffer.lines.get(e);if(!i||0===i.length)return[];let r=[],n=i.translateToString(!0),s=0,o=0,a=0,l=i.getFg(0),c=i.getBg(0);for(let e=0;e<i.getTrimmedLength();e++)if(i.loadCell(e,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==l||this._workCell.bg!==c){if(e-s>1){let e=this._getJoinedRanges(n,a,o,i,s);for(let i=0;i<e.length;i++)r.push(e[i])}s=e,a=o,l=this._workCell.fg,c=this._workCell.bg}o+=this._workCell.getChars().length||1}if(this._bufferService.cols-s>1){let e=this._getJoinedRanges(n,a,o,i,s);for(let i=0;i<e.length;i++)r.push(e[i])}return r}_getJoinedRanges(e,i,r,n,s){let o=e.substring(i,r),a=[];try{a=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let i=this._characterJoiners[e].handler(o);for(let e=0;e<i.length;e++)iG._mergeRanges(a,i[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(a,n,s),a}_stringRangesToCellRanges(e,i,r){let n=0,s=!1,o=0,a=e[0];if(a){for(let l=r;l<this._bufferService.cols;l++){let r=i.getWidth(l),c=i.getString(l).length||1;if(0!==r){if(!s&&a[0]<=o&&(a[0]=l,s=!0),a[1]<=o){if(a[1]=l,!(a=e[++n]))break;a[0]<=o?(a[0]=l,s=!0):s=!1}o+=c}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(e,i){let r=!1;for(let n=0;n<e.length;n++){let s=e[n];if(r){if(i[1]<=s[0])return e[n-1][1]=i[1],e;if(i[1]<=s[1])return e[n-1][1]=Math.max(i[1],s[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(i[1]<=s[0])return e.splice(n,0,i),e;if(i[1]<=s[1])return s[0]=Math.min(i[0],s[0]),e;i[0]<s[1]&&(s[0]=Math.min(i[0],s[0]),r=!0);continue}}return r?e[e.length-1][1]=i[1]:e.push(i),e}};function iJ(){return{width:0,height:0}}iG=M([O(0,J)],iG);var iZ=class{constructor(e,i,r,n,s,o,a){this._document=e,this._characterJoinerService=i,this._optionsService=r,this._coreBrowserService=n,this._coreService=s,this._decorationService=o,this._themeService=a,this._workCell=new V,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,r){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=r}createRow(e,i,r,n,s,o,a,l,c,h,u){let d=[],f=this._characterJoinerService.getJoinedCharacters(i),p=this._themeService.colors,g=e.getNoBgTrimmedLength();r&&g<o+1&&(g=o+1);let m,_=0,v="",y=0,b=0,S=0,w=0,x=!1,C=0,k=!1,E=0,R=0,T=[],D=-1!==h&&-1!==u;for(let L=0;L<g;L++){let g;e.loadCell(L,this._workCell);let A=this._workCell.getWidth();if(0===A)continue;let P=!1,M=L>=R,O=L,B=this._workCell;if(f.length>0&&L===f[0][0]&&M){let n=f.shift(),s=this._isCellInSelection(n[0],i);for(y=n[0]+1;y<n[1];y++)M&&=s===this._isCellInSelection(y,i);(M&&=!r||o<n[0]||o>=n[1])?(P=!0,B=new iX(this._workCell,e.translateToString(!0,n[0],n[1]),n[1]-n[0]),O=n[1]-1,A=B.getWidth()):R=n[1]}let N=this._isCellInSelection(L,i),I=r&&L===o,F=D&&L>=h&&L<=u,z=!1;this._decorationService.forEachDecorationAtCell(L,i,void 0,e=>{z=!0});let H=B.getChars()||" ";if(" "===H&&(B.isUnderline()||B.isOverline())&&(H=" "),E=A*l-c.get(H,B.isBold(),B.isItalic()),m)if(_&&(N&&k||!N&&!k&&B.bg===b)&&(N&&k&&p.selectionForeground||B.fg===S)&&B.extended.ext===w&&F===x&&E===C&&!I&&!P&&!z&&M){B.isInvisible()?v+=" ":v+=H,_++;continue}else _&&(m.textContent=v),m=this._document.createElement("span"),_=0,v="";else m=this._document.createElement("span");if(b=B.bg,S=B.fg,w=B.extended.ext,x=F,C=E,k=N,P&&o>=L&&o<=O&&(o=L),!this._coreService.isCursorHidden&&I&&this._coreService.isCursorInitialized){if(T.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&T.push("xterm-cursor-blink"),T.push("bar"===n?"xterm-cursor-bar":"underline"===n?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":T.push("xterm-cursor-outline");break;case"block":T.push("xterm-cursor-block");break;case"bar":T.push("xterm-cursor-bar");break;case"underline":T.push("xterm-cursor-underline")}}if(B.isBold()&&T.push("xterm-bold"),B.isItalic()&&T.push("xterm-italic"),B.isDim()&&T.push("xterm-dim"),v=B.isInvisible()?" ":B.getChars()||" ",B.isUnderline()&&(T.push(`xterm-underline-${B.extended.underlineStyle}`)," "===v&&(v=" "),!B.isUnderlineColorDefault()))if(B.isUnderlineColorRGB())m.style.textDecorationColor=`rgb(${U.toColorRGB(B.getUnderlineColor()).join(",")})`;else{let e=B.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&B.isBold()&&e<8&&(e+=8),m.style.textDecorationColor=p.ansi[e].css}B.isOverline()&&(T.push("xterm-overline")," "===v&&(v=" ")),B.isStrikethrough()&&T.push("xterm-strikethrough"),F&&(m.style.textDecoration="underline");let j=B.getFgColor(),W=B.getFgColorMode(),$=B.getBgColor(),q=B.getBgColorMode(),V=!!B.isInverse();if(V){let e=j;j=$,$=e;let i=W;W=q,q=i}let K,Y,X=!1;switch(this._decorationService.forEachDecorationAtCell(L,i,void 0,e=>{"top"!==e.options.layer&&X||(e.backgroundColorRGB&&(q=0x3000000,$=e.backgroundColorRGB.rgba>>8&0xffffff,K=e.backgroundColorRGB),e.foregroundColorRGB&&(W=0x3000000,j=e.foregroundColorRGB.rgba>>8&0xffffff,Y=e.foregroundColorRGB),X="top"===e.options.layer)}),!X&&N&&($=(K=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&0xffffff,q=0x3000000,X=!0,p.selectionForeground&&(W=0x3000000,j=p.selectionForeground.rgba>>8&0xffffff,Y=p.selectionForeground)),X&&T.push("xterm-decoration-top"),q){case 0x1000000:case 0x2000000:g=p.ansi[$],T.push(`xterm-bg-${$}`);break;case 0x3000000:g=iO.toColor($>>16,$>>8&255,255&$),this._addStyle(m,`background-color:#${iQ(($>>>0).toString(16),"0",6)}`);break;default:V?(g=p.foreground,T.push("xterm-bg-257")):g=p.background}switch(K||B.isDim()&&(K=ng.multiplyOpacity(g,.5)),W){case 0x1000000:case 0x2000000:B.isBold()&&j<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(j+=8),this._applyMinimumContrast(m,g,p.ansi[j],B,K,void 0)||T.push(`xterm-fg-${j}`);break;case 0x3000000:let G=iO.toColor(j>>16&255,j>>8&255,255&j);this._applyMinimumContrast(m,g,G,B,K,Y)||this._addStyle(m,`color:#${iQ(j.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(m,g,p.foreground,B,K,Y)||V&&T.push("xterm-fg-257")}T.length&&(m.className=T.join(" "),T.length=0),I||P||z||!M?m.textContent=v:_++,E!==this.defaultSpacing&&(m.style.letterSpacing=`${E}px`),d.push(m),L=O}return m&&_&&(m.textContent=v),d}_applyMinimumContrast(e,i,r,n,s,o){var a,l,c;if(1===this._optionsService.rawOptions.minimumContrastRatio||57508<=(l=a=n.getCode())&&l<=57558||9472<=(c=a)&&c<=9631)return!1;let h=this._getContrastCache(n),u;if(s||o||(u=h.getColor(i.rgba,r.rgba)),void 0===u){let e=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);u=ng.ensureContrastRatio(s||i,o||r,e),h.setColor((s||i).rgba,(o||r).rgba,u??null)}return!!u&&(this._addStyle(e,`color:${u.css}`),!0)}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let r=this._selectionStart,n=this._selectionEnd;return!!r&&!!n&&(this._columnSelectMode?r[0]<=n[0]?e>=r[0]&&i>=r[1]&&e<n[0]&&i<=n[1]:e<r[0]&&i>=r[1]&&e>=n[0]&&i<=n[1]:i>r[1]&&i<n[1]||r[1]===n[1]&&i===r[1]&&e>=r[0]&&e<n[0]||r[1]<n[1]&&i===n[1]&&e<n[0]||r[1]<n[1]&&i===r[1]&&e>=r[0])}};function iQ(e,i,r){for(;e.length<r;)e=i+e;return e}iZ=M([O(1,ef),O(2,er),O(3,ec),O(4,Q),O(5,eo),O(6,ep)],iZ);var i0=class{constructor(e,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let r=e.createElement("span");r.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[r,n,s,o],this._container.appendChild(r),this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(o),i.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,i,r,n){e===this._font&&i===this._fontSize&&r===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=i,this._weight=r,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,i,r){let n=0;if(!i&&!r&&1===e.length&&(n=e.charCodeAt(0))<256){if(-9999!==this._flat[n])return this._flat[n];let i=this._measure(e,0);return i>0&&(this._flat[n]=i),i}let s=e;i&&(s+="B"),r&&(s+="I");let o=this._holey.get(s);if(void 0===o){let n=0;i&&(n|=1),r&&(n|=2),(o=this._measure(e,n))>0&&this._holey.set(s,o)}return o}_measure(e,i){let r=this._measureElements[i];return r.textContent=e.repeat(32),r.offsetWidth/32}},i1=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,i,r,n=!1){if(this.selectionStart=i,this.selectionEnd=r,!i||!r||i[0]===r[0]&&i[1]===r[1])return void this.clear();let s=e.buffers.active.ydisp,o=i[1]-s,a=r[1]-s,l=Math.max(o,0),c=Math.min(a,e.rows-1);l>=e.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=o,this.viewportEndRow=a,this.viewportCappedStartRow=l,this.viewportCappedEndRow=c,this.startCol=i[0],this.endCol=r[0])}isCellSelected(e,i,r){return!!this.hasSelection&&(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&r>=this.viewportCappedStartRow&&i<this.endCol&&r<=this.viewportCappedEndRow:i<this.startCol&&r>=this.viewportCappedStartRow&&i>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&i>=this.startCol)}},i2="xterm-dom-renderer-owner-",i5="xterm-rows",i3="xterm-fg-",i4="xterm-bg-",i6="xterm-focus",i9="xterm-selection",i8=1,i7=class extends eL{constructor(e,i,r,n,s,o,a,l,c,h,u,d,f,p){super(),this._terminal=e,this._document=i,this._element=r,this._screenElement=n,this._viewportElement=s,this._helperContainer=o,this._linkifier2=a,this._charSizeService=c,this._optionsService=h,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=i8++,this._rowElements=[],this._selectionRenderModel=new i1,this.onRequestRedraw=this._register(new eX).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(i5),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(i9),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions={css:{canvas:iJ(),cell:iJ()},device:{canvas:iJ(),cell:iJ(),char:{width:0,height:0,left:0,top:0}}},this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=l.createInstance(iZ,document),this._element.classList.add(i2+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._register(eR(()=>{this._element.classList.remove(i2+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new i0(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;for(let i of(this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this._rowElements))i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${i5} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${i5} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${i5} .xterm-dim { color: ${ng.multiplyOpacity(e.foreground,.5).css};}${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let r=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;for(let[o,a]of(i+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}@keyframes ${n} { 50% { box-shadow: none; }}@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}${this._terminalSelector} .${i5}.${i6} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${i5}.${i6} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${i5}.${i6} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${i5} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${i5} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${i5} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${i5} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${i5} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}${this._terminalSelector} .${i9} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${i9} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${i9} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`,e.ansi.entries()))i+=`${this._terminalSelector} .${i3}${o} { color: ${a.css}; }${this._terminalSelector} .${i3}${o}.xterm-dim { color: ${ng.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${i4}${o} { background-color: ${a.css}; }`;i+=`${this._terminalSelector} .${i3}257 { color: ${ng.opaque(e.background).css}; }${this._terminalSelector} .${i3}257.xterm-dim { color: ${ng.multiplyOpacity(ng.opaque(e.background),.5).css}; }${this._terminalSelector} .${i4}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let e=this._rowElements.length;e<=i;e++){let e=this._document.createElement("div");this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(i6),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(i6),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,r),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,r),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,l=this._document.createDocumentFragment();if(r){let r=e[0]>i[0];l.appendChild(this._createSelectionElement(o,r?i[0]:e[0],r?e[0]:i[0],a-o+1))}else{let r=n===o?e[0]:0,c=o===s?i[0]:this._bufferService.cols;if(l.appendChild(this._createSelectionElement(o,r,c)),l.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,a-o-1)),o!==a){let e=s===a?i[0]:this._bufferService.cols;l.appendChild(this._createSelectionElement(a,0,e))}}this._selectionContainer.appendChild(l)}_createSelectionElement(e,i,r,n=1){let s=this._document.createElement("div"),o=i*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(r-i);return o+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-o),s.style.height=`${n*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${o}px`,s.style.width=`${a}px`,s}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let r=this._bufferService.buffer,n=r.ybase+r.y,s=Math.min(r.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,l=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=i;c++){let e=c+r.ydisp,i=this._rowElements[c],h=r.lines.get(e);if(!i||!h)break;i.replaceChildren(...this._rowFactory.createRow(h,e,e===n,a,l,s,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${i2}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,r,n,s,o){r<0&&(e=0),n<0&&(i=0);let a=this._bufferService.rows-1;r=Math.max(Math.min(r,a),0),n=Math.max(Math.min(n,a),0),s=Math.min(s,this._bufferService.cols);let l=this._bufferService.buffer,c=l.ybase+l.y,h=Math.min(l.x,s-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let a=r;a<=n;++a){let p=a+l.ydisp,g=this._rowElements[a],m=l.lines.get(p);if(!g||!m)break;g.replaceChildren(...this._rowFactory.createRow(m,p,p===c,d,f,h,u,this.dimensions.css.cell.width,this._widthCache,o?a===r?e:0:-1,o?(a===n?i:s)-1:-1))}}};i7=M([O(7,et),O(8,el),O(9,er),O(10,J),O(11,Q),O(12,ec),O(13,ep)],i7);var re=class extends eL{constructor(e,i,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new eX),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new rr(this._optionsService))}catch{this._measureStrategy=this._register(new ri(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};re=M([O(2,er)],re);var rt=class extends eL{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,i){void 0!==e&&e>0&&void 0!==i&&i>0&&(this._result.width=e,this._result.height=i)}},ri=class extends rt{constructor(e,i,r){super(),this._document=e,this._parentElement=i,this._optionsService=r,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},rr=class extends rt{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},rn=class extends eL{constructor(e,i,r){super(),this._textarea=e,this._window=i,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new rs(this._window)),this._onDprChange=this._register(new eX),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new eX),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(eW.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(tQ(this._textarea,"focus",()=>this._isFocused=!0)),this._register(tQ(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return void 0===this._cachedIsFocused&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},rs=class extends eL{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new eA),this._onDprChange=this._register(new eX),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(eR(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=tQ(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},ro=class extends eL{constructor(){super(),this.linkProviders=[],this._register(eR(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let i=this.linkProviders.indexOf(e);-1!==i&&this.linkProviders.splice(i,1)}}}};function ra(e,i,r){let n=r.getBoundingClientRect(),s=e.getComputedStyle(r),o=parseInt(s.getPropertyValue("padding-left")),a=parseInt(s.getPropertyValue("padding-top"));return[i.clientX-n.left-o,i.clientY-n.top-a]}var rl=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,r,n,s){return function(e,i,r,n,s,o,a,l,c){if(!o)return;let h=ra(e,i,r);return h[0]=Math.ceil((h[0]+(c?a/2:0))/a),h[1]=Math.ceil(h[1]/l),h[0]=Math.min(Math.max(h[0],1),n+ +!!c),h[1]=Math.min(Math.max(h[1],1),s),h}(window,e,i,r,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,i){let r=ra(window,e,i);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};rl=M([O(0,eu),O(1,el)],rl);var rc=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,r){this._rowCount=r,e=void 0!==e?e:0,i=void 0!==i?i:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,i):i,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return void this._runRefreshCallbacks();let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},rh={},ru={getSafariVersion:()=>ry,isChromeOS:()=>rk,isFirefox:()=>rm,isIpad:()=>rS,isIphone:()=>rw,isLegacyEdge:()=>r_,isLinux:()=>rC,isMac:()=>rb,isNode:()=>rf,isSafari:()=>rv,isWindows:()=>rx};for(var rd in ru)A(rh,rd,{get:ru[rd],enumerable:!0});var rf="u">typeof L.default&&"title"in L.default,rp=rf?"node":navigator.userAgent,rg=rf?"node":navigator.platform,rm=rp.includes("Firefox"),r_=rp.includes("Edge"),rv=/^((?!chrome|android).)*safari/i.test(rp);function ry(){if(!rv)return 0;let e=rp.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])}var rb=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(rg),rS="iPad"===rg,rw="iPhone"===rg,rx=["Windows","Win16","Win32","WinCE"].includes(rg),rC=rg.indexOf("Linux")>=0,rk=/\bCrOS\b/.test(rp),rE=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let i=0,r=0,n=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(i=performance.now(),this._tasks[this._i]()||this._i++,1.5*(r=Math.max(i=Math.max(1,performance.now()-i),r))>(s=e.timeRemaining())){n-i<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-i))}ms`),this._start();return}n=s}this.clear()}},rR=class extends rE{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},rT=class extends rE{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},rD=!rf&&"requestIdleCallback"in window?rT:rR,rL=class{constructor(){this._queue=new rD}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},rA=class extends eL{constructor(e,i,r,n,s,o,a,l,c){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=n,this._coreService=s,this._coreBrowserService=l,this._renderer=this._register(new eA),this._pausedResizeTask=new rL,this._observerDisposable=this._register(new eA),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new eX),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new eX),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new eX),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new eX),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new rc((e,i)=>this._renderRows(e,i),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new rP(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(eR(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});r.observe(i),this._observerDisposable.value=eR(()=>r.disconnect())}}_handleIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,i,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput)return void this._syncOutputHandler.bufferRows(e,i);let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),i=Math.max(i,n.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput)return void this._syncOutputHandler.bufferRows(e,i);e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,r){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=r,this._renderer.value?.handleSelectionChanged(e,i,r)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};rA=M([O(2,er),O(3,el),O(4,Q),O(5,eo),O(6,J),O(7,ec),O(8,ep)],rA);var rP=class{constructor(e,i,r){this._coreBrowserService=e,this._coreService=i,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,i){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,i)):(this._start=e,this._end=i,this._isBuffering=!0),void 0===this._timeout&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(void 0!==this._timeout&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){void 0!==this._timeout&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function rM(e,i,r,n){return rI(Math.abs(e-rO(e,r)-(i-rO(i,r)))-function(e,i,r){let n=0,s=e-rO(e,r),o=i-rO(i,r);for(let a=0;a<Math.abs(s-o);a++){let o="A"===function(e,i){return e>i?"A":"B"}(e,i)?-1:1;r.buffer.lines.get(s+o*a)?.isWrapped&&n++}return n}(e,i,r),rN(e>i?"A":"B",n))}function rO(e,i){let r=0,n=i.buffer.lines.get(e),s=n?.isWrapped;for(;s&&e>=0&&e<i.rows;)r++,n=i.buffer.lines.get(--e),s=n?.isWrapped;return r}function rB(e,i,r,n,s,o){let a=e,l=i,c="";for(;(a!==r||l!==n)&&l>=0&&l<o.buffer.lines.length;)a+=s?1:-1,s&&a>o.cols-1?(c+=o.buffer.translateBufferLineToString(l,!1,e,a),a=0,e=0,l++):!s&&a<0&&(c+=o.buffer.translateBufferLineToString(l,!1,0,e+1),e=a=o.cols-1,l--);return c+o.buffer.translateBufferLineToString(l,!1,e,a)}function rN(e,i){return iA.ESC+(i?"O":"[")+e}function rI(e,i){e=Math.floor(e);let r="";for(let n=0;n<e;n++)r+=i;return r}var rF=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,i=this.selectionEnd;return!!e&&!!i&&(e[1]>i[1]||e[1]===i[1]&&e[0]>i[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function rz(e,i){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return i*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var rH=RegExp(" ","g"),rj=class extends eL{constructor(e,i,r,n,s,o,a,l,c){super(),this._element=e,this._screenElement=i,this._linkifier=r,this._bufferService=n,this._coreService=s,this._mouseService=o,this._optionsService=a,this._renderService=l,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new V,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new eX),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new eX),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new eX),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new eX),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new rF(this._bufferService),this._activeSelectionMode=0,this._register(eR(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1])}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let r=this._bufferService.buffer,n=[];if(3===this._activeSelectionMode){if(e[0]===i[0])return"";let s=e[0]<i[0]?e[0]:i[0],o=e[0]<i[0]?i[0]:e[0];for(let a=e[1];a<=i[1];a++){let e=r.translateBufferLineToString(a,!0,s,o);n.push(e)}}else{let s=e[1]===i[1]?i[0]:void 0;n.push(r.translateBufferLineToString(e[1],!0,e[0],s));for(let s=e[1]+1;s<=i[1]-1;s++){let e=r.lines.get(s),i=r.translateBufferLineToString(s,!0);e?.isWrapped?n[n.length-1]+=i:n.push(i)}if(e[1]!==i[1]){let e=r.lines.get(i[1]),s=r.translateBufferLineToString(i[1],!0,0,i[0]);e&&e.isWrapped?n[n.length-1]+=s:n.push(s)}}return n.map(e=>e.replace(rH," ")).join(rx?`\r
|
|
27
|
-
`:`
|
|
28
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),rC&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!!r&&!!n&&!!i&&this._areCoordsInSelection(i,r,n)}isCellInSelection(e,i){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!!r&&!!n&&this._areCoordsInSelection([e,i],r,n)}_areCoordsInSelection(e,i,r){return e[1]>i[1]&&e[1]<r[1]||i[1]===r[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<r[0]||i[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||i[1]<r[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){let r=this._linkifier.currentLink?.link?.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=rz(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return!!n&&(this._selectWordAt(n,i),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=ra(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=r?0:(i>r&&(i-=r),(i=Math.min(Math.max(i,-50),50)/50)/Math.abs(i)+Math.round(14*i))}shouldForceSelection(e){return rb?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(2===e.button&&this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):1===e.detail?this._handleSingleClick(e):2===e.detail?this._handleDoubleClick(e):3===e.detail&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=3*!!this.shouldColumnSelect(e),this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&0===i.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(rb&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let e=r.lines.get(this._model.selectionEnd[1]);e&&0===e.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}i&&i[0]===this._model.selectionEnd[0]&&i[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&void 0!==i[0]&&void 0!==i[1]){let e=function(e,i,r,n){var s,o,a,l,c,h,u,d,f,p,g,m,_,v,y,b;let S,w=r.buffer.x,x=r.buffer.y;if(!r.buffer.hasScrollback){let b,S,C;return s=w,(0===rM(o=x,i,a=r,l=n).length?"":rI(rB(s,o,s,o-rO(o,a),!1,a).length,rN("D",l)))+rM(x,i,r,n)+(c=w,h=x,u=e,b=rM(h,d=i,f=r,p=n).length>0?d-rO(d,f):h,C=(g=c,m=h,S=rM(_=u,v=d,y=f,p).length>0?v-rO(v,y):m,g<_&&S<=v||g>=_&&S<v?"C":"D"),rI(rB(c,b,u,d,"C"===C,f).length,rN(C,p)))}if(x===i)return S=w>e?"D":"C",rI(Math.abs(w-e),rN(S,n));S=x>i?"D":"C";let C=Math.abs(x-i);return rI((b=x>i?e:w,r.cols-b+(C-1)*r.cols+1+((x>i?w:e)-1)),rN(S,n))}(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,r=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,i,r);return}!e||!i||this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&i[0]===this._oldSelectionEnd[0]&&i[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,i,r)}_fireOnSelectionChange(e,i,r){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(e,i){let r=i;for(let n=0;i>=n;n++){let s=e.loadCell(n,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:s>1&&i!==n&&(r+=s-1)}return r}setSelection(e,i,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,o=s.lines.get(e[1]);if(!o)return;let a=s.translateBufferLineToString(e[1],!1),l=this._convertViewportColToCharacterIndex(o,e[0]),c=l,h=e[0]-l,u=0,d=0,f=0,p=0;if(" "===a.charAt(l)){for(;l>0&&" "===a.charAt(l-1);)l--;for(;c<a.length&&" "===a.charAt(c+1);)c++}else{let i=e[0],r=e[0];0===o.getWidth(i)&&(u++,i--),2===o.getWidth(r)&&(d++,r++);let n=o.getString(r).length;for(n>1&&(p+=n-1,c+=n-1);i>0&&l>0&&!this._isCharWordSeparator(o.loadCell(i-1,this._workCell));){o.loadCell(i-1,this._workCell);let e=this._workCell.getChars().length;0===this._workCell.getWidth()?(u++,i--):e>1&&(f+=e-1,l-=e-1),l--,i--}for(;r<o.length&&c+1<a.length&&!this._isCharWordSeparator(o.loadCell(r+1,this._workCell));){o.loadCell(r+1,this._workCell);let e=this._workCell.getChars().length;2===this._workCell.getWidth()?(d++,r++):e>1&&(p+=e-1,c+=e-1),c++,r++}}c++;let g=l+h-u+f,m=Math.min(this._bufferService.cols,c-l+u+d-f-p);if(!(!i&&""===a.slice(l,c).trim())){if(r&&0===g&&32!==o.getCodePoint(0)){let i=s.lines.get(e[1]-1);if(i&&o.isWrapped&&32!==i.getCodePoint(this._bufferService.cols-1)){let i=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(i){let e=this._bufferService.cols-i.start;g-=e,m+=e}}}if(n&&g+m===this._bufferService.cols&&32!==o.getCodePoint(this._bufferService.cols-1)){let i=s.lines.get(e[1]+1);if(i?.isWrapped&&32!==i.getCodePoint(0)){let i=this._getWordAt([0,e[1]+1],!1,!1,!0);i&&(m+=i.length)}}return{start:g,length:m}}}_selectWordAt(e,i){let r=this._getWordAt(e,i);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let r=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,r]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=rz(r,this._bufferService.cols)}};rj=M([O(3,J),O(4,Q),O(5,eh),O(6,er),O(7,eu),O(8,ec)],rj);var rW=class{constructor(){this._data={}}set(e,i,r){this._data[e]||(this._data[e]={}),this._data[e][i]=r}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},r$=class{constructor(){this._color=new rW,this._css=new rW}setCss(e,i,r){this._css.set(e,i,r)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,r){this._color.set(e,i,r)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},rU=Object.freeze((()=>{let e=[nm.toColor("#2e3436"),nm.toColor("#cc0000"),nm.toColor("#4e9a06"),nm.toColor("#c4a000"),nm.toColor("#3465a4"),nm.toColor("#75507b"),nm.toColor("#06989a"),nm.toColor("#d3d7cf"),nm.toColor("#555753"),nm.toColor("#ef2929"),nm.toColor("#8ae234"),nm.toColor("#fce94f"),nm.toColor("#729fcf"),nm.toColor("#ad7fa8"),nm.toColor("#34e2e2"),nm.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=i[r/36%6|0],s=i[r/6%6|0],o=i[r%6];e.push({css:iO.toCss(n,s,o),rgba:iO.toRgba(n,s,o)})}for(let i=0;i<24;i++){let r=8+10*i;e.push({css:iO.toCss(r,r,r),rgba:iO.toRgba(r,r,r)})}return e})()),rq=nm.toColor("#ffffff"),rV=nm.toColor("#000000"),rK=nm.toColor("#ffffff"),rY={css:"rgba(255, 255, 255, 0.3)",rgba:0xffffff4d},rX=class extends eL{constructor(e){super(),this._optionsService=e,this._contrastCache=new r$,this._halfContrastCache=new r$,this._onChangeColors=this._register(new eX),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:rq,background:rV,cursor:rK,cursorAccent:rV,selectionForeground:void 0,selectionBackgroundTransparent:rY,selectionBackgroundOpaque:ng.blend(rV,rY),selectionInactiveBackgroundTransparent:rY,selectionInactiveBackgroundOpaque:ng.blend(rV,rY),scrollbarSliderBackground:ng.opacity(rq,.2),scrollbarSliderHoverBackground:ng.opacity(rq,.4),scrollbarSliderActiveBackground:ng.opacity(rq,.5),overviewRulerBorder:rq,ansi:rU.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=rG(e.foreground,rq),i.background=rG(e.background,rV),i.cursor=ng.blend(i.background,rG(e.cursor,rK)),i.cursorAccent=ng.blend(i.background,rG(e.cursorAccent,rV)),i.selectionBackgroundTransparent=rG(e.selectionBackground,rY),i.selectionBackgroundOpaque=ng.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=rG(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=ng.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?rG(e.selectionForeground,iz):void 0,i.selectionForeground===iz&&(i.selectionForeground=void 0),ng.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=ng.opacity(i.selectionBackgroundTransparent,.3)),ng.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=ng.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=rG(e.scrollbarSliderBackground,ng.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=rG(e.scrollbarSliderHoverBackground,ng.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=rG(e.scrollbarSliderActiveBackground,ng.opacity(i.foreground,.5)),i.overviewRulerBorder=rG(e.overviewRulerBorder,rq),i.ansi=rU.slice(),i.ansi[0]=rG(e.black,rU[0]),i.ansi[1]=rG(e.red,rU[1]),i.ansi[2]=rG(e.green,rU[2]),i.ansi[3]=rG(e.yellow,rU[3]),i.ansi[4]=rG(e.blue,rU[4]),i.ansi[5]=rG(e.magenta,rU[5]),i.ansi[6]=rG(e.cyan,rU[6]),i.ansi[7]=rG(e.white,rU[7]),i.ansi[8]=rG(e.brightBlack,rU[8]),i.ansi[9]=rG(e.brightRed,rU[9]),i.ansi[10]=rG(e.brightGreen,rU[10]),i.ansi[11]=rG(e.brightYellow,rU[11]),i.ansi[12]=rG(e.brightBlue,rU[12]),i.ansi[13]=rG(e.brightMagenta,rU[13]),i.ansi[14]=rG(e.brightCyan,rU[14]),i.ansi[15]=rG(e.brightWhite,rU[15]),e.extendedAnsi){let r=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)i.ansi[n+16]=rG(e.extendedAnsi[n],rU[n+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(void 0===e){for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function rG(e,i){if(void 0!==e)try{return nm.toColor(e)}catch{}return i}rX=M([O(0,er)],rX);var rJ=class{constructor(...e){for(let[i,r]of(this._entries=new Map,e))this.set(i,r)}set(e,i){let r=this._entries.get(e);return this._entries.set(e,i),r}forEach(e){for(let[i,r]of this._entries.entries())e(i,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},rZ=class{constructor(){this._services=new rJ,this._services.set(et,this)}setService(e,i){this._services.set(e,i)}getService(e){return this._services.get(e)}createInstance(e,...i){let r=(e[Y]||[]).sort((e,i)=>e.index-i.index),n=[];for(let i of r){let r=this._services.get(i.id);if(!r)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${i.id._id}.`);n.push(r)}let s=r.length>0?r[0].index:i.length;if(i.length!==s)throw Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${i.length} static arguments`);return new e(...i,...n)}},rQ={trace:0,debug:1,info:2,warn:3,error:4,off:5},r0=class extends eL{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=rQ[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)"function"==typeof e[i]&&(e[i]=e[i]())}_log(e,i,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+i,...r)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};r0=M([O(0,er)],r0);var r1=class extends eL{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new eX),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new eX),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new eX),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=Array(e);for(let r=0;r<Math.min(e,this.length);r++)i[r]=this._array[this._getCyclicIndex(r)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,i,...r){if(i){for(let r=e;r<this._length-i;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+r.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<r.length;i++)this._array[this._getCyclicIndex(e+i)]=r[i];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let e=this._length+r.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,r){if(!(i<=0)){if(e<0||e>=this._length)throw Error("start argument out of range");if(e+r<0)throw Error("Cannot shift elements in list beyond index 0");if(r>0){for(let n=i-1;n>=0;n--)this.set(e+n+r,this.get(e+n));let n=e+i+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<i;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},r2=Object.freeze(new U),r5=0,r3=class e{constructor(e,i,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);let n=i||V.fromCharData([0,"",1,0]);for(let i=0;i<e;++i)this.setCell(i,n);this.length=e}get(e){let i=this._data[3*e+0],r=2097151&i;return[this._data[3*e+1],2097152&i?this._combined[e]:r?H(r):"",i>>22,2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):r]}set(e,i){this._data[3*e+1]=i[0],i[1].length>1?(this._combined[e]=i[1],this._data[3*e+0]=2097152|e|i[2]<<22):this._data[3*e+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 0xc00000&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){let i=this._data[3*e+0];return 2097152&i?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&i}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){let i=this._data[3*e+0];return 2097152&i?this._combined[e]:2097151&i?H(2097151&i):""}isProtected(e){return 0x20000000&this._data[3*e+2]}loadCell(e,i){return r5=3*e,i.content=this._data[r5+0],i.fg=this._data[r5+1],i.bg=this._data[r5+2],2097152&i.content&&(i.combinedData=this._combined[e]),0x10000000&i.bg&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){2097152&i.content&&(this._combined[e]=i.combinedData),0x10000000&i.bg&&(this._extendedAttrs[e]=i.extended),this._data[3*e+0]=i.content,this._data[3*e+1]=i.fg,this._data[3*e+2]=i.bg}setCellFromCodepoint(e,i,r,n){0x10000000&n.bg&&(this._extendedAttrs[e]=n.extended),this._data[3*e+0]=i|r<<22,this._data[3*e+1]=n.fg,this._data[3*e+2]=n.bg}addCodepointToCell(e,i,r){let n=this._data[3*e+0];2097152&n?this._combined[e]+=H(i):2097151&n?(this._combined[e]=H(2097151&n)+H(i),n&=-2097152,n|=2097152):n=4194304|i,r&&(n&=-0xc00001,n|=r<<22),this._data[3*e+0]=n}insertCells(e,i,r){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),i<this.length-e){let n=new V;for(let r=this.length-e-i-1;r>=0;--r)this.setCell(e+i+r,this.loadCell(e+r,n));for(let n=0;n<i;++n)this.setCell(e+n,r)}else for(let i=e;i<this.length;++i)this.setCell(i,r);2===this.getWidth(this.length-1)&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(e,i,r){if(e%=this.length,i<this.length-e){let n=new V;for(let r=0;r<this.length-e-i;++r)this.setCell(e+r,this.loadCell(e+i+r,n));for(let e=this.length-i;e<this.length;++e)this.setCell(e,r)}else for(let i=e;i<this.length;++i)this.setCell(i,r);e&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,r)}replaceCells(e,i,r,n=!1){if(n){for(e&&2===this.getWidth(e-1)&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),i<this.length&&2===this.getWidth(i-1)&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,r);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,r),e++;return}for(e&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,r),i<this.length&&2===this.getWidth(i-1)&&this.setCellFromCodepoint(i,0,1,r);e<i&&e<this.length;)this.setCell(e++,r)}resize(e,i){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let r=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*r)this._data=new Uint32Array(this._data.buffer,0,r);else{let e=new Uint32Array(r);e.set(this._data),this._data=e}for(let r=this.length;r<e;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,r);let i=Object.keys(this._combined);for(let r=0;r<i.length;r++){let n=parseInt(i[r],10);n>=e&&delete this._combined[n]}let n=Object.keys(this._extendedAttrs);for(let i=0;i<n.length;i++){let r=parseInt(n[i],10);r>=e&&delete this._extendedAttrs[r]}}return this.length=e,4*r*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i){for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,e);return}this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,e)}copyFrom(e){for(let i in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[i]=e._combined[i];for(let i in this._extendedAttrs={},e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){let i=new e(0);for(let e in i._data=new Uint32Array(this._data),i.length=this.length,this._combined)i._combined[e]=this._combined[e];for(let e in this._extendedAttrs)i._extendedAttrs[e]=this._extendedAttrs[e];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||0x3000000&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,i,r,n,s){let o=e._data;if(s)for(let s=n-1;s>=0;s--){for(let e=0;e<3;e++)this._data[(r+s)*3+e]=o[(i+s)*3+e];0x10000000&o[(i+s)*3+2]&&(this._extendedAttrs[r+s]=e._extendedAttrs[i+s])}else for(let s=0;s<n;s++){for(let e=0;e<3;e++)this._data[(r+s)*3+e]=o[(i+s)*3+e];0x10000000&o[(i+s)*3+2]&&(this._extendedAttrs[r+s]=e._extendedAttrs[i+s])}let a=Object.keys(e._combined);for(let n=0;n<a.length;n++){let s=parseInt(a[n],10);s>=i&&(this._combined[s-i+r]=e._combined[s])}}translateToString(e,i,r,n){i=i??0,r=r??this.length,e&&(r=Math.min(r,this.getTrimmedLength())),n&&(n.length=0);let s="";for(;i<r;){let e=this._data[3*i+0],r=2097151&e,o=2097152&e?this._combined[i]:r?H(r):" ";if(s+=o,n)for(let e=0;e<o.length;++e)n.push(i);i+=e>>22||1}return n&&n.push(i),s}};function r4(e,i,r){if(i===e.length-1)return e[i].getTrimmedLength();let n=!e[i].hasContent(r-1)&&1===e[i].getWidth(r-1),s=2===e[i+1].getWidth(0);return n&&s?r-1:r}var r6=class e{constructor(i){this.line=i,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new eX),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),eE(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};r6._nextId=1;var r9={},r8=r9.B;r9[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},r9.A={"#":"£"},r9.B=void 0,r9[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r9.C=r9[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r9.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r9.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r9.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r9.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r9.E=r9[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r9.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r9.H=r9[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r9["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var r7=class{constructor(e,i,r){this._hasScrollback=e,this._optionsService=i,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=r2.clone(),this.savedCharset=r8,this.markers=[],this._nullCell=V.fromCharData([0,"",1,0]),this._whitespaceCell=V.fromCharData([0," ",1,32]),this._isClearing=!1,this._memoryCleanupQueue=new rD,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r1(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new q),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new q),this._whitespaceCell}getBlankLine(e,i){return new r3(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let i=e+this._optionsService.rawOptions.scrollback;return i>0xffffffff?0xffffffff:i}fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=r2);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r1(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let r=this.getNullCell(r2),n=0,s=this._getCorrectBufferLength(i);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let i=0;i<this.lines.length;i++)n+=+this.lines.get(i).resize(e,r);let o=0;if(this._rows<i)for(let n=this._rows;n<i;n++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||void 0!==this._optionsService.rawOptions.windowsPty.backend||void 0!==this._optionsService.rawOptions.windowsPty.buildNumber?this.lines.push(new r3(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new r3(e,r)));else for(let e=this._rows;e>i;e--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let e=this.lines.length-s;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),o&&(this.y+=o),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let i=0;i<this.lines.length;i++)n+=+this.lines.get(i).resize(e,r);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if((i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory())>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&"conpty"===e.backend&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){let r=this._optionsService.rawOptions.reflowCursorLine,n=function(e,i,r,n,s,o){let a=[];for(let l=0;l<e.length-1;l++){let c=l,h=e.get(++c);if(!h.isWrapped)continue;let u=[e.get(l)];for(;c<e.length&&h.isWrapped;)u.push(h),h=e.get(++c);if(!o&&n>=l&&n<c){l+=u.length-1;continue}let d=0,f=r4(u,0,i),p=1,g=0;for(;p<u.length;){let e=r4(u,p,i),n=Math.min(e-g,r-f);u[d].copyCellsFrom(u[p],g,f,n,!1),(f+=n)===r&&(d++,f=0),(g+=n)===e&&(p++,g=0),0===f&&0!==d&&2===u[d-1].getWidth(r-1)&&(u[d].copyCellsFrom(u[d-1],r-1,f++,1,!1),u[d-1].setCell(r-1,s))}u[d].replaceCells(f,r,s);let m=0;for(let e=u.length-1;e>0&&(e>d||0===u[e].getTrimmedLength());e--)m++;m>0&&(a.push(l+u.length-m),a.push(m)),l+=u.length-1}return a}(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(r2),r);if(n.length>0){let r=function(e,i){let r=[],n=0,s=i[0],o=0;for(let a=0;a<e.length;a++)if(s===a){let r=i[++n];e.onDeleteEmitter.fire({index:a-o,amount:r}),a+=r-1,o+=r,s=i[++n]}else r.push(a);return{layout:r,countRemoved:o}}(this.lines,n);(function(e,i){let r=[];for(let n=0;n<i.length;n++)r.push(e.get(i[n]));for(let i=0;i<r.length;i++)e.set(i,r[i]);e.length=i.length})(this.lines,r.layout),this._reflowLargerAdjustViewport(e,i,r.countRemoved)}}_reflowLargerAdjustViewport(e,i,r){let n=this.getNullCell(r2),s=r;for(;s-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new r3(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,i){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(r2),s=[],o=0;for(let a=this.lines.length-1;a>=0;a--){let l=this.lines.get(a);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;let c=[l];for(;l.isWrapped&&a>0;)l=this.lines.get(--a),c.unshift(l);if(!r){let e=this.ybase+this.y;if(e>=a&&e<a+c.length)continue}let h=c[c.length-1].getTrimmedLength(),u=function(e,i,r){let n=[],s=e.map((r,n)=>r4(e,n,i)).reduce((e,i)=>e+i),o=0,a=0,l=0;for(;l<s;){if(s-l<r){n.push(s-l);break}o+=r;let c=r4(e,a,i);o>c&&(o-=c,a++);let h=2===e[a].getWidth(o-1);h&&o--;let u=h?r-1:r;n.push(u),l+=u}return n}(c,this._cols,e),d=u.length-c.length,f;f=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(r2,!0);p.push(e)}p.length>0&&(s.push({start:a+c.length+o,newLines:p}),o+=p.length),c.push(...p);let g=u.length-1,m=u[g];0===m&&(m=u[--g]);let _=c.length-d-1,v=h;for(;_>=0;){let e=Math.min(v,m);if(void 0===c[g])break;c[g].copyCellsFrom(c[_],v-e,m-e,e,!0),0==(m-=e)&&(m=u[--g]),0==(v-=e)&&(v=r4(c,Math.max(--_,0),this._cols))}for(let i=0;i<c.length;i++)u[i]<e&&c[i].setCell(u[i],n);let y=d-f;for(;y-- >0;)0===this.ybase?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+o)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+i-1)}if(s.length>0){let e=[],i=[];for(let e=0;e<this.lines.length;e++)i.push(this.lines.get(e));let r=this.lines.length,n=r-1,a=0,l=s[0];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let c=0;for(let h=Math.min(this.lines.maxLength-1,r+o-1);h>=0;h--)if(l&&l.start>n+c){for(let e=l.newLines.length-1;e>=0;e--)this.lines.set(h--,l.newLines[e]);h++,e.push({index:n+1,amount:l.newLines.length}),c+=l.newLines.length,l=s[++a]}else this.lines.set(h,i[n--]);let h=0;for(let i=e.length-1;i>=0;i--)e[i].index+=h,this.lines.onInsertEmitter.fire(e[i]),h+=e[i].amount;let u=Math.max(0,r+o-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,i,r=0,n){let s=this.lines.get(e);return s?s.translateToString(i,r,n):""}getWrappedRangeForLine(e){let i=e,r=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:i,last:r}}setupTabStops(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let i=new r6(e);return this.markers.push(i),i.register(this.lines.onTrim(e=>{i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(e=>{i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.onDelete(e=>{i.line>=e.index&&i.line<e.index+e.amount&&i.dispose(),i.line>e.index&&(i.line-=e.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},ne=class extends eL{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new eX),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new r7(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r7(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},nt=class extends eL{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new eX),this.onResize=this._onResize.event,this._onScroll=this._register(new eX),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,2),this.rows=Math.max(e.rawOptions.rows||0,1),this.buffers=this._register(new ne(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let r=this.cols!==e,n=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let r=this.buffer,n;(n=this._cachedBlankLine)&&n.length===this.cols&&n.getFg(0)===e.fg&&n.getBg(0)===e.bg||(n=r.getBlankLine(e,i),this._cachedBlankLine=n),n.isWrapped=i;let s=r.ybase+r.scrollTop,o=r.ybase+r.scrollBottom;if(0===r.scrollTop){let e=r.lines.isFull;o===r.lines.length-1?e?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(o+1,0,n.clone()),e?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let e=o-s+1;r.lines.shiftElements(s+1,e-1,-1),r.lines.set(o,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,i){let r=this.buffer;if(e<0){if(0===r.ydisp)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(i||this._onScroll.fire(r.ydisp))}};nt=M([O(0,er)],nt);var ni={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:rb,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},nr=["normal","bold","100","200","300","400","500","600","700","800","900"],nn=class extends eL{constructor(e){super(),this._onOptionChange=this._register(new eX),this.onOptionChange=this._onOptionChange.event;let i={...ni};for(let r in e)if(r in i)try{let n=e[r];i[r]=this._sanitizeAndValidateOption(r,n)}catch(e){console.error(e)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(eR(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(r=>{r===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(r=>{-1!==e.indexOf(r)&&i()})}_setupOptions(){let e=e=>{if(!(e in ni))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},i=(e,i)=>{if(!(e in ni))throw Error(`No option with key "${e}"`);i=this._sanitizeAndValidateOption(e,i),this.rawOptions[e]!==i&&(this.rawOptions[e]=i,this._onOptionChange.fire(e))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:i.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":var r;if(i||(i=ni[e]),"block"!==(r=i)&&"underline"!==r&&"bar"!==r)throw Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=ni[e]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=nr.includes(i)?i:ni[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,0xffffffff))<0)throw Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&0!==i)throw Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}};function ns(e,i=5){if("object"!=typeof e)return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=i<=1?e[n]:e[n]&&ns(e[n],i-1);return r}var no=Object.freeze({insertMode:!1}),na=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),nl=class extends eL{constructor(e,i,r){super(),this._bufferService=e,this._logService=i,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new eX),this.onData=this._onData.event,this._onUserInput=this._register(new eX),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new eX),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new eX),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ns(no),this.decPrivateModes=ns(na)}reset(){this.modes=ns(no),this.decPrivateModes=ns(na)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};nl=M([O(0,J),O(1,ei),O(2,er)],nl);var nc={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function nh(e,i){let r=16*!!e.ctrl|4*!!e.shift|8*!!e.alt;return 4===e.button?(r|=64,r|=e.action):(r|=3&e.button,4&e.button&&(r|=64),8&e.button&&(r|=128),32===e.action?r|=32:0!==e.action||i||(r|=3)),r}var nu=String.fromCharCode,nd={DEFAULT:e=>{let i=[nh(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1b[M${nu(i[0])}${nu(i[1])}${nu(i[2])}`},SGR:e=>{let i=0===e.action&&4!==e.button?"m":"M";return`\x1b[<${nh(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=0===e.action&&4!==e.button?"m":"M";return`\x1b[<${nh(e,!0)};${e.x};${e.y}${i}`}},nf=class extends eL{constructor(e,i,r){for(let n of(super(),this._bufferService=e,this._coreService=i,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new eX),this.onProtocolChange=this._onProtocolChange.event,Object.keys(nc)))this.addProtocol(n,nc[n]);for(let e of Object.keys(nd))this.addEncoding(e,nd[e]);this.reset()}addProtocol(e,i){this._protocols[e]=i}addEncoding(e,i){this._encodings[e]=i}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,i,r){if(0===e.deltaY||e.shiftKey||void 0===i||void 0===r)return 0;let n=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=i/r+0,50>Math.abs(e.deltaY)&&(n*=.3),this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n}_applyScrollModifier(e,i){return i.altKey||i.ctrlKey||i.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||4===e.button&&32===e.action||3===e.button&&32!==e.action||4!==e.button&&(2===e.action||3===e.action)||(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))||!this._protocols[this._activeProtocol].restrict(e))return!1;let i=this._encodings[this._activeEncoding](e);return i&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(i):this._coreService.triggerDataEvent(i,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,i,r){if(r){if(e.x!==i.x||e.y!==i.y)return!1}else if(e.col!==i.col||e.row!==i.row)return!1;return e.button===i.button&&e.action===i.action&&e.ctrl===i.ctrl&&e.alt===i.alt&&e.shift===i.shift}};nf=M([O(0,J),O(1,Q),O(2,er)],nf);var np,ng,nm,n_,nv,ny,nb=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],nS=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],nw=class{constructor(){if(this.version="6",!ny){(ny=new Uint8Array(65536)).fill(1),ny[0]=0,ny.fill(0,1,32),ny.fill(0,127,160),ny.fill(2,4352,4448),ny[9001]=2,ny[9002]=2,ny.fill(2,11904,42192),ny[12351]=1,ny.fill(2,44032,55204),ny.fill(2,63744,64256),ny.fill(2,65040,65050),ny.fill(2,65072,65136),ny.fill(2,65280,65377),ny.fill(2,65504,65511);for(let e=0;e<nb.length;++e)ny.fill(0,nb[e][0],nb[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ny[e]:!function(e,i){let r=0,n=i.length-1,s;if(e<i[0][0]||e>i[n][1])return!1;for(;n>=r;)if(e>i[s=r+n>>1][1])r=s+1;else{if(!(e<i[s][0]))return!0;n=s-1}return!1}(e,nS)?e>=131072&&e<=196605||e>=196608&&e<=262141?2:1:0}charProperties(e,i){let r=this.wcwidth(e),n=0===r&&0!==i;if(n){let e=nx.extractWidth(i);0===e?n=!1:e>r&&(r=e)}return nx.createPropertyValue(0,r,n)}},nx=class e{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new eX,this.onChange=this._onChange.event;let e=new nw;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(1&e)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,r=!1){return(0xffffff&e)<<3|(3&i)<<1|!!r}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(i){let r=0,n=0,s=i.length;for(let o=0;o<s;++o){let a=i.charCodeAt(o);if(55296<=a&&a<=56319){if(++o>=s)return r+this.wcwidth(a);let e=i.charCodeAt(o);56320<=e&&e<=57343?a=(a-55296)*1024+e-56320+65536:r+=this.wcwidth(e)}let l=this.charProperties(a,n),c=e.extractWidth(l);e.extractShouldJoin(l)&&(c-=e.extractWidth(n)),r+=c,n=l}return r}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},nC=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function nk(e){let i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=0!==i[3]&&32!==i[3])}var nE=class e{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>256)throw Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){let r=new e;if(!i.length)return r;for(let e=+!!Array.isArray(i[0]);e<i.length;++e){let n=i[e];if(Array.isArray(n))for(let e=0;e<n.length;++e)r.addSubParam(n[e]);else r.addParam(n)}return r}clone(){let i=new e(this.maxLength,this.maxSubParamsLength);return i.params.set(this.params),i.length=this.length,i._subParams.set(this._subParams),i._subParamsLength=this._subParamsLength,i._subParamsIdx.set(this._subParamsIdx),i._rejectDigits=this._rejectDigits,i._rejectSubDigits=this._rejectSubDigits,i._digitIsSub=this._digitIsSub,i}toArray(){let e=[];for(let i=0;i<this.length;++i){e.push(this.params[i]);let r=this._subParamsIdx[i]>>8,n=255&this._subParamsIdx[i];n-r>0&&e.push(Array.prototype.slice.call(this._subParams,r,n))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>0x7fffffff?0x7fffffff:e}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>0x7fffffff?0x7fffffff:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let i=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];return r-i>0?this._subParams.subarray(i,r):null}getSubParamsAll(){let e={};for(let i=0;i<this.length;++i){let r=this._subParamsIdx[i]>>8,n=255&this._subParamsIdx[i];n-r>0&&(e[i]=this._subParams.slice(r,n))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,n=r[i-1];r[i-1]=~n?Math.min(10*n+e,0x7fffffff):e}},nR=[],nT=class{constructor(){this._state=0,this._active=nR,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){void 0===this._handlers[e]&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(i),{dispose:()=>{let e=r.indexOf(i);-1!==e&&r.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=nR}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=nR,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||nR,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(e,i,r){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,i,r);else this._handlerFb(this._id,"PUT",j(e,i,r))}start(){this.reset(),this._state=1}put(e,i,r){if(3!==this._state){if(1===this._state)for(;i<r;){let r=e[i++];if(59===r){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}-1===this._id&&(this._id=0),this._id=10*this._id+r-48}2===this._state&&r-i>0&&this._put(e,i,r)}}end(e,i=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let r=!1,n=this._active.length-1,s=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=i,s=this._stack.fallThrough,this._stack.paused=!1),!s&&!1===r){for(;n>=0&&!0!==(r=this._active[n].end(e));n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if((r=this._active[n].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}else this._handlerFb(this._id,"END",e);this._active=nR,this._id=-1,this._state=0}}},nD=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,r){this._hitLimit||(this._data+=j(e,i,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data))instanceof Promise)return i.then(e=>(this._data="",this._hitLimit=!1,e));return this._data="",this._hitLimit=!1,i}},nL=[],nA=class{constructor(){this._handlers=Object.create(null),this._active=nL,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=nL}registerHandler(e,i){void 0===this._handlers[e]&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(i),{dispose:()=>{let e=r.indexOf(i);-1!==e&&r.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=nL,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||nL,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(i);else this._handlerFb(this._ident,"HOOK",i)}put(e,i,r){if(this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,i,r);else this._handlerFb(this._ident,"PUT",j(e,i,r))}unhook(e,i=!0){if(this._active.length){let r=!1,n=this._active.length-1,s=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=i,s=this._stack.fallThrough,this._stack.paused=!1),!s&&!1===r){for(;n>=0&&!0!==(r=this._active[n].unhook(e));n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if((r=this._active[n].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",e);this._active=nL,this._ident=0}},nP=new nE;nP.addParam(0);var nM=class{constructor(e){this._handler=e,this._data="",this._params=nP,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():nP,this._data="",this._hitLimit=!1}put(e,i,r){this._hitLimit||(this._data+=j(e,i,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data,this._params))instanceof Promise)return i.then(e=>(this._params=nP,this._data="",this._hitLimit=!1,e));return this._params=nP,this._data="",this._hitLimit=!1,i}},nO=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,r,n){this.table[i<<8|e]=r<<4|n}addMany(e,i,r,n){for(let s=0;s<e.length;s++)this.table[i<<8|e[s]]=r<<4|n}},nB=function(){let e=new nO(4095),i=Array.apply(null,Array(256)).map((e,i)=>i),r=(e,r)=>i.slice(e,r),n=r(32,127),s=r(0,24);s.push(25),s.push.apply(s,r(28,32));let o=r(0,14),a;for(a in e.setDefault(1,0),e.addMany(n,0,2,0),o)e.addMany([24,26,153,154],a,3,0),e.addMany(r(128,144),a,3,0),e.addMany(r(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}(),nN=class extends eL{constructor(e=nB){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new nE,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,i,r)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,i)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(eR(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new nT),this._dcsParser=this._register(new nA),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw Error("only one byte as prefix supported");if((r=e.prefix.charCodeAt(0))&&60>r||r>63)throw Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw Error("only two bytes as intermediates are supported");for(let i=0;i<e.intermediates.length;++i){let n=e.intermediates.charCodeAt(i);if(32>n||n>47)throw Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=n}}if(1!==e.final.length)throw Error("final must be a single byte");let n=e.final.charCodeAt(0);if(i[0]>n||n>i[1])throw Error(`final must be in range ${i[0]} .. ${i[1]}`);return r<<=8,r|=n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(255&e)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let r=this._identifier(e,[48,126]);void 0===this._escHandlers[r]&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(i),{dispose:()=>{let e=n.indexOf(i);-1!==e&&n.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let r=this._identifier(e);void 0===this._csiHandlers[r]&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(i),{dispose:()=>{let e=n.indexOf(i);-1!==e&&n.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,r,n,s){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=s}parse(e,i,r){let n=0,s=0,o=0,a;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(void 0===r||1===this._parseStack.state)throw this._parseStack.state=1,Error("improper continuation due to previous async handler, giving up parsing");let i=this._parseStack.handlers,s=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===r&&s>-1){for(;s>=0&&!0!==(a=i[s](this._params));s--)if(a instanceof Promise)return this._parseStack.handlerPos=s,a}this._parseStack.handlers=[];break;case 4:if(!1===r&&s>-1){for(;s>=0&&!0!==(a=i[s]());s--)if(a instanceof Promise)return this._parseStack.handlerPos=s,a}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(24!==n&&26!==n,r))return a;27===n&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],a=this._oscParser.end(24!==n&&26!==n,r))return a;27===n&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let r=o;r<i;++r){switch(n=e[r],(s=this._transitions.table[this.currentState<<8|(n<160?n:160)])>>4){case 2:for(let s=r+1;;++s)if(s>=i||(n=e[s])<32||n>126&&n<160||++s>=i||(n=e[s])<32||n>126&&n<160||++s>=i||(n=e[s])<32||n>126&&n<160||++s>=i||(n=e[s])<32||n>126&&n<160){this._printHandler(e,r,s),r=s-1;break}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:r,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|n],l=o?o.length-1:-1;for(;l>=0&&!0!==(a=o[l](this._params));l--)if(a instanceof Promise)return this._preserveStack(3,o,l,s,r),a;l<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++r<i&&(n=e[r])>47&&n<60)r--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let c=this._escHandlers[this._collect<<8|n],h=c?c.length-1:-1;for(;h>=0&&!0!==(a=c[h]());h--)if(a instanceof Promise)return this._preserveStack(4,c,h,s,r),a;h<0&&this._escHandlerFb(this._collect<<8|n),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|n,this._params);break;case 13:for(let s=r+1;;++s)if(s>=i||24===(n=e[s])||26===n||27===n||n>127&&n<160){this._dcsParser.put(e,r,s),r=s-1;break}break;case 14:if(a=this._dcsParser.unhook(24!==n&&26!==n))return this._preserveStack(6,[],0,s,r),a;27===n&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let s=r+1;;s++)if(s>=i||(n=e[s])<32||n>127&&n<160){this._oscParser.put(e,r,s),r=s-1;break}break;case 6:if(a=this._oscParser.end(24!==n&&26!==n))return this._preserveStack(5,[],0,s,r),a;27===n&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&s}}},nI=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,nF=/^[\da-f]+$/;function nz(e){if(!e)return;let i=e.toLowerCase();if(0===i.indexOf("rgb:")){i=i.slice(4);let e=nI.exec(i);if(e){let i=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/i*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/i*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/i*255)]}}else if(0===i.indexOf("#")&&(i=i.slice(1),nF.exec(i)&&[3,6,9,12].includes(i.length))){let e=i.length/3,r=[0,0,0];for(let n=0;n<3;++n){let s=parseInt(i.slice(e*n,e*n+e),16);r[n]=1===e?s<<4:2===e?s:3===e?s>>4:s>>8}return r}}function nH(e,i){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(i){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}var nj={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function nW(e,i){if(e>24)return i.setWinLines||!1;switch(e){case 1:return!!i.restoreWin;case 2:return!!i.minimizeWin;case 3:return!!i.setWinPosition;case 4:return!!i.setWinSizePixels;case 5:return!!i.raiseWin;case 6:return!!i.lowerWin;case 7:return!!i.refreshWin;case 8:return!!i.setWinSizeChars;case 9:return!!i.maximizeWin;case 10:return!!i.fullscreenWin;case 11:return!!i.getWinState;case 13:return!!i.getWinPosition;case 14:return!!i.getWinSizePixels;case 15:return!!i.getScreenSizePixels;case 16:return!!i.getCellSizePixels;case 18:return!!i.getWinSizeChars;case 19:return!!i.getScreenSizeChars;case 20:return!!i.getIconTitle;case 21:return!!i.getWinTitle;case 22:return!!i.pushTitle;case 23:return!!i.popTitle;case 24:return!!i.setWinLines}return!1}var n$=0,nU=class extends eL{constructor(e,i,r,n,s,o,a,l,c=new nN){for(let h in super(),this._bufferService=e,this._charsetService=i,this._coreService=r,this._logService=n,this._optionsService=s,this._oscLinkService=o,this._coreMouseService=a,this._unicodeService=l,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new W,this._utf8Decoder=new $,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r2.clone(),this._eraseAttrDataInternal=r2.clone(),this._onRequestBell=this._register(new eX),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new eX),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new eX),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new eX),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new eX),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new eX),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new eX),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new eX),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new eX),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new eX),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new eX),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new eX),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new eX),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new nq(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,i)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:i.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})}),this._parser.setOscHandlerFallback((e,i,r)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:i,data:r})}),this._parser.setDcsHandlerFallback((e,i,r)=>{"HOOK"===i&&(r=r.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:i,payload:r})}),this._parser.setPrintHandler((e,i,r)=>this.print(e,i,r)),this._parser.registerCsiHandler({final:"@"},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:"A"},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:"B"},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:"C"},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:"D"},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:"E"},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:"F"},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:"G"},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:"H"},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:"I"},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:"J"},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:"K"},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:"L"},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:"M"},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:"P"},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:"S"},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:"T"},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:"X"},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:"Z"},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:"a"},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:"b"},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:"c"},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:">",final:"c"},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:"d"},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:"e"},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:"f"},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:"g"},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:"h"},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"h"},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:"l"},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"l"},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:"m"},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:"n"},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:"?",final:"n"},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:"r"},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:"s"},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:"t"},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:"u"},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(iA.BEL,()=>this.bell()),this._parser.setExecuteHandler(iA.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(iA.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(iA.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(iA.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(iA.BS,()=>this.backspace()),this._parser.setExecuteHandler(iA.HT,()=>this.tab()),this._parser.setExecuteHandler(iA.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(iA.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(iP.IND,()=>this.index()),this._parser.setExecuteHandler(iP.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(iP.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new nD(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new nD(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new nD(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new nD(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new nD(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new nD(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new nD(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new nD(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new nD(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new nD(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new nD(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new nD(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset()),r9)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error("Parsing error: ",e),e)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new nM((e,i)=>this.requestStatusString(e,i)))}getAttrData(){return this._curAttrData}_preserveStack(e,i,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=i,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),5e3))]).catch(e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,i){let r,n=this._activeBuffer.x,s=this._activeBuffer.y,o=0,a=this._parseStack.paused;if(a){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,i))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>131072&&(o=this._parseStack.position+131072)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${"string"==typeof e?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join("")}"`}`),0===this._logService.logLevel&&this._logService.trace("parsing data (codes)","string"==typeof e?e.split("").map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(e.length,131072))),a||this._dirtyRowTracker.clearRange(),e.length>131072)for(let i=o;i<e.length;i+=131072){let o=i+131072<e.length?i+131072:e.length,a="string"==typeof e?this._stringDecoder.decode(e.substring(i,o),this._parseBuffer):this._utf8Decoder.decode(e.subarray(i,o),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,a))return this._preserveStack(n,s,a,i),this._logSlowResolvingAsync(r),r}else if(!a){let i="string"==typeof e?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,i))return this._preserveStack(n,s,i,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(e,i,r){let n,s,o=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-i>0&&2===d.getWidth(this._activeBuffer.x-1)&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=i;p<r;++p){if((n=e[p])<127&&o){let e=o[String.fromCharCode(n)];e&&(n=e.charCodeAt(0))}let i=this._unicodeService.charProperties(n,f);s=nx.extractWidth(i);let r=nx.extractShouldJoin(i),g=r?nx.extractWidth(f):0;if(f=i,a&&this._onA11yChar.fire(H(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-g>l){if(c){let e=d,i=this._activeBuffer.x-g;for(this._activeBuffer.x=g,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),g>0&&d instanceof r3&&d.copyCellsFrom(e,i,0,g,!1);i<l;)e.setCellFromCodepoint(i++,0,1,u)}else if(this._activeBuffer.x=l-1,2===s)continue}if(r&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,n,s);for(let e=s-g;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(h&&(d.insertCells(this._activeBuffer.x,s-g,this._activeBuffer.getNullCell(u)),2===d.getWidth(l-1)&&d.setCellFromCodepoint(l-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,n,s,u),s>0)for(;--s;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<l&&r-i>0&&0===d.getWidth(this._activeBuffer.x)&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,i){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,i):this._parser.registerCsiHandler(e,e=>!nW(e.params[0],this._optionsService.rawOptions.windowOptions)||i(e))}registerDcsHandler(e,i){return this._parser.registerDcsHandler(e,new nM(i))}registerEscHandler(e,i){return this._parser.registerEscHandler(e,i)}registerOscHandler(e,i){return this._parser.registerOscHandler(e,new nD(i))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,i){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+i):(this._activeBuffer.x=e,this._activeBuffer.y=i),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,i){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+i)}cursorUp(e){let i=this._activeBuffer.y-this._activeBuffer.scrollTop;return i>=0?this._moveCursor(0,-Math.min(i,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let i=this._activeBuffer.scrollBottom-this._activeBuffer.y;return i>=0?this._moveCursor(0,Math.min(i,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let i=e.params[0];return 0===i?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===i&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let i=e.params[0]||1;for(;i--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let i=e.params[0];return 1===i&&(this._curAttrData.bg|=0x20000000),(2===i||0===i)&&(this._curAttrData.bg&=-0x20000001),!0}_eraseInBufferLine(e,i,r,n=!1,s=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(i,r,this._activeBuffer.getNullCell(this._eraseAttrData()),s),n&&(o.isWrapped=!1)}_resetBufferLine(e,i=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),i),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,i=!1){let r;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,i);r<this._bufferService.rows;r++)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,i),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+r)?.getTrimmedLength(););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,i);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0))}return!0}eraseInLine(e,i=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,i);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,i);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,i)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;i--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let i=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;i--;)this._activeBuffer.lines.splice(r,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let i=e.params[0]||1;for(;i--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let i=e.params[0]||1;for(;i--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(r2));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.deleteCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.insertCells(0,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.insertCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.deleteCells(this._activeBuffer.x,i,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return i&&(i.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let i=this._parser.precedingJoinState;if(!i)return!0;let r=e.params[0]||1,n=nx.extractWidth(i),s=this._activeBuffer.x-n,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),a=new Uint32Array(o.length*r),l=0;for(let e=0;e<o.length;){let i=o.codePointAt(e)||0;a[l++]=i,e+=i>65535?2:1}let c=l;for(let e=1;e<r;++e)a.copyWithin(c,0,l),c+=l;return this.print(a,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(iA.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(iA.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(iA.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(iA.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(iA.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,r8),this._charsetService.setgCharset(1,r8),this._charsetService.setgCharset(2,r8),this._charsetService.setgCharset(3,r8);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0}return!0}resetMode(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===e.params[i]&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0)}return!0}requestMode(e,i){let r,n,s,o;(n=r||={})[n.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",n[n.SET=1]="SET",n[n.RESET=2]="RESET",n[n.PERMANENTLY_SET=3]="PERMANENTLY_SET",n[n.PERMANENTLY_RESET=4]="PERMANENTLY_RESET";let a=this._coreService.decPrivateModes,{activeProtocol:l,activeEncoding:c}=this._coreMouseService,h=this._coreService,{buffers:u,cols:d}=this._bufferService,{active:f,alt:p}=u,g=this._optionsService.rawOptions,m=e=>e?1:2,_=e.params[0];return s=_,o=i?2===_?4:4===_?m(h.modes.insertMode):12===_?3:20===_?m(g.convertEol):0:1===_?m(a.applicationCursorKeys):3===_?g.windowOptions.setWinLines?80===d?2:+(132===d):0:6===_?m(a.origin):7===_?m(a.wraparound):8===_?3:9===_?m("X10"===l):12===_?m(g.cursorBlink):25===_?m(!h.isCursorHidden):45===_?m(a.reverseWraparound):66===_?m(a.applicationKeypad):67===_?4:1e3===_?m("VT200"===l):1002===_?m("DRAG"===l):1003===_?m("ANY"===l):1004===_?m(a.sendFocus):1005===_?4:1006===_?m("SGR"===c):1015===_?4:1016===_?m("SGR_PIXELS"===c):1048===_?1:47===_||1047===_||1049===_?m(f===p):2004===_?m(a.bracketedPasteMode):2026===_?m(a.synchronizedOutput):0,h.triggerDataEvent(`${iA.ESC}[${i?"":"?"}${s};${o}$y`),!0}_updateAttrColor(e,i,r,n,s){return 2===i?(e|=0x3000000,e&=-0x1000000,e|=U.fromColorRGB([r,n,s])):5===i&&(e&=-0x3000100,e|=0x2000000|255&r),e}_extractColor(e,i,r){let n=[0,0,-1,0,0,0],s=0,o=0;do{if(n[o+s]=e.params[i+o],e.hasSubParams(i+o)){let r=e.getSubParams(i+o),a=0;do 5===n[1]&&(s=1),n[o+a+1+s]=r[a];while(++a<r.length&&a+o+1+s<n.length)break}if(5===n[1]&&o+s>=2||2===n[1]&&o+s>=5)break;n[1]&&(s=1)}while(++o+i<e.length&&o+s<n.length)for(let e=2;e<n.length;++e)-1===n[e]&&(n[e]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return o}_processUnderline(e,i){i.extended=i.extended.clone(),(!~e||e>5)&&(e=1),i.extended.underlineStyle=e,i.fg|=0x10000000,0===e&&(i.fg&=-0x10000001),i.updateExtended()}_processSGR0(e){e.fg=r2.fg,e.bg=r2.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-0x4000000,e.updateExtended()}charAttributes(e){if(1===e.length&&0===e.params[0])return this._processSGR0(this._curAttrData),!0;let i=e.length,r,n=this._curAttrData;for(let s=0;s<i;s++)(r=e.params[s])>=30&&r<=37?(n.fg&=-0x3000100,n.fg|=0x1000000|r-30):r>=40&&r<=47?(n.bg&=-0x3000100,n.bg|=0x1000000|r-40):r>=90&&r<=97?(n.fg&=-0x3000100,n.fg|=0x1000000|r-90|8):r>=100&&r<=107?(n.bg&=-0x3000100,n.bg|=0x1000000|r-100|8):0===r?this._processSGR0(n):1===r?n.fg|=0x8000000:3===r?n.bg|=0x4000000:4===r?(n.fg|=0x10000000,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,n)):5===r?n.fg|=0x20000000:7===r?n.fg|=0x4000000:8===r?n.fg|=0x40000000:9===r?n.fg|=0x80000000:2===r?n.bg|=0x8000000:21===r?this._processUnderline(2,n):22===r?(n.fg&=-0x8000001,n.bg&=-0x8000001):23===r?n.bg&=-0x4000001:24===r?(n.fg&=-0x10000001,this._processUnderline(0,n)):25===r?n.fg&=-0x20000001:27===r?n.fg&=-0x4000001:28===r?n.fg&=-0x40000001:29===r?n.fg&=0x7fffffff:39===r?(n.fg&=-0x4000000,n.fg|=0xffffff&r2.fg):49===r?(n.bg&=-0x4000000,n.bg|=0xffffff&r2.bg):38===r||48===r||58===r?s+=this._extractColor(e,s,n):53===r?n.bg|=0x40000000:55===r?n.bg&=-0x40000001:59===r?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):100===r?(n.fg&=-0x4000000,n.fg|=0xffffff&r2.fg,n.bg&=-0x4000000,n.bg|=0xffffff&r2.bg):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${iA.ESC}[0n`);break;case 6:let i=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${iA.ESC}[${i};${r}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${iA.ESC}[?${e};${i}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r2.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let i=0===e.length?1:e.params[0];if(0===i)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(i){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar"}this._coreService.decPrivateModes.cursorBlink=i%2==1}return!0}setScrollRegion(e){let i=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||0===r)&&(r=this._bufferService.rows),r>i&&(this._activeBuffer.scrollTop=i-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!nW(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let i=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==i&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${iA.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(0===i||2===i)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),(0===i||1===i)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:(0===i||2===i)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(0===i||1===i)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let i=[],r=e.split(";");for(;r.length>1;){let e=r.shift(),n=r.shift();if(/^\d+$/.exec(e)){let r=parseInt(e);if(nV(r))if("?"===n)i.push({type:0,index:r});else{let e=nz(n);e&&i.push({type:1,index:r,color:e})}}}return i.length&&this._onColor.fire(i),!0}setHyperlink(e){let i=e.indexOf(";");if(-1===i)return!0;let r=e.slice(0,i).trim(),n=e.slice(i+1);return n?this._createHyperlink(r,n):!r.trim()&&this._finishHyperlink()}_createHyperlink(e,i){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,s=r.findIndex(e=>e.startsWith("id="));return -1!==s&&(n=r[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:i}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,i){let r=e.split(";");for(let e=0;e<r.length&&!(i>=this._specialColors.length);++e,++i)if("?"===r[e])this._onColor.fire([{type:0,index:this._specialColors[i]}]);else{let n=nz(r[e]);n&&this._onColor.fire([{type:1,index:this._specialColors[i],color:n}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let i=[],r=e.split(";");for(let e=0;e<r.length;++e)if(/^\d+$/.exec(r[e])){let n=parseInt(r[e]);nV(n)&&i.push({type:2,index:n})}return i.length&&this._onColor.fire(i),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,r8),!0}selectCharset(e){return 2!==e.length?this.selectDefaultCharset():"/"===e[0]||this._charsetService.setgCharset(nj[e[0]],r9[e[1]]||r8),!0}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=r2.clone(),this._eraseAttrDataInternal=r2.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-0x4000000,this._eraseAttrDataInternal.bg|=0x3ffffff&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new V;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let i=0;i<this._bufferService.rows;++i){let r=this._activeBuffer.ybase+this._activeBuffer.y+i,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,i){let r=e=>(this._coreService.triggerDataEvent(`${iA.ESC}${e}${iA.ESC}\\`),!0),n=this._bufferService.buffer,s=this._optionsService.rawOptions;return r('"q'===e?`P1$r${+!!this._curAttrData.isProtected()}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${({block:2,underline:4,bar:6})[s.cursorStyle]-!!s.cursorBlink} q`:"P0$r")}markRangeDirty(e,i){this._dirtyRowTracker.markRangeDirty(e,i)}},nq=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,i){e>i&&(n$=e,e=i,i=n$),e<this.start&&(this.start=e),i>this.end&&(this.end=i)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function nV(e){return 0<=e&&e<256}nq=M([O(0,J)],nq);var nK=class extends eL{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new eX),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){let r;if(void 0!==i&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){for(this._isSyncWriting=!0;r=this._writeBuffer.shift();){this._action(r);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=0x7fffffff,this._isSyncWriting=!1,this._syncCalls=0}}write(e,i){if(this._pendingData>5e7)throw Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],n=this._action(e,i);if(n){let e=e=>performance.now()-r>=12?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(r,e);n.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e);return}let s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-r>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},nY=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(void 0===e.id){let r=i.addMarker(i.ybase+i.y),n={data:e,id:this._nextId++,lines:[r]};return r.onDispose(()=>this._removeMarkerFromLink(n,r)),this._dataByLinkId.set(n.id,n),n.id}let r=this._getEntryIdKey(e),n=this._entriesWithId.get(r);if(n)return this.addLineToLink(n.id,i.ybase+i.y),n.id;let s=i.addMarker(i.ybase+i.y),o={id:this._nextId++,key:this._getEntryIdKey(e),data:e,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(o,s)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,i){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(e=>e.line!==i)){let e=this._bufferService.buffer.addMarker(i);r.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(r,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let r=e.lines.indexOf(i);-1!==r&&(e.lines.splice(r,1),0===e.lines.length&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};nY=M([O(0,J)],nY);var nX=!1,nG=class extends eL{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new eA),this._onBinary=this._register(new eX),this.onBinary=this._onBinary.event,this._onData=this._register(new eX),this.onData=this._onData.event,this._onLineFeed=this._register(new eX),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new eX),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new eX),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new eX),this._instantiationService=new rZ,this.optionsService=this._register(new nn(e)),this._instantiationService.setService(er,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(nt)),this._instantiationService.setService(J,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(r0)),this._instantiationService.setService(ei,this._logService),this.coreService=this._register(this._instantiationService.createInstance(nl)),this._instantiationService.setService(Q,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(nf)),this._instantiationService.setService(Z,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(nx)),this._instantiationService.setService(es,this.unicodeService),this._charsetService=this._instantiationService.createInstance(nC),this._instantiationService.setService(ee,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(nY),this._instantiationService.setService(en,this._oscLinkService),this._inputHandler=this._register(new nU(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(eW.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(eW.forward(this._bufferService.onResize,this._onResize)),this._register(eW.forward(this.coreService.onData,this._onData)),this._register(eW.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new nK((e,i)=>this._inputHandler.parse(e,i))),this._register(eW.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new eX),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!nX&&(this._logService.warn("writeSync is unreliable and will be removed soon."),nX=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,2),i=Math.max(i,1),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;0!==i&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&void 0!==i.buildNumber&&void 0!==i.buildNumber?e="conpty"===i.backend&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(nk.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(nk(this._bufferService),!1))),this._windowsWrappingHeuristics.value=eR(()=>{for(let i of e)i.dispose()})}}},nJ={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']},nZ=0,nQ=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new rD,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new rD,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),0===this._insertedValues.length&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,i)=>this._getKey(e)-this._getKey(i)),i=0,r=0,n=Array(this._array.length+this._insertedValues.length);for(let s=0;s<n.length;s++)r>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[r])?(n[s]=e[i],i++):n[s]=this._array[r++];this._array=n,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),0===this._array.length)return!1;let i=this._getKey(e);if(void 0===i||-1===(nZ=this._search(i))||this._getKey(this._array[nZ])!==i)return!1;do if(this._array[nZ]===e)return 0===this._deletedIndices.length&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(nZ),!0;while(++nZ<this._array.length&&this._getKey(this._array[nZ])===i)return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,i)=>e-i),i=0,r=Array(this._array.length-e.length),n=0;for(let s=0;s<this._array.length;s++)e[i]===s?i++:r[n++]=this._array[s];this._array=r,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),0!==this._array.length&&!((nZ=this._search(e))<0||nZ>=this._array.length)&&this._getKey(this._array[nZ])===e)do yield this._array[nZ];while(++nZ<this._array.length&&this._getKey(this._array[nZ])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),0!==this._array.length&&!((nZ=this._search(e))<0||nZ>=this._array.length)&&this._getKey(this._array[nZ])===e)do i(this._array[nZ]);while(++nZ<this._array.length&&this._getKey(this._array[nZ])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,r=this._array.length-1;for(;r>=i;){let n=i+r>>1,s=this._getKey(this._array[n]);if(s>e)r=n-1;else if(s<e)i=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return i}},n0=0,n1=0,n2=class extends eL{constructor(){super(),this._decorations=new nQ(e=>e?.marker.line),this._onDecorationRegistered=this._register(new eX),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new eX),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(eR(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let i=new n5(e);if(i){let e=i.marker.onDispose(()=>i.dispose()),r=i.onDispose(()=>{r.dispose(),i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),e.dispose())});this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,r){let n=0,s=0;for(let o of this._decorations.getKeyIterator(i))s=(n=o.options.x??0)+(o.options.width??1),e>=n&&e<s&&(!r||(o.options.layer??"bottom")===r)&&(yield o)}forEachDecorationAtCell(e,i,r,n){this._decorations.forEachByKey(i,i=>{n1=(n0=i.options.x??0)+(i.options.width??1),e>=n0&&e<n1&&(!r||(i.options.layer??"bottom")===r)&&n(i)})}},n5=class extends eD{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new eX),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new eX),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return null===this._cachedBg&&(this.options.backgroundColor?this._cachedBg=nm.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this.options.foregroundColor?this._cachedFg=nm.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},n3=class{constructor(e,i=1e3){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,r){this._rowCount=r,e=void 0!==e?e:0,i=void 0!==i?i:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,i):i;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=n-this._lastRefreshMs,i=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},i)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},n4=class extends eL{constructor(e,i,r,n){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new n3(this._renderRows.bind(this))),!this._terminal.element)throw Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
29
|
-
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(tQ(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(eR(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
30
|
-
`&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=N)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let r=this._terminal.buffer,n=r.lines.length.toString();for(let s=e;s<=i;s++){let e=r.lines.get(r.ydisp+s),i=[],o=e?.translateToString(!0,void 0,void 0,i)||"",a=(r.ydisp+s+1).toString(),l=this._rowElements[s];l&&(0===o.length?(l.textContent=" ",this._rowColumns.set(l,[0,1])):(l.textContent=o,this._rowColumns.set(l,i)),l.setAttribute("aria-posinset",a),l.setAttribute("aria-setsize",n),this._alignRowWidth(l))}this._announceCharacters()}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){let r,n,s=e.target,o=this._rowElements[0===i?1:this._rowElements.length-2];if(s.getAttribute("aria-posinset")!==(0===i?"1":`${this._terminal.buffer.lines.length}`)&&e.relatedTarget===o){if(0===i?(r=s,n=this._rowElements.pop(),this._rowContainer.removeChild(n)):(r=this._rowElements.shift(),n=s,this._rowContainer.removeChild(r)),r.removeEventListener("focus",this._topBoundaryFocusListener),n.removeEventListener("focus",this._bottomBoundaryFocusListener),0===i){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===i?-1:1),this._rowElements[0===i?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}}_handleSelectionChange(){if(0===this._rowElements.length)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===r.node&&i.offset>r.offset)&&([i,r]=[r,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(r.node))return;let s=({node:e,offset:i})=>{let r=e instanceof Text?e.parentNode:e,n=parseInt(r?.getAttribute("aria-posinset"),10)-1;if(isNaN(n))return console.warn("row is invalid. Race condition?"),null;let s=this._rowColumns.get(r);if(!s)return console.warn("columns is null. Race condition?"),null;let o=i<s.length?s[i]:s.slice(-1)[0]+1;return o>=this._terminal.cols&&(++n,o=0),{row:n,column:o}},o=s(i),a=s(r);if(!(!o||!a)){if(o.row>a.row||o.row===a.row&&o.column>=a.column)throw Error("invalid range");this._terminal.select(o.column,o.row,(a.row-o.row)*this._terminal.cols-o.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let i=e.getBoundingClientRect().width,r=this._rowColumns.get(e)?.slice(-1)?.[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/i})`}};n4=M([O(1,et),O(2,ec),O(3,eu)],n4);var n6=class extends eL{constructor(e,i,r,n,s){super(),this._element=e,this._mouseService=i,this._renderService=r,this._bufferService=n,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new eX),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new eX),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(eR(()=>{eE(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(tQ(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(tQ(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(tQ(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(tQ(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let i=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;let r=e.composedPath();for(let e=0;e<r.length;e++){let i=r[e];if(i.classList.contains("xterm"))break;if(i.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,i){this._activeProviderReplies&&i||(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[n,s]of this._linkProviderService.linkProviders.entries())i?this._activeProviderReplies?.get(n)&&(r=this._checkLinkProviderResult(n,e,r)):s.provideLinks(e.y,i=>{if(this._isMouseOut)return;let s=i?.map(e=>({link:e}));this._activeProviderReplies?.set(n,s),r=this._checkLinkProviderResult(n,e,r),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,i){let r=new Set;for(let n=0;n<i.size;n++){let s=i.get(n);if(s)for(let i=0;i<s.length;i++){let n=s[i],o=n.link.range.start.y<e?0:n.link.range.start.x,a=n.link.range.end.y>e?this._bufferService.cols:n.link.range.end.x;for(let e=o;e<=a;e++){if(r.has(e)){s.splice(i--,1);break}r.add(e)}}}}_checkLinkProviderResult(e,i,r){if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),s=!1;for(let i=0;i<e;i++)(!this._activeProviderReplies.has(i)||this._activeProviderReplies.get(i))&&(s=!0);if(!s&&n){let e=n.find(e=>this._linkAtPosition(e.link,i));e&&(r=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let e=0;e<this._activeProviderReplies.size;e++){let n=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,i));if(n){r=!0,this._handleNewLink(n);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){var i,r;if(!this._currentLink)return;let n=this._positionFromMouseEvent(e,this._element,this._mouseService);n&&this._mouseDownLink&&(i=this._mouseDownLink.link,r=this._currentLink.link,i.text===r.text&&i.range.start.x===r.range.start.x&&i.range.start.y===r.range.start.y&&i.range.end.x===r.range.end.x&&i.range.end.y===r.range.end.y)&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,i){this._currentLink&&this._lastMouseEvent&&(!e||!i||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,eE(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let i=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(i,r),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(r,i.text)}_fireUnderlineEvent(e,i){let r=e.range,n=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,i,r){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(r,i.text)}_linkAtPosition(e,i){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,s=i.y*this._bufferService.cols+i.x;return r<=s&&s<=n}_positionFromMouseEvent(e,i,r){let n=r.getCoords(e,i,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,i,r,n,s){return{x1:e,y1:i,x2:r,y2:n,cols:this._bufferService.cols,fg:s}}};n6=M([O(1,eh),O(2,eu),O(3,J),O(4,eg)],n6);var n9=class extends nG{constructor(e={}){super(e),this._linkifier=this._register(new eA),this.browser=rh,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new eA),this._onCursorMove=this._register(new eX),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new eX),this.onKey=this._onKey.event,this._onRender=this._register(new eX),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new eX),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new eX),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new eX),this.onBell=this._onBell.event,this._onFocus=this._register(new eX),this._onBlur=this._register(new eX),this._onA11yCharEmitter=this._register(new eX),this._onA11yTabEmitter=this._register(new eX),this._onWillOpen=this._register(new eX),this._setup(),this._decorationService=this._instantiationService.createInstance(n2),this._instantiationService.setService(eo,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ro),this._instantiationService.setService(eg,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(ea)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(eW.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(eW.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(eW.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(eW.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(eR(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i of e){let e,r="";switch(i.index){case 256:e="foreground",r="10";break;case 257:e="background",r="11";break;case 258:e="cursor",r="12";break;default:e="ansi",r="4;"+i.index}switch(i.type){case 0:let n=ng.toColorRGB("ansi"===e?this._themeService.colors.ansi[i.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${iA.ESC}]${r};${function(e,i=16){let[r,n,s]=e;return`rgb:${nH(r,i)}/${nH(n,i)}/${nH(s,i)}`}(n)}${iM.ST}`);break;case 1:if("ansi"===e)this._themeService.modifyColors(e=>e.ansi[i.index]=iO.toColor(...i.color));else{let r=e;this._themeService.modifyColors(e=>e[r]=iO.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(n4,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(iA.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(iA.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,s=i.getWidth(r),o=this._renderService.dimensions.css.cell.width*s,a=this.buffer.y*this._renderService.dimensions.css.cell.height,l=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=l+"px",this.textarea.style.top=a+"px",this.textarea.style.width=o+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(tQ(this.element,"copy",e=>{var i;this.hasSelection()&&(i=this._selectionService,e.clipboardData&&e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault())}));let e=e=>{var i,r,n;return i=this.textarea,r=this.coreService,n=this.optionsService,void(e.stopPropagation(),e.clipboardData&&I(e.clipboardData.getData("text/plain"),i,r,n))};this._register(tQ(this.textarea,"paste",e)),this._register(tQ(this.element,"paste",e)),rm?this._register(tQ(this.element,"mousedown",e=>{2===e.button&&z(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(tQ(this.element,"contextmenu",e=>{z(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),rC&&this._register(tQ(this.element,"auxclick",e=>{1===e.button&&F(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(tQ(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(tQ(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(tQ(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(tQ(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(tQ(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(tQ(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(tQ(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(tQ(this.screenElement,"mousemove",e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",B),rk||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(rn,this.textarea,e.ownerDocument.defaultView??window,this._document??"u">typeof window?window.document:null)),this._instantiationService.setService(ec,this._coreBrowserService),this._register(tQ(this.textarea,"focus",e=>this._handleTextAreaFocus(e))),this._register(tQ(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(re,this._document,this._helperContainer),this._instantiationService.setService(el,this._charSizeService),this._themeService=this._instantiationService.createInstance(rX),this._instantiationService.setService(ep,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(iG),this._instantiationService.setService(ef,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(rA,this.rows,this.screenElement)),this._instantiationService.setService(eu,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(ik,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(rl),this._instantiationService.setService(eh,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(n6,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(iv,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(rj,this.element,this.screenElement,n)),this._instantiationService.setService(ed,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(eW.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(iy,this.screenElement)),this._register(tQ(this.element,"mousedown",e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(n4,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(iC,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(iC,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i7,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function r(i){let r,n,s=e._mouseService.getMouseReportCoords(i,e.screenElement);if(!s)return!1;switch(i.overrideType||i.type){case"mousemove":n=32,void 0===i.buttons?(r=3,void 0!==i.button&&(r=i.button<3?i.button:3)):r=1&i.buttons?0:4&i.buttons?1:2&i.buttons?2:3;break;case"mouseup":n=0,r=i.button<3?i.button:3;break;case"mousedown":n=1,r=i.button<3?i.button:3;break;case"wheel":if(e._customWheelEventHandler&&!1===e._customWheelEventHandler(i))return!1;let o=i.deltaY;if(0===o||0===e.coreMouseService.consumeWheelEvent(i,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr))return!1;n=o<0?0:1,r=4;break;default:return!1}return void 0!==n&&void 0!==r&&!(r>4)&&e.coreMouseService.triggerMouseEvent({col:s.col,row:s.row,x:s.x,y:s.y,button:r,action:n,ctrl:i.ctrlKey,alt:i.altKey,shift:i.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s=e=>(r(e),e.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(e)),o=e=>(r(e),this.cancel(e,!0)),a=e=>{e.buttons&&r(e)},l=e=>{e.buttons||r(e)};this._register(this.coreMouseService.onProtocolChange(e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?n.mousemove||(i.addEventListener("mousemove",l),n.mousemove=l):(i.removeEventListener("mousemove",n.mousemove),n.mousemove=null),16&e?n.wheel||(i.addEventListener("wheel",o,{passive:!1}),n.wheel=o):(i.removeEventListener("wheel",n.wheel),n.wheel=null),2&e?n.mouseup||(n.mouseup=s):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),4&e?n.mousedrag||(n.mousedrag=a):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(tQ(i,"mousedown",e=>{if(e.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(e)))return r(e),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(e)})),this._register(tQ(i,"wheel",i=>{if(!n.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(i))return!1;if(!this.buffer.hasScrollback){if(0===i.deltaY)return!1;if(0===e.coreMouseService.consumeWheelEvent(i,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr))return this.cancel(i,!0);let r=iA.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(i.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(r,!0),this.cancel(i,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;0!==i&&this.scrollLines(i)}paste(e){I(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,i,r){this._selectionService.setSelection(e,i,r)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,i){this._selectionService?.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;i||"Dead"!==e.key&&"AltGraph"!==e.key||(this._unprocessedDeadKey=!0);let r=function(e,i,r,n){let s={type:0,cancel:!1,key:void 0},o=!!e.shiftKey|2*!!e.altKey|4*!!e.ctrlKey|8*!!e.metaKey;switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?i?s.key=iA.ESC+"OA":s.key=iA.ESC+"[A":"UIKeyInputLeftArrow"===e.key?i?s.key=iA.ESC+"OD":s.key=iA.ESC+"[D":"UIKeyInputRightArrow"===e.key?i?s.key=iA.ESC+"OC":s.key=iA.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(i?s.key=iA.ESC+"OB":s.key=iA.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":iA.DEL,e.altKey&&(s.key=iA.ESC+s.key);break;case 9:if(e.shiftKey){s.key=iA.ESC+"[Z";break}s.key=iA.HT,s.cancel=!0;break;case 13:s.key=e.altKey?iA.ESC+iA.CR:iA.CR,s.cancel=!0;break;case 27:s.key=iA.ESC,e.altKey&&(s.key=iA.ESC+iA.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;o?s.key=iA.ESC+"[1;"+(o+1)+"D":i?s.key=iA.ESC+"OD":s.key=iA.ESC+"[D";break;case 39:if(e.metaKey)break;o?s.key=iA.ESC+"[1;"+(o+1)+"C":i?s.key=iA.ESC+"OC":s.key=iA.ESC+"[C";break;case 38:if(e.metaKey)break;o?s.key=iA.ESC+"[1;"+(o+1)+"A":i?s.key=iA.ESC+"OA":s.key=iA.ESC+"[A";break;case 40:if(e.metaKey)break;o?s.key=iA.ESC+"[1;"+(o+1)+"B":i?s.key=iA.ESC+"OB":s.key=iA.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(s.key=iA.ESC+"[2~");break;case 46:o?s.key=iA.ESC+"[3;"+(o+1)+"~":s.key=iA.ESC+"[3~";break;case 36:o?s.key=iA.ESC+"[1;"+(o+1)+"H":i?s.key=iA.ESC+"OH":s.key=iA.ESC+"[H";break;case 35:o?s.key=iA.ESC+"[1;"+(o+1)+"F":i?s.key=iA.ESC+"OF":s.key=iA.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=iA.ESC+"[5;"+(o+1)+"~":s.key=iA.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=iA.ESC+"[6;"+(o+1)+"~":s.key=iA.ESC+"[6~";break;case 112:o?s.key=iA.ESC+"[1;"+(o+1)+"P":s.key=iA.ESC+"OP";break;case 113:o?s.key=iA.ESC+"[1;"+(o+1)+"Q":s.key=iA.ESC+"OQ";break;case 114:o?s.key=iA.ESC+"[1;"+(o+1)+"R":s.key=iA.ESC+"OR";break;case 115:o?s.key=iA.ESC+"[1;"+(o+1)+"S":s.key=iA.ESC+"OS";break;case 116:o?s.key=iA.ESC+"[15;"+(o+1)+"~":s.key=iA.ESC+"[15~";break;case 117:o?s.key=iA.ESC+"[17;"+(o+1)+"~":s.key=iA.ESC+"[17~";break;case 118:o?s.key=iA.ESC+"[18;"+(o+1)+"~":s.key=iA.ESC+"[18~";break;case 119:o?s.key=iA.ESC+"[19;"+(o+1)+"~":s.key=iA.ESC+"[19~";break;case 120:o?s.key=iA.ESC+"[20;"+(o+1)+"~":s.key=iA.ESC+"[20~";break;case 121:o?s.key=iA.ESC+"[21;"+(o+1)+"~":s.key=iA.ESC+"[21~";break;case 122:o?s.key=iA.ESC+"[23;"+(o+1)+"~":s.key=iA.ESC+"[23~";break;case 123:o?s.key=iA.ESC+"[24;"+(o+1)+"~":s.key=iA.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if((!r||n)&&e.altKey&&!e.metaKey){let i=nJ[e.keyCode]?.[+!!e.shiftKey];if(i)s.key=iA.ESC+i;else if(e.keyCode>=65&&e.keyCode<=90){let i=String.fromCharCode(e.ctrlKey?e.keyCode-64:e.keyCode+32);e.shiftKey&&(i=i.toUpperCase()),s.key=iA.ESC+i}else if(32===e.keyCode)s.key=iA.ESC+(e.ctrlKey?iA.NUL:" ");else if("Dead"===e.key&&e.code.startsWith("Key")){let i=e.code.slice(3,4);e.shiftKey||(i=i.toLowerCase()),s.key=iA.ESC+i,s.cancel=!0}}else!r||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?!e.key||e.ctrlKey||e.altKey||e.metaKey||!(e.keyCode>=48)||1!==e.key.length?e.key&&e.ctrlKey&&("_"===e.key&&(s.key=iA.US),"@"===e.key&&(s.key=iA.NUL)):s.key=e.key:65===e.keyCode&&(s.type=1);else e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?s.key=iA.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?s.key=iA.DEL:219===e.keyCode?s.key=iA.ESC:220===e.keyCode?s.key=iA.FS:221===e.keyCode&&(s.key=iA.GS)}return s}(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===r.type||2===r.type){let i=this.rows-1;return this.scrollLines(2===r.type?-i:i),this.cancel(e,!0)}return 1===r.type&&this.selectAll(),!!(this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&1===e.key.length&&e.key.charCodeAt(0)>=65&&90>=e.key.charCodeAt(0))||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):((r.key===iA.ETX||r.key===iA.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)?this.cancel(e,!0):void(this._keyDownHandled=!0))}_isThirdLevelShift(e,i){let r=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return"keypress"===i.type?r:r&&(!i.keyCode||i.keyCode>47)}_keyUp(e){var i;this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(16===(i=e).keyCode||17===i.keyCode||18===i.keyCode||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(null===e.which||void 0===e.which)i=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;i=e.which}return!!i&&(!e.altKey&&!e.ctrlKey&&!e.metaKey||!!this._isThirdLevelShift(this.browser,e))&&(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&"insertText"===e.inputType&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){this._charSizeService?.measure()}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(r2));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(iA.ESC+"[I"):this.coreService.triggerDataEvent(iA.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${iA.ESC}[4;${r};${i}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${iA.ESC}[6;${s};${n}t`)}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}},n8=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let r={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(r),i.dispose=()=>this._wrappedAddonDispose(r),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){i=r;break}if(-1===i)throw Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},n7=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new V)}translateToString(e,i,r){return this._line.translateToString(e,i,r)}},se=class{constructor(e,i){this._buffer=e,this.type=i}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let i=this._buffer.lines.get(e);if(i)return new n7(i)}getNullCell(){return new V}},st=class extends eL{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new eX),this.onBufferChange=this._onBufferChange.event,this._normal=new se(this._core.buffers.normal,"normal"),this._alternate=new se(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},si=class{constructor(e){this._core=e}registerCsiHandler(e,i){return this._core.registerCsiHandler(e,e=>i(e.toArray()))}addCsiHandler(e,i){return this.registerCsiHandler(e,i)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(e,r)=>i(e,r.toArray()))}addDcsHandler(e,i){return this.registerDcsHandler(e,i)}registerEscHandler(e,i){return this._core.registerEscHandler(e,i)}addEscHandler(e,i){return this.registerEscHandler(e,i)}registerOscHandler(e,i){return this._core.registerOscHandler(e,i)}addOscHandler(e,i){return this.registerOscHandler(e,i)}},sr=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},sn=["cols","rows"],ss=0,so=class extends eL{constructor(e){super(),this._core=this._register(new n9(e)),this._addonManager=this._register(new n8),this._publicOptions={...this._core.options};let i=e=>this._core.options[e],r=(e,i)=>{this._checkReadonlyOptions(e),this._core.options[e]=i};for(let e in this._core.options){let n={get:i.bind(this,e),set:r.bind(this,e)};Object.defineProperty(this._publicOptions,e,n)}}_checkReadonlyOptions(e){if(sn.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new si(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new sr(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new st(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let i in e)this._publicOptions[i]=e[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,i=!0){this._core.input(e,i)}resize(e,i){this._verifyIntegers(e,i),this._core.resize(e,i)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,i,r){this._verifyIntegers(e,i,r),this._core.select(e,i,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,i){this._verifyIntegers(e,i),this._core.selectLines(e,i)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,i){this._core.write(e,i)}writeln(e,i){this._core.write(e),this._core.write(`\r
|
|
31
|
-
`,i)}paste(e){this._core.paste(e)}refresh(e,i){this._verifyIntegers(e,i),this._core.refresh(e,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return B},set promptLabel(t){B=t},get tooMuchOutput(){return N},set tooMuchOutput(t){N=t}}}_verifyIntegers(...e){for(ss of e)if(ss===1/0||isNaN(ss)||ss%1!=0)throw Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ss of e)if(ss&&(ss===1/0||isNaN(ss)||ss%1!=0||ss<0))throw Error("This API only accepts positive integers")}};e.s(["Terminal",0,so],99894);var sa=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let i=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(0===e.css.cell.width||0===e.css.cell.height)return;let i=0===this._terminal.options.scrollback?0:this._terminal.options.overviewRuler?.width||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),s=Math.max(0,parseInt(r.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),a={top:parseInt(o.getPropertyValue("padding-top")),bottom:parseInt(o.getPropertyValue("padding-bottom")),right:parseInt(o.getPropertyValue("padding-right")),left:parseInt(o.getPropertyValue("padding-left"))},l=a.top+a.bottom;return{cols:Math.max(2,Math.floor((s-(a.right+a.left)-i)/e.css.cell.width)),rows:Math.max(1,Math.floor((n-l)/e.css.cell.height))}}};e.s(["FitAddon",0,sa],93309)},96085,e=>{"use strict";let i,r,n,s=Object.create(null);s.open="0",s.close="1",s.ping="2",s.pong="3",s.message="4",s.upgrade="5",s.noop="6";let o=Object.create(null);Object.keys(s).forEach(e=>{o[s[e]]=e});let a={type:"error",data:"parser error"},l="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),c="function"==typeof ArrayBuffer,h=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,u=({type:e,data:i},r,n)=>{if(l&&i instanceof Blob)if(r)return n(i);else return d(i,n);if(c&&(i instanceof ArrayBuffer||h(i)))if(r)return n(i);else return d(new Blob([i]),n);return n(s[e]+(i||""))},d=(e,i)=>{let r=new FileReader;return r.onload=function(){i("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(e)};function f(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<p.length;e++)g[p.charCodeAt(e)]=e;let m="function"==typeof ArrayBuffer,_=(e,i)=>{if("string"!=typeof e)return{type:"message",data:y(e,i)};let r=e.charAt(0);return"b"===r?{type:"message",data:v(e.substring(1),i)}:o[r]?e.length>1?{type:o[r],data:e.substring(1)}:{type:o[r]}:a},v=(e,i)=>m?y((e=>{let i=.75*e.length,r=e.length,n,s=0,o,a,l,c;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);let h=new ArrayBuffer(i),u=new Uint8Array(h);for(n=0;n<r;n+=4)o=g[e.charCodeAt(n)],a=g[e.charCodeAt(n+1)],l=g[e.charCodeAt(n+2)],c=g[e.charCodeAt(n+3)],u[s++]=o<<2|a>>4,u[s++]=(15&a)<<4|l>>2,u[s++]=(3&l)<<6|63&c;return h})(e),i):{base64:!0,data:e},y=(e,i)=>"blob"===i?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function b(e){return e.reduce((e,i)=>e+i.length,0)}function S(e,i){if(e[0].length===i)return e.shift();let r=new Uint8Array(i),n=0;for(let s=0;s<i;s++)r[s]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function w(e){if(e){var i=e;for(var r in w.prototype)i[r]=w.prototype[r];return i}}w.prototype.on=w.prototype.addEventListener=function(e,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(i),this},w.prototype.once=function(e,i){function r(){this.off(e,r),i.apply(this,arguments)}return r.fn=i,this.on(e,r),this},w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(e,i){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<n.length;s++)if((r=n[s])===i||r.fn===i){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},w.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var i=Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,i)}return this},w.prototype.emitReserved=w.prototype.emit,w.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},w.prototype.hasListeners=function(e){return!!this.listeners(e).length};let x="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,i)=>i(e,0),C="u">typeof self?self:"u">typeof window?window:Function("return this")();function k(e,...i){return i.reduce((i,r)=>(e.hasOwnProperty(r)&&(i[r]=e[r]),i),{})}let E=C.setTimeout,R=C.clearTimeout;function T(e,i){i.useNativeTimers?(e.setTimeoutFn=E.bind(C),e.clearTimeoutFn=R.bind(C)):(e.setTimeoutFn=C.setTimeout.bind(C),e.clearTimeoutFn=C.clearTimeout.bind(C))}function D(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class L extends Error{constructor(e,i,r){super(e),this.description=i,this.context=r,this.type="TransportError"}}class A extends w{constructor(e){super(),this.writable=!1,T(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,i,r){return super.emitReserved("error",new L(e,i,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let i=_(e,this.socket.binaryType);this.onPacket(i)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,i={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let i=function(e){let i="";for(let r in e)e.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return i}(e);return i.length?"?"+i:""}}class P extends A{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let i=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let i=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,i)=>{let r=e.split("\x1e"),n=[];for(let e=0;e<r.length;e++){let s=_(r[e],i);if(n.push(s),"error"===s.type)break}return n})(e,this.socket.binaryType).forEach(i),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var i;let r,n,s;this.writable=!1,i=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},n=Array(r=e.length),s=0,e.forEach((e,o)=>{u(e,!1,e=>{n[o]=e,++s===r&&i(n.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",i=this.query||{};return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(e,i)}}let M=!1;try{M="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let O=M;function B(){}class N extends P{constructor(e){if(super(e),"u">typeof location){const i="https:"===location.protocol;let r=location.port;r||(r=i?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,i){let r=this.request({method:"POST",data:e});r.on("success",i),r.on("error",(e,i)=>{this.onError("xhr post error",e,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=e}}class I extends w{constructor(e,i,r){super(),this.createRequest=e,T(this,r),this._opts=r,this._method=r.method||"GET",this._uri=i,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;let i=k(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(i);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=I.requestsCount++,I.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=B,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete I.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function F(){for(let e in I.requests)I.requests.hasOwnProperty(e)&&I.requests[e].abort()}I.requestsCount=0,I.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",F):"function"==typeof addEventListener&&addEventListener("onpagehide"in C?"pagehide":"unload",F,!1));let z=(n=H({xdomain:!1}))&&null!==n.responseType;function H(e){let i=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!i||O))return new XMLHttpRequest}catch(e){}if(!i)try{return new C[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let j="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class W extends A{get name(){return"websocket"}doOpen(){let e=this.uri(),i=this.opts.protocols,r=j?{}:k(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,i,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;u(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||(i.b64=1),this.createUri(e,i)}}let $=C.WebSocket||C.MozWebSocket,U={websocket:class extends W{createSocket(e,i,r){return j?new $(e,i,r):i?new $(e,i):new $(e)}doWrite(e,i){this.ws.send(i)}},webtransport:class extends A{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var n,s;let o,d,p,g,m=(n=Number.MAX_SAFE_INTEGER,s=this.socket.binaryType,r||(r=new TextDecoder),o=[],d=0,p=-1,g=!1,new TransformStream({transform(e,i){for(o.push(e);;){if(0===d){if(1>b(o))break;let e=S(o,1);g=(128&e[0])==128,d=(p=127&e[0])<126?3:126===p?1:2}else if(1===d){if(2>b(o))break;let e=S(o,2);p=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),d=3}else if(2===d){if(8>b(o))break;let e=S(o,8),r=new DataView(e.buffer,e.byteOffset,e.length),n=r.getUint32(0);if(n>2097151){i.enqueue(a);break}p=0x100000000*n+r.getUint32(4),d=3}else{if(b(o)<p)break;let e=S(o,p);i.enqueue(_(g?e:r.decode(e),s)),d=0}if(0===p||p>n){i.enqueue(a);break}}}})),v=e.readable.pipeThrough(m).getReader(),y=new TransformStream({transform(e,r){var n;n=i=>{let n,s=i.length;if(s<126)new DataView((n=new Uint8Array(1)).buffer).setUint8(0,s);else if(s<65536){let e=new DataView((n=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,s)}else{let e=new DataView((n=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(s))}e.data&&"string"!=typeof e.data&&(n[0]|=128),r.enqueue(n),r.enqueue(i)},l&&e.data instanceof Blob?e.data.arrayBuffer().then(f).then(n):c&&(e.data instanceof ArrayBuffer||h(e.data))?n(f(e.data)):u(e,!1,e=>{i||(i=new TextEncoder),n(i.encode(e))})}});y.readable.pipeTo(e.writable),this._writer=y.writable.getWriter();let w=()=>{v.read().then(({done:e,value:i})=>{e||(this.onPacket(i),w())}).catch(e=>{})};w();let x={type:"open"};this.query.sid&&(x.data=`{"sid":"${this.query.sid}"}`),this._writer.write(x).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;this._writer.write(r).then(()=>{n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends N{constructor(e){super(e);const i=e&&e.forceBase64;this.supportsBinary=z&&!i}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new I(H,this.uri(),e)}}},q=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,V=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function K(e){var i,r;let n,s;if(e.length>8e3)throw"URI too long";let o=e,a=e.indexOf("["),l=e.indexOf("]");-1!=a&&-1!=l&&(e=e.substring(0,a)+e.substring(a,l).replace(/:/g,";")+e.substring(l,e.length));let c=q.exec(e||""),h={},u=14;for(;u--;)h[V[u]]=c[u]||"";return -1!=a&&-1!=l&&(h.source=o,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),n=(i=h.path).replace(/\/{2,9}/g,"/").split("/"),("/"==i.slice(0,1)||0===i.length)&&n.splice(0,1),"/"==i.slice(-1)&&n.splice(n.length-1,1),h.pathNames=n,r=h.query,s={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,i,r){i&&(s[i]=r)}),h.queryKey=s,h}let Y="function"==typeof addEventListener&&"function"==typeof removeEventListener,X=[];Y&&addEventListener("offline",()=>{X.forEach(e=>e())},!1);class G extends w{constructor(e,i){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(i=e,e=null),e){const r=K(e);i.hostname=r.host,i.secure="https"===r.protocol||"wss"===r.protocol,i.port=r.port,r.query&&(i.query=r.query)}else i.host&&(i.hostname=K(i.host).host);T(this,i),this.secure=null!=i.secure?i.secure:"u">typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||("u">typeof location?location.hostname:"localhost"),this.port=i.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(e=>{let i=e.prototype.name;this.transports.push(i),this._transportsByName[i]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let i={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");i[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return i}(this.opts.query)),Y&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},X.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let i=Object.assign({},this.opts.query);i.EIO=4,i.transport=e,this.id&&(i.sid=this.id);let r=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&G.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(e);i.open(),this.setTransport(i)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",G.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let i=Error("server error");i.code=e.data,this._onError(i);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let i=0;i<this.writeBuffer.length;i++){let r=this.writeBuffer[i].data;if(r&&(e+="string"==typeof r?function(e){let i=0,r=0;for(let n=0,s=e.length;n<s;n++)(i=e.charCodeAt(n))<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),i>0&&e>this._maxPayload)return this.writeBuffer.slice(0,i);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,x(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,i,r){return this._sendPacket("message",e,i,r),this}send(e,i,r){return this._sendPacket("message",e,i,r),this}_sendPacket(e,i,r,n){if("function"==typeof i&&(n=i,i=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let s={type:e,data:i,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},r=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(G.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,i){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Y&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=X.indexOf(this._offlineEventListener);-1!==e&&X.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this._prevBufferLen=0}}}G.protocol=4;class J extends G{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let i=this.createTransport(e),r=!1;G.priorWebsocketSuccess=!1;let n=()=>{r||(i.send([{type:"ping",data:"probe"}]),i.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;G.priorWebsocketSuccess="websocket"===i.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(h(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=i.name,this.emitReserved("upgradeError",e)}}))};function s(){r||(r=!0,h(),i.close(),i=null)}let o=e=>{let r=Error("probe error: "+e);r.transport=i.name,s(),this.emitReserved("upgradeError",r)};function a(){o("transport closed")}function l(){o("socket closed")}function c(e){i&&e.name!==i.name&&s()}let h=()=>{i.removeListener("open",n),i.removeListener("error",o),i.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};i.once("open",n),i.once("error",o),i.once("close",a),this.once("close",l),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||i.open()},200):i.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let i=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&i.push(e[r]);return i}}class Z extends J{constructor(e,i={}){const r="object"==typeof e?e:i;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>U[e]).filter(e=>!!e)),super(e,r)}}Z.protocol;let Q="function"==typeof ArrayBuffer,ee=Object.prototype.toString,et="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===ee.call(Blob),ei="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===ee.call(File);function er(e){return Q&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||et&&e instanceof Blob||ei&&e instanceof File}let en=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(ed=ef||(ef={}))[ed.CONNECT=0]="CONNECT",ed[ed.DISCONNECT=1]="DISCONNECT",ed[ed.EVENT=2]="EVENT",ed[ed.ACK=3]="ACK",ed[ed.CONNECT_ERROR=4]="CONNECT_ERROR",ed[ed.BINARY_EVENT=5]="BINARY_EVENT",ed[ed.BINARY_ACK=6]="BINARY_ACK";class es extends w{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let i;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(i=this.decodeString(e)).type===ef.BINARY_EVENT;r||i.type===ef.BINARY_ACK?(i.type=r?ef.EVENT:ef.ACK,this.reconstructor=new eo(i),0===i.attachments&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(er(e)||e.base64)if(this.reconstructor)(i=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let i=0,r={type:Number(e.charAt(0))};if(void 0===ef[r.type])throw Error("unknown packet type "+r.type);if(r.type===ef.BINARY_EVENT||r.type===ef.BINARY_ACK){let n=i+1;for(;"-"!==e.charAt(++i)&&i!=e.length;);let s=e.substring(n,i);if(s!=Number(s)||"-"!==e.charAt(i))throw Error("Illegal attachments");let o=Number(s);if(!ea(o)||o<0)throw Error("Illegal attachments");if(o>this.opts.maxAttachments)throw Error("too many attachments");r.attachments=o}if("/"===e.charAt(i+1)){let n=i+1;for(;++i&&","!==e.charAt(i)&&i!==e.length;);r.nsp=e.substring(n,i)}else r.nsp="/";let n=e.charAt(i+1);if(""!==n&&Number(n)==n){let n=i+1;for(;++i;){let r=e.charAt(i);if(null==r||Number(r)!=r){--i;break}if(i===e.length)break}r.id=Number(e.substring(n,i+1))}if(e.charAt(++i)){let n=this.tryParse(e.substr(i));if(es.isPayloadValid(r.type,n))r.data=n;else throw Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,i){switch(e){case ef.CONNECT:return el(i);case ef.DISCONNECT:return void 0===i;case ef.CONNECT_ERROR:return"string"==typeof i||el(i);case ef.EVENT:case ef.BINARY_EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:case ef.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class eo{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var i,r;let e=(i=this.reconPack,r=this.buffers,i.data=function e(i,r){if(!i)return i;if(i&&!0===i._placeholder){if("number"==typeof i.num&&i.num>=0&&i.num<r.length)return r[i.num];throw Error("illegal attachments")}if(Array.isArray(i))for(let n=0;n<i.length;n++)i[n]=e(i[n],r);else if("object"==typeof i)for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(i[n]=e(i[n],r));return i}(i.data,r),delete i.attachments,i);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let ea=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function el(e){return"[object Object]"===Object.prototype.toString.call(e)}function ec(e,i,r){return e.on(i,r),function(){e.off(i,r)}}e.s(["Decoder",0,es,"Encoder",0,class{constructor(e){this.replacer=e}encode(e){return(e.type===ef.EVENT||e.type===ef.ACK)&&function e(i,r){if(!i||"object"!=typeof i)return!1;if(Array.isArray(i)){for(let r=0,n=i.length;r<n;r++)if(e(i[r]))return!0;return!1}if(er(i))return!0;if(i.toJSON&&"function"==typeof i.toJSON&&1==arguments.length)return e(i.toJSON(),!0);for(let r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&e(i[r]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===ef.EVENT?ef.BINARY_EVENT:ef.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let i=""+e.type;return(e.type===ef.BINARY_EVENT||e.type===ef.BINARY_ACK)&&(i+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(i+=e.nsp+","),null!=e.id&&(i+=e.id),null!=e.data&&(i+=JSON.stringify(e.data,this.replacer)),i}encodeAsBinary(e){let i,r,n=(i=[],r=e.data,e.data=function e(i,r){if(!i)return i;if(er(i)){let e={_placeholder:!0,num:r.length};return r.push(i),e}if(Array.isArray(i)){let n=Array(i.length);for(let s=0;s<i.length;s++)n[s]=e(i[s],r);return n}if("object"==typeof i&&!(i instanceof Date)){let n={};for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=e(i[s],r));return n}return i}(r,i),e.attachments=i.length,{packet:e,buffers:i}),s=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(s),o}},"PacketType",0,ef,"isPacketValid",0,function(e){var i;return"string"==typeof e.nsp&&(void 0===(i=e.id)||ea(i))&&function(e,i){switch(e){case ef.CONNECT:return void 0===i||el(i);case ef.DISCONNECT:return void 0===i;case ef.EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:return Array.isArray(i);case ef.CONNECT_ERROR:return"string"==typeof i||el(i);default:return!1}}(e.type,e.data)},"protocol",0,5],51890);let eh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class eu extends w{constructor(e,i,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=i,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[ec(e,"open",this.onopen.bind(this)),ec(e,"packet",this.onpacket.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...i){var r,n,s;if(eh.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(i.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:ef.EVENT,data:i};if(o.options={},o.options.compress=!1!==this.flags.compress,"function"==typeof i[i.length-1]){let e=this.ids++,r=i.pop();this._registerAckCallback(e,r),o.id=e}let a=null==(n=null==(r=this.io.engine)?void 0:r.transport)?void 0:n.writable,l=this.connected&&!(null==(s=this.io.engine)?void 0:s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,i){var r;let n=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===n){this.acks[e]=i;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===e&&this.sendBuffer.splice(i,1);i.call(this,Error("operation has timed out"))},n),o=(...e)=>{this.io.clearTimeoutFn(s),i.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...i){return new Promise((r,n)=>{let s=(e,i)=>e?n(e):r(i);s.withError=!0,i.push(s),this.emit(e,...i)})}_addToQueue(e){let i;"function"==typeof e[e.length-1]&&(i=e.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>(this._queue[0],null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(e)):(this._queue.shift(),i&&i(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let i=this._queue[0];(!i.pending||e)&&(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ef.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ef.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ef.EVENT:case ef.BINARY_EVENT:this.onevent(e);break;case ef.ACK:case ef.BINARY_ACK:this.onack(e);break;case ef.DISCONNECT:this.ondisconnect();break;case ef.CONNECT_ERROR:this.destroy();let i=Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i)}}onevent(e){let i=e.data||[];null!=e.id&&i.push(this.ack(e.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let i of this._anyListeners.slice())i.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let i=this,r=!1;return function(...n){r||(r=!0,i.packet({type:ef.ACK,id:e,data:n}))}}onack(e){let i=this.acks[e.id];"function"==typeof i&&(delete this.acks[e.id],i.withError&&e.data.unshift(null),i.apply(this,e.data))}onconnect(e,i){this.id=e,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ef.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let i=this._anyListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let i=this._anyOutgoingListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let i of this._anyOutgoingListeners.slice())i.apply(this,e.data)}}var ed,ef,ep=e.i(51890);function eg(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}eg.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*e);e=(1&Math.floor(10*i))==0?e-r:e+r}return 0|Math.min(e,this.max)},eg.prototype.reset=function(){this.attempts=0},eg.prototype.setMin=function(e){this.ms=e},eg.prototype.setMax=function(e){this.max=e},eg.prototype.setJitter=function(e){this.jitter=e};class em extends w{constructor(e,i){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(i=e,e=void 0),(i=i||{}).path=i.path||"/socket.io",this.opts=i,T(this,i),this.reconnection(!1!==i.reconnection),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=i.randomizationFactor)?r:.5),this.backoff=new eg({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==i.timeout?2e4:i.timeout),this._readyState="closed",this.uri=e;const n=i.parser||ep;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==i.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var i;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(i=this.backoff)||i.setMin(e),this)}randomizationFactor(e){var i;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(i=this.backoff)||i.setJitter(e),this)}reconnectionDelayMax(e){var i;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(i=this.backoff)||i.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Z(this.uri,this.opts);let i=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=ec(i,"open",function(){r.onopen(),e&&e()}),s=i=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",i),e?e(i):this.maybeReconnectOnOpen()},o=ec(i,"error",s);if(!1!==this._timeout){let e=this._timeout,r=this.setTimeoutFn(()=>{n(),s(Error("timeout")),i.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(ec(e,"ping",this.onping.bind(this)),ec(e,"data",this.ondata.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this)),ec(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){x(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,i){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new eu(this,e,i),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let i=this.encoder.encode(e);for(let r=0;r<i.length;r++)this.engine.write(i[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,i){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},i);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let e_={};function ev(e,i){let r;"object"==typeof e&&(i=e,e=void 0);let n=function(e,i="",r){let n=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=K(e)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+i,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}(e,(i=i||{}).path||"/socket.io"),s=n.source,o=n.id,a=n.path,l=e_[o]&&a in e_[o].nsps;return i.forceNew||i["force new connection"]||!1===i.multiplex||l?r=new em(s,i):(e_[o]||(e_[o]=new em(s,i)),r=e_[o]),n.query&&!i.query&&(i.query=n.queryKey),r.socket(n.path,i)}Object.assign(ev,{Manager:em,Socket:eu,io:ev,connect:ev}),e.s(["io",0,ev],96085)},67211,e=>{"use strict";var i=e.i(18050),r=e.i(71645),n=e.i(99894),s=e.i(93309),o=e.i(96085),a=e.i(627),l=e.i(31278),c=e.i(74886),h=e.i(75254);let u=(0,h.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var d=e.i(43531);let f=(0,h.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);var p=e.i(12382),g=e.i(85902),m=e.i(77814),_=e.i(70935);let v=(0,r.forwardRef)(function({tabId:e,cwd:h,env:v,worktreePath:y,command:b,className:S="",initialTodos:w,initialClaudeStatus:x,isActive:C,onTodosUpdated:k,onStatusChange:E},R){let T=(0,r.useRef)(null),D=(0,r.useRef)(null),L=(0,r.useRef)(null),A=(0,r.useRef)(null),P=(0,r.useRef)(e),[M,O]=(0,r.useState)(!1),B=(0,r.useRef)(!1),N=(0,r.useRef)(C),I=(0,r.useRef)("idle"),F=(0,r.useRef)(!1),z=(0,r.useRef)(!1),H=(0,r.useRef)(null),j=(0,r.useRef)(null),W=(0,r.useRef)(null),$=(0,r.useRef)(0),[U,q]=(0,r.useState)("idle"),[V,K]=(0,r.useState)(x??"idle"),Y=(0,r.useRef)(x??"idle"),[X,G]=(0,r.useState)(w??[]),[J,Z]=(0,r.useState)(!1),{effectiveTheme:Q}=(0,a.useTheme)(),ee=(0,r.useRef)(E);ee.current=E;let et="dark"===Q,ei=et?{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"}:{background:"#ffffff",foreground:"#1e1e1e",cursor:"#1e1e1e",selectionBackground:"#add6ff"};async function er(e){try{await fetch((0,_.apiUrl)(`/api/internal/tabs/${e}/interrupt`),{method:"POST"})}catch(e){console.warn("[TerminalView] Failed to notify interrupt:",e)}}function en(){let e=A.current,i=D.current,r=P.current;e&&e.connected&&i&&r&&e.emit("resize",{sessionId:r,cols:i.cols,rows:i.rows})}function es(e){e.write("\x1b[2J\x1b[3J\x1b[H")}async function eo(i,r,n){q("connecting");try{var s,a,l,c;let u,d,f=await fetch((0,_.apiUrl)("/api/terminal/sessions"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:h,env:v,worktreePath:y,sessionId:i,command:b}),signal:n});if(!f.ok){let e=await f.text().catch(()=>"");throw Error(`Failed to create session: ${f.status} ${e}`)}let p=await f.json();if(n.aborted)return;P.current=p.sessionId,p.reused||es(r),s=p.sessionId,a=p.reused,l=r,c=n,H.current?.dispose(),H.current=null,A.current&&(A.current.removeAllListeners(),A.current.disconnect()),A.current=u=(0,o.io)((0,_.getServerUrl)(),{transports:["polling","websocket"]}),d=!1,u.on("connect",()=>{let e=F.current;F.current=!0,e?l.writeln("\x1b[90mReconnected.\x1b[0m"):a?(z.current=!0,es(l)):l.writeln("\x1b[90mConnected.\x1b[0m"),q("connected"),$.current=0,u.emit("join",{room:`tab:${s}`,mode:"terminal"}),e&&N.current&&l.focus()}),u.on("output",({data:e})=>{a&&!d?(d=!0,l.write(e,()=>{z.current=!1,L.current?.fit();let e=D.current;if(e){let i=64===e.cols?63:64;e.resize(i,e.rows),en(),setTimeout(()=>{L.current?.fit(),en()},50)}l.scrollToBottom()})):l.write(e)}),u.on("exit",({exitCode:e})=>{console.log("[TerminalView] PTY exited with code:",e),q("exited"),P.current=null,A.current=null}),u.on("error",({message:e})=>{if(console.error("[TerminalView] Socket error message:",e),e.startsWith("Session not found")&&$.current<1){$.current+=1,ea();return}q("error")}),u.on("disconnect",()=>{c.aborted||q(e=>"exited"===e||"paused"===e||"idle"===e?e:"exited")}),u.on("status-changed",({status:e})=>{K(e)}),u.on("todos-updated",({todos:i})=>{G(i),k?.(e,i)}),u.on("editor:open",({sessionId:e,content:i})=>{window.dispatchEvent(new CustomEvent("editor-session-open-request",{detail:{sessionId:e,content:i}}))}),H.current=l.onData(e=>{"\x1b"===e&&("running"===Y.current||"waiting"===Y.current)&&P.current&&er(P.current),u.connected&&P.current&&u.emit("input",{sessionId:P.current,data:e})})}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;console.error("[TerminalView] connectSession error:",e instanceof Error?e.message:String(e)),q("error")}}async function ea(){let i=D.current;if(!i)return;let r=new AbortController;await eo(e,i,r.signal)}(0,r.useEffect)(()=>{ee.current?.(e,U,V)},[e,U,V]),(0,r.useLayoutEffect)(()=>{N.current=C}),(0,r.useLayoutEffect)(()=>{I.current=U}),(0,r.useLayoutEffect)(()=>{Y.current=V}),(0,r.useEffect)(()=>{C&&D.current?.focus()},[C]),(0,r.useEffect)(()=>{if(M)D.current?.blur();else if(C){let e=T.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}},[M,C]),(0,r.useEffect)(()=>{"connected"===U&&L.current&&(L.current.fit(),z.current||en())},[U]),(0,r.useEffect)(()=>{if(!T.current)return;let i=T.current,r=new n.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"Cascadia Code", "Fira Code", "Menlo", monospace',theme:ei,allowProposedApi:!0}),o=new s.FitAddon;r.loadAddon(o),r.open(T.current),o.fit(),D.current=r,L.current=o,N.current&&r.focus(),r.attachCustomKeyEventHandler(()=>!B.current),r.buffer.onBufferChange(e=>{"normal"===e.type&&r.refresh(0,r.rows-1)});let a=0,l=e=>{let i=performance.now();""===e.data&&i-a<100?e.stopImmediatePropagation():a=i};i.addEventListener("compositionend",l,!0);let c=null,h=0,u=e=>{if(1!==e.touches.length){c=null;return}c=e.touches[0].clientY,h=r.buffer.active.viewportY},d=e=>{if(null===c||1!==e.touches.length)return;let n=i.clientHeight/r.rows;if(n<=0)return;let s=(c-e.touches[0].clientY)/n;r.scrollToLine(Math.round(h+s))};i.addEventListener("touchstart",u,{passive:!0}),i.addEventListener("touchmove",d,{passive:!0});let f=new ResizeObserver(()=>{!B.current&&(o.fit(),z.current||en())});f.observe(T.current);let p=new AbortController;return eo(e,r,p.signal),()=>{p.abort(),f.disconnect(),i.removeEventListener("compositionend",l,!0),i.removeEventListener("touchstart",u),i.removeEventListener("touchmove",d),H.current?.dispose(),H.current=null,r.dispose(),D.current=null,L.current=null,A.current?.removeAllListeners(),A.current?.disconnect(),A.current=null}},[]),(0,r.useEffect)(()=>{D.current&&(D.current.options.theme=ei)},[et]),(0,r.useEffect)(()=>{function e(){B.current=!0,D.current?.blur()}function i(){if(setTimeout(()=>{let e=D.current;if(e){let i=64===e.cols?63:64;e.resize(i,e.rows),en(),setTimeout(()=>{B.current=!1,L.current?.fit(),en()},100)}else B.current=!1},300),!N.current)return;let e=T.current?.querySelector("textarea.xterm-helper-textarea");e?.focus()}return window.addEventListener("editor-session-open",e),window.addEventListener("editor-session-done",i),()=>{window.removeEventListener("editor-session-open",e),window.removeEventListener("editor-session-done",i)}},[]),(0,r.useEffect)(()=>{function e(e){let i=A.current;if(!i||!i.connected||j.current)return;j.current=setTimeout(()=>{j.current=null,W.current&&(i.off("health-check-ack",W.current),W.current=null),i.disconnect(),i.connect(),q("connecting")},6e3);let r=()=>{j.current&&(clearTimeout(j.current),j.current=null),W.current=null,e.refocus&&N.current&&D.current?.focus()};W.current=r,i.once("health-check-ack",r),i.emit("health-check")}function i(){"visible"===document.visibilityState&&e({refocus:!0})}let r=setInterval(()=>{"visible"!==document.visibilityState||"connected"===I.current&&e({refocus:!1})},8e3);return document.addEventListener("visibilitychange",i),()=>{document.removeEventListener("visibilitychange",i),clearInterval(r),j.current&&(clearTimeout(j.current),j.current=null),W.current&&(A.current?.off("health-check-ack",W.current),W.current=null)}},[]),(0,r.useImperativeHandle)(R,()=>({sendInput:e=>{let i=A.current,r=P.current;i?.connected&&r&&i.emit("input",{sessionId:r,data:e})},focus:()=>{D.current?.focus()}}));let el=(0,r.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{Z(!0),setTimeout(()=>Z(!1),2e3)})},[e]),ec="connecting"===U,eh="paused"===U||"exited"===U||"error"===U,eu="connected"===U,ed=X.filter(e=>"deleted"!==e.status),ef=ed.filter(e=>"completed"===e.status).length,ep=ed.length,eg=e.length>8?`${e.slice(0,8)}…`:e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:`flex flex-col h-full min-h-0 ${S}`,children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 border-b border-border flex-shrink-0 bg-card",children:[(0,i.jsx)("span",{className:"font-mono text-xs text-muted-foreground",title:e,children:eg}),(0,i.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:el,className:"text-muted-foreground hover:text-foreground",title:"Copy tab ID",children:J?(0,i.jsx)(d.Check,{className:"w-3 h-3 text-success"}):(0,i.jsx)(c.Copy,{className:"w-3 h-3"})}),(0,i.jsxs)(g.Button,{size:"xs",onClick:function(){let e=A.current,i=P.current;if(!e||!e.connected||!i)return;let r=`claude --dangerously-skip-permissions --resume ${i} 2>/dev/null || claude --dangerously-skip-permissions --session-id ${i}
|
|
32
|
-
`;e.emit("input",{sessionId:i,data:r})},disabled:!eu,title:"Run Claude",children:[(0,i.jsx)(u,{className:"w-3 h-3"}),"Run Claude"]}),(0,i.jsxs)(g.Button,{variant:"ghost",size:"xs",onClick:()=>O(!0),disabled:!eu,className:"text-muted-foreground hover:text-foreground",title:"Open editor input",children:[(0,i.jsx)(f,{className:"w-3 h-3"}),"Open Editor"]}),ep>0&&(0,i.jsxs)("div",{className:"ml-auto flex items-center gap-1.5 shrink-0",title:X.find(e=>"in_progress"===e.status)?.content??"",children:[(0,i.jsx)(m.Progress,{value:ef,max:ep,className:"w-16 gap-0 [&_[data-slot=progress-track]]:h-[3px]"}),(0,i.jsxs)("span",{className:"text-[10px] text-muted-foreground tabular-nums",children:[ef,"/",ep]})]})]}),(0,i.jsxs)("div",{className:"relative flex-1 min-h-0 overflow-hidden",children:[(0,i.jsx)("div",{ref:T,className:"w-full h-full",style:{padding:"4px"}}),ec&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background",children:(0,i.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-xs",children:[(0,i.jsx)(l.Loader2,{className:"w-4 h-4 animate-spin"}),(0,i.jsx)("span",{children:"Connecting..."})]})}),eh&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/90",children:(0,i.jsxs)("div",{className:"text-center space-y-2",children:["error"===U&&(0,i.jsx)("p",{className:"text-xs text-destructive",children:"Connection failed"}),"exited"===U&&(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:"Session ended"}),"paused"===U&&(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:"Paused"}),(0,i.jsx)(g.Button,{size:"xs",onClick:ea,children:"Reconnect"})]})})]})]}),(0,i.jsx)(p.MonacoEditorModal,{open:M,onOpenChange:e=>{e.open||O(!1)},onSubmit:e=>{D.current&&e&&D.current.paste(e),O(!1)},title:"Terminal Input",submitLabel:"Paste"})]})});e.s(["TerminalView",0,v],67211)},2576,e=>{"use strict";var i=e.i(71645),r=e.i(96085),n=e.i(70935);e.s(["useTaskEvents",0,function(e){let s=(0,i.useRef)(null),o=(0,i.useRef)(e);(0,i.useLayoutEffect)(()=>{o.current=e}),(0,i.useEffect)(()=>{let e=(0,r.io)((0,n.getServerUrl)(),{transports:["polling","websocket"]});return s.current=e,e.on("task:created",({task:e})=>{o.current.onTaskCreated(e)}),e.on("task:updated",({task:e})=>{o.current.onTaskUpdated(e)}),e.on("task:deleted",({taskId:e})=>{o.current.onTaskDeleted(e)}),()=>{e.disconnect(),s.current=null}},[])}])}]);
|