zen-gitsync 2.1.8 → 2.1.9
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/package.json +1 -1
- package/src/ui/public/assets/index-2zWLRJg9.css +1 -0
- package/src/ui/public/assets/index-BKaSsEOq.js +22 -0
- package/src/ui/public/assets/{vendor-Bm8yNvvz.js → vendor-lzd7uK7e.js} +1 -1
- package/src/ui/public/index.html +3 -3
- package/src/ui/server/index.js +17 -0
- package/src/ui/public/assets/index-B7Bmz9T9.js +0 -22
- package/src/ui/public/assets/index-DNVXEFTm.css +0 -1
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
* @return {boolean} True if the event is supported.
|
|
43
43
|
* @internal
|
|
44
44
|
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
45
|
-
*/const KP=function(e,t){if(e&&e.addEventListener){const n=function(r){const s=WP(r);t&&Reflect.apply(t,this,[r,s])};e.addEventListener("wheel",n,{passive:!0})}},UP={beforeMount(e,t){KP(e,t.value)}};let qP=1;const YP=se({name:"ElTable",directives:{Mousewheel:UP},components:{TableHeader:CP,TableBody:MP,TableFooter:$P,ElScrollbar:Ll,hColgroup:rb},props:BP,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change","scroll"],setup(e){const{t}=It(),n=Re("table"),r=st();St(Yn,r);const s=fP(r,e);r.store=s;const o=new pP({store:r.store,table:r,fit:e.fit,showHeader:e.showHeader});r.layout=o;const a=O(()=>(s.states.data.value||[]).length===0),{setCurrentRow:i,getSelectionRows:l,toggleRowSelection:c,clearSelection:u,clearFilter:f,toggleAllSelection:h,toggleRowExpansion:m,clearSort:p,sort:v,updateKeyChildren:b}=LP(s),{isHidden:_,renderExpanded:k,setDragVisible:w,isGroup:g,handleMouseLeave:y,handleHeaderFooterMousewheel:C,tableSize:S,emptyBlockStyle:P,handleFixedMousewheel:x,resizeProxyVisible:D,bodyWidth:A,resizeState:M,doLayout:W,tableBodyStyles:j,tableLayout:L,scrollbarViewStyle:$,scrollbarStyle:F}=IP(e,o,s,r),{scrollBarRef:E,scrollTo:T,setScrollLeft:H,setScrollTop:Y}=DP(),K=qr(W,50),X=`${n.namespace.value}-table_${qP++}`;r.tableId=X,r.state={isGroup:g,resizeState:M,doLayout:W,debouncedUpdateLayout:K};const G=O(()=>{var le;return(le=e.sumText)!=null?le:t("el.table.sumText")}),oe=O(()=>{var le;return(le=e.emptyText)!=null?le:t("el.table.emptyText")}),ge=O(()=>nb(s.states.originColumns.value)[0]);return NP(r),Lt(()=>{K.cancel()}),{ns:n,layout:o,store:s,columns:ge,handleHeaderFooterMousewheel:C,handleMouseLeave:y,tableId:X,tableSize:S,isHidden:_,isEmpty:a,renderExpanded:k,resizeProxyVisible:D,resizeState:M,isGroup:g,bodyWidth:A,tableBodyStyles:j,emptyBlockStyle:P,debouncedUpdateLayout:K,handleFixedMousewheel:x,setCurrentRow:i,getSelectionRows:l,toggleRowSelection:c,clearSelection:u,clearFilter:f,toggleAllSelection:h,toggleRowExpansion:m,clearSort:p,doLayout:W,sort:v,updateKeyChildren:b,t,setDragVisible:w,context:r,computedSumText:G,computedEmptyText:oe,tableLayout:L,scrollbarViewStyle:$,scrollbarStyle:F,scrollBarRef:E,scrollTo:T,setScrollLeft:H,setScrollTop:Y,allowDragLastColumn:e.allowDragLastColumn}}});function GP(e,t,n,r,s,o){const a=wt("hColgroup"),i=wt("table-header"),l=wt("table-body"),c=wt("table-footer"),u=wt("el-scrollbar"),f=Gc("mousewheel");return R(),q("div",{ref:"tableWrapper",class:I([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:Ze(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:e.handleMouseLeave},[U("div",{class:I(e.ns.e("inner-wrapper"))},[U("div",{ref:"hiddenColumns",class:"hidden-columns"},[me(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?rt((R(),q("div",{key:0,ref:"headerWrapper",class:I(e.ns.e("header-wrapper"))},[U("table",{ref:"tableHeader",class:I(e.ns.e("header")),style:Ze(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),re(i,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,"allow-drag-last-column":e.allowDragLastColumn,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","append-filter-panel-to","allow-drag-last-column","onSetDragVisible"])],6)],2)),[[f,e.handleHeaderFooterMousewheel]]):fe("v-if",!0),U("div",{ref:"bodyWrapper",class:I(e.ns.e("body-wrapper"))},[re(u,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn,tabindex:e.scrollbarTabindex,onScroll:h=>e.$emit("scroll",h)},{default:ie(()=>[U("table",{ref:"tableBody",class:I(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:Ze({width:e.bodyWidth,tableLayout:e.tableLayout})},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(R(),ye(i,{key:0,ref:"tableHeaderRef",class:I(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort","store","append-filter-panel-to","onSetDragVisible"])):fe("v-if",!0),re(l,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"tooltip-options":e.tooltipOptions,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),e.showSummary&&e.tableLayout==="auto"?(R(),ye(c,{key:1,class:I(e.ns.e("body-footer")),border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):fe("v-if",!0)],6),e.isEmpty?(R(),q("div",{key:0,ref:"emptyBlock",style:Ze(e.emptyBlockStyle),class:I(e.ns.e("empty-block"))},[U("span",{class:I(e.ns.e("empty-text"))},[me(e.$slots,"empty",{},()=>[_t(Me(e.computedEmptyText),1)])],2)],6)):fe("v-if",!0),e.$slots.append?(R(),q("div",{key:1,ref:"appendWrapper",class:I(e.ns.e("append-wrapper"))},[me(e.$slots,"append")],2)):fe("v-if",!0)]),_:3},8,["view-style","wrap-style","always","tabindex","onScroll"])],2),e.showSummary&&e.tableLayout==="fixed"?rt((R(),q("div",{key:1,ref:"footerWrapper",class:I(e.ns.e("footer-wrapper"))},[U("table",{class:I(e.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:Ze(e.tableBodyStyles)},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),re(c,{border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[Tt,!e.isEmpty],[f,e.handleHeaderFooterMousewheel]]):fe("v-if",!0),e.border||e.isGroup?(R(),q("div",{key:2,class:I(e.ns.e("border-left-patch"))},null,2)):fe("v-if",!0)],2),rt(U("div",{ref:"resizeProxy",class:I(e.ns.e("column-resize-proxy"))},null,2),[[Tt,e.resizeProxyVisible]])],46,["data-prefix","onMouseleave"])}var XP=We(YP,[["render",GP],["__file","table.vue"]]);const JP={selection:"table-column--selection",expand:"table__expand-column"},ZP={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},QP=e=>JP[e]||"",e6={selection:{renderHeader({store:e,column:t}){function n(){return e.states.data.value&&e.states.data.value.length===0}return Ye(so,{disabled:n(),size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value,ariaLabel:t.label})},renderCell({row:e,column:t,store:n,$index:r}){return Ye(so,{disabled:t.selectable?!t.selectable.call(null,e,r):!1,size:n.states.tableSize.value,onChange:()=>{n.commit("rowSelectedChanged",e)},onClick:s=>s.stopPropagation(),modelValue:n.isSelected(e),ariaLabel:t.label})},sortable:!1,resizable:!1},index:{renderHeader({column:e}){return e.label||"#"},renderCell({column:e,$index:t}){let n=t+1;const r=e.index;return Xe(r)?n=t+r:ke(r)&&(n=r(t)),Ye("div",{},[n])},sortable:!1},expand:{renderHeader({column:e}){return e.label||""},renderCell({row:e,store:t,expanded:n}){const{ns:r}=t,s=[r.e("expand-icon")];return n&&s.push(r.em("expand-icon","expanded")),Ye("div",{class:s,onClick:function(a){a.stopPropagation(),t.toggleRowExpansion(e)}},{default:()=>[Ye(je,null,{default:()=>[Ye(Ks)]})]})},sortable:!1,resizable:!1}};function t6({row:e,column:t,$index:n}){var r;const s=t.property,o=s&&zo(e,s).value;return t&&t.formatter?t.formatter(e,t,o,n):((r=o==null?void 0:o.toString)==null?void 0:r.call(o))||""}function n6({row:e,treeNode:t,store:n},r=!1){const{ns:s}=n;if(!t)return r?[Ye("span",{class:s.e("placeholder")})]:null;const o=[],a=function(i){i.stopPropagation(),!t.loading&&n.loadOrToggle(e)};if(t.indent&&o.push(Ye("span",{class:s.e("indent"),style:{"padding-left":`${t.indent}px`}})),xt(t.expanded)&&!t.noLazyChildren){const i=[s.e("expand-icon"),t.expanded?s.em("expand-icon","expanded"):""];let l=Ks;t.loading&&(l=Js),o.push(Ye("div",{class:i,onClick:a},{default:()=>[Ye(je,{class:{[s.is("loading")]:t.loading}},{default:()=>[Ye(l)]})]}))}else o.push(Ye("span",{class:s.e("placeholder")}));return o}function zp(e,t){return e.reduce((n,r)=>(n[r]=r,n),t)}function r6(e,t){const n=st();return{registerComplexWatchers:()=>{const o=["fixed"],a={realWidth:"width",realMinWidth:"minWidth"},i=zp(o,a);Object.keys(i).forEach(l=>{const c=a[l];et(t,c)&&Ee(()=>t[c],u=>{let f=u;c==="width"&&l==="realWidth"&&(f=Wd(u)),c==="minWidth"&&l==="realMinWidth"&&(f=X0(u)),n.columnConfig.value[c]=f,n.columnConfig.value[l]=f;const h=c==="fixed";e.value.store.scheduleLayout(h)})})},registerNormalWatchers:()=>{const o=["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip","tooltipFormatter"],a={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},i=zp(o,a);Object.keys(i).forEach(l=>{const c=a[l];et(t,c)&&Ee(()=>t[c],u=>{n.columnConfig.value[l]=u})})}}}function s6(e,t,n){const r=st(),s=V(""),o=V(!1),a=V(),i=V(),l=Re("table");Kr(()=>{a.value=e.align?`is-${e.align}`:null,a.value}),Kr(()=>{i.value=e.headerAlign?`is-${e.headerAlign}`:a.value,i.value});const c=O(()=>{let g=r.vnode.vParent||r.parent;for(;g&&!g.tableId&&!g.columnId;)g=g.vnode.vParent||g.parent;return g}),u=O(()=>{const{store:g}=r.parent;if(!g)return!1;const{treeData:y}=g.states,C=y.value;return C&&Object.keys(C).length>0}),f=V(Wd(e.width)),h=V(X0(e.minWidth)),m=g=>(f.value&&(g.width=f.value),h.value&&(g.minWidth=h.value),!f.value&&h.value&&(g.width=void 0),g.minWidth||(g.minWidth=80),g.realWidth=Number(Ct(g.width)?g.minWidth:g.width),g),p=g=>{const y=g.type,C=e6[y]||{};Object.keys(C).forEach(P=>{const x=C[P];P!=="className"&&!Ct(x)&&(g[P]=x)});const S=QP(y);if(S){const P=`${d(l.namespace)}-${S}`;g.className=g.className?`${g.className} ${P}`:P}return g},v=g=>{pe(g)?g.forEach(C=>y(C)):y(g);function y(C){var S;((S=C==null?void 0:C.type)==null?void 0:S.name)==="ElTableColumn"&&(C.vParent=r)}};return{columnId:s,realAlign:a,isSubColumn:o,realHeaderAlign:i,columnOrTableParent:c,setColumnWidth:m,setColumnForcedProps:p,setColumnRenders:g=>{e.renderHeader||g.type!=="selection"&&(g.renderHeader=C=>(r.columnConfig.value.label,me(t,"header",C,()=>[g.label]))),t["filter-icon"]&&(g.renderFilterIcon=C=>me(t,"filter-icon",C));let y=g.renderCell;return g.type==="expand"?(g.renderCell=C=>Ye("div",{class:"cell"},[y(C)]),n.value.renderExpanded=C=>t.default?t.default(C):t.default):(y=y||t6,g.renderCell=C=>{let S=null;if(t.default){const W=t.default(C);S=W.some(j=>j.type!==jt)?W:y(C)}else S=y(C);const{columns:P}=n.value.store.states,x=P.value.findIndex(W=>W.type==="default"),D=u.value&&C.cellIndex===x,A=n6(C,D),M={class:"cell",style:{}};return g.showOverflowTooltip&&(M.class=`${M.class} ${d(l.namespace)}-tooltip`,M.style={width:`${(C.column.realWidth||Number(C.column.width))-1}px`}),v(S),Ye("div",M,[A,S])}),g},getPropsData:(...g)=>g.reduce((y,C)=>(pe(C)&&C.forEach(S=>{y[S]=e[S]}),y),{}),getColumnElIndex:(g,y)=>Array.prototype.indexOf.call(g,y),updateColumnOrder:()=>{n.value.store.commit("updateColumnOrder",r.columnConfig.value)}}}var o6={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},tooltipFormatter:Function,fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every(t=>["ascending","descending",null].includes(t))}};let a6=1;var db=se({name:"ElTableColumn",components:{ElCheckbox:so},props:o6,setup(e,{slots:t}){const n=st(),r=V({}),s=O(()=>{let w=n.parent;for(;w&&!w.tableId;)w=w.parent;return w}),{registerNormalWatchers:o,registerComplexWatchers:a}=r6(s,e),{columnId:i,isSubColumn:l,realHeaderAlign:c,columnOrTableParent:u,setColumnWidth:f,setColumnForcedProps:h,setColumnRenders:m,getPropsData:p,getColumnElIndex:v,realAlign:b,updateColumnOrder:_}=s6(e,t,s),k=u.value;i.value=`${k.tableId||k.columnId}_column_${a6++}`,ml(()=>{l.value=s.value!==k;const w=e.type||"default",g=e.sortable===""?!0:e.sortable,y=w==="selection"?!1:Ct(e.showOverflowTooltip)?k.props.showOverflowTooltip:e.showOverflowTooltip,C=Ct(e.tooltipFormatter)?k.props.tooltipFormatter:e.tooltipFormatter,S={...ZP[w],id:i.value,type:w,property:e.prop||e.property,align:b,headerAlign:c,showOverflowTooltip:y,tooltipFormatter:C,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:g,index:e.index,rawColumnKey:n.vnode.key};let M=p(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"]);M=eP(S,M),M=nP(m,f,h)(M),r.value=M,o(),a()}),dt(()=>{var w;const g=u.value,y=l.value?g.vnode.el.children:(w=g.refs.hiddenColumns)==null?void 0:w.children,C=()=>v(y||[],n.vnode.el);r.value.getColumnIndex=C,C()>-1&&s.value.store.commit("insertColumn",r.value,l.value?g.columnConfig.value:null,_)}),Lt(()=>{const w=r.value.getColumnIndex;(w?w():-1)>-1&&s.value.store.commit("removeColumn",r.value,l.value?k.columnConfig.value:null,_)}),n.columnId=i.value,n.columnConfig=r},render(){var e,t,n;try{const r=(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{},column:{},$index:-1}),s=[];if(pe(r))for(const a of r)((n=a.type)==null?void 0:n.name)==="ElTableColumn"||a.shapeFlag&2?s.push(a):a.type===Ke&&pe(a.children)&&a.children.forEach(i=>{(i==null?void 0:i.patchFlag)!==1024&&!Be(i==null?void 0:i.children)&&s.push(i)});return Ye("div",s)}catch{return Ye("div",[])}}});const _$=Ot(XP,{TableColumn:db}),C$=Os(db);function i6(e){let t;const n=V(!1),r=$t({...e,originalPosition:"",originalOverflow:"",visible:!1});function s(h){r.text=h}function o(){const h=r.parent,m=f.ns;if(!h.vLoadingAddClassList){let p=h.getAttribute("loading-number");p=Number.parseInt(p)-1,p?h.setAttribute("loading-number",p.toString()):(ir(h,m.bm("parent","relative")),h.removeAttribute("loading-number")),ir(h,m.bm("parent","hidden"))}a(),u.unmount()}function a(){var h,m;(m=(h=f.$el)==null?void 0:h.parentNode)==null||m.removeChild(f.$el)}function i(){var h;e.beforeClose&&!e.beforeClose()||(n.value=!0,clearTimeout(t),t=setTimeout(l,400),r.visible=!1,(h=e.closed)==null||h.call(e))}function l(){if(!n.value)return;const h=r.parent;n.value=!1,h.vLoadingAddClassList=void 0,o()}const u=cw(se({name:"ElLoading",setup(h,{expose:m}){const{ns:p,zIndex:v}=yd("loading");return m({ns:p,zIndex:v}),()=>{const b=r.spinner||r.svg,_=Ye("svg",{class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[Ye("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),k=r.text?Ye("p",{class:p.b("text")},[r.text]):void 0;return Ye(fr,{name:p.b("fade"),onAfterLeave:l},{default:ie(()=>[rt(re("div",{style:{backgroundColor:r.background||""},class:[p.b("mask"),r.customClass,r.fullscreen?"is-fullscreen":""]},[Ye("div",{class:p.b("spinner")},[_,k])]),[[Tt,r.visible]])])})}}})),f=u.mount(document.createElement("div"));return{...gn(r),setText:s,removeElLoadingChild:a,close:i,handleAfterLeave:l,vm:f,get $el(){return f.$el}}}let Xa;const l6=function(e={}){if(!ct)return;const t=u6(e);if(t.fullscreen&&Xa)return Xa;const n=i6({...t,closed:()=>{var s;(s=t.closed)==null||s.call(t),t.fullscreen&&(Xa=void 0)}});c6(t,t.parent,n),jp(t,t.parent,n),t.parent.vLoadingAddClassList=()=>jp(t,t.parent,n);let r=t.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",t.parent.setAttribute("loading-number",r),t.parent.appendChild(n.$el),Fe(()=>n.visible.value=t.visible),t.fullscreen&&(Xa=n),n},u6=e=>{var t,n,r,s;let o;return Be(e.target)?o=(t=document.querySelector(e.target))!=null?t:document.body:o=e.target||document.body,{parent:o===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(r=e.lock)!=null?r:!1,customClass:e.customClass||"",visible:(s=e.visible)!=null?s:!0,beforeClose:e.beforeClose,closed:e.closed,target:o}},c6=async(e,t,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,s={};if(e.fullscreen)n.originalPosition.value=as(document.body,"position"),n.originalOverflow.value=as(document.body,"overflow"),s.zIndex=r();else if(e.parent===document.body){n.originalPosition.value=as(document.body,"position"),await Fe();for(const o of["top","left"]){const a=o==="top"?"scrollTop":"scrollLeft";s[o]=`${e.target.getBoundingClientRect()[o]+document.body[a]+document.documentElement[a]-Number.parseInt(as(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])s[o]=`${e.target.getBoundingClientRect()[o]}px`}else n.originalPosition.value=as(t,"position");for(const[o,a]of Object.entries(s))n.$el.style[o]=a},jp=(e,t,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?ir(t,r.bm("parent","relative")):ys(t,r.bm("parent","relative")),e.fullscreen&&e.lock?ys(t,r.bm("parent","hidden")):ir(t,r.bm("parent","hidden"))},Mi=Symbol("ElLoading"),Wp=(e,t)=>{var n,r,s,o;const a=t.instance,i=h=>Ue(t.value)?t.value[h]:void 0,l=h=>{const m=Be(h)&&(a==null?void 0:a[h])||h;return m&&V(m)},c=h=>l(i(h)||e.getAttribute(`element-loading-${kr(h)}`)),u=(n=i("fullscreen"))!=null?n:t.modifiers.fullscreen,f={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:u,target:(r=i("target"))!=null?r:u?void 0:e,body:(s=i("body"))!=null?s:t.modifiers.body,lock:(o=i("lock"))!=null?o:t.modifiers.lock};e[Mi]={options:f,instance:l6(f)}},d6=(e,t)=>{for(const n of Object.keys(t))ft(t[n])&&(t[n].value=e[n])},S$={mounted(e,t){t.value&&Wp(e,t)},updated(e,t){const n=e[Mi];t.oldValue!==t.value&&(t.value&&!t.oldValue?Wp(e,t):t.value&&t.oldValue?Ue(t.value)&&d6(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[Mi])==null||t.instance.close(),e[Mi]=null}},fb=["success","info","warning","error"],Jt=Ug({customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:ct?document.body:void 0}),f6=De({customClass:{type:String,default:Jt.customClass},dangerouslyUseHTMLString:{type:Boolean,default:Jt.dangerouslyUseHTMLString},duration:{type:Number,default:Jt.duration},icon:{type:Cn,default:Jt.icon},id:{type:String,default:Jt.id},message:{type:_e([String,Object,Function]),default:Jt.message},onClose:{type:_e(Function),default:Jt.onClose},showClose:{type:Boolean,default:Jt.showClose},type:{type:String,values:fb,default:Jt.type},plain:{type:Boolean,default:Jt.plain},offset:{type:Number,default:Jt.offset},zIndex:{type:Number,default:Jt.zIndex},grouping:{type:Boolean,default:Jt.grouping},repeatNum:{type:Number,default:Jt.repeatNum}}),h6={destroy:()=>!0},Dn=Dv([]),p6=e=>{const t=Dn.findIndex(s=>s.id===e),n=Dn[t];let r;return t>0&&(r=Dn[t-1]),{current:n,prev:r}},v6=e=>{const{prev:t}=p6(e);return t?t.vm.exposed.bottom.value:0},m6=(e,t)=>Dn.findIndex(r=>r.id===e)>0?16:t,g6=se({name:"ElMessage"}),b6=se({...g6,props:f6,emits:h6,setup(e,{expose:t,emit:n}){const r=e,{Close:s}=_d,o=V(!1),{ns:a,zIndex:i}=yd("message"),{currentZIndex:l,nextZIndex:c}=i,u=V(),f=V(!1),h=V(0);let m;const p=O(()=>r.type?r.type==="error"?"danger":r.type:"info"),v=O(()=>{const x=r.type;return{[a.bm("icon",x)]:x&&Zs[x]}}),b=O(()=>r.icon||Zs[r.type]||""),_=O(()=>v6(r.id)),k=O(()=>m6(r.id,r.offset)+_.value),w=O(()=>h.value+k.value),g=O(()=>({top:`${k.value}px`,zIndex:l.value}));function y(){r.duration!==0&&({stop:m}=Yu(()=>{S()},r.duration))}function C(){m==null||m()}function S(){f.value=!1,Fe(()=>{var x;o.value||((x=r.onClose)==null||x.call(r),n("destroy"))})}function P({code:x}){x===it.esc&&S()}return dt(()=>{y(),c(),f.value=!0}),Ee(()=>r.repeatNum,()=>{C(),y()}),Gt(document,"keydown",P),fn(u,()=>{h.value=u.value.getBoundingClientRect().height}),t({visible:f,bottom:w,close:S}),(x,D)=>(R(),ye(fr,{name:d(a).b("fade"),onBeforeEnter:A=>o.value=!0,onBeforeLeave:x.onClose,onAfterLeave:A=>x.$emit("destroy"),persisted:""},{default:ie(()=>[rt(U("div",{id:x.id,ref_key:"messageRef",ref:u,class:I([d(a).b(),{[d(a).m(x.type)]:x.type},d(a).is("closable",x.showClose),d(a).is("plain",x.plain),x.customClass]),style:Ze(d(g)),role:"alert",onMouseenter:C,onMouseleave:y},[x.repeatNum>1?(R(),ye(d(h3),{key:0,value:x.repeatNum,type:d(p),class:I(d(a).e("badge"))},null,8,["value","type","class"])):fe("v-if",!0),d(b)?(R(),ye(d(je),{key:1,class:I([d(a).e("icon"),d(v)])},{default:ie(()=>[(R(),ye(ut(d(b))))]),_:1},8,["class"])):fe("v-if",!0),me(x.$slots,"default",{},()=>[x.dangerouslyUseHTMLString?(R(),q(Ke,{key:1},[fe(" Caution here, message could've been compromised, never use user's input as message "),U("p",{class:I(d(a).e("content")),innerHTML:x.message},null,10,["innerHTML"])],2112)):(R(),q("p",{key:0,class:I(d(a).e("content"))},Me(x.message),3))]),x.showClose?(R(),ye(d(je),{key:2,class:I(d(a).e("closeBtn")),onClick:tt(S,["stop"])},{default:ie(()=>[re(d(s))]),_:1},8,["class","onClick"])):fe("v-if",!0)],46,["id"]),[[Tt,f.value]])]),_:3},8,["name","onBeforeEnter","onBeforeLeave","onAfterLeave"]))}});var y6=We(b6,[["__file","message.vue"]]);let w6=1;const hb=e=>{const t=!e||Be(e)||jn(e)||ke(e)?{message:e}:e,n={...Jt,...t};if(!n.appendTo)n.appendTo=document.body;else if(Be(n.appendTo)){let r=document.querySelector(n.appendTo);En(r)||(r=document.body),n.appendTo=r}return xt(er.grouping)&&!n.grouping&&(n.grouping=er.grouping),Xe(er.duration)&&n.duration===3e3&&(n.duration=er.duration),Xe(er.offset)&&n.offset===16&&(n.offset=er.offset),xt(er.showClose)&&!n.showClose&&(n.showClose=er.showClose),n},_6=e=>{const t=Dn.indexOf(e);if(t===-1)return;Dn.splice(t,1);const{handler:n}=e;n.close()},C6=({appendTo:e,...t},n)=>{const r=`message_${w6++}`,s=t.onClose,o=document.createElement("div"),a={...t,id:r,onClose:()=>{s==null||s(),_6(u)},onDestroy:()=>{Gs(null,o)}},i=re(y6,a,ke(a.message)||jn(a.message)?{default:ke(a.message)?a.message:()=>a.message}:null);i.appContext=n||lo._context,Gs(i,o),e.appendChild(o.firstElementChild);const l=i.component,u={id:r,vnode:i,vm:l,handler:{close:()=>{l.exposed.close()}},props:i.component.props};return u},lo=(e={},t)=>{if(!ct)return{close:()=>{}};const n=hb(e);if(n.grouping&&Dn.length){const s=Dn.find(({vnode:o})=>{var a;return((a=o.props)==null?void 0:a.message)===n.message});if(s)return s.props.repeatNum+=1,s.props.type=n.type,s.handler}if(Xe(er.max)&&Dn.length>=er.max)return{close:()=>{}};const r=C6(n,t);return Dn.push(r),r.handler};fb.forEach(e=>{lo[e]=(t={},n)=>{const r=hb(t);return lo({...r,type:e},n)}});function S6(e){const t=[...Dn];for(const n of t)(!e||e===n.props.type)&&n.handler.close()}lo.closeAll=S6;lo._context=null;const E$=vk(lo,"$message"),Ec="_trap-focus-children",cs=[],Kp=e=>{if(cs.length===0)return;const t=cs[cs.length-1][Ec];if(t.length>0&&e.code===it.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const n=e.shiftKey,r=e.target===t[0],s=e.target===t[t.length-1];r&&n&&(e.preventDefault(),t[t.length-1].focus()),s&&!n&&(e.preventDefault(),t[0].focus())}},E6={beforeMount(e){e[Ec]=Hh(e),cs.push(e),cs.length<=1&&document.addEventListener("keydown",Kp)},updated(e){Fe(()=>{e[Ec]=Hh(e)})},unmounted(){cs.shift(),cs.length===0&&document.removeEventListener("keydown",Kp)}},k6=se({name:"ElMessageBox",directives:{TrapFocus:E6},components:{ElButton:ca,ElFocusTrap:Td,ElInput:Cr,ElOverlay:B0,ElIcon:je,..._d},inheritAttrs:!1,props:{buttonSize:{type:String,validator:q0},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:r,ns:s,size:o}=yd("message-box",O(()=>e.buttonSize)),{t:a}=n,{nextZIndex:i}=r,l=V(!1),c=$t({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:qs(Js),cancelButtonLoadingIcon:qs(Js),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:i()}),u=O(()=>{const $=c.type;return{[s.bm("icon",$)]:$&&Zs[$]}}),f=lr(),h=lr(),m=O(()=>{const $=c.type;return c.icon||$&&Zs[$]||""}),p=O(()=>!!c.message),v=V(),b=V(),_=V(),k=V(),w=V(),g=O(()=>c.confirmButtonClass);Ee(()=>c.inputValue,async $=>{await Fe(),e.boxType==="prompt"&&$&&M()},{immediate:!0}),Ee(()=>l.value,$=>{var F,E;$&&(e.boxType!=="prompt"&&(c.autofocus?_.value=(E=(F=w.value)==null?void 0:F.$el)!=null?E:v.value:_.value=v.value),c.zIndex=i()),e.boxType==="prompt"&&($?Fe().then(()=>{var T;k.value&&k.value.$el&&(c.autofocus?_.value=(T=W())!=null?T:v.value:_.value=v.value)}):(c.editorErrorMessage="",c.validateError=!1))});const y=O(()=>e.draggable),C=O(()=>e.overflow);V0(v,b,y,C),dt(async()=>{await Fe(),e.closeOnHashChange&&window.addEventListener("hashchange",S)}),Lt(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",S)});function S(){l.value&&(l.value=!1,Fe(()=>{c.action&&t("action",c.action)}))}const P=()=>{e.closeOnClickModal&&A(c.distinguishCancelAndClose?"close":"cancel")},x=zd(P),D=$=>{if(c.inputType!=="textarea")return $.preventDefault(),A("confirm")},A=$=>{var F;e.boxType==="prompt"&&$==="confirm"&&!M()||(c.action=$,c.beforeClose?(F=c.beforeClose)==null||F.call(c,$,c,S):S())},M=()=>{if(e.boxType==="prompt"){const $=c.inputPattern;if($&&!$.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||a("el.messagebox.error"),c.validateError=!0,!1;const F=c.inputValidator;if(ke(F)){const E=F(c.inputValue);if(E===!1)return c.editorErrorMessage=c.inputErrorMessage||a("el.messagebox.error"),c.validateError=!0,!1;if(Be(E))return c.editorErrorMessage=E,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},W=()=>{var $,F;const E=($=k.value)==null?void 0:$.$refs;return(F=E==null?void 0:E.input)!=null?F:E==null?void 0:E.textarea},j=()=>{A("close")},L=()=>{e.closeOnPressEscape&&j()};return e.lockScroll&&H0(l),{...gn(c),ns:s,overlayEvent:x,visible:l,hasMessage:p,typeClass:u,contentId:f,inputId:h,btnSize:o,iconComponent:m,confirmButtonClasses:g,rootRef:v,focusStartRef:_,headerRef:b,inputRef:k,confirmRef:w,doClose:S,handleClose:j,onCloseRequested:L,handleWrapperClick:P,handleInputEnter:D,handleAction:A,t:a}}});function O6(e,t,n,r,s,o){const a=wt("el-icon"),i=wt("el-input"),l=wt("el-button"),c=wt("el-focus-trap"),u=wt("el-overlay");return R(),ye(fr,{name:"fade-in-linear",onAfterLeave:f=>e.$emit("vanish"),persisted:""},{default:ie(()=>[rt(re(u,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:ie(()=>[U("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:I(`${e.ns.namespace.value}-overlay-message-box`),onClick:e.overlayEvent.onClick,onMousedown:e.overlayEvent.onMousedown,onMouseup:e.overlayEvent.onMouseup},[re(c,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:ie(()=>[U("div",{ref:"rootRef",class:I([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:Ze(e.customStyle),tabindex:"-1",onClick:tt(()=>{},["stop"])},[e.title!==null&&e.title!==void 0?(R(),q("div",{key:0,ref:"headerRef",class:I([e.ns.e("header"),{"show-close":e.showClose}])},[U("div",{class:I(e.ns.e("title"))},[e.iconComponent&&e.center?(R(),ye(a,{key:0,class:I([e.ns.e("status"),e.typeClass])},{default:ie(()=>[(R(),ye(ut(e.iconComponent)))]),_:1},8,["class"])):fe("v-if",!0),U("span",null,Me(e.title),1)],2),e.showClose?(R(),q("button",{key:0,type:"button",class:I(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:Pt(tt(f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[re(a,{class:I(e.ns.e("close"))},{default:ie(()=>[(R(),ye(ut(e.closeIcon||"close")))]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):fe("v-if",!0)],2)):fe("v-if",!0),U("div",{id:e.contentId,class:I(e.ns.e("content"))},[U("div",{class:I(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(R(),ye(a,{key:0,class:I([e.ns.e("status"),e.typeClass])},{default:ie(()=>[(R(),ye(ut(e.iconComponent)))]),_:1},8,["class"])):fe("v-if",!0),e.hasMessage?(R(),q("div",{key:1,class:I(e.ns.e("message"))},[me(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(R(),ye(ut(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(R(),ye(ut(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:ie(()=>[_t(Me(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):fe("v-if",!0)],2),rt(U("div",{class:I(e.ns.e("input"))},[re(i,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":f=>e.inputValue=f,type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:I({invalid:e.validateError}),onKeydown:Pt(e.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),U("div",{class:I(e.ns.e("errormsg")),style:Ze({visibility:e.editorErrorMessage?"visible":"hidden"})},Me(e.editorErrorMessage),7)],2),[[Tt,e.showInput]])],10,["id"]),U("div",{class:I(e.ns.e("btns"))},[e.showCancelButton?(R(),ye(l,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:I([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:f=>e.handleAction("cancel"),onKeydown:Pt(tt(f=>e.handleAction("cancel"),["prevent"]),["enter"])},{default:ie(()=>[_t(Me(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):fe("v-if",!0),rt(re(l,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:I([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:f=>e.handleAction("confirm"),onKeydown:Pt(tt(f=>e.handleAction("confirm"),["prevent"]),["enter"])},{default:ie(()=>[_t(Me(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[Tt,e.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[Tt,e.visible]])]),_:3},8,["onAfterLeave"])}var T6=We(k6,[["render",O6],["__file","index.vue"]]);const pa=new Map,x6=e=>{let t=document.body;return e.appendTo&&(Be(e.appendTo)&&(t=document.querySelector(e.appendTo)),En(e.appendTo)&&(t=e.appendTo),En(t)||(t=document.body)),t},A6=(e,t,n=null)=>{const r=re(T6,e,ke(e.message)||jn(e.message)?{default:ke(e.message)?e.message:()=>e.message}:null);return r.appContext=n,Gs(r,t),x6(e).appendChild(t.firstElementChild),r.component},M6=()=>document.createElement("div"),P6=(e,t)=>{const n=M6();e.onVanish=()=>{Gs(null,n),pa.delete(s)},e.onAction=o=>{const a=pa.get(s);let i;e.showInput?i={value:s.inputValue,action:o}:i=o,e.callback?e.callback(i,r.proxy):o==="cancel"||o==="close"?e.distinguishCancelAndClose&&o!=="cancel"?a.reject("close"):a.reject("cancel"):a.resolve(i)};const r=A6(e,n,t),s=r.proxy;for(const o in e)et(e,o)&&!et(s.$props,o)&&(o==="closeIcon"&&Ue(e[o])?s[o]=qs(e[o]):s[o]=e[o]);return s.visible=!0,s};function bo(e,t=null){if(!ct)return Promise.reject();let n;return Be(e)||jn(e)?e={message:e}:n=e.callback,new Promise((r,s)=>{const o=P6(e,t??bo._context);pa.set(o,{options:e,callback:n,resolve:r,reject:s})})}const R6=["alert","confirm","prompt"],$6={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};R6.forEach(e=>{bo[e]=L6(e)});function L6(e){return(t,n,r,s)=>{let o="";return Ue(n)?(r=n,o=""):Ct(n)?o="":o=n,bo(Object.assign({title:o,message:t,type:"",...$6[e]},r,{boxType:e}),s)}}bo.close=()=>{pa.forEach((e,t)=>{t.doClose()}),pa.clear()};bo._context=null;const Br=bo;Br.install=e=>{Br._context=e._context,e.config.globalProperties.$msgbox=Br,e.config.globalProperties.$messageBox=Br,e.config.globalProperties.$alert=Br.alert,e.config.globalProperties.$confirm=Br.confirm,e.config.globalProperties.$prompt=Br.prompt};const k$=Br,cr=Object.create(null);cr.open="0";cr.close="1";cr.ping="2";cr.pong="3";cr.message="4";cr.upgrade="5";cr.noop="6";const Pi=Object.create(null);Object.keys(cr).forEach(e=>{Pi[cr[e]]=e});const kc={type:"error",data:"parser error"},pb=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",vb=typeof ArrayBuffer=="function",mb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Yd=({type:e,data:t},n,r)=>pb&&t instanceof Blob?n?r(t):Up(t,r):vb&&(t instanceof ArrayBuffer||mb(t))?n?r(t):Up(new Blob([t]),r):r(cr[e]+(t||"")),Up=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function qp(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let yu;function I6(e,t){if(pb&&e.data instanceof Blob)return e.data.arrayBuffer().then(qp).then(t);if(vb&&(e.data instanceof ArrayBuffer||mb(e.data)))return t(qp(e.data));Yd(e,!1,n=>{yu||(yu=new TextEncoder),t(yu.encode(n))})}const Yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ro=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Yp.length;e++)Ro[Yp.charCodeAt(e)]=e;const N6=e=>{let t=e.length*.75,n=e.length,r,s=0,o,a,i,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)o=Ro[e.charCodeAt(r)],a=Ro[e.charCodeAt(r+1)],i=Ro[e.charCodeAt(r+2)],l=Ro[e.charCodeAt(r+3)],u[s++]=o<<2|a>>4,u[s++]=(a&15)<<4|i>>2,u[s++]=(i&3)<<6|l&63;return c},B6=typeof ArrayBuffer=="function",Gd=(e,t)=>{if(typeof e!="string")return{type:"message",data:gb(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:D6(e.substring(1),t)}:Pi[n]?e.length>1?{type:Pi[n],data:e.substring(1)}:{type:Pi[n]}:kc},D6=(e,t)=>{if(B6){const n=N6(e);return gb(n,t)}else return{base64:!0,data:e}},gb=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},bb="",F6=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{Yd(o,!1,i=>{r[a]=i,++s===n&&t(r.join(bb))})})},V6=(e,t)=>{const n=e.split(bb),r=[];for(let s=0;s<n.length;s++){const o=Gd(n[s],t);if(r.push(o),o.type==="error")break}return r};function H6(){return new TransformStream({transform(e,t){I6(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let wu;function Ja(e){return e.reduce((t,n)=>t+n.length,0)}function Za(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function z6(e,t){wu||(wu=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(a,i){for(n.push(a);;){if(r===0){if(Ja(n)<1)break;const l=Za(n,1);o=(l[0]&128)===128,s=l[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(Ja(n)<2)break;const l=Za(n,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Ja(n)<8)break;const l=Za(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){i.enqueue(kc);break}s=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Ja(n)<s)break;const l=Za(n,s);i.enqueue(Gd(o?l:wu.decode(l),t)),r=0}if(s===0||s>e){i.enqueue(kc);break}}}})}const yb=4;function Rt(e){if(e)return j6(e)}function j6(e){for(var t in Rt.prototype)e[t]=Rt.prototype[t];return e}Rt.prototype.on=Rt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Rt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Rt.prototype.off=Rt.prototype.removeListener=Rt.prototype.removeAllListeners=Rt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Rt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Rt.prototype.emitReserved=Rt.prototype.emit;Rt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Rt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Vl=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),_n=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),W6="arraybuffer";function wb(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const K6=_n.setTimeout,U6=_n.clearTimeout;function Hl(e,t){t.useNativeTimers?(e.setTimeoutFn=K6.bind(_n),e.clearTimeoutFn=U6.bind(_n)):(e.setTimeoutFn=_n.setTimeout.bind(_n),e.clearTimeoutFn=_n.clearTimeout.bind(_n))}const q6=1.33;function Y6(e){return typeof e=="string"?G6(e):Math.ceil((e.byteLength||e.size)*q6)}function G6(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function _b(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function X6(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function J6(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class Z6 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Xd extends Rt{constructor(t){super(),this.writable=!1,Hl(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Z6(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Gd(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=X6(t);return n.length?"?"+n:""}}class Q6 extends Xd{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};V6(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,F6(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=_b()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Cb=!1;try{Cb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const eR=Cb;function tR(){}class nR extends Q6{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class or extends Rt{constructor(t,n,r){super(),this.createRequest=t,Hl(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=wb(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=or.requestsCount++,or.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=tR,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete or.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}or.requestsCount=0;or.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Gp);else if(typeof addEventListener=="function"){const e="onpagehide"in _n?"pagehide":"unload";addEventListener(e,Gp,!1)}}function Gp(){for(let e in or.requests)or.requests.hasOwnProperty(e)&&or.requests[e].abort()}const rR=function(){const e=Sb({xdomain:!1});return e&&e.responseType!==null}();class sR extends nR{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=rR&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new or(Sb,this.uri(),t)}}function Sb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||eR))return new XMLHttpRequest}catch{}if(!t)try{return new _n[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Eb=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class oR extends Xd{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Eb?{}:wb(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(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Yd(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&Vl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=_b()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const _u=_n.WebSocket||_n.MozWebSocket;class aR extends oR{createSocket(t,n,r){return Eb?new _u(t,n,r):n?new _u(t,n):new _u(t)}doWrite(t,n){this.ws.send(n)}}class iR extends Xd{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=z6(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=H6();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:i,value:l})=>{i||(this.onPacket(l),o())}).catch(i=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Vl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const lR={websocket:aR,webtransport:iR,polling:sR},uR=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,cR=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Oc(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=uR.exec(e||""),o={},a=14;for(;a--;)o[cR[a]]=s[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=dR(o,o.path),o.queryKey=fR(o,o.query),o}function dR(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function fR(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const Tc=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ri=[];Tc&&addEventListener("offline",()=>{Ri.forEach(e=>e())},!1);class Ur extends Rt{constructor(t,n){if(super(),this.binaryType=W6,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Oc(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Oc(n.host).host);Hl(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=J6(this.opts.query)),Tc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ri.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=yb,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ur.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ur.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=Y6(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Vl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ur.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Tc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ri.indexOf(this._offlineEventListener);r!==-1&&Ri.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ur.protocol=yb;class hR extends Ur{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ur.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ur.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const a=f=>{const h=new Error("probe error: "+f);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function i(){a("transport closed")}function l(){a("socket closed")}function c(f){n&&f.name!==n.name&&o()}const u=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",i),this.off("close",l),this.off("upgrading",c)};n.once("open",s),n.once("error",a),n.once("close",i),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let pR=class extends hR{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>lR[s]).filter(s=>!!s)),super(t,r)}};function vR(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Oc(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const mR=typeof ArrayBuffer=="function",gR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,kb=Object.prototype.toString,bR=typeof Blob=="function"||typeof Blob<"u"&&kb.call(Blob)==="[object BlobConstructor]",yR=typeof File=="function"||typeof File<"u"&&kb.call(File)==="[object FileConstructor]";function Jd(e){return mR&&(e instanceof ArrayBuffer||gR(e))||bR&&e instanceof Blob||yR&&e instanceof File}function $i(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if($i(e[n]))return!0;return!1}if(Jd(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return $i(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&$i(e[n]))return!0;return!1}function wR(e){const t=[],n=e.data,r=e;return r.data=xc(n,t),r.attachments=t.length,{packet:r,buffers:t}}function xc(e,t){if(!e)return e;if(Jd(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=xc(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=xc(e[r],t));return n}return e}function _R(e,t){return e.data=Ac(e.data,t),delete e.attachments,e}function Ac(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Ac(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Ac(e[n],t));return e}const CR=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],SR=5;var at;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(at||(at={}));class ER{constructor(t){this.replacer=t}encode(t){return(t.type===at.EVENT||t.type===at.ACK)&&$i(t)?this.encodeAsBinary({type:t.type===at.EVENT?at.BINARY_EVENT:at.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===at.BINARY_EVENT||t.type===at.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=wR(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}function Xp(e){return Object.prototype.toString.call(e)==="[object Object]"}class Zd extends Rt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===at.BINARY_EVENT;r||n.type===at.BINARY_ACK?(n.type=r?at.EVENT:at.ACK,this.reconstructor=new kR(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Jd(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(at[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===at.BINARY_EVENT||r.type===at.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Zd.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case at.CONNECT:return Xp(n);case at.DISCONNECT:return n===void 0;case at.CONNECT_ERROR:return typeof n=="string"||Xp(n);case at.EVENT:case at.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&CR.indexOf(n[0])===-1);case at.ACK:case at.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class kR{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=_R(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const OR=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Zd,Encoder:ER,get PacketType(){return at},protocol:SR},Symbol.toStringTag,{value:"Module"}));function $n(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const TR=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ob extends Rt{constructor(t,n,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=t,this.nsp=n,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;const t=this.io;this.subs=[$n(t,"open",this.onopen.bind(this)),$n(t,"packet",this.onpacket.bind(this)),$n(t,"error",this.onerror.bind(this)),$n(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(TR.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:at.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,f=n.pop();this._registerAckCallback(u,f),a.id=u}const i=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,l=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!i||(l?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===t&&this.sendBuffer.splice(i,1);n.call(this,new Error("operation has timed out"))},s),a=(...i)=>{this.io.clearTimeoutFn(o),n.apply(this,i)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(a,i)=>a?s(a):r(i);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:at.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case at.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new 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 at.EVENT:case at.BINARY_EVENT:this.onevent(t);break;case at.ACK:case at.BINARY_ACK:this.onack(t);break;case at.DISCONNECT:this.ondisconnect();break;case at.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:at.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:at.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function yo(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}yo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};yo.prototype.reset=function(){this.attempts=0};yo.prototype.setMin=function(e){this.ms=e};yo.prototype.setMax=function(e){this.max=e};yo.prototype.setJitter=function(e){this.jitter=e};class Mc extends Rt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Hl(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new yo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||OR;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new pR(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=$n(n,"open",function(){r.onopen(),t&&t()}),o=i=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",i),t?t(i):this.maybeReconnectOnOpen()},a=$n(n,"error",o);if(this._timeout!==!1){const i=this._timeout,l=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},i);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push($n(t,"ping",this.onping.bind(this)),$n(t,"data",this.ondata.bind(this)),$n(t,"error",this.onerror.bind(this)),$n(t,"close",this.onclose.bind(this)),$n(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Vl(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Ob(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const To={};function Cu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=vR(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=To[s]&&o in To[s].nsps,i=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return i?l=new Mc(r,t):(To[s]||(To[s]=new Mc(r,t)),l=To[s]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Cu,{Manager:Mc,Socket:Ob,io:Cu,connect:Cu});var zt={},Qa={},Ls={},Is={},ei={},ti={},Su={},Xn={},Eu={},Jp;function Qd(){return Jp||(Jp=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.VerticalReverse="vertical-reverse",t.Horizontal="horizontal",t.HorizontalReverse="horizontal-reverse"}(e.Orientation||(e.Orientation={}))}(Eu)),Eu}var Zp;function wo(){if(Zp)return Xn;Zp=1,Object.defineProperty(Xn,"__esModule",{value:!0});const e=Qd();function t(c,u){return typeof c=="boolean"?c:u}Xn.booleanOptionOr=t;function n(c,u){return typeof c=="number"?c:u}Xn.numberOptionOr=n;function r(c,u){return Object.assign({},u.reduce((f,h)=>Object.assign({},f,{[h]:c[h]}),{}))}Xn.pick=r;function s(c,u){console.log(JSON.stringify(c.map(f=>r(f,u)),null,2))}Xn.debug=s;function o(c){return c===void 0}Xn.isUndefined=o;function a(c={}){return Object.keys(c).reduce((u,f)=>o(c[f])?u:Object.assign({},u,{[f]:c[f]}),{})}Xn.withoutUndefinedKeys=a;function i(c,u,f){const h=f.style.dot.size,m=c.template.arrow.size,p=h+c.template.arrow.offset,v=Math.PI/7,b=l(c,u,f),_=p*Math.cos(b),k=p*Math.sin(b),w=(p+m)*Math.cos(b-v),g=(p+m)*Math.sin(b-v),y=(p+m/2)*Math.cos(b),C=(p+m/2)*Math.sin(b),S=(p+m)*Math.cos(b+v),P=(p+m)*Math.sin(b+v);return`M${_},${k} L${w},${g} Q${y},${C} ${S},${P} L${S},${P}`}Xn.arrowSvgPath=i;function l(c,u,f){const h=u.x-f.x,m=u.y-f.y,p=c.template.commit.spacing;let v,b;switch(c.orientation){case e.Orientation.Horizontal:v=m,b=-p;break;case e.Orientation.HorizontalReverse:v=m,b=p;break;case e.Orientation.VerticalReverse:v=-p,b=h;break;default:v=p,b=h;break}return c.isVertical?Math.abs(m)>p&&(b=0):Math.abs(h)>p&&(v=0),c.reverseArrow&&(v*=-1,b*=-1),Math.atan2(v,b)}return Xn}var Qp;function ef(){return Qp||(Qp=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=wo();var n;(function(c){c.Bezier="bezier",c.Straight="straight"})(n||(n={})),e.MergeStyle=n,e.DEFAULT_FONT="normal 12pt Calibri";class r{constructor(u){u.branch=u.branch||{},u.branch.label=u.branch.label||{},u.arrow=u.arrow||{},u.commit=u.commit||{},u.commit.dot=u.commit.dot||{},u.commit.message=u.commit.message||{},this.colors=u.colors||["#000000"],this.branch={color:u.branch.color,lineWidth:u.branch.lineWidth||2,mergeStyle:u.branch.mergeStyle||n.Bezier,spacing:t.numberOptionOr(u.branch.spacing,20),label:{display:t.booleanOptionOr(u.branch.label.display,!0),color:u.branch.label.color||u.commit.color,strokeColor:u.branch.label.strokeColor||u.commit.color,bgColor:u.branch.label.bgColor||"white",font:u.branch.label.font||u.commit.message.font||e.DEFAULT_FONT,borderRadius:t.numberOptionOr(u.branch.label.borderRadius,10)}},this.arrow={size:u.arrow.size||null,color:u.arrow.color||null,offset:u.arrow.offset||2},this.commit={color:u.commit.color,spacing:t.numberOptionOr(u.commit.spacing,25),hasTooltipInCompactMode:t.booleanOptionOr(u.commit.hasTooltipInCompactMode,!0),dot:{color:u.commit.dot.color||u.commit.color,size:u.commit.dot.size||3,strokeWidth:t.numberOptionOr(u.commit.dot.strokeWidth,0),strokeColor:u.commit.dot.strokeColor,font:u.commit.dot.font||u.commit.message.font||"normal 10pt Calibri"},message:{display:t.booleanOptionOr(u.commit.message.display,!0),displayAuthor:t.booleanOptionOr(u.commit.message.displayAuthor,!0),displayHash:t.booleanOptionOr(u.commit.message.displayHash,!0),color:u.commit.message.color||u.commit.color,font:u.commit.message.font||e.DEFAULT_FONT}},this.tag=u.tag||{}}}e.Template=r;const s=new r({colors:["#6963FF","#47E8D4","#6BDB52","#E84BA5","#FFA657"],branch:{color:"#000000",lineWidth:4,spacing:50,mergeStyle:n.Straight},commit:{spacing:60,dot:{size:16,strokeColor:"#000000",strokeWidth:4},message:{color:"black"}},arrow:{size:16,offset:-1.5}});e.blackArrowTemplate=s;const o=new r({colors:["#979797","#008fb5","#f1c109"],branch:{lineWidth:10,spacing:50},commit:{spacing:80,dot:{size:14},message:{font:"normal 14pt Arial"}}});e.metroTemplate=o;var a;(function(c){c.Metro="metro",c.BlackArrow="blackarrow"})(a||(a={})),e.TemplateName=a;function i(c,u){const f=l(c);return u.branch||(u.branch={}),u.commit||(u.commit={}),{colors:u.colors||f.colors,arrow:Object.assign({},f.arrow,u.arrow),branch:Object.assign({},f.branch,u.branch,{label:Object.assign({},f.branch.label,u.branch.label)}),commit:Object.assign({},f.commit,u.commit,{dot:Object.assign({},f.commit.dot,u.commit.dot),message:Object.assign({},f.commit.message,u.commit.message)}),tag:Object.assign({},f.tag,u.tag)}}e.templateExtend=i;function l(c){return c?typeof c=="string"?{[a.BlackArrow]:s,[a.Metro]:o}[c]:c:o}e.getTemplate=l}(Su)),Su}var ev;function Tb(){if(ev)return ti;ev=1,Object.defineProperty(ti,"__esModule",{value:!0});const e=ef(),t=wo();class n{constructor(s,o,a,i){this.name=s,this.tagStyle=o,this.commitStyle=i,this.render=a}get style(){return{strokeColor:this.tagStyle.strokeColor||this.commitStyle.color,bgColor:this.tagStyle.bgColor||this.commitStyle.color,color:this.tagStyle.color||"white",font:this.tagStyle.font||this.commitStyle.message.font||e.DEFAULT_FONT,borderRadius:t.numberOptionOr(this.tagStyle.borderRadius,10),pointerWidth:t.numberOptionOr(this.tagStyle.pointerWidth,12)}}}return ti.Tag=n,ti}var tv;function tf(){if(tv)return ei;tv=1,Object.defineProperty(ei,"__esModule",{value:!0});const e=Tb(),t=()=>(Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)).substring(0,40);class n{constructor(s){this.refs=[],this.x=0,this.y=0;let o,a;try{[,o,a]=s.author.match(/(.*) <(.*)>/)}catch{[o,a]=[s.author,""]}this.author={name:o,email:a,timestamp:Date.now()},this.committer={name:o,email:a,timestamp:Date.now()},this.subject=s.subject,this.body=s.body||"",this.hash=s.hash||t(),this.hashAbbrev=this.hash.substring(0,7),this.parents=s.parents?s.parents:[],this.parentsAbbrev=this.parents.map(i=>i.substring(0,7)),this.style=Object.assign({},s.style,{message:Object.assign({},s.style.message),dot:Object.assign({},s.style.dot)}),this.dotText=s.dotText,this.onClick=()=>s.onClick?s.onClick(this):void 0,this.onMessageClick=()=>s.onMessageClick?s.onMessageClick(this):void 0,this.onMouseOver=()=>s.onMouseOver?s.onMouseOver(this):void 0,this.onMouseOut=()=>s.onMouseOut?s.onMouseOut(this):void 0,this.renderDot=s.renderDot,this.renderMessage=s.renderMessage,this.renderTooltip=s.renderTooltip}get message(){let s="";return this.style.message.displayHash&&(s+=`${this.hashAbbrev} `),s+=this.subject,this.style.message.displayAuthor&&(s+=` - ${this.author.name} <${this.author.email}>`),s}get branchToDisplay(){return this.branches?this.branches[0]:""}setRefs(s){return this.refs=s.getNames(this.hash),this}setTags(s,o,a){return this.tags=s.getNames(this.hash).map(i=>new e.Tag(i,o(i),a(i),this.style)),this}setBranches(s){return this.branches=s,this}setPosition({x:s,y:o}){return this.x=s,this.y=o,this}withDefaultColor(s){const o=Object.assign({},this.style,{dot:Object.assign({},this.style.dot),message:Object.assign({},this.style.message)});o.color||(o.color=s),o.dot.color||(o.dot.color=s),o.message.color||(o.message.color=s);const a=this.cloneCommit();return a.style=o,a}cloneCommit(){const s=new n({author:`${this.author.name} <${this.author.email}>`,subject:this.subject,style:this.style,body:this.body,hash:this.hash,parents:this.parents,dotText:this.dotText,onClick:this.onClick,onMessageClick:this.onMessageClick,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut,renderDot:this.renderDot,renderMessage:this.renderMessage,renderTooltip:this.renderTooltip});return s.refs=this.refs,s.branches=this.branches,s.tags=this.tags,s.x=this.x,s.y=this.y,s}}return ei.Commit=n,ei}var nv;function xb(){if(nv)return Is;nv=1;var e=Is&&Is.__rest||function(a,i){var l={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&i.indexOf(c)<0&&(l[c]=a[c]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,c=Object.getOwnPropertySymbols(a);u<c.length;u++)i.indexOf(c[u])<0&&Object.prototype.propertyIsEnumerable.call(a,c[u])&&(l[c[u]]=a[c[u]]);return l};Object.defineProperty(Is,"__esModule",{value:!0});const t=tf(),n=zl(),r=wo();class s{constructor(i,l,c){this._branch=i,this.name=i.name,this._graph=l,this._onGraphUpdate=c}branch(i){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot branch from the deleted branch "${this.name}"`);const l=typeof i=="string"?{name:i}:i;return l.from=this,this._graph.createBranch(l).getUserApi()}commit(i){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot commit on the deleted branch "${this.name}"`);return typeof i=="string"&&(i={subject:i}),i||(i={}),this._commitWithParents(i,[]),this._onGraphUpdate(),this}delete(){if(this._graph.refs.getCommit("HEAD")===this._graph.refs.getCommit(this.name))throw new Error(`Cannot delete the checked out branch "${this.name}"`);return[...function*(l,c){const u=(h,m)=>h.commits.find(({hash:p})=>p===m);let f=u(l,l.refs.getCommit(c.name));for(;f&&f.hash!==c.parentCommitHash;)yield f,f=u(l,f.parents[0])}(this._graph,this._branch)].forEach(l=>{l.refs=l.refs.filter(c=>c!==this.name)}),this._graph.refs.delete(this.name),this._graph.branches.delete(this.name),this._branch=n.createDeletedBranch(this._graph,this._branch.style,()=>{}),this._onGraphUpdate(),this}merge(...i){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot merge to the deleted branch "${this.name}"`);let l=i[0];o(l)||(l={branch:i[0],fastForward:!1,commitOptions:{subject:i[1]}});const{branch:c,fastForward:u,commitOptions:f}=l,h=typeof c=="string"?c:c.name,m=this._graph.refs.getCommit(h);if(!m)throw new Error(`The branch called "${h}" is unknown`);let p=!1;if(u){const v=this._graph.refs.getCommit(this._branch.name);v&&(p=this._areCommitsConnected(v,m))}return u&&p?this._fastForwardTo(m):this._commitWithParents(Object.assign({},f,{subject:f&&f.subject||`Merge branch ${h}`}),[m]),this._onGraphUpdate(),this}tag(i){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot tag on the deleted branch "${this.name}"`);return typeof i=="string"?this._graph.getUserApi().tag({name:i,ref:this._branch.name}):this._graph.getUserApi().tag(Object.assign({},i,{ref:this._branch.name})),this}checkout(){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot checkout the deleted branch "${this.name}"`);const i=this._branch,l=this._graph.refs.getCommit(i.name);return this._graph.currentBranch=i,l&&this._graph.refs.set("HEAD",l),this}_commitWithParents(i,l){const c=this._graph.refs.getCommit(this._branch.name);c?l.unshift(c):this._branch.parentCommitHash&&l.unshift(this._branch.parentCommitHash);const{tag:u}=i,f=e(i,["tag"]),h=new t.Commit(Object.assign({hash:this._graph.generateCommitHash(),author:this._branch.commitDefaultOptions.author||this._graph.author,subject:this._branch.commitDefaultOptions.subject||this._graph.commitMessage},f,{parents:l,style:this._getCommitStyle(i.style)}));c?this._graph.refs.getNames(c).forEach(p=>this._graph.refs.set(p,h.hash)):this._graph.refs.set(this._branch.name,h.hash),this._graph.commits.push(h),this.checkout(),u&&this.tag(u)}_areCommitsConnected(i,l){const c=this._graph.commits.find(({hash:f})=>l===f);return!c||c.parents.length===0?!1:c.parents.includes(i)?!0:c.parents.some(f=>this._areCommitsConnected(i,f))}_fastForwardTo(i){this._graph.refs.set(this._branch.name,i)}_getCommitStyle(i={}){return Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style),i,{message:Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit.message),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style.message),i.message,r.withoutUndefinedKeys({display:this._graph.shouldDisplayCommitMessage&&void 0})),dot:Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit.dot),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style.dot),i.dot)})}_isReferenced(){return this._graph.branches.has(this.name)||this._graph.refs.hasName(this.name)||this._graph.commits.reduce((i,{refs:l})=>[...i,...l],[]).includes(this.name)}}Is.BranchUserApi=s;function o(a){return typeof a=="object"&&!(a instanceof s)}return Is}var rv;function zl(){if(rv)return Ls;rv=1,Object.defineProperty(Ls,"__esModule",{value:!0});const e=xb(),t="";Ls.DELETED_BRANCH_NAME=t;class n{constructor(o){this.gitgraph=o.gitgraph,this.name=o.name,this.style=o.style,this.parentCommitHash=o.parentCommitHash,this.commitDefaultOptions=o.commitDefaultOptions||{style:{}},this.onGraphUpdate=o.onGraphUpdate,this.renderLabel=o.renderLabel}getUserApi(){return new e.BranchUserApi(this,this.gitgraph,this.onGraphUpdate)}isDeleted(){return this.name===t}}Ls.Branch=n;function r(s,o,a){return new n({name:t,gitgraph:s,style:o,onGraphUpdate:a})}return Ls.createDeletedBranch=r,Ls}var xo={},ni={},sv;function nf(){if(sv)return ni;sv=1,Object.defineProperty(ni,"__esModule",{value:!0});var e;return function(t){t.Compact="compact"}(e||(e={})),ni.Mode=e,ni}var ri={},si={},ov;function Ab(){if(ov)return si;ov=1,Object.defineProperty(si,"__esModule",{value:!0});class e{constructor(r){this.rows=new Map,this.maxRowCache=void 0,this.computeRowsFromCommits(r)}getRowOf(r){return this.rows.get(r)||0}getMaxRow(){return this.maxRowCache===void 0&&(this.maxRowCache=t(Array.from(this.rows.values())).length-1),this.maxRowCache}computeRowsFromCommits(r){r.forEach((s,o)=>{this.rows.set(s.hash,o)}),this.maxRowCache=void 0}}si.RegularGraphRows=e;function t(n){const r=new Set;return n.forEach(s=>r.add(s)),Array.from(r)}return si}var av;function xR(){if(av)return ri;av=1,Object.defineProperty(ri,"__esModule",{value:!0});const e=Ab();class t extends e.RegularGraphRows{computeRowsFromCommits(r){r.forEach((s,o)=>{let a=o;if(!(o===0)){const l=this.getRowOf(s.parents[0]),c=r[o-1];if(a=Math.max(l+1,this.getRowOf(c.hash)),s.parents.length>1){const f=this.getRowOf(s.parents[1]);l<f&&a++}}this.rows.set(s.hash,a)})}}return ri.CompactGraphRows=t,ri}var iv;function AR(){if(iv)return xo;iv=1,Object.defineProperty(xo,"__esModule",{value:!0});const e=nf(),t=xR(),n=Ab();xo.GraphRows=n.RegularGraphRows;function r(s,o){return s===e.Mode.Compact?new t.CompactGraphRows(o):new n.RegularGraphRows(o)}return xo.createGraphRows=r,xo}var oi={},lv;function MR(){if(lv)return oi;lv=1,Object.defineProperty(oi,"__esModule",{value:!0});class e{constructor(n,r,s){this.branches=new Set,this.colors=r,n.forEach(o=>this.branches.add(o.branchToDisplay)),s&&(this.branches=new Set(Array.from(this.branches).sort(s)))}get(n){return Array.from(this.branches).findIndex(r=>r===n)}getColorOf(n){return this.colors[this.get(n)%this.colors.length]}}return oi.BranchesOrder=e,oi}var ai={},uv;function rf(){if(uv)return ai;uv=1,Object.defineProperty(ai,"__esModule",{value:!0});class e{constructor(){this.commitPerName=new Map,this.namesPerCommit=new Map}set(n,r){const s=this.commitPerName.get(n);return s&&this.removeNameFrom(s,n),this.addNameTo(r,n),this.addCommitTo(n,r),this}delete(n){return this.hasName(n)&&(this.removeNameFrom(this.getCommit(n),n),this.commitPerName.delete(n)),this}getCommit(n){return this.commitPerName.get(n)}getNames(n){return this.namesPerCommit.get(n)||[]}getAllNames(){return Array.from(this.commitPerName.keys())}hasCommit(n){return this.namesPerCommit.has(n)}hasName(n){return this.commitPerName.has(n)}removeNameFrom(n,r){const s=this.namesPerCommit.get(n)||[];this.namesPerCommit.set(n,s.filter(o=>o!==r))}addNameTo(n,r){const s=this.namesPerCommit.get(n)||[];this.namesPerCommit.set(n,[...s,r])}addCommitTo(n,r){this.commitPerName.set(n,r)}}return ai.Refs=e,ai}var Ao={},cv;function Mb(){if(cv)return Ao;cv=1,Object.defineProperty(Ao,"__esModule",{value:!0});const e=wo();class t{constructor(s,o,a,i,l,c){this.branchesPaths=new Map,this.commits=s,this.branches=o,this.commitSpacing=a,this.isGraphVertical=i,this.isGraphReverse=l,this.createDeletedBranch=c}execute(){return this.fromCommits(),this.withMergeCommits(),this.smoothBranchesPaths()}fromCommits(){this.commits.forEach(s=>{let o=this.branches.get(s.branchToDisplay);o||(o=this.getDeletedBranchInPath()||this.createDeletedBranch());const a=[],i=this.branchesPaths.get(o),l=this.commits.find(({hash:c})=>c===s.parents[0]);i?a.push(...i):l&&a.push({x:l.x,y:l.y}),a.push({x:s.x,y:s.y}),this.branchesPaths.set(o,a)})}withMergeCommits(){this.commits.filter(({parents:o})=>o.length>1).forEach(o=>{const a=this.commits.find(({hash:u})=>u===o.parents[1]);if(!a)return;const i=a.branches?a.branches[0]:"";let l=this.branches.get(i);if(!l&&(l=this.getDeletedBranchInPath(),!l))return;const c=[...this.branchesPaths.get(l)||[]];this.branchesPaths.set(l,[...c,{x:o.x,y:o.y,mergeCommit:!0}])})}getDeletedBranchInPath(){return Array.from(this.branchesPaths.keys()).find(s=>s.isDeleted())}smoothBranchesPaths(){const s=new Map;return this.branchesPaths.forEach((o,a)=>{if(o.length<=1){s.set(a,[o]);return}this.isGraphVertical?o=o.sort((l,c)=>l.y>c.y?-1:1):o=o.sort((l,c)=>l.x>c.x?1:-1),this.isGraphReverse&&(o=o.reverse());const i=o.reduce((l,c,u)=>{if(c.mergeCommit){l[l.length-1].push(e.pick(c,["x","y"]));let f=u-1,h=o[f];for(;f>=0&&h.mergeCommit;)f--,h=o[f];f>=0&&l.push([h])}else l[l.length-1].push(c);return l},[[]]);this.isGraphReverse&&i.forEach(l=>l.reverse()),this.isGraphVertical?i.forEach(l=>{if(l.length<=1)return;const c=l[0],u=l[l.length-1],f=l[1].x,h=Math.round(Math.abs(c.y-u.y)/this.commitSpacing)-1,m=h>0?new Array(h).fill(0).map((v,b)=>({x:f,y:l[0].y-this.commitSpacing*(b+1)})):[],p=s.get(a)||[];s.set(a,[...p,[c,...m,u]])}):i.forEach(l=>{if(l.length<=1)return;const c=l[0],u=l[l.length-1],f=l[1].y,h=Math.round(Math.abs(c.x-u.x)/this.commitSpacing)-1,m=h>0?new Array(h).fill(0).map((v,b)=>({y:f,x:l[0].x+this.commitSpacing*(b+1)})):[],p=s.get(a)||[];s.set(a,[...p,[c,...m,u]])})}),s}}Ao.BranchesPathsCalculator=t;function n(r,s,o){return r.map(a=>"M"+a.map(({x:i,y:l},c,u)=>{if(s&&u.length>1&&(c===1||c===u.length-1)){const f=u[c-1];if(o){const h=(f.y+l)/2;return`C ${f.x} ${h} ${i} ${h} ${i} ${l}`}else{const h=(f.x+i)/2;return`C ${h} ${f.y} ${h} ${l} ${i} ${l}`}}return`L ${i} ${l}`}).join(" ").slice(1)).join(" ")}return Ao.toSvgPath=n,Ao}var ii={},dv;function Pb(){if(dv)return ii;dv=1,Object.defineProperty(ii,"__esModule",{value:!0});const e=tf(),t=zl(),n=rf();class r{constructor(o,a){this._graph=o,this._onGraphUpdate=a}clear(){return this._graph.refs=new n.Refs,this._graph.tags=new n.Refs,this._graph.commits=[],this._graph.branches=new Map,this._graph.currentBranch=this._graph.createBranch("master"),this._onGraphUpdate(),this}commit(o){return this._graph.currentBranch.getUserApi().commit(o),this}branch(o){return this._graph.createBranch(o).getUserApi()}tag(...o){let a,i,l,c;if(typeof o[0]=="string"?(a=o[0],i=o[1]):(a=o[0].name,i=o[0].ref,l=o[0].style,c=o[0].render),!i){const f=this._graph.refs.getCommit("HEAD");if(!f)return this;i=f}let u;if(this._graph.refs.hasCommit(i)&&(u=i),this._graph.refs.hasName(i)&&(u=this._graph.refs.getCommit(i)),!u)throw new Error(`The ref "${i}" does not exist`);return this._graph.tags.set(a,u),this._graph.tagStyles[a]=l,this._graph.tagRenders[a]=c,this._onGraphUpdate(),this}import(o){const a=new Error("Only `git2json` format is supported for imported data.");if(!Array.isArray(o)||!o.every(u=>typeof u=="object"&&typeof u.author=="object"&&Array.isArray(u.refs)))throw a;const l=o.map(u=>Object.assign({},u,{style:Object.assign({},this._graph.template.commit,{message:Object.assign({},this._graph.template.commit.message,{display:this._graph.shouldDisplayCommitMessage})}),author:`${u.author.name} <${u.author.email}>`})).reverse();this.clear(),this._graph.commits=l.map(u=>new e.Commit(u)),l.forEach(({refs:u,hash:f})=>{if(!u||!f)return;const h="tag: ";u.map(p=>p.split(h)).map(([p,v])=>v).filter(p=>typeof p=="string").forEach(p=>this._graph.tags.set(p,f)),u.filter(p=>!p.startsWith(h)).forEach(p=>this._graph.refs.set(p,f))});const c=this._getBranches();return this._graph.commits.map(u=>this._withBranches(c,u)).reduce((u,f)=>(f.branches&&f.branches.forEach(h=>u.add(h)),u),new Set).forEach(u=>this.branch(u)),this._onGraphUpdate(),this}_withBranches(o,a){let i=Array.from((o.get(a.hash)||new Set).values());return i.length===0&&(i=[t.DELETED_BRANCH_NAME]),a.setBranches(i)}_getBranches(){const o=new Map,a=[];return this._graph.refs.getAllNames().filter(l=>l!=="HEAD").forEach(l=>{const c=this._graph.refs.getCommit(l);for(c&&a.push(c);a.length>0;){const u=a.pop(),f=this._graph.commits.find(({hash:m})=>m===u),h=o.get(u)||new Set;h.add(l),o.set(u,h),f&&f.parents&&f.parents.length>0&&a.push(f.parents[0])}}),o}}return ii.GitgraphUserApi=r,ii}var fv;function PR(){if(fv)return Qa;fv=1,Object.defineProperty(Qa,"__esModule",{value:!0});const e=zl(),t=AR(),n=nf(),r=MR(),s=ef(),o=rf(),a=Mb(),i=wo(),l=Qd(),c=Pb();class u{constructor(h={}){this.refs=new o.Refs,this.tags=new o.Refs,this.tagStyles={},this.tagRenders={},this.commits=[],this.branches=new Map,this.listeners=[],this.nextTimeoutId=null,this.template=s.getTemplate(h.template),this.currentBranch=this.createBranch("master"),this.orientation=h.orientation,this.reverseArrow=i.booleanOptionOr(h.reverseArrow,!1),this.initCommitOffsetX=i.numberOptionOr(h.initCommitOffsetX,0),this.initCommitOffsetY=i.numberOptionOr(h.initCommitOffsetY,0),this.mode=h.mode,this.author=h.author||"Sergio Flores <saxo-guy@epic.com>",this.commitMessage=h.commitMessage||"He doesn't like George Michael! Boooo!",this.generateCommitHash=typeof h.generateCommitHash=="function"?h.generateCommitHash:()=>{},this.branchesOrderFunction=typeof h.compareBranchesOrder=="function"?h.compareBranchesOrder:void 0,this.branchLabelOnEveryCommit=i.booleanOptionOr(h.branchLabelOnEveryCommit,!1)}get isHorizontal(){return this.orientation===l.Orientation.Horizontal||this.orientation===l.Orientation.HorizontalReverse}get isVertical(){return!this.isHorizontal}get isReverse(){return this.orientation===l.Orientation.HorizontalReverse||this.orientation===l.Orientation.VerticalReverse}get shouldDisplayCommitMessage(){return!this.isHorizontal&&this.mode!==n.Mode.Compact}getUserApi(){return new c.GitgraphUserApi(this,()=>this.next())}subscribe(h){this.listeners.push(h);let m=!0;return()=>{if(!m)return;m=!1;const p=this.listeners.indexOf(h);this.listeners.splice(p,1)}}getRenderedData(){const h=this.computeRenderedCommits(),m=this.computeRenderedBranchesPaths(h),p=this.computeCommitMessagesX(m);return this.computeBranchesColor(h,m),{commits:h,branchesPaths:m,commitMessagesX:p}}createBranch(h){const m="HEAD";let p={gitgraph:this,name:"",parentCommitHash:this.refs.getCommit(m),style:this.template.branch,onGraphUpdate:()=>this.next()};if(typeof h=="string")p.name=h,p.parentCommitHash=this.refs.getCommit(m);else{const b=h.from?h.from.name:m,_=this.refs.getCommit(b)||(this.refs.hasCommit(h.from)?h.from:void 0);h.style=h.style||{},p=Object.assign({},p,h,{parentCommitHash:_,style:Object.assign({},p.style,h.style,{label:Object.assign({},p.style.label,h.style.label)})})}const v=new e.Branch(p);return this.branches.set(v.name,v),v}computeRenderedCommits(){const h=this.getBranches(),m=(()=>{const k=new Set(this.commits.reduce((y,{hash:C})=>h.has(C)?y:[...y,C],[])),w=this.commits.reduce((y,C)=>C.parents.length>1?[...y,...C.parents.slice(1).map(S=>this.commits.find(({hash:P})=>S===P))]:y,[]),g=new Set;return w.forEach(y=>{let C=y;for(;C&&k.has(C.hash);)g.add(C.hash),C=C.parents.length>0?this.commits.find(({hash:S})=>C.parents[0]===S):void 0}),g})(),p=this.commits.filter(({hash:k})=>h.has(k)||m.has(k)),v=p.map(k=>this.withBranches(h,k)),b=t.createGraphRows(this.mode,p),_=new r.BranchesOrder(v,this.template.colors,this.branchesOrderFunction);return v.map(k=>k.setRefs(this.refs)).map(k=>this.withPosition(b,_,k)).map(k=>k.withDefaultColor(this.getBranchDefaultColor(_,k.branchToDisplay))).map(k=>k.setTags(this.tags,w=>Object.assign({},this.tagStyles[w],this.template.tag),w=>this.tagRenders[w]))}computeRenderedBranchesPaths(h){return new a.BranchesPathsCalculator(h,this.branches,this.template.commit.spacing,this.isVertical,this.isReverse,()=>e.createDeletedBranch(this,this.template.branch,()=>this.next())).execute()}computeBranchesColor(h,m){const p=new r.BranchesOrder(h,this.template.colors,this.branchesOrderFunction);Array.from(m).forEach(([v])=>{v.computedColor=v.style.color||this.getBranchDefaultColor(p,v.name)})}computeCommitMessagesX(h){return Array.from(h).length*this.template.branch.spacing}withBranches(h,m){let p=Array.from((h.get(m.hash)||new Set).values());return p.length===0&&(p=[e.DELETED_BRANCH_NAME]),m.setBranches(p)}getBranches(){const h=new Map,m=[];return this.refs.getAllNames().filter(v=>v!=="HEAD").forEach(v=>{const b=this.refs.getCommit(v);for(b&&m.push(b);m.length>0;){const _=m.pop(),k=this.commits.find(({hash:g})=>g===_),w=h.get(_)||new Set;w.add(v),h.set(_,w),k&&k.parents&&k.parents.length>0&&m.push(k.parents[0])}}),h}withPosition(h,m,p){const v=h.getRowOf(p.hash),b=h.getMaxRow(),_=m.get(p.branchToDisplay);switch(this.orientation){default:return p.setPosition({x:this.initCommitOffsetX+this.template.branch.spacing*_,y:this.initCommitOffsetY+this.template.commit.spacing*(b-v)});case l.Orientation.VerticalReverse:return p.setPosition({x:this.initCommitOffsetX+this.template.branch.spacing*_,y:this.initCommitOffsetY+this.template.commit.spacing*v});case l.Orientation.Horizontal:return p.setPosition({x:this.initCommitOffsetX+this.template.commit.spacing*v,y:this.initCommitOffsetY+this.template.branch.spacing*_});case l.Orientation.HorizontalReverse:return p.setPosition({x:this.initCommitOffsetX+this.template.commit.spacing*(b-v),y:this.initCommitOffsetY+this.template.branch.spacing*_})}}getBranchDefaultColor(h,m){return h.getColorOf(m)}next(){this.nextTimeoutId&&window.clearTimeout(this.nextTimeoutId),this.nextTimeoutId=window.setTimeout(()=>{this.listeners.forEach(h=>h(this.getRenderedData()))},0)}}return Qa.GitgraphCore=u,Qa}var hv;function RR(){if(hv)return zt;hv=1,Object.defineProperty(zt,"__esModule",{value:!0});var e=PR();zt.GitgraphCore=e.GitgraphCore;var t=nf();zt.Mode=t.Mode;var n=Pb();zt.GitgraphUserApi=n.GitgraphUserApi;var r=xb();zt.BranchUserApi=r.BranchUserApi;var s=zl();zt.Branch=s.Branch;var o=tf();zt.Commit=o.Commit;var a=Tb();zt.Tag=a.Tag;var i=rf();zt.Refs=i.Refs;var l=ef();zt.MergeStyle=l.MergeStyle,zt.TemplateName=l.TemplateName,zt.templateExtend=l.templateExtend;var c=Qd();zt.Orientation=c.Orientation;var u=Mb();zt.toSvgPath=u.toSvgPath;var f=wo();return zt.arrowSvgPath=f.arrowSvgPath,zt}var Ns=RR(),pr="http://www.w3.org/2000/svg";function $R(e){var t=document.createElementNS(pr,"svg");return t}function Kt(e){var t=document.createElementNS(pr,"g");return e.children.forEach(function(n){return n&&t.appendChild(n)}),e.translate&&t.setAttribute("transform","translate("+e.translate.x+", "+e.translate.y+")"),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e.strokeWidth&&t.setAttribute("stroke-width",e.strokeWidth.toString()),e.onClick&&t.addEventListener("click",e.onClick),e.onMouseOver&&t.addEventListener("mouseover",e.onMouseOver),e.onMouseOut&&t.addEventListener("mouseout",e.onMouseOut),t}function va(e){var t=document.createElementNS(pr,"text");return t.setAttribute("alignment-baseline","central"),t.setAttribute("dominant-baseline","central"),t.textContent=e.content,e.fill&&t.setAttribute("fill",e.fill),e.font&&t.setAttribute("style","font: "+e.font),e.anchor&&t.setAttribute("text-anchor",e.anchor),e.translate&&(t.setAttribute("x",e.translate.x.toString()),t.setAttribute("y",e.translate.y.toString())),e.onClick&&t.addEventListener("click",e.onClick),t}function LR(e){var t=document.createElementNS(pr,"circle");return t.setAttribute("cx",e.radius.toString()),t.setAttribute("cy",e.radius.toString()),t.setAttribute("r",e.radius.toString()),e.id&&t.setAttribute("id",e.id),e.fill&&t.setAttribute("fill",e.fill),t}function IR(e){var t=document.createElementNS(pr,"rect");return t.setAttribute("width",e.width.toString()),t.setAttribute("height",e.height.toString()),e.borderRadius&&t.setAttribute("rx",e.borderRadius.toString()),e.fill&&t.setAttribute("fill",e.fill||"none"),e.stroke&&t.setAttribute("stroke",e.stroke),t}function ol(e){var t=document.createElementNS(pr,"path");return t.setAttribute("d",e.d),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e.strokeWidth&&t.setAttribute("stroke-width",e.strokeWidth.toString()),e.translate&&t.setAttribute("transform","translate("+e.translate.x+", "+e.translate.y+")"),t}function pv(e){var t=document.createElementNS(pr,"use");return t.setAttribute("href","#"+e),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+e),t}function NR(){return document.createElementNS(pr,"clipPath")}function BR(e){var t=document.createElementNS(pr,"defs");return e.forEach(function(n){return t.appendChild(n)}),t}function DR(e){var t=document.createElementNS(pr,"foreignObject");t.setAttribute("width",e.width.toString()),e.translate&&(t.setAttribute("x",e.translate.x.toString()),t.setAttribute("y",e.translate.y.toString()));var n=document.createElement("p");return n.textContent=e.content,t.appendChild(n),t}var Yo=10,Rb=5;function FR(e,t){var n=IR({width:0,height:0,borderRadius:e.style.label.borderRadius,stroke:e.style.label.strokeColor||t.style.color,fill:e.style.label.bgColor}),r=va({content:e.name,translate:{x:Yo,y:0},font:e.style.label.font,fill:e.style.label.color||t.style.color}),s=Kt({children:[n]}),o=new MutationObserver(function(){var a=r.getBBox(),i=a.height,l=a.width,c=l+2*Yo,u=i+2*Rb;n.setAttribute("width",c.toString()),n.setAttribute("height",u.toString()),r.setAttribute("y",(u/2).toString())});return o.observe(s,{attributes:!1,subtree:!1,childList:!0}),s.appendChild(r),s}var Pc=10,VR=5;function HR(e){var t=ol({d:"",fill:e.style.bgColor,stroke:e.style.strokeColor}),n=va({content:e.name,fill:e.style.color,font:e.style.font,translate:{x:0,y:0}}),r=Kt({children:[t]}),s=e.style.pointerWidth,o=new MutationObserver(function(){var a=n.getBBox(),i=a.height,l=a.width;if(!(i===0||l===0)){var c=e.style.borderRadius,u=s+l+2*Pc,f=i+2*VR,h=["M 0,0","L "+s+","+f/2,"V "+f/2,"Q "+s+","+f/2+" "+(s+c)+","+f/2,"H "+(u-c),"Q "+u+","+f/2+" "+u+","+(f/2-c),"V -"+(f/2-c),"Q "+u+",-"+f/2+" "+(u-c)+",-"+f/2,"H "+(s+c),"Q "+s+",-"+f/2+" "+s+",-"+f/2,"V -"+f/2,"z"].join(" ");t.setAttribute("d",h.toString()),n.setAttribute("x",(s+Pc).toString())}});return o.observe(r,{attributes:!1,subtree:!1,childList:!0}),r.appendChild(n),r}var Go=10,Jn=10;function zR(e){var t=ol({d:"",fill:"#EEE"}),n=va({translate:{x:Jn+Go,y:0},content:e.hashAbbrev+" - "+e.subject,fill:"#333"}),r=e.style.dot.size*2,s=Kt({translate:{x:r,y:r/2},children:[t]}),o=new MutationObserver(function(){var a=n.getBBox().width,i=5,l=50,c=Jn+a+2*Go,u=["M 0,0","L "+Jn+","+Jn,"V "+(l/2-i),"Q "+Jn+","+l/2+" "+(Jn+i)+","+l/2,"H "+(c-i),"Q "+c+","+l/2+" "+c+","+(l/2-i),"V -"+(l/2-i),"Q "+c+",-"+l/2+" "+(c-i)+",-"+l/2,"H "+(Jn+i),"Q "+Jn+",-"+l/2+" "+Jn+",-"+(l/2-i),"V -"+Jn,"z"].join(" ");t.setAttribute("d",u.toString())});return o.observe(s,{attributes:!1,subtree:!1,childList:!0}),s.appendChild(n),s}function T$(e,t){var n={},r={},s=!1,o,a,i=0,l=null,c=$R();h(!!(t&&t.responsive)),e.appendChild(c),t&&t.responsive&&e.setAttribute("style","display:inline-block; position: relative; width:100%; padding-bottom:100%; vertical-align:middle; overflow:hidden;");var u=new Ns.GitgraphCore(t);return u.subscribe(function(A){s=!0,f(A)}),u.getUserApi();function f(A){n={};var M=A.commits,W=A.branchesPaths;i=A.commitMessagesX,o=A,a=v(M),c.innerHTML="",c.appendChild(Kt({translate:{x:Yo,y:Go},children:[p(W),a]}))}function h(A){var M=new MutationObserver(function(){s?(s=!1,W(),f(o)):(j(),L(A))});M.observe(c,{attributes:!1,subtree:!0,childList:!0});function W(){var $=Array.from(a.children),F=0,E=u.orientation===Ns.Orientation.VerticalReverse?$:$.reverse();r=E.reduce(function(T,H){var Y=parseInt(H.getAttribute("transform").split(",")[1].slice(0,-1),10),K=H.getElementsByTagName("foreignObject")[0],X=K&&K.firstElementChild;return T[Y]=Y+F,F+=vv(X),T},{})}function j(){if(!u.isHorizontal){var $=10;Object.keys(n).forEach(function(F){var E=n[F],T=E.branchLabel,H=E.tags,Y=E.message,K=i;if(T){m(T,K);var X=T.getBBox().width+2*Yo;K+=X+$}H.forEach(function(G){m(G,K);var oe=parseFloat(G.getAttribute("data-offset")||"0"),ge=G.getBBox().width+2*Pc+oe;K+=ge+$}),Y&&m(Y,K)})}}function L($){var F=c.getBBox(),E=F.height,T=F.width,H=50,Y=20,K=u.isHorizontal?H:Yo+Go,X=u.isHorizontal?H:Rb+Go+Y;$?(c.setAttribute("preserveAspectRatio","xMinYMin meet"),c.setAttribute("viewBox","0 0 "+(T+K)+" "+(E+X))):(c.setAttribute("width",(T+K).toString()),c.setAttribute("height",(E+X).toString()))}}function m(A,M){var W=A.getAttribute("transform")||"translate(0, 0)";A.setAttribute("transform",W.replace(/translate\(([\d\.]+),/,"translate("+M+","))}function p(A){var M=u.template.commit.dot.size,W=u.template.branch.mergeStyle===Ns.MergeStyle.Bezier,j=Array.from(A).map(function(L){var $=L[0],F=L[1];return ol({d:Ns.toSvgPath(F.map(function(E){return E.map(C)}),W,u.isVertical),fill:"none",stroke:$.computedColor||"",strokeWidth:$.style.lineWidth,translate:{x:M,y:M}})});return Kt({children:j})}function v(A){return Kt({children:A.map(M)});function M(j){var L=C(j),$=L.x,F=L.y;return Kt({translate:{x:$,y:F},children:[g(j)].concat(W(j),[Kt({translate:{x:-$,y:0},children:[b(j)].concat(k(j),w(j))})])})}function W(j){if(!u.template.arrow.size)return[null];var L=j.style.dot.size;return j.parents.map(function($){var F=A.find(function(H){var Y=H.hash;return Y===$});if(!F)return null;var E=u.reverseArrow?{x:L+(F.x-j.x),y:L+(F.y-j.y)}:{x:L,y:L},T=ol({d:Ns.arrowSvgPath(u,F,j),fill:u.template.arrow.color||""});return Kt({translate:E,children:[T]})})}}function b(A){if(!A.style.message.display)return null;var M;if(A.renderMessage)return M=Kt({children:[]}),_(M),M.appendChild(A.renderMessage(A)),P(A,M),M;var W=va({content:A.message,fill:A.style.message.color||"",font:A.style.message.font,onClick:A.onMessageClick});if(M=Kt({translate:{x:0,y:A.style.dot.size},children:[W]}),A.body){var j=DR({width:600,translate:{x:10,y:0},content:A.body});_(M),M.appendChild(j)}return P(A,M),M}function _(A){var M=new MutationObserver(function(j){j.forEach(function(L){var $=L.target;return W($)})});M.observe(A,{attributes:!1,subtree:!1,childList:!0});function W(j){if(j.nodeName==="foreignObject"){var L=j.firstChild&&j.firstChild.parentElement;if(!L)return;L.setAttribute("height",vv(L.firstElementChild).toString())}j.childNodes.forEach(W)}}function k(A){var M=Array.from(u.branches.values());return M.map(function(W){if(!W.style.label.display)return null;if(!u.branchLabelOnEveryCommit){var j=u.refs.getCommit(W.name);if(A.hash!==j)return null}if(A.branchToDisplay!==W.name)return null;var L=W.renderLabel?W.renderLabel(W):FR(W,A),$;if(u.isVertical)$=Kt({children:[L]});else{var F=A.style.dot.size*2,E=10;$=Kt({translate:{x:A.x,y:F+E},children:[L]})}return S(A,$),$})}function w(A){return A.tags?u.isHorizontal?[]:A.tags.map(function(M){var W=M.render?M.render(M.name,M.style):HR(M),j=Kt({translate:{x:0,y:A.style.dot.size},children:[W]});return j.setAttribute("data-offset",M.style.pointerWidth.toString()),x(A,j),j}):[]}function g(A){if(A.renderDot)return A.renderDot(A);var M=A.hash,W=LR({id:M,radius:A.style.dot.size,fill:A.style.dot.color||""}),j="clip-"+A.hash,L=NR();L.setAttribute("id",j),L.appendChild(pv(M));var $=pv(M);$.setAttribute("clip-path","url(#"+j+")"),$.setAttribute("stroke",A.style.dot.strokeColor||"");var F=A.style.dot.strokeWidth?A.style.dot.strokeWidth*2:0;$.setAttribute("stroke-width",F.toString());var E=A.dotText?va({content:A.dotText,font:A.style.dot.font,anchor:"middle",translate:{x:A.style.dot.size,y:A.style.dot.size}}):null;return Kt({onClick:A.onClick,onMouseOver:function(){y(A),A.onMouseOver()},onMouseOut:function(){l&&l.remove(),A.onMouseOut()},children:[BR([W,L]),$,E]})}function y(A){if(c.firstChild&&!(u.isVertical&&u.mode!==Ns.Mode.Compact)&&!(u.isVertical&&!A.style.hasTooltipInCompactMode)){var M=A.renderTooltip?A.renderTooltip(A):zR(A);l=Kt({translate:C(A),children:[M]}),c.firstChild.appendChild(l)}}function C(A){var M=A.x,W=A.y;return{x:M,y:r[W]||W}}function S(A,M){n[A.hashAbbrev]||D(A),n[A.hashAbbrev].branchLabel=M}function P(A,M){n[A.hashAbbrev]||D(A),n[A.hashAbbrev].message=M}function x(A,M){n[A.hashAbbrev]||D(A),n[A.hashAbbrev].tags.push(M)}function D(A){n[A.hashAbbrev]={branchLabel:null,tags:[],message:null}}}function vv(e){var t=0;if(e){var n=e.getBoundingClientRect().height,r=window.getComputedStyle(e).marginTop||"0px",s=parseInt(r.replace("px",""),10);t=n+s}return t}export{t$ as $,je as A,wd as B,Me as C,Pl as D,E$ as E,Ke as F,kt as G,YR as H,f$ as I,rt as J,S$ as K,Xu as L,Ks as M,tt as N,I as O,n$ as P,k$ as Q,u$ as R,Cr as S,fr as T,s$ as U,g$ as V,m$ as W,Tt as X,Ze as Y,a$ as Z,XR as _,co as a,qR as a0,h$ as a1,c$ as a2,b$ as a3,Fe as a4,Lt as a5,h3 as a6,JR as a7,ut as a8,o$ as a9,QR as aa,e$ as ab,Js as ac,d$ as ad,l$ as ae,y$ as af,i$ as ag,C$ as ah,_$ as ai,T$ as aj,ZR as ak,p$ as al,v$ as am,Zk as an,Ye as ao,cw as ap,jR as aq,se as b,O as c,WR as d,q as e,R as f,U as g,re as h,xa as i,ie as j,w$ as k,Cu as l,Qi as m,KR as n,dt as o,ca as p,GR as q,V as r,UR as s,r$ as t,d as u,fe as v,Ee as w,ye as x,px as y,_t as z};
|
|
45
|
+
*/const KP=function(e,t){if(e&&e.addEventListener){const n=function(r){const s=WP(r);t&&Reflect.apply(t,this,[r,s])};e.addEventListener("wheel",n,{passive:!0})}},UP={beforeMount(e,t){KP(e,t.value)}};let qP=1;const YP=se({name:"ElTable",directives:{Mousewheel:UP},components:{TableHeader:CP,TableBody:MP,TableFooter:$P,ElScrollbar:Ll,hColgroup:rb},props:BP,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change","scroll"],setup(e){const{t}=It(),n=Re("table"),r=st();St(Yn,r);const s=fP(r,e);r.store=s;const o=new pP({store:r.store,table:r,fit:e.fit,showHeader:e.showHeader});r.layout=o;const a=O(()=>(s.states.data.value||[]).length===0),{setCurrentRow:i,getSelectionRows:l,toggleRowSelection:c,clearSelection:u,clearFilter:f,toggleAllSelection:h,toggleRowExpansion:m,clearSort:p,sort:v,updateKeyChildren:b}=LP(s),{isHidden:_,renderExpanded:k,setDragVisible:w,isGroup:g,handleMouseLeave:y,handleHeaderFooterMousewheel:C,tableSize:S,emptyBlockStyle:P,handleFixedMousewheel:x,resizeProxyVisible:D,bodyWidth:A,resizeState:M,doLayout:W,tableBodyStyles:j,tableLayout:L,scrollbarViewStyle:$,scrollbarStyle:F}=IP(e,o,s,r),{scrollBarRef:E,scrollTo:T,setScrollLeft:H,setScrollTop:Y}=DP(),K=qr(W,50),X=`${n.namespace.value}-table_${qP++}`;r.tableId=X,r.state={isGroup:g,resizeState:M,doLayout:W,debouncedUpdateLayout:K};const G=O(()=>{var le;return(le=e.sumText)!=null?le:t("el.table.sumText")}),oe=O(()=>{var le;return(le=e.emptyText)!=null?le:t("el.table.emptyText")}),ge=O(()=>nb(s.states.originColumns.value)[0]);return NP(r),Lt(()=>{K.cancel()}),{ns:n,layout:o,store:s,columns:ge,handleHeaderFooterMousewheel:C,handleMouseLeave:y,tableId:X,tableSize:S,isHidden:_,isEmpty:a,renderExpanded:k,resizeProxyVisible:D,resizeState:M,isGroup:g,bodyWidth:A,tableBodyStyles:j,emptyBlockStyle:P,debouncedUpdateLayout:K,handleFixedMousewheel:x,setCurrentRow:i,getSelectionRows:l,toggleRowSelection:c,clearSelection:u,clearFilter:f,toggleAllSelection:h,toggleRowExpansion:m,clearSort:p,doLayout:W,sort:v,updateKeyChildren:b,t,setDragVisible:w,context:r,computedSumText:G,computedEmptyText:oe,tableLayout:L,scrollbarViewStyle:$,scrollbarStyle:F,scrollBarRef:E,scrollTo:T,setScrollLeft:H,setScrollTop:Y,allowDragLastColumn:e.allowDragLastColumn}}});function GP(e,t,n,r,s,o){const a=wt("hColgroup"),i=wt("table-header"),l=wt("table-body"),c=wt("table-footer"),u=wt("el-scrollbar"),f=Gc("mousewheel");return R(),q("div",{ref:"tableWrapper",class:I([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:Ze(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:e.handleMouseLeave},[U("div",{class:I(e.ns.e("inner-wrapper"))},[U("div",{ref:"hiddenColumns",class:"hidden-columns"},[me(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?rt((R(),q("div",{key:0,ref:"headerWrapper",class:I(e.ns.e("header-wrapper"))},[U("table",{ref:"tableHeader",class:I(e.ns.e("header")),style:Ze(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),re(i,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,"allow-drag-last-column":e.allowDragLastColumn,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","append-filter-panel-to","allow-drag-last-column","onSetDragVisible"])],6)],2)),[[f,e.handleHeaderFooterMousewheel]]):fe("v-if",!0),U("div",{ref:"bodyWrapper",class:I(e.ns.e("body-wrapper"))},[re(u,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn,tabindex:e.scrollbarTabindex,onScroll:h=>e.$emit("scroll",h)},{default:ie(()=>[U("table",{ref:"tableBody",class:I(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:Ze({width:e.bodyWidth,tableLayout:e.tableLayout})},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(R(),ye(i,{key:0,ref:"tableHeaderRef",class:I(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort","store","append-filter-panel-to","onSetDragVisible"])):fe("v-if",!0),re(l,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"tooltip-options":e.tooltipOptions,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),e.showSummary&&e.tableLayout==="auto"?(R(),ye(c,{key:1,class:I(e.ns.e("body-footer")),border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):fe("v-if",!0)],6),e.isEmpty?(R(),q("div",{key:0,ref:"emptyBlock",style:Ze(e.emptyBlockStyle),class:I(e.ns.e("empty-block"))},[U("span",{class:I(e.ns.e("empty-text"))},[me(e.$slots,"empty",{},()=>[_t(Me(e.computedEmptyText),1)])],2)],6)):fe("v-if",!0),e.$slots.append?(R(),q("div",{key:1,ref:"appendWrapper",class:I(e.ns.e("append-wrapper"))},[me(e.$slots,"append")],2)):fe("v-if",!0)]),_:3},8,["view-style","wrap-style","always","tabindex","onScroll"])],2),e.showSummary&&e.tableLayout==="fixed"?rt((R(),q("div",{key:1,ref:"footerWrapper",class:I(e.ns.e("footer-wrapper"))},[U("table",{class:I(e.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:Ze(e.tableBodyStyles)},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),re(c,{border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[Tt,!e.isEmpty],[f,e.handleHeaderFooterMousewheel]]):fe("v-if",!0),e.border||e.isGroup?(R(),q("div",{key:2,class:I(e.ns.e("border-left-patch"))},null,2)):fe("v-if",!0)],2),rt(U("div",{ref:"resizeProxy",class:I(e.ns.e("column-resize-proxy"))},null,2),[[Tt,e.resizeProxyVisible]])],46,["data-prefix","onMouseleave"])}var XP=We(YP,[["render",GP],["__file","table.vue"]]);const JP={selection:"table-column--selection",expand:"table__expand-column"},ZP={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},QP=e=>JP[e]||"",e6={selection:{renderHeader({store:e,column:t}){function n(){return e.states.data.value&&e.states.data.value.length===0}return Ye(so,{disabled:n(),size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value,ariaLabel:t.label})},renderCell({row:e,column:t,store:n,$index:r}){return Ye(so,{disabled:t.selectable?!t.selectable.call(null,e,r):!1,size:n.states.tableSize.value,onChange:()=>{n.commit("rowSelectedChanged",e)},onClick:s=>s.stopPropagation(),modelValue:n.isSelected(e),ariaLabel:t.label})},sortable:!1,resizable:!1},index:{renderHeader({column:e}){return e.label||"#"},renderCell({column:e,$index:t}){let n=t+1;const r=e.index;return Xe(r)?n=t+r:ke(r)&&(n=r(t)),Ye("div",{},[n])},sortable:!1},expand:{renderHeader({column:e}){return e.label||""},renderCell({row:e,store:t,expanded:n}){const{ns:r}=t,s=[r.e("expand-icon")];return n&&s.push(r.em("expand-icon","expanded")),Ye("div",{class:s,onClick:function(a){a.stopPropagation(),t.toggleRowExpansion(e)}},{default:()=>[Ye(je,null,{default:()=>[Ye(Ks)]})]})},sortable:!1,resizable:!1}};function t6({row:e,column:t,$index:n}){var r;const s=t.property,o=s&&zo(e,s).value;return t&&t.formatter?t.formatter(e,t,o,n):((r=o==null?void 0:o.toString)==null?void 0:r.call(o))||""}function n6({row:e,treeNode:t,store:n},r=!1){const{ns:s}=n;if(!t)return r?[Ye("span",{class:s.e("placeholder")})]:null;const o=[],a=function(i){i.stopPropagation(),!t.loading&&n.loadOrToggle(e)};if(t.indent&&o.push(Ye("span",{class:s.e("indent"),style:{"padding-left":`${t.indent}px`}})),xt(t.expanded)&&!t.noLazyChildren){const i=[s.e("expand-icon"),t.expanded?s.em("expand-icon","expanded"):""];let l=Ks;t.loading&&(l=Js),o.push(Ye("div",{class:i,onClick:a},{default:()=>[Ye(je,{class:{[s.is("loading")]:t.loading}},{default:()=>[Ye(l)]})]}))}else o.push(Ye("span",{class:s.e("placeholder")}));return o}function zp(e,t){return e.reduce((n,r)=>(n[r]=r,n),t)}function r6(e,t){const n=st();return{registerComplexWatchers:()=>{const o=["fixed"],a={realWidth:"width",realMinWidth:"minWidth"},i=zp(o,a);Object.keys(i).forEach(l=>{const c=a[l];et(t,c)&&Ee(()=>t[c],u=>{let f=u;c==="width"&&l==="realWidth"&&(f=Wd(u)),c==="minWidth"&&l==="realMinWidth"&&(f=X0(u)),n.columnConfig.value[c]=f,n.columnConfig.value[l]=f;const h=c==="fixed";e.value.store.scheduleLayout(h)})})},registerNormalWatchers:()=>{const o=["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip","tooltipFormatter"],a={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},i=zp(o,a);Object.keys(i).forEach(l=>{const c=a[l];et(t,c)&&Ee(()=>t[c],u=>{n.columnConfig.value[l]=u})})}}}function s6(e,t,n){const r=st(),s=V(""),o=V(!1),a=V(),i=V(),l=Re("table");Kr(()=>{a.value=e.align?`is-${e.align}`:null,a.value}),Kr(()=>{i.value=e.headerAlign?`is-${e.headerAlign}`:a.value,i.value});const c=O(()=>{let g=r.vnode.vParent||r.parent;for(;g&&!g.tableId&&!g.columnId;)g=g.vnode.vParent||g.parent;return g}),u=O(()=>{const{store:g}=r.parent;if(!g)return!1;const{treeData:y}=g.states,C=y.value;return C&&Object.keys(C).length>0}),f=V(Wd(e.width)),h=V(X0(e.minWidth)),m=g=>(f.value&&(g.width=f.value),h.value&&(g.minWidth=h.value),!f.value&&h.value&&(g.width=void 0),g.minWidth||(g.minWidth=80),g.realWidth=Number(Ct(g.width)?g.minWidth:g.width),g),p=g=>{const y=g.type,C=e6[y]||{};Object.keys(C).forEach(P=>{const x=C[P];P!=="className"&&!Ct(x)&&(g[P]=x)});const S=QP(y);if(S){const P=`${d(l.namespace)}-${S}`;g.className=g.className?`${g.className} ${P}`:P}return g},v=g=>{pe(g)?g.forEach(C=>y(C)):y(g);function y(C){var S;((S=C==null?void 0:C.type)==null?void 0:S.name)==="ElTableColumn"&&(C.vParent=r)}};return{columnId:s,realAlign:a,isSubColumn:o,realHeaderAlign:i,columnOrTableParent:c,setColumnWidth:m,setColumnForcedProps:p,setColumnRenders:g=>{e.renderHeader||g.type!=="selection"&&(g.renderHeader=C=>(r.columnConfig.value.label,me(t,"header",C,()=>[g.label]))),t["filter-icon"]&&(g.renderFilterIcon=C=>me(t,"filter-icon",C));let y=g.renderCell;return g.type==="expand"?(g.renderCell=C=>Ye("div",{class:"cell"},[y(C)]),n.value.renderExpanded=C=>t.default?t.default(C):t.default):(y=y||t6,g.renderCell=C=>{let S=null;if(t.default){const W=t.default(C);S=W.some(j=>j.type!==jt)?W:y(C)}else S=y(C);const{columns:P}=n.value.store.states,x=P.value.findIndex(W=>W.type==="default"),D=u.value&&C.cellIndex===x,A=n6(C,D),M={class:"cell",style:{}};return g.showOverflowTooltip&&(M.class=`${M.class} ${d(l.namespace)}-tooltip`,M.style={width:`${(C.column.realWidth||Number(C.column.width))-1}px`}),v(S),Ye("div",M,[A,S])}),g},getPropsData:(...g)=>g.reduce((y,C)=>(pe(C)&&C.forEach(S=>{y[S]=e[S]}),y),{}),getColumnElIndex:(g,y)=>Array.prototype.indexOf.call(g,y),updateColumnOrder:()=>{n.value.store.commit("updateColumnOrder",r.columnConfig.value)}}}var o6={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},tooltipFormatter:Function,fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every(t=>["ascending","descending",null].includes(t))}};let a6=1;var db=se({name:"ElTableColumn",components:{ElCheckbox:so},props:o6,setup(e,{slots:t}){const n=st(),r=V({}),s=O(()=>{let w=n.parent;for(;w&&!w.tableId;)w=w.parent;return w}),{registerNormalWatchers:o,registerComplexWatchers:a}=r6(s,e),{columnId:i,isSubColumn:l,realHeaderAlign:c,columnOrTableParent:u,setColumnWidth:f,setColumnForcedProps:h,setColumnRenders:m,getPropsData:p,getColumnElIndex:v,realAlign:b,updateColumnOrder:_}=s6(e,t,s),k=u.value;i.value=`${k.tableId||k.columnId}_column_${a6++}`,ml(()=>{l.value=s.value!==k;const w=e.type||"default",g=e.sortable===""?!0:e.sortable,y=w==="selection"?!1:Ct(e.showOverflowTooltip)?k.props.showOverflowTooltip:e.showOverflowTooltip,C=Ct(e.tooltipFormatter)?k.props.tooltipFormatter:e.tooltipFormatter,S={...ZP[w],id:i.value,type:w,property:e.prop||e.property,align:b,headerAlign:c,showOverflowTooltip:y,tooltipFormatter:C,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:g,index:e.index,rawColumnKey:n.vnode.key};let M=p(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"]);M=eP(S,M),M=nP(m,f,h)(M),r.value=M,o(),a()}),dt(()=>{var w;const g=u.value,y=l.value?g.vnode.el.children:(w=g.refs.hiddenColumns)==null?void 0:w.children,C=()=>v(y||[],n.vnode.el);r.value.getColumnIndex=C,C()>-1&&s.value.store.commit("insertColumn",r.value,l.value?g.columnConfig.value:null,_)}),Lt(()=>{const w=r.value.getColumnIndex;(w?w():-1)>-1&&s.value.store.commit("removeColumn",r.value,l.value?k.columnConfig.value:null,_)}),n.columnId=i.value,n.columnConfig=r},render(){var e,t,n;try{const r=(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{},column:{},$index:-1}),s=[];if(pe(r))for(const a of r)((n=a.type)==null?void 0:n.name)==="ElTableColumn"||a.shapeFlag&2?s.push(a):a.type===Ke&&pe(a.children)&&a.children.forEach(i=>{(i==null?void 0:i.patchFlag)!==1024&&!Be(i==null?void 0:i.children)&&s.push(i)});return Ye("div",s)}catch{return Ye("div",[])}}});const _$=Ot(XP,{TableColumn:db}),C$=Os(db);function i6(e){let t;const n=V(!1),r=$t({...e,originalPosition:"",originalOverflow:"",visible:!1});function s(h){r.text=h}function o(){const h=r.parent,m=f.ns;if(!h.vLoadingAddClassList){let p=h.getAttribute("loading-number");p=Number.parseInt(p)-1,p?h.setAttribute("loading-number",p.toString()):(ir(h,m.bm("parent","relative")),h.removeAttribute("loading-number")),ir(h,m.bm("parent","hidden"))}a(),u.unmount()}function a(){var h,m;(m=(h=f.$el)==null?void 0:h.parentNode)==null||m.removeChild(f.$el)}function i(){var h;e.beforeClose&&!e.beforeClose()||(n.value=!0,clearTimeout(t),t=setTimeout(l,400),r.visible=!1,(h=e.closed)==null||h.call(e))}function l(){if(!n.value)return;const h=r.parent;n.value=!1,h.vLoadingAddClassList=void 0,o()}const u=cw(se({name:"ElLoading",setup(h,{expose:m}){const{ns:p,zIndex:v}=yd("loading");return m({ns:p,zIndex:v}),()=>{const b=r.spinner||r.svg,_=Ye("svg",{class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[Ye("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),k=r.text?Ye("p",{class:p.b("text")},[r.text]):void 0;return Ye(fr,{name:p.b("fade"),onAfterLeave:l},{default:ie(()=>[rt(re("div",{style:{backgroundColor:r.background||""},class:[p.b("mask"),r.customClass,r.fullscreen?"is-fullscreen":""]},[Ye("div",{class:p.b("spinner")},[_,k])]),[[Tt,r.visible]])])})}}})),f=u.mount(document.createElement("div"));return{...gn(r),setText:s,removeElLoadingChild:a,close:i,handleAfterLeave:l,vm:f,get $el(){return f.$el}}}let Xa;const l6=function(e={}){if(!ct)return;const t=u6(e);if(t.fullscreen&&Xa)return Xa;const n=i6({...t,closed:()=>{var s;(s=t.closed)==null||s.call(t),t.fullscreen&&(Xa=void 0)}});c6(t,t.parent,n),jp(t,t.parent,n),t.parent.vLoadingAddClassList=()=>jp(t,t.parent,n);let r=t.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",t.parent.setAttribute("loading-number",r),t.parent.appendChild(n.$el),Fe(()=>n.visible.value=t.visible),t.fullscreen&&(Xa=n),n},u6=e=>{var t,n,r,s;let o;return Be(e.target)?o=(t=document.querySelector(e.target))!=null?t:document.body:o=e.target||document.body,{parent:o===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(r=e.lock)!=null?r:!1,customClass:e.customClass||"",visible:(s=e.visible)!=null?s:!0,beforeClose:e.beforeClose,closed:e.closed,target:o}},c6=async(e,t,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,s={};if(e.fullscreen)n.originalPosition.value=as(document.body,"position"),n.originalOverflow.value=as(document.body,"overflow"),s.zIndex=r();else if(e.parent===document.body){n.originalPosition.value=as(document.body,"position"),await Fe();for(const o of["top","left"]){const a=o==="top"?"scrollTop":"scrollLeft";s[o]=`${e.target.getBoundingClientRect()[o]+document.body[a]+document.documentElement[a]-Number.parseInt(as(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])s[o]=`${e.target.getBoundingClientRect()[o]}px`}else n.originalPosition.value=as(t,"position");for(const[o,a]of Object.entries(s))n.$el.style[o]=a},jp=(e,t,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?ir(t,r.bm("parent","relative")):ys(t,r.bm("parent","relative")),e.fullscreen&&e.lock?ys(t,r.bm("parent","hidden")):ir(t,r.bm("parent","hidden"))},Mi=Symbol("ElLoading"),Wp=(e,t)=>{var n,r,s,o;const a=t.instance,i=h=>Ue(t.value)?t.value[h]:void 0,l=h=>{const m=Be(h)&&(a==null?void 0:a[h])||h;return m&&V(m)},c=h=>l(i(h)||e.getAttribute(`element-loading-${kr(h)}`)),u=(n=i("fullscreen"))!=null?n:t.modifiers.fullscreen,f={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:u,target:(r=i("target"))!=null?r:u?void 0:e,body:(s=i("body"))!=null?s:t.modifiers.body,lock:(o=i("lock"))!=null?o:t.modifiers.lock};e[Mi]={options:f,instance:l6(f)}},d6=(e,t)=>{for(const n of Object.keys(t))ft(t[n])&&(t[n].value=e[n])},S$={mounted(e,t){t.value&&Wp(e,t)},updated(e,t){const n=e[Mi];t.oldValue!==t.value&&(t.value&&!t.oldValue?Wp(e,t):t.value&&t.oldValue?Ue(t.value)&&d6(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[Mi])==null||t.instance.close(),e[Mi]=null}},fb=["success","info","warning","error"],Jt=Ug({customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:ct?document.body:void 0}),f6=De({customClass:{type:String,default:Jt.customClass},dangerouslyUseHTMLString:{type:Boolean,default:Jt.dangerouslyUseHTMLString},duration:{type:Number,default:Jt.duration},icon:{type:Cn,default:Jt.icon},id:{type:String,default:Jt.id},message:{type:_e([String,Object,Function]),default:Jt.message},onClose:{type:_e(Function),default:Jt.onClose},showClose:{type:Boolean,default:Jt.showClose},type:{type:String,values:fb,default:Jt.type},plain:{type:Boolean,default:Jt.plain},offset:{type:Number,default:Jt.offset},zIndex:{type:Number,default:Jt.zIndex},grouping:{type:Boolean,default:Jt.grouping},repeatNum:{type:Number,default:Jt.repeatNum}}),h6={destroy:()=>!0},Dn=Dv([]),p6=e=>{const t=Dn.findIndex(s=>s.id===e),n=Dn[t];let r;return t>0&&(r=Dn[t-1]),{current:n,prev:r}},v6=e=>{const{prev:t}=p6(e);return t?t.vm.exposed.bottom.value:0},m6=(e,t)=>Dn.findIndex(r=>r.id===e)>0?16:t,g6=se({name:"ElMessage"}),b6=se({...g6,props:f6,emits:h6,setup(e,{expose:t,emit:n}){const r=e,{Close:s}=_d,o=V(!1),{ns:a,zIndex:i}=yd("message"),{currentZIndex:l,nextZIndex:c}=i,u=V(),f=V(!1),h=V(0);let m;const p=O(()=>r.type?r.type==="error"?"danger":r.type:"info"),v=O(()=>{const x=r.type;return{[a.bm("icon",x)]:x&&Zs[x]}}),b=O(()=>r.icon||Zs[r.type]||""),_=O(()=>v6(r.id)),k=O(()=>m6(r.id,r.offset)+_.value),w=O(()=>h.value+k.value),g=O(()=>({top:`${k.value}px`,zIndex:l.value}));function y(){r.duration!==0&&({stop:m}=Yu(()=>{S()},r.duration))}function C(){m==null||m()}function S(){f.value=!1,Fe(()=>{var x;o.value||((x=r.onClose)==null||x.call(r),n("destroy"))})}function P({code:x}){x===it.esc&&S()}return dt(()=>{y(),c(),f.value=!0}),Ee(()=>r.repeatNum,()=>{C(),y()}),Gt(document,"keydown",P),fn(u,()=>{h.value=u.value.getBoundingClientRect().height}),t({visible:f,bottom:w,close:S}),(x,D)=>(R(),ye(fr,{name:d(a).b("fade"),onBeforeEnter:A=>o.value=!0,onBeforeLeave:x.onClose,onAfterLeave:A=>x.$emit("destroy"),persisted:""},{default:ie(()=>[rt(U("div",{id:x.id,ref_key:"messageRef",ref:u,class:I([d(a).b(),{[d(a).m(x.type)]:x.type},d(a).is("closable",x.showClose),d(a).is("plain",x.plain),x.customClass]),style:Ze(d(g)),role:"alert",onMouseenter:C,onMouseleave:y},[x.repeatNum>1?(R(),ye(d(h3),{key:0,value:x.repeatNum,type:d(p),class:I(d(a).e("badge"))},null,8,["value","type","class"])):fe("v-if",!0),d(b)?(R(),ye(d(je),{key:1,class:I([d(a).e("icon"),d(v)])},{default:ie(()=>[(R(),ye(ut(d(b))))]),_:1},8,["class"])):fe("v-if",!0),me(x.$slots,"default",{},()=>[x.dangerouslyUseHTMLString?(R(),q(Ke,{key:1},[fe(" Caution here, message could've been compromised, never use user's input as message "),U("p",{class:I(d(a).e("content")),innerHTML:x.message},null,10,["innerHTML"])],2112)):(R(),q("p",{key:0,class:I(d(a).e("content"))},Me(x.message),3))]),x.showClose?(R(),ye(d(je),{key:2,class:I(d(a).e("closeBtn")),onClick:tt(S,["stop"])},{default:ie(()=>[re(d(s))]),_:1},8,["class","onClick"])):fe("v-if",!0)],46,["id"]),[[Tt,f.value]])]),_:3},8,["name","onBeforeEnter","onBeforeLeave","onAfterLeave"]))}});var y6=We(b6,[["__file","message.vue"]]);let w6=1;const hb=e=>{const t=!e||Be(e)||jn(e)||ke(e)?{message:e}:e,n={...Jt,...t};if(!n.appendTo)n.appendTo=document.body;else if(Be(n.appendTo)){let r=document.querySelector(n.appendTo);En(r)||(r=document.body),n.appendTo=r}return xt(er.grouping)&&!n.grouping&&(n.grouping=er.grouping),Xe(er.duration)&&n.duration===3e3&&(n.duration=er.duration),Xe(er.offset)&&n.offset===16&&(n.offset=er.offset),xt(er.showClose)&&!n.showClose&&(n.showClose=er.showClose),n},_6=e=>{const t=Dn.indexOf(e);if(t===-1)return;Dn.splice(t,1);const{handler:n}=e;n.close()},C6=({appendTo:e,...t},n)=>{const r=`message_${w6++}`,s=t.onClose,o=document.createElement("div"),a={...t,id:r,onClose:()=>{s==null||s(),_6(u)},onDestroy:()=>{Gs(null,o)}},i=re(y6,a,ke(a.message)||jn(a.message)?{default:ke(a.message)?a.message:()=>a.message}:null);i.appContext=n||lo._context,Gs(i,o),e.appendChild(o.firstElementChild);const l=i.component,u={id:r,vnode:i,vm:l,handler:{close:()=>{l.exposed.close()}},props:i.component.props};return u},lo=(e={},t)=>{if(!ct)return{close:()=>{}};const n=hb(e);if(n.grouping&&Dn.length){const s=Dn.find(({vnode:o})=>{var a;return((a=o.props)==null?void 0:a.message)===n.message});if(s)return s.props.repeatNum+=1,s.props.type=n.type,s.handler}if(Xe(er.max)&&Dn.length>=er.max)return{close:()=>{}};const r=C6(n,t);return Dn.push(r),r.handler};fb.forEach(e=>{lo[e]=(t={},n)=>{const r=hb(t);return lo({...r,type:e},n)}});function S6(e){const t=[...Dn];for(const n of t)(!e||e===n.props.type)&&n.handler.close()}lo.closeAll=S6;lo._context=null;const E$=vk(lo,"$message"),Ec="_trap-focus-children",cs=[],Kp=e=>{if(cs.length===0)return;const t=cs[cs.length-1][Ec];if(t.length>0&&e.code===it.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const n=e.shiftKey,r=e.target===t[0],s=e.target===t[t.length-1];r&&n&&(e.preventDefault(),t[t.length-1].focus()),s&&!n&&(e.preventDefault(),t[0].focus())}},E6={beforeMount(e){e[Ec]=Hh(e),cs.push(e),cs.length<=1&&document.addEventListener("keydown",Kp)},updated(e){Fe(()=>{e[Ec]=Hh(e)})},unmounted(){cs.shift(),cs.length===0&&document.removeEventListener("keydown",Kp)}},k6=se({name:"ElMessageBox",directives:{TrapFocus:E6},components:{ElButton:ca,ElFocusTrap:Td,ElInput:Cr,ElOverlay:B0,ElIcon:je,..._d},inheritAttrs:!1,props:{buttonSize:{type:String,validator:q0},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:r,ns:s,size:o}=yd("message-box",O(()=>e.buttonSize)),{t:a}=n,{nextZIndex:i}=r,l=V(!1),c=$t({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:qs(Js),cancelButtonLoadingIcon:qs(Js),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:i()}),u=O(()=>{const $=c.type;return{[s.bm("icon",$)]:$&&Zs[$]}}),f=lr(),h=lr(),m=O(()=>{const $=c.type;return c.icon||$&&Zs[$]||""}),p=O(()=>!!c.message),v=V(),b=V(),_=V(),k=V(),w=V(),g=O(()=>c.confirmButtonClass);Ee(()=>c.inputValue,async $=>{await Fe(),e.boxType==="prompt"&&$&&M()},{immediate:!0}),Ee(()=>l.value,$=>{var F,E;$&&(e.boxType!=="prompt"&&(c.autofocus?_.value=(E=(F=w.value)==null?void 0:F.$el)!=null?E:v.value:_.value=v.value),c.zIndex=i()),e.boxType==="prompt"&&($?Fe().then(()=>{var T;k.value&&k.value.$el&&(c.autofocus?_.value=(T=W())!=null?T:v.value:_.value=v.value)}):(c.editorErrorMessage="",c.validateError=!1))});const y=O(()=>e.draggable),C=O(()=>e.overflow);V0(v,b,y,C),dt(async()=>{await Fe(),e.closeOnHashChange&&window.addEventListener("hashchange",S)}),Lt(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",S)});function S(){l.value&&(l.value=!1,Fe(()=>{c.action&&t("action",c.action)}))}const P=()=>{e.closeOnClickModal&&A(c.distinguishCancelAndClose?"close":"cancel")},x=zd(P),D=$=>{if(c.inputType!=="textarea")return $.preventDefault(),A("confirm")},A=$=>{var F;e.boxType==="prompt"&&$==="confirm"&&!M()||(c.action=$,c.beforeClose?(F=c.beforeClose)==null||F.call(c,$,c,S):S())},M=()=>{if(e.boxType==="prompt"){const $=c.inputPattern;if($&&!$.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||a("el.messagebox.error"),c.validateError=!0,!1;const F=c.inputValidator;if(ke(F)){const E=F(c.inputValue);if(E===!1)return c.editorErrorMessage=c.inputErrorMessage||a("el.messagebox.error"),c.validateError=!0,!1;if(Be(E))return c.editorErrorMessage=E,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},W=()=>{var $,F;const E=($=k.value)==null?void 0:$.$refs;return(F=E==null?void 0:E.input)!=null?F:E==null?void 0:E.textarea},j=()=>{A("close")},L=()=>{e.closeOnPressEscape&&j()};return e.lockScroll&&H0(l),{...gn(c),ns:s,overlayEvent:x,visible:l,hasMessage:p,typeClass:u,contentId:f,inputId:h,btnSize:o,iconComponent:m,confirmButtonClasses:g,rootRef:v,focusStartRef:_,headerRef:b,inputRef:k,confirmRef:w,doClose:S,handleClose:j,onCloseRequested:L,handleWrapperClick:P,handleInputEnter:D,handleAction:A,t:a}}});function O6(e,t,n,r,s,o){const a=wt("el-icon"),i=wt("el-input"),l=wt("el-button"),c=wt("el-focus-trap"),u=wt("el-overlay");return R(),ye(fr,{name:"fade-in-linear",onAfterLeave:f=>e.$emit("vanish"),persisted:""},{default:ie(()=>[rt(re(u,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:ie(()=>[U("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:I(`${e.ns.namespace.value}-overlay-message-box`),onClick:e.overlayEvent.onClick,onMousedown:e.overlayEvent.onMousedown,onMouseup:e.overlayEvent.onMouseup},[re(c,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:ie(()=>[U("div",{ref:"rootRef",class:I([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:Ze(e.customStyle),tabindex:"-1",onClick:tt(()=>{},["stop"])},[e.title!==null&&e.title!==void 0?(R(),q("div",{key:0,ref:"headerRef",class:I([e.ns.e("header"),{"show-close":e.showClose}])},[U("div",{class:I(e.ns.e("title"))},[e.iconComponent&&e.center?(R(),ye(a,{key:0,class:I([e.ns.e("status"),e.typeClass])},{default:ie(()=>[(R(),ye(ut(e.iconComponent)))]),_:1},8,["class"])):fe("v-if",!0),U("span",null,Me(e.title),1)],2),e.showClose?(R(),q("button",{key:0,type:"button",class:I(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:Pt(tt(f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[re(a,{class:I(e.ns.e("close"))},{default:ie(()=>[(R(),ye(ut(e.closeIcon||"close")))]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):fe("v-if",!0)],2)):fe("v-if",!0),U("div",{id:e.contentId,class:I(e.ns.e("content"))},[U("div",{class:I(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(R(),ye(a,{key:0,class:I([e.ns.e("status"),e.typeClass])},{default:ie(()=>[(R(),ye(ut(e.iconComponent)))]),_:1},8,["class"])):fe("v-if",!0),e.hasMessage?(R(),q("div",{key:1,class:I(e.ns.e("message"))},[me(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(R(),ye(ut(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(R(),ye(ut(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:ie(()=>[_t(Me(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):fe("v-if",!0)],2),rt(U("div",{class:I(e.ns.e("input"))},[re(i,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":f=>e.inputValue=f,type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:I({invalid:e.validateError}),onKeydown:Pt(e.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),U("div",{class:I(e.ns.e("errormsg")),style:Ze({visibility:e.editorErrorMessage?"visible":"hidden"})},Me(e.editorErrorMessage),7)],2),[[Tt,e.showInput]])],10,["id"]),U("div",{class:I(e.ns.e("btns"))},[e.showCancelButton?(R(),ye(l,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:I([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:f=>e.handleAction("cancel"),onKeydown:Pt(tt(f=>e.handleAction("cancel"),["prevent"]),["enter"])},{default:ie(()=>[_t(Me(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):fe("v-if",!0),rt(re(l,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:I([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:f=>e.handleAction("confirm"),onKeydown:Pt(tt(f=>e.handleAction("confirm"),["prevent"]),["enter"])},{default:ie(()=>[_t(Me(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[Tt,e.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[Tt,e.visible]])]),_:3},8,["onAfterLeave"])}var T6=We(k6,[["render",O6],["__file","index.vue"]]);const pa=new Map,x6=e=>{let t=document.body;return e.appendTo&&(Be(e.appendTo)&&(t=document.querySelector(e.appendTo)),En(e.appendTo)&&(t=e.appendTo),En(t)||(t=document.body)),t},A6=(e,t,n=null)=>{const r=re(T6,e,ke(e.message)||jn(e.message)?{default:ke(e.message)?e.message:()=>e.message}:null);return r.appContext=n,Gs(r,t),x6(e).appendChild(t.firstElementChild),r.component},M6=()=>document.createElement("div"),P6=(e,t)=>{const n=M6();e.onVanish=()=>{Gs(null,n),pa.delete(s)},e.onAction=o=>{const a=pa.get(s);let i;e.showInput?i={value:s.inputValue,action:o}:i=o,e.callback?e.callback(i,r.proxy):o==="cancel"||o==="close"?e.distinguishCancelAndClose&&o!=="cancel"?a.reject("close"):a.reject("cancel"):a.resolve(i)};const r=A6(e,n,t),s=r.proxy;for(const o in e)et(e,o)&&!et(s.$props,o)&&(o==="closeIcon"&&Ue(e[o])?s[o]=qs(e[o]):s[o]=e[o]);return s.visible=!0,s};function bo(e,t=null){if(!ct)return Promise.reject();let n;return Be(e)||jn(e)?e={message:e}:n=e.callback,new Promise((r,s)=>{const o=P6(e,t??bo._context);pa.set(o,{options:e,callback:n,resolve:r,reject:s})})}const R6=["alert","confirm","prompt"],$6={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};R6.forEach(e=>{bo[e]=L6(e)});function L6(e){return(t,n,r,s)=>{let o="";return Ue(n)?(r=n,o=""):Ct(n)?o="":o=n,bo(Object.assign({title:o,message:t,type:"",...$6[e]},r,{boxType:e}),s)}}bo.close=()=>{pa.forEach((e,t)=>{t.doClose()}),pa.clear()};bo._context=null;const Br=bo;Br.install=e=>{Br._context=e._context,e.config.globalProperties.$msgbox=Br,e.config.globalProperties.$messageBox=Br,e.config.globalProperties.$alert=Br.alert,e.config.globalProperties.$confirm=Br.confirm,e.config.globalProperties.$prompt=Br.prompt};const k$=Br,cr=Object.create(null);cr.open="0";cr.close="1";cr.ping="2";cr.pong="3";cr.message="4";cr.upgrade="5";cr.noop="6";const Pi=Object.create(null);Object.keys(cr).forEach(e=>{Pi[cr[e]]=e});const kc={type:"error",data:"parser error"},pb=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",vb=typeof ArrayBuffer=="function",mb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Yd=({type:e,data:t},n,r)=>pb&&t instanceof Blob?n?r(t):Up(t,r):vb&&(t instanceof ArrayBuffer||mb(t))?n?r(t):Up(new Blob([t]),r):r(cr[e]+(t||"")),Up=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function qp(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let yu;function I6(e,t){if(pb&&e.data instanceof Blob)return e.data.arrayBuffer().then(qp).then(t);if(vb&&(e.data instanceof ArrayBuffer||mb(e.data)))return t(qp(e.data));Yd(e,!1,n=>{yu||(yu=new TextEncoder),t(yu.encode(n))})}const Yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ro=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Yp.length;e++)Ro[Yp.charCodeAt(e)]=e;const N6=e=>{let t=e.length*.75,n=e.length,r,s=0,o,a,i,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)o=Ro[e.charCodeAt(r)],a=Ro[e.charCodeAt(r+1)],i=Ro[e.charCodeAt(r+2)],l=Ro[e.charCodeAt(r+3)],u[s++]=o<<2|a>>4,u[s++]=(a&15)<<4|i>>2,u[s++]=(i&3)<<6|l&63;return c},B6=typeof ArrayBuffer=="function",Gd=(e,t)=>{if(typeof e!="string")return{type:"message",data:gb(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:D6(e.substring(1),t)}:Pi[n]?e.length>1?{type:Pi[n],data:e.substring(1)}:{type:Pi[n]}:kc},D6=(e,t)=>{if(B6){const n=N6(e);return gb(n,t)}else return{base64:!0,data:e}},gb=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},bb="",F6=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{Yd(o,!1,i=>{r[a]=i,++s===n&&t(r.join(bb))})})},V6=(e,t)=>{const n=e.split(bb),r=[];for(let s=0;s<n.length;s++){const o=Gd(n[s],t);if(r.push(o),o.type==="error")break}return r};function H6(){return new TransformStream({transform(e,t){I6(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let wu;function Ja(e){return e.reduce((t,n)=>t+n.length,0)}function Za(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function z6(e,t){wu||(wu=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(a,i){for(n.push(a);;){if(r===0){if(Ja(n)<1)break;const l=Za(n,1);o=(l[0]&128)===128,s=l[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(Ja(n)<2)break;const l=Za(n,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Ja(n)<8)break;const l=Za(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),u=c.getUint32(0);if(u>Math.pow(2,21)-1){i.enqueue(kc);break}s=u*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Ja(n)<s)break;const l=Za(n,s);i.enqueue(Gd(o?l:wu.decode(l),t)),r=0}if(s===0||s>e){i.enqueue(kc);break}}}})}const yb=4;function Rt(e){if(e)return j6(e)}function j6(e){for(var t in Rt.prototype)e[t]=Rt.prototype[t];return e}Rt.prototype.on=Rt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Rt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Rt.prototype.off=Rt.prototype.removeListener=Rt.prototype.removeAllListeners=Rt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Rt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Rt.prototype.emitReserved=Rt.prototype.emit;Rt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Rt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Vl=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),_n=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),W6="arraybuffer";function wb(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const K6=_n.setTimeout,U6=_n.clearTimeout;function Hl(e,t){t.useNativeTimers?(e.setTimeoutFn=K6.bind(_n),e.clearTimeoutFn=U6.bind(_n)):(e.setTimeoutFn=_n.setTimeout.bind(_n),e.clearTimeoutFn=_n.clearTimeout.bind(_n))}const q6=1.33;function Y6(e){return typeof e=="string"?G6(e):Math.ceil((e.byteLength||e.size)*q6)}function G6(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function _b(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function X6(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function J6(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class Z6 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Xd extends Rt{constructor(t){super(),this.writable=!1,Hl(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new Z6(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Gd(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=X6(t);return n.length?"?"+n:""}}class Q6 extends Xd{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};V6(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,F6(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=_b()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Cb=!1;try{Cb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const eR=Cb;function tR(){}class nR extends Q6{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class or extends Rt{constructor(t,n,r){super(),this.createRequest=t,Hl(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=wb(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=or.requestsCount++,or.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=tR,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete or.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}or.requestsCount=0;or.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Gp);else if(typeof addEventListener=="function"){const e="onpagehide"in _n?"pagehide":"unload";addEventListener(e,Gp,!1)}}function Gp(){for(let e in or.requests)or.requests.hasOwnProperty(e)&&or.requests[e].abort()}const rR=function(){const e=Sb({xdomain:!1});return e&&e.responseType!==null}();class sR extends nR{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=rR&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new or(Sb,this.uri(),t)}}function Sb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||eR))return new XMLHttpRequest}catch{}if(!t)try{return new _n[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Eb=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class oR extends Xd{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Eb?{}:wb(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(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Yd(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&Vl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=_b()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const _u=_n.WebSocket||_n.MozWebSocket;class aR extends oR{createSocket(t,n,r){return Eb?new _u(t,n,r):n?new _u(t,n):new _u(t)}doWrite(t,n){this.ws.send(n)}}class iR extends Xd{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=z6(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=H6();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:i,value:l})=>{i||(this.onPacket(l),o())}).catch(i=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Vl(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const lR={websocket:aR,webtransport:iR,polling:sR},uR=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,cR=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Oc(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=uR.exec(e||""),o={},a=14;for(;a--;)o[cR[a]]=s[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=dR(o,o.path),o.queryKey=fR(o,o.query),o}function dR(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function fR(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const Tc=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ri=[];Tc&&addEventListener("offline",()=>{Ri.forEach(e=>e())},!1);class Ur extends Rt{constructor(t,n){if(super(),this.binaryType=W6,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Oc(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Oc(n.host).host);Hl(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),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},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=J6(this.opts.query)),Tc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ri.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=yb,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Ur.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Ur.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=Y6(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Vl(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Ur.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Tc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ri.indexOf(this._offlineEventListener);r!==-1&&Ri.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Ur.protocol=yb;class hR extends Ur{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Ur.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Ur.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const a=f=>{const h=new Error("probe error: "+f);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function i(){a("transport closed")}function l(){a("socket closed")}function c(f){n&&f.name!==n.name&&o()}const u=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",i),this.off("close",l),this.off("upgrading",c)};n.once("open",s),n.once("error",a),n.once("close",i),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let pR=class extends hR{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>lR[s]).filter(s=>!!s)),super(t,r)}};function vR(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Oc(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const mR=typeof ArrayBuffer=="function",gR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,kb=Object.prototype.toString,bR=typeof Blob=="function"||typeof Blob<"u"&&kb.call(Blob)==="[object BlobConstructor]",yR=typeof File=="function"||typeof File<"u"&&kb.call(File)==="[object FileConstructor]";function Jd(e){return mR&&(e instanceof ArrayBuffer||gR(e))||bR&&e instanceof Blob||yR&&e instanceof File}function $i(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if($i(e[n]))return!0;return!1}if(Jd(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return $i(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&$i(e[n]))return!0;return!1}function wR(e){const t=[],n=e.data,r=e;return r.data=xc(n,t),r.attachments=t.length,{packet:r,buffers:t}}function xc(e,t){if(!e)return e;if(Jd(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=xc(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=xc(e[r],t));return n}return e}function _R(e,t){return e.data=Ac(e.data,t),delete e.attachments,e}function Ac(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Ac(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Ac(e[n],t));return e}const CR=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],SR=5;var at;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(at||(at={}));class ER{constructor(t){this.replacer=t}encode(t){return(t.type===at.EVENT||t.type===at.ACK)&&$i(t)?this.encodeAsBinary({type:t.type===at.EVENT?at.BINARY_EVENT:at.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===at.BINARY_EVENT||t.type===at.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=wR(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}function Xp(e){return Object.prototype.toString.call(e)==="[object Object]"}class Zd extends Rt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===at.BINARY_EVENT;r||n.type===at.BINARY_ACK?(n.type=r?at.EVENT:at.ACK,this.reconstructor=new kR(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Jd(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(at[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===at.BINARY_EVENT||r.type===at.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Zd.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case at.CONNECT:return Xp(n);case at.DISCONNECT:return n===void 0;case at.CONNECT_ERROR:return typeof n=="string"||Xp(n);case at.EVENT:case at.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&CR.indexOf(n[0])===-1);case at.ACK:case at.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class kR{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=_R(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const OR=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Zd,Encoder:ER,get PacketType(){return at},protocol:SR},Symbol.toStringTag,{value:"Module"}));function $n(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const TR=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ob extends Rt{constructor(t,n,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=t,this.nsp=n,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;const t=this.io;this.subs=[$n(t,"open",this.onopen.bind(this)),$n(t,"packet",this.onpacket.bind(this)),$n(t,"error",this.onerror.bind(this)),$n(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(TR.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:at.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const u=this.ids++,f=n.pop();this._registerAckCallback(u,f),a.id=u}const i=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,l=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!i||(l?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===t&&this.sendBuffer.splice(i,1);n.call(this,new Error("operation has timed out"))},s),a=(...i)=>{this.io.clearTimeoutFn(o),n.apply(this,i)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(a,i)=>a?s(a):r(i);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:at.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case at.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new 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 at.EVENT:case at.BINARY_EVENT:this.onevent(t);break;case at.ACK:case at.BINARY_ACK:this.onack(t);break;case at.DISCONNECT:this.ondisconnect();break;case at.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:at.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:at.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function yo(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}yo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};yo.prototype.reset=function(){this.attempts=0};yo.prototype.setMin=function(e){this.ms=e};yo.prototype.setMax=function(e){this.max=e};yo.prototype.setJitter=function(e){this.jitter=e};class Mc extends Rt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Hl(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new yo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||OR;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new pR(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=$n(n,"open",function(){r.onopen(),t&&t()}),o=i=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",i),t?t(i):this.maybeReconnectOnOpen()},a=$n(n,"error",o);if(this._timeout!==!1){const i=this._timeout,l=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},i);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push($n(t,"ping",this.onping.bind(this)),$n(t,"data",this.ondata.bind(this)),$n(t,"error",this.onerror.bind(this)),$n(t,"close",this.onclose.bind(this)),$n(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Vl(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Ob(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const To={};function Cu(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=vR(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=To[s]&&o in To[s].nsps,i=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return i?l=new Mc(r,t):(To[s]||(To[s]=new Mc(r,t)),l=To[s]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Cu,{Manager:Mc,Socket:Ob,io:Cu,connect:Cu});var zt={},Qa={},Ls={},Is={},ei={},ti={},Su={},Xn={},Eu={},Jp;function Qd(){return Jp||(Jp=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.VerticalReverse="vertical-reverse",t.Horizontal="horizontal",t.HorizontalReverse="horizontal-reverse"}(e.Orientation||(e.Orientation={}))}(Eu)),Eu}var Zp;function wo(){if(Zp)return Xn;Zp=1,Object.defineProperty(Xn,"__esModule",{value:!0});const e=Qd();function t(c,u){return typeof c=="boolean"?c:u}Xn.booleanOptionOr=t;function n(c,u){return typeof c=="number"?c:u}Xn.numberOptionOr=n;function r(c,u){return Object.assign({},u.reduce((f,h)=>Object.assign({},f,{[h]:c[h]}),{}))}Xn.pick=r;function s(c,u){console.log(JSON.stringify(c.map(f=>r(f,u)),null,2))}Xn.debug=s;function o(c){return c===void 0}Xn.isUndefined=o;function a(c={}){return Object.keys(c).reduce((u,f)=>o(c[f])?u:Object.assign({},u,{[f]:c[f]}),{})}Xn.withoutUndefinedKeys=a;function i(c,u,f){const h=f.style.dot.size,m=c.template.arrow.size,p=h+c.template.arrow.offset,v=Math.PI/7,b=l(c,u,f),_=p*Math.cos(b),k=p*Math.sin(b),w=(p+m)*Math.cos(b-v),g=(p+m)*Math.sin(b-v),y=(p+m/2)*Math.cos(b),C=(p+m/2)*Math.sin(b),S=(p+m)*Math.cos(b+v),P=(p+m)*Math.sin(b+v);return`M${_},${k} L${w},${g} Q${y},${C} ${S},${P} L${S},${P}`}Xn.arrowSvgPath=i;function l(c,u,f){const h=u.x-f.x,m=u.y-f.y,p=c.template.commit.spacing;let v,b;switch(c.orientation){case e.Orientation.Horizontal:v=m,b=-p;break;case e.Orientation.HorizontalReverse:v=m,b=p;break;case e.Orientation.VerticalReverse:v=-p,b=h;break;default:v=p,b=h;break}return c.isVertical?Math.abs(m)>p&&(b=0):Math.abs(h)>p&&(v=0),c.reverseArrow&&(v*=-1,b*=-1),Math.atan2(v,b)}return Xn}var Qp;function ef(){return Qp||(Qp=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=wo();var n;(function(c){c.Bezier="bezier",c.Straight="straight"})(n||(n={})),e.MergeStyle=n,e.DEFAULT_FONT="normal 12pt Calibri";class r{constructor(u){u.branch=u.branch||{},u.branch.label=u.branch.label||{},u.arrow=u.arrow||{},u.commit=u.commit||{},u.commit.dot=u.commit.dot||{},u.commit.message=u.commit.message||{},this.colors=u.colors||["#000000"],this.branch={color:u.branch.color,lineWidth:u.branch.lineWidth||2,mergeStyle:u.branch.mergeStyle||n.Bezier,spacing:t.numberOptionOr(u.branch.spacing,20),label:{display:t.booleanOptionOr(u.branch.label.display,!0),color:u.branch.label.color||u.commit.color,strokeColor:u.branch.label.strokeColor||u.commit.color,bgColor:u.branch.label.bgColor||"white",font:u.branch.label.font||u.commit.message.font||e.DEFAULT_FONT,borderRadius:t.numberOptionOr(u.branch.label.borderRadius,10)}},this.arrow={size:u.arrow.size||null,color:u.arrow.color||null,offset:u.arrow.offset||2},this.commit={color:u.commit.color,spacing:t.numberOptionOr(u.commit.spacing,25),hasTooltipInCompactMode:t.booleanOptionOr(u.commit.hasTooltipInCompactMode,!0),dot:{color:u.commit.dot.color||u.commit.color,size:u.commit.dot.size||3,strokeWidth:t.numberOptionOr(u.commit.dot.strokeWidth,0),strokeColor:u.commit.dot.strokeColor,font:u.commit.dot.font||u.commit.message.font||"normal 10pt Calibri"},message:{display:t.booleanOptionOr(u.commit.message.display,!0),displayAuthor:t.booleanOptionOr(u.commit.message.displayAuthor,!0),displayHash:t.booleanOptionOr(u.commit.message.displayHash,!0),color:u.commit.message.color||u.commit.color,font:u.commit.message.font||e.DEFAULT_FONT}},this.tag=u.tag||{}}}e.Template=r;const s=new r({colors:["#6963FF","#47E8D4","#6BDB52","#E84BA5","#FFA657"],branch:{color:"#000000",lineWidth:4,spacing:50,mergeStyle:n.Straight},commit:{spacing:60,dot:{size:16,strokeColor:"#000000",strokeWidth:4},message:{color:"black"}},arrow:{size:16,offset:-1.5}});e.blackArrowTemplate=s;const o=new r({colors:["#979797","#008fb5","#f1c109"],branch:{lineWidth:10,spacing:50},commit:{spacing:80,dot:{size:14},message:{font:"normal 14pt Arial"}}});e.metroTemplate=o;var a;(function(c){c.Metro="metro",c.BlackArrow="blackarrow"})(a||(a={})),e.TemplateName=a;function i(c,u){const f=l(c);return u.branch||(u.branch={}),u.commit||(u.commit={}),{colors:u.colors||f.colors,arrow:Object.assign({},f.arrow,u.arrow),branch:Object.assign({},f.branch,u.branch,{label:Object.assign({},f.branch.label,u.branch.label)}),commit:Object.assign({},f.commit,u.commit,{dot:Object.assign({},f.commit.dot,u.commit.dot),message:Object.assign({},f.commit.message,u.commit.message)}),tag:Object.assign({},f.tag,u.tag)}}e.templateExtend=i;function l(c){return c?typeof c=="string"?{[a.BlackArrow]:s,[a.Metro]:o}[c]:c:o}e.getTemplate=l}(Su)),Su}var ev;function Tb(){if(ev)return ti;ev=1,Object.defineProperty(ti,"__esModule",{value:!0});const e=ef(),t=wo();class n{constructor(s,o,a,i){this.name=s,this.tagStyle=o,this.commitStyle=i,this.render=a}get style(){return{strokeColor:this.tagStyle.strokeColor||this.commitStyle.color,bgColor:this.tagStyle.bgColor||this.commitStyle.color,color:this.tagStyle.color||"white",font:this.tagStyle.font||this.commitStyle.message.font||e.DEFAULT_FONT,borderRadius:t.numberOptionOr(this.tagStyle.borderRadius,10),pointerWidth:t.numberOptionOr(this.tagStyle.pointerWidth,12)}}}return ti.Tag=n,ti}var tv;function tf(){if(tv)return ei;tv=1,Object.defineProperty(ei,"__esModule",{value:!0});const e=Tb(),t=()=>(Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)).substring(0,40);class n{constructor(s){this.refs=[],this.x=0,this.y=0;let o,a;try{[,o,a]=s.author.match(/(.*) <(.*)>/)}catch{[o,a]=[s.author,""]}this.author={name:o,email:a,timestamp:Date.now()},this.committer={name:o,email:a,timestamp:Date.now()},this.subject=s.subject,this.body=s.body||"",this.hash=s.hash||t(),this.hashAbbrev=this.hash.substring(0,7),this.parents=s.parents?s.parents:[],this.parentsAbbrev=this.parents.map(i=>i.substring(0,7)),this.style=Object.assign({},s.style,{message:Object.assign({},s.style.message),dot:Object.assign({},s.style.dot)}),this.dotText=s.dotText,this.onClick=()=>s.onClick?s.onClick(this):void 0,this.onMessageClick=()=>s.onMessageClick?s.onMessageClick(this):void 0,this.onMouseOver=()=>s.onMouseOver?s.onMouseOver(this):void 0,this.onMouseOut=()=>s.onMouseOut?s.onMouseOut(this):void 0,this.renderDot=s.renderDot,this.renderMessage=s.renderMessage,this.renderTooltip=s.renderTooltip}get message(){let s="";return this.style.message.displayHash&&(s+=`${this.hashAbbrev} `),s+=this.subject,this.style.message.displayAuthor&&(s+=` - ${this.author.name} <${this.author.email}>`),s}get branchToDisplay(){return this.branches?this.branches[0]:""}setRefs(s){return this.refs=s.getNames(this.hash),this}setTags(s,o,a){return this.tags=s.getNames(this.hash).map(i=>new e.Tag(i,o(i),a(i),this.style)),this}setBranches(s){return this.branches=s,this}setPosition({x:s,y:o}){return this.x=s,this.y=o,this}withDefaultColor(s){const o=Object.assign({},this.style,{dot:Object.assign({},this.style.dot),message:Object.assign({},this.style.message)});o.color||(o.color=s),o.dot.color||(o.dot.color=s),o.message.color||(o.message.color=s);const a=this.cloneCommit();return a.style=o,a}cloneCommit(){const s=new n({author:`${this.author.name} <${this.author.email}>`,subject:this.subject,style:this.style,body:this.body,hash:this.hash,parents:this.parents,dotText:this.dotText,onClick:this.onClick,onMessageClick:this.onMessageClick,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut,renderDot:this.renderDot,renderMessage:this.renderMessage,renderTooltip:this.renderTooltip});return s.refs=this.refs,s.branches=this.branches,s.tags=this.tags,s.x=this.x,s.y=this.y,s}}return ei.Commit=n,ei}var nv;function xb(){if(nv)return Is;nv=1;var e=Is&&Is.__rest||function(a,i){var l={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&i.indexOf(c)<0&&(l[c]=a[c]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,c=Object.getOwnPropertySymbols(a);u<c.length;u++)i.indexOf(c[u])<0&&Object.prototype.propertyIsEnumerable.call(a,c[u])&&(l[c[u]]=a[c[u]]);return l};Object.defineProperty(Is,"__esModule",{value:!0});const t=tf(),n=zl(),r=wo();class s{constructor(i,l,c){this._branch=i,this.name=i.name,this._graph=l,this._onGraphUpdate=c}branch(i){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot branch from the deleted branch "${this.name}"`);const l=typeof i=="string"?{name:i}:i;return l.from=this,this._graph.createBranch(l).getUserApi()}commit(i){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot commit on the deleted branch "${this.name}"`);return typeof i=="string"&&(i={subject:i}),i||(i={}),this._commitWithParents(i,[]),this._onGraphUpdate(),this}delete(){if(this._graph.refs.getCommit("HEAD")===this._graph.refs.getCommit(this.name))throw new Error(`Cannot delete the checked out branch "${this.name}"`);return[...function*(l,c){const u=(h,m)=>h.commits.find(({hash:p})=>p===m);let f=u(l,l.refs.getCommit(c.name));for(;f&&f.hash!==c.parentCommitHash;)yield f,f=u(l,f.parents[0])}(this._graph,this._branch)].forEach(l=>{l.refs=l.refs.filter(c=>c!==this.name)}),this._graph.refs.delete(this.name),this._graph.branches.delete(this.name),this._branch=n.createDeletedBranch(this._graph,this._branch.style,()=>{}),this._onGraphUpdate(),this}merge(...i){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot merge to the deleted branch "${this.name}"`);let l=i[0];o(l)||(l={branch:i[0],fastForward:!1,commitOptions:{subject:i[1]}});const{branch:c,fastForward:u,commitOptions:f}=l,h=typeof c=="string"?c:c.name,m=this._graph.refs.getCommit(h);if(!m)throw new Error(`The branch called "${h}" is unknown`);let p=!1;if(u){const v=this._graph.refs.getCommit(this._branch.name);v&&(p=this._areCommitsConnected(v,m))}return u&&p?this._fastForwardTo(m):this._commitWithParents(Object.assign({},f,{subject:f&&f.subject||`Merge branch ${h}`}),[m]),this._onGraphUpdate(),this}tag(i){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot tag on the deleted branch "${this.name}"`);return typeof i=="string"?this._graph.getUserApi().tag({name:i,ref:this._branch.name}):this._graph.getUserApi().tag(Object.assign({},i,{ref:this._branch.name})),this}checkout(){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot checkout the deleted branch "${this.name}"`);const i=this._branch,l=this._graph.refs.getCommit(i.name);return this._graph.currentBranch=i,l&&this._graph.refs.set("HEAD",l),this}_commitWithParents(i,l){const c=this._graph.refs.getCommit(this._branch.name);c?l.unshift(c):this._branch.parentCommitHash&&l.unshift(this._branch.parentCommitHash);const{tag:u}=i,f=e(i,["tag"]),h=new t.Commit(Object.assign({hash:this._graph.generateCommitHash(),author:this._branch.commitDefaultOptions.author||this._graph.author,subject:this._branch.commitDefaultOptions.subject||this._graph.commitMessage},f,{parents:l,style:this._getCommitStyle(i.style)}));c?this._graph.refs.getNames(c).forEach(p=>this._graph.refs.set(p,h.hash)):this._graph.refs.set(this._branch.name,h.hash),this._graph.commits.push(h),this.checkout(),u&&this.tag(u)}_areCommitsConnected(i,l){const c=this._graph.commits.find(({hash:f})=>l===f);return!c||c.parents.length===0?!1:c.parents.includes(i)?!0:c.parents.some(f=>this._areCommitsConnected(i,f))}_fastForwardTo(i){this._graph.refs.set(this._branch.name,i)}_getCommitStyle(i={}){return Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style),i,{message:Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit.message),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style.message),i.message,r.withoutUndefinedKeys({display:this._graph.shouldDisplayCommitMessage&&void 0})),dot:Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit.dot),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style.dot),i.dot)})}_isReferenced(){return this._graph.branches.has(this.name)||this._graph.refs.hasName(this.name)||this._graph.commits.reduce((i,{refs:l})=>[...i,...l],[]).includes(this.name)}}Is.BranchUserApi=s;function o(a){return typeof a=="object"&&!(a instanceof s)}return Is}var rv;function zl(){if(rv)return Ls;rv=1,Object.defineProperty(Ls,"__esModule",{value:!0});const e=xb(),t="";Ls.DELETED_BRANCH_NAME=t;class n{constructor(o){this.gitgraph=o.gitgraph,this.name=o.name,this.style=o.style,this.parentCommitHash=o.parentCommitHash,this.commitDefaultOptions=o.commitDefaultOptions||{style:{}},this.onGraphUpdate=o.onGraphUpdate,this.renderLabel=o.renderLabel}getUserApi(){return new e.BranchUserApi(this,this.gitgraph,this.onGraphUpdate)}isDeleted(){return this.name===t}}Ls.Branch=n;function r(s,o,a){return new n({name:t,gitgraph:s,style:o,onGraphUpdate:a})}return Ls.createDeletedBranch=r,Ls}var xo={},ni={},sv;function nf(){if(sv)return ni;sv=1,Object.defineProperty(ni,"__esModule",{value:!0});var e;return function(t){t.Compact="compact"}(e||(e={})),ni.Mode=e,ni}var ri={},si={},ov;function Ab(){if(ov)return si;ov=1,Object.defineProperty(si,"__esModule",{value:!0});class e{constructor(r){this.rows=new Map,this.maxRowCache=void 0,this.computeRowsFromCommits(r)}getRowOf(r){return this.rows.get(r)||0}getMaxRow(){return this.maxRowCache===void 0&&(this.maxRowCache=t(Array.from(this.rows.values())).length-1),this.maxRowCache}computeRowsFromCommits(r){r.forEach((s,o)=>{this.rows.set(s.hash,o)}),this.maxRowCache=void 0}}si.RegularGraphRows=e;function t(n){const r=new Set;return n.forEach(s=>r.add(s)),Array.from(r)}return si}var av;function xR(){if(av)return ri;av=1,Object.defineProperty(ri,"__esModule",{value:!0});const e=Ab();class t extends e.RegularGraphRows{computeRowsFromCommits(r){r.forEach((s,o)=>{let a=o;if(!(o===0)){const l=this.getRowOf(s.parents[0]),c=r[o-1];if(a=Math.max(l+1,this.getRowOf(c.hash)),s.parents.length>1){const f=this.getRowOf(s.parents[1]);l<f&&a++}}this.rows.set(s.hash,a)})}}return ri.CompactGraphRows=t,ri}var iv;function AR(){if(iv)return xo;iv=1,Object.defineProperty(xo,"__esModule",{value:!0});const e=nf(),t=xR(),n=Ab();xo.GraphRows=n.RegularGraphRows;function r(s,o){return s===e.Mode.Compact?new t.CompactGraphRows(o):new n.RegularGraphRows(o)}return xo.createGraphRows=r,xo}var oi={},lv;function MR(){if(lv)return oi;lv=1,Object.defineProperty(oi,"__esModule",{value:!0});class e{constructor(n,r,s){this.branches=new Set,this.colors=r,n.forEach(o=>this.branches.add(o.branchToDisplay)),s&&(this.branches=new Set(Array.from(this.branches).sort(s)))}get(n){return Array.from(this.branches).findIndex(r=>r===n)}getColorOf(n){return this.colors[this.get(n)%this.colors.length]}}return oi.BranchesOrder=e,oi}var ai={},uv;function rf(){if(uv)return ai;uv=1,Object.defineProperty(ai,"__esModule",{value:!0});class e{constructor(){this.commitPerName=new Map,this.namesPerCommit=new Map}set(n,r){const s=this.commitPerName.get(n);return s&&this.removeNameFrom(s,n),this.addNameTo(r,n),this.addCommitTo(n,r),this}delete(n){return this.hasName(n)&&(this.removeNameFrom(this.getCommit(n),n),this.commitPerName.delete(n)),this}getCommit(n){return this.commitPerName.get(n)}getNames(n){return this.namesPerCommit.get(n)||[]}getAllNames(){return Array.from(this.commitPerName.keys())}hasCommit(n){return this.namesPerCommit.has(n)}hasName(n){return this.commitPerName.has(n)}removeNameFrom(n,r){const s=this.namesPerCommit.get(n)||[];this.namesPerCommit.set(n,s.filter(o=>o!==r))}addNameTo(n,r){const s=this.namesPerCommit.get(n)||[];this.namesPerCommit.set(n,[...s,r])}addCommitTo(n,r){this.commitPerName.set(n,r)}}return ai.Refs=e,ai}var Ao={},cv;function Mb(){if(cv)return Ao;cv=1,Object.defineProperty(Ao,"__esModule",{value:!0});const e=wo();class t{constructor(s,o,a,i,l,c){this.branchesPaths=new Map,this.commits=s,this.branches=o,this.commitSpacing=a,this.isGraphVertical=i,this.isGraphReverse=l,this.createDeletedBranch=c}execute(){return this.fromCommits(),this.withMergeCommits(),this.smoothBranchesPaths()}fromCommits(){this.commits.forEach(s=>{let o=this.branches.get(s.branchToDisplay);o||(o=this.getDeletedBranchInPath()||this.createDeletedBranch());const a=[],i=this.branchesPaths.get(o),l=this.commits.find(({hash:c})=>c===s.parents[0]);i?a.push(...i):l&&a.push({x:l.x,y:l.y}),a.push({x:s.x,y:s.y}),this.branchesPaths.set(o,a)})}withMergeCommits(){this.commits.filter(({parents:o})=>o.length>1).forEach(o=>{const a=this.commits.find(({hash:u})=>u===o.parents[1]);if(!a)return;const i=a.branches?a.branches[0]:"";let l=this.branches.get(i);if(!l&&(l=this.getDeletedBranchInPath(),!l))return;const c=[...this.branchesPaths.get(l)||[]];this.branchesPaths.set(l,[...c,{x:o.x,y:o.y,mergeCommit:!0}])})}getDeletedBranchInPath(){return Array.from(this.branchesPaths.keys()).find(s=>s.isDeleted())}smoothBranchesPaths(){const s=new Map;return this.branchesPaths.forEach((o,a)=>{if(o.length<=1){s.set(a,[o]);return}this.isGraphVertical?o=o.sort((l,c)=>l.y>c.y?-1:1):o=o.sort((l,c)=>l.x>c.x?1:-1),this.isGraphReverse&&(o=o.reverse());const i=o.reduce((l,c,u)=>{if(c.mergeCommit){l[l.length-1].push(e.pick(c,["x","y"]));let f=u-1,h=o[f];for(;f>=0&&h.mergeCommit;)f--,h=o[f];f>=0&&l.push([h])}else l[l.length-1].push(c);return l},[[]]);this.isGraphReverse&&i.forEach(l=>l.reverse()),this.isGraphVertical?i.forEach(l=>{if(l.length<=1)return;const c=l[0],u=l[l.length-1],f=l[1].x,h=Math.round(Math.abs(c.y-u.y)/this.commitSpacing)-1,m=h>0?new Array(h).fill(0).map((v,b)=>({x:f,y:l[0].y-this.commitSpacing*(b+1)})):[],p=s.get(a)||[];s.set(a,[...p,[c,...m,u]])}):i.forEach(l=>{if(l.length<=1)return;const c=l[0],u=l[l.length-1],f=l[1].y,h=Math.round(Math.abs(c.x-u.x)/this.commitSpacing)-1,m=h>0?new Array(h).fill(0).map((v,b)=>({y:f,x:l[0].x+this.commitSpacing*(b+1)})):[],p=s.get(a)||[];s.set(a,[...p,[c,...m,u]])})}),s}}Ao.BranchesPathsCalculator=t;function n(r,s,o){return r.map(a=>"M"+a.map(({x:i,y:l},c,u)=>{if(s&&u.length>1&&(c===1||c===u.length-1)){const f=u[c-1];if(o){const h=(f.y+l)/2;return`C ${f.x} ${h} ${i} ${h} ${i} ${l}`}else{const h=(f.x+i)/2;return`C ${h} ${f.y} ${h} ${l} ${i} ${l}`}}return`L ${i} ${l}`}).join(" ").slice(1)).join(" ")}return Ao.toSvgPath=n,Ao}var ii={},dv;function Pb(){if(dv)return ii;dv=1,Object.defineProperty(ii,"__esModule",{value:!0});const e=tf(),t=zl(),n=rf();class r{constructor(o,a){this._graph=o,this._onGraphUpdate=a}clear(){return this._graph.refs=new n.Refs,this._graph.tags=new n.Refs,this._graph.commits=[],this._graph.branches=new Map,this._graph.currentBranch=this._graph.createBranch("master"),this._onGraphUpdate(),this}commit(o){return this._graph.currentBranch.getUserApi().commit(o),this}branch(o){return this._graph.createBranch(o).getUserApi()}tag(...o){let a,i,l,c;if(typeof o[0]=="string"?(a=o[0],i=o[1]):(a=o[0].name,i=o[0].ref,l=o[0].style,c=o[0].render),!i){const f=this._graph.refs.getCommit("HEAD");if(!f)return this;i=f}let u;if(this._graph.refs.hasCommit(i)&&(u=i),this._graph.refs.hasName(i)&&(u=this._graph.refs.getCommit(i)),!u)throw new Error(`The ref "${i}" does not exist`);return this._graph.tags.set(a,u),this._graph.tagStyles[a]=l,this._graph.tagRenders[a]=c,this._onGraphUpdate(),this}import(o){const a=new Error("Only `git2json` format is supported for imported data.");if(!Array.isArray(o)||!o.every(u=>typeof u=="object"&&typeof u.author=="object"&&Array.isArray(u.refs)))throw a;const l=o.map(u=>Object.assign({},u,{style:Object.assign({},this._graph.template.commit,{message:Object.assign({},this._graph.template.commit.message,{display:this._graph.shouldDisplayCommitMessage})}),author:`${u.author.name} <${u.author.email}>`})).reverse();this.clear(),this._graph.commits=l.map(u=>new e.Commit(u)),l.forEach(({refs:u,hash:f})=>{if(!u||!f)return;const h="tag: ";u.map(p=>p.split(h)).map(([p,v])=>v).filter(p=>typeof p=="string").forEach(p=>this._graph.tags.set(p,f)),u.filter(p=>!p.startsWith(h)).forEach(p=>this._graph.refs.set(p,f))});const c=this._getBranches();return this._graph.commits.map(u=>this._withBranches(c,u)).reduce((u,f)=>(f.branches&&f.branches.forEach(h=>u.add(h)),u),new Set).forEach(u=>this.branch(u)),this._onGraphUpdate(),this}_withBranches(o,a){let i=Array.from((o.get(a.hash)||new Set).values());return i.length===0&&(i=[t.DELETED_BRANCH_NAME]),a.setBranches(i)}_getBranches(){const o=new Map,a=[];return this._graph.refs.getAllNames().filter(l=>l!=="HEAD").forEach(l=>{const c=this._graph.refs.getCommit(l);for(c&&a.push(c);a.length>0;){const u=a.pop(),f=this._graph.commits.find(({hash:m})=>m===u),h=o.get(u)||new Set;h.add(l),o.set(u,h),f&&f.parents&&f.parents.length>0&&a.push(f.parents[0])}}),o}}return ii.GitgraphUserApi=r,ii}var fv;function PR(){if(fv)return Qa;fv=1,Object.defineProperty(Qa,"__esModule",{value:!0});const e=zl(),t=AR(),n=nf(),r=MR(),s=ef(),o=rf(),a=Mb(),i=wo(),l=Qd(),c=Pb();class u{constructor(h={}){this.refs=new o.Refs,this.tags=new o.Refs,this.tagStyles={},this.tagRenders={},this.commits=[],this.branches=new Map,this.listeners=[],this.nextTimeoutId=null,this.template=s.getTemplate(h.template),this.currentBranch=this.createBranch("master"),this.orientation=h.orientation,this.reverseArrow=i.booleanOptionOr(h.reverseArrow,!1),this.initCommitOffsetX=i.numberOptionOr(h.initCommitOffsetX,0),this.initCommitOffsetY=i.numberOptionOr(h.initCommitOffsetY,0),this.mode=h.mode,this.author=h.author||"Sergio Flores <saxo-guy@epic.com>",this.commitMessage=h.commitMessage||"He doesn't like George Michael! Boooo!",this.generateCommitHash=typeof h.generateCommitHash=="function"?h.generateCommitHash:()=>{},this.branchesOrderFunction=typeof h.compareBranchesOrder=="function"?h.compareBranchesOrder:void 0,this.branchLabelOnEveryCommit=i.booleanOptionOr(h.branchLabelOnEveryCommit,!1)}get isHorizontal(){return this.orientation===l.Orientation.Horizontal||this.orientation===l.Orientation.HorizontalReverse}get isVertical(){return!this.isHorizontal}get isReverse(){return this.orientation===l.Orientation.HorizontalReverse||this.orientation===l.Orientation.VerticalReverse}get shouldDisplayCommitMessage(){return!this.isHorizontal&&this.mode!==n.Mode.Compact}getUserApi(){return new c.GitgraphUserApi(this,()=>this.next())}subscribe(h){this.listeners.push(h);let m=!0;return()=>{if(!m)return;m=!1;const p=this.listeners.indexOf(h);this.listeners.splice(p,1)}}getRenderedData(){const h=this.computeRenderedCommits(),m=this.computeRenderedBranchesPaths(h),p=this.computeCommitMessagesX(m);return this.computeBranchesColor(h,m),{commits:h,branchesPaths:m,commitMessagesX:p}}createBranch(h){const m="HEAD";let p={gitgraph:this,name:"",parentCommitHash:this.refs.getCommit(m),style:this.template.branch,onGraphUpdate:()=>this.next()};if(typeof h=="string")p.name=h,p.parentCommitHash=this.refs.getCommit(m);else{const b=h.from?h.from.name:m,_=this.refs.getCommit(b)||(this.refs.hasCommit(h.from)?h.from:void 0);h.style=h.style||{},p=Object.assign({},p,h,{parentCommitHash:_,style:Object.assign({},p.style,h.style,{label:Object.assign({},p.style.label,h.style.label)})})}const v=new e.Branch(p);return this.branches.set(v.name,v),v}computeRenderedCommits(){const h=this.getBranches(),m=(()=>{const k=new Set(this.commits.reduce((y,{hash:C})=>h.has(C)?y:[...y,C],[])),w=this.commits.reduce((y,C)=>C.parents.length>1?[...y,...C.parents.slice(1).map(S=>this.commits.find(({hash:P})=>S===P))]:y,[]),g=new Set;return w.forEach(y=>{let C=y;for(;C&&k.has(C.hash);)g.add(C.hash),C=C.parents.length>0?this.commits.find(({hash:S})=>C.parents[0]===S):void 0}),g})(),p=this.commits.filter(({hash:k})=>h.has(k)||m.has(k)),v=p.map(k=>this.withBranches(h,k)),b=t.createGraphRows(this.mode,p),_=new r.BranchesOrder(v,this.template.colors,this.branchesOrderFunction);return v.map(k=>k.setRefs(this.refs)).map(k=>this.withPosition(b,_,k)).map(k=>k.withDefaultColor(this.getBranchDefaultColor(_,k.branchToDisplay))).map(k=>k.setTags(this.tags,w=>Object.assign({},this.tagStyles[w],this.template.tag),w=>this.tagRenders[w]))}computeRenderedBranchesPaths(h){return new a.BranchesPathsCalculator(h,this.branches,this.template.commit.spacing,this.isVertical,this.isReverse,()=>e.createDeletedBranch(this,this.template.branch,()=>this.next())).execute()}computeBranchesColor(h,m){const p=new r.BranchesOrder(h,this.template.colors,this.branchesOrderFunction);Array.from(m).forEach(([v])=>{v.computedColor=v.style.color||this.getBranchDefaultColor(p,v.name)})}computeCommitMessagesX(h){return Array.from(h).length*this.template.branch.spacing}withBranches(h,m){let p=Array.from((h.get(m.hash)||new Set).values());return p.length===0&&(p=[e.DELETED_BRANCH_NAME]),m.setBranches(p)}getBranches(){const h=new Map,m=[];return this.refs.getAllNames().filter(v=>v!=="HEAD").forEach(v=>{const b=this.refs.getCommit(v);for(b&&m.push(b);m.length>0;){const _=m.pop(),k=this.commits.find(({hash:g})=>g===_),w=h.get(_)||new Set;w.add(v),h.set(_,w),k&&k.parents&&k.parents.length>0&&m.push(k.parents[0])}}),h}withPosition(h,m,p){const v=h.getRowOf(p.hash),b=h.getMaxRow(),_=m.get(p.branchToDisplay);switch(this.orientation){default:return p.setPosition({x:this.initCommitOffsetX+this.template.branch.spacing*_,y:this.initCommitOffsetY+this.template.commit.spacing*(b-v)});case l.Orientation.VerticalReverse:return p.setPosition({x:this.initCommitOffsetX+this.template.branch.spacing*_,y:this.initCommitOffsetY+this.template.commit.spacing*v});case l.Orientation.Horizontal:return p.setPosition({x:this.initCommitOffsetX+this.template.commit.spacing*v,y:this.initCommitOffsetY+this.template.branch.spacing*_});case l.Orientation.HorizontalReverse:return p.setPosition({x:this.initCommitOffsetX+this.template.commit.spacing*(b-v),y:this.initCommitOffsetY+this.template.branch.spacing*_})}}getBranchDefaultColor(h,m){return h.getColorOf(m)}next(){this.nextTimeoutId&&window.clearTimeout(this.nextTimeoutId),this.nextTimeoutId=window.setTimeout(()=>{this.listeners.forEach(h=>h(this.getRenderedData()))},0)}}return Qa.GitgraphCore=u,Qa}var hv;function RR(){if(hv)return zt;hv=1,Object.defineProperty(zt,"__esModule",{value:!0});var e=PR();zt.GitgraphCore=e.GitgraphCore;var t=nf();zt.Mode=t.Mode;var n=Pb();zt.GitgraphUserApi=n.GitgraphUserApi;var r=xb();zt.BranchUserApi=r.BranchUserApi;var s=zl();zt.Branch=s.Branch;var o=tf();zt.Commit=o.Commit;var a=Tb();zt.Tag=a.Tag;var i=rf();zt.Refs=i.Refs;var l=ef();zt.MergeStyle=l.MergeStyle,zt.TemplateName=l.TemplateName,zt.templateExtend=l.templateExtend;var c=Qd();zt.Orientation=c.Orientation;var u=Mb();zt.toSvgPath=u.toSvgPath;var f=wo();return zt.arrowSvgPath=f.arrowSvgPath,zt}var Ns=RR(),pr="http://www.w3.org/2000/svg";function $R(e){var t=document.createElementNS(pr,"svg");return t}function Kt(e){var t=document.createElementNS(pr,"g");return e.children.forEach(function(n){return n&&t.appendChild(n)}),e.translate&&t.setAttribute("transform","translate("+e.translate.x+", "+e.translate.y+")"),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e.strokeWidth&&t.setAttribute("stroke-width",e.strokeWidth.toString()),e.onClick&&t.addEventListener("click",e.onClick),e.onMouseOver&&t.addEventListener("mouseover",e.onMouseOver),e.onMouseOut&&t.addEventListener("mouseout",e.onMouseOut),t}function va(e){var t=document.createElementNS(pr,"text");return t.setAttribute("alignment-baseline","central"),t.setAttribute("dominant-baseline","central"),t.textContent=e.content,e.fill&&t.setAttribute("fill",e.fill),e.font&&t.setAttribute("style","font: "+e.font),e.anchor&&t.setAttribute("text-anchor",e.anchor),e.translate&&(t.setAttribute("x",e.translate.x.toString()),t.setAttribute("y",e.translate.y.toString())),e.onClick&&t.addEventListener("click",e.onClick),t}function LR(e){var t=document.createElementNS(pr,"circle");return t.setAttribute("cx",e.radius.toString()),t.setAttribute("cy",e.radius.toString()),t.setAttribute("r",e.radius.toString()),e.id&&t.setAttribute("id",e.id),e.fill&&t.setAttribute("fill",e.fill),t}function IR(e){var t=document.createElementNS(pr,"rect");return t.setAttribute("width",e.width.toString()),t.setAttribute("height",e.height.toString()),e.borderRadius&&t.setAttribute("rx",e.borderRadius.toString()),e.fill&&t.setAttribute("fill",e.fill||"none"),e.stroke&&t.setAttribute("stroke",e.stroke),t}function ol(e){var t=document.createElementNS(pr,"path");return t.setAttribute("d",e.d),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e.strokeWidth&&t.setAttribute("stroke-width",e.strokeWidth.toString()),e.translate&&t.setAttribute("transform","translate("+e.translate.x+", "+e.translate.y+")"),t}function pv(e){var t=document.createElementNS(pr,"use");return t.setAttribute("href","#"+e),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+e),t}function NR(){return document.createElementNS(pr,"clipPath")}function BR(e){var t=document.createElementNS(pr,"defs");return e.forEach(function(n){return t.appendChild(n)}),t}function DR(e){var t=document.createElementNS(pr,"foreignObject");t.setAttribute("width",e.width.toString()),e.translate&&(t.setAttribute("x",e.translate.x.toString()),t.setAttribute("y",e.translate.y.toString()));var n=document.createElement("p");return n.textContent=e.content,t.appendChild(n),t}var Yo=10,Rb=5;function FR(e,t){var n=IR({width:0,height:0,borderRadius:e.style.label.borderRadius,stroke:e.style.label.strokeColor||t.style.color,fill:e.style.label.bgColor}),r=va({content:e.name,translate:{x:Yo,y:0},font:e.style.label.font,fill:e.style.label.color||t.style.color}),s=Kt({children:[n]}),o=new MutationObserver(function(){var a=r.getBBox(),i=a.height,l=a.width,c=l+2*Yo,u=i+2*Rb;n.setAttribute("width",c.toString()),n.setAttribute("height",u.toString()),r.setAttribute("y",(u/2).toString())});return o.observe(s,{attributes:!1,subtree:!1,childList:!0}),s.appendChild(r),s}var Pc=10,VR=5;function HR(e){var t=ol({d:"",fill:e.style.bgColor,stroke:e.style.strokeColor}),n=va({content:e.name,fill:e.style.color,font:e.style.font,translate:{x:0,y:0}}),r=Kt({children:[t]}),s=e.style.pointerWidth,o=new MutationObserver(function(){var a=n.getBBox(),i=a.height,l=a.width;if(!(i===0||l===0)){var c=e.style.borderRadius,u=s+l+2*Pc,f=i+2*VR,h=["M 0,0","L "+s+","+f/2,"V "+f/2,"Q "+s+","+f/2+" "+(s+c)+","+f/2,"H "+(u-c),"Q "+u+","+f/2+" "+u+","+(f/2-c),"V -"+(f/2-c),"Q "+u+",-"+f/2+" "+(u-c)+",-"+f/2,"H "+(s+c),"Q "+s+",-"+f/2+" "+s+",-"+f/2,"V -"+f/2,"z"].join(" ");t.setAttribute("d",h.toString()),n.setAttribute("x",(s+Pc).toString())}});return o.observe(r,{attributes:!1,subtree:!1,childList:!0}),r.appendChild(n),r}var Go=10,Jn=10;function zR(e){var t=ol({d:"",fill:"#EEE"}),n=va({translate:{x:Jn+Go,y:0},content:e.hashAbbrev+" - "+e.subject,fill:"#333"}),r=e.style.dot.size*2,s=Kt({translate:{x:r,y:r/2},children:[t]}),o=new MutationObserver(function(){var a=n.getBBox().width,i=5,l=50,c=Jn+a+2*Go,u=["M 0,0","L "+Jn+","+Jn,"V "+(l/2-i),"Q "+Jn+","+l/2+" "+(Jn+i)+","+l/2,"H "+(c-i),"Q "+c+","+l/2+" "+c+","+(l/2-i),"V -"+(l/2-i),"Q "+c+",-"+l/2+" "+(c-i)+",-"+l/2,"H "+(Jn+i),"Q "+Jn+",-"+l/2+" "+Jn+",-"+(l/2-i),"V -"+Jn,"z"].join(" ");t.setAttribute("d",u.toString())});return o.observe(s,{attributes:!1,subtree:!1,childList:!0}),s.appendChild(n),s}function T$(e,t){var n={},r={},s=!1,o,a,i=0,l=null,c=$R();h(!!(t&&t.responsive)),e.appendChild(c),t&&t.responsive&&e.setAttribute("style","display:inline-block; position: relative; width:100%; padding-bottom:100%; vertical-align:middle; overflow:hidden;");var u=new Ns.GitgraphCore(t);return u.subscribe(function(A){s=!0,f(A)}),u.getUserApi();function f(A){n={};var M=A.commits,W=A.branchesPaths;i=A.commitMessagesX,o=A,a=v(M),c.innerHTML="",c.appendChild(Kt({translate:{x:Yo,y:Go},children:[p(W),a]}))}function h(A){var M=new MutationObserver(function(){s?(s=!1,W(),f(o)):(j(),L(A))});M.observe(c,{attributes:!1,subtree:!0,childList:!0});function W(){var $=Array.from(a.children),F=0,E=u.orientation===Ns.Orientation.VerticalReverse?$:$.reverse();r=E.reduce(function(T,H){var Y=parseInt(H.getAttribute("transform").split(",")[1].slice(0,-1),10),K=H.getElementsByTagName("foreignObject")[0],X=K&&K.firstElementChild;return T[Y]=Y+F,F+=vv(X),T},{})}function j(){if(!u.isHorizontal){var $=10;Object.keys(n).forEach(function(F){var E=n[F],T=E.branchLabel,H=E.tags,Y=E.message,K=i;if(T){m(T,K);var X=T.getBBox().width+2*Yo;K+=X+$}H.forEach(function(G){m(G,K);var oe=parseFloat(G.getAttribute("data-offset")||"0"),ge=G.getBBox().width+2*Pc+oe;K+=ge+$}),Y&&m(Y,K)})}}function L($){var F=c.getBBox(),E=F.height,T=F.width,H=50,Y=20,K=u.isHorizontal?H:Yo+Go,X=u.isHorizontal?H:Rb+Go+Y;$?(c.setAttribute("preserveAspectRatio","xMinYMin meet"),c.setAttribute("viewBox","0 0 "+(T+K)+" "+(E+X))):(c.setAttribute("width",(T+K).toString()),c.setAttribute("height",(E+X).toString()))}}function m(A,M){var W=A.getAttribute("transform")||"translate(0, 0)";A.setAttribute("transform",W.replace(/translate\(([\d\.]+),/,"translate("+M+","))}function p(A){var M=u.template.commit.dot.size,W=u.template.branch.mergeStyle===Ns.MergeStyle.Bezier,j=Array.from(A).map(function(L){var $=L[0],F=L[1];return ol({d:Ns.toSvgPath(F.map(function(E){return E.map(C)}),W,u.isVertical),fill:"none",stroke:$.computedColor||"",strokeWidth:$.style.lineWidth,translate:{x:M,y:M}})});return Kt({children:j})}function v(A){return Kt({children:A.map(M)});function M(j){var L=C(j),$=L.x,F=L.y;return Kt({translate:{x:$,y:F},children:[g(j)].concat(W(j),[Kt({translate:{x:-$,y:0},children:[b(j)].concat(k(j),w(j))})])})}function W(j){if(!u.template.arrow.size)return[null];var L=j.style.dot.size;return j.parents.map(function($){var F=A.find(function(H){var Y=H.hash;return Y===$});if(!F)return null;var E=u.reverseArrow?{x:L+(F.x-j.x),y:L+(F.y-j.y)}:{x:L,y:L},T=ol({d:Ns.arrowSvgPath(u,F,j),fill:u.template.arrow.color||""});return Kt({translate:E,children:[T]})})}}function b(A){if(!A.style.message.display)return null;var M;if(A.renderMessage)return M=Kt({children:[]}),_(M),M.appendChild(A.renderMessage(A)),P(A,M),M;var W=va({content:A.message,fill:A.style.message.color||"",font:A.style.message.font,onClick:A.onMessageClick});if(M=Kt({translate:{x:0,y:A.style.dot.size},children:[W]}),A.body){var j=DR({width:600,translate:{x:10,y:0},content:A.body});_(M),M.appendChild(j)}return P(A,M),M}function _(A){var M=new MutationObserver(function(j){j.forEach(function(L){var $=L.target;return W($)})});M.observe(A,{attributes:!1,subtree:!1,childList:!0});function W(j){if(j.nodeName==="foreignObject"){var L=j.firstChild&&j.firstChild.parentElement;if(!L)return;L.setAttribute("height",vv(L.firstElementChild).toString())}j.childNodes.forEach(W)}}function k(A){var M=Array.from(u.branches.values());return M.map(function(W){if(!W.style.label.display)return null;if(!u.branchLabelOnEveryCommit){var j=u.refs.getCommit(W.name);if(A.hash!==j)return null}if(A.branchToDisplay!==W.name)return null;var L=W.renderLabel?W.renderLabel(W):FR(W,A),$;if(u.isVertical)$=Kt({children:[L]});else{var F=A.style.dot.size*2,E=10;$=Kt({translate:{x:A.x,y:F+E},children:[L]})}return S(A,$),$})}function w(A){return A.tags?u.isHorizontal?[]:A.tags.map(function(M){var W=M.render?M.render(M.name,M.style):HR(M),j=Kt({translate:{x:0,y:A.style.dot.size},children:[W]});return j.setAttribute("data-offset",M.style.pointerWidth.toString()),x(A,j),j}):[]}function g(A){if(A.renderDot)return A.renderDot(A);var M=A.hash,W=LR({id:M,radius:A.style.dot.size,fill:A.style.dot.color||""}),j="clip-"+A.hash,L=NR();L.setAttribute("id",j),L.appendChild(pv(M));var $=pv(M);$.setAttribute("clip-path","url(#"+j+")"),$.setAttribute("stroke",A.style.dot.strokeColor||"");var F=A.style.dot.strokeWidth?A.style.dot.strokeWidth*2:0;$.setAttribute("stroke-width",F.toString());var E=A.dotText?va({content:A.dotText,font:A.style.dot.font,anchor:"middle",translate:{x:A.style.dot.size,y:A.style.dot.size}}):null;return Kt({onClick:A.onClick,onMouseOver:function(){y(A),A.onMouseOver()},onMouseOut:function(){l&&l.remove(),A.onMouseOut()},children:[BR([W,L]),$,E]})}function y(A){if(c.firstChild&&!(u.isVertical&&u.mode!==Ns.Mode.Compact)&&!(u.isVertical&&!A.style.hasTooltipInCompactMode)){var M=A.renderTooltip?A.renderTooltip(A):zR(A);l=Kt({translate:C(A),children:[M]}),c.firstChild.appendChild(l)}}function C(A){var M=A.x,W=A.y;return{x:M,y:r[W]||W}}function S(A,M){n[A.hashAbbrev]||D(A),n[A.hashAbbrev].branchLabel=M}function P(A,M){n[A.hashAbbrev]||D(A),n[A.hashAbbrev].message=M}function x(A,M){n[A.hashAbbrev]||D(A),n[A.hashAbbrev].tags.push(M)}function D(A){n[A.hashAbbrev]={branchLabel:null,tags:[],message:null}}}function vv(e){var t=0;if(e){var n=e.getBoundingClientRect().height,r=window.getComputedStyle(e).marginTop||"0px",s=parseInt(r.replace("px",""),10);t=n+s}return t}export{XR as $,je as A,wd as B,Me as C,Pl as D,E$ as E,Ke as F,kt as G,YR as H,f$ as I,rt as J,S$ as K,Xu as L,Ks as M,tt as N,I as O,n$ as P,k$ as Q,u$ as R,Cr as S,fr as T,s$ as U,Ze as V,a$ as W,t$ as X,g$ as Y,m$ as Z,Tt as _,co as a,qR as a0,h$ as a1,c$ as a2,b$ as a3,Fe as a4,Lt as a5,h3 as a6,JR as a7,ut as a8,o$ as a9,QR as aa,e$ as ab,Js as ac,d$ as ad,l$ as ae,y$ as af,i$ as ag,C$ as ah,_$ as ai,T$ as aj,ZR as ak,p$ as al,v$ as am,Zk as an,Ye as ao,cw as ap,jR as aq,se as b,O as c,WR as d,q as e,R as f,U as g,re as h,xa as i,ie as j,w$ as k,Cu as l,Qi as m,KR as n,dt as o,ca as p,GR as q,V as r,UR as s,r$ as t,d as u,fe as v,Ee as w,ye as x,px as y,_t as z};
|