You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Paperlibrary__Random__Ex...

403 lines
1.1 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[221,5,7,8,9,16],{"+ua5":function(Ge,be,U){},"+vTd":function(Ge,be,U){Ge.exports={flex_box_center:"flex_box_center___37CPQ",flex_space_between:"flex_space_between___1yzV5",flex_box_vertical_center:"flex_box_vertical_center___2QH_C",flex_box_center_end:"flex_box_center_end___22kLi",flex_box_column:"flex_box_column___1Y3On",line:"line___-rzSr",b1:"b1___1zz_c",b2:"b2___1dAOW",list:"list___1gpez",title:"title___21uOv",tr:"tr___3kTJL",itemDetail:"itemDetail___8QmqJ",answerWrapper:"answerWrapper___3guKO",decoration:"decoration___1rcYW",row:"row___3uQSh",typeRow:"typeRow___ADZSj",type:"type___2pfNZ",typeName:"typeName___8ZhPv",typeIcon:"typeIcon___1Xniv",unpublished:"unpublished___dTXTI",private:"private___XQiDx",public:"public___iIFou",reviewFlag:"reviewFlag___YP4vk",typeRightAction:"typeRightAction___1PQjp",actionLink:"actionLink___2E5q_",actionIcon:"actionIcon___GCvNK",topicTitle:"topicTitle___3fJds",topicTitleContent:"topicTitleContent___35cf9",judgmentContent:"judgmentContent___SU5rV",programContent:"programContent___3G6-D",otherContent:"otherContent___1JHnX",combinationContent:"combinationContent___6ZXO-",con:"con___1_qCl",otherContentItem:"otherContentItem___18WrV",otehrContentHtml:"otehrContentHtml___LW3nV",difficultyRow:"difficultyRow___3HvT0",updateTimeRow:"updateTimeRow___1dNd0",updateTimeWrap:"updateTimeWrap___2PKks",updateTimeContent:"updateTimeContent___1mNBy",programLanguage:"programLanguage___3CnaJ",updateTimeRowAction:"updateTimeRowAction___1DaMt",bottomAction:"bottomAction___Y-BNC",borderColorBlue:"borderColorBlue___2Xd-0",borderColorRed:"borderColorRed___2zA_q",borderColorFFF:"borderColorFFF___2R5-5",borderColorGray:"borderColorGray___nZnDe",selectIcon:"selectIcon___2byLd",colorGreen:"colorGreen___1iOKR",parseAnswerBorder:"parseAnswerBorder___1LTYn",answer:"answer___2L9lv",answerHtml:"answerHtml___3zrOk",parse:"parse___3d3dm",parseText:"parseText___1C_VL",parseAnswer:"parseAnswer___QMVPC",parseAnswerHtml:"parseAnswerHtml___2TCVz",actionBar:"actionBar___2ItMN",know:"know___y8QKK",menu:"menu___SYdg7",bottom:"bottom___2dFIa",textBtn:"textBtn___1y00f"}},"+z73":function(Ge,be,U){Ge.exports={flex_box_center:"flex_box_center___3WSrc",flex_space_between:"flex_space_between___1fpCp",flex_box_vertical_center:"flex_box_vertical_center___3Wy8W",flex_box_center_end:"flex_box_center_end___3YIs2",flex_box_column:"flex_box_column___3CNwR",pWrap:"pWrap___2jVbQ",few:"few___3Eebn"}},"/cxE":function(Ge,be,U){"use strict";U.d(be,"f",function(){return R}),U.d(be,"g",function(){return N}),U.d(be,"h",function(){return S}),U.d(be,"e",function(){return F}),U.d(be,"b",function(){return j}),U.d(be,"c",function(){return e}),U.d(be,"d",function(){return w}),U.d(be,"a",function(){return g});class ue{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(c){setTimeout(()=>{throw c.stack?new Error(c.message+`
`+c.stack):c},0)}}emit(c){this.listeners.forEach(u=>{u(c)})}onUnexpectedError(c){this.unexpectedErrorHandler(c),this.emit(c)}onUnexpectedExternalError(c){this.unexpectedErrorHandler(c)}}const W=new ue;function R(c){F(c)||W.onUnexpectedError(c);return}function N(c){F(c)||W.onUnexpectedExternalError(c);return}function S(c){if(c instanceof Error){let{name:u,message:a}=c;const i=c.stacktrace||c.stack;return{$isError:!0,name:u,message:a,stack:i}}return c}const O="Canceled";function F(c){return c instanceof Error&&c.name===O&&c.message===O}function j(){const c=new Error(O);return c.name=c.message,c}function e(c){return c?new Error(`Illegal argument: ${c}`):new Error("Illegal argument")}function w(c){return c?new Error(`Illegal state: ${c}`):new Error("Illegal state")}class g extends Error{constructor(c){super("NotSupported");c&&(this.message=c)}}},"1vnw":function(Ge,be,U){Ge.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(Ge,be,U){"use strict";U.d(be,"a",function(){return W});class ue{constructor(R){this.element=R,this.next=ue.Undefined,this.prev=ue.Undefined}}ue.Undefined=new ue(void 0);class W{constructor(){this._first=ue.Undefined,this._last=ue.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ue.Undefined}clear(){let R=this._first;for(;R!==ue.Undefined;){const N=R.next;R.prev=ue.Undefined,R.next=ue.Undefined,R=N}this._first=ue.Undefined,this._last=ue.Undefined,this._size=0}unshift(R){return this._insert(R,!1)}push(R){return this._insert(R,!0)}_insert(R,N){const S=new ue(R);if(this._first===ue.Undefined)this._first=S,this._last=S;else if(N){const F=this._last;this._last=S,S.prev=F,F.next=S}else{const F=this._first;this._first=S,S.next=F,F.prev=S}this._size+=1;let O=!1;return()=>{O||(O=!0,this._remove(S))}}shift(){if(this._first===ue.Undefined)return;{const R=this._first.element;return this._remove(this._first),R}}pop(){if(this._last===ue.Undefined)return;{const R=this._last.element;return this._remove(this._last),R}}_remove(R){if(R.prev!==ue.Undefined&&R.next!==ue.Undefined){const N=R.prev;N.next=R.next,R.next.prev=N}else R.prev===ue.Undefined&&R.next===ue.Undefined?(this._first=ue.Undefined,this._last=ue.Undefined):R.next===ue.Undefined?(this._last=this._last.prev,this._last.next=ue.Undefined):R.prev===ue.Undefined&&(this._first=this._first.next,this._first.prev=ue.Undefined);this._size-=1}*[Symbol.iterator](){let R=this._first;for(;R!==ue.Undefined;)yield R.element,R=R.next}}},"3/fG":function(Ge,be,U){"use strict";U.d(be,"a",function(){return W});function ue(R,N){let S;return N.length===0?S=R:S=R.replace(/\{(\d+)\}/g,function(O,F){const j=F[0];return typeof N[j]!="undefined"?N[j]:O}),S}function W(R,N,...S){return ue(N,S)}},"5VLF":function(Ge,be,U){"use strict";var ue,W;function R(N,S,O){var F=function(j,e){return N.js_beautify(j,e)};return F.js=N.js_beautify,F.css=S.css_beautify,F.html=O.html_beautify,F.js_beautify=N.js_beautify,F.css_beautify=S.css_beautify,F.html_beautify=O.html_beautify,F}!(ue=[U("6UM0"),U("TXwP"),U("psGv")],W=function(N,S,O){return R(N,S,O)}.apply(be,ue),W!==void 0&&(Ge.exports=W))},"5Y4S":function(Ge,be,U){"use strict";U.d(be,"a",function(){return R});var ue=U("MNsG");const W=ue.b.performance&&typeof ue.b.performance.now=="function";class R{constructor(N){this._highResolution=W&&N,this._startTime=this._now(),this._stopTime=-1}static create(N=!0){return new R(N)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ue.b.performance.now():Date.now()}}},"6+eU":function(Ge,be,U){"use strict";U.d(be,"a",function(){return m});var ue=U("wx14"),W=U("rePB"),R=U("VTBJ"),N=U("1OyB"),S=U("vuIU"),O=U("Ji7U"),F=U("LK+K"),j=U("q1tI"),e=U.n(j),w=U("TSYQ"),g=U.n(w),c=function(_){var o,f="".concat(_.rootPrefixCls,"-item"),l=g()(f,"".concat(f,"-").concat(_.page),(o={},Object(W.a)(o,"".concat(f,"-active"),_.active),Object(W.a)(o,_.className,!!_.className),Object(W.a)(o,"".concat(f,"-disabled"),!_.page),o)),h=function(){_.onClick(_.page)},E=function(T){_.onKeyPress(T,_.onClick,_.page)};return e.a.createElement("li",{title:_.showTitle?_.page:null,className:l,onClick:h,onKeyPress:E,tabIndex:"0"},_.itemRender(_.page,"page",e.a.createElement("a",{rel:"nofollow"},_.page)))},u=c,a={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},i=function(b){Object(O.a)(o,b);var _=Object(F.a)(o);function o(){var f;Object(N.a)(this,o);for(var l=arguments.length,h=new Array(l),E=0;E<l;E++)h[E]=arguments[E];return f=_.call.apply(_,[this].concat(h)),f.state={goInputText:""},f.buildOptionText=function(y){return"".concat(y," ").concat(f.props.locale.items_per_page)},f.changeSize=function(y){f.props.changeSize(Number(y))},f.handleChange=function(y){f.setState({goInputText:y.target.value})},f.handleBlur=function(y){var T=f.props,L=T.goButton,D=T.quickGo,x=T.rootPrefixCls,P=f.state.goInputText;if(L||P==="")return;if(y.relatedTarget&&(y.relatedTarget.className.indexOf("".concat(x,"-prev"))>=0||y.relatedTarget.className.indexOf("".concat(x,"-next"))>=0))return;f.setState({goInputText:""}),D(f.getValidValue())},f.go=function(y){var T=f.state.goInputText;if(T==="")return;(y.keyCode===a.ENTER||y.type==="click")&&(f.setState({goInputText:""}),f.props.quickGo(f.getValidValue()))},f}return Object(S.a)(o,[{key:"getValidValue",value:function(){var l=this.state,h=l.goInputText,E=l.current;return!h||isNaN(h)?E:Number(h)}},{key:"getPageSizeOptions",value:function(){var l=this.props,h=l.pageSize,E=l.pageSizeOptions;return E.some(function(y){return y.toString()===h.toString()})?E:E.concat([h.toString()]).sort(function(y,T){var L=isNaN(Number(y))?0:Number(y),D=isNaN(Number(T))?0:Number(T);return L-D})}},{key:"render",value:function(){var l=this,h=this.props,E=h.pageSize,y=h.locale,T=h.rootPrefixCls,L=h.changeSize,D=h.quickGo,x=h.goButton,P=h.selectComponentClass,H=h.buildOptionText,I=h.selectPrefixCls,z=h.disabled,$=this.state.goInputText,fe="".concat(T,"-options"),ee=P,ye=null,pe=null,ae=null;if(!L&&!D)return null;var se=this.getPageSizeOptions();if(L&&ee){var _e=se.map(function(te,k){return e.a.createElement(ee.Option,{key:k,value:te.toString()},(H||l.buildOptionText)(te))});ye=e.a.createElement(ee,{disabled:z,prefixCls:I,showSearch:!1,className:"".concat(fe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(k){return k.parentNode}},_e)}return D&&(x&&(ae=typeof x=="boolean"?e.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:z,className:"".concat(fe,"-quick-jumper-button")},y.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},x)),pe=e.a.createElement("div",{className:"".concat(fe,"-quick-jumper")},y.jump_to,e.a.createElement("input",{disabled:z,type:"text",value:$,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),y.page,ae)),e.a.createElement("li",{className:"".concat(fe)},ye,pe)}}]),o}(e.a.Component);i.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=i,s=U("N2Kk");function r(){}function n(b){return typeof b=="number"&&isFinite(b)&&Math.floor(b)===b}function t(b,_,o){return o}function v(b,_,o){var f=typeof b=="undefined"?_.pageSize:b;return Math.floor((o.total-1)/f)+1}var p=function(b){Object(O.a)(o,b);var _=Object(F.a)(o);function o(f){var l;Object(N.a)(this,o),l=_.call(this,f),l.getJumpPrevPage=function(){return Math.max(1,l.state.current-(l.props.showLessItems?3:5))},l.getJumpNextPage=function(){return Math.min(v(void 0,l.state,l.props),l.state.current+(l.props.showLessItems?3:5))},l.getItemIcon=function(L,D){var x=l.props.prefixCls,P=L||e.a.createElement("button",{type:"button","aria-label":D,className:"".concat(x,"-item-link")});return typeof L=="function"&&(P=e.a.createElement(L,Object(R.a)({},l.props))),P},l.savePaginationNode=function(L){l.paginationNode=L},l.isValid=function(L){return n(L)&&L!==l.state.current},l.shouldDisplayQuickJumper=function(){var L=l.props,D=L.showQuickJumper,x=L.pageSize,P=L.total;return P<=x?!1:D},l.handleKeyDown=function(L){(L.keyCode===a.ARROW_UP||L.keyCode===a.ARROW_DOWN)&&L.preventDefault()},l.handleKeyUp=function(L){var D=l.getValidValue(L),x=l.state.currentInputValue;D!==x&&l.setState({currentInputValue:D}),L.keyCode===a.ENTER?l.handleChange(D):L.keyCode===a.ARROW_UP?l.handleChange(D-1):L.keyCode===a.ARROW_DOWN&&l.handleChange(D+1)},l.changePageSize=function(L){var D=l.state.current,x=v(L,l.state,l.props);D=D>x?x:D,x===0&&(D=l.state.current),typeof L=="number"&&("pageSize"in l.props||l.setState({pageSize:L}),"current"in l.props||l.setState({current:D,currentInputValue:D})),l.props.onShowSizeChange(D,L),"onChange"in l.props&&l.props.onChange&&l.props.onChange(D,L)},l.handleChange=function(L){var D=l.props.disabled,x=L;if(l.isValid(x)&&!D){var P=v(void 0,l.state,l.props);x>P?x=P:x<1&&(x=1),"current"in l.props||l.setState({current:x,currentInputValue:x});var H=l.state.pageSize;return l.props.onChange(x,H),x}return l.state.current},l.prev=function(){l.hasPrev()&&l.handleChange(l.state.current-1)},l.next=function(){l.hasNext()&&l.handleChange(l.state.current+1)},l.jumpPrev=function(){l.handleChange(l.getJumpPrevPage())},l.jumpNext=function(){l.handleChange(l.getJumpNextPage())},l.hasPrev=function(){return l.state.current>1},l.hasNext=function(){return l.state.current<v(void 0,l.state,l.props)},l.runIfEnter=function(L,D){if(L.key==="Enter"||L.charCode===13){for(var x=arguments.length,P=new Array(x>2?x-2:0),H=2;H<x;H++)P[H-2]=arguments[H];D.apply(void 0,P)}},l.runIfEnterPrev=function(L){l.runIfEnter(L,l.prev)},l.runIfEnterNext=function(L){l.runIfEnter(L,l.next)},l.runIfEnterJumpPrev=function(L){l.runIfEnter(L,l.jumpPrev)},l.runIfEnterJumpNext=function(L){l.runIfEnter(L,l.jumpNext)},l.handleGoTO=function(L){(L.keyCode===a.ENTER||L.type==="click")&&l.handleChange(l.state.currentInputValue)};var h=f.onChange!==r,E="current"in f;E&&!h&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var y=f.defaultCurrent;"current"in f&&(y=f.current);var T=f.defaultPageSize;return"pageSize"in f&&(T=f.pageSize),y=Math.min(y,v(T,void 0,f)),l.state={current:y,currentInputValue:y,pageSize:T},l}return Object(S.a)(o,[{key:"componentDidUpdate",value:function(l,h){var E=this.props.prefixCls;if(h.current!==this.state.current&&this.paginationNode){var y=this.paginationNode.querySelector(".".concat(E,"-item-").concat(h.current));y&&document.activeElement===y&&y.blur()}}},{key:"getValidValue",value:function(l){var h=l.target.value,E=v(void 0,this.state,this.props),y=this.state.currentInputValue,T;return h===""?T=h:isNaN(Number(h))?T=y:h>=E?T=E:T=Number(h),T}},{key:"getShowSizeChanger",value:function(){var l=this.props,h=l.showSizeChanger,E=l.total,y=l.totalBoundaryShowSizeChanger;return typeof h!="undefined"?h:E>y}},{key:"renderPrev",value:function(l){var h=this.props,E=h.prevIcon,y=h.itemRender,T=y(l,"prev",this.getItemIcon(E,"prev page")),L=!this.hasPrev();return Object(j.isValidElement)(T)?Object(j.cloneElement)(T,{disabled:L}):T}},{key:"renderNext",value:function(l){var h=this.props,E=h.nextIcon,y=h.itemRender,T=y(l,"next",this.getItemIcon(E,"next page")),L=!this.hasNext();return Object(j.isValidElement)(T)?Object(j.cloneElement)(T,{disabled:L}):T}},{key:"render",value:function(){var l=this,h=this.props,E=h.prefixCls,y=h.className,T=h.style,L=h.disabled,D=h.hideOnSinglePage,x=h.total,P=h.locale,H=h.showQuickJumper,I=h.showLessItems,z=h.showTitle,$=h.showTotal,fe=h.simple,ee=h.itemRender,ye=h.showPrevNextJumpers,pe=h.jumpPrevIcon,ae=h.jumpNextIcon,se=h.selectComponentClass,_e=h.selectPrefixCls,te=h.pageSizeOptions,k=this.state,A=k.current,C=k.pageSize,B=k.currentInputValue;if(D===!0&&x<=C)return null;var K=v(void 0,this.state,this.props),M=[],ie=null,Ee=null,Oe=null,q=null,de=null,Te=H&&H.goButton,xe=I?1:2,Pe=A-1>0?A-1:0,Ne=A+1<K?A+1:K,Re=Object.keys(this.props).reduce(function(X,Q){return(Q.substr(0,5)==="data-"||Q.substr(0,5)==="aria-"||Q==="role")&&(X[Q]=l.props[Q]),X},{});if(fe)return Te&&(typeof Te=="boolean"?de=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},P.jump_to_confirm):de=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Te),de=e.a.createElement("li",{title:z?"".concat(P.jump_to).concat(A,"/").concat(K):null,className:"".concat(E,"-simple-pager")},de)),e.a.createElement("ul",Object(ue.a)({className:g()(E,"".concat(E,"-simple"),Object(W.a)({},"".concat(E,"-disabled"),L),y),style:T,ref:this.savePaginationNode},Re),e.a.createElement("li",{title:z?P.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:g()("".concat(E,"-prev"),Object(W.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Pe)),e.a.createElement("li",{title:z?"".concat(A,"/").concat(K):null,className:"".concat(E,"-simple-pager")},e.a.createElement("input",{type:"text",value:B,disabled:L,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),e.a.createElement("span",{className:"".concat(E,"-slash")},"/"),K),e.a.createElement("li",{title:z?P.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:g()("".concat(E,"-next"),Object(W.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Ne)),de);if(K<=3+xe*2){var Me={locale:P,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:z,itemRender:ee};K||M.push(e.a.createElement(u,Object(ue.a)({},Me,{key:"noPager",page:K,className:"".concat(E,"-disabled")})));for(var He=1;He<=K;He+=1){var We=A===He;M.push(e.a.createElement(u,Object(ue.a)({},Me,{key:He,page:He,active:We})))}}else{var Ke=I?P.prev_3:P.prev_5,Be=I?P.next_3:P.next_5;ye&&(ie=e.a.createElement("li",{title:z?Ke:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:g()("".concat(E,"-jump-prev"),Object(W.a)({},"".concat(E,"-jump-prev-custom-icon"),!!pe))},ee(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(pe,"prev page"))),Ee=e.a.createElement("li",{title:z?Be:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:g()("".concat(E,"-jump-next"),Object(W.a)({},"".concat(E,"-jump-next-custom-icon"),!!ae))},ee(this.getJumpNextPage(),"jump-next",this.getItemIcon(ae,"next page")))),q=e.a.createElement(u,{locale:P,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:K,page:K,active:!1,showTitle:z,itemRender:ee}),Oe=e.a.createElement(u,{locale:P,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:z,itemRender:ee});var Ve=Math.max(1,A-xe),Xe=Math.min(A+xe,K);A-1<=xe&&(Xe=1+xe*2),K-A<=xe&&(Ve=K-xe*2);for(var ne=Ve;ne<=Xe;ne+=1){var V=A===ne;M.push(e.a.createElement(u,{locale:P,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ne,page:ne,active:V,showTitle:z,itemRender:ee}))}A-1>=xe*2&&A!==1+2&&(M[0]=Object(j.cloneElement)(M[0],{className:"".concat(E,"-item-after-jump-prev")}),M.unshift(ie)),K-A>=xe*2&&A!==K-2&&(M[M.length-1]=Object(j.cloneElement)(M[M.length-1],{className:"".concat(E,"-item-before-jump-next")}),M.push(Ee)),Ve!==1&&M.unshift(Oe),Xe!==K&&M.push(q)}var G=null;$&&(G=e.a.createElement("li",{className:"".concat(E,"-total-text")},$(x,[x===0?0:(A-1)*C+1,A*C>x?x:A*C])));var Z=!this.hasPrev()||!K,re=!this.hasNext()||!K;return e.a.createElement("ul",Object(ue.a)({className:g()(E,y,Object(W.a)({},"".concat(E,"-disabled"),L)),style:T,unselectable:"unselectable",ref:this.savePaginationNode},Re),G,e.a.createElement("li",{title:z?P.prev_page:null,onClick:this.prev,tabIndex:Z?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(E,"-prev"),Object(W.a)({},"".concat(E,"-disabled"),Z)),"aria-disabled":Z},this.renderPrev(Pe)),M,e.a.createElement("li",{title:z?P.next_page:null,onClick:this.next,tabIndex:re?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(E,"-next"),Object(W.a)({},"".concat(E,"-disabled"),re)),"aria-disabled":re},this.renderNext(Ne)),e.a.createElement(d,{disabled:L,locale:P,rootPrefixCls:E,selectComponentClass:se,selectPrefixCls:_e,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:A,pageSize:C,pageSizeOptions:te,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Te}))}}],[{key:"getDerivedStateFromProps",value:function(l,h){var E={};if("current"in l&&(E.current=l.current,l.current!==h.current&&(E.currentInputValue=E.current)),"pageSize"in l&&l.pageSize!==h.pageSize){var y=h.current,T=v(l.pageSize,h,l);y=y>T?T:y,"current"in l||(E.current=y,E.currentInputValue=y),E.pageSize=l.pageSize}return E}}]),o}(e.a.Component);p.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:r,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:r,locale:s.a,style:{},itemRender:t,totalBoundaryShowSizeChanger:50};var m=p},"6UM0":function(Ge,be,U){var ue,W;(function(){var R;(function(){"use strict";var S=[function(e,w,g){var c=g(1).Beautifier,u=g(5).Options;function a(i,d){var s=new c(i,d);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new u}},function(e,w,g){var c=g(2).Output,u=g(3).Token,a=g(4),i=g(5).Options,d=g(7).Tokenizer,s=g(7).line_starters,r=g(7).positionable_operators,n=g(7).TOKEN;function t(I,z){return z.indexOf(I)!==-1}function v(I){return I.replace(/^\s+/g,"")}function p(I){for(var z={},$=0;$<I.length;$++)z[I[$].replace(/-/g,"_")]=I[$];return z}function m(I,z){return I&&I.type===n.RESERVED&&I.text===z}function b(I,z){return I&&I.type===n.RESERVED&&t(I.text,z)}var _=["case","return","do","if","throw","else","await","break","continue","async"],o=["before-newline","after-newline","preserve-newline"],f=p(o),l=[f.before_newline,f.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(I,z){if(z.multiline_frame||z.mode===h.ForInitializer||z.mode===h.Conditional)return;I.remove_indent(z.start_line_index)}function y(I){I=I.replace(a.allLineBreaks,`
`);for(var z=[],$=I.indexOf(`
`);$!==-1;)z.push(I.substring(0,$)),I=I.substring($+1),$=I.indexOf(`
`);return I.length&&z.push(I),z}function T(I){return I===h.ArrayLiteral}function L(I){return t(I,[h.Expression,h.ForInitializer,h.Conditional])}function D(I,z){for(var $=0;$<I.length;$++){var fe=I[$].trim();if(fe.charAt(0)!==z)return!1}return!0}function x(I,z){for(var $=0,fe=I.length,ee;$<fe;$++)if(ee=I[$],ee&&ee.indexOf(z)!==0)return!1;return!0}function P(I,z){z=z||{},this._source_text=I||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new i(z)}P.prototype.create_flags=function(I,z){var $=0;I&&($=I.indentation_level,!this._output.just_added_newline()&&I.line_indent_level>$&&($=I.line_indent_level));var fe={mode:z,parent:I,last_token:I?I.last_token:new u(n.START_BLOCK,""),last_word:I?I.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:I?I.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return fe},P.prototype._reset=function(I){var z=I.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new c(this._options,z),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var $=new d(I,this._options);return this._tokens=$.tokenize(),I},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var I,z=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
`,z&&a.lineBreak.test(z||"")&&($=z.match(a.lineBreak)[0]));for(var fe=this._tokens.next();fe;)this.handle_token(fe),this._last_last_text=this._flags.last_token.text,this._flags.last_token=fe,fe=this._tokens.next();return I=this._output.get_code($),I},P.prototype.handle_token=function(I,z){I.type===n.START_EXPR?this.handle_start_expr(I):I.type===n.END_EXPR?this.handle_end_expr(I):I.type===n.START_BLOCK?this.handle_start_block(I):I.type===n.END_BLOCK?this.handle_end_block(I):I.type===n.WORD?this.handle_word(I):I.type===n.RESERVED?this.handle_word(I):I.type===n.SEMICOLON?this.handle_semicolon(I):I.type===n.STRING?this.handle_string(I):I.type===n.EQUALS?this.handle_equals(I):I.type===n.OPERATOR?this.handle_operator(I):I.type===n.COMMA?this.handle_comma(I):I.type===n.BLOCK_COMMENT?this.handle_block_comment(I,z):I.type===n.COMMENT?this.handle_comment(I,z):I.type===n.DOT?this.handle_dot(I):I.type===n.EOF?this.handle_eof(I):I.type===n.UNKNOWN?this.handle_unknown(I,z):this.handle_unknown(I,z)},P.prototype.handle_whitespace_and_comments=function(I,z){var $=I.newlines,fe=this._options.keep_array_indentation&&T(this._flags.mode);if(I.comments_before)for(var ee=I.comments_before.next();ee;)this.handle_whitespace_and_comments(ee,z),this.handle_token(ee,z),ee=I.comments_before.next();if(fe)for(var ye=0;ye<$;ye+=1)this.print_newline(ye>0,z);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,z);for(var pe=1;pe<$;pe+=1)this.print_newline(!0,z)}};var H=["async","break","continue","return","throw","yield"];P.prototype.allow_wrap_or_preserved_newline=function(I,z){if(z=z===void 0?!1:z,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&I.newlines||z,fe=t(this._flags.last_token.text,r)||t(I.text,r);if(fe){var ee=t(this._flags.last_token.text,r)&&t(this._options.operator_position,l)||t(I.text,r);$=$&&ee}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(b(this._flags.last_token,H))return;this._output.set_wrap_point()}},P.prototype.print_newline=function(I,z){if(!z&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&m($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(I)&&(this._flags.multiline_frame=!0)},P.prototype.print_token_line_indentation=function(I){this._output.just_added_newline()&&(this._options.keep_array_indentation&&I.newlines&&(I.text==="["||T(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(I.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},P.prototype.print_token=function(I){if(this._output.raw){this._output.add_raw_token(I);return}if(this._options.comma_first&&I.previous&&I.previous.type===n.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var z=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(z),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(I),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(I),this._output.non_breaking_space=!0,this._output.add_token(I.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},P.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.prototype.set_mode=function(I){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,I),this._flags=this.create_flags(this._previous_flags,I),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||b(this._flags.last_token,["get","set"]))},P.prototype.start_of_statement=function(I){var z=!1;return z=z||b(this._flags.last_token,["var","let","const"])&&I.type===n.WORD,z=z||m(this._flags.last_token,"do"),z=z||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&b(this._flags.last_token,H)&&!I.newlines,z=z||m(this._flags.last_token,"else")&&!(m(I,"if")&&!I.comments_before),z=z||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),z=z||this._flags.last_token.type===n.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(I.text==="--"||I.text==="++")&&this._last_last_text!=="function"&&I.type!==n.WORD&&I.type!==n.RESERVED,z=z||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||b(this._flags.last_token,["get","set"])),z?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(I,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I,b(I,["do","for","if","while"])),!0):!1},P.prototype.handle_start_expr=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I);var z=h.Expression;if(I.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){b(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(I),this.set_mode(z),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}z=h.ArrayLiteral,T(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),t(this._flags.last_token.type,[n.START_EXPR,n.END_EXPR,n.WORD,n.OPERATOR,n.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===n.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,z=h.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,z=h.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&I.whitespace_before===""?this._output.space_before_token=!1:(t(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var fe=this._tokens.peek(-4);b($,["async","function"])||$.text==="*"&&b(fe,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(fe.text==="{"||fe.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(I);(this._flags.last_token.type===n.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&t(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===n.START_BLOCK?this.print_newline():(this._flags.last_token.type===n.END_EXPR||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===n.COMMA)&&this.allow_wrap_or_preserved_newline(I,I.newlines),this.print_token(I),this.set_mode(z),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},P.prototype.handle_end_expr=function(I){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(I,I.text==="]"&&T(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===n.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(I),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},P.prototype.handle_start_block=function(I){this.handle_whitespace_and_comments(I);var z=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.BlockStatement):$&&(t($.text,[":",","])&&t(z.type,[n.STRING,n.WORD,n.RESERVED])||t(z.text,["get","set","..."])&&t($.type,[n.WORD,n.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t($.text,[":",","])?this.set_mode(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.BlockStatement):t(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||b(this._flags.last_token,["return","throw","import","default"])?this.set_mode(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(b(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var fe=!z.comments_before&&z.text==="}",ee=fe&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var ye=0,pe=null;this._flags.inline_frame=!0;do if(ye+=1,pe=this._tokens.peek(ye-1),pe.newlines){this._flags.inline_frame=!1;break}while(pe.type!==n.EOF&&!(pe.type===n.END_BLOCK&&pe.opened===I))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&I.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&(ee||this._flags.last_token.type===n.EQUALS||b(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(T(this._previous_flags.mode)&&(this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.COMMA)&&((this._flags.last_token.type===n.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(I),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==n.OPERATOR&&this._flags.last_token.type!==n.START_EXPR&&(this._flags.last_token.type===n.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(I),this.indent(),!fe&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},P.prototype.handle_end_block=function(I){for(this.handle_whitespace_and_comments(I);this._flags.mode===h.Statement;)this.restore_mode();var z=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!z?this._output.space_before_token=!0:this._options.brace_style==="expand"?z||this.print_newline():z||(T(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(I)},P.prototype.handle_word=function(I){if(I.type===n.RESERVED){if(t(I.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)I.type=n.WORD;else if(I.text==="import"&&t(this._tokens.peek().text,["(","."]))I.type=n.WORD;else if(t(I.text,["as","from"])&&!this._flags.import_block)I.type=n.WORD;else if(this._flags.mode===h.ObjectLiteral){var z=this._tokens.peek();z.text===":"&&(I.type=n.WORD)}}if(this.start_of_statement(I)?b(this._flags.last_token,["var","let","const"])&&I.type===n.WORD&&(this._flags.declaration_statement=!0):I.newlines&&!L(this._flags.mode)&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==n.EQUALS&&(this._options.preserve_newlines||!b(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(I),this.print_newline()):this.handle_whitespace_and_comments(I),this._flags.do_block&&!this._flags.do_while)if(m(I,"while")){this._output.space_before_token=!0,this.print_token(I),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&m(I,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&b(I,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(I),this._flags.in_case=!0;return}if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I)),m(I,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&(!this._output.just_added_blankline()&&!I.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?b(this._flags.last_token,["get","set","new","export"])||b(this._flags.last_token,H)?this._output.space_before_token=!0:m(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===n.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(L(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(I),this._flags.last_word=I.text;return}var $="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":b(I,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&I.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===h.BlockStatement?$="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&L(this._flags.mode)?$="SPACE":this._flags.last_token.type===n.STRING?$="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===h.ObjectLiteral&&t(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),b(I,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),b(I,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&I.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var fe=this._output.current_line;fe.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?b(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&b(I,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==n.END_EXPR?(this._flags.last_token.type!==n.START_EXPR||!b(I,["var","let","const"]))&&this._flags.last_token.text!==":"&&(m(I,"if")&&m(I.previous,"else")?this._output.space_before_token=!0:this.print_newline()):b(I,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);I.previous&&(I.previous.type===n.WORD||I.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(I),this._flags.last_word=I.text,I.type===n.RESERVED&&(I.text==="do"?this._flags.do_block=!0:I.text==="if"?this._flags.if_block=!0:I.text==="import"?this._flags.import_block=!0:this._flags.import_block&&m(I,"from")&&(this._flags.import_block=!1))},P.prototype.handle_semicolon=function(I){this.start_of_statement(I)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(I);for(var z=this._tokens.peek();this._flags.mode===h.Statement&&!(this._flags.if_block&&m(z,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(I)},P.prototype.handle_string=function(I){I.text.startsWith("`")&&I.newlines===0&&I.whitespace_before===""&&(I.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(I)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(I),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(I):I.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(I.previous.text==="]"||I.previous.text===")")&&I.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(I)},P.prototype.handle_equals=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(I),this._output.space_before_token=!0},P.prototype.handle_comma=function(I){this.handle_whitespace_and_comments(I,!0),this.print_token(I),this._output.space_before_token=!0,this._flags.declaration_statement?(L(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(I)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(I)},P.prototype.handle_operator=function(I){var z=I.text==="*"&&(b(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),$=t(I.text,["-","+"])&&(t(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||t(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(I)){var fe=!z;this.handle_whitespace_and_comments(I,fe)}if(I.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(I);return}if(I.text==="::"){this.print_token(I);return}if(this._flags.last_token.type===n.OPERATOR&&t(this._options.operator_position,l)&&this.allow_wrap_or_preserved_newline(I),I.text===":"&&this._flags.in_case){this.print_token(I),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==n.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var ee=!0,ye=!0,pe=!1;if(I.text===":"?this._flags.ternary_depth===0?ee=!1:(this._flags.ternary_depth-=1,pe=!0):I.text==="?"&&(this._flags.ternary_depth+=1),!$&&!z&&this._options.preserve_newlines&&t(I.text,r)){var ae=I.text===":",se=ae&&pe,_e=ae&&!pe;switch(this._options.operator_position){case f.before_newline:this._output.space_before_token=!_e,this.print_token(I),(!ae||se)&&this.allow_wrap_or_preserved_newline(I),this._output.space_before_token=!0;return;case f.after_newline:this._output.space_before_token=!0,!ae||se?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(I):this._output.space_before_token=!1,this.print_token(I),this._output.space_before_token=!0;return;case f.preserve_newline:_e||this.allow_wrap_or_preserved_newline(I),ee=!(this._output.just_added_newline()||_e),this._output.space_before_token=ee,this.print_token(I),this._output.space_before_token=!0;return}}if(z){this.allow_wrap_or_preserved_newline(I),ee=!1;var te=this._tokens.peek();ye=te&&t(te.type,[n.WORD,n.RESERVED])}else if(I.text==="...")this.allow_wrap_or_preserved_newline(I),ee=this._flags.last_token.type===n.START_BLOCK,ye=!1;else if(t(I.text,["--","++","!","~"])||$){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(I),ee=!1,ye=!1,I.newlines&&(I.text==="--"||I.text==="++"||I.text==="~")){var k=b(this._flags.last_token,_)&&I.newlines;k&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(k,!0)}this._flags.last_token.text===";"&&L(this._flags.mode)&&(ee=!0),this._flags.last_token.type===n.RESERVED?ee=!0:this._flags.last_token.type===n.END_EXPR?ee=!(this._flags.last_token.text==="]"&&(I.text==="--"||I.text==="++")):this._flags.last_token.type===n.OPERATOR&&(ee=t(I.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(I.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(ye=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ee,this.print_token(I),this._output.space_before_token=ye},P.prototype.handle_block_comment=function(I,z){if(this._output.raw){this._output.add_raw_token(I),I.directives&&I.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(I.directives){this.print_newline(!1,z),this.print_token(I),I.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(I.text)&&!I.newlines){this._output.space_before_token=!0,this.print_token(I),this._output.space_before_token=!0;return}else this.print_block_commment(I,z)},P.prototype.print_block_commment=function(I,z){var $=y(I.text),fe,ee=!1,ye=!1,pe=I.whitespace_before,ae=pe.length;if(this.print_newline(!1,z),this.print_token_line_indentation(I),this._output.add_token($[0]),this.print_newline(!1,z),$.length>1){for($=$.slice(1),ee=D($,"*"),ye=x($,pe),ee&&(this._flags.alignment=1),fe=0;fe<$.length;fe++)ee?(this.print_token_line_indentation(I),this._output.add_token(v($[fe]))):ye&&$[fe]?(this.print_token_line_indentation(I),this._output.add_token($[fe].substring(ae))):(this._output.current_line.set_indent(-1),this._output.add_token($[fe])),this.print_newline(!1,z);this._flags.alignment=0}},P.prototype.handle_comment=function(I,z){I.newlines?this.print_newline(!1,z):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(I),this.print_newline(!1,z)},P.prototype.handle_dot=function(I){this.start_of_statement(I)||this.handle_whitespace_and_comments(I,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),b(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(I,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(I)},P.prototype.handle_unknown=function(I,z){this.print_token(I),I.text[I.text.length-1]===`
`&&this.print_newline(!1,z)},P.prototype.handle_eof=function(I){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(I)},e.exports.Beautifier=P},function(e){function w(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}w.prototype.clone_empty=function(){var u=new w(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},w.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},w.prototype.has_match=function(u){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(u))return!0;return!1},w.prototype.set_indent=function(u,a){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},w.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},w.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},w.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(u){this.__items.push(u);var a=u.lastIndexOf(`
`);a!==-1?this.__character_count=u.length-a:this.__character_count+=u.length},w.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function g(u,a){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),a=a||"",u.indent_level>0&&(a=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}g.prototype.get_indent_size=function(u,a){var i=this.__base_string_length;return a=a||0,u<0&&(i=0),i+=u*this.__indent_size,i+=a,i},g.prototype.get_indent_string=function(u,a){var i=this.__base_string;return a=a||0,u<0&&(u=0,i=""),a+=u*this.__indent_size,this.__ensure_cache(a),i+=this.__cache[a],i},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,a=0,i="";this.__indent_size&&u>=this.__indent_size&&(a=Math.floor(u/this.__indent_size),u-=a*this.__indent_size,i=new Array(a+1).join(this.__indent_string)),u&&(i+=new Array(u+1).join(" ")),this.__cache.push(i)};function c(u,a){this.__indent_cache=new g(u,a),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(u,a){return this.__indent_cache.get_indent_string(u,a)},c.prototype.get_indent_size=function(u,a){return this.__indent_cache.get_indent_size(u,a)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(u){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return u!==`
`&&(i=i.replace(/[\n]/g,u)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(u,a){return u=u||0,a=a||0,this.next_line.set_indent(u,a),this.__lines.length>1?(this.current_line.set_indent(u,a),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(u){for(var a=0;a<u.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},c.prototype.remove_indent=function(u){for(var a=this.__lines.length;u<a;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(u,a){for(var i=this.__lines.length-2;i>=0;){var d=this.__lines[i];if(d.is_empty())break;if(d.item(0).indexOf(u)!==0&&d.item(-1)!==a){this.__lines.splice(i+1,0,new w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=c},function(e){function w(g,c,u,a){this.type=g,this.text=c,this.comments_before=null,this.newlines=u||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=w},function(e,w){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",c="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",a="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",i="(?:\\\\u[0-9a-fA-F]{4}|["+g+u+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+c+u+a+"])*";w.identifier=new RegExp(i+d,"g"),w.identifierStart=new RegExp(i),w.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+c+u+a+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;w.newline=/[\n\r\u2028\u2029]/,w.lineBreak=new RegExp(`\r
|`+w.newline.source),w.allLineBreaks=new RegExp(w.lineBreak.source,"g")},function(e,w,g){var c=g(6).Options,u=["before-newline","after-newline","preserve-newline"];function a(i){c.call(this,i,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r<s.length;r++)s[r]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[r];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",u),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new c,e.exports.Options=a},function(e){function w(u,a){this.raw_options=g(u,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}w.prototype._get_array=function(u,a){var i=this.raw_options[u],d=a||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(d=i.concat()):typeof i=="string"&&(d=i.split(/[^a-zA-Z0-9_\/\-]+/)),d},w.prototype._get_boolean=function(u,a){var i=this.raw_options[u],d=i===void 0?!!a:!!i;return d},w.prototype._get_characters=function(u,a){var i=this.raw_options[u],d=a||"";return typeof i=="string"&&(d=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},w.prototype._get_number=function(u,a){var i=this.raw_options[u];a=parseInt(a,10),isNaN(a)&&(a=0);var d=parseInt(i,10);return isNaN(d)&&(d=a),d},w.prototype._get_selection=function(u,a,i){var d=this._get_selection_list(u,a,i);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[u]+"'");return d[0]},w.prototype._get_selection_list=function(u,a,i){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[a[0]],!this._is_valid_selection(i,a))throw new Error("Invalid Default Value!");var d=this._get_array(u,i);if(!this._is_valid_selection(d,a))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[u]+"'");return d},w.prototype._is_valid_selection=function(u,a){return u.length&&a.length&&!u.some(function(i){return a.indexOf(i)===-1})};function g(u,a){var i={};u=c(u);var d;for(d in u)d!==a&&(i[d]=u[d]);if(a&&u[a])for(d in u[a])i[d]=u[a][d];return i}function c(u){var a={},i;for(i in u){var d=i.replace(/-/g,"_");a[d]=u[i]}return a}e.exports.Options=w,e.exports.normalizeOpts=c,e.exports.mergeOpts=g},function(e,w,g){var c=g(8).InputScanner,u=g(9).Tokenizer,a=g(9).TOKEN,i=g(13).Directives,d=g(4),s=g(12).Pattern,r=g(14).TemplatablePattern;function n(D,x){return x.indexOf(D)!==-1}var t={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:a.START,RAW:a.RAW,EOF:a.EOF},v=new i(/\/\*/,/\*\//),p=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,m=/[0-9]/,b=/[^\d\.]/,_=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),o=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";o=o.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),o="\\?\\.(?!\\d) "+o,o=o.replace(/ /g,"|");var f=new RegExp(o),l="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=l.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+h.join("|")+")$"),y,T=function(D,x){u.call(this,D,x),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var P=new s(this._input),H=new r(this._input).read_options(this._options);this.__patterns={template:H,identifier:H.starting_with(d.identifier).matching(d.identifierMatch),number:P.matching(p),punct:P.matching(f),comment:P.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:P.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:P.matching(/<!--/),html_comment_end:P.matching(/-->/),include:P.starting_with(/#include/).until_after(d.lineBreak),shebang:P.starting_with(/#!/).until_after(d.lineBreak),xml:P.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:H.until(/['\\\n\r\u2028\u2029]/),double_quote:H.until(/["\\\n\r\u2028\u2029]/),template_text:H.until(/[`\\$]/),template_expression:H.until(/[`}\\]/)}};T.prototype=new u,T.prototype._is_comment=function(D){return D.type===t.COMMENT||D.type===t.BLOCK_COMMENT||D.type===t.UNKNOWN},T.prototype._is_opening=function(D){return D.type===t.START_BLOCK||D.type===t.START_EXPR},T.prototype._is_closing=function(D,x){return(D.type===t.END_BLOCK||D.type===t.END_EXPR)&&x&&(D.text==="]"&&x.text==="["||D.text===")"&&x.text==="("||D.text==="}"&&x.text==="{")},T.prototype._reset=function(){y=!1},T.prototype._get_next_token=function(D,x){var P=null;this._readWhitespace();var H=this._input.peek();return H===null?this._create_token(t.EOF,""):(P=P||this._read_non_javascript(H),P=P||this._read_string(H),P=P||this._read_word(D),P=P||this._read_singles(H),P=P||this._read_comment(H),P=P||this._read_regexp(H,D),P=P||this._read_xml(H,D),P=P||this._read_punctuation(),P=P||this._create_token(t.UNKNOWN,this._input.next()),P)},T.prototype._read_word=function(D){var x;if(x=this.__patterns.identifier.read(),x!=="")return x=x.replace(d.allLineBreaks,`
`),!(D.type===t.DOT||D.type===t.RESERVED&&(D.text==="set"||D.text==="get"))&&E.test(x)?(x==="in"||x==="of")&&(D.type===t.WORD||D.type===t.STRING)?this._create_token(t.OPERATOR,x):this._create_token(t.RESERVED,x):this._create_token(t.WORD,x);if(x=this.__patterns.number.read(),x!=="")return this._create_token(t.WORD,x)},T.prototype._read_singles=function(D){var x=null;return D==="("||D==="["?x=this._create_token(t.START_EXPR,D):D===")"||D==="]"?x=this._create_token(t.END_EXPR,D):D==="{"?x=this._create_token(t.START_BLOCK,D):D==="}"?x=this._create_token(t.END_BLOCK,D):D===";"?x=this._create_token(t.SEMICOLON,D):D==="."&&b.test(this._input.peek(1))?x=this._create_token(t.DOT,D):D===","&&(x=this._create_token(t.COMMA,D)),x&&this._input.next(),x},T.prototype._read_punctuation=function(){var D=this.__patterns.punct.read();if(D!=="")return D==="="?this._create_token(t.EQUALS,D):D==="?."?this._create_token(t.DOT,D):this._create_token(t.OPERATOR,D)},T.prototype._read_non_javascript=function(D){var x="";if(D==="#"){if(this._is_first_token()&&(x=this.__patterns.shebang.read(),x))return this._create_token(t.UNKNOWN,x.trim()+`
`);if(x=this.__patterns.include.read(),x)return this._create_token(t.UNKNOWN,x.trim()+`
`);D=this._input.next();var P="#";if(this._input.hasNext()&&this._input.testChar(m)){do D=this._input.next(),P+=D;while(this._input.hasNext()&&D!=="#"&&D!=="=");return D==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(P+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(P+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,P)}this._input.back()}else if(D==="<"&&this._is_first_token()){if(x=this.__patterns.html_comment_start.read(),x){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)x+=this._input.next();return y=!0,this._create_token(t.COMMENT,x)}}else if(y&&D==="-"&&(x=this.__patterns.html_comment_end.read(),x))return y=!1,this._create_token(t.COMMENT,x);return null},T.prototype._read_comment=function(D){var x=null;if(D==="/"){var P="";if(this._input.peek(1)==="*"){P=this.__patterns.block_comment.read();var H=v.get_directives(P);H&&H.ignore==="start"&&(P+=v.readIgnored(this._input)),P=P.replace(d.allLineBreaks,`
`),x=this._create_token(t.BLOCK_COMMENT,P),x.directives=H}else this._input.peek(1)==="/"&&(P=this.__patterns.comment.read(),x=this._create_token(t.COMMENT,P))}return x},T.prototype._read_string=function(D){if(D==="`"||D==="'"||D==='"'){var x=this._input.next();return this.has_char_escapes=!1,D==="`"?x+=this._read_string_recursive("`",!0,"${"):x+=this._read_string_recursive(D),this.has_char_escapes&&this._options.unescape_strings&&(x=L(x)),this._input.peek()===D&&(x+=this._input.next()),x=x.replace(d.allLineBreaks,`
`),this._create_token(t.STRING,x)}return null},T.prototype._allow_regexp_or_xml=function(D){return D.type===t.RESERVED&&n(D.text,["return","case","throw","else","do","typeof","yield"])||D.type===t.END_EXPR&&D.text===")"&&D.opened.previous.type===t.RESERVED&&n(D.opened.previous.text,["if","while","for"])||n(D.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},T.prototype._read_regexp=function(D,x){if(D==="/"&&this._allow_regexp_or_xml(x)){for(var P=this._input.next(),H=!1,I=!1;this._input.hasNext()&&(H||I||this._input.peek()!==D)&&!this._input.testChar(d.newline);)P+=this._input.peek(),H?H=!1:(H=this._input.peek()==="\\",this._input.peek()==="["?I=!0:this._input.peek()==="]"&&(I=!1)),this._input.next();return this._input.peek()===D&&(P+=this._input.next(),P+=this._input.read(d.identifier)),this._create_token(t.STRING,P)}return null},T.prototype._read_xml=function(D,x){if(this._options.e4x&&D==="<"&&this._allow_regexp_or_xml(x)){var P="",H=this.__patterns.xml.read_match();if(H){for(var I=H[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),z=I.indexOf("{")===0,$=0;H;){var fe=!!H[1],ee=H[2],ye=!!H[H.length-1]||ee.slice(0,8)==="![CDATA[";if(!ye&&(ee===I||z&&ee.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(fe?--$:++$),P+=H[0],$<=0)break;H=this.__patterns.xml.read_match()}return H||(P+=this._input.match(/[\s\S]*/g)[0]),P=P.replace(d.allLineBreaks,`
`),this._create_token(t.STRING,P)}}return null};function L(D){for(var x="",P=0,H=new c(D),I=null;H.hasNext();)if(I=H.match(/([\s]|[^\\]|\\\\)+/g),I&&(x+=I[0]),H.peek()==="\\"){if(H.next(),H.peek()==="x")I=H.match(/x([0-9A-Fa-f]{2})/g);else if(H.peek()==="u")I=H.match(/u([0-9A-Fa-f]{4})/g);else{x+="\\",H.hasNext()&&(x+=H.next());continue}if(!I)return D;if(P=parseInt(I[1],16),P>126&&P<=255&&I[0].indexOf("x")===0)return D;if(P>=0&&P<32){x+="\\"+I[0];continue}else P===34||P===39||P===92?x+="\\"+String.fromCharCode(P):x+=String.fromCharCode(P)}return x}T.prototype._read_string_recursive=function(D,x,P){var H,I;D==="'"?I=this.__patterns.single_quote:D==='"'?I=this.__patterns.double_quote:D==="`"?I=this.__patterns.template_text:D==="}"&&(I=this.__patterns.template_expression);for(var z=I.read(),$="";this._input.hasNext();){if($=this._input.next(),$===D||!x&&d.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(H=this._input.peek(),H==="x"||H==="u"?this.has_char_escapes=!0:H==="\r"&&this._input.peek(1)===`
`&&this._input.next(),$+=this._input.next()):P&&(P==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),P===$&&(D==="`"?$+=this._read_string_recursive("}",x,"`"):$+=this._read_string_recursive("`",x,"${"),this._input.hasNext()&&($+=this._input.next())));$+=I.read(),z+=$}return z},e.exports.Tokenizer=T,e.exports.TOKEN=t,e.exports.positionable_operators=_.slice(),e.exports.line_starters=l.slice()},function(e){var w=RegExp.prototype.hasOwnProperty("sticky");function g(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},g.prototype.peek=function(c){var u=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(u=this.__input.charAt(c)),u},g.prototype.__match=function(c,u){c.lastIndex=u;var a=c.exec(this.__input);return a&&!(w&&c.sticky)&&(a.index!==u&&(a=null)),a},g.prototype.test=function(c,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(c,u):!1},g.prototype.testChar=function(c,u){var a=this.peek(u);return c.lastIndex=0,a!==null&&c.test(a)},g.prototype.match=function(c){var u=this.__match(c,this.__position);return u?this.__position+=u[0].length:u=null,u},g.prototype.read=function(c,u,a){var i="",d;return c&&(d=this.match(c),d&&(i+=d[0])),u&&(d||!c)&&(i+=this.readUntil(u,a)),i},g.prototype.readUntil=function(c,u){var a="",i=this.__position;c.lastIndex=this.__position;var d=c.exec(this.__input);return d?(i=d.index,u&&(i+=d[0].length)):i=this.__input_length,a=this.__input.substring(this.__position,i),this.__position=i,a},g.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},g.prototype.get_regexp=function(c,u){var a=null,i="g";return u&&w&&(i="y"),typeof c=="string"&&c!==""?a=new RegExp(c,i):c&&(a=new RegExp(c.source,i)),a},g.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(c){var u=this.__position,a=this.readUntilAfter(c);return this.__position=u,a},g.prototype.lookBack=function(c){var u=this.__position-1;return u>=c.length&&this.__input.substring(u-c.length,u).toLowerCase()===c},e.exports.InputScanner=g},function(e,w,g){var c=g(8).InputScanner,u=g(3).Token,a=g(10).TokenStream,i=g(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(r,n){this._input=new c(r),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var r,n=new u(d.START,""),t=null,v=[],p=new a;n.type!==d.EOF;){for(r=this._get_next_token(n,t);this._is_comment(r);)p.add(r),r=this._get_next_token(n,t);p.isEmpty()||(r.comments_before=p,p=new a),r.parent=t,this._is_opening(r)?(v.push(t),t=r):t&&this._is_closing(r,t)&&(r.opened=t,t.closed=r,t=v.pop(),r.parent=t),r.previous=n,n.next=r,this.__tokens.add(r),n=r}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(r,n){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(d.RAW,t):this._create_token(d.EOF,"")},s.prototype._is_comment=function(r){return!1},s.prototype._is_opening=function(r){return!1},s.prototype._is_closing=function(r,n){return!1},s.prototype._create_token=function(r,n){var t=new u(r,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return t},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=s,e.exports.TOKEN=d},function(e){function w(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}w.prototype.restart=function(){this.__position=0},w.prototype.isEmpty=function(){return this.__tokens_length===0},w.prototype.hasNext=function(){return this.__position<this.__tokens_length},w.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},w.prototype.peek=function(g){var c=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(c=this.__tokens[g]),c},w.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},e.exports.TokenStream=w},function(e,w,g){var c=g(12).Pattern;function u(a,i){c.call(this,a,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}u.prototype=new c,u.prototype.__set_whitespace_patterns=function(a,i){a+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},u.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var i=this.__split(this._newline_regexp,a);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return a},u.prototype.matching=function(a,i){var d=this._create();return d.__set_whitespace_patterns(a,i),d._update(),d},u.prototype._create=function(){return new u(this._input,this)},u.prototype.__split=function(a,i){a.lastIndex=0;for(var d=0,s=[],r=a.exec(i);r;)s.push(i.substring(d,r.index)),d=r.index+r[0].length,r=a.exec(i);return d<i.length?s.push(i.substring(d,i.length)):s.push(""),s},e.exports.WhitespacePattern=u},function(e){function w(g,c){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}w.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},w.prototype.read_match=function(){return this._input.match(this._match_pattern)},w.prototype.until_after=function(g){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(g),c._update(),c},w.prototype.until=function(g){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(g),c._update(),c},w.prototype.starting_with=function(g){var c=this._create();return c._starting_pattern=this._input.get_regexp(g,!0),c._update(),c},w.prototype.matching=function(g){var c=this._create();return c._match_pattern=this._input.get_regexp(g,!0),c._update(),c},w.prototype._create=function(){return new w(this._input,this)},w.prototype._update=function(){},e.exports.Pattern=w},function(e){function w(g,c){g=typeof g=="string"?g:g.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+c,"g")}w.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(g);u;)c[u[1]]=u[2],u=this.__directive_pattern.exec(g);return c},w.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=w},function(e,w,g){var c=g(12).Pattern,u={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(i,d){c.call(this,i,d),this.__template_pattern=null,this._disabled=Object.assign({},u),this._excluded=Object.assign({},u),d&&(this.__template_pattern=this._input.get_regexp(d.__template_pattern),this._excluded=Object.assign(this._excluded,d._excluded),this._disabled=Object.assign(this._disabled,d._disabled));var s=new c(i);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new c,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(i){var d=this._create();return d._disabled[i]=!0,d._update(),d},a.prototype.read_options=function(i){var d=this._create();for(var s in u)d._disabled[s]=i.templating.indexOf(s)===-1;return d._update(),d},a.prototype.exclude=function(i){var d=this._create();return d._excluded[i]=!0,d._update(),d},a.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),i+=d,d=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},a.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},a.prototype._read_template=function(){var i="",d=this._input.peek();if(d==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(i=i||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},e.exports.TemplatablePattern=a}],O={};function F(e){var w=O[e];if(w!==void 0)return w.exports;var g=O[e]={exports:{}};return S[e](g,g.exports,F),g.exports}var j=F(0);R=j})();var N=R;!(ue=[],W=function(){return{js_beautify:N}}.apply(be,ue),W!==void 0&&(Ge.exports=W))})()},"746U":function(Ge,be,U){"use strict";U.d(be,"f",function(){return ue}),U.d(be,"l",function(){return W}),U.d(be,"k",function(){return R}),U.d(be,"j",function(){return N}),U.d(be,"g",function(){return S}),U.d(be,"m",function(){return O}),U.d(be,"h",function(){return F}),U.d(be,"n",function(){return j}),U.d(be,"c",function(){return e}),U.d(be,"a",function(){return w}),U.d(be,"i",function(){return g}),U.d(be,"o",function(){return c}),U.d(be,"e",function(){return i}),U.d(be,"d",function(){return d}),U.d(be,"p",function(){return s}),U.d(be,"b",function(){return r});function ue(n){return Array.isArray(n)}function W(n){return typeof n=="string"}function R(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function N(n){return typeof n=="number"&&!isNaN(n)}function S(n){return n===!0||n===!1}function O(n){return typeof n=="undefined"}function F(n){return!j(n)}function j(n){return O(n)||n===null}function e(n,t){if(!n)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function w(n){if(j(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function g(n){return typeof n=="function"}function c(n,t){const v=Math.min(n.length,t.length);for(let p=0;p<v;p++)u(n[p],t[p])}function u(n,t){if(W(t)){if(typeof n!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(g(t)){try{if(n instanceof t)return}catch(v){}if(!j(n)&&n.constructor===t)return;if(t.length===1&&t.call(void 0,n)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(n){let t=[],v=Object.getPrototypeOf(n);for(;Object.prototype!==v;)t=t.concat(Object.getOwnPropertyNames(v)),v=Object.getPrototypeOf(v);return t}function i(n){const t=[];for(const v of a(n))typeof n[v]=="function"&&t.push(v);return t}function d(n,t){const v=m=>function(){const b=Array.prototype.slice.call(arguments,0);return t(m,b)};let p={};for(const m of n)p[m]=v(m);return p}function s(n){return n===null?void 0:n}function r(n,t="Unreachable"){throw new Error(t)}},"815F":function(Ge,be,U){"use strict";U.d(be,"e",function(){return F}),U.d(be,"c",function(){return e}),U.d(be,"d",function(){return w}),U.d(be,"a",function(){return c}),U.d(be,"f",function(){return u}),U.d(be,"b",function(){return a});var ue=U("KQm4"),W=U("VTBJ"),R=U("Ff2n"),N=U("Zm9Q"),S=U("Kwbf"),O=U("OZM5");function F(i,d){return i!=null?i:d}function j(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function s(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(t){var v=t.key,p=t.children;Object(S.a)(v!=null,"Tree node must have a certain key: [".concat(n).concat(v,"]"));var m=String(v);Object(S.a)(!d.has(m)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(m)),d.set(m,!0),s(p,"".concat(n).concat(m," > "))})}s(i)}function e(i){function d(s){var r=Object(N.a)(s);return r.map(function(n){if(!Object(O.i)(n))return Object(S.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var t=n.key,v=n.props,p=v.children,m=Object(R.a)(v,["children"]),b=Object(W.a)({key:t},m),_=d(p);return _.length&&(b.children=_),b}).filter(function(n){return n})}return d(i)}function w(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=new Set(d===!0?[]:d),r=[];function n(t){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.map(function(p,m){var b=Object(O.h)(v?v.pos:"0",m),_=F(p.key,b),o=Object(W.a)(Object(W.a)({},p),{},{parent:v,pos:b,children:null,data:p,isStart:[].concat(Object(ue.a)(v?v.isStart:[]),[m===0]),isEnd:[].concat(Object(ue.a)(v?v.isEnd:[]),[m===t.length-1])});return r.push(o),d===!0||s.has(_)?o.children=n(p.children||[],o):o.children=[],o})}return n(i),r}function g(i,d,s){var r;s?typeof s=="string"?r=function(v){return v[s]}:typeof s=="function"&&(r=function(v){return s(v)}):r=function(v,p){return F(v.key,p)};function n(t,v,p){var m=t?t.children:i,b=t?Object(O.h)(p.pos,v):"0";if(t){var _=r(t,b),o={node:t,index:v,pos:b,key:_,parentPos:p.node?p.pos:null,level:p.level+1};d(o)}m&&m.forEach(function(f,l){n(f,l,{node:t,pos:b,level:p?p.level+1:-1})})}n(null)}function c(i){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=d.initWrapper,r=d.processEntity,n=d.onProcessFinished,t=arguments.length>2?arguments[2]:void 0,v={},p={},m={posEntities:v,keyEntities:p};return s&&(m=s(m)||m),g(i,function(b){var _=b.node,o=b.index,f=b.pos,l=b.key,h=b.parentPos,E=b.level,y={node:_,index:o,key:l,pos:f,level:E},T=F(l,f);v[f]=y,p[T]=y,y.parent=v[h],y.parent&&(y.parent.children=y.parent.children||[],y.parent.children.push(y)),r&&r(y,m)},t),n&&n(m),m}function u(i,d){var s=d.expandedKeys,r=d.selectedKeys,n=d.loadedKeys,t=d.loadingKeys,v=d.checkedKeys,p=d.halfCheckedKeys,m=d.dragOverNodeKey,b=d.dropPosition,_=d.keyEntities,o=_[i],f={eventKey:i,expanded:s.indexOf(i)!==-1,selected:r.indexOf(i)!==-1,loaded:n.indexOf(i)!==-1,loading:t.indexOf(i)!==-1,checked:v.indexOf(i)!==-1,halfChecked:p.indexOf(i)!==-1,pos:String(o?o.pos:""),dragOver:m===i&&b===0,dragOverGapTop:m===i&&b===-1,dragOverGapBottom:m===i&&b===1};return f}function a(i){var d=i.data,s=i.expanded,r=i.selected,n=i.checked,t=i.loaded,v=i.loading,p=i.halfChecked,m=i.dragOver,b=i.dragOverGapTop,_=i.dragOverGapBottom,o=i.pos,f=i.active,l=Object(W.a)(Object(W.a)({},d),{},{expanded:s,selected:r,checked:n,loaded:t,loading:v,halfChecked:p,dragOver:m,dragOverGapTop:b,dragOverGapBottom:_,pos:o,active:f});return"props"in l||Object.defineProperty(l,"props",{get:function(){return Object(S.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),l}},"8HAY":function(Ge,be,U){"use strict";U.d(be,"a",function(){return S}),U.d(be,"b",function(){return O}),U.d(be,"d",function(){return F}),U.d(be,"e",function(){return j}),U.d(be,"c",function(){return e});var ue=U("MI8n"),W=U("pmY6"),R=U("3/fG"),N=function(w,g,c,u){function a(i){return i instanceof c?i:new c(function(d){d(i)})}return new(c||(c=Promise))(function(i,d){function s(t){try{n(u.next(t))}catch(v){d(v)}}function r(t){try{n(u.throw(t))}catch(v){d(v)}}function n(t){t.done?i(t.value):a(t.value).then(s,r)}n((u=u.apply(w,g||[])).next())})};class S extends W.a{constructor(w,g="",c="",u=!0,a){super();this._onDidChange=this._register(new ue.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=w,this._label=g,this._cssClass=c,this._enabled=u,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(w){this._setLabel(w)}_setLabel(w){this._label!==w&&(this._label=w,this._onDidChange.fire({label:w}))}get tooltip(){return this._tooltip||""}set tooltip(w){this._setTooltip(w)}_setTooltip(w){this._tooltip!==w&&(this._tooltip=w,this._onDidChange.fire({tooltip:w}))}get class(){return this._cssClass}set class(w){this._setClass(w)}_setClass(w){this._cssClass!==w&&(this._cssClass=w,this._onDidChange.fire({class:w}))}get enabled(){return this._enabled}set enabled(w){this._setEnabled(w)}_setEnabled(w){this._enabled!==w&&(this._enabled=w,this._onDidChange.fire({enabled:w}))}get checked(){return this._checked}set checked(w){this._setChecked(w)}_setChecked(w){this._checked!==w&&(this._checked=w,this._onDidChange.fire({checked:w}))}run(w,g){return N(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(w))})}}class O extends W.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ue.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ue.b),this.onDidRun=this._onDidRun.event}run(w,g){return N(this,void 0,void 0,function*(){if(!w.enabled)return;this._onBeforeRun.fire({action:w});let c;try{yield this.runAction(w,g)}catch(u){c=u}this._onDidRun.fire({action:w,error:c})})}runAction(w,g){return N(this,void 0,void 0,function*(){yield w.run(g)})}}class F extends S{constructor(w){super(F.ID,w,w?"separator text":"separator");this.checked=!1,this.enabled=!1}}F.ID="vs.actions.separator";class j{constructor(w,g,c,u){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=w,this.label=g,this.class=u,this._actions=c}get actions(){return this._actions}dispose(){}run(){return N(this,void 0,void 0,function*(){})}}class e extends S{constructor(){super(e.ID,R.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(Ge,be,U){Ge.exports={button:"button___1wy9m"}},"9Bee":function(Ge,be,U){"use strict";var ue=U("DYRE"),W=U("zeV3"),R=U("+L6B"),N=U("2/Rp"),S=U("k1fw"),O=U("9og8"),F=U("tJVT"),j=U("WmNS"),e=U.n(j),w=U("q1tI"),g=U.n(w),c=U("vg9a"),u=U("DlQD"),a=U.n(u),i=U("rUJ1");function d(ne,V){var G=ne.match(/^(\s+)(?:```)/);if(G===null)return V;var Z=G[1];return V.split(`
`).map(function(re){var X=re.match(/^\s+/);if(X===null)return re;var Q=Object(F.a)(X,1),oe=Q[0];return oe.length>=Z.length?re.slice(Z.length):re}).join(`
`)}var s=[],r=["<ul>"],n=new a.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){s.length=0,r=["<ul>"]}var p={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(ne,V,G,Z){if(V>=ne.length||ne[V].level<=G)return V;var re=ne[V];Z.push("<li><a href='#"+re.anchor+"'>"+re.text+"</a>"),V++;var X=[];return V=m(ne,V,re.level,X),X.length>0&&(Z.push("<ul>"),X.forEach(function(Q){Z.push(Q)}),Z.push("</ul>")),Z.push("</li>"),V=m(ne,V,G,Z),V}function b(){return m(s,0,0,r),r.push("</ul>"),r.join("")}var _={heading:function(V){var G=t.exec(V);if(G)return{type:"heading",raw:G[0],depth:G[1].length,text:G[2]}},fences:function(V){var G=this.rules.block.fences.exec(V);if(G){var Z=G[0],re=d(Z,G[3]||""),X=G[2]?G[2].trim():G[2];if(["latex","katex","math"].indexOf(X)>=0){var Q=l(),oe=re;re=Q,h[Q]={type:"block",expression:oe}}return{type:"code",raw:Z,lang:X,text:re}}}},o=/(?:\${2})([^\n`]+?)(?:\${2})/gi,f=0,l=function(){return"__special_katext_id_".concat(f++,"__")},h={};function E(){return h}function y(){f=0,h={}}function T(ne){return ne=ne.replace(o,function(V,G){var Z=l();return h[Z]={type:"inline",expression:G},Z}),ne}var L=n.listitem;n.listitem=function(ne){return L(T(ne))};var D=n.paragraph;n.paragraph=function(ne){return D(T(ne))};var x=n.tablecell;n.tablecell=function(ne,V){return x(T(ne),V)},n.code=function(ne,V,G){var Z=(V||"").match(/\S*/)[0];return Z?["latex","katex","math"].indexOf(Z)>=0?"<p class='editormd-tex'>".concat(ne,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(V,'">').concat(G?ne:Object(i.escape)(ne,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(G?ne:Object(i.escape)(ne,!0))+"</code></pre>"},n.heading=function(ne,V,G){var Z=this.options.headerPrefix+G.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:Z,level:V,text:ne}),"<h"+V+' id="'+Z+'">'+ne+"</h"+V+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:_,renderer:n});var P=a.a,H=U("SJMd"),I=U("ulZh"),z=U.n(I),$=U("m3rI"),fe=U("Oy/b"),ee=U("p5ED"),ye=U("ErOA"),pe=U("STEk");/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var ae=function(ne,V){return(ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,Z){G.__proto__=Z}||function(G,Z){for(var re in Z)Object.prototype.hasOwnProperty.call(Z,re)&&(G[re]=Z[re])})(ne,V)};function se(ne,V){if(typeof V!="function"&&V!==null)throw new TypeError("Class extends value "+String(V)+" is not a constructor or null");function G(){this.constructor=ne}ae(ne,V),ne.prototype=V===null?Object.create(V):(G.prototype=V.prototype,new G)}function _e(ne,V,G,Z){return new(G||(G=Promise))(function(re,X){function Q(De){try{he(Z.next(De))}catch(Ie){X(Ie)}}function oe(De){try{he(Z.throw(De))}catch(Ie){X(Ie)}}function he(De){var Ie;De.done?re(De.value):(Ie=De.value,Ie instanceof G?Ie:new G(function(Ue){Ue(Ie)})).then(Q,oe)}he((Z=Z.apply(ne,V||[])).next())})}function te(ne,V){var G,Z,re,X,Q={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return X={next:oe(0),throw:oe(1),return:oe(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function oe(he){return function(De){return function(Ie){if(G)throw new TypeError("Generator is already executing.");for(;Q;)try{if(G=1,Z&&(re=2&Ie[0]?Z.return:Ie[0]?Z.throw||((re=Z.return)&&re.call(Z),0):Z.next)&&!(re=re.call(Z,Ie[1])).done)return re;switch(Z=0,re&&(Ie=[2&Ie[0],re.value]),Ie[0]){case 0:case 1:re=Ie;break;case 4:return Q.label++,{value:Ie[1],done:!1};case 5:Q.label++,Z=Ie[1],Ie=[0];continue;case 7:Ie=Q.ops.pop(),Q.trys.pop();continue;default:if(!(re=Q.trys,(re=re.length>0&&re[re.length-1])||Ie[0]!==6&&Ie[0]!==2)){Q=0;continue}if(Ie[0]===3&&(!re||Ie[1]>re[0]&&Ie[1]<re[3])){Q.label=Ie[1];break}if(Ie[0]===6&&Q.label<re[1]){Q.label=re[1],re=Ie;break}if(re&&Q.label<re[2]){Q.label=re[2],Q.ops.push(Ie);break}re[2]&&Q.ops.pop(),Q.trys.pop();continue}Ie=V.call(ne,Q)}catch(Ue){Ie=[6,Ue],Z=0}finally{G=re=0}if(5&Ie[0])throw Ie[1];return{value:Ie[0]?Ie[1]:void 0,done:!0}}([he,De])}}}var k=function(){function ne(){}return ne.addKey=function(V){ne.key=V},Object.defineProperty(ne,"isLicensed",{get:function(){return!!ne.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ne.key)},enumerable:!1,configurable:!0}),ne}(),A=function(){function ne(){}return ne.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ne.setAttributes=function(V,G){for(var Z=0,re=G;Z<re.length;Z++){var X=re[Z],Q=X[0],oe=X[1];V.setAttribute(Q,oe)}},ne.createRect=function(V,G,Z){var re=document.createElementNS("http://www.w3.org/2000/svg","rect");return re.setAttribute("width",V.toString()),re.setAttribute("height",G.toString()),Z&&ne.setAttributes(re,Z),re},ne.createLine=function(V,G,Z,re,X){var Q=document.createElementNS("http://www.w3.org/2000/svg","line");return Q.setAttribute("x1",V.toString()),Q.setAttribute("y1",G.toString()),Q.setAttribute("x2",Z.toString()),Q.setAttribute("y2",re.toString()),X&&ne.setAttributes(Q,X),Q},ne.createPolygon=function(V,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Z.setAttribute("points",V),G&&ne.setAttributes(Z,G),Z},ne.createCircle=function(V,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","circle");return Z.setAttribute("cx",(V/2).toString()),Z.setAttribute("cy",(V/2).toString()),Z.setAttribute("r",V.toString()),G&&ne.setAttributes(Z,G),Z},ne.createEllipse=function(V,G,Z){var re=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return re.setAttribute("cx",(V/2).toString()),re.setAttribute("cy",(G/2).toString()),re.setAttribute("rx",(V/2).toString()),re.setAttribute("ry",(G/2).toString()),Z&&ne.setAttributes(re,Z),re},ne.createGroup=function(V){var G=document.createElementNS("http://www.w3.org/2000/svg","g");return V&&ne.setAttributes(G,V),G},ne.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ne.createMarker=function(V,G,Z,re,X,Q,oe){var he=document.createElementNS("http://www.w3.org/2000/svg","marker");return ne.setAttributes(he,[["id",V],["orient",G],["markerWidth",Z.toString()],["markerHeight",re.toString()],["refX",X.toString()],["refY",Q.toString()]]),he.appendChild(oe),he},ne.createText=function(V){var G=document.createElementNS("http://www.w3.org/2000/svg","text");return G.setAttribute("x","0"),G.setAttribute("y","0"),V&&ne.setAttributes(G,V),G},ne.createTSpan=function(V,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Z.textContent=V,G&&ne.setAttributes(Z,G),Z},ne.createImage=function(V){var G=document.createElementNS("http://www.w3.org/2000/svg","image");return V&&ne.setAttributes(G,V),G},ne.createPoint=function(V,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Z.x=V,Z.y=G,Z},ne.createPath=function(V,G){var Z=document.createElementNS("http://www.w3.org/2000/svg","path");return Z.setAttribute("d",V),G&&ne.setAttributes(Z,G),Z},ne.createElement=function(V,G){var Z=document.createElementNS("http://www.w3.org/2000/svg",V);return G&&ne.setAttributes(Z,G),Z},ne.getHollowRectanglePath=function(V,G,Z,re,X,Q,oe,he){return"M"+V+","+G+"V"+(G+re)+"H"+(V+Z)+"V"+G+"H"+X+"V"+Q+"H"+(X+oe)+"V"+(Q+he)+"H"+X+"V"+G+"Z"},ne}(),C=function(){function ne(V){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+V+"_"}return Object.defineProperty(ne.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),ne.prototype.addClass=function(V){return this.styleSheet===void 0&&this.addStyleSheet(),V.name=""+this.classNamePrefix+V.localName,this.classes.push(V),this.styleSheet.sheet.insertRule("."+V.name+" {"+V.style+"}",this.styleSheet.sheet.cssRules.length),V},ne.prototype.addRule=function(V){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(V),this.styleSheet.sheet.insertRule(V.selector+" {"+V.style+"}",this.styleSheet.sheet.cssRules.length)},ne.prototype.addStyleSheet=function(){var V;this.styleSheet=document.createElement("style"),((V=this.styleSheetRoot)!==null&&V!==void 0?V:document.head).appendChild(this.styleSheet),this.addRule(new B("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new B("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new B("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new K("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new K("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ne.prototype.removeStyleSheet=function(){var V;this.styleSheet&&(((V=this.styleSheetRoot)!==null&&V!==void 0?V:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ne}(),B=function(ne,V){this.selector=ne,this.style=V},K=function(ne,V){this.localName=ne,this.style=V},M=function(){function ne(){this.blocks=[],this.display=""}return ne.prototype.addButtonBlock=function(V){V.className=this.blockClassName,V.buttonClassName=this.buttonClassName,V.buttonColorsClassName=this.buttonColorsClassName,V.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(V)},ne.prototype.addElementBlock=function(V){V.className===void 0&&(V.className=this.blockClassName),this.blocks.push(V)},ne.prototype.getUI=function(){var V=document.createElement("div");return V.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,V.style.display=this.display,this.blocks.forEach(function(G){return V.appendChild(G.getUI())}),V},ne}(),ie=function(){function ne(){}return ne.prototype.getUI=function(){var V=document.createElement("div");if(V.className=this.className,this.minWidth!==void 0&&(V.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":V.style.justifyContent="flex-start";break;case"center":V.style.justifyContent="center";break;case"end":V.style.justifyContent="flex-end"}return V.style.whiteSpace="nowrap",V},ne}(),Ee=function(ne){function V(){var G=ne!==null&&ne.apply(this,arguments)||this;return G.buttons=[],G}return se(V,ne),V.prototype.addButton=function(G){G.className=this.buttonClassName,G.colorsClassName=this.buttonColorsClassName,G.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(G)},V.prototype.getUI=function(){var G=ne.prototype.getUI.call(this);return this.buttons.forEach(function(Z){return G.appendChild(Z.getUI())}),G},V}(ie),Oe=function(){function ne(V,G){this._isActive=!1,this._isHidden=!1,this._icon=V,this.title=G,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(ne.prototype,"icon",{get:function(){return this._icon},set:function(V){this._icon=V,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"isActive",{get:function(){return this._isActive},set:function(V){this._isActive=V,this.adjustClassName()},enumerable:!1,configurable:!0}),ne.prototype.getUI=function(){var V=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return V.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},ne.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},ne.prototype.hide=function(){this._isHidden=!0},ne}(),q=function(ne){function V(){var G=ne!==null&&ne.apply(this,arguments)||this;return G.elements=[],G}return se(V,ne),V.prototype.addElement=function(G){this.elements.push(G)},V.prototype.getUI=function(){var G=ne.prototype.getUI.call(this);return this.elements.forEach(function(Z){return G.appendChild(Z)}),G},V}(ie),de=function(){function ne(V,G){this.horizontal=V,this.vertical=G}return Object.defineProperty(ne.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),ne.prototype.getVerticalLength=function(V){return V/this.ratio},ne.prototype.getHorizontalLength=function(V){return V*this.ratio},ne}(),Te=function(){function ne(){}return ne.getIcon=function(V,G){if(V>0&&G>0){var Z=new de(V,G),re=Z.ratio>=1?20:Z.getHorizontalLength(20),X=Z.ratio<1?20:Z.getVerticalLength(20),Q=document.createElementNS("http://www.w3.org/2000/svg","svg");Q.setAttribute("xmlns","http://www.w3.org/2000/svg"),Q.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Q);var oe=A.createDefs();Q.appendChild(oe);var he=A.createElement("clipPath",[["id","text-bg-clip"]]);oe.appendChild(he);var De=A.createPath(A.getHollowRectanglePath((24-re)/2,(24-X)/2,re,X,(24-re)/2+2,(24-X)/2+2,re-4,X-4));Q.appendChild(De);var Ie=A.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ie.appendChild(A.createTSpan(V+":"+G)),Q.appendChild(Ie);var Ue=Ie.getBBox();A.setAttributes(Ie,[["x",((24-Ue.width)/2).toString()],["y",((24-Ue.height)/2-Ue.y).toString()]]);var Ye=A.createPath(A.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ue.width))/2,(24-Math.ceil(Ue.height))/2,Math.ceil(Ue.width),Math.ceil(Ue.height)));return he.appendChild(Ye),A.setAttributes(De,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Q),Q.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},ne}(),xe=function(ne){function V(G,Z,re){var X=ne.call(this,G,Z)||this;return X.isDropdownOpen=!1,X.onClick=X.dropdownButtonClicked,X.dropdownButtons=re,X}return se(V,ne),V.prototype.setupDropdown=function(){var G=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(Z){Z.className=G.className,Z.colorsClassName=G.colorsClassName,G.dropdownBlock.appendChild(Z.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},V.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},V.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},V.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},V.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},V.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},V}(Oe),Pe=function(){function ne(V,G){this.GRIP_SIZE=10,this.color=V,this.fillColor=G,this.visual=A.createGroup(),this.visual.appendChild(A.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(A.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ne.prototype.ownsTarget=function(V){return V===this.visual||V===this.visual.childNodes[0]||V===this.visual.childNodes[1]},ne.prototype.setCenter=function(V,G){this.visual.childNodes.forEach(function(Z){return A.setAttributes(Z,[["cx",V.toString()],["cy",G.toString()]])})},ne}(),Ne=function(){function ne(V,G,Z,re){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=V,this.canvasHeight=G,this.margin=Z,this.container=re,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(ne.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(V){this._aspectRatio=V,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(V){this._isGridVisible=V,this.gridContainer&&A.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(V){this._zoomFactor=V,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),ne.prototype.open=function(){var V=this;this.cropShadeElement=A.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=A.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var G=0;G<this.numberOfGridLines;G++)this.horizontalGridLines.push(A.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(A.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(Z){return V.gridContainer.appendChild(Z)}),this.verticalGridLines.forEach(function(Z){return V.gridContainer.appendChild(Z)}),this.cropRectElement=A.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Pe(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},ne.prototype.setCropRectangle=function(V){this.cropRect=V;var G=Object.assign({},this.cropRect);this.zoomFactor!==1&&(G.width=this.cropRect.width*this.zoomFactor,G.height=this.cropRect.height*this.zoomFactor,G.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-G.width/2,G.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-G.height/2),A.setAttributes(this.cropRectElement,[["x",G.x.toString()],["y",G.y.toString()],["width",G.width.toString()],["height",G.height.toString()]]);var Z=G.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(X,Q){var oe=G.y+Z*(Q+1);A.setAttributes(X,[["x1",""+G.x],["y1",""+oe],["x2",""+(G.x+G.width)],["y2",""+oe]])});var re=G.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(X,Q){var oe=G.x+re*(Q+1);A.setAttributes(X,[["x1",""+oe],["y1",""+G.y],["x2",""+oe],["y2",""+(G.y+G.height)]])}),A.setAttributes(this.cropShadeElement,[["d",A.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,G.x,G.y,G.width,G.height)]]),this.topLeftGrip.setCenter(G.x,G.y),this.topRightGrip.setCenter(G.x+G.width,G.y),this.bottomLeftGrip.setCenter(G.x,G.y+G.height),this.bottomRightGrip.setCenter(G.x+G.width,G.y+G.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},ne.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},ne.prototype.clientToLocalCoordinates=function(V,G){var Z=this.container.getBoundingClientRect();return{x:V-Z.left+this.margin,y:G-Z.top+this.margin}},ne.prototype.onPointerDown=function(V){this.container.setPointerCapture(V.pointerId),this.previousPoint=this.clientToLocalCoordinates(V.clientX,V.clientY),this.cropRectElement===V.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(V.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(V.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(V.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(V.target)&&(this.activeGrip=this.bottomRightGrip)},ne.prototype.onPointerMove=function(V){if(this.isMoving)this.move(this.clientToLocalCoordinates(V.clientX,V.clientY));else if(this.activeGrip){var G=this.clientToLocalCoordinates(V.clientX,V.clientY);this.resize(G)}V.preventDefault()},ne.prototype.onPointerUp=function(V){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(V.pointerId)},ne.prototype.move=function(V){var G=V.x-this.previousPoint.x,Z=V.y-this.previousPoint.y;this.zoomFactor!==1&&(G=-G/this.zoomFactor,Z=-Z/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+G),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+Z),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=V},ne.prototype.resize=function(V){var G=Object.assign({},this.cropRect),Z=V.x-this.previousPoint.x,re=V.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:G.x+Z<this.margin&&(Z=this.margin-G.x),G.x+=Z,G.width=this.cropRect.x+this.cropRect.width-G.x;break;case this.bottomRightGrip:case this.topRightGrip:G.width+Z>this.canvasWidth*this.zoomFactor&&(Z=this.canvasWidth*this.zoomFactor-G.width),G.width+=Z}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(G.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(Z),G.height=this.aspectRatio.getVerticalLength(G.width)):(G.y+=re,G.height=this.cropRect.y+this.cropRect.height-G.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?G.height=this.aspectRatio.getVerticalLength(G.width):G.height+=re}G.width<10&&(G.x=this.cropRect.x,G.width=10),G.height<10&&(G.y=this.cropRect.y,G.height=10),this.previousPoint=V,G.x>=this.margin&&G.y>=this.margin&&G.x-this.margin+G.width<=this.canvasWidth&&G.y-this.margin+G.height<=this.canvasHeight&&(this.cropRect=G,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},ne.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var V=this.cropRect.x+this.cropRect.width/2,G=this.cropRect.y+this.cropRect.height/2,Z=this.aspectRatio.getHorizontalLength(this.cropRect.height),re=this.aspectRatio.getVerticalLength(this.cropRect.width);Z/this.canvasWidth<re/this.canvasHeight?this.cropRect.width=Z:this.cropRect.height=re,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=V-this.cropRect.width/2,this.cropRect.y=G-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},ne.prototype.getRescaledRect=function(V,G,Z,re,X,Q){var oe=Z/V,he=re/G;return{x:(X.x-Q)*oe+Q,y:(X.y-Q)*he+Q,width:X.width*oe,height:X.height*he}},ne.prototype.scaleCanvas=function(V,G){var Z=this.getRescaledRect(this.canvasWidth,this.canvasHeight,V,G,this.cropRect,this.margin);this.canvasWidth=V,this.canvasHeight=G,this.onCropChange&&this.onCropChange(Z),this.setCropRectangle(Z)},ne}(),Re=function(){function ne(V){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=V,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(ne.prototype,"angle",{get:function(){return this._angle},set:function(V){this._angle=V,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),ne.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},ne.prototype.onPointerDown=function(V){this.controlContainer.setPointerCapture(V.pointerId),this.isDragging=!0,this.previousPoint={x:V.clientX,y:V.clientY}},ne.prototype.onPointerMove=function(V){this.isDragging&&(this.onAngleChange&&this.onAngleChange((V.clientX-this.previousPoint.x)/5),this.previousPoint.x=V.clientX)},ne.prototype.onPointerUp=function(V){this.isDragging&&this.onAngleChange&&this.onAngleChange((V.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(V.pointerId)},ne.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var V=this.angleLabelText.getBBox();A.setAttributes(this.angleLabelElement,[["x",((this.width-V.width)/2).toString()],["y",(this.height/2).toString()]])}},ne.prototype.positionScaleShape=function(){if(this.scaleShape){var V=this.scaleShape.transform.baseVal.getItem(0);V.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(V,0)}},ne.prototype.getVisual=function(){var V=document.createElementNS("http://www.w3.org/2000/svg","svg");V.setAttribute("xmlns","http://www.w3.org/2000/svg"),V.setAttribute("width",this.width+"px"),V.setAttribute("height",this.height+"px"),V.setAttribute("viewBox","0 0 "+this.width+" "+this.height),V.style.flexShrink="0",document.body.appendChild(V);for(var G="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,Z=1;Z<=this.width/5+10;Z++){var re=Z%5==0?this.height/3:this.height/6;G+="h4v"+-re+"h1v"+re}G+="v1H0Z",this.scaleShape=A.createPath(G);var X=A.createTransform();this.scaleShape.transform.baseVal.appendItem(X),V.appendChild(this.scaleShape),this.angleLabelElement=A.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=A.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Q=A.createTSpan("");return Q.innerHTML="&deg;",this.angleLabelElement.appendChild(Q),V.appendChild(this.angleLabelElement),document.body.removeChild(V),V},ne}(),Me=function(){function ne(){this.naturalSize=!1,this.imageType="image/png"}return ne.prototype.rasterize=function(V,G,Z,re,X,Q,oe){var he=this;return new Promise(function(De){var Ie=document.createElement("canvas");Ie.width=V.width.baseVal.value-2*re,Ie.height=V.height.baseVal.value-2*re;var Ue=1,Ye=1;he.naturalSize===!0?(Ue=G.naturalWidth/(V.width.baseVal.value-2*re)/Q,Ye=G.naturalHeight/(V.height.baseVal.value-2*re)/oe,Ie.width=G.naturalWidth/Q,Ie.height=G.naturalHeight/oe):he.width!==void 0&&he.height!==void 0&&(Ue=he.width/Z.width,Ye=he.height/Z.height,Ie.width*=Ue,Ie.height*=Ye);var Je=Ie.getContext("2d");Je.translate(Ie.width/2,Ie.height/2),Je.rotate(X*Math.PI/180),Je.scale(Q,oe),Je.translate(-Ie.width/2,-Ie.height/2),Je.drawImage(G,0,0,Ie.width,Ie.height);var Ze=document.createElement("canvas");Ze.width=Z.width*Ue,Ze.height=Z.height*Ye,Ze.getContext("2d").putImageData(Je.getImageData((Z.x-re)*Ue,(Z.y-re)*Ye,Z.width*Ue,Z.height*Ye),0,0),De(Ze.toDataURL(he.imageType,he.imageQuality))})},ne}(),He=function(){function ne(V){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=ne.instanceCounter++,this.styles=new C(this.instanceNo),this.target=V,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(ne.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(V){this._zoomToCropEnabled=V,V?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(V){this._isGridVisible=V,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"gridLines",{get:function(){return this._gridLines},set:function(V){this._gridLines=V,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(V){this._rotationAngle=V,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ne.prototype,"aspectRatio",{get:function(){var V;return(V=this._aspectRatio)!==null&&V!==void 0?V:this.aspectRatios[0]},set:function(V){this._aspectRatio=V},enumerable:!1,configurable:!0}),ne.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},ne.prototype.show=function(){this.showUI(),this.open()},ne.prototype.close=function(V){V===void 0&&(V=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),V||this.closeEventListeners.forEach(function(G){return G()}),this._isOpen=!1)},ne.prototype.addRenderEventListener=function(V){this.renderEventListeners.push(V)},ne.prototype.removeRenderEventListener=function(V){this.renderEventListeners.indexOf(V)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(V),1)},ne.prototype.addCloseEventListener=function(V){this.closeEventListeners.push(V)},ne.prototype.removeCloseEventListener=function(V){this.closeEventListeners.indexOf(V)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(V),1)},ne.prototype.setupResizeObserver=function(){var V=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){V.resize(V.target.clientWidth,V.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},ne.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var V=1*this.target.clientWidth/this.target.clientHeight,G=this.contentDiv.clientWidth/V>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*V:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,Z=G+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/V;this.resize(G,Z)}},ne.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ne.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",A.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},ne.prototype.resize=function(V,G){this.imageWidth=Math.round(V),this.imageHeight=Math.round(G),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},ne.prototype.setEditingTarget=function(){var V=document.createElement("canvas");V.width=this.target.naturalWidth,V.height=this.target.naturalHeight,V.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var G=V.toDataURL();A.setAttributes(this.editingTarget,[["href",G]]),this.setEditingTargetSize()},ne.prototype.setTopLeft=function(){var V=this.target.getBoundingClientRect(),G=this.editorCanvas.getBoundingClientRect();this.left=V.left-G.left-this.CANVAS_MARGIN,this.top=V.top-G.top-this.CANVAS_MARGIN},ne.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=A.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=A.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=A.createGroup(),this.editingTargetRotationScaleContainer=A.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var V=A.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(V);var G=A.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(G),this.editingTargetContainer=A.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},ne.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},ne.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=A.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ne(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},ne.prototype.zoomToCrop=function(){if(this.cropRect){var V=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,G=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=V+"px "+G+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-V+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-G+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},ne.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},ne.prototype.cropRectChanged=function(V){this.cropRect=V,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},ne.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},ne.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ne.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ne.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var V=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,G=this.target.offsetTop>V+this.CANVAS_MARGIN?this.target.offsetTop-(V+this.CANVAS_MARGIN):0;this.coverDiv.style.top=G+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},ne.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},ne.prototype.addTopToolbar=function(){var V=this;this.topToolbar=new M,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var G=new Ee;G.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(G);var Z=[];this.aspectRatios.forEach(function(Ye){var Je=new Oe(Te.getIcon(Ye.horizontal,Ye.vertical),Ye.horizontal===0&&Ye.vertical===0?"FREE":Ye.horizontal+":"+Ye.vertical);Je.onClick=function(){return V.ratioButtonClicked(Ye)},Z.push(Je)}),this.aspectRatioButton=new xe(Te.getIcon(0,0),"Aspect ratio",Z),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,G.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var re=new Oe('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");re.isActive=this.isGridVisible,re.onClick=function(){V.isGridVisible=!V.isGridVisible,re.isActive=V.isGridVisible},G.addButton(re);var X=new Oe('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(X.isActive=this.zoomToCropEnabled,X.onClick=function(){V.zoomToCropEnabled=!V.zoomToCropEnabled,X.isActive=V.zoomToCropEnabled},G.addButton(X),!k.isLicensed){var Q=new q;this.topToolbar.addElementBlock(Q);var oe=document.createElement("div");oe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var he=document.createElement("a");he.style.color="currentColor",he.href="https://markerjs.com/products/cropro",he.target="_blank",he.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',oe.appendChild(he),Q.addElement(oe)}var De=new Ee;De.minWidth=3*this.toolbarHeight+"px",De.contentAlign="end",this.topToolbar.addButtonBlock(De);var Ie=new Oe('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Ie.onClick=this.startRenderAndClose,De.addButton(Ie),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ie.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ue=new Oe('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Ue.onClick=this.close,De.addButton(Ue),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ue.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},ne.prototype.addBottomToolbar=function(){var V=this;this.bottomToolbar=new M,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var G=new Ee;G.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(G);var Z=new Oe('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");Z.onClick=this.rotateLeftButtonClicked,G.addButton(Z);var re=new Oe('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");re.onClick=this.rotateRightButtonClicked,G.addButton(re);var X=new q;X.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(X),this.straightener=new Re("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(De){V.rotateBy(De),V.straightener.angle=V.rotationAngle},X.addElement(this.straightener.getUI());var Q=new Ee;Q.minWidth=2*this.toolbarHeight+"px",Q.contentAlign="end",this.bottomToolbar.addButtonBlock(Q);var oe=new Oe('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");oe.onClick=this.flipHorizontallyButtonClicked,Q.addButton(oe);var he=new Oe('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");he.onClick=this.flipVerticallyButtonClicked,Q.addButton(he)},ne.prototype.ratioButtonClicked=function(V){this.aspectRatio=V,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},ne.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Te.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},ne.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new de(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},ne.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ne.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},ne.prototype.restoreState=function(V){if(V){var G=this.cropLayer.getRescaledRect(V.width,V.height,this.imageWidth,this.imageHeight,V.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(G),this.cropRectChanged(G),this.flippedHorizontally=V.flippedHorizontally,this.flippedVertically=V.flippedVertically,this.applyFlip(),this.rotationAngle=V.rotationAngle,this.applyRotation()}},ne.prototype.clientToLocalCoordinates=function(V,G){var Z=this.cropImage.getBoundingClientRect();return{x:V-Z.left,y:G-Z.top}},ne.prototype.onWindowResize=function(){this.positionUI()},ne.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var V=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=V+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},ne.prototype.rotateLeftButtonClicked=function(){var V=this.rotationAngle-90;this.rotationAngle%90!=0&&(V+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(V)},ne.prototype.rotateRightButtonClicked=function(){var V=this.rotationAngle+90;this.rotationAngle%90!=0&&(V-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(V)},ne.prototype.rotateTo=function(V){V=(V=V>180?V-360:V)<=-180?V+360:V,this.rotationAngle=V,this.applyRotation()},ne.prototype.rotateBy=function(V){this.rotateTo((this.rotationAngle+V)%360)},ne.prototype.applyRotation=function(){var V=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var G=this.editingTargetRotationContainer.transform.baseVal.getItem(0);G.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(G,0);var Z=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/Z.width,this.imageHeight/Z.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=V},ne.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},ne.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},ne.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},ne.prototype.startRenderAndClose=function(){return _e(this,void 0,void 0,function(){var V,G;return te(this,function(Z){switch(Z.label){case 0:return[4,this.render()];case 1:return V=Z.sent(),G=this.getState(),this.renderEventListeners.forEach(function(re){return re(V,G)}),this.close(!0),[2]}})})},ne.prototype.render=function(){return _e(this,void 0,void 0,function(){var V;return te(this,function(G){switch(G.label){case 0:return(V=new Me).naturalSize=this.renderAtNaturalSize,V.imageType=this.renderImageType,V.imageQuality=this.renderImageQuality,V.width=this.renderWidth,V.height=this.renderHeight,this.unzoomFromCrop(),A.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,V.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return G.sent(),[4,V.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,G.sent()]}})})},ne.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new K("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new K("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new K("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var V=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new K("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*V)+`px;
height: `+(this.toolbarHeight-2*V)+`px;
padding: `+V+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new K("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new K("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new B("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new B("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new K("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new K("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new K("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new K("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*V)+`px;
padding: `+V+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new K("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},ne.instanceCounter=0,ne}(),We=U("8hTe"),Ke=U.n(We),Be=/<pre[^>]*>/g;function Ve(ne){var V=document.createElement("div");return V.innerHTML=ne,V.childNodes.length===0?"":V.childNodes[0].nodeValue}var Xe=be.a=function(ne){var V=ne.value,G=V===void 0?"":V,Z=ne.edit,re=Z===void 0?!1:Z,X=ne.className,Q=ne.showTextOnly,oe=ne.showLines,he=ne.replaces,De=ne.zoomImg,Ie=ne.hasMask,Ue=ne.style,Ye=Ue===void 0?{}:Ue,Je=ne.stylesPrev,Ze=Je===void 0?{}:Je,dt=String(G),at=Object(w.useRef)(),$e=Object(w.useRef)(),Nt=Object(w.useState)(""),bt=Object(F.a)(Nt,2),Ut=bt[0],Lt=bt[1],ot=Object(w.useState)("office"),Ft=Object(F.a)(ot,2),Jt=Ft[0],Vt=Ft[1],rn=function(){var pt=new He($e.current);pt.displayMode="popup",pt.addRenderEventListener(function(){var yt=Object(O.a)(e.a.mark(function ut(Qt){var Rt;return e.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return at.current.style.display="none",Kt.next=3,Object(ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qt}});case 3:Rt=Kt.sent,Rt!=null&&Rt.id&&he($e.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Rt==null?void 0:Rt.id,"?type=").concat(Rt.content_type));case 5:case"end":return Kt.stop()}},ut)}));return function(ut){return yt.apply(this,arguments)}}()),pt.show()},qe=function(){var pt=new pe.a($e.current);pt.settings.displayMode="popup",pt.addEventListener("render",function(){var yt=Object(O.a)(e.a.mark(function ut(Qt){var Rt;return e.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:if(at.current.style.display="none",!$e.current){Kt.next=6;break}return Kt.next=4,Object(ye.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qt.dataUrl}});case 4:Rt=Kt.sent,Rt!=null&&Rt.id&&he($e.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Rt==null?void 0:Rt.id,"?type=").concat(Rt.content_type));case 6:case"end":return Kt.stop()}},ut)}));return function(ut){return yt.apply(this,arguments)}}()),pt.show(),window.markerArea=pt},it=Object(w.useMemo)(function(){at.current&&(at.current.style.zIndex=-1);try{var Bt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,pt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;dt=dt.replace(Bt,"("+$.a.API_SERVER+"/api/attachments/").replace(pt,'"'+$.a.API_SERVER+"/api/attachments/").replace(yt,'"'+$.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(dn){}var ut=P(dt),Qt=E();if(dt.match(/\[TOC\]/)&&(ut=ut.replace("<p>[TOC]</p>",b()),v()),ut=ut.replace(/(__special_katext_id_\d+__)/g,function(dn,Kt){var gn=Qt[Kt],xn=gn.type,Sn=gn.expression;return Object(fe.renderToString)(Ve(Sn)||"",{displayMode:xn==="block",throwOnError:!1,output:"html"})}),ut=ut.replace(/▁/g,"\u2581\u2581\u2581"),y(),Q){var Rt=document.createElement("div");return Rt.innerHTML=ut,Rt.innerText}return setTimeout(function(){return $t()},500),ut},[dt]),ft=Object(w.useRef)();p.WebkitLineClamp=oe,oe&&(Ye=Object(S.a)(Object(S.a)({},Ye),p));function It(Bt){var pt=Bt.target;if(pt.tagName.toUpperCase()==="IMG"){if(De){var yt=pt.getAttribute("src");Lt(yt),Vt("image")}}else if(pt.tagName.toUpperCase()==="A"){var ut=pt.getAttribute("href");if(ut.indexOf("office")>-1)Bt.preventDefault(),Lt(ut),Vt("office");else if(ut.indexOf("application/pdf")>-1)Bt.preventDefault(),Lt(ut),Vt("pdf");else if(ut.indexOf("text/html")>-1)Bt.preventDefault(),Lt(ut),Vt("html");else if(ut.startsWith("#")){Bt.preventDefault();var Qt=document.getElementById(ut.replace("#",""));Qt&&Qt.scrollIntoView(!0)}}}var $t=function(){var pt,yt=(pt=ft.current)===null||pt===void 0?void 0:pt.querySelectorAll("video");yt==null||yt.forEach(function(ut){if(ut.oncontextmenu=function(){return!1},ut.src.indexOf(".m3u8")>-1&&!ut.canPlayType("application/vnd.apple.mpegurl")){if(z.a.isSupported()){var Qt=new z.a;Qt.loadSource(ut.src),Qt.attachMedia(ut)}}})};Object(w.useEffect)(function(){if(ft.current&&it&&(it.match(Be)&&window.PR.prettyPrint()),ft.current)return ft.current.addEventListener("click",It),function(){ft.current.removeEventListener("click",It),y(),v()}},[it,ft.current,It]);var ln=function(pt){if(!re)return;pt.target.nodeName==="IMG"?(at.current.style.zIndex=1,at.current.style.display="flex",at.current.style.width=pt.target.clientWidth+"px",at.current.style.height=pt.target.clientHeight+"px",at.current.style.top=pt.target.offsetTop+"px",at.current.style.left=pt.target.offsetLeft+"px",$e.current.src=pt.target.getAttribute("src")):at.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:ft,style:Object(S.a)({},Ye),className:"".concat(X||""," markdown-body ").concat(Ke.a.mdBody),onMouseOver:ln,dangerouslySetInnerHTML:{__html:it}}),g.a.createElement("div",{ref:at,className:Ke.a.button},g.a.createElement(W.a,null,g.a.createElement(N.a,{onClick:function(){return rn()}},"\u88C1\u526A"),g.a.createElement(N.a,{onClick:function(){return qe()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:$e,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(ee.a,{close:!0,data:Ut,type:Ut!=null&&Ut.length?Jt:"",style:Object(S.a)({},Ze),onClose:function(){return Lt("")}}))}},BU3w:function(Ge,be,U){"use strict";U.d(be,"a",function(){return O});var ue=U("MNnm"),W="rc-util-key";function R(F){if(F.attachTo)return F.attachTo;var j=document.querySelector("head");return j||document.body}function N(F){var j,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var w=document.createElement("style");if((j=e.csp)===null||j===void 0?void 0:j.nonce){var g;w.nonce=(g=e.csp)===null||g===void 0?void 0:g.nonce}w.innerHTML=F;var c=R(e),u=c.firstChild;return e.prepend&&c.prepend?c.prepend(w):e.prepend&&u?c.insertBefore(w,u):c.appendChild(w),w}var S=new Map;function O(F,j){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=R(e);if(!S.has(w)){var g=N("",e),c=g.parentNode;S.set(w,c),c.removeChild(g)}var u=Array.from(S.get(w).children).find(function(r){return r.tagName==="STYLE"&&r[W]===j});if(u){var a,i;if(((a=e.csp)===null||a===void 0?void 0:a.nonce)&&u.nonce!==((i=e.csp)===null||i===void 0?void 0:i.nonce)){var d;u.nonce=(d=e.csp)===null||d===void 0?void 0:d.nonce}return u.innerHTML!==F&&(u.innerHTML=F),u}var s=N(F,e);return s[W]=j,s}},BdwD:function(Ge,be,U){"use strict";var ue=U("+L6B"),W=U("2/Rp"),R=U("0Owb"),N=U("k1fw"),S=U("q1tI"),O=U.n(S),F=U("FOrL"),j=U.n(F),e=function(g){var c=g.buttonProps,u=c===void 0?{}:c,a=g.styles,i=a===void 0?{}:a,d=g.imgStyles,s=d===void 0?{}:d,r=g.customText,n=g.ButtonText,t=g.ButtonClick,v=g.Buttonclass,p=g.ButtonTwo;return O.a.createElement("section",{className:"tc animated fadeIn",style:Object(N.a)(Object(N.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),i)},O.a.createElement("img",{src:j.a,style:Object(N.a)(Object(N.a)({},{width:"200px",height:"150px"}),s)}),O.a.createElement("p",{className:"mt10 font14"},r||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),n&&O.a.createElement(W.a,Object(R.a)({className:v,onClick:t},u),n),p&&p)};be.a=e},"C/vA":function(Ge,be,U){"use strict";U.d(be,"a",function(){return ue});function ue(W){const R=this;let N=!1,S;return function(){return N||(N=!0,S=W.apply(R,arguments)),S}}},"Cg/j":function(Ge,be,U){"use strict";U.d(be,"b",function(){return ue}),U.d(be,"a",function(){return W}),U.d(be,"c",function(){return N}),U.d(be,"d",function(){return S});var ue;(function(O){O.serviceIds=new Map,O.DI_TARGET="$di$target",O.DI_DEPENDENCIES="$di$dependencies";function F(j){return j[O.DI_DEPENDENCIES]||[]}O.getServiceDependencies=F})(ue||(ue={}));const W=N("instantiationService");function R(O,F,j,e){F[ue.DI_TARGET]===F?F[ue.DI_DEPENDENCIES].push({id:O,index:j,optional:e}):(F[ue.DI_DEPENDENCIES]=[{id:O,index:j,optional:e}],F[ue.DI_TARGET]=F)}function N(O){if(ue.serviceIds.has(O))return ue.serviceIds.get(O);const F=function(j,e,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");R(F,j,w,!1)};return F.toString=()=>O,ue.serviceIds.set(O,F),F}function S(O){return function(F,j,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");R(O,F,e,!0)}}},DlQD:function(Ge,be,U){(function(ue,W){Ge.exports=W()})(this,function(){"use strict";function ue(G,Z){for(var re=0;re<Z.length;re++){var X=Z[re];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(G,X.key,X)}}function W(G,Z,re){return Z&&ue(G.prototype,Z),re&&ue(G,re),G}function R(G,Z){if(!G)return;if(typeof G=="string")return N(G,Z);var re=Object.prototype.toString.call(G).slice(8,-1);if(re==="Object"&&G.constructor&&(re=G.constructor.name),re==="Map"||re==="Set")return Array.from(G);if(re==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(re))return N(G,Z)}function N(G,Z){(Z==null||Z>G.length)&&(Z=G.length);for(var re=0,X=new Array(Z);re<Z;re++)X[re]=G[re];return X}function S(G,Z){var re;if(typeof Symbol=="undefined"||G[Symbol.iterator]==null){if(Array.isArray(G)||(re=R(G))||Z&&G&&typeof G.length=="number"){re&&(G=re);var X=0;return function(){return X>=G.length?{done:!0}:{done:!1,value:G[X++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return re=G[Symbol.iterator](),re.next.bind(re)}function O(G,Z){return Z={exports:{}},G(Z,Z.exports),Z.exports}var F=O(function(G){function Z(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function re(X){G.exports.defaults=X}G.exports={defaults:Z(),getDefaults:Z,changeDefaults:re}}),j=F.defaults,e=F.getDefaults,w=F.changeDefaults,g=/[&<>"']/,c=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},d=function(Z){return i[Z]};function s(G,Z){if(Z){if(g.test(G))return G.replace(c,d)}else if(u.test(G))return G.replace(a,d);return G}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(G){return G.replace(r,function(Z,re){return re=re.toLowerCase(),re==="colon"?":":re.charAt(0)==="#"?re.charAt(1)==="x"?String.fromCharCode(parseInt(re.substring(2),16)):String.fromCharCode(+re.substring(1)):""})}var t=/(^|[^\[])\^/g;function v(G,Z){G=G.source||G,Z=Z||"";var re={replace:function(Q,oe){return oe=oe.source||oe,oe=oe.replace(t,"$1"),G=G.replace(Q,oe),re},getRegex:function(){return new RegExp(G,Z)}};return re}var p=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(G,Z,re){if(G){var X;try{X=decodeURIComponent(n(re)).replace(p,"").toLowerCase()}catch(Q){return null}if(X.indexOf("javascript:")===0||X.indexOf("vbscript:")===0||X.indexOf("data:")===0)return null}Z&&!m.test(re)&&(re=h(Z,re));try{re=encodeURI(re).replace(/%25/g,"%")}catch(Q){return null}return re}var _={},o=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(G,Z){_[" "+G]||(o.test(G)?_[" "+G]=G+"/":_[" "+G]=L(G,"/",!0)),G=_[" "+G];var re=G.indexOf(":")===-1;return Z.substring(0,2)==="//"?re?Z:G.replace(f,"$1")+Z:Z.charAt(0)==="/"?re?Z:G.replace(l,"$1")+Z:G+Z}var E={exec:function(){}};function y(G){for(var Z=1,re,X;Z<arguments.length;Z++){re=arguments[Z];for(X in re)Object.prototype.hasOwnProperty.call(re,X)&&(G[X]=re[X])}return G}function T(G,Z){var re=G.replace(/\|/g,function(oe,he,De){for(var Ie=!1,Ue=he;--Ue>=0&&De[Ue]==="\\";)Ie=!Ie;return Ie?"|":" |"}),X=re.split(/ \|/),Q=0;if(X.length>Z)X.splice(Z);else for(;X.length<Z;)X.push("");for(;Q<X.length;Q++)X[Q]=X[Q].trim().replace(/\\\|/g,"|");return X}function L(G,Z,re){var X=G.length;if(X===0)return"";for(var Q=0;Q<X;){var oe=G.charAt(X-Q-1);if(oe===Z&&!re)Q++;else if(oe!==Z&&re)Q++;else break}return G.substr(0,X-Q)}function D(G,Z){if(G.indexOf(Z[1])===-1)return-1;for(var re=G.length,X=0,Q=0;Q<re;Q++)if(G[Q]==="\\")Q++;else if(G[Q]===Z[0])X++;else if(G[Q]===Z[1]&&(X--,X<0))return Q;return-1}function x(G){G&&G.sanitize&&!G.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var P={escape:s,unescape:n,edit:v,cleanUrl:b,resolveUrl:h,noopTest:E,merge:y,splitCells:T,rtrim:L,findClosingBracket:D,checkSanitizeDeprecation:x},H=F.defaults,I=P.rtrim,z=P.splitCells,$=P.escape,fe=P.findClosingBracket;function ee(G,Z,re){var X=Z.href,Q=Z.title?$(Z.title):null,oe=G[1].replace(/\\([\[\]])/g,"$1");return G[0].charAt(0)!=="!"?{type:"link",raw:re,href:X,title:Q,text:oe}:{type:"image",raw:re,href:X,title:Q,text:$(oe)}}function ye(G,Z){var re=G.match(/^(\s+)(?:```)/);if(re===null)return Z;var X=re[1];return Z.split(`
`).map(function(Q){var oe=Q.match(/^\s+/);if(oe===null)return Q;var he=oe[0];return he.length>=X.length?Q.slice(X.length):Q}).join(`
`)}var pe=function(){function G(re){this.options=re||H}var Z=G.prototype;return Z.space=function(X){var Q=this.rules.block.newline.exec(X);if(Q)return Q[0].length>1?{type:"space",raw:Q[0]}:{raw:`
`}},Z.code=function(X,Q){var oe=this.rules.block.code.exec(X);if(oe){var he=Q[Q.length-1];if(he&&he.type==="paragraph")return{raw:oe[0],text:oe[0].trimRight()};var De=oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:oe[0],codeBlockStyle:"indented",text:this.options.pedantic?De:I(De,`
`)}}},Z.fences=function(X){var Q=this.rules.block.fences.exec(X);if(Q){var oe=Q[0],he=ye(oe,Q[3]||"");return{type:"code",raw:oe,lang:Q[2]?Q[2].trim():Q[2],text:he}}},Z.heading=function(X){var Q=this.rules.block.heading.exec(X);if(Q)return{type:"heading",raw:Q[0],depth:Q[1].length,text:Q[2]}},Z.nptable=function(X){var Q=this.rules.block.nptable.exec(X);if(Q){var oe={type:"table",header:z(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
`):[],raw:Q[0]};if(oe.header.length===oe.align.length){var he=oe.align.length,De;for(De=0;De<he;De++)/^ *-+: *$/.test(oe.align[De])?oe.align[De]="right":/^ *:-+: *$/.test(oe.align[De])?oe.align[De]="center":/^ *:-+ *$/.test(oe.align[De])?oe.align[De]="left":oe.align[De]=null;for(he=oe.cells.length,De=0;De<he;De++)oe.cells[De]=z(oe.cells[De],oe.header.length);return oe}}},Z.hr=function(X){var Q=this.rules.block.hr.exec(X);if(Q)return{type:"hr",raw:Q[0]}},Z.blockquote=function(X){var Q=this.rules.block.blockquote.exec(X);if(Q){var oe=Q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Q[0],text:oe}}},Z.list=function(X){var Q=this.rules.block.list.exec(X);if(Q){for(var oe=Q[0],he=Q[2],De=he.length>1,Ie=he[he.length-1]===")",Ue={type:"list",raw:oe,ordered:De,start:De?+he.slice(0,-1):"",loose:!1,items:[]},Ye=Q[0].match(this.rules.block.item),Je=!1,Ze,dt,at,$e,Nt,bt,Ut,Lt=Ye.length,ot=0;ot<Lt;ot++)Ze=Ye[ot],oe=Ze,dt=Ze.length,Ze=Ze.replace(/^ *([*+-]|\d+[.)]) */,""),~Ze.indexOf(`
`)&&(dt-=Ze.length,Ze=this.options.pedantic?Ze.replace(/^ {1,4}/gm,""):Ze.replace(new RegExp("^ {1,"+dt+"}","gm"),"")),ot!==Lt-1&&(at=this.rules.block.bullet.exec(Ye[ot+1])[0],(De?at.length===1||!Ie&&at[at.length-1]===")":at.length>1||this.options.smartLists&&at!==he)&&($e=Ye.slice(ot+1).join(`
`),Ue.raw=Ue.raw.substring(0,Ue.raw.length-$e.length),ot=Lt-1)),Nt=Je||/\n\n(?!\s*$)/.test(Ze),ot!==Lt-1&&(Je=Ze.charAt(Ze.length-1)===`
`,Nt||(Nt=Je)),Nt&&(Ue.loose=!0),bt=/^\[[ xX]\] /.test(Ze),Ut=void 0,bt&&(Ut=Ze[1]!==" ",Ze=Ze.replace(/^\[[ xX]\] +/,"")),Ue.items.push({type:"list_item",raw:oe,task:bt,checked:Ut,loose:Nt,text:Ze});return Ue}},Z.html=function(X){var Q=this.rules.block.html.exec(X);if(Q)return{type:this.options.sanitize?"paragraph":"html",raw:Q[0],pre:!this.options.sanitizer&&(Q[1]==="pre"||Q[1]==="script"||Q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):$(Q[0]):Q[0]}},Z.def=function(X){var Q=this.rules.block.def.exec(X);if(Q){Q[3]&&(Q[3]=Q[3].substring(1,Q[3].length-1));var oe=Q[1].toLowerCase().replace(/\s+/g," ");return{tag:oe,raw:Q[0],href:Q[2],title:Q[3]}}},Z.table=function(X){var Q=this.rules.block.table.exec(X);if(Q){var oe={type:"table",header:z(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
`):[]};if(oe.header.length===oe.align.length){oe.raw=Q[0];var he=oe.align.length,De;for(De=0;De<he;De++)/^ *-+: *$/.test(oe.align[De])?oe.align[De]="right":/^ *:-+: *$/.test(oe.align[De])?oe.align[De]="center":/^ *:-+ *$/.test(oe.align[De])?oe.align[De]="left":oe.align[De]=null;for(he=oe.cells.length,De=0;De<he;De++)oe.cells[De]=z(oe.cells[De].replace(/^ *\| *| *\| *$/g,""),oe.header.length);return oe}}},Z.lheading=function(X){var Q=this.rules.block.lheading.exec(X);if(Q)return{type:"heading",raw:Q[0],depth:Q[2].charAt(0)==="="?1:2,text:Q[1]}},Z.paragraph=function(X){var Q=this.rules.block.paragraph.exec(X);if(Q)return{type:"paragraph",raw:Q[0],text:Q[1].charAt(Q[1].length-1)===`
`?Q[1].slice(0,-1):Q[1]}},Z.text=function(X,Q){var oe=this.rules.block.text.exec(X);if(oe){var he=Q[Q.length-1];return he&&he.type==="text"?{raw:oe[0],text:oe[0]}:{type:"text",raw:oe[0],text:oe[0]}}},Z.escape=function(X){var Q=this.rules.inline.escape.exec(X);if(Q)return{type:"escape",raw:Q[0],text:$(Q[1])}},Z.tag=function(X,Q,oe){var he=this.rules.inline.tag.exec(X);if(he)return!Q&&/^<a /i.test(he[0])?Q=!0:Q&&/^<\/a>/i.test(he[0])&&(Q=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(he[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(he[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:he[0],inLink:Q,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):$(he[0]):he[0]}},Z.link=function(X){var Q=this.rules.inline.link.exec(X);if(Q){var oe=fe(Q[2],"()");if(oe>-1){var he=Q[0].indexOf("!")===0?5:4,De=he+Q[1].length+oe;Q[2]=Q[2].substring(0,oe),Q[0]=Q[0].substring(0,De).trim(),Q[3]=""}var Ie=Q[2],Ue="";if(this.options.pedantic){var Ye=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ie);Ye?(Ie=Ye[1],Ue=Ye[3]):Ue=""}else Ue=Q[3]?Q[3].slice(1,-1):"";Ie=Ie.trim().replace(/^<([\s\S]*)>$/,"$1");var Je=ee(Q,{href:Ie&&Ie.replace(this.rules.inline._escapes,"$1"),title:Ue&&Ue.replace(this.rules.inline._escapes,"$1")},Q[0]);return Je}},Z.reflink=function(X,Q){var oe;if((oe=this.rules.inline.reflink.exec(X))||(oe=this.rules.inline.nolink.exec(X))){var he=(oe[2]||oe[1]).replace(/\s+/g," ");if(he=Q[he.toLowerCase()],!he||!he.href){var De=oe[0].charAt(0);return{type:"text",raw:De,text:De}}var Ie=ee(oe,he,oe[0]);return Ie}},Z.strong=function(X,Q,oe){oe===void 0&&(oe="");var he=this.rules.inline.strong.start.exec(X);if(he&&(!he[1]||he[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){Q=Q.slice(-1*X.length);var De=he[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;De.lastIndex=0;for(var Ie;(he=De.exec(Q))!=null;)if(Ie=this.rules.inline.strong.middle.exec(Q.slice(0,he.index+3)),Ie)return{type:"strong",raw:X.slice(0,Ie[0].length),text:X.slice(2,Ie[0].length-2)}}},Z.em=function(X,Q,oe){oe===void 0&&(oe="");var he=this.rules.inline.em.start.exec(X);if(he&&(!he[1]||he[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){Q=Q.slice(-1*X.length);var De=he[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;De.lastIndex=0;for(var Ie;(he=De.exec(Q))!=null;)if(Ie=this.rules.inline.em.middle.exec(Q.slice(0,he.index+2)),Ie)return{type:"em",raw:X.slice(0,Ie[0].length),text:X.slice(1,Ie[0].length-1)}}},Z.codespan=function(X){var Q=this.rules.inline.code.exec(X);if(Q){var oe=Q[2].replace(/\n/g," "),he=/[^ ]/.test(oe),De=oe.startsWith(" ")&&oe.endsWith(" ");return he&&De&&(oe=oe.substring(1,oe.length-1)),oe=$(oe,!0),{type:"codespan",raw:Q[0],text:oe}}},Z.br=function(X){var Q=this.rules.inline.br.exec(X);if(Q)return{type:"br",raw:Q[0]}},Z.del=function(X){var Q=this.rules.inline.del.exec(X);if(Q)return{type:"del",raw:Q[0],text:Q[1]}},Z.autolink=function(X,Q){var oe=this.rules.inline.autolink.exec(X);if(oe){var he,De;return oe[2]==="@"?(he=$(this.options.mangle?Q(oe[1]):oe[1]),De="mailto:"+he):(he=$(oe[1]),De=he),{type:"link",raw:oe[0],text:he,href:De,tokens:[{type:"text",raw:he,text:he}]}}},Z.url=function(X,Q){var oe;if(oe=this.rules.inline.url.exec(X)){var he,De;if(oe[2]==="@")he=$(this.options.mangle?Q(oe[0]):oe[0]),De="mailto:"+he;else{var Ie;do Ie=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Ie!==oe[0]);he=$(oe[0]),oe[1]==="www."?De="http://"+he:De=he}return{type:"link",raw:oe[0],text:he,href:De,tokens:[{type:"text",raw:he,text:he}]}}},Z.inlineText=function(X,Q,oe){var he=this.rules.inline.text.exec(X);if(he){var De;return Q?De=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):$(he[0]):he[0]:De=$(this.options.smartypants?oe(he[0]):he[0]),{type:"text",raw:he[0],text:De}}},G}(),ae=P.noopTest,se=P.edit,_e=P.merge,te={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ae,table:ae,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};te._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,te.def=se(te.def).replace("label",te._label).replace("title",te._title).getRegex(),te.bullet=/(?:[*+-]|\d{1,9}[.)])/,te.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,te.item=se(te.item,"gm").replace(/bull/g,te.bullet).getRegex(),te.list=se(te.list).replace(/bull/g,te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+te.def.source+")").getRegex(),te._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",te._comment=/<!--(?!-?>)[\s\S]*?-->/,te.html=se(te.html,"i").replace("comment",te._comment).replace("tag",te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),te.paragraph=se(te._paragraph).replace("hr",te.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",te._tag).getRegex(),te.blockquote=se(te.blockquote).replace("paragraph",te.paragraph).getRegex(),te.normal=_e({},te),te.gfm=_e({},te.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),te.gfm.nptable=se(te.gfm.nptable).replace("hr",te.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",te._tag).getRegex(),te.gfm.table=se(te.gfm.table).replace("hr",te.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",te._tag).getRegex(),te.pedantic=_e({},te.normal,{html:se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",te._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ae,paragraph:se(te.normal._paragraph).replace("hr",te.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var k={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ae,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ae,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};k._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",k.punctuation=se(k.punctuation).replace(/punctuation/g,k._punctuation).getRegex(),k._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",k._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",k.em.start=se(k.em.start).replace(/punctuation/g,k._punctuation).getRegex(),k.em.middle=se(k.em.middle).replace(/punctuation/g,k._punctuation).replace(/overlapSkip/g,k._overlapSkip).getRegex(),k.em.endAst=se(k.em.endAst,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.em.endUnd=se(k.em.endUnd,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.strong.start=se(k.strong.start).replace(/punctuation/g,k._punctuation).getRegex(),k.strong.middle=se(k.strong.middle).replace(/punctuation/g,k._punctuation).replace(/blockSkip/g,k._blockSkip).getRegex(),k.strong.endAst=se(k.strong.endAst,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.strong.endUnd=se(k.strong.endUnd,"g").replace(/punctuation/g,k._punctuation).getRegex(),k.blockSkip=se(k._blockSkip,"g").getRegex(),k.overlapSkip=se(k._overlapSkip,"g").getRegex(),k._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,k._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,k._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,k.autolink=se(k.autolink).replace("scheme",k._scheme).replace("email",k._email).getRegex(),k._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,k.tag=se(k.tag).replace("comment",te._comment).replace("attribute",k._attribute).getRegex(),k._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,k._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,k._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,k.link=se(k.link).replace("label",k._label).replace("href",k._href).replace("title",k._title).getRegex(),k.reflink=se(k.reflink).replace("label",k._label).getRegex(),k.reflinkSearch=se(k.reflinkSearch,"g").replace("reflink",k.reflink).replace("nolink",k.nolink).getRegex(),k.normal=_e({},k),k.pedantic=_e({},k.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:se(/^!?\[(label)\]\((.*?)\)/).replace("label",k._label).getRegex(),reflink:se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",k._label).getRegex()}),k.gfm=_e({},k.normal,{escape:se(k.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),k.gfm.url=se(k.gfm.url,"i").replace("email",k.gfm._extended_email).getRegex(),k.breaks=_e({},k.gfm,{br:se(k.br).replace("{2,}","*").getRegex(),text:se(k.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var A={block:te,inline:k},C=F.defaults,B=A.block,K=A.inline;function M(G){return G.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ie(G){var Z="",re,X,Q=G.length;for(re=0;re<Q;re++)X=G.charCodeAt(re),Math.random()>.5&&(X="x"+X.toString(16)),Z+="&#"+X+";";return Z}var Ee=function(){function G(re){this.tokens=[],this.tokens.links=Object.create(null),this.options=re||C,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var X={block:B.normal,inline:K.normal};this.options.pedantic?(X.block=B.pedantic,X.inline=K.pedantic):this.options.gfm&&(X.block=B.gfm,this.options.breaks?X.inline=K.breaks:X.inline=K.gfm),this.tokenizer.rules=X}G.lex=function(X,Q){var oe=new G(Q);return oe.lex(X)};var Z=G.prototype;return Z.lex=function(X){return X=X.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(X,this.tokens,!0),this.inline(this.tokens),this.tokens},Z.blockTokens=function(X,Q,oe){Q===void 0&&(Q=[]),oe===void 0&&(oe=!0),X=X.replace(/^ +$/gm,"");for(var he,De,Ie,Ue;X;){if(he=this.tokenizer.space(X)){X=X.substring(he.raw.length),he.type&&Q.push(he);continue}if(he=this.tokenizer.code(X,Q)){X=X.substring(he.raw.length),he.type?Q.push(he):(Ue=Q[Q.length-1],Ue.raw+=`
`+he.raw,Ue.text+=`
`+he.text);continue}if(he=this.tokenizer.fences(X)){X=X.substring(he.raw.length),Q.push(he);continue}if(he=this.tokenizer.heading(X)){X=X.substring(he.raw.length),Q.push(he);continue}if(he=this.tokenizer.nptable(X)){X=X.substring(he.raw.length),Q.push(he);continue}if(he=this.tokenizer.hr(X)){X=X.substring(he.raw.length),Q.push(he);continue}if(he=this.tokenizer.blockquote(X)){X=X.substring(he.raw.length),he.tokens=this.blockTokens(he.text,[],oe),Q.push(he);continue}if(he=this.tokenizer.list(X)){for(X=X.substring(he.raw.length),Ie=he.items.length,De=0;De<Ie;De++)he.items[De].tokens=this.blockTokens(he.items[De].text,[],!1);Q.push(he);continue}if(he=this.tokenizer.html(X)){X=X.substring(he.raw.length),Q.push(he);continue}if(oe&&(he=this.tokenizer.def(X))){X=X.substring(he.raw.length),this.tokens.links[he.tag]||(this.tokens.links[he.tag]={href:he.href,title:he.title});continue}if(he=this.tokenizer.table(X)){X=X.substring(he.raw.length),Q.push(he);continue}if(he=this.tokenizer.lheading(X)){X=X.substring(he.raw.length),Q.push(he);continue}if(oe&&(he=this.tokenizer.paragraph(X))){X=X.substring(he.raw.length),Q.push(he);continue}if(he=this.tokenizer.text(X,Q)){X=X.substring(he.raw.length),he.type?Q.push(he):(Ue=Q[Q.length-1],Ue.raw+=`
`+he.raw,Ue.text+=`
`+he.text);continue}if(X){var Ye="Infinite loop on byte: "+X.charCodeAt(0);if(this.options.silent){console.error(Ye);break}else throw new Error(Ye)}}return Q},Z.inline=function(X){var Q,oe,he,De,Ie,Ue,Ye=X.length;for(Q=0;Q<Ye;Q++){Ue=X[Q];switch(Ue.type){case"paragraph":case"text":case"heading":{Ue.tokens=[],this.inlineTokens(Ue.text,Ue.tokens);break}case"table":{for(Ue.tokens={header:[],cells:[]},De=Ue.header.length,oe=0;oe<De;oe++)Ue.tokens.header[oe]=[],this.inlineTokens(Ue.header[oe],Ue.tokens.header[oe]);for(De=Ue.cells.length,oe=0;oe<De;oe++)for(Ie=Ue.cells[oe],Ue.tokens.cells[oe]=[],he=0;he<Ie.length;he++)Ue.tokens.cells[oe][he]=[],this.inlineTokens(Ie[he],Ue.tokens.cells[oe][he]);break}case"blockquote":{this.inline(Ue.tokens);break}case"list":{for(De=Ue.items.length,oe=0;oe<De;oe++)this.inline(Ue.items[oe].tokens);break}}}return X},Z.inlineTokens=function(X,Q,oe,he,De){Q===void 0&&(Q=[]),oe===void 0&&(oe=!1),he===void 0&&(he=!1),De===void 0&&(De="");var Ie,Ue=X,Ye;if(this.tokens.links){var Je=Object.keys(this.tokens.links);if(Je.length>0)for(;(Ye=this.tokenizer.rules.inline.reflinkSearch.exec(Ue))!=null;)Je.includes(Ye[0].slice(Ye[0].lastIndexOf("[")+1,-1))&&(Ue=Ue.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ye=this.tokenizer.rules.inline.blockSkip.exec(Ue))!=null;)Ue=Ue.slice(0,Ye.index)+"["+"a".repeat(Ye[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;X;){if(Ie=this.tokenizer.escape(X)){X=X.substring(Ie.raw.length),Q.push(Ie);continue}if(Ie=this.tokenizer.tag(X,oe,he)){X=X.substring(Ie.raw.length),oe=Ie.inLink,he=Ie.inRawBlock,Q.push(Ie);continue}if(Ie=this.tokenizer.link(X)){X=X.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,he)),Q.push(Ie);continue}if(Ie=this.tokenizer.reflink(X,this.tokens.links)){X=X.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,he)),Q.push(Ie);continue}if(Ie=this.tokenizer.strong(X,Ue,De)){X=X.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],oe,he),Q.push(Ie);continue}if(Ie=this.tokenizer.em(X,Ue,De)){X=X.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],oe,he),Q.push(Ie);continue}if(Ie=this.tokenizer.codespan(X)){X=X.substring(Ie.raw.length),Q.push(Ie);continue}if(Ie=this.tokenizer.br(X)){X=X.substring(Ie.raw.length),Q.push(Ie);continue}if(Ie=this.tokenizer.del(X)){X=X.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],oe,he),Q.push(Ie);continue}if(Ie=this.tokenizer.autolink(X,ie)){X=X.substring(Ie.raw.length),Q.push(Ie);continue}if(!oe&&(Ie=this.tokenizer.url(X,ie))){X=X.substring(Ie.raw.length),Q.push(Ie);continue}if(Ie=this.tokenizer.inlineText(X,he,M)){X=X.substring(Ie.raw.length),De=Ie.raw.slice(-1),Q.push(Ie);continue}if(X){var Ze="Infinite loop on byte: "+X.charCodeAt(0);if(this.options.silent){console.error(Ze);break}else throw new Error(Ze)}}return Q},W(G,null,[{key:"rules",get:function(){return{block:B,inline:K}}}]),G}(),Oe=F.defaults,q=P.cleanUrl,de=P.escape,Te=function(){function G(re){this.options=re||Oe}var Z=G.prototype;return Z.code=function(X,Q,oe){var he=(Q||"").match(/\S*/)[0];if(this.options.highlight){var De=this.options.highlight(X,he);De!=null&&De!==X&&(oe=!0,X=De)}return he?'<pre><code class="'+this.options.langPrefix+de(he,!0)+'">'+(oe?X:de(X,!0))+`</code></pre>
`:"<pre><code>"+(oe?X:de(X,!0))+`</code></pre>
`},Z.blockquote=function(X){return`<blockquote>
`+X+`</blockquote>
`},Z.html=function(X){return X},Z.heading=function(X,Q,oe,he){return this.options.headerIds?"<h"+Q+' id="'+this.options.headerPrefix+he.slug(oe)+'">'+X+"</h"+Q+`>
`:"<h"+Q+">"+X+"</h"+Q+`>
`},Z.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Z.list=function(X,Q,oe){var he=Q?"ol":"ul",De=Q&&oe!==1?' start="'+oe+'"':"";return"<"+he+De+`>
`+X+"</"+he+`>
`},Z.listitem=function(X){return"<li>"+X+`</li>
`},Z.checkbox=function(X){return"<input "+(X?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Z.paragraph=function(X){return"<p>"+X+`</p>
`},Z.table=function(X,Q){return Q&&(Q="<tbody>"+Q+"</tbody>"),`<table>
<thead>
`+X+`</thead>
`+Q+`</table>
`},Z.tablerow=function(X){return`<tr>
`+X+`</tr>
`},Z.tablecell=function(X,Q){var oe=Q.header?"th":"td",he=Q.align?"<"+oe+' align="'+Q.align+'">':"<"+oe+">";return he+X+"</"+oe+`>
`},Z.strong=function(X){return"<strong>"+X+"</strong>"},Z.em=function(X){return"<em>"+X+"</em>"},Z.codespan=function(X){return"<code>"+X+"</code>"},Z.br=function(){return this.options.xhtml?"<br/>":"<br>"},Z.del=function(X){return"<del>"+X+"</del>"},Z.link=function(X,Q,oe){if(X=q(this.options.sanitize,this.options.baseUrl,X),X===null)return oe;var he='<a href="'+de(X)+'"';return Q&&(he+=' title="'+Q+'"'),he+=">"+oe+"</a>",he},Z.image=function(X,Q,oe){if(X=q(this.options.sanitize,this.options.baseUrl,X),X===null)return oe;var he='<img src="'+X+'" alt="'+oe+'"';return Q&&(he+=' title="'+Q+'"'),he+=this.options.xhtml?"/>":">",he},Z.text=function(X){return X},G}(),xe=function(){function G(){}var Z=G.prototype;return Z.strong=function(X){return X},Z.em=function(X){return X},Z.codespan=function(X){return X},Z.del=function(X){return X},Z.html=function(X){return X},Z.text=function(X){return X},Z.link=function(X,Q,oe){return""+oe},Z.image=function(X,Q,oe){return""+oe},Z.br=function(){return""},G}(),Pe=function(){function G(){this.seen={}}var Z=G.prototype;return Z.slug=function(X){var Q=X.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Q)){var oe=Q;do this.seen[oe]++,Q=oe+"-"+this.seen[oe];while(this.seen.hasOwnProperty(Q))}return this.seen[Q]=0,Q},G}(),Ne=F.defaults,Re=P.unescape,Me=function(){function G(re){this.options=re||Ne,this.options.renderer=this.options.renderer||new Te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new xe,this.slugger=new Pe}G.parse=function(X,Q){var oe=new G(Q);return oe.parse(X)};var Z=G.prototype;return Z.parse=function(X,Q){Q===void 0&&(Q=!0);var oe="",he,De,Ie,Ue,Ye,Je,Ze,dt,at,$e,Nt,bt,Ut,Lt,ot,Ft,Jt,Vt,rn=X.length;for(he=0;he<rn;he++){$e=X[he];switch($e.type){case"space":continue;case"hr":{oe+=this.renderer.hr();continue}case"heading":{oe+=this.renderer.heading(this.parseInline($e.tokens),$e.depth,Re(this.parseInline($e.tokens,this.textRenderer)),this.slugger);continue}case"code":{oe+=this.renderer.code($e.text,$e.lang,$e.escaped);continue}case"table":{for(dt="",Ze="",Ue=$e.header.length,De=0;De<Ue;De++)Ze+=this.renderer.tablecell(this.parseInline($e.tokens.header[De]),{header:!0,align:$e.align[De]});for(dt+=this.renderer.tablerow(Ze),at="",Ue=$e.cells.length,De=0;De<Ue;De++){for(Je=$e.tokens.cells[De],Ze="",Ye=Je.length,Ie=0;Ie<Ye;Ie++)Ze+=this.renderer.tablecell(this.parseInline(Je[Ie]),{header:!1,align:$e.align[Ie]});at+=this.renderer.tablerow(Ze)}oe+=this.renderer.table(dt,at);continue}case"blockquote":{at=this.parse($e.tokens),oe+=this.renderer.blockquote(at);continue}case"list":{for(Nt=$e.ordered,bt=$e.start,Ut=$e.loose,Ue=$e.items.length,at="",De=0;De<Ue;De++)ot=$e.items[De],Ft=ot.checked,Jt=ot.task,Lt="",ot.task&&(Vt=this.renderer.checkbox(Ft),Ut?ot.tokens.length>0&&ot.tokens[0].type==="text"?(ot.tokens[0].text=Vt+" "+ot.tokens[0].text,ot.tokens[0].tokens&&ot.tokens[0].tokens.length>0&&ot.tokens[0].tokens[0].type==="text"&&(ot.tokens[0].tokens[0].text=Vt+" "+ot.tokens[0].tokens[0].text)):ot.tokens.unshift({type:"text",text:Vt}):Lt+=Vt),Lt+=this.parse(ot.tokens,Ut),at+=this.renderer.listitem(Lt,Jt,Ft);oe+=this.renderer.list(at,Nt,bt);continue}case"html":{oe+=this.renderer.html($e.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline($e.tokens));continue}case"text":{for(at=$e.tokens?this.parseInline($e.tokens):$e.text;he+1<rn&&X[he+1].type==="text";)$e=X[++he],at+=`
`+($e.tokens?this.parseInline($e.tokens):$e.text);oe+=Q?this.renderer.paragraph(at):at;continue}default:{var qe='Token with "'+$e.type+'" type was not found.';if(this.options.silent){console.error(qe);return}else throw new Error(qe)}}}return oe},Z.parseInline=function(X,Q){Q=Q||this.renderer;var oe="",he,De,Ie=X.length;for(he=0;he<Ie;he++){De=X[he];switch(De.type){case"escape":{oe+=Q.text(De.text);break}case"html":{oe+=Q.html(De.text);break}case"link":{oe+=Q.link(De.href,De.title,this.parseInline(De.tokens,Q));break}case"image":{oe+=Q.image(De.href,De.title,De.text);break}case"strong":{oe+=Q.strong(this.parseInline(De.tokens,Q));break}case"em":{oe+=Q.em(this.parseInline(De.tokens,Q));break}case"codespan":{oe+=Q.codespan(De.text);break}case"br":{oe+=Q.br();break}case"del":{oe+=Q.del(this.parseInline(De.tokens,Q));break}case"text":{oe+=Q.text(De.text);break}default:{var Ue='Token with "'+De.type+'" type was not found.';if(this.options.silent){console.error(Ue);return}else throw new Error(Ue)}}}return oe},G}(),He=P.merge,We=P.checkSanitizeDeprecation,Ke=P.escape,Be=F.getDefaults,Ve=F.changeDefaults,Xe=F.defaults;function ne(G,Z,re){if(typeof G=="undefined"||G===null)throw new Error("marked(): input parameter is undefined or null");if(typeof G!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(G)+", string expected");if(typeof Z=="function"&&(re=Z,Z=null),Z=He({},ne.defaults,Z||{}),We(Z),re){var X=Z.highlight,Q;try{Q=Ee.lex(G,Z)}catch(Ie){return re(Ie)}var oe=function(Ue){var Ye;if(!Ue)try{Ye=Me.parse(Q,Z)}catch(Je){Ue=Je}return Z.highlight=X,Ue?re(Ue):re(null,Ye)};if(!X||X.length<3)return oe();if(delete Z.highlight,!Q.length)return oe();var he=0;ne.walkTokens(Q,function(Ie){Ie.type==="code"&&(he++,setTimeout(function(){X(Ie.text,Ie.lang,function(Ue,Ye){if(Ue)return oe(Ue);Ye!=null&&Ye!==Ie.text&&(Ie.text=Ye,Ie.escaped=!0),he--,he===0&&oe()})},0))}),he===0&&oe();return}try{var De=Ee.lex(G,Z);return Z.walkTokens&&ne.walkTokens(De,Z.walkTokens),Me.parse(De,Z)}catch(Ie){if(Ie.message+=`
Please report this to https://github.com/markedjs/marked.`,Z.silent)return"<p>An error occurred:</p><pre>"+Ke(Ie.message+"",!0)+"</pre>";throw Ie}}ne.options=ne.setOptions=function(G){return He(ne.defaults,G),Ve(ne.defaults),ne},ne.getDefaults=Be,ne.defaults=Xe,ne.use=function(G){var Z=He({},G);if(G.renderer&&function(){var X=ne.defaults.renderer||new Te,Q=function(De){var Ie=X[De];X[De]=function(){for(var Ue=arguments.length,Ye=new Array(Ue),Je=0;Je<Ue;Je++)Ye[Je]=arguments[Je];var Ze=G.renderer[De].apply(X,Ye);return Ze===!1&&(Ze=Ie.apply(X,Ye)),Ze}};for(var oe in G.renderer)Q(oe);Z.renderer=X}(),G.tokenizer&&function(){var X=ne.defaults.tokenizer||new pe,Q=function(De){var Ie=X[De];X[De]=function(){for(var Ue=arguments.length,Ye=new Array(Ue),Je=0;Je<Ue;Je++)Ye[Je]=arguments[Je];var Ze=G.tokenizer[De].apply(X,Ye);return Ze===!1&&(Ze=Ie.apply(X,Ye)),Ze}};for(var oe in G.tokenizer)Q(oe);Z.tokenizer=X}(),G.walkTokens){var re=ne.defaults.walkTokens;Z.walkTokens=function(X){G.walkTokens(X),re&&re(X)}}ne.setOptions(Z)},ne.walkTokens=function(G,Z){for(var re=S(G),X;!(X=re()).done;){var Q=X.value;Z(Q);switch(Q.type){case"table":{for(var oe=S(Q.tokens.header),he;!(he=oe()).done;){var De=he.value;ne.walkTokens(De,Z)}for(var Ie=S(Q.tokens.cells),Ue;!(Ue=Ie()).done;)for(var Ye=Ue.value,Je=S(Ye),Ze;!(Ze=Je()).done;){var dt=Ze.value;ne.walkTokens(dt,Z)}break}case"list":{ne.walkTokens(Q.items,Z);break}default:Q.tokens&&ne.walkTokens(Q.tokens,Z)}}},ne.Parser=Me,ne.parser=Me.parse,ne.Renderer=Te,ne.TextRenderer=xe,ne.Lexer=Ee,ne.lexer=Ee.lex,ne.Tokenizer=pe,ne.Slugger=Pe,ne.parse=ne;var V=ne;return V})},EJTS:function(Ge,be,U){"use strict";U.d(be,"a",function(){return p});var ue=U("qVdP"),W=U("jsC+"),R=U("lUTK"),N=U("BvKs"),S=U("sRBo"),O=U("kaz8"),F=U("oBTY"),j=U("7Kak"),e=U("9yH6"),w=U("tJVT"),g=U("q1tI"),c=U.n(g),u=U("9Bee"),a=U("+vTd"),i=U.n(a),d=U("xKgJ"),s=U("Is5a"),r=U.n(s),n=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],v=function(b){var _,o=b.data,f=b.selectIds,l=b.onSelectCheckBox,h=l===void 0?function(){}:l,E=b.showCheckbox,y=E===void 0?!0:E,T=Object(g.useState)(!1),L=Object(w.a)(T,2),D=L[0],x=L[1],P=function(){if(o.item_type==="JUDGMENT")return c.a.createElement("div",{className:i.a.judgmentContent},o.choices.map(function(ye,pe){return c.a.createElement(e.a,{key:pe,disabled:!0},ye.choice_text)}));if(o.item_type==="PROGRAM"){var fe;return c.a.createElement("div",{className:i.a.programContent},c.a.createElement(u.a,{value:(fe=o.program_attr)===null||fe===void 0?void 0:fe.description}))}if(o.item_type==="COMBINATION"){var ee;return c.a.createElement("div",{className:i.a.combinationContent},o==null||((ee=o.sub_item_banks)===null||ee===void 0)?void 0:ee.map(function(ye,pe){var ae,se="(\u9898\u76EE".concat(pe+1,"-\u5355\u9009\u9898) ");return c.a.createElement(g.Fragment,null,c.a.createElement("div",{style:{marginTop:10,marginBottom:10}},c.a.createElement(u.a,{value:se+ye.name})),ye.choices.map(function(_e,te){return c.a.createElement("div",{key:te,className:i.a.otherContentItem},c.a.createElement("p",null,n[te]),c.a.createElement(u.a,{className:i.a.otehrContentHtml,value:_e.choice_text}))}),c.a.createElement("div",{className:i.a.con},c.a.createElement("b",{className:"c-grey-333 font14"}," ","\u7B54\u6848\uFF1A",t==null?void 0:t[ye==null||((ae=ye.choices)===null||ae===void 0)?void 0:ae.findIndex(function(_e){return _e==null?void 0:_e.is_answer})]," "),c.a.createElement("div",null,c.a.createElement("span",null,"\u89E3\u6790\uFF1A"),c.a.createElement(u.a,{className:i.a.parseAnswerHtml,value:ye.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return c.a.createElement("div",{className:i.a.otherContent},o.choices.map(function(ye,pe){return c.a.createElement("div",{key:pe,className:i.a.otherContentItem},c.a.createElement("p",null,n[pe]),c.a.createElement(u.a,{className:i.a.otehrContentHtml,value:ye.choice_text}))}))},H=function(){var fe;return c.a.createElement("div",null,(fe=o.standard_answer)===null||fe===void 0?void 0:fe.map(function(ee,ye){return c.a.createElement(u.a,{key:ye,className:i.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(ee.position,"\uFF09\uFF1A").concat(ee.answer_text.join("\u3001"))})}))},I=function(){var fe,ee,ye,pe={SUBJECTIVE:(fe=o.answer_texts)===null||fe===void 0?void 0:fe[0],JUDGMENT:(ee=o.choices)===null||ee===void 0||((ye=ee.find(function(C){return C.is_answer}))===null||ye===void 0)?void 0:ye.choice_text},ae=o.choices.map(function(C){return C.is_answer}).findIndex(function(C){return C}),se=ae>-1?t[ae]:"",_e="";o.choices.map(function(C,B){C.is_answer&&(_e+=t[B])});var te=pe[o.item_type],k={SINGLE:c.a.createElement(u.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(se||"\u65E0")}),MULTIPLE:c.a.createElement(u.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(_e||"\u65E0")}),COMPLETION:H()},A=c.a.createElement(u.a,{className:i.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(te||"\u65E0")});return k[o.item_type]||A},z=function(fe){var ee=Object(F.a)(f);fe.target.checked?ee.push(o.id):ee=ee.filter(function(ye){return ye!==o.id}),h(ee)};return c.a.createElement("div",{className:i.a.itemWrap},c.a.createElement("div",{className:i.a.list},y&&c.a.createElement(O.a,{className:"mr10",onChange:z,checked:f.includes(o.id)}),c.a.createElement("div",{className:i.a.title},c.a.createElement(u.a,{key:1,showLines:1,showTextOnly:!0,className:i.a.topicTitleContent,value:o.name})),c.a.createElement("div",{className:i.a.line},c.a.createElement("b",{className:i.a.b1}),c.a.createElement("b",{className:i.a.b2})),c.a.createElement("div",{onClick:function(){return x(!D)},className:i.a.tr},D?"\u6536\u8D77":"\u5C55\u5F00",c.a.createElement("i",{style:{transform:D?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),c.a.createElement("aside",{style:D?{display:"block"}:{display:"none"},className:i.a.itemDetail},c.a.createElement("div",{style:{marginBottom:44}},c.a.createElement(u.a,{key:2,className:i.a.topicTitleContent,value:o.name}),c.a.createElement("div",{className:"".concat(i.a.row," mt15")},P()),c.a.createElement("div",{className:i.a.row},c.a.createElement("div",{className:i.a.updateTimeRow},c.a.createElement("div",{className:i.a.updateTimeWrap},o.item_type==="PROGRAM"&&c.a.createElement("p",{className:i.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(_=o.program_attr)===null||_===void 0?void 0:_.language))))),o.item_type!=="PROGRAM"&&o.item_type!=="COMBINATION"&&c.a.createElement("div",{className:i.a.answerWrapper},c.a.createElement("img",{src:r.a,alt:"",className:i.a.decoration}),c.a.createElement("div",{className:i.a.answer},I()),c.a.createElement("div",{className:i.a.parse},c.a.createElement("div",{className:i.a.parseText},"\u89E3\u6790\uFF1A"),c.a.createElement("div",{className:i.a.parseAnswer},o.analysis?c.a.createElement(u.a,{className:i.a.parseAnswerHtml,value:o.analysis}):"\u6682\u65E0\u89E3\u6790")))))},p=function(b){var _,o,f,l,h,E,y,T,L,D,x,P,H,I,z,$,fe=b.isProblemset,ee=b.data,ye=b.user,pe=b.activeTabsKey,ae=b.onPublicReview,se=ae===void 0?function(){}:ae,_e=b.onStartExperience,te=_e===void 0?function(){}:_e,k=b.onSetPrivate,A=k===void 0?function(){}:k,C=b.onCorrection,B=C===void 0?function(){}:C,K=b.onCollect,M=K===void 0?function(){}:K,ie=b.onSetPublic,Ee=ie===void 0?function(){}:ie,Oe=b.onDelete,q=Oe===void 0?function(){}:Oe,de=b.onCancel,Te=de===void 0?function(){}:de,xe=b.onSelect,Pe=xe===void 0?function(){}:xe,Ne=b.onMoveTo,Re=Ne===void 0?function(){}:Ne,Me=b.onSetShare,He=Me===void 0?function(){}:Me,We=b.onCancelShare,Ke=We===void 0?function(){}:We,Be=b.onPublish,Ve=Be===void 0?function(){}:Be,Xe=b.onCancelPublish,ne=Xe===void 0?function(){}:Xe,V=ee.item_type==="PROGRAM"?"/problems/".concat((_=ee.program_attr)===null||_===void 0?void 0:_.identifier,"/edit"):"/problemset/edit/".concat(ee.id),G=pe==="0"&&!ee.public&&!ee.apply&&(ee.item_type==="PROGRAM"&&((o=ee.program_attr)===null||o===void 0?void 0:o.status)!==0||ee.item_type!=="PROGRAM"),Z=c.a.createElement(N.a,{forceSubMenuRender:!0,className:i.a.menu},pe==="0"&&!ee.public&&c.a.createElement(N.a.Item,{key:"-1"},c.a.createElement("a",{className:i.a.actionLink,target:"_blank",href:V},"\u7F16\u8F91")),(pe==="0"||pe==="3")&&ee.item_type==="PROGRAM"&&((f=ee.program_attr)===null||f===void 0?void 0:f.status)!==0&&!ee.public&&((l=ee.author)===null||l===void 0?void 0:l.login)===((h=ye.userInfo)===null||h===void 0?void 0:h.login)&&c.a.createElement(N.a.Item,{key:"0"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){var oe;return ne(ee==null||((oe=ee.program_attr)===null||oe===void 0)?void 0:oe.identifier)}},"\u64A4\u9500\u53D1\u5E03")),pe==="0"&&c.a.createElement(N.a.Item,{key:"1"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Re(ee.id)}},"\u79FB\u52A8\u5230")),pe==="0"&&!(ee!=null&&ee.is_share)&&c.a.createElement(N.a.Item,{key:"3"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return He(ee.id)}},"\u5171\u4EAB")),(pe==="0"&&(ee==null?void 0:ee.is_share)||pe==="3"&&((E=ee.author)===null||E===void 0?void 0:E.login)===((y=ye.userInfo)===null||y===void 0?void 0:y.login))&&c.a.createElement(N.a.Item,{key:"3"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Ke(ee.id)}},"\u64A4\u9500\u5171\u4EAB")),G&&c.a.createElement(N.a.Item,{key:"4"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return Ee(ee.id)}},"\u516C\u5F00")),pe==="0"&&!ee.public&&ee.apply&&(ee.item_type==="PROGRAM"&&ee.program_attr.status!==0||ee.item_type!=="PROGRAM")&&c.a.createElement(N.a.Item,{key:"5"},c.a.createElement("a",{className:i.a.reviewFlag,onClick:se},"\u5BA1\u6838\u4E2D")),(pe==="0"||pe==="1")&&ee.public&&((T=ee.author)===null||T===void 0?void 0:T.login)===((L=ye.userInfo)===null||L===void 0?void 0:L.login)&&c.a.createElement(N.a.Item,{key:"6"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return A(ee.id)}},"\u64A4\u9500\u516C\u5F00")),pe==="2"&&c.a.createElement(N.a.Item,{key:"7"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return M(ee.id,ee.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(pe==="0"||pe==="3")&&ee.item_type==="PROGRAM"&&((D=ee.program_attr)===null||D===void 0?void 0:D.status)===0&&!ee.public&&((x=ee.author)===null||x===void 0?void 0:x.login)===((P=ye.userInfo)===null||P===void 0?void 0:P.login)&&c.a.createElement(N.a.Item,{key:"8"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){var oe;return Ve(ee==null||((oe=ee.program_attr)===null||oe===void 0)?void 0:oe.identifier)}},"\u53D1\u5E03")),(pe==="1"||pe==="3")&&!Object(d.o)()&&!Object(d.m)()&&((H=ee.author)===null||H===void 0?void 0:H.login)!==((I=ye.userInfo)===null||I===void 0?void 0:I.login)&&c.a.createElement(N.a.Item,{key:"9"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return M(ee.id,ee.is_collected)}},ee.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),pe!=="0"&&!Object(d.o)()&&!Object(d.m)()&&c.a.createElement(N.a.Item,{key:"10"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return B(ee.id)}},"\u7EA0\u9519")),(pe==="0"&&!ee.public||pe==="1"&&Object(d.o)()&&((z=ee.author)===null||z===void 0?void 0:z.login)!==(($=ye.userInfo)===null||$===void 0?void 0:$.login))&&c.a.createElement(N.a.Item,{key:"11"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return q(ee.id)}},"\u5220\u9664"))),re=c.a.createElement(N.a,{forceSubMenuRender:!0,className:i.a.menu},c.a.createElement(N.a.Item,{key:"10"},c.a.createElement("a",{className:i.a.actionLink,onClick:function(){return B(ee.id)}},"\u7EA0\u9519"))),X=pe!=="0"&&!Object(d.o)()&&!Object(d.m)();return c.a.createElement(c.a.Fragment,null,fe?c.a.createElement(c.a.Fragment,null,ee.item_type!=="SUBJECTIVE"&&ee.item_type!=="COMBINATION"&&c.a.createElement("span",{className:i.a.textBtn,style:{cursor:"pointer"},onClick:function(){return te(ee)}},"\u4F53\u9A8C"),c.a.createElement(W.a,{overlay:Z},c.a.createElement("span",{style:{cursor:"default"},onClick:function(oe){return oe.preventDefault()}},c.a.createElement("span",{className:i.a.textBtn},"\u66F4\u591A")))):X?c.a.createElement(W.a,{className:"ml40",overlay:re},c.a.createElement("span",{style:{cursor:"default"},onClick:function(oe){return oe.preventDefault()}},c.a.createElement("span",null,"\u66F4\u591A"))):c.a.createElement("span",null))};be.b=v},FKdj:function(Ge,be,U){Ge.exports={flex_box_center:"flex_box_center___3uXpC",flex_space_between:"flex_space_between___1R5l3",flex_box_vertical_center:"flex_box_vertical_center___2whw-",flex_box_center_end:"flex_box_center_end___Jni7d",flex_box_column:"flex_box_column___bQWh0",page:"page___2wqIC",wrap:"wrap___3ThhU",title:"title___3BwkD",select:"select___2Ozsr",contentWrap:"contentWrap___3srp0",pngIcon:"pngIcon___2ckkq",tabsWrap:"tabsWrap___2Y959",searchWrap:"searchWrap___H9GsL",addQuestionBtn:"addQuestionBtn___1b8s_",search:"search___3d1EJ",searchIcon:"searchIcon___1mrzV",batchWrap:"batchWrap___j1Er3",contentListWrap:"contentListWrap___3pty2",li:"li___2UOPB",bottom:"bottom___I7MVG",actionLeftItem:"actionLeftItem___3bGeH",questionTypeName:"questionTypeName___Aiyux",more:"more___YExtS",btnAdd:"btnAdd___2RrWf",treeWrapper:"treeWrapper___U0OPC",treeHeader:"treeHeader___1LB2p",treeContent:"treeContent___Ckfqx",action:"action___Xn5RP",headerWrapper:"headerWrapper___3ECJD",exportBtn:"exportBtn___35cZE"}},FOrL:function(Ge,be,U){Ge.exports=U.p+"static/nodata.a6b3f948.png"},FWmy:function(Ge,be,U){"use strict";U.d(be,"a",function(){return ue});function ue(W,R){if(!W)throw new Error(R?`Assertion failed (${R})`:"Assertion Failed")}},Is5a:function(Ge,be){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACMgAAAA6CAYAAABPwffJAAAAAXNSR0IArs4c6QAAH35JREFUeF7t3Q2MZWV9x/H/c849d17uzL6y7K4M76xLNIAKoiBQak0oRgsiYKyxUEq0LwZLYmqa0hqtpi8xodam1daKRFtbRITYBmlspRBBAXmRaHddsCyO7Bsssztzd2buveec5jl37jC7bN155l7OL7P3ewmZfTnn+Z37+f9nsjn3n+c4W8JrfHx8bGam9ZfNZutif3q1Wrl3YKDyB2NjY+NLWC74FHV+8AVzQlcC6nqr87vC4+RgAXW91fnBYJyAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACpr6/r86nBcoVUNdbnV+uNmnqevcy34WW84knto0513giz22NWef03P9qb27Vs846a9MrOiSjzg/14vjuBNT1Vud3p8fZoQLqeqvzQ704HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBMzU9/fV+fRAuQLqeqvzy9UmTV3vXucHD8g88shj/2zm3ttoNOa7wZmzJEnMnPvqOeec9euvZJuo81/J98baLxdQ11udT0+UK6Cutzq/XG3SEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBA4OgTU9/fV+UdHFZfPu1DXW52/fCp1dFyput69zg8ekLnvvu8+l+e28XDldM52XHTRW171SpZanf9KvjfWfrmAut7qfHqiXAF1vdX55WqThgACCCCAAAIIIIAAAggggAACCCCAAAIIIIDA0SGgvr+vzj86qrh83oW63ur85VOpo+NK1fXudX7wgMy3v31vnue5NZtNc84sz9sPWkqq1aLCb3vbxcFrhrSGOj/kWjm2ewF1vdX53QuyQoiAut7q/BArjkUAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIG2gPr+vjqfPihXQF1vdX652qSp693r/OBhlrvu+ve8PRiTmx+N6QzJtFsjt8sue0fwmiFtpc4PuVaO7V5AXW91fveCrBAioK63Oj/EimMRQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgLaC+v6/Opw/KFVDXW51frjZp6nr3Oj94mOX22+/0kzHWbDaK3WP8yw/JJElSDMxceeXlwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWW2/9Smcsptgx5qVdZNq/vuaa9wWvGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWb7whVvyZrN5UCf4xy055yxJqnb99dcGrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1k+85m/yZ05y4vdY/zjldpLFEMy5uyGD/9e8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjl05+++ZAdZNqPVvKvJEnsIx+5MXjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8olPfCrvPFKp/dXvHtNuDL/Yn3zspuA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy003fSxvNhsLOuGlJfwOMp/85MeD1wxpK3V+yLVybPcC6nqr87sXZIUQAXW91fkhVhyLAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACbQH1/X11Pn1QroC63ur8crVJU9e71/nBwyw33viR3O8a03nN7x4zt5PMzTd/OnjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8qEP3ZC3mi3Lbe65SvM94axaTeyzn/1M8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjluuuuf2kyxv/KrzD3Nc9zu+WWfwxeM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7z//dfkzUbjoP1j/COX/KOWqtWqffnLtwavGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWa644sp8fsuY+X7obCrj7I47bg9eM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7zjHb+Wt1rNYseY9is359z8DjLf/OZdwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWSy65NG82m0UnNJuN4muSJMVX/4ilb33r7uA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy4UXXpT73WP8kIxzZv43fgeZJKkWu8ncf/99wWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWN73pzXmr1SoGYzo7yfgdZPyQTKVSse9//3vBa4a0lTo/5Fo5tnsBdb3V+d0LskKIgLre6vwQK45FAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBtoD6/r46nz4oV0Bdb3V+udqkqevd6/zgYZazzz4nbzQaxXBMsXuM74liB5mk2EXm0UcfCV4zpK3U+SHXyrHdC6jrrc7vXpAVQgTU9Vbnh1hxLAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCLQF1Pf31fn0QbkC6nqr88vVJk1d717nBw+zbN58et7ZOabZbPjpGKtWE/OPXapWq7Zly/8ErxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1lOOeXUYkCmMyRjls8Px/gBmaeffip4zZC2UueHXCvHdi+grrc6v3tBVggRUNdbnR9ixbEIIIAAAggggAACCCCAAAIIIIAAAggggAACCCDQFlDf31fn0wflCqjrrc4vV5s0db17nR88zOIv4MCBujUafkimYa7zeKVKYsO1mv30p08HrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/MXNcyS57m75557Vq9atfbCq656951+95h6fWp+F5kkqVqtVrMkSexrX/v65RMTL9x/ySWXvOicy3vRMur8XrwH1li8gLre6vzFS3FkLwTU9Vbn98KQNRBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6DcB9f19dX6/1Vv9ftX1Vuer/fstX13vVzL//x2Q8aG+0HfffXd1zbp1v3rssSe8rzay4opzXrc5rtfr1mo1bWpqqthBZnh42DpDMo88vjWtT+2/Y/fuZ/9p754937r00ksbfp3QYRl1fr81ufr9quutzlf791u+ut7q/H6rN+8XAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIFeCKjv76vze2HIGosXUNdbnb94KY7shYC63mXlH3ZAphN+7733Dqw5ZsONGzae9Ie55aMe9o2vP714tJIfkvE7yZi5YueYzg4yDz+2pfB35iZ37njmz/ZPPP+5Cy64YKL4s0XuKKPO70UDscbiBdT1VucvXoojeyGgrrc6vxeGrIEAAggggAACCCCAAAIIIIAAAggggAACCCCAQL8JqO/vq/P7rd7q96uutzpf7d9v+ep6l5n/sgGZuXD34IMPrhpZsfrP12886beyLI98Ezhndv65ZxSDMX5Ixn/NcysGZKrVavH1gYeeLP7Mv6LIZbuf2/7Fycm9N5x33nmzZpYfaUhGnd9vza5+v+p6q/PV/v2Wr663Or/f6s37RQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgFwLq+/vq/F4YssbiBdT1VucvXoojeyGgrnfZ+QcNyCwIHxhdufbGdRtO+NPcD8f4o+amXi6+4Ozi8UqNRntAxr/845Wq1aT4+p37H2nXwU/T5GYuctmenc/+8eS+F24+0pCMOr8XDcQaixdQ11udv3gpjuyFgLre6vxeGLIGAggggAACCCCAAAIIIIAAAggggAACCCCAAAL9JqC+v6/O77d6q9+vut7qfLV/v+Wr663Inx+Q6YT70ZaHH330shNPfM2X8jwfzf2Ui5k1m6nd9i+32q23/MNBu8c45yzP8/kBmWuv+4Bd9Z7fsCSJi/Oc/8+5ye3bf3ztG9/whrv8qM3hdpJR5/dbs6vfr7re6ny1f7/lq+utzu+3evN+EUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBDohYD6/r46vxeGrLF4AXW91fmLl+LIXgio663KP3RAJnrggQfWbjjutL+t1Ubf7Ydj/MYxrVbLPv93N9vT27batm3bit1j/JxLs9kqvvqdY/zLP2Zp06ZNduqmzfbB37nRKpVKsZGMH5Kp1ye/vvPnT/3u+eef/4KZZYc+amkOQJbfiyZijcULqOutzl+8FEf2QkBdb3V+LwxZAwEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBfhNQ399X5/dbvdXvV11vdb7av9/y1fVW5RcDMgumc6IfPP7ku44/YdNXsyyL/XCMP+CuO2+zhx96wOIoth/+8Ilixxj/eCW/e8zc+ZYkSfH7M888y9IstTeee75ddvnVxXYx/rAoitKfPbvtvWe/7oxv+AGZhbvIqPP7rdnV71ddb3W+2r/f8tX1Vuf3W715vwgggAACCCCAAAIIIIAAAggggAACCCCAAAII9EJAfX9fnd8LQ9ZYvIC63ur8xUtxZC8E1PVW5i8ckInMLN761M/+YuWqtb/fGY7ZvXunfeHzf21xHFujMWNbtmwthmOKV95+XtLcnIxVk6q9evMmGxgYsjRN7foP3mDHHrth/ph9Ey/81ebTjv+omaULd5HpTAep8nvRRKyxeAF1vdX5i5fiyF4IqOutzu+FIWsggAACCCCAAAIIIIAAAggggAACCCCAAAIIINBvAur7++r8fqu3+v2q663OV/v3W7663sp8t2A6J37ooR+OverEE2+pxMkv5Zkffsnt3v+6x3705GOWZZkdODBlW7duKwZiGg0/JFOMx8w/Zsn/+aZNp1mtNup3jLHXnvF6u/itlxSPWHKRWStt/vdz27f/5rnnnjk+NyTjF/Avv4gk/9BHPfVb85f9fuk31+n5sun7Mo9+o9/6svF50wgggAACCCCAAAIIIIAAAggggAACCCCAAAJdCfD5Ap8vdNVAgSfTb/RbYMt0dXjf99vC6Zz77ntw8+mvOesbae5OzX0fZpnd/q9ftqmpSZua2metZtOeeeZZm56ents1xhWPW2rvIONscHDQTjrpBKskiY2MrLSRkVG78j3v989XMpc7i13+9JYfP/Guiy46b2tnF5m56hW71yjyGZDp6vsn+GT6jR/wwU3TxQn0G/3WRftwKgIIIIAAAggggAACCCCAAAIIIIAAAggggECfCvD5Ap8vlNn69Bv9Rr+VN5/S2UEmesYs2fPw4284/uTN/2FZXsssszxzdvttXzLnnL3w/K5iGGbHjp02NVW3RmN2buMXX67cqtWqjYyM2MaNG4rdY9asPbb483dfda25KLfIIrPI1Z956keXbHjzOT84ycxvQZN1BmRU+QzIlPntZr6H/DgV/VYue9+m0W/8g6Jvm583jgACCCCAAAIIIIAAAggggAACCCCAAAIIILBkAT5f4POFJTfPEk6k3+i3JbTNkk/p+36bA4jHxy3Z/txD55x2ypl3Z3lWy/PMbyBjd//bbRZFse3e9VzxmKVWq1XsIpOmaTEw419+gMYPxZx88olWqVSK36/fcFxxzNvfebXfQMaciyxyUX3rTx59+yknnP/w2FgxIJPOVU6Wz4DMkr93lnQi/cYP+CU1zhJPot/otyW2DqchgAACCCCAAAIIIIAAAggggAACCCCAAAII9LEAny/w+UKZ7U+/0W/0W3nzKZ0dZCo7dlgyPv74a4874dW35VF+kmX+8Umpfe+737FGs1HsINOYnSlq44dkdu7cbfV6vRiGGR4etg0bjrU4jou/HxgcsrXHrLdqUrU3v+WXzbnYLMrNZe6Znz/7k6vHxl73o40biwGZ1lyxZfkMyJT57Ta/g4ys3vRbufVWp839g4J+UxeCfAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEElpEAny8wsFBmu9Jv9Bv9Vt58ih+Qicws3rXLqnv2bD111THHfi6Kquf53WP8DjH/+/SWYjhmdna6+LqY19q16606MGjHrNtgJ596+twOM2ZZ1nhw4vndv71u3ean16+3xsIdZFT5zrnOY54W89Y4pksB+o1+67KFgk6n3+i3oIbhYAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEErPiMlM9P6YTSBOg3Ps8qrdn4+ZYeNCATxwdW7Hlx7ydXrlx1XZ47y7LcpqcP2LatT1ilUrXndz9n09P1X1ifoaGarVt/nDWbs7Zp81k2NDRsUeTMudz27Zv44rrVa25K0+H9hxuQUeQzIFPmt9vB/6BQ1Hvu3RYDYYp8+o1+K/PnK/1Wbr+RhgACCCCAAAIIIIAAAggggAACCCCAAAIIIHB0CCwcWFB8nsTnWUdHHy32XdBvDMgstld6cVzf99uhAOPj41esHxv7TJbmsR+Q8bvI7Nr5M5ua3GfORfbC8zts+sDUYe2Hhkds7TEb/dyR1UZW2PoNx8/tHuMsil26a3z8w2NjY3f8ogGZsvP5ALkX30aLX4N+4wf84rul+yPpN/qt+y5iBQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIF+E+DzBT5fKLPn6Tf6jX4rbz7loB1koqg+umfixROHhoY+lVQGf8UPx3T+f37XuDVbTYvjxOr1/Ta5f681ZmeKWvnHKY2uWGO12grLspbFccXWrR8rhmM6/zdbM/85PT39R+tWrd6eZbXJw+0go8hnQKbMb7eDd5BR1Hvu3RY7yCjy6Tf6rcyfr/Rbuf1GGgIIIIAAAggggAACCCCAAAIIIIAAAggggMDRIbBwYEHxeRKfZx0dfbTYd0G/MSCz2F7pxXF932+5f5aSWWXHDkucm6q14mTV3r3PXX7MqvUfz/J0KM/NMj8ok5pNTu61VnPGXBSbs8hc5E8tNoyxLE8tz1JLqoM2MrLGXGwWFQMy/ms8/fzEro+tWfOqOytpcyLPR+obN1rTzFpzRZTlO//sJ16lCdBv9FtpzdZ+hh4/38oEJwsBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgaNAgM8X+DyrzDam3+g3+q28+RS/g4z/ADkeH7fErZwcbh1IVuStxvqZ6ckPrBhddU2aZ1GemWV+CiY1a6Uta7WmLW2llvupGTNzLra4ElulMmSVuGLmh2PMmYvMYhdl+ycnbh0cGv17V6nuqgw39+f7Rg+MjRUDMu0FhPkMyJT57TY/sEC/lcvet2n8fOMfFH3b/LxxBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgSUL8PkCny8suXmWcCL9Rr8toW2WfErf99scQPSMWbJqwgbr2fRIVk9X5XG64cDU1EdXrFz11jTLoixr7xRTPHLJ/6LYnaHt7neJKb76//xv/K4xfjgmirJ9ExPfGRiMb06ike1RLZ6oRUNTE6ts5iQrBmT8qv4ly2dAZsnfO0s6kX7jB/ySGmeJJ9Fv9NsSW4fTEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBPpYgM8X+HyhzPan3+g3+q28+ZTODjKR38Vlzx6r5nm95lxtdDI9sDprzJyYNqavHhlZ/c4sSwczPyDj+7MzLDPXq85vQuOHZCIz/2v/5KUoimempl78Zjww8JUoGd4xGg+/mOf1Sedq9XXrrDG3e8z8gIwqnwGZMr/d5neQod/KZe/btM4/KFQ/X+bgZf3Oz7e+bX3eOAIIIIAAAggggAACCCCAAAIIIIAAAggggEAXAny+wMBCF+0TfCr9Rr8FN00XJ/R9v80BFI9Z2rHDkrRmg1FrutaaSkctydfMTmfr09bkxQNDtQuTJDkjy/Ko2EEmd/M7yfidY8zlxQ4yUeSyZrP55Ox0/f64MnrvwFC0y5pub2UknswqQ/W4bjMbN84/XmluD5pivEaSzwfIXXz3LOFU+o0f8EtomyWfQr/Rb0tuHk5EAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6FsBPl/g84Uym59+o9/ot/LmU4qHIx06JZSmU0OzrjJSaaUrGlm+Mk3z1ZY1jsvy1utdxZ1eTQbGnEUrnYtq7fOzem7ZvkZzdjxv5VsiV3nMourP49i9WI3cvlYl3j+Qt6bieGR64e4xneEUdX6ZDUcW/UYPlCug/vmizi9XmzQEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBI4OAfX9fXX+0VHF5fMu1PVW5y+fSh0dV6qutzJ/4YBM8ZCkcbOk9qJVm8364OxsZSSKWiNplI3mLh7Nm80VeWYjqbXWZ62sluX5kG+ByLnpqBLVY6vscpFNuSTZ7/J0Ms6iySyrTA0MtKaSpDZTX22NMSt2jyke0nTIgIws/+ho4+XzLhZMQdJvy6dsy/ZK6bdlWzouHAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABmQCfL8jo+zKYfuvLssvedD/3WzEg418LpnQi/6ilwUFL/JDMdB4Pu9nWUKsa1aJWo+Yq1SFrpYNZ5hLnsrh9bpRGUd60SjyTtxrTWaVarzSyej5QmR5y6QE/HDMzY825Ryv54Zjs0EcbqfNl3denwep6q/P7tOyyt62utzpfBk8wAggggAACCCCAAAIIIIAAAggggAACCCCAAALLWEB9f1+dv4xLtywvXV1vdf6yLNoyvmh1vVX5hw7I+N/7/+MdO6zih2RmZ6eqWTUeTNKhgZmZqcHKUDRQn02r1SiJs3SmGJCJ4sG0kTXT2kDcaE1ns4ODIzPNeHo2aqQzAwMjjbnhmJaZpX6eZuHuMZ2eWTClJMlfxr27LC9dXW91/rIs2jK+aHW91fnLuHRcOgIIIIAAAggggAACCCCAAAIIIIAAAggggAACMgH1/X11vgy+T4PV9Vbn92nZZW9bXW9V/vyAjJc/5CL8428qA3ssnh2wanWmnjQrUdJqumQ4GozrrcmKa7j2I5qqeV6rjLYOZDNpJcmbSStrNgZrzYFZa8yus3TMzA/HFI9VOtxwTKfq6nxZ9/VpsLre6vw+Lbvsbavrrc6XwROMAAIIIIAAAggggAACCCCAAAIIIIAAAggggMAyFlDf31fnL+PSLctLV9dbnb8si7aML1pdb0X+QQMyvnaHXIT/e//IpUqlYlGSWKUeT8Zx3UVx7IrdYzqvNM3TtJZntXQ0bTat1WpZtnHjwYMxv2g4prOOOn8Z9++yvHR1vdX5y7Joy/ii1fVW5y/j0nHpCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgjIBNT399X5Mvg+DVbXW53fp2WXvW11vcvOf9mAjJefuwj/y84jl6LOr8fHLYpjc1FU/N38K8ssT1PLx8Ze2ilm4a4xxWLO+R1kjvhS5x/xAjmgpwLqeqvze4rJYkcUUNdbnX9EIA5AAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBlwmo7++r82mJcgXU9Vbnl6tNmrreZeYfdkDGt8CCi/C/7QzKHPrrQ7uleITS3B8u/PWih2M6C6rz+TYoV0Bdb3V+udqkqeutzqcDEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAIFxAfX9fnR8uxhndCKjrrc7vxo5zwwXU9S4r//8dkFlIdsjFdP7q0HNftjvMYneMOVJ51PlHuj7+vrcC6nqr83uryWpHElDXW51/JB/+HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBF4uoL6/r86nJ8oVUNdbnV+uNmnqer+S+f8HabRiLm3R4IUAAAAASUVORK5CYII="},"Ix/O":function(Ge,be){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JYp7:function(Ge,be,U){"use strict";U.d(be,"a",function(){return ue});var ue;(function(W){function R(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}W.is=R;const N=Object.freeze([]);function S(){return N}W.empty=S;function*O(t){yield t}W.single=O;function F(t){return t||N}W.from=F;function j(t){return!t||t[Symbol.iterator]().next().done===!0}W.isEmpty=j;function e(t){return t[Symbol.iterator]().next().value}W.first=e;function w(t,v){for(const p of t)if(v(p))return!0;return!1}W.some=w;function g(t,v){for(const p of t)if(v(p))return p;return}W.find=g;function*c(t,v){for(const p of t)v(p)&&(yield p)}W.filter=c;function*u(t,v){let p=0;for(const m of t)yield v(m,p++)}W.map=u;function*a(...t){for(const v of t)for(const p of v)yield p}W.concat=a;function*i(t){for(const v of t)for(const p of v)yield p}W.concatNested=i;function d(t,v,p){let m=p;for(const b of t)m=v(m,b);return m}W.reduce=d;function*s(t,v,p=t.length){for(v<0&&(v+=t.length),p<0?p+=t.length:p>t.length&&(p=t.length);v<p;v++)yield t[v]}W.slice=s;function r(t,v=Number.POSITIVE_INFINITY){const p=[];if(v===0)return[p,t];const m=t[Symbol.iterator]();for(let b=0;b<v;b++){const _=m.next();if(_.done)return[p,W.empty()];p.push(_.value)}return[p,{[Symbol.iterator](){return m}}]}W.consume=r;function n(t,v,p=(m,b)=>m===b){const m=t[Symbol.iterator](),b=v[Symbol.iterator]();for(;;){const _=m.next(),o=b.next();if(_.done!==o.done)return!1;if(_.done)return!0;if(!p(_.value,o.value))return!1}}W.equals=n})(ue||(ue={}))},KMxT:function(Ge,be,U){"use strict";U.r(be);var ue=U("DjyN"),W=U("NUBc"),R=U("qVdP"),N=U("jsC+"),S=U("lUTK"),O=U("BvKs"),F=U("T2oS"),j=U("W9HT"),e=U("+L6B"),w=U("2/Rp"),g=U("k1fw"),c=U("9og8"),u=U("tJVT"),a=U("PpiC"),i=U("5NDa"),d=U("5rEg"),s=U("Znn+"),r=U("ZTPi"),n=U("WmNS"),t=U.n(n),v=U("q1tI"),p=U.n(v),m=U("9kvl"),b=U("iris"),_=U("jcZT"),o=U("BdwD"),f=U("SAoR"),l=U("FKdj"),h=U.n(l),E=U("EJTS"),y=U("LE3n"),T=U("xKgJ"),L=U("SVaM"),D=U("xTzM"),x=U.n(D),P=U("1vsH"),H=U("ErOA"),I=r.a.TabPane,z=d.a.Search,$;(function(ee){ee.Mine="0",ee.Public="1",ee.Collection="2",ee.TeachGroupShare="3"})($||($={}));var fe=function(ye){var pe,ae,se,_e,te,k,A,C,B=ye.classroomList,K=ye.problemset,M=ye.user,ie=ye.globalSetting,Ee=ye.loading,Oe=ye.dispatch,q=ye.match,de=ye.shixunHomeworks,Te=Object(a.a)(ye,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),xe=Object(P.I)(),Pe=Object(v.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:xe.qtype,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((pe=Te.location)===null||pe===void 0||((ae=pe.query)===null||ae===void 0)?void 0:ae.id)||null,exam_id:(q==null||((se=q.params)===null||se===void 0)?void 0:se.id)||null,exercise_id:(q==null||((_e=q.params)===null||_e===void 0)?void 0:_e.categoryId)||null}),Ne=Object(u.a)(Pe,2),Re=Ne[0],Me=Ne[1],He=Object(v.useState)(0),We=Object(u.a)(He,2),Ke=We[0],Be=We[1],Ve=Object(v.useState)([]),Xe=Object(u.a)(Ve,2),ne=Xe[0],V=Xe[1],G=Object(v.useState)($.Mine),Z=Object(u.a)(G,2),re=Z[0],X=Z[1],Q=Object(v.useState)(-1),oe=Object(u.a)(Q,2),he=oe[0],De=oe[1],Ie=Object(v.useState)([]),Ue=Object(u.a)(Ie,2),Ye=Ue[0],Je=Ue[1],Ze=Object(v.useState)([]),dt=Object(u.a)(Ze,2),at=dt[0],$e=dt[1],Nt=Object(v.useState)(!1),bt=Object(u.a)(Nt,2),Ut=bt[0],Lt=bt[1],ot=Object(v.useRef)(!1),Ft=Object(v.useState)([]),Jt=Object(u.a)(Ft,2),Vt=Jt[0],rn=Jt[1],qe=Object(v.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),it=Object(u.a)(qe,2),ft=it[0],It=it[1],$t=Object(v.useState)([]),ln=Object(u.a)($t,2),Bt=ln[0],pt=ln[1],yt=Object(v.useRef)(null),ut=Object(v.useState)(!1),Qt=Object(u.a)(ut,2),Rt=Qt[0],dn=Qt[1],Kt=Object(v.useState)(""),gn=Object(u.a)(Kt,2),xn=gn[0],Sn=gn[1],Cn=[{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u5347\u5E8F",type:"updated_at",direction:"asc"},{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F",type:"updated_at",direction:"desc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u5347\u5E8F",type:"quotes",direction:"asc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u964D\u5E8F",type:"quotes",direction:"desc"}];Object(v.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]),Object(v.useEffect)(function(){var tt;Oe({type:"problemset/getDisciplines",payload:{source:"question"}});var et=((tt=Te.location.query)===null||tt===void 0?void 0:tt.group_id)||0;Re.group_id=Number(et),Me(Re),en(Re).then(function(mt){mt!=null&&mt.status||pt(mt==null?void 0:mt.item_banks_group),dn(!1)}),ni(),ti()},[]),Object(v.useEffect)(function(){return Oe({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Oe({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){Oe({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Oe({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(v.useEffect)(function(){return Oe({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Oe({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(v.useEffect)(function(){return Oe({type:"globalSetting/headerFooterToggle",payload:!1}),function(){Oe({type:"globalSetting/headerFooterToggle",payload:!0})}},[]);var ti=function(){var tt=Object(c.a)(t.a.mark(function et(){return t.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:Oe({type:"problemset/getTeachGroupData"});case 1:case"end":return Ot.stop()}},et)}));return function(){return tt.apply(this,arguments)}}(),en=function(){var tt=Object(c.a)(t.a.mark(function et(mt){var Ot;return t.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return mt.item_type=mt.item_type,dn(!0),Xt.next=4,Oe({type:"problemset/getItemBanks",payload:mt});case 4:if(Ot=Xt.sent,!(Ot&&Ot.status!==403&&Ot.status!==401&&Ot.status!==500)){Xt.next=14;break}return Be(Ot.items_count||0),V(Ot.items||[]),Je(Ot.tag_disciplines||[]),ii(Ot.items||[]),rn([]),$e((Ot==null?void 0:Ot.navigation)||[]),dn(!1),Xt.abrupt("return",Ot);case 14:case"end":return Xt.stop()}},et)}));return function(mt){return tt.apply(this,arguments)}}(),ni=function(){Oe({type:"problemset/getBasketList",payload:{}})},ii=function(et){var mt=et.every(function(Ot){var qt;return((qt=Ot.program_attr)===null||qt===void 0?void 0:qt.status)===0});ot.current=mt},ri=function(et,mt){if(Re.discipline_id=et||"",Re.sub_discipline_id=mt||"",Re.tag_discipline_id="",Re.page=1,Re.per_page=20,delete Re.id,De(et===null?-1:null),Me(Re),en(Re),et===null)return},Ai=function(et){Re.difficulty=et||"",Re.page=1,Re.per_page=20,delete Re.id,Me(Re),en(Re)},On=function(et){Re.tag_discipline_id=et,Re.page=1,Re.per_page=20,delete Re.id,et===-1&&(Re.discipline_id="",Re.sub_discipline_id="",Re.tag_discipline_id=""),De(et),Me(Re),en(Re)},Hn=Object(v.useState)(!1),Kn=Object(u.a)(Hn,2),ai=Kn[0],Gn=Kn[1],zn=function(et){Oe({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:et}}),Re.discipline_id="",Re.sub_discipline_id="",Re.tag_discipline_id="",Re.difficulty=null,Re.type=et,et==="0"?Re.group_id=0:Re.group_id=null,et==="3"?Gn(!0):Gn(!1),Re.page=1,Re.per_page=20,delete Re.id,De(-1),X(et),Me(Re),en(Re)},si=function(et,mt){Re.page=et,Re.per_page=mt,Me(Re),en(Re)},Ln=function(et){Re.discipline_id="",Re.sub_discipline_id="",Re.tag_discipline_id="",Re.difficulty=null,Re.page=1,Re.keyword=et,delete Re.id,et?(Lt(!0),Object(L.a)({name:et,copywriting:et,position:"ItemBank"})):Lt(!1),De(-1),Me(Re),en(Re)},oi=function(){Re.per_page=20,Me(Re),en(Re)},Vn=function(){var tt=Object(c.a)(t.a.mark(function et(mt){return t.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:Oe({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(mt),group_type:$.Mine}}),Re.page=1,Re.per_page=20,Re.group_id=Math.abs(mt),Me(Re),en(Re).then(function(Xt){return pt(Xt==null?void 0:Xt.item_banks_group)});case 6:case"end":return qt.stop()}},et)}));return function(mt){return tt.apply(this,arguments)}}(),Xn=function(){Oe({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:Re}});return},li=function(){Oe({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Yn=function(){var tt=Object(c.a)(t.a.mark(function et(mt){return t.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:Oe({type:"problemset/getDisciplines",payload:{source:"question",group_id:mt,group_type:$.TeachGroupShare}}),Re.page=1,Re.group_id=mt||null,delete Re.id,Me(Object(g.a)({},Re)),en(Re);case 6:case"end":return qt.stop()}},et)}));return function(mt){return tt.apply(this,arguments)}}(),ui=function(et){Re.sort_by=et.type,Re.sort_direction=et.direction,Re.page=1,Re.per_page=20,It(et.name),Me(Re),en(Re)},di=function(et){Re.discipline_id="",Re.sub_discipline_id="",Re.tag_discipline_id="",Re.difficulty=null,Re.page=1,Re.per_page=20,Re.group_id=et,De(-1),Me(Re),en(Re).then(function(mt){return pt(mt==null?void 0:mt.item_banks_group)})},$n=function(et){rn(et)},ci=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],hi={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Qn=function(){var tt=Object(c.a)(t.a.mark(function et(mt){var Ot;return t.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:if(!(xe.type==="exercise")){Xt.next=6;break}return Xt.next=3,Object(H.a)("/api/exercises/".concat(xe.exerciseid,"/toggle_random_question.json"),{method:"post",body:{question_id:xe.qid,item_bank_id:mt}});case 3:return Ot=Xt.sent,Ot!=null&&Ot.status||m.d.push(xe.from),Xt.abrupt("return");case 6:case"end":return Xt.stop()}},et)}));return function(mt){return tt.apply(this,arguments)}}();return p.a.createElement("div",{className:h.a.page},p.a.createElement("section",null,p.a.createElement("div",{className:h.a.wrap},p.a.createElement("div",{className:h.a.title},"\u8BD5\u9898\u5E93"),p.a.createElement("div",{className:h.a.headerWrapper},p.a.createElement("div",{className:h.a.tabsWrap},p.a.createElement(r.a,{activeKey:re,onChange:zn,tabBarExtraContent:p.a.createElement("div",{className:h.a.searchWrap},p.a.createElement(z,{allowClear:!0,suffix:p.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(h.a.searchIcon),onClick:function(){return Ln(Re.keyword)}}),className:h.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",value:Re.keyword,onChange:function(et){Re.keyword=et.target.value,Me(Object(g.a)({},Re))},onSearch:Ln}))},p.a.createElement(I,{tab:"\u516C\u5171",key:"1"}),((te=K.teachGroupData)===null||te===void 0||((k=te.groups)===null||k===void 0)?void 0:k.length)&&p.a.createElement(I,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(T.o)()&&!Object(T.m)()&&p.a.createElement(I,{tab:"\u6536\u85CF\u5939",key:"2"}),p.a.createElement(I,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),p.a.createElement(b.a,{showSelectAll:!1,className:h.a.select,disciplinesData:(A=K.disciplinesData)===null||A===void 0?void 0:A.disciplines,knowledgeData:Ye,directionValue:Re.discipline_id,subDisciplineValue:Re.sub_discipline_id,typeValue:Re.item_type,isprogram_homework:!1,showItemType:!1,showKnowledge:!0,name:xn,setname:Sn,difficultyValue:Re.difficulty,showShixun:!1,onShixunChange:li,onDirectionChange:ri,onTypeChange:function(){},onDifficultyChange:Ai,knowledgeValue:he,onKnowledgeChange:On,teachGroupData:(C=K.teachGroupData)===null||C===void 0?void 0:C.groups,onTeachGroupChange:Yn,teachGroupValue:Re.group_id,showTeachGroup:ai})),p.a.createElement("div",{className:h.a.treeWrapper,style:{display:re===$.Mine?"block":"none"}},p.a.createElement("div",{className:h.a.treeHeader},p.a.createElement(f.a,{data:at,onClick:Vn}),p.a.createElement(w.a,{type:"link",onClick:Xn,className:h.a.exportBtn},p.a.createElement("img",{src:x.a,alt:"",className:h.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),p.a.createElement(j.a,{spinning:Rt},p.a.createElement("div",{ref:yt,className:h.a.treeContent},p.a.createElement(y.a,{isProblemset:!1,reloadData:oi,data:Bt,onShare:function(){},onOpen:Vn})))),p.a.createElement("div",{className:h.a.contentWrap},p.a.createElement("div",{className:h.a.batchWrap},p.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},p.a.createElement("div",{className:"font14"},p.a.createElement(N.a,{overlay:p.a.createElement(O.a,{selectedKeys:[ft]},Cn==null?void 0:Cn.map(function(tt,et){return p.a.createElement(O.a.Item,{key:tt.name,onClick:function(){return ui(tt)}},tt.name)}))},p.a.createElement("span",{style:{color:"#464F66"}},p.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),ft))))),Ut?p.a.createElement("div",null,p.a.createElement(w.a,{style:{paddingLeft:0},onClick:function(){Re.page=1,Re.keyword=null,delete Re.id,Me(Re),Lt(!1),en(Re)},type:"link"},p.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),p.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",Re.keyword,"\u201D")):null,p.a.createElement("div",{className:h.a.contentListWrap},Ke!==0?p.a.createElement(j.a,{size:"large",spinning:Ee["problemset/getItemBanks"]},ne.map(function(tt,et){var mt,Ot;return p.a.createElement("div",{className:h.a.li,key:tt.id},p.a.createElement("div",{className:h.a.top},p.a.createElement(E.b,{showCheckbox:!1,data:tt,selectIds:Vt,onSelectCheckBox:$n})),p.a.createElement("div",{className:h.a.bottom},p.a.createElement("p",{className:"".concat(h.a.actionLeftItem," ").concat(h.a.questionTypeName)},(mt=ci.find(function(qt){return qt.type===tt.item_type}))===null||mt===void 0?void 0:mt.name),p.a.createElement("p",{className:h.a.actionLeftItem},hi[tt.difficulty]),p.a.createElement("p",{className:h.a.actionLeftItem},"\u521B\u5EFA\u8005",p.a.createElement("span",{className:"c-grey-333"},tt==null||((Ot=tt.author)===null||Ot===void 0)?void 0:Ot.name)),p.a.createElement("p",{className:h.a.actionLeftItem},"\u66F4\u65B0",p.a.createElement("span",{className:"c-grey-333"},tt==null?void 0:tt.updated_at)),p.a.createElement("p",{className:h.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",p.a.createElement("span",{className:"c-grey-333"},tt==null?void 0:tt.quotes)),p.a.createElement("div",{className:h.a.more},p.a.createElement("span",{className:h.a.btnAdd,onClick:function(){return Qn(tt.id)}},"\u66FF\u6362"))))})):p.a.createElement(j.a,{size:"large",spinning:Ee["problemset/getItemBanks"]},p.a.createElement(o.a,null))),Ke!==0&&p.a.createElement(W.a,{showQuickJumper:!0,onChange:si,defaultCurrent:1,pageSize:Re==null?void 0:Re.per_page,current:Re.page||1,total:Ke,showTotal:function(et){return p.a.createElement("span",{className:"mr10"},"\u5171",p.a.createElement("span",{className:"c-light-primary"},et),"\u6761\u6570\u636E")}}))),p.a.createElement(_.a,{onOk:di})))};be.default=Object(m.a)(function(ee){var ye=ee.classroomList,pe=ee.problemset,ae=ee.user,se=ee.loading,_e=ee.globalSetting,te=ee.shixunHomeworks;return{classroomList:ye,problemset:pe,user:ae,globalSetting:_e,loading:se.effects,shixunHomeworks:te}})(fe)},LE3n:function(Ge,be,U){"use strict";var ue=U("ozfa"),W=U("MJZm"),R=U("k1fw"),N=U("+L6B"),S=U("2/Rp"),O=U("5NDa"),F=U("5rEg"),j=U("2qtc"),e=U("kLXV"),w=U("miYZ"),g=U("tsqr"),c=U("9og8"),u=U("tJVT"),a=U("WmNS"),i=U.n(a),d=U("q1tI"),s=U.n(d),r=U("1vnw"),n=U.n(r),t=U("ErOA"),v=U("Ix/O"),p=U.n(v),m=U("xTzM"),b=U.n(m),_=U("WCUW"),o=U("LvDl"),f=U.n(o),l=function(y){var T=y.isProblemset,L=y.name,D=y.id,x=y.itemBanksCount,P=y.onOpen,H=P===void 0?function(){}:P,I=y.onShare,z=I===void 0?function(){}:I,$=y.onMove,fe=$===void 0?function(){}:$,ee=y.onDeleteOk,ye=ee===void 0?function(){}:ee,pe=Object(d.useState)(!1),ae=Object(u.a)(pe,2),se=ae[0],_e=ae[1],te=Object(d.useState)(L),k=Object(u.a)(te,2),A=k[0],C=k[1],B=Object(d.useState)(L),K=Object(u.a)(B,2),M=K[0],ie=K[1],Ee=function(){var q=Object(c.a)(i.a.mark(function de(Te){var xe,Pe,Ne;return i.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:if(xe=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],M.trim()){Me.next=4;break}return g.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Me.abrupt("return");case 4:if(!(M.charAt(0)===" ")){Me.next=7;break}return g.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Me.abrupt("return");case 7:Pe=0;case 8:if(!(Pe<M.length)){Me.next=15;break}if(!xe.includes(M.charAt(Pe))){Me.next=12;break}return g.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),Me.abrupt("return",!1);case 12:Pe++,Me.next=8;break;case 15:return Me.next=17,Object(t.a)("/api/item_banks_groups/".concat(Math.abs(Te),".json"),{method:"put",body:{name:M}});case 17:Ne=Me.sent,Ne.status===0&&(_e(!1),C(M));case 19:case"end":return Me.stop()}},de)}));return function(Te){return q.apply(this,arguments)}}(),Oe=function(de){e.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:s.a.createElement("div",null,s.a.createElement("p",null,"\u672C\u6B21\u5220\u9664\u64CD\u4F5C\u786E\u5B9A\u540E\u5185\u5BB9\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F"),s.a.createElement("p",null,"\u5220\u9664\u6587\u4EF6\u5939\uFF0C\u5C06\u540C\u6B65\u5220\u9664\u5176\u6240\u5305\u542B\u7684\u5168\u90E8\u5B50\u6587\u4EF6\u5939\u548C\u8BD5\u9898\uFF0C\u8BF7\u614E\u91CD\u64CD\u4F5C\uFF01")),cancelText:"\u53D6\u6D88",onOk:function(){var Te=Object(c.a)(i.a.mark(function Pe(){var Ne;return i.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return Me.next=2,Object(t.a)("/api/item_banks_groups/".concat(Math.abs(de),".json"),{method:"delete",body:{}});case 2:Ne=Me.sent,Ne.status===0&&ye(de);case 4:case"end":return Me.stop()}},Pe)}));function xe(){return Te.apply(this,arguments)}return xe}()})};return s.a.createElement("div",{className:n.a.list},se?s.a.createElement(F.a,{style:{maxWidth:780},value:M,onChange:function(de){return ie(de.target.value)}}):s.a.createElement("div",{title:A,onClick:function(){return H(D)},className:n.a.name},A),T&&s.a.createElement("div",{className:n.a.btns},se?s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{style:{height:16},onClick:function(){return Ee(D)},className:"ml0"},s.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),s.a.createElement("div",{style:{height:16},onClick:function(){ie(A),_e(!1)},className:"ml10"},s.a.createElement("i",{className:"iconfont icon-qingchu"}))):s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{onClick:function(){return fe(D,"up")},className:"ml0"},s.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),s.a.createElement("div",{onClick:function(){return fe(D,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},s.a.createElement("i",{className:"iconfont icon-shangyi3"}))),s.a.createElement(S.a,{className:"ml10",onClick:function(){if(!x){g.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}z(Math.abs(D))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),s.a.createElement(S.a,{className:"ml10",onClick:function(){return _e(!0)},type:"link"},"\u91CD\u547D\u540D"),s.a.createElement(S.a,{onClick:function(){return Oe(D)},type:"link",danger:!0},"\u5220\u9664")))},h=function(y){var T=y.isProblemset,L=y.data,D=y.onOpen,x=D===void 0?function(){}:D,P=y.onShare,H=P===void 0?function(){}:P,I=y.reloadData,z=Object(d.useState)(),$=Object(u.a)(z,2),fe=$[0],ee=$[1];Object(d.useEffect)(function(){ee(L==null?void 0:L.map(function(A){return{title:s.a.createElement(l,{isProblemset:T,name:A.name,id:A.id,itemBanksCount:A.item_banks_count,onMove:pe,onOpen:x,onShare:H,onDeleteOk:se}),key:A.id,icon:s.a.createElement("img",{src:p.a,className:n.a.folderIcon}),isLeaf:!1}}))},[L]);var ye=function A(C,B,K){for(var M=Object(o.cloneDeep)(C),ie=0;ie<M.length;ie++){if(M[ie].key===B){if(K==="up"){var Ee=[M[ie],M[ie-1]];M[ie-1]=Ee[0],M[ie]=Ee[1]}else{var Oe=[M[ie+1],M[ie]];M[ie]=Oe[0],M[ie+1]=Oe[1]}break}M[ie].children&&(M[ie].children=A(M[ie].children,B,K))}return M},pe=function(){var A=Object(c.a)(i.a.mark(function C(B,K){var M;return i.a.wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:if(!(K==="up")){Ee.next=6;break}return Ee.next=3,Object(_.I)({id:Math.abs(B)});case 3:Ee.t0=Ee.sent,Ee.next=9;break;case 6:return Ee.next=8,Object(_.H)({id:Math.abs(B)});case 8:Ee.t0=Ee.sent;case 9:M=Ee.t0,M.status===0&&ee(function(Oe){return ye(Oe,B,K)});case 11:case"end":return Ee.stop()}},C)}));return function(B,K){return A.apply(this,arguments)}}(),ae=function A(C,B){return C.filter(function(K){return K.key===B?!1:(K.children&&(K.children=A(K.children,B)),!0)})},se=function(C){ee(function(B){return ae(B,C)}),I()},_e=function A(C,B,K){return C.map(function(M){return M.key===B?Object(R.a)(Object(R.a)({},M),K):M.children?Object(R.a)(Object(R.a)({},M),{},{children:A(M.children,B,K)}):M})},te=function(){var A=Object(c.a)(i.a.mark(function C(B){var K,M,ie,Ee,Oe;return i.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return K=B.key,de.next=3,Object(_.B)({group_id:Math.abs(K)});case 3:M=de.sent,ie=M||{},Ee=ie.item_banks_group,Oe=ie.item_banks_group_count,Oe>0?ee(function(Te){return _e(Te,K,{children:Ee.map(function(xe){return{title:s.a.createElement(l,{isProblemset:T,name:xe.name,id:xe.id,itemBanksCount:xe.item_banks_count,onMove:pe,onOpen:x,onShare:H,onDeleteOk:se}),key:xe.id,icon:s.a.createElement("img",{src:p.a,className:n.a.folderIcon}),isLeaf:!1}})})}):ee(function(Te){return _e(Te,K,{isLeaf:!0})});case 6:case"end":return de.stop()}},C)}));return function(B){return A.apply(this,arguments)}}(),k=function(C,B){var K=B.node,M=B.expanded;ee(function(ie){return _e(ie,K.key,{icon:M?s.a.createElement("img",{src:b.a,className:n.a.folderIcon}):s.a.createElement("img",{src:p.a,className:n.a.folderIcon})})})};return(fe==null?void 0:fe.length)>0&&s.a.createElement(W.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:fe,loadData:te,onExpand:k,className:n.a.folderWrapper,selectable:!1})};be.a=h},LdHM:function(Ge,be,U){"use strict";U.d(be,"b",function(){return t}),U.d(be,"a",function(){return p});var ue=U("1OyB"),W=U("vuIU"),R=U("Ji7U"),N=U("LK+K"),S=U("q1tI"),O=U("rePB"),F=U("Ff2n"),j=U("ODXe"),e=U("4IlW"),w=U("bX4T"),g=U("YrtM"),c=U("TSYQ"),u=U.n(c),a=U("+nKL"),i=U("8OUc"),d=function(z,$){var fe=z.prefixCls,ee=z.id,ye=z.flattenOptions,pe=z.childrenAsData,ae=z.values,se=z.searchValue,_e=z.multiple,te=z.defaultActiveFirstOption,k=z.height,A=z.itemHeight,C=z.notFoundContent,B=z.open,K=z.menuItemSelectedIcon,M=z.virtual,ie=z.onSelect,Ee=z.onToggleOpen,Oe=z.onActiveValue,q=z.onScroll,de=z.onMouseEnter,Te="".concat(fe,"-item"),xe=Object(g.a)(function(){return ye},[B,ye],function(V,G){return G[0]&&V[1]!==G[1]}),Pe=S.useRef(null),Ne=function(G){G.preventDefault()},Re=function(G){Pe.current&&Pe.current.scrollTo({index:G})},Me=function(G){for(var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,re=xe.length,X=0;X<re;X+=1){var Q=(G+X*Z+re)%re,oe=xe[Q],he=oe.group,De=oe.data;if(!he&&!De.disabled)return Q}return-1},He=S.useState(function(){return Me(0)}),We=Object(j.a)(He,2),Ke=We[0],Be=We[1],Ve=function(G){Be(G);var Z=xe[G];if(!Z){Oe(null,-1);return}Oe(Z.data.value,G)};S.useEffect(function(){Ve(te!==!1?Me(0):-1)},[xe.length,se]),S.useEffect(function(){var V=setTimeout(function(){if(!_e&&B&&ae.size===1){var G=Array.from(ae)[0],Z=xe.findIndex(function(re){var X=re.data;return X.value===G});Ve(Z),Re(Z)}});return function(){return clearTimeout(V)}},[B]);var Xe=function(G){G!==void 0&&ie(G,{selected:!ae.has(G)}),_e||Ee(!1)};if(S.useImperativeHandle($,function(){return{onKeyDown:function(G){var Z=G.which;switch(Z){case e.a.UP:case e.a.DOWN:{var re=0;if(Z===e.a.UP?re=-1:Z===e.a.DOWN&&(re=1),re!==0){var X=Me(Ke+re,re);Re(X),Ve(X)}break}case e.a.ENTER:{var Q=xe[Ke];Q&&!Q.data.disabled?Xe(Q.data.value):Xe(void 0),B&&G.preventDefault();break}case e.a.ESC:Ee(!1)}},onKeyUp:function(){},scrollTo:function(G){Re(G)}}}),xe.length===0)return S.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),className:"".concat(Te,"-empty"),onMouseDown:Ne},C);function ne(V){var G=xe[V];if(!G)return null;var Z=G.data||{},re=Z.value,X=Z.label,Q=Z.children,oe=Object(w.a)(Z,!0),he=pe?Q:X;return G?S.createElement("div",Object.assign({"aria-label":typeof he=="string"?he:null},oe,{key:V,role:"option",id:"".concat(ee,"_list_").concat(V),"aria-selected":ae.has(re)}),re):null}return S.createElement(S.Fragment,null,S.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},ne(Ke-1),ne(Ke),ne(Ke+1)),S.createElement(a.a,{itemKey:"key",ref:Pe,data:xe,height:k,itemHeight:A,fullHeight:!1,onMouseDown:Ne,onScroll:q,virtual:M,onMouseEnter:de},function(V,G){var Z,re=V.group,X=V.groupOption,Q=V.data,oe=Q.label,he=Q.key;if(re)return S.createElement("div",{className:u()(Te,"".concat(Te,"-group"))},oe!==void 0?oe:he);var De=Q.disabled,Ie=Q.value,Ue=Q.title,Ye=Q.children,Je=Q.style,Ze=Q.className,dt=Object(F.a)(Q,["disabled","value","title","children","style","className"]),at=ae.has(Ie),$e="".concat(Te,"-option"),Nt=u()(Te,$e,Ze,(Z={},Object(O.a)(Z,"".concat($e,"-grouped"),X),Object(O.a)(Z,"".concat($e,"-active"),Ke===G&&!De),Object(O.a)(Z,"".concat($e,"-disabled"),De),Object(O.a)(Z,"".concat($e,"-selected"),at),Z)),bt=pe?Ye:oe,Ut=!K||typeof K=="function"||at;return S.createElement("div",Object.assign({},dt,{"aria-selected":at,className:Nt,title:Ue,onMouseMove:function(){if(Ke===G||De)return;Ve(G)},onClick:function(){De||Xe(Ie)},style:Je}),S.createElement("div",{className:"".concat($e,"-content")},bt||Ie),S.isValidElement(K)||at,Ut&&S.createElement(i.a,{className:"".concat(Te,"-option-state"),customizeIcon:K,customizeIconProps:{isSelected:at}},at?"\u2713":null))}))},s=S.forwardRef(d);s.displayName="OptionList";var r=s,n=function(){return null};n.isSelectOption=!0;var t=n,v=function(){return null};v.isSelectOptGroup=!0;var p=v,m=U("VTBJ"),b=U("Zm9Q");function _(I){var z=I.key,$=I.props,fe=$.children,ee=$.value,ye=Object(F.a)($,["children","value"]);return Object(m.a)({key:z,value:ee!==void 0?ee:z,children:fe},ye)}function o(I){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(b.a)(I).map(function($,fe){if(!S.isValidElement($)||!$.type)return null;var ee=$.type.isSelectOptGroup,ye=$.key,pe=$.props,ae=pe.children,se=Object(F.a)(pe,["children"]);return z||!ee?_($):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(ye===null?fe:ye,"__"),label:ye},se),{},{options:o(ae)})}).filter(function($){return $})}var f=U("2Qr1"),l=U("qNPg"),h=U("U8pU"),E=U("Kwbf"),y=U("WKfj");function T(I){var z=I.mode,$=I.options,fe=I.children,ee=I.backfill,ye=I.allowClear,pe=I.placeholder,ae=I.getInputElement,se=I.showSearch,_e=I.onSearch,te=I.defaultOpen,k=I.autoFocus,A=I.labelInValue,C=I.value,B=I.inputValue,K=I.optionLabelProp,M=z==="multiple"||z==="tags",ie=se!==void 0?se:M||z==="combobox",Ee=$||o(fe);if(Object(E.a)(z!=="tags"||Ee.every(function(Te){return!Te.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),z==="tags"||z==="combobox"){var Oe=Ee.some(function(Te){return Te.options?Te.options.some(function(xe){return typeof("value"in xe?xe.value:xe.key)=="number"}):typeof("value"in Te?Te.value:Te.key)=="number"});Object(E.a)(!Oe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(z!=="combobox"||!K,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(z==="combobox"||!ee,"`backfill` only works with `combobox` mode."),Object(E.a)(z==="combobox"||!ae,"`getInputElement` only work with `combobox` mode."),Object(E.b)(z!=="combobox"||!ae||!ye||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),_e&&!ie&&z!=="combobox"&&z!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!te||k,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),C!=null){var q=Object(y.d)(C);Object(E.a)(!A||q.every(function(Te){return Object(h.a)(Te)==="object"&&("key"in Te||"value"in Te)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!M||Array.isArray(C),"`value` should be array when `mode` is `multiple` or `tags`")}if(fe){var de=null;Object(b.a)(fe).some(function(Te){if(!S.isValidElement(Te)||!Te.type)return!1;var xe=Te.type;if(xe.isSelectOption)return!1;if(xe.isSelectOptGroup){var Pe=Object(b.a)(Te.props.children).every(function(Ne){return!S.isValidElement(Ne)||!Te.type||Ne.type.isSelectOption?!0:(de=Ne.type,!1)});return!Pe}return de=xe,!0}),de&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(de.displayName||de.name||de,"`.")),Object(E.a)(B===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var L=T,D=Object(l.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:o,flattenOptions:f.d,getLabeledValue:f.e,filterOptions:f.b,isValueDisabled:f.g,findValueOption:f.c,warningProps:L,fillOptionsWithMissingValue:f.a}),x=function(I){Object(R.a)($,I);var z=Object(N.a)($);function $(){var fe;return Object(ue.a)(this,$),fe=z.apply(this,arguments),fe.selectRef=S.createRef(),fe.focus=function(){fe.selectRef.current.focus()},fe.blur=function(){fe.selectRef.current.blur()},fe}return Object(W.a)($,[{key:"render",value:function(){return S.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),$}(S.Component);x.Option=t,x.OptGroup=p;var P=x,H=be.c=P},MI8n:function(Ge,be,U){"use strict";U.d(be,"c",function(){return S}),U.d(be,"b",function(){return e}),U.d(be,"e",function(){return w}),U.d(be,"a",function(){return g}),U.d(be,"d",function(){return c}),U.d(be,"f",function(){return u});var ue=U("/cxE"),W=U("pmY6"),R=U("24hK"),N=U("5Y4S"),S;(function(a){a.None=()=>W.a.None;function i(T){return(L,D=null,x)=>{let P=!1,H;return H=T(I=>P?void 0:(H?H.dispose():P=!0,L.call(D,I)),null,x),P&&H.dispose(),H}}a.once=i;function d(T,L){return p((D,x=null,P)=>T(H=>D.call(x,L(H)),null,P))}a.map=d;function s(T,L){return p((D,x=null,P)=>T(H=>{L(H),D.call(x,H)},null,P))}a.forEach=s;function r(T,L){return p((D,x=null,P)=>T(H=>L(H)&&D.call(x,H),null,P))}a.filter=r;function n(T){return T}a.signal=n;function t(...T){return(L,D=null,x)=>Object(W.e)(...T.map(P=>P(H=>L.call(D,H),null,x)))}a.any=t;function v(T,L,D){let x=D;return d(T,P=>(x=L(x,P),x))}a.reduce=v;function p(T){let L;const D=new e({onFirstListenerAdd(){L=T(D.fire,D)},onLastListenerRemove(){L.dispose()}});return D.event}function m(T,L,D=100,x=!1,P){let H,I,z,$=0;const fe=new e({leakWarningThreshold:P,onFirstListenerAdd(){H=T(ee=>{$++,I=L(I,ee),x&&!z&&(fe.fire(I),I=void 0),clearTimeout(z),z=setTimeout(()=>{const ye=I;I=void 0,z=void 0,(!x||$>1)&&fe.fire(ye),$=0},D)})},onLastListenerRemove(){H.dispose()}});return fe.event}a.debounce=m;function b(T,L=(D,x)=>D===x){let D=!0,x;return r(T,P=>{const H=D||!L(P,x);return D=!1,x=P,H})}a.latch=b;function _(T,L){return[a.filter(T,L),a.filter(T,D=>!L(D))]}a.split=_;function o(T,L=!1,D=[]){let x=D.slice(),P=T(z=>{x?x.push(z):I.fire(z)});const H=()=>{x&&x.forEach(z=>I.fire(z)),x=null},I=new e({onFirstListenerAdd(){P||(P=T(z=>I.fire(z)))},onFirstListenerDidAdd(){x&&(L?setTimeout(H):H())},onLastListenerRemove(){P&&P.dispose(),P=null}});return I.event}a.buffer=o;class f{constructor(T){this.event=T}map(T){return new f(d(this.event,T))}forEach(T){return new f(s(this.event,T))}filter(T){return new f(r(this.event,T))}reduce(T,L){return new f(v(this.event,T,L))}latch(){return new f(b(this.event))}debounce(T,L=100,D=!1,x){return new f(m(this.event,T,L,D,x))}on(T,L,D){return this.event(T,L,D)}once(T,L,D){return i(this.event)(T,L,D)}}function l(T){return new f(T)}a.chain=l;function h(T,L,D=x=>x){const x=(...z)=>I.fire(D(...z)),P=()=>T.on(L,x),H=()=>T.removeListener(L,x),I=new e({onFirstListenerAdd:P,onLastListenerRemove:H});return I.event}a.fromNodeEventEmitter=h;function E(T,L,D=x=>x){const x=(...z)=>I.fire(D(...z)),P=()=>T.addEventListener(L,x),H=()=>T.removeEventListener(L,x),I=new e({onFirstListenerAdd:P,onLastListenerRemove:H});return I.event}a.fromDOMEventEmitter=E;function y(T){return new Promise(L=>i(T)(L))}a.toPromise=y})(S||(S={}));class O{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${O._idPool++}`}start(a){this._stopWatch=new N.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}O._idPool=0;let F=-1;class j{constructor(a,i=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=i,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let i=F;if(typeof this.customThreshold=="number"&&(i=this.customThreshold),i<=0||a<i)return;this._stacks||(this._stacks=new Map);const d=new Error().stack.split(`
`).slice(3).join(`
`),s=this._stacks.get(d)||0;if(this._stacks.set(d,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let r,n=0;for(const[t,v]of this._stacks)(!r||n<v)&&(r=t,n=v);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${n}):`),console.warn(r)}return()=>{const r=this._stacks.get(d)||0;this._stacks.set(d,r-1)}}}class e{constructor(a){var i;this._disposed=!1,this._options=a,this._leakageMon=F>0?new j(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((i=this._options)===null||i===void 0?void 0:i._profName)?new O(this._options._profName):void 0}get event(){return this._event||(this._event=(a,i,d)=>{var s;this._listeners||(this._listeners=new R.a);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const n=this._listeners.push(i?[a,i]:a);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,i);const t=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),v=Object(W.i)(()=>{if(t&&t(),!this._disposed&&(n(),this._options&&this._options.onLastListenerRemove)){const p=this._listeners&&!this._listeners.isEmpty();p||this._options.onLastListenerRemove(this)}});return d instanceof W.b?d.add(v):Array.isArray(d)&&d.push(v),v}),this._event}fire(a){var i,d;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new R.a);for(let s of this._listeners)this._deliveryQueue.push([s,a]);for((i=this._perfMon)===null||i===void 0||i.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,r]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,r):s[0].call(s[1],r)}catch(n){Object(ue.f)(n)}}(d=this._perfMon)===null||d===void 0||d.stop()}}dispose(){var a,i,d,s,r;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(i=this._deliveryQueue)===null||i===void 0||i.clear(),(s=(d=this._options)===null||d===void 0?void 0:d.onLastListenerRemove)===null||s===void 0||s.call(d),(r=this._leakageMon)===null||r===void 0||r.dispose())}}class w extends e{constructor(a){super(a);this._isPaused=0,this._eventQueue=new R.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class g extends w{constructor(a){var i;super(a);this._delay=(i=a.delay)!==null&&i!==void 0?i:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class c{constructor(){this.buffers=[]}wrapEvent(a){return(i,d,s)=>a(r=>{const n=this.buffers[this.buffers.length-1];n?n.push(()=>i.call(d,r)):i.call(d,r)},void 0,s)}bufferEvents(a){const i=[];this.buffers.push(i);const d=a();return this.buffers.pop(),i.forEach(s=>s()),d}}class u{constructor(){this.listening=!1,this.inputEvent=S.None,this.inputEventListener=W.a.None,this.emitter=new e({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Ge,be,U){"use strict";(function(ue,W){U.d(be,"b",function(){return d}),U.d(be,"i",function(){return t}),U.d(be,"f",function(){return v}),U.d(be,"d",function(){return p}),U.d(be,"g",function(){return m}),U.d(be,"h",function(){return b}),U.d(be,"c",function(){return _}),U.d(be,"k",function(){return o}),U.d(be,"j",function(){return f}),U.d(be,"a",function(){return l}),U.d(be,"e",function(){return y});var R;const N="en";let S=!1,O=!1,F=!1,j=!1,e=!1,w=!1,g=!1,c,u=N,a,i;const d=typeof self=="object"?self:typeof ue=="object"?ue:{};let s;typeof d.vscode!="undefined"&&typeof d.vscode.process!="undefined"?s=d.vscode.process:typeof W!="undefined"&&(s=W);const r=typeof((R=s==null?void 0:s.versions)===null||R===void 0?void 0:R.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!r)i=navigator.userAgent,S=i.indexOf("Windows")>=0,O=i.indexOf("Macintosh")>=0,g=(i.indexOf("Macintosh")>=0||i.indexOf("iPad")>=0||i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,F=i.indexOf("Linux")>=0,w=!0,c=navigator.language,u=c;else if(typeof s=="object"){S=s.platform==="win32",O=s.platform==="darwin",F=s.platform==="linux",j=F&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,c=N,u=N;const T=s.env.VSCODE_NLS_CONFIG;if(T)try{const L=JSON.parse(T),D=L.availableLanguages["*"];c=L.locale,u=D||N,a=L._translationsConfigFile}catch(L){}e=!0}else console.error("Unable to resolve platform.");let n=0;O?n=1:S?n=3:F&&(n=2);const t=S,v=O,p=F,m=e,b=w,_=g,o=i,f=function(){if(d.setImmediate)return d.setImmediate.bind(d);if(typeof d.postMessage=="function"&&!d.importScripts){let D=[];d.addEventListener("message",P=>{if(P.data&&P.data.vscodeSetImmediateId)for(let H=0,I=D.length;H<I;H++){const z=D[H];if(z.id===P.data.vscodeSetImmediateId){D.splice(H,1),z.callback();return}}});let x=0;return P=>{const H=++x;D.push({id:H,callback:P}),d.postMessage({vscodeSetImmediateId:H},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const L=Promise.resolve();return D=>L.then(D)}(),l=O||g?2:S?1:3;let h=!0,E=!1;function y(){if(!E){E=!0;const T=new Uint8Array(2);T[0]=1,T[1]=2;const L=new Uint16Array(T.buffer);h=L[0]===(2<<8)+1}return h}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(Ge,be,U){"use strict";U.d(be,"C",function(){return ue}),U.d(be,"v",function(){return R}),U.d(be,"s",function(){return N}),U.d(be,"t",function(){return S}),U.d(be,"U",function(){return O}),U.d(be,"J",function(){return F}),U.d(be,"O",function(){return j}),U.d(be,"p",function(){return e}),U.d(be,"T",function(){return w}),U.d(be,"q",function(){return g}),U.d(be,"N",function(){return c}),U.d(be,"M",function(){return u}),U.d(be,"Q",function(){return a}),U.d(be,"u",function(){return i}),U.d(be,"x",function(){return d}),U.d(be,"I",function(){return s}),U.d(be,"f",function(){return r}),U.d(be,"h",function(){return n}),U.d(be,"g",function(){return t}),U.d(be,"i",function(){return v}),U.d(be,"G",function(){return p}),U.d(be,"H",function(){return m}),U.d(be,"r",function(){return b}),U.d(be,"R",function(){return _}),U.d(be,"d",function(){return o}),U.d(be,"e",function(){return f}),U.d(be,"E",function(){return l}),U.d(be,"F",function(){return h}),U.d(be,"j",function(){return E}),U.d(be,"z",function(){return y}),U.d(be,"K",function(){return L}),U.d(be,"L",function(){return D}),U.d(be,"m",function(){return P}),U.d(be,"k",function(){return I}),U.d(be,"A",function(){return $}),U.d(be,"a",function(){return fe}),U.d(be,"n",function(){return ee}),U.d(be,"l",function(){return ye}),U.d(be,"D",function(){return pe}),U.d(be,"B",function(){return ae}),U.d(be,"b",function(){return se}),U.d(be,"S",function(){return _e}),U.d(be,"o",function(){return te}),U.d(be,"P",function(){return k}),U.d(be,"w",function(){return A}),U.d(be,"c",function(){return C}),U.d(be,"y",function(){return M});function ue(q){return!q||typeof q!="string"?!0:q.trim().length===0}const W=/{(\d+)}/g;function R(q,...de){return de.length===0?q:q.replace(W,function(Te,xe){const Pe=parseInt(xe,10);return isNaN(Pe)||Pe<0||Pe>=de.length?Te:de[Pe]})}function N(q){return q.replace(/[<>&]/g,function(de){switch(de){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return de}})}function S(q){return q.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function O(q,de=" "){const Te=F(q,de);return j(Te,de)}function F(q,de){if(!q||!de)return q;const Te=de.length;if(Te===0||q.length===0)return q;let xe=0;for(;q.indexOf(de,xe)===xe;)xe=xe+Te;return q.substring(xe)}function j(q,de){if(!q||!de)return q;const Te=de.length,xe=q.length;if(Te===0||xe===0)return q;let Pe=xe,Ne=-1;for(;!(Ne=q.lastIndexOf(de,Pe-1),Ne===-1||Ne+Te!==Pe);){if(Ne===0)return"";Pe=Ne}return q.substring(0,Pe)}function e(q){return q.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function w(q){return q.replace(/\*/g,"")}function g(q,de,Te={}){if(!q)throw new Error("Cannot create regex from empty string");de||(q=S(q)),Te.wholeWord&&(/\B/.test(q.charAt(0))||(q="\\b"+q),/\B/.test(q.charAt(q.length-1))||(q=q+"\\b"));let xe="";return Te.global&&(xe+="g"),Te.matchCase||(xe+="i"),Te.multiline&&(xe+="m"),Te.unicode&&(xe+="u"),new RegExp(q,xe)}function c(q){if(q.source==="^"||q.source==="^$"||q.source==="$"||q.source==="^\\s*$")return!1;const de=q.exec("");return!!(de&&q.lastIndex===0)}function u(q){return(q.global?"g":"")+(q.ignoreCase?"i":"")+(q.multiline?"m":"")+(q.unicode?"u":"")}function a(q){return q.split(/\r\n|\r|\n/)}function i(q){for(let de=0,Te=q.length;de<Te;de++){const xe=q.charCodeAt(de);if(xe!==32&&xe!==9)return de}return-1}function d(q,de=0,Te=q.length){for(let xe=de;xe<Te;xe++){const Pe=q.charCodeAt(xe);if(Pe!==32&&Pe!==9)return q.substring(de,xe)}return q.substring(de,Te)}function s(q,de=q.length-1){for(let Te=de;Te>=0;Te--){const xe=q.charCodeAt(Te);if(xe!==32&&xe!==9)return Te}return-1}function r(q,de){return q<de?-1:q>de?1:0}function n(q,de,Te=0,xe=q.length,Pe=0,Ne=de.length){for(;Te<xe&&Pe<Ne;Te++,Pe++){let He=q.charCodeAt(Te),We=de.charCodeAt(Pe);if(He<We)return-1;if(He>We)return 1}const Re=xe-Te,Me=Ne-Pe;return Re<Me?-1:Re>Me?1:0}function t(q,de){return v(q,de,0,q.length,0,de.length)}function v(q,de,Te=0,xe=q.length,Pe=0,Ne=de.length){for(;Te<xe&&Pe<Ne;Te++,Pe++){let He=q.charCodeAt(Te),We=de.charCodeAt(Pe);if(He===We)continue;if(He>=128||We>=128)return n(q.toLowerCase(),de.toLowerCase(),Te,xe,Pe,Ne);p(He)&&(He-=32),p(We)&&(We-=32);const Ke=He-We;if(Ke===0)continue;return Ke}const Re=xe-Te,Me=Ne-Pe;return Re<Me?-1:Re>Me?1:0}function p(q){return q>=97&&q<=122}function m(q){return q>=65&&q<=90}function b(q,de){return q.length===de.length&&v(q,de)===0}function _(q,de){const Te=de.length;return de.length>q.length?!1:v(q,de,0,Te)===0}function o(q,de){let Te,xe=Math.min(q.length,de.length);for(Te=0;Te<xe;Te++)if(q.charCodeAt(Te)!==de.charCodeAt(Te))return Te;return xe}function f(q,de){let Te,xe=Math.min(q.length,de.length);const Pe=q.length-1,Ne=de.length-1;for(Te=0;Te<xe;Te++)if(q.charCodeAt(Pe-Te)!==de.charCodeAt(Ne-Te))return Te;return xe}function l(q){return 55296<=q&&q<=56319}function h(q){return 56320<=q&&q<=57343}function E(q,de){return(q-55296<<10)+(de-56320)+65536}function y(q,de,Te){const xe=q.charCodeAt(Te);if(l(xe)&&Te+1<de){const Pe=q.charCodeAt(Te+1);if(h(Pe))return E(xe,Pe)}return xe}function T(q,de){const Te=q.charCodeAt(de-1);if(h(Te)&&de>1){const xe=q.charCodeAt(de-2);if(l(xe))return E(xe,Te)}return Te}function L(q,de){const Te=B.getInstance(),xe=de,Pe=q.length,Ne=y(q,Pe,de);de+=Ne>=65536?2:1;let Re=Te.getGraphemeBreakType(Ne);for(;de<Pe;){const Me=y(q,Pe,de),He=Te.getGraphemeBreakType(Me);if(C(Re,He))break;de+=Me>=65536?2:1,Re=He}return de-xe}function D(q,de){const Te=B.getInstance(),xe=de,Pe=T(q,de);de-=Pe>=65536?2:1;let Ne=Te.getGraphemeBreakType(Pe);for(;de>0;){const Re=T(q,de),Me=Te.getGraphemeBreakType(Re);if(C(Me,Ne))break;de-=Re>=65536?2:1,Ne=Me}return xe-de}const x=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function P(q){return x.test(q)}const H=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function I(q){return H.test(q)}const z=/^[\t\n\r\x20-\x7E]*$/;function $(q){return z.test(q)}const fe=/[\u2028\u2029]/;function ee(q){return fe.test(q)}function ye(q){for(let de=0,Te=q.length;de<Te;de++)if(pe(q.charCodeAt(de)))return!0;return!1}function pe(q){return q=+q,q>=11904&&q<=55215||q>=63744&&q<=64255||q>=65281&&q<=65374}function ae(q){return q>=127462&&q<=127487||q===8986||q===8987||q===9200||q===9203||q>=9728&&q<=10175||q===11088||q===11093||q>=127744&&q<=128591||q>=128640&&q<=128764||q>=128992&&q<=129003||q>=129280&&q<=129535||q>=129648&&q<=129750}const se=String.fromCharCode(65279);function _e(q){return!!(q&&q.length>0&&q.charCodeAt(0)===65279)}function te(q,de=!1){return q?(de&&(q=q.replace(/\\./g,"")),q.toLowerCase()!==q):!1}function k(q){const de=90-65+1;return q=q%(2*de),q<de?String.fromCharCode(97+q):String.fromCharCode(65+q-de)}function A(q){const de=B.getInstance();return de.getGraphemeBreakType(q)}function C(q,de){return q===0?de!==5&&de!==7:q===2&&de===3?!1:q===4||q===2||q===3||(de===4||de===2||de===3)?!0:q===8&&(de===8||de===9||de===11||de===12)||((q===11||q===9)&&(de===9||de===10)||((q===12||q===10)&&de===10||(de===5||de===13||(de===7||(q===1||q===13&&de===14)))))?!1:!(q===6&&de===6)}class B{constructor(){this._data=K()}static getInstance(){return B._INSTANCE||(B._INSTANCE=new B),B._INSTANCE}getGraphemeBreakType(q){if(q<32)return q===10?3:q===13?2:4;if(q<127)return 0;const de=this._data,Te=de.length/3;let xe=1;for(;xe<=Te;)if(q<de[3*xe])xe=2*xe;else if(q>de[3*xe+1])xe=2*xe+1;else return de[3*xe+2];return 0}}B._INSTANCE=null;function K(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function M(q,de){if(q===0)return 0;const Te=ie(q,de);if(Te!==void 0)return Te;const xe=T(de,q);return q-=Ee(xe),q}function ie(q,de){let Te=T(de,q);for(q-=Ee(Te);Oe(Te)||Te===65039||Te===8419;){if(q===0)return;Te=T(de,q),q-=Ee(Te)}if(!ae(Te))return;if(q>=0){const xe=T(de,q);xe===8205&&(q-=Ee(xe))}return q}function Ee(q){return q>=65536?2:1}function Oe(q){return 127995<=q&&q<=127999}},NvD2:function(Ge,be,U){"use strict";U.d(be,"a",function(){return O});var ue=U("Kwbf");function W(F,j){var e=new Set;return F.forEach(function(w){j.has(w)||e.add(w)}),e}function R(F){var j=F||{},e=j.disabled,w=j.disableCheckbox,g=j.checkable;return!!(e||w)||g===!1}function N(F,j,e,w){for(var g=new Set(F),c=new Set,u=0;u<=e;u+=1){var a=j.get(u)||new Set;a.forEach(function(r){var n=r.key,t=r.node,v=r.children,p=v===void 0?[]:v;g.has(n)&&!w(t)&&p.filter(function(m){return!w(m.node)}).forEach(function(m){g.add(m.key)})})}for(var i=new Set,d=e;d>=0;d-=1){var s=j.get(d)||new Set;s.forEach(function(r){var n=r.parent,t=r.node;if(w(t)||!r.parent||i.has(r.parent.key))return;if(w(r.parent.node)){i.add(n.key);return}var v=!0,p=!1;(n.children||[]).filter(function(m){return!w(m.node)}).forEach(function(m){var b=m.key,_=g.has(b);v&&!_&&(v=!1),!p&&(_||c.has(b))&&(p=!0)}),v&&g.add(n.key),p&&c.add(n.key),i.add(n.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(W(c,g))}}function S(F,j,e,w,g){for(var c=new Set(F),u=new Set(j),a=0;a<=w;a+=1){var i=e.get(a)||new Set;i.forEach(function(n){var t=n.key,v=n.node,p=n.children,m=p===void 0?[]:p;!c.has(t)&&!u.has(t)&&!g(v)&&m.filter(function(b){return!g(b.node)}).forEach(function(b){c.delete(b.key)})})}u=new Set;for(var d=new Set,s=w;s>=0;s-=1){var r=e.get(s)||new Set;r.forEach(function(n){var t=n.parent,v=n.node;if(g(v)||!n.parent||d.has(n.parent.key))return;if(g(n.parent.node)){d.add(t.key);return}var p=!0,m=!1;(t.children||[]).filter(function(b){return!g(b.node)}).forEach(function(b){var _=b.key,o=c.has(_);p&&!o&&(p=!1),!m&&(o||u.has(_))&&(m=!0)}),p||c.delete(t.key),m&&u.add(t.key),d.add(t.key)})}return{checkedKeys:Array.from(c),halfCheckedKeys:Array.from(W(u,c))}}function O(F,j,e,w){var g=[],c;w?c=w:c=R;var u=new Set(F.filter(function(s){var r=!!e[s];return r||g.push(s),r})),a=new Map,i=0;Object.keys(e).forEach(function(s){var r=e[s],n=r.level,t=a.get(n);t||(t=new Set,a.set(n,t)),t.add(r),i=Math.max(i,n)}),Object(ue.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(s){return"'".concat(s,"'")}).join(", ")));var d;return j===!0?d=N(u,a,i,c):d=S(u,j.halfCheckedKeys,a,i,c),d}},OZM5:function(Ge,be,U){"use strict";U.d(be,"b",function(){return w}),U.d(be,"a",function(){return g}),U.d(be,"k",function(){return c}),U.d(be,"h",function(){return u}),U.d(be,"i",function(){return a}),U.d(be,"g",function(){return i}),U.d(be,"c",function(){return d}),U.d(be,"d",function(){return s}),U.d(be,"j",function(){return t}),U.d(be,"e",function(){return v}),U.d(be,"f",function(){return p});var ue=U("KQm4"),W=U("U8pU"),R=U("Ff2n"),N=U("q1tI"),S=U.n(N),O=U("Kwbf"),F=U("WaYH"),j=.25,e=2;function w(m,b){var _=m.slice(),o=_.indexOf(b);return o>=0&&_.splice(o,1),_}function g(m,b){var _=m.slice();return _.indexOf(b)===-1&&_.push(b),_}function c(m){return m.split("-")}function u(m,b){return"".concat(m,"-").concat(b)}function a(m){return m&&m.type&&m.type.isTreeNode}function i(m,b){var _=[m],o=b[m];function f(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];l.forEach(function(h){var E=h.key,y=h.children;_.push(E),f(y)})}return f(o.children),_}function d(m,b){var _=m.clientY,o=b.selectHandle.getBoundingClientRect(),f=o.top,l=o.bottom,h=o.height,E=Math.max(h*j,e);return _<=f+E?-1:_>=l-E?1:0}function s(m,b){if(!m)return;var _=b.multiple;return _?m.slice():m.length?[m[0]]:m}var r=function(b){return b};function n(m,b){if(!m)return[];var _=b||{},o=_.processProps,f=o===void 0?r:o,l=Array.isArray(m)?m:[m];return l.map(function(h){var E=h.children,y=Object(R.a)(h,["children"]),T=n(E,b);return S.a.createElement(F.a,Object.assign({},f(y)),T)})}function t(m){if(!m)return null;var b;if(Array.isArray(m))b={checkedKeys:m,halfCheckedKeys:void 0};else if(Object(W.a)(m)==="object")b={checkedKeys:m.checked||void 0,halfCheckedKeys:m.halfChecked||void 0};else return Object(O.a)(!1,"`checkedKeys` is not an array or an object"),null;return b}function v(m,b){var _=new Set;function o(f){if(_.has(f))return;var l=b[f];if(!l)return;_.add(f);var h=l.parent,E=l.node;if(E.disabled)return;h&&o(h.key)}return(m||[]).forEach(function(f){o(f)}),Object(ue.a)(_)}function p(m){var b={};return Object.keys(m).forEach(function(_){(_.startsWith("data-")||_.startsWith("aria-"))&&(b[_]=m[_])}),b}},"P/tu":function(Ge,be,U){"use strict";var ue=U("ozfa"),W=U("MJZm"),R=U("0Owb"),N=U("9og8"),S=U("tJVT"),O=U("PpiC"),F=U("WmNS"),j=U.n(F),e=U("q1tI"),w=U.n(e),g=U("WCUW"),c=U("spXi"),u=U.n(c),a=function(d){var s=d.value,r=d.onChange,n=d.defaultValue,t=d.disabled,v=Object(O.a)(d,["value","onChange","defaultValue","disabled"]),p=Object(e.useState)([]),m=Object(S.a)(p,2),b=m[0],_=m[1],o=Object(e.useState)("1"),f=Object(S.a)(o,2),l=f[0],h=f[1];Object(e.useEffect)(function(){E()},[]);var E=function(){var L=Object(N.a)(j.a.mark(function D(){var x,P;return j.a.wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,Object(g.A)({});case 2:x=I.sent,x!=null&&x.data&&(P=[{title:w.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:u.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:w.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:y(x.data||[])}],_(P),h("2"));case 4:case"end":return I.stop()}},D)}));return function(){return L.apply(this,arguments)}}(),y=function(D){function x(P){var H=P.children,I=Array.isArray(H)&&H.length>0,z=P==null?void 0:P.group_id;return{title:w.a.createElement("div",{title:P==null?void 0:P.name,className:u.a.name},P==null?void 0:P.name),value:z,key:z,icon:w.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:I?H==null?void 0:H.map(function($){return x($)}):[]}}return D==null?void 0:D.map(function(P){return x(P)})},T=n?{defaultExpandedKeys:[0]}:{selectedKeys:s,defaultExpandedKeys:s};return w.a.createElement("div",{className:u.a.customTree},w.a.createElement(W.a,Object(R.a)({key:l},T,{showIcon:!0,treeData:b,onSelect:r,disabled:t},v)))};be.a=a},Q0Vu:function(Ge,be,U){Ge.exports={flex_box_center:"flex_box_center___3fHaw",flex_space_between:"flex_space_between___1tu3K",flex_box_vertical_center:"flex_box_vertical_center___3kmTT",flex_box_center_end:"flex_box_center_end___19OcD",flex_box_column:"flex_box_column___1aMoy",main:"main___JkLSb",wrap:"wrap___1k_Ib",content:"content___1by-P",programName:"programName___1mMSD",name:"name___2mlTd",directionContentWrap:"directionContentWrap___3qsxQ",directionItem:"directionItem___2aAvu",active:"active___ACZqb",subActive:"subActive___2RkoB",subItem:"subItem___3tJgX",subMenu:"subMenu___Y_7S_",action:"action___xqgFs"}},SAoR:function(Ge,be,U){"use strict";var ue=U("Q9mQ"),W=U("diRs"),R=U("q1tI"),N=U.n(R),S=U("+z73"),O=U.n(S),F=function(e){var w=e.data,g=w===void 0?[]:w,c=e.onClick,u=function(){return g.map(function(d,s){return N.a.createElement("div",{key:s,className:O.a.few},N.a.createElement("b",{title:d.name,style:{color:s===0?"#333333":"#999999"},onClick:function(){return c(d.id)}},d.name),s<g.length-1&&N.a.createElement("span",null,"/"))})},a=function(){var d=!0,s=g.slice(2,-2),r=N.a.createElement("div",{className:O.a.pWrap},s.map(function(n){return N.a.createElement("span",{title:n.name,onClick:function(){return c(n.id)},key:n.id},n.name)}));return g.map(function(n,t){var v=null;return t>1&&t<g.length-2?d&&(v=N.a.createElement(W.a,{key:t,placement:"bottom",content:r},N.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),d=!1):v=N.a.createElement("div",{key:t,className:O.a.few},N.a.createElement("b",{title:n.name,style:{color:t===0?"#333333":"#999999"},onClick:function(){return c(n.id)}},n.name),t<g.length-1&&N.a.createElement("span",null,"/")),v})};return N.a.createElement("aside",{style:{overflowX:"auto"}},(g==null?void 0:g.length)>5?a():u())};be.a=F},SJMd:function(Ge,be){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var U,ue,W,R=!1,N,S;window.PR_SHOULD_USE_CONTINUATION=!0;var O,F;(function(){var j=window,e=["break,continue,do,else,for,if,return,while"],w=[e,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[w,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],c=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],u=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],i="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",d=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",r=[e,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],n=[e,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],t=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[c,a,u,d,s,r,n,t],p=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",b="kwd",_="com",o="typ",f="lit",l="pun",h="pln",E="tag",y="dec",T="src",L="atn",D="atv",x="nocode",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function H(ie){for(var Ee=0,Oe=!1,q=!1,de=0,Te=ie.length;de<Te;++de){var xe=ie[de];if(xe.ignoreCase)q=!0;else if(/[a-z]/i.test(xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Oe=!0,q=!1;break}}var Pe={b:8,t:9,n:10,v:11,f:12,r:13};function Ne(Ke){var Be=Ke.charCodeAt(0);if(Be!==92)return Be;var Ve=Ke.charAt(1);return Be=Pe[Ve],Be||("0"<=Ve&&Ve<="7"?parseInt(Ke.substring(1),8):Ve==="u"||Ve==="x"?parseInt(Ke.substring(2),16):Ke.charCodeAt(1))}function Re(Ke){if(Ke<32)return(Ke<16?"\\x0":"\\x")+Ke.toString(16);var Be=String.fromCharCode(Ke);return Be==="\\"||Be==="-"||Be==="]"||Be==="^"?"\\"+Be:Be}function Me(Ke){var Be=Ke.substring(1,Ke.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Ve=[],Xe=Be[0]==="^",ne=["["];Xe&&ne.push("^");for(var V=Xe?1:0,G=Be.length;V<G;++V){var Z=Be[V];if(/\\[bdsw]/i.test(Z))ne.push(Z);else{var re=Ne(Z),X;V+2<G&&Be[V+1]==="-"?(X=Ne(Be[V+2]),V+=2):X=re,Ve.push([re,X]),X<65||re>122||(X<65||re>90||Ve.push([Math.max(65,re)|32,Math.min(X,90)|32]),X<97||re>122||Ve.push([Math.max(97,re)&~32,Math.min(X,122)&~32]))}}Ve.sort(function(De,Ie){return De[0]-Ie[0]||Ie[1]-De[1]});for(var Q=[],oe=[],V=0;V<Ve.length;++V){var he=Ve[V];he[0]<=oe[1]+1?oe[1]=Math.max(oe[1],he[1]):Q.push(oe=he)}for(var V=0;V<Q.length;++V){var he=Q[V];ne.push(Re(he[0])),he[1]>he[0]&&(he[1]+1>he[0]&&ne.push("-"),ne.push(Re(he[1])))}return ne.push("]"),ne.join("")}function He(Ke){for(var Be=Ke.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Ve=Be.length,Xe=[],ne=0,V=0;ne<Ve;++ne){var G=Be[ne];if(G==="(")++V;else if(G.charAt(0)==="\\"){var Z=+G.substring(1);Z&&(Z<=V?Xe[Z]=-1:Be[ne]=Re(Z))}}for(var ne=1;ne<Xe.length;++ne)Xe[ne]===-1&&(Xe[ne]=++Ee);for(var ne=0,V=0;ne<Ve;++ne){var G=Be[ne];if(G==="(")++V,Xe[V]||(Be[ne]="(?:");else if(G.charAt(0)==="\\"){var Z=+G.substring(1);Z&&Z<=V&&(Be[ne]="\\"+Xe[Z])}}for(var ne=0;ne<Ve;++ne)Be[ne]==="^"&&Be[ne+1]!=="^"&&(Be[ne]="");if(Ke.ignoreCase&&Oe)for(var ne=0;ne<Ve;++ne){var G=Be[ne],re=G.charAt(0);G.length>=2&&re==="["?Be[ne]=Me(G):re!=="\\"&&(Be[ne]=G.replace(/[a-zA-Z]/g,function(oe){var he=oe.charCodeAt(0);return"["+String.fromCharCode(he&~32,he|32)+"]"}))}return Be.join("")}for(var We=[],de=0,Te=ie.length;de<Te;++de){var xe=ie[de];if(xe.global||xe.multiline)throw new Error(""+xe);We.push("(?:"+He(xe)+")")}return new RegExp(We.join("|"),q?"gi":"g")}function I(ie,Ee){var Oe=/(?:^|\s)nocode(?:\s|$)/,q=[],de=0,Te=[],xe=0;function Pe(Ne){var Re=Ne.nodeType;if(Re==1){if(Oe.test(Ne.className))return;for(var Me=Ne.firstChild;Me;Me=Me.nextSibling)Pe(Me);var He=Ne.nodeName.toLowerCase();(He==="br"||He==="li")&&(q[xe]=`
`,Te[xe<<1]=de++,Te[xe++<<1|1]=Ne)}else if(Re==3||Re==4){var We=Ne.nodeValue;We.length&&(Ee?We=We.replace(/\r\n?/g,`
`):We=We.replace(/[ \t\r\n]+/g," "),q[xe]=We,Te[xe<<1]=de,de+=We.length,Te[xe++<<1|1]=Ne)}}return Pe(ie),{sourceCode:q.join("").replace(/\n$/,""),spans:Te}}function z(ie,Ee,Oe,q,de){if(!Oe)return;var Te={sourceNode:ie,pre:1,langExtension:null,numberLines:null,sourceCode:Oe,spans:null,basePos:Ee,decorations:null};q(Te),de.push.apply(de,Te.decorations)}var $=/\S/;function fe(ie){for(var Ee=void 0,Oe=ie.firstChild;Oe;Oe=Oe.nextSibling){var q=Oe.nodeType;Ee=q===1?Ee?ie:Oe:q===3&&$.test(Oe.nodeValue)?ie:Ee}return Ee===ie?void 0:Ee}function ee(ie,Ee){var Oe={},q;(function(){for(var xe=ie.concat(Ee),Pe=[],Ne={},Re=0,Me=xe.length;Re<Me;++Re){var He=xe[Re],We=He[3];if(We)for(var Ke=We.length;--Ke>=0;)Oe[We.charAt(Ke)]=He;var Be=He[1],Ve=""+Be;Ne.hasOwnProperty(Ve)||(Pe.push(Be),Ne[Ve]=null)}Pe.push(/[\0-\uffff]/),q=H(Pe)})();var de=Ee.length,Te=function(xe){for(var Pe=xe.sourceCode,Ne=xe.basePos,Re=xe.sourceNode,Me=[Ne,h],He=0,We=Pe.match(q)||[],Ke={},Be=0,Ve=We.length;Be<Ve;++Be){var Xe=We[Be],ne=Ke[Xe],V=void 0,G;if(typeof ne=="string")G=!1;else{var Z=Oe[Xe.charAt(0)];if(Z)V=Xe.match(Z[1]),ne=Z[0];else{for(var re=0;re<de;++re)if(Z=Ee[re],V=Xe.match(Z[1]),V){ne=Z[0];break}V||(ne=h)}G=ne.length>=5&&ne.substring(0,5)==="lang-",G&&!(V&&typeof V[1]=="string")&&(G=!1,ne=T),G||(Ke[Xe]=ne)}var X=He;if(He+=Xe.length,!G)Me.push(Ne+X,ne);else{var Q=V[1],oe=Xe.indexOf(Q),he=oe+Q.length;V[2]&&(he=Xe.length-V[2].length,oe=he-Q.length);var De=ne.substring(5);z(Re,Ne+X,Xe.substring(0,oe),Te,Me),z(Re,Ne+X+oe,Q,k(De,Q),Me),z(Re,Ne+X+he,Xe.substring(he),Te,Me)}}xe.decorations=Me};return Te}function ye(ie){var Ee=[],Oe=[];ie.tripleQuotedStrings?Ee.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ie.multiLineStrings?Ee.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ee.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ie.verbatimStrings&&Oe.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var q=ie.hashComments;q&&(ie.cStyleComments?(q>1?Ee.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ee.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Oe.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ee.push([_,/^#[^\r\n]*/,null,"#"])),ie.cStyleComments&&(Oe.push([_,/^\/\/[^\r\n]*/,null]),Oe.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var de=ie.regexLiterals;if(de){var Te=de>1?"":`
\r`,xe=Te?".":"[\\S\\s]",Pe="/(?=[^/*"+Te+"])(?:[^/\\x5B\\x5C"+Te+"]|\\x5C"+xe+"|\\x5B(?:[^\\x5C\\x5D"+Te+"]|\\x5C"+xe+")*(?:\\x5D|$))+/";Oe.push(["lang-regex",RegExp("^"+P+"("+Pe+")")])}var Ne=ie.types;Ne&&Oe.push([o,Ne]);var Re=(""+ie.keywords).replace(/^ | $/g,"");Re.length&&Oe.push([b,new RegExp("^(?:"+Re.replace(/[\s,]+/g,"|")+")\\b"),null]),Ee.push([h,/^\s+/,null,` \r
\xA0`]);var Me="^.[^\\s\\w.$@'\"`/\\\\]*";return ie.regexLiterals&&(Me+="(?!s*/)"),Oe.push([f,/^@[a-z_$][a-z_$@0-9]*/i,null],[o,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[f,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[l,new RegExp(Me),null]),ee(Ee,Oe)}var pe=ye({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ae(ie,Ee,Oe){for(var q=/(?:^|\s)nocode(?:\s|$)/,de=/\r\n?|\n/,Te=ie.ownerDocument,xe=Te.createElement("li");ie.firstChild;)xe.appendChild(ie.firstChild);var Pe=[xe];function Ne(Be){var Ve=Be.nodeType;if(Ve==1&&!q.test(Be.className))if(Be.nodeName==="br")Re(Be),Be.parentNode&&Be.parentNode.removeChild(Be);else for(var Xe=Be.firstChild;Xe;Xe=Xe.nextSibling)Ne(Xe);else if((Ve==3||Ve==4)&&Oe){var ne=Be.nodeValue,V=ne.match(de);if(V){var G=ne.substring(0,V.index);Be.nodeValue=G;var Z=ne.substring(V.index+V[0].length);if(Z){var re=Be.parentNode;re.insertBefore(Te.createTextNode(Z),Be.nextSibling)}Re(Be),G||Be.parentNode.removeChild(Be)}}}function Re(Be){for(;!Be.nextSibling;)if(Be=Be.parentNode,!Be)return;function Ve(V,G){var Z=G?V.cloneNode(!1):V,re=V.parentNode;if(re){var X=Ve(re,1),Q=V.nextSibling;X.appendChild(Z);for(var oe=Q;oe;oe=Q)Q=oe.nextSibling,X.appendChild(oe)}return Z}for(var Xe=Ve(Be.nextSibling,0),ne;(ne=Xe.parentNode)&&ne.nodeType===1;)Xe=ne;Pe.push(Xe)}for(var Me=0;Me<Pe.length;++Me)Ne(Pe[Me]);Ee===(Ee|0)&&Pe[0].setAttribute("value",Ee);var He=Te.createElement("ol");He.className="linenums";for(var We=Math.max(0,Ee-1|0)||0,Me=0,Ke=Pe.length;Me<Ke;++Me)xe=Pe[Me],xe.className="L"+(Me+We)%10,xe.firstChild||xe.appendChild(Te.createTextNode("\xA0")),He.appendChild(xe);ie.appendChild(He)}function se(ie){var Ee=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ee=Ee&&+Ee[1]<=8;var Oe=/\n/g,q=ie.sourceCode,de=q.length,Te=0,xe=ie.spans,Pe=xe.length,Ne=0,Re=ie.decorations,Me=Re.length,He=0;Re[Me]=de;var We,Ke;for(Ke=We=0;Ke<Me;)Re[Ke]!==Re[Ke+2]?(Re[We++]=Re[Ke++],Re[We++]=Re[Ke++]):Ke+=2;for(Me=We,Ke=We=0;Ke<Me;){for(var Be=Re[Ke],Ve=Re[Ke+1],Xe=Ke+2;Xe+2<=Me&&Re[Xe+1]===Ve;)Xe+=2;Re[We++]=Be,Re[We++]=Ve,Ke=Xe}Me=Re.length=We;var ne=ie.sourceNode,V="";ne&&(V=ne.style.display,ne.style.display="none");try{for(var G=null;Ne<Pe;){var Z=xe[Ne],re=xe[Ne+2]||de,X=Re[He+2]||de,Xe=Math.min(re,X),Q=xe[Ne+1],oe;if(Q.nodeType!==1&&(oe=q.substring(Te,Xe))){Ee&&(oe=oe.replace(Oe,"\r")),Q.nodeValue=oe;var he=Q.ownerDocument,De=he.createElement("span");De.className=Re[He+1];var Ie=Q.parentNode;Ie.replaceChild(De,Q),De.appendChild(Q),Te<re&&(xe[Ne+1]=Q=he.createTextNode(q.substring(Xe,re)),Ie.insertBefore(Q,De.nextSibling))}Te=Xe,Te>=re&&(Ne+=2),Te>=X&&(He+=2)}}finally{ne&&(ne.style.display=V)}}var _e={};function te(ie,Ee){for(var Oe=Ee.length;--Oe>=0;){var q=Ee[Oe];_e.hasOwnProperty(q)?j.console&&console.warn("cannot override language handler %s",q):_e[q]=ie}}function k(ie,Ee){return ie&&_e.hasOwnProperty(ie)||(ie=/^\s*</.test(Ee)?"default-markup":"default-code"),_e[ie]}te(pe,["default-code"]),te(ee([],[[h,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[l,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),te(ee([[h,/^[\s]+/,null,` \r
`],[D,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[L,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[l,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),te(ee([],[[D,/^[\s\S]+/]]),["uq.val"]),te(ye({keywords:c,hashComments:!0,cStyleComments:!0,types:p}),["c","cc","cpp","cxx","cyc","m"]),te(ye({keywords:"null,true,false"}),["json"]),te(ye({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:p}),["cs"]),te(ye({keywords:u,cStyleComments:!0}),["java"]),te(ye({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),te(ye({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),te(ye({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),te(ye({keywords:n,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),te(ye({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),te(ye({keywords:i,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),te(ee([],[[m,/^[\s\S]+/]]),["regex"]);function A(ie){var Ee=ie.langExtension;try{var Oe=I(ie.sourceNode,ie.pre),q=Oe.sourceCode;ie.sourceCode=q,ie.spans=Oe.spans,ie.basePos=0,k(Ee,q)(ie),se(ie)}catch(de){j.console&&console.log(de&&de.stack||de)}}function C(ie,Ee,Oe){var q=Oe||!1,de=Ee||null,Te=document.createElement("div");Te.innerHTML="<pre>"+ie+"</pre>",Te=Te.firstChild,q&&ae(Te,q,!0);var xe={langExtension:de,numberLines:q,sourceNode:Te,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return A(xe),Te.innerHTML}function B(ie,Ee){var Oe=Ee||document.body,q=Oe.ownerDocument||document;function de(Z){return Oe.getElementsByTagName(Z)}for(var Te=[de("pre"),de("code"),de("xmp")],xe=[],Pe=0;Pe<Te.length;++Pe)for(var Ne=0,Re=Te[Pe].length;Ne<Re;++Ne)xe.push(Te[Pe][Ne]);Te=null;var Me=Date;Me.now||(Me={now:function(){return+new Date}});var He=0,We=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ke=/\bprettyprint\b/,Be=/\bprettyprinted\b/,Ve=/pre|xmp/i,Xe=/^code$/i,ne=/^(?:pre|code|xmp)$/i,V={};function G(){for(var Z=j.PR_SHOULD_USE_CONTINUATION?Me.now()+250:Infinity;He<xe.length&&Me.now()<Z;He++){for(var re=xe[He],X=V,Q=re;Q=Q.previousSibling;){var oe=Q.nodeType,he=(oe===7||oe===8)&&Q.nodeValue;if(he?!/^\??prettify\b/.test(he):oe!==3||/\S/.test(Q.nodeValue))break;if(he){X={},he.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Lt,ot,Ft){X[ot]=Ft});break}}var De=re.className;if((X!==V||Ke.test(De))&&!Be.test(De)){for(var Ie=!1,Ue=re.parentNode;Ue;Ue=Ue.parentNode){var Ye=Ue.tagName;if(ne.test(Ye)&&Ue.className&&Ke.test(Ue.className)){Ie=!0;break}}if(!Ie){re.className+=" prettyprinted";var Je=X.lang;if(!Je){Je=De.match(We);var Ze;!Je&&(Ze=fe(re))&&Xe.test(Ze.tagName)&&(Je=Ze.className.match(We)),Je&&(Je=Je[1])}var dt;if(Ve.test(re.tagName))dt=1;else{var at=re.currentStyle,$e=q.defaultView,Nt=at?at.whiteSpace:$e&&$e.getComputedStyle?$e.getComputedStyle(re,null).getPropertyValue("white-space"):0;dt=Nt&&Nt.substring(0,3)==="pre"}var bt=X.linenums;(bt=bt==="true"||+bt)||(bt=De.match(/\blinenums\b(?::(\d+))?/),bt=bt?bt[1]&&bt[1].length?+bt[1]:!0:!1),bt&&ae(re,bt,dt);var Ut={langExtension:Je,sourceNode:re,numberLines:bt,pre:dt,sourceCode:null,basePos:null,spans:null,decorations:null};A(Ut)}}}He<xe.length?j.setTimeout(G,250):typeof ie=="function"&&ie()}G()}var K=j.PR={createSimpleLexer:ee,registerLangHandler:te,sourceDecorator:ye,PR_ATTRIB_NAME:L,PR_ATTRIB_VALUE:D,PR_COMMENT:_,PR_DECLARATION:y,PR_KEYWORD:b,PR_LITERAL:f,PR_NOCODE:x,PR_PLAIN:h,PR_PUNCTUATION:l,PR_SOURCE:T,PR_STRING:m,PR_TAG:E,PR_TYPE:o,prettyPrintOne:R?j.prettyPrintOne=C:O=C,prettyPrint:F=R?j.prettyPrint=B:F=B},M=j.define;typeof M=="function"&&M.amd&&M("google-code-prettify",[],function(){return K})})()},STEk:function(Ge,be,U){"use strict";U.d(be,"a",function(){return te});/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var ue=function(k,A){return(ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,B){C.__proto__=B}||function(C,B){for(var K in B)Object.prototype.hasOwnProperty.call(B,K)&&(C[K]=B[K])})(k,A)};function W(k,A){function C(){this.constructor=k}ue(k,A),k.prototype=A===null?Object.create(A):(C.prototype=A.prototype,new C)}function R(k,A,C,B){return new(C||(C=Promise))(function(K,M){function ie(q){try{Oe(B.next(q))}catch(de){M(de)}}function Ee(q){try{Oe(B.throw(q))}catch(de){M(de)}}function Oe(q){var de;q.done?K(q.value):(de=q.value,de instanceof C?de:new C(function(Te){Te(de)})).then(ie,Ee)}Oe((B=B.apply(k,A||[])).next())})}function N(k,A){var C,B,K,M,ie={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return M={next:Ee(0),throw:Ee(1),return:Ee(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function Ee(Oe){return function(q){return function(de){if(C)throw new TypeError("Generator is already executing.");for(;ie;)try{if(C=1,B&&(K=2&de[0]?B.return:de[0]?B.throw||((K=B.return)&&K.call(B),0):B.next)&&!(K=K.call(B,de[1])).done)return K;switch(B=0,K&&(de=[2&de[0],K.value]),de[0]){case 0:case 1:K=de;break;case 4:return ie.label++,{value:de[1],done:!1};case 5:ie.label++,B=de[1],de=[0];continue;case 7:de=ie.ops.pop(),ie.trys.pop();continue;default:if(!(K=ie.trys,(K=K.length>0&&K[K.length-1])||de[0]!==6&&de[0]!==2)){ie=0;continue}if(de[0]===3&&(!K||de[1]>K[0]&&de[1]<K[3])){ie.label=de[1];break}if(de[0]===6&&ie.label<K[1]){ie.label=K[1],K=de;break}if(K&&ie.label<K[2]){ie.label=K[2],ie.ops.push(de);break}K[2]&&ie.ops.pop(),ie.trys.pop();continue}de=A.call(k,ie)}catch(Te){de=[6,Te],B=0}finally{C=K=0}if(5&de[0])throw de[1];return{value:de[0]?de[1]:void 0,done:!0}}([Oe,q])}}}function S(){for(var k=0,A=0,C=arguments.length;A<C;A++)k+=arguments[A].length;var B=Array(k),K=0;for(A=0;A<C;A++)for(var M=arguments[A],ie=0,Ee=M.length;ie<Ee;ie++,K++)B[K]=M[ie];return B}var O=function(){function k(){}return k.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},k.setAttributes=function(A,C){for(var B=0,K=C;B<K.length;B++){var M=K[B],ie=M[0],Ee=M[1];A.setAttribute(ie,Ee)}},k.createRect=function(A,C,B){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",A.toString()),K.setAttribute("height",C.toString()),B&&k.setAttributes(K,B),K},k.createLine=function(A,C,B,K,M){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",A.toString()),ie.setAttribute("y1",C.toString()),ie.setAttribute("x2",B.toString()),ie.setAttribute("y2",K.toString()),M&&k.setAttributes(ie,M),ie},k.createPolygon=function(A,C){var B=document.createElementNS("http://www.w3.org/2000/svg","polygon");return B.setAttribute("points",A),C&&k.setAttributes(B,C),B},k.createCircle=function(A,C){var B=document.createElementNS("http://www.w3.org/2000/svg","circle");return B.setAttribute("cx",(A/2).toString()),B.setAttribute("cy",(A/2).toString()),B.setAttribute("r",A.toString()),C&&k.setAttributes(B,C),B},k.createEllipse=function(A,C,B){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(A/2).toString()),K.setAttribute("cy",(C/2).toString()),K.setAttribute("rx",(A/2).toString()),K.setAttribute("ry",(C/2).toString()),B&&k.setAttributes(K,B),K},k.createGroup=function(A){var C=document.createElementNS("http://www.w3.org/2000/svg","g");return A&&k.setAttributes(C,A),C},k.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},k.createMarker=function(A,C,B,K,M,ie,Ee){var Oe=document.createElementNS("http://www.w3.org/2000/svg","marker");return k.setAttributes(Oe,[["id",A],["orient",C],["markerWidth",B.toString()],["markerHeight",K.toString()],["refX",M.toString()],["refY",ie.toString()]]),Oe.appendChild(Ee),Oe},k.createText=function(A){var C=document.createElementNS("http://www.w3.org/2000/svg","text");return C.setAttribute("x","0"),C.setAttribute("y","0"),A&&k.setAttributes(C,A),C},k.createTSpan=function(A,C){var B=document.createElementNS("http://www.w3.org/2000/svg","tspan");return B.textContent=A,C&&k.setAttributes(B,C),B},k.createImage=function(A){var C=document.createElementNS("http://www.w3.org/2000/svg","image");return A&&k.setAttributes(C,A),C},k.createPoint=function(A,C){var B=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return B.x=A,B.y=C,B},k.createPath=function(A,C){var B=document.createElementNS("http://www.w3.org/2000/svg","path");return B.setAttribute("d",A),C&&k.setAttributes(B,C),B},k}(),F=function(){function k(){}return k.addKey=function(A){k.key=A},Object.defineProperty(k,"isLicensed",{get:function(){return!!k.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(k.key)},enumerable:!1,configurable:!0}),k}(),j=function(){function k(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return k.prototype.rasterize=function(A,C,B){var K=this;return new Promise(function(M){var ie=B!==void 0?B:document.createElement("canvas");A===null&&(K.markersOnly=!0,K.naturalSize=!1);var Ee=document.createElementNS("http://www.w3.org/2000/svg","svg");Ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ee.setAttribute("width",C.width.baseVal.valueAsString),Ee.setAttribute("height",C.height.baseVal.valueAsString),Ee.setAttribute("viewBox","0 0 "+C.viewBox.baseVal.width.toString()+" "+C.viewBox.baseVal.height.toString()),Ee.innerHTML=C.innerHTML,K.naturalSize===!0?(Ee.width.baseVal.value=A.naturalWidth,Ee.height.baseVal.value=A.naturalHeight):K.width!==void 0&&K.height!==void 0&&(Ee.width.baseVal.value=K.width,Ee.height.baseVal.value=K.height),ie.width=Ee.width.baseVal.value,ie.height=Ee.height.baseVal.value;var Oe=Ee.outerHTML,q=ie.getContext("2d");K.markersOnly!==!0&&q.drawImage(A,0,0,ie.width,ie.height);var de=window.URL,Te=new Image(ie.width,ie.height);Te.setAttribute("crossOrigin","anonymous");var xe=new Blob([Oe],{type:"image/svg+xml"}),Pe=de.createObjectURL(xe);Te.onload=function(){q.drawImage(Te,0,0),de.revokeObjectURL(Pe);var Ne=ie.toDataURL(K.imageType,K.imageQuality);M(Ne)},Te.src=Pe})},k}(),e=function(){},w=function(){function k(A){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+A+"_"}return Object.defineProperty(k.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),k.prototype.addClass=function(A){return this.styleSheet===void 0&&this.addStyleSheet(),A.name=""+this.classNamePrefix+A.localName,this.classes.push(A),this.styleSheet.sheet.insertRule("."+A.name+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length),A},k.prototype.addRule=function(A){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(A),this.styleSheet.sheet.insertRule(A.selector+" {"+A.style+"}",this.styleSheet.sheet.cssRules.length)},k.prototype.addStyleSheet=function(){var A;this.styleSheet=document.createElement("style"),((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).appendChild(this.styleSheet),this.addRule(new g("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new c("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new c("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},k.prototype.removeStyleSheet=function(){var A;this.styleSheet&&(((A=this.styleSheetRoot)!==null&&A!==void 0?A:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},k}(),g=function(k,A){this.selector=k,this.style=A},c=function(k,A){this.localName=k,this.style=A},u=function(){function k(A,C,B,K,M){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=A,this.displayMode=C,this.markerItems=B,this.uiStyleSettings=K,this.styles=M,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return k.prototype.show=function(A){var C=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var B=document.createElement("div");B.className=this.toolbarBlockStyleClass.name,B.style.whiteSpace="nowrap",this.uiContainer.appendChild(B),this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(B,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(M){var ie=document.createElement("div");ie.className=""+C.toolbarButtonStyleClass.name,ie.setAttribute("data-type-name",M.typeName),ie.innerHTML=M.icon,ie.addEventListener("click",function(){C.markerToolbarButtonClicked(ie,M)}),C.buttons.push(ie),C.markerButtons.push(ie)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",K.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(K),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},k.prototype.addButtonClickListener=function(A){this.buttonClickListeners.push(A)},k.prototype.removeButtonClickListener=function(A){this.buttonClickListeners.indexOf(A)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(A),1)},k.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},k.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var A=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var C=0;C<this.markerButtons.length;C++)C<A||C===A&&this.markerButtons.length-1===A?this.markerButtonBlock.appendChild(this.markerButtons[C]):(C===A&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[C]))}},k.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},k.prototype.resetButtonStyles=function(){var A=this;this.buttons.forEach(function(C){C.className=C.className.replace(A.uiStyleSettings.toolbarButtonStyleColorsClassName?A.uiStyleSettings.toolbarButtonStyleColorsClassName:A.toolbarButtonStyleColorsClass.name,"").trim(),C.className=C.className.replace(A.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?A.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:A.toolbarActiveButtonStyleColorsClass.name,"").trim(),C.className+=" "+(A.uiStyleSettings.toolbarButtonStyleColorsClassName?A.uiStyleSettings.toolbarButtonStyleColorsClassName:A.toolbarButtonStyleColorsClass.name)})},k.prototype.addActionButton=function(A,C,B){var K=this,M=document.createElement("div");switch(M.className=""+this.toolbarButtonStyleClass.name,M.innerHTML=C,M.setAttribute("data-action",B),M.addEventListener("click",function(){K.actionToolbarButtonClicked(M,B)}),B){case"select":M.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":M.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":M.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":M.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":M.style.fill=this.uiStyleSettings.closeButtonColor}A.appendChild(M),this.buttons.push(M)},k.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new c("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new c("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new c("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new c("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new c("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var A=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new c("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
padding: `+A+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new c("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new c("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},k.prototype.markerToolbarButtonClicked=function(A,C){this.setActiveButton(A),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("marker",C)}),this.markerButtonOverflowBlock.style.display="none"},k.prototype.actionToolbarButtonClicked=function(A,C){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(B){return B("action",C)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},k.prototype.setActiveButton=function(A){this.resetButtonStyles(),A.className=A.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),A.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},k.prototype.setActiveMarkerButton=function(A){var C=this.markerButtons.find(function(B){return B.getAttribute("data-type-name")===A});C&&this.setActiveButton(C)},k.prototype.setCurrentMarker=function(A){var C=this;this.currentMarker=A,this.buttons.filter(function(B){return/delete|notes/.test(B.getAttribute("data-action"))}).forEach(function(B){C.currentMarker===void 0?(B.style.fillOpacity="0.4",B.style.pointerEvents="none"):(B.style.fillOpacity="1",B.style.pointerEvents="all")})},k}(),a=function(){function k(A,C,B,K){this.panels=[],this.panelButtons=[],this.markerjsContainer=A,this.displayMode=C,this.uiStyleSettings=B,this.styles=K,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return k.prototype.addStyles=function(){var A;this.toolboxStyleClass=this.styles.addClass(new c("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new c("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var C=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new c("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new c("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new c("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new c("toolbox-panel-row_colors",`
background-color: `+((A=this.uiStyleSettings.toolboxBackgroundColor)!==null&&A!==void 0?A:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new c("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
padding: `+C+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new c("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new c("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},k.prototype.show=function(A){var C;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=A,this.uiContainer.className=this.toolboxStyleClass.name+" "+((C=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},k.prototype.setPanelButtons=function(A){var C,B,K=this;this.panels=A,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((C=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&C!==void 0?C:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((B=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&B!==void 0?B:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(M){var ie;M.uiStyleSettings=K.uiStyleSettings;var Ee=document.createElement("div");Ee.className=K.toolboxButtonStyleClass.name+" "+((ie=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ie!==void 0?ie:K.toolboxButtonStyleColorsClass.name),Ee.innerHTML=M.icon,Ee.title=M.title,Ee.addEventListener("click",function(){K.panelButtonClick(M)}),K.panelButtons.push(Ee),K.buttonRow.appendChild(Ee)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},k.prototype.panelButtonClick=function(A){var C=this,B=-1;if(A!==this.activePanel){B=this.panels.indexOf(A),this.panelRow.innerHTML="";var K=A.getUi();K.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(K),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=A}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){C.displayMode==="inline"?C.panelRow.style.display="none":C.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(M,ie){var Ee,Oe;M.className=C.toolboxButtonStyleClass.name+" "+(ie===B?""+((Ee=C.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ee!==void 0?Ee:C.toolboxActiveButtonStyleColorsClass.name):""+((Oe=C.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Oe!==void 0?Oe:C.toolboxButtonStyleColorsClass.name))})},k}(),i=function(k,A){this.title=k,this.icon=A},d=function(k){function A(C,B,K,M){var ie=k.call(this,C,M||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ie.colors=[],ie.addTransparent=!1,ie.colorBoxes=[],ie.colors=B,ie.currentColor=K,ie.setCurrentColor=ie.setCurrentColor.bind(ie),ie.getColorBox=ie.getColorBox.bind(ie),ie}return W(A,k),A.prototype.getUi=function(){var C=this,B=document.createElement("div");return B.style.overflow="hidden",B.style.whiteSpace="nowrap",this.colors.forEach(function(K){var M=C.getColorBox(K);B.appendChild(M),C.colorBoxes.push(M)}),B},A.prototype.getColorBox=function(C){var B=this,K=this.uiStyleSettings.toolbarHeight/4,M=this.uiStyleSettings.toolbarHeight-K,ie=document.createElement("div");ie.style.display="inline-block",ie.style.boxSizing="content-box",ie.style.width=M-2+"px",ie.style.height=M-2+"px",ie.style.padding="1px",ie.style.marginRight="2px",ie.style.marginBottom="2px",ie.style.borderWidth="2px",ie.style.borderStyle="solid",ie.style.borderRadius=(M+2)/2+"px",ie.style.borderColor=C===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){B.setCurrentColor(C,ie)});var Ee=document.createElement("div");return Ee.style.display="inline-block",Ee.style.width=M-2+"px",Ee.style.height=M-2+"px",Ee.style.backgroundColor=C,Ee.style.borderRadius=M/2+"px",C==="transparent"&&(Ee.style.fill=this.uiStyleSettings.toolboxAccentColor,Ee.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),ie.appendChild(Ee),ie},A.prototype.setCurrentColor=function(C,B){var K=this;this.currentColor=C,this.colorBoxes.forEach(function(M){M.style.borderColor=M===B?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(C)},A}(i),s=function(){function k(A,C,B){this._state="new",this._isSelected=!1,this._container=A,this._overlayContainer=C,this.globalSettings=B,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(k.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),k.prototype.ownsTarget=function(A){return!1},Object.defineProperty(k.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),k.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},k.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},k.prototype.pointerDown=function(A,C){},k.prototype.dblClick=function(A,C){},k.prototype.manipulate=function(A){},k.prototype.pointerUp=function(A){this.stateChanged()},k.prototype.dispose=function(){},k.prototype.addMarkerVisualToContainer=function(A){this.container.childNodes.length>0?this.container.insertBefore(A,this.container.childNodes[0]):this.container.appendChild(A)},k.prototype.getState=function(){return{typeName:k.typeName,state:this.state,notes:this.notes}},k.prototype.restoreState=function(A){this._state=A.state,this.notes=A.notes},k.prototype.scale=function(A,C){},k.prototype.colorChanged=function(A){this.onColorChanged&&this.onColorChanged(A),this.stateChanged()},k.prototype.fillColorChanged=function(A){this.onFillColorChanged&&this.onFillColorChanged(A),this.stateChanged()},k.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var A=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),A.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(A)&&this.onStateChanged(this)}},k.typeName="MarkerBase",k}(),r=function(){function k(){this.findGripByVisual=this.findGripByVisual.bind(this)}return k.prototype.findGripByVisual=function(A){return this.topLeft.ownsTarget(A)?this.topLeft:this.topCenter.ownsTarget(A)?this.topCenter:this.topRight.ownsTarget(A)?this.topRight:this.centerLeft.ownsTarget(A)?this.centerLeft:this.centerRight.ownsTarget(A)?this.centerRight:this.bottomLeft.ownsTarget(A)?this.bottomLeft:this.bottomCenter.ownsTarget(A)?this.bottomCenter:this.bottomRight.ownsTarget(A)?this.bottomRight:void 0},k}(),n=function(){function k(){this.GRIP_SIZE=10,this.visual=O.createGroup(),this.visual.appendChild(O.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(O.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return k.prototype.ownsTarget=function(A){return A===this.visual||A===this.visual.childNodes[0]||A===this.visual.childNodes[1]},k}(),t=function(){function k(){}return k.toITransformMatrix=function(A){return{a:A.a,b:A.b,c:A.c,d:A.d,e:A.e,f:A.f}},k.toSVGMatrix=function(A,C){return A.a=C.a,A.b=C.b,A.c=C.c,A.d=C.d,A.e=C.e,A.f=C.f,A},k}(),v=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.left=0,M.top=0,M.width=0,M.height=0,M.defaultSize={x:50,y:20},M.offsetX=0,M.offsetY=0,M.rotationAngle=0,M.CB_DISTANCE=10,M._suppressMarkerCreateEvent=!1,M.container.transform.baseVal.appendItem(O.createTransform()),M.setupControlBox(),M}return W(A,k),Object.defineProperty(A.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"visual",{get:function(){return this._visual},set:function(C){this._visual=C;var B=O.createTransform();this._visual.transform.baseVal.appendItem(B)},enumerable:!1,configurable:!0}),A.prototype.ownsTarget=function(C){return!!k.prototype.ownsTarget.call(this,C)||!!(this.controlGrips.findGripByVisual(C)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(C))},A.prototype.pointerDown=function(C,B){k.prototype.pointerDown.call(this,C,B),this.state==="new"&&(this.left=C.x,this.top=C.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var K=this.unrotatePoint(C);if(this.manipulationStartX=K.x,this.manipulationStartY=K.y,this.offsetX=K.x-this.left,this.offsetY=K.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(B),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(B)){this.activeGrip=this.rotatorGrip;var M=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=M.x-this.width/2,this.top=M.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ie=this.container.transform.baseVal.getItem(0);ie.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ie,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},A.prototype.pointerUp=function(C){var B=this.state;k.prototype.pointerUp.call(this,C),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(C),this._state="select",B==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},A.prototype.moveVisual=function(C){this.visual.style.transform="translate("+C.x+"px, "+C.y+"px)"},A.prototype.manipulate=function(C){var B=this.unrotatePoint(C);this.state==="creating"?this.resize(C):this.state==="move"?(this.left=this.manipulationStartLeft+(B.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(B.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(B):this.state==="rotate"&&this.rotate(C)},A.prototype.resize=function(C){var B=this.manipulationStartLeft,K=this.manipulationStartWidth,M=this.manipulationStartTop,ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:B=this.manipulationStartLeft+C.x-this.manipulationStartX,K=this.manipulationStartWidth+this.manipulationStartLeft-B;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:K=this.manipulationStartWidth+C.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:M=this.manipulationStartTop+C.y-this.manipulationStartY,ie=this.manipulationStartHeight+this.manipulationStartTop-M;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ie=this.manipulationStartHeight+C.y-this.manipulationStartY}K>=0?(this.left=B,this.width=K):(this.left=B+K,this.width=-K),ie>=0?(this.top=M,this.height=ie):(this.top=M+ie,this.height=-ie),this.setSize()},A.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},A.prototype.rotate=function(C){if(Math.abs(C.x-this.centerX)>.1){var B=Math.sign(C.x-this.centerX);this.rotationAngle=180*Math.atan((C.y-this.centerY)/(C.x-this.centerX))/Math.PI+90*B,this.applyRotation()}},A.prototype.applyRotation=function(){var C=this.container.transform.baseVal.getItem(0);C.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(C,0)},A.prototype.rotatePoint=function(C){if(this.rotationAngle===0)return C;var B=this.container.getCTM(),K=O.createPoint(C.x,C.y);return{x:(K=K.matrixTransform(B)).x,y:K.y}},A.prototype.unrotatePoint=function(C){if(this.rotationAngle===0)return C;var B=this.container.getCTM();B=B.inverse();var K=O.createPoint(C.x,C.y);return{x:(K=K.matrixTransform(B)).x,y:K.y}},A.prototype.select=function(){k.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){k.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=O.createGroup();var C=O.createTransform();C.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(C),this.container.appendChild(this.controlBox),this.controlRect=O.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=O.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new r,this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){var C=this.controlBox.transform.baseVal.getItem(0);C.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(C,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},A.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},A.prototype.createGrip=function(){var C=new n;return C.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(C.visual),C},A.prototype.positionGrips=function(){var C=this.controlGrips.topLeft.GRIP_SIZE,B=-C/2,K=B,M=(this.width+this.CB_DISTANCE)/2-C/2,ie=(this.height+this.CB_DISTANCE)/2-C/2,Ee=this.height+this.CB_DISTANCE-C/2,Oe=this.width+this.CB_DISTANCE-C/2;this.positionGrip(this.controlGrips.topLeft.visual,B,K),this.positionGrip(this.controlGrips.topCenter.visual,M,K),this.positionGrip(this.controlGrips.topRight.visual,Oe,K),this.positionGrip(this.controlGrips.centerLeft.visual,B,ie),this.positionGrip(this.controlGrips.centerRight.visual,Oe,ie),this.positionGrip(this.controlGrips.bottomLeft.visual,B,Ee),this.positionGrip(this.controlGrips.bottomCenter.visual,M,Ee),this.positionGrip(this.controlGrips.bottomRight.visual,Oe,Ee),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,M,K-3*this.CB_DISTANCE)},A.prototype.positionGrip=function(C,B,K){var M=C.transform.baseVal.getItem(0);M.setTranslate(B,K),C.transform.baseVal.replaceItem(M,0)},A.prototype.hideControlBox=function(){this.controlBox.style.display="none"},A.prototype.showControlBox=function(){this.controlBox.style.display=""},A.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:t.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:t.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},k.prototype.getState.call(this))},A.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var B=C;this.left=B.left,this.top=B.top,this.width=B.width,this.height=B.height,this.rotationAngle=B.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,B.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,B.containerTransformMatrix))},A.prototype.scale=function(C,B){k.prototype.scale.call(this,C,B);var K=this.rotatePoint({x:this.left,y:this.top}),M=this.unrotatePoint({x:K.x*C,y:K.y*B});this.left=M.x,this.top=M.y,this.width=this.width*C,this.height=this.height*B,this.adjustControlBox()},A}(s),p=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.fillColor="transparent",M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.opacity=1,M.setStrokeColor=M.setStrokeColor.bind(M),M.setFillColor=M.setFillColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.createVisual=M.createVisual.bind(M),M}return W(A,k),A.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual)},A.prototype.createVisual=function(){this.visual=O.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(C,B){k.prototype.pointerDown.call(this,C,B),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},A.prototype.manipulate=function(C){k.prototype.manipulate.call(this,C)},A.prototype.resize=function(C){k.prototype.resize.call(this,C),this.setSize()},A.prototype.setSize=function(){k.prototype.setSize.call(this),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(C){k.prototype.pointerUp.call(this,C),this.setSize()},A.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},A.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},A.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},A.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},A.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},k.prototype.getState.call(this))},A.prototype.restoreState=function(C){var B=C;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),k.prototype.restoreState.call(this,C),this.setSize()},A.prototype.scale=function(C,B){k.prototype.scale.call(this,C,B),this.setSize()},A.title="Rectangle marker",A}(v),m=function(k){function A(C,B,K,M){var ie=k.call(this,C,M||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ie.widths=[],ie.widthBoxes=[],ie.widths=B,ie.currentWidth=K,ie.setCurrentWidth=ie.setCurrentWidth.bind(ie),ie}return W(A,k),A.prototype.getUi=function(){var C=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",this.widths.forEach(function(K){var M=document.createElement("div");M.style.display="flex",M.style.flexGrow="2",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.borderColor=K===C.currentWidth?C.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){C.setCurrentWidth(K,M)}),B.appendChild(M);var ie=document.createElement("div");ie.innerText=K.toString(),ie.style.marginRight="5px",M.appendChild(ie);var Ee=document.createElement("div");Ee.style.minHeight="20px",Ee.style.flexGrow="2",Ee.style.display="flex",Ee.style.alignItems="center";var Oe=document.createElement("hr");Oe.style.minWidth="20px",Oe.style.border="0px",Oe.style.borderTop=K+"px solid "+C.uiStyleSettings.toolboxColor,Oe.style.flexGrow="2",Ee.appendChild(Oe),M.appendChild(Ee),C.widthBoxes.push(M)}),B},A.prototype.setCurrentWidth=function(C,B){var K=this;this.currentWidth=C,this.widthBoxes.forEach(function(M){M.style.borderColor=M===B?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},A}(i),b=function(k){function A(C,B,K,M){var ie=k.call(this,C,M||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ie.styles=[],ie.styleBoxes=[],ie.styles=B,ie.currentStyle=K,ie.setCurrentStyle=ie.setCurrentStyle.bind(ie),ie}return W(A,k),A.prototype.getUi=function(){var C=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",this.styles.forEach(function(K){var M=document.createElement("div");M.style.display="flex",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.overflow="hidden",M.style.maxWidth=100/C.styles.length-5+"%",M.style.borderColor=K===C.currentStyle?C.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){C.setCurrentStyle(K,M)}),B.appendChild(M);var ie=document.createElement("div");ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.overflow="hidden";var Ee=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+C.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(K!==""?'stroke-dasharray="'+K+'"':"")+` />
</svg>`;ie.innerHTML=Ee,M.appendChild(ie),C.styleBoxes.push(M)}),B},A.prototype.setCurrentStyle=function(C,B){var K=this;this.currentStyle=C,this.styleBoxes.forEach(function(M){M.style.borderColor=M===B?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},A}(i),_=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.strokePanel=new d("Line color",K.defaultColorSet,K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new m("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new b("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return W(A,k),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=A.typeName,C},A.typeName="FrameMarker",A.title="Frame marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',A}(p),o=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},f=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.x1=0,M.y1=0,M.x2=0,M.y2=0,M.defaultLength=50,M.manipulationStartX=0,M.manipulationStartY=0,M.manipulationStartX1=0,M.manipulationStartY1=0,M.manipulationStartX2=0,M.manipulationStartY2=0,M.setupControlBox(),M}return W(A,k),A.prototype.ownsTarget=function(C){return!!k.prototype.ownsTarget.call(this,C)||!(!this.grip1.ownsTarget(C)&&!this.grip2.ownsTarget(C))},A.prototype.pointerDown=function(C,B){k.prototype.pointerDown.call(this,C,B),this.manipulationStartX=C.x,this.manipulationStartY=C.y,this.state==="new"&&(this.x1=C.x,this.y1=C.y,this.x2=C.x,this.y2=C.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(B)?this.activeGrip=this.grip1:this.grip2.ownsTarget(B)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},A.prototype.pointerUp=function(C){var B=this.state;k.prototype.pointerUp.call(this,C),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(C),this._state="select",B==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},A.prototype.adjustVisual=function(){},A.prototype.manipulate=function(C){this.state==="creating"?this.resize(C):this.state==="move"?(this.x1=this.manipulationStartX1+C.x-this.manipulationStartX,this.y1=this.manipulationStartY1+C.y-this.manipulationStartY,this.x2=this.manipulationStartX2+C.x-this.manipulationStartX,this.y2=this.manipulationStartY2+C.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(C)},A.prototype.resize=function(C){switch(this.activeGrip){case this.grip1:this.x1=C.x,this.y1=C.y;break;case this.grip2:case void 0:this.x2=C.x,this.y2=C.y}this.adjustVisual(),this.adjustControlBox()},A.prototype.select=function(){k.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},A.prototype.deselect=function(){k.prototype.deselect.call(this),this.controlBox.style.display="none"},A.prototype.setupControlBox=function(){this.controlBox=O.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},A.prototype.adjustControlBox=function(){this.positionGrips()},A.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},A.prototype.createGrip=function(){var C=new n;return C.visual.transform.baseVal.appendItem(O.createTransform()),this.controlBox.appendChild(C.visual),C},A.prototype.positionGrips=function(){var C=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-C/2,this.y1-C/2),this.positionGrip(this.grip2.visual,this.x2-C/2,this.y2-C/2)},A.prototype.positionGrip=function(C,B,K){var M=C.transform.baseVal.getItem(0);M.setTranslate(B,K),C.transform.baseVal.replaceItem(M,0)},A.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},k.prototype.getState.call(this))},A.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var B=C;this.x1=B.x1,this.y1=B.y1,this.x2=B.x2,this.y2=B.y2},A.prototype.scale=function(C,B){k.prototype.scale.call(this,C,B),this.x1=this.x1*C,this.y1=this.y1*B,this.x2=this.x2*C,this.y2=this.y2*B,this.adjustVisual(),this.adjustControlBox()},A}(s),l=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.setStrokeColor=M.setStrokeColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.strokePanel=new d("Line color",K.defaultColorSet,K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new m("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new b("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return W(A,k),A.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorLine&&C!==this.visibleLine)},A.prototype.createVisual=function(){this.visual=O.createGroup(),this.selectorLine=O.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=O.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(C,B){k.prototype.pointerDown.call(this,C,B),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},A.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),O.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},A.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},A.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},k.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var B=C;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.createVisual(),this.adjustVisual()},A.typeName="LineMarker",A.title="Line marker",A.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',A}(f),h=function(k){function A(C,B,K,M){var ie=k.call(this,C,M||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ie.fonts=[],ie.fontBoxes=[],ie.fonts=B,ie.currentFont=K,ie.setCurrentFont=ie.setCurrentFont.bind(ie),ie}return W(A,k),A.prototype.getUi=function(){var C=this,B=document.createElement("div");return B.style.overflow="hidden",B.style.flexGrow="2",this.fonts.forEach(function(K){var M=document.createElement("div");M.style.display="inline-block",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.overflow="hidden",M.style.maxWidth=100/C.fonts.length-5+"%",M.style.borderColor=K===C.currentFont?C.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){C.setCurrentFont(K,M)}),B.appendChild(M);var ie=document.createElement("div");ie.style.display="flex",ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.fontFamily=K,ie.style.overflow="hidden";var Ee=document.createElement("div");Ee.style.whiteSpace="nowrap",Ee.style.overflow="hidden",Ee.style.textOverflow="ellipsis",Ee.innerHTML="The quick brown fox jumps over the lazy dog",ie.appendChild(Ee),M.appendChild(ie),C.fontBoxes.push(M)}),B},A.prototype.setCurrentFont=function(C,B){var K=this;this.currentFont=C,this.fontBoxes.forEach(function(M){M.style.borderColor=M===B?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},A}(i),E=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.color="transparent",M.padding=5,M.DEFAULT_TEXT="your text here",M.text=M.DEFAULT_TEXT,M.isMoved=!1,M.color=K.defaultColor,M.fontFamily=K.defaultFontFamily,M.defaultSize={x:100,y:30},M.setColor=M.setColor.bind(M),M.setFont=M.setFont.bind(M),M.renderText=M.renderText.bind(M),M.sizeText=M.sizeText.bind(M),M.textEditDivClicked=M.textEditDivClicked.bind(M),M.showTextEditor=M.showTextEditor.bind(M),M.setSize=M.setSize.bind(M),M.positionTextEditor=M.positionTextEditor.bind(M),M.colorPanel=new d("Color",K.defaultColorSet,K.defaultColor),M.colorPanel.onColorChanged=M.setColor,M.fontFamilyPanel=new h("Font",K.defaultFontFamilies,K.defaultFontFamily),M.fontFamilyPanel.onFontChanged=M.setFont,M}return W(A,k),A.prototype.ownsTarget=function(C){if(k.prototype.ownsTarget.call(this,C)||C===this.visual||C===this.textElement||C===this.bgRectangle)return!0;var B=!1;return this.textElement.childNodes.forEach(function(K){K===C&&(B=!0)}),B},A.prototype.createVisual=function(){this.visual=O.createGroup(),this.bgRectangle=O.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=O.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.textElement.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},A.prototype.pointerDown=function(C,B){k.prototype.pointerDown.call(this,C,B),this.isMoved=!1,this.pointerDownPoint=C,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},A.prototype.renderText=function(){var C=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(B){C.textElement.appendChild(O.createTSpan(B.trim()===""?" ":B.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},A.prototype.getTextScale=function(){var C=this.textElement.getBBox(),B=1;if(C.width>0&&C.height>0){var K=(1*this.width-this.width*this.padding*2/100)/C.width,M=(1*this.height-this.height*this.padding*2/100)/C.height;B=Math.min(K,M)}return B},A.prototype.getTextPosition=function(C){var B=this.textElement.getBBox(),K=0,M=0;return B.width>0&&B.height>0&&(K=(this.width-B.width*C)/2,M=this.height/2-B.height*C/2),{x:K,y:M}},A.prototype.sizeText=function(){var C=this.textElement.getBBox(),B=this.getTextScale(),K=this.getTextPosition(B);K.y-=C.y*B,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+K.x+"px, "+K.y+"px) scale("+B+", "+B+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(K.x,K.y),this.textElement.transform.baseVal.getItem(1).setScale(B,B))},A.prototype.manipulate=function(C){k.prototype.manipulate.call(this,C),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(C.x-this.pointerDownPoint.x)>5||Math.abs(C.y-this.pointerDownPoint.y)>5)},A.prototype.resize=function(C){k.prototype.resize.call(this,C),this.isMoved=!0,this.setSize(),this.sizeText()},A.prototype.setSize=function(){k.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},A.prototype.pointerUp=function(C){var B=this.state;B==="creating"&&(this._suppressMarkerCreateEvent=!0),k.prototype.pointerUp.call(this,C),this.setSize(),(B==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},A.prototype.showTextEditor=function(){var C=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(B){B.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var B=Number.parseFloat(C.textEditor.style.fontSize);C.textEditor.clientWidth>=Number.parseInt(C.textEditor.style.maxWidth)&&B>.9;)B-=.1,C.textEditor.style.fontSize=Math.max(B,.9)+"em"}),this.textEditor.addEventListener("keyup",function(B){B.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(B){if(B.clipboardData){var K=B.clipboardData.getData("text"),M=window.getSelection();if(!M.rangeCount)return!1;M.deleteFromDocument(),M.getRangeAt(0).insertNode(document.createTextNode(K)),B.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){C.textEditDivClicked(C.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},A.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var C=this.getTextScale(),B=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),K=this.textElement.getBBox(),M={x:K.width*C,y:K.height*C};B.x-=M.x/2,B.y-=M.y/2,this.textEditor.style.top=B.y+"px",this.textEditor.style.left=B.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-B.x+"px",this.textEditor.style.fontSize=Math.max(16*C,12)+"px",this.textElement.style.display="none"}},A.prototype.textEditDivClicked=function(C){this.text=C.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},A.prototype.select=function(){k.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},A.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),k.prototype.deselect.call(this)},A.prototype.dblClick=function(C,B){k.prototype.dblClick.call(this,C,B),this.showTextEditor()},A.prototype.setColor=function(C){this.textElement&&O.setAttributes(this.textElement,[["fill",C]]),this.color=C,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(C)},A.prototype.setFont=function(C){this.textElement&&O.setAttributes(this.textElement,[["font-family",C]]),this.fontFamily=C,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},A.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},A.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},k.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){var B=C;this.color=B.color,this.fontFamily=B.fontFamily,this.padding=B.padding,this.text=B.text,this.createVisual(),k.prototype.restoreState.call(this,C),this.setSize()},A.prototype.scale=function(C,B){k.prototype.scale.call(this,C,B),this.setSize(),this.sizeText(),this.positionTextEditor()},A.typeName="TextMarker",A.title="Text marker",A.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',A}(v),y=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.color="transparent",M.lineWidth=3,M.drawing=!1,M.pixelRatio=1,M.color=K.defaultColor,M.lineWidth=K.defaultStrokeWidth,M.pixelRatio=K.freehandPixelRatio,M.setColor=M.setColor.bind(M),M.addCanvas=M.addCanvas.bind(M),M.finishCreation=M.finishCreation.bind(M),M.setLineWidth=M.setLineWidth.bind(M),M.colorPanel=new d("Color",K.defaultColorSet,K.defaultColor),M.colorPanel.onColorChanged=M.setColor,M.lineWidthPanel=new m("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.lineWidthPanel.onWidthChanged=M.setLineWidth,M}return W(A,k),A.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.drawingImage)},A.prototype.createVisual=function(){this.visual=O.createGroup(),this.drawingImage=O.createImage(),this.visual.appendChild(this.drawingImage);var C=O.createTransform();this.visual.transform.baseVal.appendItem(C),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(C,B){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(C.x,C.y),this.drawing=!0):k.prototype.pointerDown.call(this,C,B)},A.prototype.manipulate=function(C){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(C.x,C.y),this.canvasContext.stroke()):k.prototype.manipulate.call(this,C)},A.prototype.resize=function(C){k.prototype.resize.call(this,C),O.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},A.prototype.pointerUp=function(C){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):k.prototype.pointerUp.call(this,C)},A.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},A.prototype.select=function(){this.state==="creating"&&this.finishCreation(),k.prototype.select.call(this)},A.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),k.prototype.deselect.call(this)},A.prototype.finishCreation=function(){for(var C=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),B=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],K=B[0],M=B[1],ie=B[2],Ee=B[3],Oe=!1,q=0;q<this.canvasElement.height;q++)for(var de=0;de<this.canvasElement.width;de++)C.data[q*this.canvasElement.width*4+4*de+3]>0&&(Oe=!0,q<M&&(M=q),de<K&&(K=de),q>Ee&&(Ee=q),de>ie&&(ie=de));if(Oe){this.left=K/this.pixelRatio,this.top=M/this.pixelRatio,this.width=(ie-K)/this.pixelRatio,this.height=(Ee-M)/this.pixelRatio;var Te=document.createElement("canvas");Te.width=ie-K,Te.height=Ee-M,Te.getContext("2d").putImageData(this.canvasContext.getImageData(K,M,ie-K,Ee-M),0,0),this.drawingImgUrl=Te.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},A.prototype.setDrawingImage=function(){O.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),O.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},A.prototype.setColor=function(C){this.color=C,this.colorChanged(C)},A.prototype.setLineWidth=function(C){this.lineWidth=C},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({drawingImgUrl:this.drawingImgUrl},k.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){this.createVisual(),k.prototype.restoreState.call(this,C),this.drawingImgUrl=C.drawingImgUrl,this.setDrawingImage()},A.prototype.scale=function(C,B){k.prototype.scale.call(this,C,B),this.setDrawingImage()},A.typeName="FreehandMarker",A.title="Freehand marker",A.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',A}(v),T=function(k){function A(C,B,K){var M=k.call(this,C,K||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return M.typeBoxes=[],M.currentType=B,M.setCurrentType=M.setCurrentType.bind(M),M}return W(A,k),A.prototype.getUi=function(){var C=this,B=document.createElement("div");B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2";for(var K=function(Ee){var Oe="both";switch(Ee){case 0:Oe="both";break;case 1:Oe="start";break;case 2:Oe="end";break;case 3:Oe="none"}var q=document.createElement("div");if(q.style.display="flex",q.style.flexGrow="2",q.style.alignItems="center",q.style.justifyContent="space-between",q.style.padding="5px",q.style.borderWidth="2px",q.style.borderStyle="solid",q.style.borderColor=Oe===M.currentType?M.uiStyleSettings.toolboxAccentColor:"transparent",q.addEventListener("click",function(){C.setCurrentType(Oe,q)}),B.appendChild(q),Oe==="both"||Oe==="start"){var de=document.createElement("div");de.style.display="flex",de.style.alignItems="center",de.style.minHeight="20px",de.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,de.style.marginLeft="5px",q.appendChild(de)}var Te=document.createElement("div");Te.style.display="flex",Te.style.alignItems="center",Te.style.minHeight="20px",Te.style.flexGrow="2";var xe=document.createElement("hr");if(xe.style.minWidth="20px",xe.style.border="0px",xe.style.borderTop="3px solid "+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee"),xe.style.flexGrow="2",Te.appendChild(xe),q.appendChild(Te),Oe==="both"||Oe==="end"){var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.alignItems="center",Pe.style.minHeight="20px",Pe.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Pe.style.marginRight="5px",q.appendChild(Pe)}M.typeBoxes.push(q)},M=this,ie=0;ie<4;ie++)K(ie);return B},A.prototype.setCurrentType=function(C,B){var K=this;this.currentType=C,this.typeBoxes.forEach(function(M){M.style.borderColor=M===B?K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},A}(i),L=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.arrowType="end",M.arrowBaseHeight=10,M.arrowBaseWidth=10,M.getArrowPoints=M.getArrowPoints.bind(M),M.setArrowType=M.setArrowType.bind(M),M.arrowTypePanel=new T("Arrow type","end"),M.arrowTypePanel.onArrowTypeChanged=M.setArrowType,M}return W(A,k),A.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.arrow1&&C!==this.arrow2)},A.prototype.getArrowPoints=function(C,B){var K=this.arrowBaseWidth+2*this.strokeWidth,M=this.arrowBaseHeight+2*this.strokeWidth;return C-K/2+","+(B+M/2)+" "+C+","+(B-M/2)+" "+(C+K/2)+","+(B+M/2)},A.prototype.createTips=function(){this.arrow1=O.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=O.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.arrow2)},A.prototype.pointerDown=function(C,B){k.prototype.pointerDown.call(this,C,B),this.state==="creating"&&this.createTips()},A.prototype.adjustVisual=function(){if(k.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",O.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),O.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),B=this.arrow1.transform.baseVal.getItem(0);B.setRotate(C,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(B,0);var K=this.arrow2.transform.baseVal.getItem(0);K.setRotate(C+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(K,0)}},A.prototype.setArrowType=function(C){this.arrowType=C,this.adjustVisual(),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({arrowType:this.arrowType},k.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var B=C;this.arrowType=B.arrowType,this.createTips(),this.adjustVisual()},A.typeName="ArrowMarker",A.title="Arrow marker",A.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',A}(l),D=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.fillColor=K.defaultFillColor,M.strokeWidth=0,M.fillPanel=new d("Color",K.defaultColorSet,K.defaultFillColor),M.fillPanel.onColorChanged=M.setFillColor,M}return W(A,k),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=A.typeName,C},A.typeName="CoverMarker",A.title="Cover marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',A}(p),x=function(k){function A(C,B,K,M){var ie=k.call(this,C,M||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ie.opacities=[],ie.opacityBoxes=[],ie.opacities=B,ie.currentOpacity=K,ie.setCurrentOpacity=ie.setCurrentOpacity.bind(ie),ie}return W(A,k),A.prototype.getUi=function(){var C=this,B=document.createElement("div");return B.style.display="flex",B.style.overflow="hidden",B.style.flexGrow="2",B.style.justifyContent="space-between",this.opacities.forEach(function(K){var M=document.createElement("div");M.style.display="flex",M.style.alignItems="center",M.style.justifyContent="center",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.borderColor=K===C.currentOpacity?C.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){C.setCurrentOpacity(K,M)}),B.appendChild(M);var ie=document.createElement("div");ie.innerText=100*K+"%",M.appendChild(ie),C.opacityBoxes.push(M)}),B},A.prototype.setCurrentOpacity=function(C,B){var K=this;this.currentOpacity=C,this.opacityBoxes.forEach(function(M){M.style.borderColor=M===B?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},A}(i),P=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.setOpacity=M.setOpacity.bind(M),M.fillColor=K.defaultHighlightColor,M.strokeWidth=0,M.opacity=K.defaultHighlightOpacity,M.fillPanel=new d("Color",K.defaultColorSet,M.fillColor),M.fillPanel.onColorChanged=M.setFillColor,M.opacityPanel=new x("Opacity",K.defaultOpacitySteps,M.opacity),M.opacityPanel.onOpacityChanged=M.setOpacity,M}return W(A,k),A.prototype.setOpacity=function(C){this.opacity=C,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=A.typeName,C},A.typeName="HighlightMarker",A.title="Highlight marker",A.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',A}(D),H='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',I=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.bgColor="transparent",M.tipPosition={x:0,y:0},M.tipBase1Position={x:0,y:0},M.tipBase2Position={x:0,y:0},M.tipMoving=!1,M.color=K.defaultStrokeColor,M.bgColor=K.defaultFillColor,M.fontFamily=K.defaultFontFamily,M.defaultSize={x:100,y:30},M.setBgColor=M.setBgColor.bind(M),M.getTipPoints=M.getTipPoints.bind(M),M.positionTip=M.positionTip.bind(M),M.setTipPoints=M.setTipPoints.bind(M),M.colorPanel=new d("Text color",K.defaultColorSet,M.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),M.colorPanel.onColorChanged=M.setColor,M.bgColorPanel=new d("Fill color",K.defaultColorSet,M.bgColor,H),M.bgColorPanel.onColorChanged=M.setBgColor,M.fontFamilyPanel=new h("Font",K.defaultFontFamilies,K.defaultFontFamily),M.fontFamilyPanel.onFontChanged=M.setFont,M.tipGrip=new n,M.tipGrip.visual.transform.baseVal.appendItem(O.createTransform()),M.controlBox.appendChild(M.tipGrip.visual),M}return W(A,k),A.prototype.ownsTarget=function(C){return k.prototype.ownsTarget.call(this,C)||this.tipGrip.ownsTarget(C)||this.tip===C},A.prototype.createTip=function(){O.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=O.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},A.prototype.pointerDown=function(C,B){this.state==="new"&&k.prototype.pointerDown.call(this,C,B),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(B)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):k.prototype.pointerDown.call(this,C,B)},A.prototype.pointerUp=function(C){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,k.prototype.pointerUp.call(this,C);else{var B=this.state==="creating";k.prototype.pointerUp.call(this,C),this.setTipPoints(B),this.positionTip()}},A.prototype.manipulate=function(C){if(this.tipMoving){var B=this.unrotatePoint(C);this.tipPosition={x:B.x-this.manipulationStartLeft,y:B.y-this.manipulationStartTop},this.positionTip()}else k.prototype.manipulate.call(this,C)},A.prototype.setBgColor=function(C){this.bgRectangle&&this.tip&&(O.setAttributes(this.bgRectangle,[["fill",C]]),O.setAttributes(this.tip,[["fill",C]])),this.bgColor=C,this.fillColorChanged(C)},A.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},A.prototype.setTipPoints=function(C){C===void 0&&(C=!1);var B=Math.min(this.height/2,15),K=this.height/5;C&&(this.tipPosition={x:B+K/2,y:this.height+20});var M=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?M<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(K=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:0},this.tipBase2Position={x:B+K,y:0}):(this.tipBase1Position={x:0,y:B},this.tipBase2Position={x:0,y:B+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?M<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(K=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-K,y:0},this.tipBase2Position={x:this.width-B,y:0}):(this.tipBase1Position={x:this.width,y:B},this.tipBase2Position={x:this.width,y:B+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?M<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(K=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-B-K,y:this.height},this.tipBase2Position={x:this.width-B,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-B-K},this.tipBase2Position={x:this.width,y:this.height-B}):M<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(K=this.width/5,B=Math.min(this.width/2,15),this.tipBase1Position={x:B,y:this.height},this.tipBase2Position={x:B+K,y:this.height}):(this.tipBase1Position={x:0,y:this.height-B},this.tipBase2Position={x:0,y:this.height-B-K})},A.prototype.resize=function(C){k.prototype.resize.call(this,C),this.positionTip()},A.prototype.positionTip=function(){O.setAttributes(this.tip,[["points",this.getTipPoints()]]);var C=this.tipGrip.visual.transform.baseVal.getItem(0);C.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(C,0)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),A.prototype.select=function(){this.positionTip(),k.prototype.select.call(this)},A.prototype.getState=function(){var C=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},k.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){var B=C;this.bgColor=B.bgColor,this.tipPosition=B.tipPosition,k.prototype.restoreState.call(this,C),this.createTip(),this.setTipPoints()},A.prototype.scale=function(C,B){k.prototype.scale.call(this,C,B),this.tipPosition={x:this.tipPosition.x*C,y:this.tipPosition.y*B},this.positionTip()},A.typeName="CalloutMarker",A.title="Callout marker",A.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',A}(E),z=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.fillColor="transparent",M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.opacity=1,M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.fillColor=K.defaultFillColor,M.setStrokeColor=M.setStrokeColor.bind(M),M.setFillColor=M.setFillColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.setOpacity=M.setOpacity.bind(M),M.createVisual=M.createVisual.bind(M),M.strokePanel=new d("Line color",S(K.defaultColorSet,["transparent"]),K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.fillPanel=new d("Fill color",S(K.defaultColorSet,["transparent"]),M.fillColor,H),M.fillPanel.onColorChanged=M.setFillColor,M.strokeWidthPanel=new m("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new b("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M.opacityPanel=new x("Opacity",K.defaultOpacitySteps,M.opacity),M.opacityPanel.onOpacityChanged=M.setOpacity,M}return W(A,k),A.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual)},A.prototype.createVisual=function(){this.visual=O.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(C,B){k.prototype.pointerDown.call(this,C,B),this.state==="new"&&(this.createVisual(),this.moveVisual(C),this._state="creating")},A.prototype.manipulate=function(C){k.prototype.manipulate.call(this,C)},A.prototype.resize=function(C){k.prototype.resize.call(this,C),this.setSize()},A.prototype.setSize=function(){k.prototype.setSize.call(this),O.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},A.prototype.pointerUp=function(C){k.prototype.pointerUp.call(this,C),this.setSize()},A.prototype.setStrokeColor=function(C){this.strokeColor=C,this.visual&&O.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(C),this.stateChanged()},A.prototype.setFillColor=function(C){this.fillColor=C,this.visual&&O.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(C),this.stateChanged()},A.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.visual&&O.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},A.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.visual&&O.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},A.prototype.setOpacity=function(C){this.opacity=C,this.visual&&O.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},k.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){var B=C;this.fillColor=B.fillColor,this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.opacity=B.opacity,this.createVisual(),k.prototype.restoreState.call(this,C),this.setSize()},A.prototype.scale=function(C,B){k.prototype.scale.call(this,C,B),this.setSize()},A.typeName="EllipseMarker",A.title="Ellipse marker",A.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',A}(v),$=function(k){function A(C,B,K){return k.call(this,C,B,K)||this}return W(A,k),Object.defineProperty(A.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),A.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.tip1&&C!==this.tip2)},A.prototype.createTips=function(){this.tip1=O.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.tip1),this.tip2=O.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(O.createTransform()),this.visual.appendChild(this.tip2)},A.prototype.pointerDown=function(C,B){k.prototype.pointerDown.call(this,C,B),this.state==="creating"&&this.createTips()},A.prototype.adjustVisual=function(){if(k.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(O.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var C=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),B=this.tip1.transform.baseVal.getItem(0);B.setRotate(C,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(B,0);var K=this.tip2.transform.baseVal.getItem(0);K.setRotate(C+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(K,0)}},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C),this.createTips(),this.adjustVisual()},A.typeName="MeasurementMarker",A.title="Measurement marker",A.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',A}(l),fe=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.strokePanel.colors=K.defaultColorSet,M.fillColor="transparent",M}return W(A,k),Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=k.prototype.getState.call(this);return C.typeName=A.typeName,C},A.typeName="EllipseFrameMarker",A.title="Ellipse frame marker",A.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',A}(z),ee=function(){function k(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(k.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),k.prototype.addUndoStep=function(A){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(A)||(this.undoStack.push(A),JSON.stringify(this.lastRedoStep)!==JSON.stringify(A)&&this.redoStack.splice(0,this.redoStack.length))},k.prototype.replaceLastUndoStep=function(A){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=A)},k.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},k.prototype.undo=function(){if(this.undoStack.length>1){var A=this.undoStack.pop();return A!==void 0&&this.redoStack.push(A),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},k.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},k}(),ye=function(k){function A(C,B,K){var M=k.call(this,C,B,K)||this;return M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.curveX=0,M.curveY=0,M.manipulationStartCurveX=0,M.manipulationStartCurveY=0,M.setStrokeColor=M.setStrokeColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.positionGrips=M.positionGrips.bind(M),M.addControlGrips=M.addControlGrips.bind(M),M.adjustVisual=M.adjustVisual.bind(M),M.setupControlBox=M.setupControlBox.bind(M),M.resize=M.resize.bind(M),M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.strokePanel=new d("Line color",K.defaultColorSet,K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new m("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new b("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return W(A,k),A.prototype.ownsTarget=function(C){return!(!k.prototype.ownsTarget.call(this,C)&&C!==this.visual&&C!==this.selectorCurve&&C!==this.visibleCurve&&!this.curveGrip.ownsTarget(C))},A.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},A.prototype.createVisual=function(){this.visual=O.createGroup(),this.selectorCurve=O.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=O.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},A.prototype.pointerDown=function(C,B){k.prototype.pointerDown.call(this,C,B),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=C.x,this.curveY=C.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(B)&&(this.activeGrip=this.curveGrip,this._state="resize")},A.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),O.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),O.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),O.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},A.prototype.setupControlBox=function(){k.prototype.setupControlBox.call(this),this.curveControlLine1=O.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=O.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},A.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,k.prototype.addControlGrips.call(this)},A.prototype.positionGrips=function(){k.prototype.positionGrips.call(this);var C=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-C/2,this.curveY-C/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},A.prototype.manipulate=function(C){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+C.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+C.y-this.manipulationStartY),k.prototype.manipulate.call(this,C)},A.prototype.resize=function(C){this.activeGrip===this.curveGrip&&(this.curveX=C.x,this.curveY=C.y),k.prototype.resize.call(this,C),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},A.prototype.setStrokeColor=function(C){this.strokeColor=C,this.adjustVisual(),this.colorChanged(C)},A.prototype.setStrokeWidth=function(C){this.strokeWidth=C,this.adjustVisual()},A.prototype.setStrokeDasharray=function(C){this.strokeDasharray=C,this.adjustVisual()},A.prototype.scale=function(C,B){this.curveX=this.curveX*C,this.curveY=this.curveY*B,k.prototype.scale.call(this,C,B)},Object.defineProperty(A.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),A.prototype.getState=function(){var C=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},k.prototype.getState.call(this));return C.typeName=A.typeName,C},A.prototype.restoreState=function(C){k.prototype.restoreState.call(this,C);var B=C;this.strokeColor=B.strokeColor,this.strokeWidth=B.strokeWidth,this.strokeDasharray=B.strokeDasharray,this.curveX=B.curveX,this.curveY=B.curveY,this.createVisual(),this.adjustVisual()},A.typeName="CurveMarker",A.title="Curve marker",A.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',A}(f),pe=function(){function k(A,C){C===void 0&&(C=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=A,this.cancelable=C}return Object.defineProperty(k.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),k.prototype.preventDefault=function(){this._defaultPrevented=!0},k}(),ae=function(k){function A(C,B,K){var M=k.call(this,C,!1)||this;return M.dataUrl=B,M.state=K,M}return W(A,k),A}(pe),se=function(k){function A(C,B,K){K===void 0&&(K=!1);var M=k.call(this,C,K)||this;return M.marker=B,M}return W(A,k),A}(pe),_e=function(){function k(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return k.prototype.addEventListener=function(A,C){this[A].push(C)},k.prototype.removeEventListener=function(A,C){var B=this[A].indexOf(C);B>-1&&this[A].splice(B,1)},k}(),te=function(){function k(A){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new o,this._isOpen=!1,this.undoRedoManager=new ee,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new _e,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=k.instanceCounter++,this.styles=new w(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=A,this.targetRoot=document.body,this.width=A.clientWidth,this.height=A.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(k.prototype,"ALL_MARKER_TYPES",{get:function(){return[_,y,L,E,fe,z,P,I,$,D,l,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[_,y,L,E,z,P,I]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"BASIC_MARKER_TYPES",{get:function(){return[_,y,L,E,P]},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(A){var C=this;this._availableMarkerTypes.splice(0),A.forEach(function(B){if(typeof B=="string"){var K=C.ALL_MARKER_TYPES.find(function(M){return M.typeName===B});K!==void 0&&C._availableMarkerTypes.push(K)}else C._availableMarkerTypes.push(B)})},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(A){this._zoomLevel=A,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),k.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),F.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},k.prototype.show=function(){var A=this;this.styles.styleSheetRoot===void 0&&e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(C){return C(new pe(A))})},k.prototype.render=function(){return R(this,void 0,void 0,function(){var A;return N(this,function(C){switch(C.label){case 0:return this.setCurrentMarker(),(A=new j).naturalSize=this.renderAtNaturalSize,A.imageType=this.renderImageType,A.imageQuality=this.renderImageQuality,A.markersOnly=this.renderMarkersOnly,A.width=this.renderWidth,A.height=this.renderHeight,[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return C.sent(),[4,A.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,C.sent()]}})})},k.prototype.close=function(A){var C=this;if(A===void 0&&(A=!1),this.isOpen){var B=!1;A||this.eventListeners.beforeclose.forEach(function(K){var M=new pe(C,!0);K(M),M.defaultPrevented&&(B=!0)}),B||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(K){return K(new pe(C))}),this.detachEvents(),this._isOpen=!1)}},k.prototype.addMarkersToToolbar=function(){for(var A,C=[],B=0;B<arguments.length;B++)C[B]=arguments[B];(A=this._availableMarkerTypes).push.apply(A,C)},k.prototype.addRenderEventListener=function(A){this.addEventListener("render",function(C){A(C.dataUrl,C.state)})},k.prototype.removeRenderEventListener=function(A){},k.prototype.addCloseEventListener=function(A){this.addEventListener("close",function(){A()})},k.prototype.removeCloseEventListener=function(A){},k.prototype.setupResizeObserver=function(){var A=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){A.resize(A.target.clientWidth,A.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return A.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},k.prototype.onPopupTargetResize=function(){var A=1*this.target.clientWidth/this.target.clientHeight,C=this.editorCanvas.clientWidth/A>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*A:this.editorCanvas.clientWidth,B=C<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/A;this.resize(C,B)},k.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},k.prototype.resize=function(A,C){this._isResizing=!0;var B=A/this.imageWidth,K=C/this.imageHeight;this.imageWidth=Math.round(A),this.imageHeight=Math.round(C),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(B,K),this._isResizing=!1},k.prototype.scaleMarkers=function(A,C){var B,K=this;this._currentMarker&&this._currentMarker instanceof E?this._currentMarker.scale(A,C):(B=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(M){M!==K._currentMarker&&M.scale(A,C)}),B!==void 0&&this.setCurrentMarker(B)},k.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},k.prototype.setTopLeft=function(){var A=this.editingTarget.getBoundingClientRect(),C=this.editorCanvas.getBoundingClientRect();this.left=A.left-C.left,this.top=A.top-C.top},k.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},k.prototype.addDefs=function(){for(var A,C=[],B=0;B<arguments.length;B++)C[B]=arguments[B];this.defs=O.createDefs(),this.addDefsToImage(),(A=this.defs).append.apply(A,C)},k.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},k.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},k.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},k.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},k.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},k.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},k.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},k.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var A=document.createElement("a");A.href="https://markerjs.com/",A.target="_blank",A.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',A.title="Powered by marker.js",A.style.display="grid",A.style.alignItems="center",A.style.justifyItems="center",A.style.padding="3px",A.style.width="20px",A.style.height="20px",this.logoUI.appendChild(A),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},k.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},k.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},k.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},k.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new u(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new a(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},k.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},k.prototype.removeMarker=function(A){this.markerImage.removeChild(A.container),this.markers.indexOf(A)>-1&&this.markers.splice(this.markers.indexOf(A),1),A.dispose()},k.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},k.prototype.toolbarButtonClicked=function(A,C){if(A==="marker"&&C!==void 0)this.createNewMarker(C);else if(A==="action")switch(C){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},k.prototype.deleteSelectedMarker=function(){var A=this;if(this._currentMarker!==void 0){var C=!1;if(this.eventListeners.markerbeforedelete.forEach(function(K){var M=new se(A,A._currentMarker,!0);K(M),M.defaultPrevented&&(C=!0)}),!C){var B=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(K){return K(new se(A,B))})}}},k.prototype.clear=function(){var A=this,C=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ie){var Ee=new se(A,void 0,!0);ie(Ee),Ee.defaultPrevented&&(C=!0)}),!C)){this.setCurrentMarker();for(var B=function(ie){var Ee=K.markers[ie];K.setCurrentMarker(K.markers[ie]),K._currentMarker.dispose(),K.markerImage.removeChild(K._currentMarker.container),K.markers.splice(K.markers.indexOf(K._currentMarker),1),K.eventListeners.markerdelete.forEach(function(Oe){return Oe(new se(A,Ee))})},K=this,M=this.markers.length-1;M>=0;M--)B(M);this.addUndoStep()}},Object.defineProperty(k.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),k.prototype.showNotesEditor=function(){var A;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(A=this._currentMarker.notes)!==null&&A!==void 0?A:"",this.overlayContainer.appendChild(this.notesArea))},k.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},k.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},k.prototype.addUndoStep=function(){var A=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var C=this.getState(),B=this.undoRedoManager.getLastUndoStep();if(!B||B.width===C.width&&B.height===C.height){var K=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(C),K<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(M){return M(new pe(A))})}else this.undoRedoManager.replaceLastUndoStep(C),this.eventListeners.statechange.forEach(function(M){return M(new pe(A))})}},k.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},k.prototype.undoStep=function(){var A=this,C=this.undoRedoManager.undo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new pe(A))}))},k.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},k.prototype.redoStep=function(){var A=this,C=this.undoRedoManager.redo();C!==void 0&&(this.restoreState(C),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(B){return B(new pe(A))}))},k.prototype.stepZoom=function(){var A=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=A<this.zoomSteps.length-1?this.zoomSteps[A+1]:this.zoomSteps[0]},k.prototype.panTo=function(A){this.contentDiv.scrollBy({left:this.prevPanPoint.x-A.x,top:this.prevPanPoint.y-A.y}),this.prevPanPoint=A},k.prototype.startRenderAndClose=function(){return R(this,void 0,void 0,function(){var A,C,B=this;return N(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return A=K.sent(),C=this.getState(),this.eventListeners.render.forEach(function(M){return M(new ae(B,A,C))}),this.close(!0),[2]}})})},k.prototype.getState=function(A){A===!0&&this.setCurrentMarker();var C={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(B){return C.markers.push(B.getState())}),C},k.prototype.restoreState=function(A){var C=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);A.markers.forEach(function(B){var K=C._availableMarkerTypes.find(function(ie){return ie.typeName===B.typeName});if(K!==void 0){var M=C.addNewMarker(K);M.restoreState(B),C.markers.push(M)}}),A.width&&A.height&&(A.width!==this.imageWidth||A.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/A.width,this.imageHeight/A.height),this.eventListeners.restorestate.forEach(function(B){return B(new pe(C))})},k.prototype.addNewMarker=function(A){var C=O.createGroup();return this.markerImage.appendChild(C),new A(C,this.overlayContainer,this.settings)},k.prototype.createNewMarker=function(A){var C,B=this;(C=typeof A=="string"?this._availableMarkerTypes.find(function(K){return K.typeName===A}):A)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(C),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(C.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(K){return K(new se(B,B._currentMarker))}))},k.prototype.markerCreated=function(A){var C=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(A),this.setCurrentMarker(A),A instanceof y&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(y):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(B){return B(new se(C,C._currentMarker))})},k.prototype.colorChanged=function(A){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=A,this.settings.defaultStrokeColor=A)},k.prototype.fillColorChanged=function(A){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=A)},k.prototype.markerStateChanged=function(A){var C=this;this.eventListeners.markerchange.forEach(function(B){return B(new se(C,A))})},k.prototype.setCurrentMarker=function(A){var C=this;this._currentMarker!==A&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(B){return B(new se(C,C._currentMarker))})),this._currentMarker=A,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(B){return B(new se(C,C._currentMarker))}))},k.prototype.onPointerDown=function(A){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||A.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var C=this.markers.find(function(B){return B.ownsTarget(A.target)});C!==void 0?(this.setCurrentMarker(C),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(A.clientX,A.clientY),A.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:A.clientX,y:A.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(A.clientX,A.clientY))},k.prototype.onDblClick=function(A){if(this._isFocused||this.focus(),this.mode==="select"){var C=this.markers.find(function(B){return B.ownsTarget(A.target)});C!==void 0&&C!==this._currentMarker&&this.setCurrentMarker(C),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(A.clientX,A.clientY),A.target):this.setCurrentMarker()}},k.prototype.onPointerMove=function(A){this.touchPoints!==1&&A.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||A.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(A.clientX,A.clientY)):this.zoomLevel>1&&this.panTo({x:A.clientX,y:A.clientY}))},k.prototype.onPointerUp=function(A){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(A.clientX,A.clientY)),this.isDragging=!1,this.addUndoStep()},k.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},k.prototype.onKeyUp=function(A){this._currentMarker===void 0||this.notesArea!==void 0||A.key!=="Delete"&&A.key!=="Backspace"||this.deleteSelectedMarker()},k.prototype.clientToLocalCoordinates=function(A,C){var B=this.markerImage.getBoundingClientRect();return{x:(A-B.left)/this.zoomLevel,y:(C-B.top)/this.zoomLevel}},k.prototype.onWindowResize=function(){this.positionUI()},k.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var A=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=A+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},k.prototype.addLicenseKey=function(A){F.addKey(A)},k.prototype.addEventListener=function(A,C){this.eventListeners.addEventListener(A,C)},k.prototype.removeEventListener=function(A,C){this.eventListeners.removeEventListener(A,C)},k.prototype.renderState=function(A){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(A),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(k.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),k.prototype.focus=function(){var A=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(C){return C(new pe(A))}))},k.prototype.blur=function(){var A=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(C){return C(new pe(A))}))},k.instanceCounter=0,k}()},T8No:function(Ge,be,U){"use strict";U.d(be,"a",function(){return F}),U.d(be,"e",function(){return j}),U.d(be,"c",function(){return l}),U.d(be,"b",function(){return h}),U.d(be,"d",function(){return E}),U.d(be,"f",function(){return L});var ue=U("MNsG"),W=U("N0LK"),R=U("Cg/j");let N=ue.k||"";const S=new Map;S.set("false",!1),S.set("true",!0),S.set("isMac",ue.f),S.set("isLinux",ue.d),S.set("isWindows",ue.i),S.set("isWeb",ue.h),S.set("isMacNative",ue.f&&!ue.h),S.set("isEdge",N.indexOf("Edg/")>=0),S.set("isFirefox",N.indexOf("Firefox")>=0),S.set("isChrome",N.indexOf("Chrome")>=0),S.set("isSafari",N.indexOf("Safari")>=0);const O=Object.prototype.hasOwnProperty;class F{static has(x){return c.create(x)}static equals(x,P){return u.create(x,P)}static regex(x,P){return m.create(x,P)}static not(x){return s.create(x)}static and(...x){return o.create(x,null)}static or(...x){return f.create(x,null,!0)}static deserialize(x,P=!1){return x?this._deserializeOrExpression(x,P):void 0}static _deserializeOrExpression(x,P){let H=x.split("||");return f.create(H.map(I=>this._deserializeAndExpression(I,P)),null,!0)}static _deserializeAndExpression(x,P){let H=x.split("&&");return o.create(H.map(I=>this._deserializeOne(I,P)),null)}static _deserializeOne(x,P){if(x=x.trim(),x.indexOf("!=")>=0){let H=x.split("!=");return d.create(H[0].trim(),this._deserializeValue(H[1],P))}if(x.indexOf("==")>=0){let H=x.split("==");return u.create(H[0].trim(),this._deserializeValue(H[1],P))}if(x.indexOf("=~")>=0){let H=x.split("=~");return m.create(H[0].trim(),this._deserializeRegexValue(H[1],P))}if(x.indexOf(" in ")>=0){let H=x.split(" in ");return a.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(x)){const H=x.split(">=");return t.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(x)){const H=x.split(">");return n.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(x)){const H=x.split("<=");return p.create(H[0].trim(),H[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(x)){const H=x.split("<");return v.create(H[0].trim(),H[1].trim())}return/^\!\s*/.test(x)?s.create(x.substr(1).trim()):c.create(x)}static _deserializeValue(x,P){if(x=x.trim(),x==="true")return!0;if(x==="false")return!1;let H=/^'([^']*)'$/.exec(x);return H?H[1].trim():x}static _deserializeRegexValue(x,P){if(Object(W.C)(x)){if(P)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let H=x.indexOf("/"),I=x.lastIndexOf("/");if(H===I||H<0){if(P)throw new Error(`bad regexp-value '${x}', missing /-enclosure`);return console.warn(`bad regexp-value '${x}', missing /-enclosure`),null}let z=x.slice(H+1,I),$=x[I+1]==="i"?"i":"";try{return new RegExp(z,$)}catch(fe){if(P)throw new Error(`bad regexp-value '${x}', parse error: ${fe}`);return console.warn(`bad regexp-value '${x}', parse error: ${fe}`),null}}}function j(x,P){const H=x?x.substituteConstants():void 0,I=P?P.substituteConstants():void 0;return!H&&!I?!0:!H||!I?!1:H.equals(I)}function e(x,P){return x.cmp(P)}class w{constructor(){this.type=0}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}w.INSTANCE=new w;class g{constructor(){this.type=1}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!0}serialize(){return"true"}keys(){return[]}negate(){return w.INSTANCE}}g.INSTANCE=new g;class c{constructor(x,P){this.key=x,this.negated=P,this.type=2}static create(x,P=null){const H=S.get(x);return typeof H=="boolean"?H?g.INSTANCE:w.INSTANCE:new c(x,P)}cmp(x){return x.type!==this.type?this.type-x.type:y(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=S.get(this.key);return typeof x=="boolean"?x?g.INSTANCE:w.INSTANCE:this}evaluate(x){return!!x.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this)),this.negated}}class u{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=4}static create(x,P,H=null){if(typeof P=="boolean")return P?c.create(x,H):s.create(x,H);const I=S.get(x);if(typeof I=="boolean"){const z=I?"true":"false";return P===z?g.INSTANCE:w.INSTANCE}return new u(x,P,H)}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=S.get(this.key);if(typeof x=="boolean"){const P=x?"true":"false";return this.value===P?g.INSTANCE:w.INSTANCE}return this}evaluate(x){return x.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=d.create(this.key,this.value,this)),this.negated}}class a{constructor(x,P){this.key=x,this.valueKey=P,this.type=10,this.negated=null}static create(x,P){return new a(x,P)}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.valueKey,x.key,x.valueKey)}equals(x){return x.type===this.type?this.key===x.key&&this.valueKey===x.valueKey:!1}substituteConstants(){return this}evaluate(x){const P=x.getValue(this.valueKey),H=x.getValue(this.key);return Array.isArray(P)?P.indexOf(H)>=0:typeof H=="string"&&typeof P=="object"&&P!==null?O.call(P,H):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=i.create(this)),this.negated}}class i{constructor(x){this._actual=x,this.type=11}static create(x){return new i(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class d{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=5}static create(x,P,H=null){if(typeof P=="boolean")return P?s.create(x,H):c.create(x,H);const I=S.get(x);if(typeof I=="boolean"){const z=I?"true":"false";return P===z?w.INSTANCE:g.INSTANCE}return new d(x,P,H)}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=S.get(this.key);if(typeof x=="boolean"){const P=x?"true":"false";return this.value===P?w.INSTANCE:g.INSTANCE}return this}evaluate(x){return x.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class s{constructor(x,P){this.key=x,this.negated=P,this.type=3}static create(x,P=null){const H=S.get(x);return typeof H=="boolean"?H?w.INSTANCE:g.INSTANCE:new s(x,P)}cmp(x){return x.type!==this.type?this.type-x.type:y(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=S.get(this.key);return typeof x=="boolean"?x?w.INSTANCE:g.INSTANCE:this}evaluate(x){return!x.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this)),this.negated}}function r(x,P){if(typeof x=="string"){const H=parseFloat(x);isNaN(H)||(x=H)}return typeof x=="string"||typeof x=="number"?P(x):w.INSTANCE}class n{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=12}static create(x,P,H=null){return r(P,I=>new n(x,I,H))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class t{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=13}static create(x,P,H=null){return r(P,I=>new t(x,I,H))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this.value,this)),this.negated}}class v{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=14}static create(x,P,H=null){return r(P,I=>new v(x,I,H))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}class p{constructor(x,P,H){this.key=x,this.value=P,this.negated=H,this.type=15}static create(x,P,H=null){return r(P,I=>new p(x,I,H))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class m{constructor(x,P){this.key=x,this.regexp=P,this.type=7,this.negated=null}static create(x,P){return new m(x,P)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.key<x.key)return-1;if(this.key>x.key)return 1;const P=this.regexp?this.regexp.source:"",H=x.regexp?x.regexp.source:"";return P<H?-1:P>H?1:0}equals(x){if(x.type===this.type){const P=this.regexp?this.regexp.source:"",H=x.regexp?x.regexp.source:"";return this.key===x.key&&P===H}return!1}substituteConstants(){return this}evaluate(x){let P=x.getValue(this.key);return this.regexp?this.regexp.test(P):!1}serialize(){const x=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${x}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this)),this.negated}}class b{constructor(x){this._actual=x,this.type=8}static create(x){return new b(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function _(x){let P=null;for(let H=0,I=x.length;H<I;H++){const z=x[H].substituteConstants();if(x[H]!==z&&P===null){P=[];for(let $=0;$<H;$++)P[$]=x[$]}P!==null&&(P[H]=z)}return P===null?x:P}class o{constructor(x,P){this.expr=x,this.negated=P,this.type=6}static create(x,P){return o._normalizeArr(x,P)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let P=0,H=this.expr.length;P<H;P++){const I=e(this.expr[P],x.expr[P]);if(I!==0)return I}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let P=0,H=this.expr.length;P<H;P++)if(!this.expr[P].equals(x.expr[P]))return!1;return!0}return!1}substituteConstants(){const x=_(this.expr);return x===this.expr?this:o.create(x,this.negated)}evaluate(x){for(let P=0,H=this.expr.length;P<H;P++)if(!this.expr[P].evaluate(x))return!1;return!0}static _normalizeArr(x,P){const H=[];let I=!1;for(const z of x){if(!z)continue;if(z.type===1){I=!0;continue}if(z.type===0)return w.INSTANCE;if(z.type===6){H.push(...z.expr);continue}H.push(z)}if(H.length===0&&I)return g.INSTANCE;if(H.length===0)return;if(H.length===1)return H[0];H.sort(e);for(let z=1;z<H.length;z++)H[z-1].equals(H[z])&&(H.splice(z,1),z--);if(H.length===1)return H[0];for(;H.length>1;){const z=H[H.length-1];if(z.type!==9)break;H.pop();const $=H.pop(),fe=H.length===0,ee=f.create(z.expr.map(ye=>o.create([ye,$],null)),null,fe);ee&&(H.push(ee),H.sort(e))}return H.length===1?H[0]:new o(H,P)}serialize(){return this.expr.map(x=>x.serialize()).join(" && ")}keys(){const x=[];for(let P of this.expr)x.push(...P.keys());return x}negate(){if(!this.negated){const x=[];for(let P of this.expr)x.push(P.negate());this.negated=f.create(x,this,!0)}return this.negated}}class f{constructor(x,P){this.expr=x,this.negated=P,this.type=9}static create(x,P,H){return f._normalizeArr(x,P,H)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let P=0,H=this.expr.length;P<H;P++){const I=e(this.expr[P],x.expr[P]);if(I!==0)return I}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let P=0,H=this.expr.length;P<H;P++)if(!this.expr[P].equals(x.expr[P]))return!1;return!0}return!1}substituteConstants(){const x=_(this.expr);return x===this.expr?this:f.create(x,this.negated,!1)}evaluate(x){for(let P=0,H=this.expr.length;P<H;P++)if(this.expr[P].evaluate(x))return!0;return!1}static _normalizeArr(x,P,H){let I=[],z=!1;if(x){for(let $=0,fe=x.length;$<fe;$++){const ee=x[$];if(!ee)continue;if(ee.type===0){z=!0;continue}if(ee.type===1)return g.INSTANCE;if(ee.type===9){I=I.concat(ee.expr);continue}I.push(ee)}if(I.length===0&&z)return w.INSTANCE;I.sort(e)}if(I.length===0)return;if(I.length===1)return I[0];for(let $=1;$<I.length;$++)I[$-1].equals(I[$])&&(I.splice($,1),$--);if(I.length===1)return I[0];if(H){for(let $=0;$<I.length;$++)for(let fe=$+1;fe<I.length;fe++)L(I[$],I[fe])&&(I.splice(fe,1),fe--);if(I.length===1)return I[0]}return new f(I,P)}serialize(){return this.expr.map(x=>x.serialize()).join(" || ")}keys(){const x=[];for(let P of this.expr)x.push(...P.keys());return x}negate(){if(!this.negated){let x=[];for(let P of this.expr)x.push(P.negate());for(;x.length>1;){const P=x.shift(),H=x.shift(),I=[];for(const $ of D(P))for(const fe of D(H))I.push(o.create([$,fe],null));const z=x.length===0;x.unshift(f.create(I,null,z))}this.negated=x[0]}return this.negated}}class l extends c{constructor(x,P,H){super(x,null);this._defaultValue=P,typeof H=="object"?l._info.push(Object.assign(Object.assign({},H),{key:x})):H!==!0&&l._info.push({key:x,description:H,type:P!=null?typeof P:void 0})}static all(){return l._info.values()}bindTo(x){return x.createKey(this.key,this._defaultValue)}getValue(x){return x.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(x){return u.create(this.key,x)}}l._info=[];const h=Object(R.c)("contextKeyService"),E="setContext";function y(x,P){return x<P?-1:x>P?1:0}function T(x,P,H,I){return x<H?-1:x>H?1:P<I?-1:P>I?1:0}function L(x,P){if(P.type===6&&x.type!==9&&x.type!==6){for(const z of P.expr)if(x.equals(z))return!0}const H=x.negate(),I=D(H).concat(D(P));I.sort(e);for(let z=0;z<I.length;z++){const $=I[z],fe=$.negate();for(let ee=z+1;ee<I.length;ee++){const ye=I[ee];if(fe.equals(ye))return!0}}return!1}function D(x){return x.type===9?x.expr:[x]}},TXwP:function(Ge,be,U){var ue,W;(function(){var R;(function(){"use strict";var S=[,,function(e){function w(u){this.__parent=u,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}w.prototype.clone_empty=function(){var u=new w(this.__parent);return u.set_indent(this.__indent_count,this.__alignment_count),u},w.prototype.item=function(u){return u<0?this.__items[this.__items.length+u]:this.__items[u]},w.prototype.has_match=function(u){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(u))return!0;return!1},w.prototype.set_indent=function(u,a){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},w.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},w.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},w.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(u){this.__items.push(u);var a=u.lastIndexOf(`
`);a!==-1?this.__character_count=u.length-a:this.__character_count+=u.length},w.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function g(u,a){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),a=a||"",u.indent_level>0&&(a=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}g.prototype.get_indent_size=function(u,a){var i=this.__base_string_length;return a=a||0,u<0&&(i=0),i+=u*this.__indent_size,i+=a,i},g.prototype.get_indent_string=function(u,a){var i=this.__base_string;return a=a||0,u<0&&(u=0,i=""),a+=u*this.__indent_size,this.__ensure_cache(a),i+=this.__cache[a],i},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,a=0,i="";this.__indent_size&&u>=this.__indent_size&&(a=Math.floor(u/this.__indent_size),u-=a*this.__indent_size,i=new Array(a+1).join(this.__indent_string)),u&&(i+=new Array(u+1).join(" ")),this.__cache.push(i)};function c(u,a){this.__indent_cache=new g(u,a),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(u,a){return this.__indent_cache.get_indent_string(u,a)},c.prototype.get_indent_size=function(u,a){return this.__indent_cache.get_indent_size(u,a)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(u){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return u!==`
`&&(i=i.replace(/[\n]/g,u)),i},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(u,a){return u=u||0,a=a||0,this.next_line.set_indent(u,a),this.__lines.length>1?(this.current_line.set_indent(u,a),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(u){for(var a=0;a<u.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(u.whitespace_before),this.current_line.push(u.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},c.prototype.add_token=function(u){this.__add_space_before_token(),this.current_line.push(u),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},c.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},c.prototype.remove_indent=function(u){for(var a=this.__lines.length;u<a;)this.__lines[u]._remove_indent(),u++;this.current_line._remove_wrap_indent()},c.prototype.trim=function(u){for(u=u===void 0?!1:u,this.current_line.trim();u&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(u,a){for(var i=this.__lines.length-2;i>=0;){var d=this.__lines[i];if(d.is_empty())break;if(d.item(0).indexOf(u)!==0&&d.item(-1)!==a){this.__lines.splice(i+1,0,new w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=c},,,,function(e){function w(u,a){this.raw_options=g(u,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}w.prototype._get_array=function(u,a){var i=this.raw_options[u],d=a||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(d=i.concat()):typeof i=="string"&&(d=i.split(/[^a-zA-Z0-9_\/\-]+/)),d},w.prototype._get_boolean=function(u,a){var i=this.raw_options[u],d=i===void 0?!!a:!!i;return d},w.prototype._get_characters=function(u,a){var i=this.raw_options[u],d=a||"";return typeof i=="string"&&(d=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),d},w.prototype._get_number=function(u,a){var i=this.raw_options[u];a=parseInt(a,10),isNaN(a)&&(a=0);var d=parseInt(i,10);return isNaN(d)&&(d=a),d},w.prototype._get_selection=function(u,a,i){var d=this._get_selection_list(u,a,i);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+u+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[u]+"'");return d[0]},w.prototype._get_selection_list=function(u,a,i){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[a[0]],!this._is_valid_selection(i,a))throw new Error("Invalid Default Value!");var d=this._get_array(u,i);if(!this._is_valid_selection(d,a))throw new Error("Invalid Option Value: The option '"+u+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[u]+"'");return d},w.prototype._is_valid_selection=function(u,a){return u.length&&a.length&&!u.some(function(i){return a.indexOf(i)===-1})};function g(u,a){var i={};u=c(u);var d;for(d in u)d!==a&&(i[d]=u[d]);if(a&&u[a])for(d in u[a])i[d]=u[a][d];return i}function c(u){var a={},i;for(i in u){var d=i.replace(/-/g,"_");a[d]=u[i]}return a}e.exports.Options=w,e.exports.normalizeOpts=c,e.exports.mergeOpts=g},,function(e){var w=RegExp.prototype.hasOwnProperty("sticky");function g(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position<this.__input_length},g.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},g.prototype.peek=function(c){var u=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(u=this.__input.charAt(c)),u},g.prototype.__match=function(c,u){c.lastIndex=u;var a=c.exec(this.__input);return a&&!(w&&c.sticky)&&(a.index!==u&&(a=null)),a},g.prototype.test=function(c,u){return u=u||0,u+=this.__position,u>=0&&u<this.__input_length?!!this.__match(c,u):!1},g.prototype.testChar=function(c,u){var a=this.peek(u);return c.lastIndex=0,a!==null&&c.test(a)},g.prototype.match=function(c){var u=this.__match(c,this.__position);return u?this.__position+=u[0].length:u=null,u},g.prototype.read=function(c,u,a){var i="",d;return c&&(d=this.match(c),d&&(i+=d[0])),u&&(d||!c)&&(i+=this.readUntil(u,a)),i},g.prototype.readUntil=function(c,u){var a="",i=this.__position;c.lastIndex=this.__position;var d=c.exec(this.__input);return d?(i=d.index,u&&(i+=d[0].length)):i=this.__input_length,a=this.__input.substring(this.__position,i),this.__position=i,a},g.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},g.prototype.get_regexp=function(c,u){var a=null,i="g";return u&&w&&(i="y"),typeof c=="string"&&c!==""?a=new RegExp(c,i):c&&(a=new RegExp(c.source,i)),a},g.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(c){var u=this.__position,a=this.readUntilAfter(c);return this.__position=u,a},g.prototype.lookBack=function(c){var u=this.__position-1;return u>=c.length&&this.__input.substring(u-c.length,u).toLowerCase()===c},e.exports.InputScanner=g},,,,,function(e){function w(g,c){g=typeof g=="string"?g:g.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+c,"g")}w.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var u=this.__directive_pattern.exec(g);u;)c[u[1]]=u[2],u=this.__directive_pattern.exec(g);return c},w.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=w},,function(e,w,g){var c=g(16).Beautifier,u=g(17).Options;function a(i,d){var s=new c(i,d);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new u}},function(e,w,g){var c=g(17).Options,u=g(2).Output,a=g(8).InputScanner,i=g(13).Directives,d=new i(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,n=/\s/,t=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,p=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function m(b,_){this._source_text=b||"",this._options=new c(_),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}m.prototype.eatString=function(b){var _="";for(this._ch=this._input.next();this._ch;){if(_+=this._ch,this._ch==="\\")_+=this._input.next();else if(b.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return _},m.prototype.eatWhitespace=function(b){for(var _=n.test(this._input.peek()),o=0;n.test(this._input.peek());)this._ch=this._input.next(),b&&this._ch===`
`&&((o===0||o<this._options.max_preserve_newlines)&&(o++,this._output.add_new_line(!0)));return _},m.prototype.foundNestedPseudoClass=function(){for(var b=0,_=1,o=this._input.peek(_);o;){if(o==="{")return!0;if(o==="(")b+=1;else if(o===")"){if(b===0)return!1;b-=1}else if(o===";"||o==="}")return!1;_++,o=this._input.peek(_)}return!1},m.prototype.print_string=function(b){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(b)},m.prototype.preserveSingleSpace=function(b){b&&(this._output.space_before_token=!0)},m.prototype.indent=function(){this._indentLevel++},m.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var b=this._source_text,_=this._options.eol;_==="auto"&&(_=`
`,b&&s.test(b||"")&&(_=b.match(s)[0])),b=b.replace(r,`
`);var o=b.match(/^[\t ]*/)[0];this._output=new u(this._options,o),this._input=new a(b),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var f=0,l=!1,h=!1,E=!1,y=!1,T=!1,L=!1,D=this._ch,x=!1,P,H,I;P=this._input.read(t),H=P!=="",I=D,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),D=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var z=this._input.read(v),$=d.get_directives(z);$&&$.ignore==="start"&&(z+=d.readIgnored(this._input)),this.print_string(z),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(p)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(H),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var fe=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);fe.match(/[ :]$/)&&(fe=this.eatString(": ").replace(/\s$/,""),this.print_string(fe),this._output.space_before_token=!0),fe=fe.replace(/\s$/,""),fe==="extend"?y=!0:fe==="import"&&(T=!0),fe in this.NESTED_AT_RULE?(this._nestedLevel+=1,fe in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!l&&f===0&&fe.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(H),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),E?(E=!1,l=this._indentLevel>=this._nestedLevel):l=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&l&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(I==="("?this._output.space_before_token=!1:I!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),I==="{"&&this._output.trim(!0),T=!1,y=!1,h&&(this.outdent(),h=!1),this.print_string(this._ch),l=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ee=0;ee<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ee++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ee])){x=!0;break}(l||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&f===0?(this.print_string(":"),h||(h=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ye=I==='"'||I==="'";this.preserveSingleSpace(ye||H),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")x=!1,f===0?(h&&(this.outdent(),h=!1),y=!1,T=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),f++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),f&&(f--,this.outdent()));else{var pe=!1;this._input.lookBack("with")&&(pe=!0),this.preserveSingleSpace(H||pe),this.print_string(this._ch),h&&I==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),L=!0):(this.eatWhitespace(),f++,this.indent())}else if(this._ch===")")f&&(f--,this.outdent()),L&&this._input.peek()===";"&&this._options.selector_separator_newline&&(L=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!h||L)&&f===0&&!T&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&f===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&n.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(H),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),n.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ae=I==='"'||I==="'";this.preserveSingleSpace(ae||H),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&x&&this._output.add_new_line()}var se=this._output.get_code(_);return se},e.exports.Beautifier=m},function(e,w,g){var c=g(6).Options;function u(a){c.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var i=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||i;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<d.length;s++)d[s]!=="expand"?this.brace_style="collapse":this.brace_style=d[s]}u.prototype=new c,e.exports.Options=u}],O={};function F(e){var w=O[e];if(w!==void 0)return w.exports;var g=O[e]={exports:{}};return S[e](g,g.exports,F),g.exports}var j=F(15);R=j})();var N=R;!(ue=[],W=function(){return{css_beautify:N}}.apply(be,ue),W!==void 0&&(Ge.exports=W))})()},Vhoy:function(Ge,be,U){"use strict";U.d(be,"d",function(){return N}),U.d(be,"e",function(){return S}),U.d(be,"c",function(){return O}),U.d(be,"b",function(){return F}),U.d(be,"a",function(){return j});var ue=U("MI8n");class W{constructor(){this._icons=new Map,this._onDidRegister=new ue.b}add(e){const w=this._icons.get(e.id);w?e.description?w.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const R=new W,N=R;function S(e,w){return new F(e,w)}function O(e){return e?e.replace(/\$\((.*?)\)/g,(w,g)=>` ${g} `).trim():""}class F{constructor(e,w,g){this.id=e,this.definition=w,this.description=g,R.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var j;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const w=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function g(a){if(a instanceof F)return["codicon","codicon-"+a.id];const i=w.exec(a.id);if(!i)return g(F.error);let[,d,s]=i;const r=["codicon","codicon-"+d];return s&&r.push("codicon-modifier-"+s.substr(1)),r}e.asClassNameArray=g;function c(a){return g(a).join(" ")}e.asClassName=c;function u(a){return"."+g(a).join(".")}e.asCSSSelector=u})(j||(j={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(F||(F={}))},WaYH:function(Ge,be,U){"use strict";var ue=U("rePB"),W=U("Ff2n"),R=U("VTBJ"),N=U("1OyB"),S=U("vuIU"),O=U("JX7q"),F=U("Ji7U"),j=U("LK+K"),e=U("q1tI"),w=U("TSYQ"),g=U.n(w),c=U("sboe"),u=U("OZM5"),a=function(b){var _=b.prefixCls,o=b.level,f=b.isStart,l=b.isEnd;if(!o)return null;for(var h="".concat(_,"-indent-unit"),E=[],y=0;y<o;y+=1){var T;E.push(e.createElement("span",{key:y,className:g()(h,(T={},Object(ue.a)(T,"".concat(h,"-start"),f[y+1]),Object(ue.a)(T,"".concat(h,"-end"),l[y+1]),Object(ue.a)(T,"".concat(h,"-end-first-level"),!y&&l[0]),T))}))}return e.createElement("span",{"aria-hidden":"true",className:"".concat(_,"-indent")},E)},i=a,d=U("815F"),s="open",r="close",n="---",t=function(m){Object(F.a)(_,m);var b=Object(j.a)(_);function _(){var o;return Object(N.a)(this,_),o=b.apply(this,arguments),o.state={dragNodeHighlight:!1},o.onSelectorClick=function(f){var l=o.props.context.onNodeClick;l(f,Object(d.b)(o.props)),o.isSelectable()?o.onSelect(f):o.onCheck(f)},o.onSelectorDoubleClick=function(f){var l=o.props.context.onNodeDoubleClick;l(f,Object(d.b)(o.props))},o.onSelect=function(f){if(o.isDisabled())return;var l=o.props.context.onNodeSelect;f.preventDefault(),l(f,Object(d.b)(o.props))},o.onCheck=function(f){if(o.isDisabled())return;var l=o.props,h=l.disableCheckbox,E=l.checked,y=o.props.context.onNodeCheck;if(!o.isCheckable()||h)return;f.preventDefault();var T=!E;y(f,Object(d.b)(o.props),T)},o.onMouseEnter=function(f){var l=o.props.context.onNodeMouseEnter;l(f,Object(d.b)(o.props))},o.onMouseLeave=function(f){var l=o.props.context.onNodeMouseLeave;l(f,Object(d.b)(o.props))},o.onContextMenu=function(f){var l=o.props.context.onNodeContextMenu;l(f,Object(d.b)(o.props))},o.onDragStart=function(f){var l=o.props.context.onNodeDragStart;f.stopPropagation(),o.setState({dragNodeHighlight:!0}),l(f,Object(O.a)(o));try{f.dataTransfer.setData("text/plain","")}catch(h){}},o.onDragEnter=function(f){var l=o.props.context.onNodeDragEnter;f.preventDefault(),f.stopPropagation(),l(f,Object(O.a)(o))},o.onDragOver=function(f){var l=o.props.context.onNodeDragOver;f.preventDefault(),f.stopPropagation(),l(f,Object(O.a)(o))},o.onDragLeave=function(f){var l=o.props.context.onNodeDragLeave;f.stopPropagation(),l(f,Object(O.a)(o))},o.onDragEnd=function(f){var l=o.props.context.onNodeDragEnd;f.stopPropagation(),o.setState({dragNodeHighlight:!1}),l(f,Object(O.a)(o))},o.onDrop=function(f){var l=o.props.context.onNodeDrop;f.preventDefault(),f.stopPropagation(),o.setState({dragNodeHighlight:!1}),l(f,Object(O.a)(o))},o.onExpand=function(f){var l=o.props.context.onNodeExpand;l(f,Object(d.b)(o.props))},o.setSelectHandle=function(f){o.selectHandle=f},o.getNodeState=function(){var f=o.props.expanded;return o.isLeaf()?null:f?s:r},o.hasChildren=function(){var f=o.props.eventKey,l=o.props.context.keyEntities,h=l[f]||{},E=h.children;return!!(E||[]).length},o.isLeaf=function(){var f=o.props,l=f.isLeaf,h=f.loaded,E=o.props.context.loadData,y=o.hasChildren();return l===!1?!1:l||!E&&!y||E&&h&&!y},o.isDisabled=function(){var f=o.props.disabled,l=o.props.context.disabled;return!!(l||f)},o.isCheckable=function(){var f=o.props.checkable,l=o.props.context.checkable;return!l||f===!1?!1:l},o.syncLoadData=function(f){var l=f.expanded,h=f.loading,E=f.loaded,y=o.props.context,T=y.loadData,L=y.onNodeLoad;if(h)return;T&&l&&!o.isLeaf()&&(!o.hasChildren()&&!E&&L(Object(d.b)(o.props)))},o.renderSwitcher=function(){var f=o.props,l=f.expanded,h=f.switcherIcon,E=o.props.context,y=E.prefixCls,T=E.switcherIcon,L=h||T;if(o.isLeaf())return e.createElement("span",{className:g()("".concat(y,"-switcher"),"".concat(y,"-switcher-noop"))},typeof L=="function"?L(Object(R.a)(Object(R.a)({},o.props),{},{isLeaf:!0})):L);var D=g()("".concat(y,"-switcher"),"".concat(y,"-switcher_").concat(l?s:r));return e.createElement("span",{onClick:o.onExpand,className:D},typeof L=="function"?L(Object(R.a)(Object(R.a)({},o.props),{},{isLeaf:!1})):L)},o.renderCheckbox=function(){var f=o.props,l=f.checked,h=f.halfChecked,E=f.disableCheckbox,y=o.props.context.prefixCls,T=o.isDisabled(),L=o.isCheckable();if(!L)return null;var D=typeof L!="boolean"?L:null;return e.createElement("span",{className:g()("".concat(y,"-checkbox"),l&&"".concat(y,"-checkbox-checked"),!l&&h&&"".concat(y,"-checkbox-indeterminate"),(T||E)&&"".concat(y,"-checkbox-disabled")),onClick:o.onCheck},D)},o.renderIcon=function(){var f=o.props.loading,l=o.props.context.prefixCls;return e.createElement("span",{className:g()("".concat(l,"-iconEle"),"".concat(l,"-icon__").concat(o.getNodeState()||"docu"),f&&"".concat(l,"-icon_loading"))})},o.renderSelector=function(){var f=o.state.dragNodeHighlight,l=o.props,h=l.title,E=l.selected,y=l.icon,T=l.loading,L=l.data,D=o.props.context,x=D.prefixCls,P=D.showIcon,H=D.icon,I=D.draggable,z=D.loadData,$=D.titleRender,fe=o.isDisabled(),ee="".concat(x,"-node-content-wrapper"),ye;if(P){var pe=y||H;ye=pe?e.createElement("span",{className:g()("".concat(x,"-iconEle"),"".concat(x,"-icon__customize"))},typeof pe=="function"?pe(o.props):pe):o.renderIcon()}else z&&T&&(ye=o.renderIcon());var ae;typeof h=="function"?ae=h(L):$?ae=$(L):ae=h;var se=e.createElement("span",{className:"".concat(x,"-title")},ae);return e.createElement("span",{ref:o.setSelectHandle,title:typeof h=="string"?h:"",className:g()("".concat(ee),"".concat(ee,"-").concat(o.getNodeState()||"normal"),!fe&&(E||f)&&"".concat(x,"-node-selected"),!fe&&I&&"draggable"),draggable:!fe&&I||void 0,"aria-grabbed":!fe&&I||void 0,onMouseEnter:o.onMouseEnter,onMouseLeave:o.onMouseLeave,onContextMenu:o.onContextMenu,onClick:o.onSelectorClick,onDoubleClick:o.onSelectorDoubleClick,onDragStart:I?o.onDragStart:void 0},ye,se)},o}return Object(S.a)(_,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var f=this.props.selectable,l=this.props.context.selectable;return typeof f=="boolean"?f:l}},{key:"render",value:function(){var f,l=this.props,h=l.eventKey,E=l.className,y=l.style,T=l.dragOver,L=l.dragOverGapTop,D=l.dragOverGapBottom,x=l.isLeaf,P=l.isStart,H=l.isEnd,I=l.expanded,z=l.selected,$=l.checked,fe=l.halfChecked,ee=l.loading,ye=l.domRef,pe=l.active,ae=l.onMouseMove,se=Object(W.a)(l,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),_e=this.props.context,te=_e.prefixCls,k=_e.filterTreeNode,A=_e.draggable,C=_e.keyEntities,B=this.isDisabled(),K=Object(u.f)(se),M=C[h]||{},ie=M.level,Ee=H[H.length-1];return e.createElement("div",Object.assign({ref:ye,className:g()(E,"".concat(te,"-treenode"),(f={},Object(ue.a)(f,"".concat(te,"-treenode-disabled"),B),Object(ue.a)(f,"".concat(te,"-treenode-switcher-").concat(I?"open":"close"),!x),Object(ue.a)(f,"".concat(te,"-treenode-checkbox-checked"),$),Object(ue.a)(f,"".concat(te,"-treenode-checkbox-indeterminate"),fe),Object(ue.a)(f,"".concat(te,"-treenode-selected"),z),Object(ue.a)(f,"".concat(te,"-treenode-loading"),ee),Object(ue.a)(f,"".concat(te,"-treenode-active"),pe),Object(ue.a)(f,"".concat(te,"-treenode-leaf-last"),Ee),Object(ue.a)(f,"drag-over",!B&&T),Object(ue.a)(f,"drag-over-gap-top",!B&&L),Object(ue.a)(f,"drag-over-gap-bottom",!B&&D),Object(ue.a)(f,"filter-node",k&&k(Object(d.b)(this.props))),f)),style:y,onDragEnter:A?this.onDragEnter:void 0,onDragOver:A?this.onDragOver:void 0,onDragLeave:A?this.onDragLeave:void 0,onDrop:A?this.onDrop:void 0,onDragEnd:A?this.onDragEnd:void 0,onMouseMove:ae},K),e.createElement(i,{prefixCls:te,level:ie,isStart:P,isEnd:H}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),_}(e.Component),v=function(b){return e.createElement(c.a.Consumer,null,function(_){return e.createElement(t,Object.assign({},b,{context:_}))})};v.displayName="TreeNode",v.defaultProps={title:n},v.isTreeNode=1;var p=be.a=v},Y1PL:function(Ge,be,U){"use strict";U.r(be),U.d(be,"ResizableTextArea",function(){return fe});var ue=U("wx14"),W=U("1OyB"),R=U("vuIU"),N=U("Ji7U"),S=U("LK+K"),O=U("q1tI"),F=U("VTBJ"),j=U("rePB"),e=U("Zm9Q"),w=U("Kwbf"),g=U("c+Xe"),c=U("m+aA"),u=U("bdgK"),a=new Map;function i(pe){pe.forEach(function(ae){var se,_e=ae.target;(se=a.get(_e))===null||se===void 0||se.forEach(function(te){return te(_e)})})}var d=new u.default(i),s=null,r=null;function n(pe,ae){a.has(pe)||(a.set(pe,new Set),d.observe(pe)),a.get(pe).add(ae)}function t(pe,ae){a.has(pe)&&(a.get(pe).delete(ae),a.get(pe).size||(d.unobserve(pe),a.delete(pe)))}var v=function(pe){Object(N.a)(se,pe);var ae=Object(S.a)(se);function se(){return Object(W.a)(this,se),ae.apply(this,arguments)}return Object(R.a)(se,[{key:"render",value:function(){return this.props.children}}]),se}(O.Component),p=O.createContext(null);function m(pe){var ae=pe.children,se=pe.onBatchResize,_e=O.useRef(0),te=O.useRef([]),k=O.useContext(p),A=O.useCallback(function(C,B,K){_e.current+=1;var M=_e.current;te.current.push({size:C,element:B,data:K}),Promise.resolve().then(function(){M===_e.current&&(se==null||se(te.current),te.current=[])}),k==null||k(C,B,K)},[se,k]);return O.createElement(p.Provider,{value:A},ae)}function b(pe){var ae=pe.children,se=pe.disabled,_e=O.useRef(null),te=O.useRef(null),k=O.useContext(p),A=O.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),C=O.isValidElement(ae)&&Object(g.c)(ae),B=C?ae.ref:null,K=O.useMemo(function(){return Object(g.a)(B,_e)},[B,_e]),M=O.useRef(pe);M.current=pe;var ie=O.useCallback(function(Ee){var Oe=M.current,q=Oe.onResize,de=Oe.data,Te=Ee.getBoundingClientRect(),xe=Te.width,Pe=Te.height,Ne=Ee.offsetWidth,Re=Ee.offsetHeight,Me=Math.floor(xe),He=Math.floor(Pe);if(A.current.width!==Me||A.current.height!==He||A.current.offsetWidth!==Ne||A.current.offsetHeight!==Re){var We={width:Me,height:He,offsetWidth:Ne,offsetHeight:Re};A.current=We;var Ke=Ne===Math.round(xe)?xe:Ne,Be=Re===Math.round(Pe)?Pe:Re,Ve=Object(F.a)(Object(F.a)({},We),{},{offsetWidth:Ke,offsetHeight:Be});k==null||k(Ve,Ee,de),q&&Promise.resolve().then(function(){q(Ve,Ee)})}},[]);return O.useEffect(function(){var Ee=Object(c.a)(_e.current)||Object(c.a)(te.current);return Ee&&!se&&n(Ee,ie),function(){return t(Ee,ie)}},[_e.current,se]),O.createElement(v,{ref:te},C?O.cloneElement(ae,{ref:K}):ae)}var _="rc-observer-key";function o(pe){var ae=pe.children,se=Object(e.a)(ae);return se.map(function(_e,te){var k=(_e==null?void 0:_e.key)||"".concat(_,"-").concat(te);return O.createElement(b,Object(ue.a)({},pe,{key:k}),_e)})}o.Collection=m;var f=o,l=U("bT9E"),h=U("TSYQ"),E=U.n(h),y=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,T=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],L={},D;function x(pe){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,se=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(ae&&L[se])return L[se];var _e=window.getComputedStyle(pe),te=_e.getPropertyValue("box-sizing")||_e.getPropertyValue("-moz-box-sizing")||_e.getPropertyValue("-webkit-box-sizing"),k=parseFloat(_e.getPropertyValue("padding-bottom"))+parseFloat(_e.getPropertyValue("padding-top")),A=parseFloat(_e.getPropertyValue("border-bottom-width"))+parseFloat(_e.getPropertyValue("border-top-width")),C=T.map(function(K){return"".concat(K,":").concat(_e.getPropertyValue(K))}).join(";"),B={sizingStyle:C,paddingSize:k,borderSize:A,boxSizing:te};return ae&&se&&(L[se]=B),B}function P(pe){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;D||(D=document.createElement("textarea"),D.setAttribute("tab-index","-1"),D.setAttribute("aria-hidden","true"),document.body.appendChild(D)),pe.getAttribute("wrap")?D.setAttribute("wrap",pe.getAttribute("wrap")):D.removeAttribute("wrap");var te=x(pe,ae),k=te.paddingSize,A=te.borderSize,C=te.boxSizing,B=te.sizingStyle;D.setAttribute("style","".concat(B,";").concat(y)),D.value=pe.value||pe.placeholder||"";var K=Number.MIN_SAFE_INTEGER,M=Number.MAX_SAFE_INTEGER,ie=D.scrollHeight,Ee;if(C==="border-box"?ie+=A:C==="content-box"&&(ie-=k),se!==null||_e!==null){D.value=" ";var Oe=D.scrollHeight-k;se!==null&&(K=Oe*se,C==="border-box"&&(K=K+k+A),ie=Math.max(K,ie)),_e!==null&&(M=Oe*_e,C==="border-box"&&(M=M+k+A),Ee=ie>M?"":"hidden",ie=Math.min(M,ie))}return{height:ie,minHeight:K,maxHeight:M,overflowY:Ee,resize:"none"}}var H=U("Gytx"),I=U.n(H),z;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(z||(z={}));var $=function(pe){Object(N.a)(se,pe);var ae=Object(S.a)(se);function se(_e){var te;return Object(W.a)(this,se),te=ae.call(this,_e),te.nextFrameActionId=void 0,te.resizeFrameId=void 0,te.textArea=void 0,te.saveTextArea=function(k){te.textArea=k},te.handleResize=function(k){var A=te.state.resizeStatus,C=te.props,B=C.autoSize,K=C.onResize;if(A!==z.NONE)return;typeof K=="function"&&K(k),B&&te.resizeOnNextFrame()},te.resizeOnNextFrame=function(){cancelAnimationFrame(te.nextFrameActionId),te.nextFrameActionId=requestAnimationFrame(te.resizeTextarea)},te.resizeTextarea=function(){var k=te.props.autoSize;if(!k||!te.textArea)return;var A=k.minRows,C=k.maxRows,B=P(te.textArea,!1,A,C);te.setState({textareaStyles:B,resizeStatus:z.RESIZING},function(){cancelAnimationFrame(te.resizeFrameId),te.resizeFrameId=requestAnimationFrame(function(){te.setState({resizeStatus:z.RESIZED},function(){te.resizeFrameId=requestAnimationFrame(function(){te.setState({resizeStatus:z.NONE}),te.fixFirefoxAutoScroll()})})})})},te.renderTextArea=function(){var k=te.props,A=k.prefixCls,C=A===void 0?"rc-textarea":A,B=k.autoSize,K=k.onResize,M=k.className,ie=k.disabled,Ee=te.state,Oe=Ee.textareaStyles,q=Ee.resizeStatus,de=Object(l.a)(te.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Te=E()(C,M,Object(j.a)({},"".concat(C,"-disabled"),ie));"value"in de&&(de.value=de.value||"");var xe=Object(F.a)(Object(F.a)(Object(F.a)({},te.props.style),Oe),q===z.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return O.createElement(f,{onResize:te.handleResize,disabled:!(B||K)},O.createElement("textarea",Object(ue.a)({},de,{className:Te,style:xe,ref:te.saveTextArea})))},te.state={textareaStyles:{},resizeStatus:z.NONE},te}return Object(R.a)(se,[{key:"componentDidUpdate",value:function(te){(te.value!==this.props.value||!I()(te.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var te=this.textArea.selectionStart,k=this.textArea.selectionEnd;this.textArea.setSelectionRange(te,k)}}catch(A){}}},{key:"render",value:function(){return this.renderTextArea()}}]),se}(O.Component),fe=$,ee=function(pe){Object(N.a)(se,pe);var ae=Object(S.a)(se);function se(_e){var te;Object(W.a)(this,se),te=ae.call(this,_e),te.resizableTextArea=void 0,te.focus=function(){te.resizableTextArea.textArea.focus()},te.saveTextArea=function(A){te.resizableTextArea=A},te.handleChange=function(A){var C=te.props.onChange;te.setValue(A.target.value,function(){te.resizableTextArea.resizeTextarea()}),C&&C(A)},te.handleKeyDown=function(A){var C=te.props,B=C.onPressEnter,K=C.onKeyDown;A.keyCode===13&&B&&B(A),K&&K(A)};var k=typeof _e.value=="undefined"||_e.value===null?_e.defaultValue:_e.value;return te.state={value:k},te}return Object(R.a)(se,[{key:"setValue",value:function(te,k){"value"in this.props||this.setState({value:te},k)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return O.createElement(fe,Object(ue.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(te){return"value"in te?{value:te.value}:null}}]),se}(O.Component),ye=be.default=ee},ZW9T:function(Ge,be,U){"use strict";U.d(be,"a",function(){return H});var ue=U("k1fw"),W=U("oBTY"),R=U("miYZ"),N=U("tsqr"),S=U("rAM+"),O=U("tJVT"),F=U("PpiC"),j=U("q1tI"),e=U.n(j),w=U("bdgK"),g=U("9og8"),c=U("WmNS"),u=U.n(c),a={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},i={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},d={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},s={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},r=U("5VLF"),n=U.n(r),t={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},v=function(z,$){return $.map(function(fe){return{label:fe,kind:z.languages.CompletionItemKind.Keyword,insertText:fe}})},p=function(z){return Object.keys(t.tables).map(function($){return{label:$,kind:z.languages.CompletionItemKind.Variable,insertText:$}})},m=function(z,$){var fe=t.tables[z];return fe?fe.map(function(ee){return{label:ee,kind:$.languages.CompletionItemKind.Field,insertText:ee}}):[]};function b(I,z,$,fe,ee){var ye=z.getWordUntilPosition($),pe={startLineNumber:$.lineNumber,endLineNumber:$.lineNumber,startColumn:ye.startColumn,endColumn:ye.endColumn},ae=fe.map(function(se){return{label:se,kind:I.languages.CompletionItemKind.Keyword,insertText:se,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}});return ee.map(function(se){ae.push(Object(ue.a)(Object(ue.a)({},se),{},{range:pe}))}),ae}var _=function(I){t.languages.map(function(ee){return I.languages.registerDocumentFormattingEditProvider(ee,{provideDocumentFormattingEdits:function(pe,ae,se){return Object(g.a)(u.a.mark(function _e(){var te;return u.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return te=n()(pe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),A.abrupt("return",[{range:pe.getFullModelRange(),text:te}]);case 2:case"end":return A.stop()}},_e)}))()}}),ee});var z=d.quickKey.map(function(ee){return{label:ee.label,kind:I.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=s.quickKey.map(function(ee){return{label:ee.label,kind:I.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),fe=i.quickKey.map(function(ee){return{label:ee.label,kind:I.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}});I.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ye,pe){var ae=ye.getWordUntilPosition(pe),se={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn},_e=ye.getLineContent(pe.lineNumber).substring(ae.startColumn-2,ae.endColumn);return{suggestions:[].concat(Object(W.a)(d.keywords.map(function(te){return{label:te,kind:I.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})),Object(W.a)(d.quickKey.map(function(te){return{label:te.label,kind:I.languages.CompletionItemKind.Function,documentation:te.content,insertText:_e.startsWith("#")?te.content.replace(/#/,""):te.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})))}}}),I.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(ye,pe){var ae=ye.getWordUntilPosition(pe),se={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn};return{suggestions:Object(W.a)(a.keywords.map(function(_e){return{label:_e,kind:I.languages.CompletionItemKind.Function,documentation:_e,insertText:_e,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}}))}}}),I.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ye,pe){var ae=ye.getWordUntilPosition(pe),se={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn},_e=ye.getLineContent(pe.lineNumber).substring(ae.startColumn-2,ae.endColumn);return{suggestions:[].concat(Object(W.a)(i.keywords.map(function(te){return{label:te,kind:I.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})),Object(W.a)(i.quickKey.map(function(te){return{label:te.label,kind:I.languages.CompletionItemKind.Function,documentation:te.content,insertText:_e.startsWith("#")?te.content.replace(/#/,""):te.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})))}}}),I.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ye,pe){var ae=ye.getWordUntilPosition(pe),se={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn},_e=ye.getLineContent(pe.lineNumber).substring(ae.startColumn-2,ae.endColumn);return{suggestions:[].concat(Object(W.a)(s.keywords.map(function(te){return{label:te,kind:I.languages.CompletionItemKind.Function,documentation:te,insertText:te,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})),Object(W.a)(s.quickKey.map(function(te){return{label:te.label,kind:I.languages.CompletionItemKind.Function,documentation:te.content,insertText:_e.startsWith("#")?te.content.replace(/#/,""):te.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}})))}}})},o="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",f=U("fjLI"),l=U("LvDl"),h=U("+ua5");function E(I){return/^\d+$/.test(I)?"".concat(I,"px"):I}function y(){}var T=!1,L={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function D(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],z=I;if(Array.isArray(I)){for(var $=0;$<I.length;$++){var fe=L[I[$]];if(fe)return fe}return z[0]}return L[z]||z}var x=null,P=be.b=function(I){var z=I.width,$=z===void 0?"100%":z,fe=I.height,ee=fe===void 0?"100%":fe,ye=I.value,pe=I.language,ae=pe===void 0?"javascript":pe,se=I.style,_e=se===void 0?{}:se,te=I.options,k=te===void 0?{}:te,A=I.overrideServices,C=A===void 0?{}:A,B=I.theme,K=B===void 0?"vs-dark":B,M=I.onEditBlur,ie=I.onSave,Ee=I.autoHeight,Oe=Ee===void 0?!1:Ee,q=I.forbidCopy,de=q===void 0?!1:q,Te=I.onChange,xe=Te===void 0?y:Te,Pe=I.editorDidMount,Ne=Pe===void 0?y:Pe,Re=I.onFocus,Me=Re===void 0?y:Re,He=I.filename,We=He===void 0?"educoder.txt":He,Ke=I.errorLine,Be=I.errorContent,Ve=Be===void 0?"":Be,Xe=Object(F.a)(I,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ne=Object(j.useRef)(),V=Object(j.useRef)({}),G=Object(j.useRef)(),Z=Object(j.useRef)(),re=Object(j.useRef)(!1),X=Object(j.useRef)(),Q=Object(j.useState)(!1),oe=Object(O.a)(Q,2),he=oe[0],De=oe[1];function Ie(){var qe;return ne.current&&(qe=new w.default(function(it){var ft=Object(S.a)(it),It;try{for(ft.s();!(It=ft.n()).done;){var $t=It.value;($t.target.offsetHeight>0||$t.target.offsetWidth>0)&&V.current.instance.layout()}}catch(ln){ft.e(ln)}finally{ft.f()}}),qe.observe(ne.current)),qe}function Ue(){N.b.warn(decodeURIComponent(o))}var Ye=function(){var it=V.current.instance;if(ye!=null&&it&&he){var ft=it.getModel();ft&&ye!==ft.getValue()&&(T=!0,ft.setValue(ye),it.layout(),T=!1)}};Object(j.useEffect)(function(){Z.current&&clearTimeout(Z.current),Z.current=setTimeout(function(){Ye()},500)},[ye,he,V.current]),Object(j.useEffect)(function(){if(Ke&&V.current&&V.current.instance){var qe=V.current.instance;qe.changeViewZones(function(ft){var It=document.createElement("div");It.style.padding="10px 20px",It.style.width="calc(100% - 20px)",It.className="my-error-line-wrp",It.innerHTML=Ve,ft.addZone({afterLineNumber:Ke||11,heightInLines:3,domNode:It})});var it={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};qe.addOverlayWidget(it),qe.revealPositionInCenter({lineNumber:20,column:1})}},[Ke,V.current,he]);function Je(){var qe=V.current.instance;if(qe){var it=qe.getSelection(),ft=V.current.pastePos||{},It=new x.Range(ft.startLineNumber||it.endLineNumber,ft.startColumn||it.endColumn,ft.endLineNumber||it.endLineNumber,ft.endColumn||it.endColumn);setTimeout(function(){qe.executeEdits("",[{range:It,text:""}])},300)}}function Ze(qe){(window.navigator.platform.match("Mac")?qe.metaKey:qe.ctrlKey)&&qe.keyCode==83&&(qe.preventDefault(),ie())}var dt=function(){if(Oe&&V.current.instance){var it=V.current.instance.getContentHeight();Vt(it<ee?ee:it)}else Vt(ee)};function at(qe){var it=document.createEvent("MouseEvents");it.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),qe.dispatchEvent(it)}function $e(qe,it){var ft=window.URL||window.webkitURL||window,It=new Blob([it]),$t=document.createElementNS("http://www.w3.org/1999/xhtml","a");$t.href=ft.createObjectURL(It),$t.download=qe,at($t)}Object(j.useEffect)(function(){dt()},[dt]),Object(j.useEffect)(function(){ne.current&&!he&&Promise.all([U.e(18),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(qe){try{x=qe,V.current.instance=x.editor.create(ne.current,{value:ye,language:D(ae),theme:K,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},C);var it=V.current.instance,ft=f.d._menuItems,It=Object(W.a)(ft).find(function(yt){return yt[0]._debugName=="EditorContext"}),$t=It[1],ln=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Bt=function(ut,Qt){var Rt=ut._first;do{var dn,Kt,gn=Qt.includes((dn=Rt.element)===null||dn===void 0||((Kt=dn.command)===null||Kt===void 0)?void 0:Kt.id);gn&&ut._remove(Rt)}while(Rt=Rt.next)};if(Ne(it,x),setTimeout(function(){dt(),V.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){$e(We||"educoder.txt",it.getValue())}}),it.getDomNode().addEventListener("input",function(){G.current.autoFormat&&it.getAction("editor.action.formatDocument").run()})},500),V.current.subscription=it.onDidChangeModelContent(function(yt){re.current?clearTimeout(X.current):(dt(),xe(it.getValue(),yt)),X.current=setTimeout(function(){re.current=!1},500)}),window.Monaco||_(x,D(ae)),de&&(Bt($t,ln),ne.current.classList.add("noCopyPaste"),it.onKeyDown(function(yt){var ut=yt.keyCode,Qt=yt.ctrlKey,Rt=yt.metaKey;(ut===33||ut===52)&&(Rt||Qt)&&(Ue(),yt.preventDefault())})),window.Monaco=x,M&&it.onDidBlurEditorWidget(function(){M(it.getValue())}),Me&&it.onDidFocusEditorText(function(){Me(it.getValue())}),de){it.addCommand(x.KeyMod.CtrlCmd|x.KeyCode.KEY_V,function(){return Ue(),null}),it.onDidPaste(function(yt){V.current.pastePos=yt});try{window.addEventListener("paste",Je)}catch(yt){}}var pt=Ie();return De(!0),function(){var yt=V.current.instance;yt.dispose();var ut=yt.getModel();ut&&ut.dispose(),V.current.subscription&&V.current.subscription.dispose(),de&&window.removeEventListener("paste",Je),pt.unobserve(ne.current)}}catch(yt){}})},[]),Object(j.useEffect)(function(){var qe=V.current.instance;if(qe&&he)return document.addEventListener("keydown",Ze,!1),function(){document.removeEventListener("keydown",Ze)}},[ie,he]),Object(j.useEffect)(function(){var qe=V.current.instance;if(qe&&he){var it=D(ae);x.editor.setModelLanguage(qe.getModel(),it),console.log("language:",ae,qe.getModel(),it)}},[ae,he]),Object(j.useEffect)(function(){var qe=V.current.instance;qe&&he&&x.editor.setTheme(K)},[K,he]),Object(j.useEffect)(function(){var qe=V.current.instance;G.current=k,qe&&he&&(qe.updateOptions(Object(ue.a)({},k)),setTimeout(function(){qe.getModel().updateOptions(Object(ue.a)({},k))},200))},[JSON.stringify(k),he]),Object(j.useEffect)(function(){var qe=V.current.instance;qe&&he&&qe.layout()},[$,ee,he]);var Nt=Object(j.useState)(E($)),bt=Object(O.a)(Nt,2),Ut=bt[0],Lt=bt[1],ot=Object(j.useState)(E(ee)),Ft=Object(O.a)(ot,2),Jt=Ft[0],Vt=Ft[1],rn=Object(ue.a)(Object(ue.a)({},_e),{},{width:Ut,height:Jt});return e.a.createElement("div",{className:"my-monaco-editor",ref:ne,style:rn})};function H(I){var z=I.width,$=z===void 0?"100%":z,fe=I.height,ee=fe===void 0?"100%":fe,ye=I.original,pe=I.modified,ae=I.language,se=I.options,_e=se===void 0?{}:se,te=Object(j.useRef)(),k=Object(j.useState)(null),A=Object(O.a)(k,2),C=A[0],B=A[1];function K(Oe){var q;return te.current&&(q=new w.default(function(de){var Te=Object(S.a)(de),xe;try{for(Te.s();!(xe=Te.n()).done;){var Pe=xe.value;(Pe.target.offsetHeight>0||Pe.target.offsetWidth>0)&&Oe.layout()}}catch(Ne){Te.e(Ne)}finally{Te.f()}}),q.observe(te.current)),q}Object(j.useEffect)(function(){te.current&&Promise.all([U.e(18),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(Oe){x=Oe;var q=x.editor.createDiffEditor(te.current,Object(ue.a)(Object(ue.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},_e),{},{wordWrap:!0}));B(q);var de=K(q);return function(){q.dispose();var Te=q.getModel();Te&&Te.dispose(),de.unobserve(te.current)}})},[]),Object(j.useEffect)(function(){C&&C.setModel({original:x.editor.createModel(ye,ae),modified:x.editor.createModel(pe,ae)})},[ye,pe,ae,C]);var M=E($),ie=E(ee),Ee={width:M,height:ie};return e.a.createElement("div",{className:"my-diff-editor",ref:te,style:Ee})}},bT9E:function(Ge,be,U){"use strict";U.d(be,"a",function(){return W});var ue=U("VTBJ");function W(R,N){var S=Object(ue.a)({},R);return Array.isArray(N)&&N.forEach(function(O){delete S[O]}),S}},d5o6:function(Ge,be,U){Ge.exports={flex_box_center:"flex_box_center___2-Tej",flex_space_between:"flex_space_between___1Q3vH",flex_box_vertical_center:"flex_box_vertical_center___2x9ha",flex_box_center_end:"flex_box_center_end___1fvRI",flex_box_column:"flex_box_column___2RmOE",addModal:"addModal___2Pv06",row:"row___2XmSi",label:"label___1L8pt"}},fAei:function(Ge,be,U){"use strict";U.d(be,"a",function(){return t.a});var ue=U("rePB"),W=U("VTBJ"),R=U("KQm4"),N=U("1OyB"),S=U("vuIU"),O=U("Ji7U"),F=U("LK+K"),j=U("q1tI"),e=U("4IlW"),w=U("Kwbf"),g=U("TSYQ"),c=U.n(g),u=U("sboe"),a=U("OZM5"),i=U("815F"),d=U("ODXe"),s=U("Ff2n"),r=U("+nKL"),n=U("8XRh"),t=U("WaYH"),v=function(ye,pe){var ae=ye.className,se=ye.style,_e=ye.motion,te=ye.motionNodes,k=ye.motionType,A=ye.onMotionStart,C=ye.onMotionEnd,B=ye.active,K=ye.treeNodeRequiredProps,M=Object(s.a)(ye,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),ie=j.useState(!0),Ee=Object(d.a)(ie,2),Oe=Ee[0],q=Ee[1],de=j.useContext(u.a),Te=de.prefixCls,xe=j.useRef(!1),Pe=function(){xe.current||C(),xe.current=!0};return Object(j.useEffect)(function(){te&&k==="hide"&&Oe&&q(!1)},[te]),Object(j.useEffect)(function(){return te&&A(),function(){te&&Pe()}},[]),te?j.createElement(n.default,Object.assign({ref:pe,visible:Oe},_e,{motionAppear:k==="show",onAppearEnd:Pe,onLeaveEnd:Pe}),function(Ne,Re){var Me=Ne.className,He=Ne.style;return j.createElement("div",{ref:Re,className:c()("".concat(Te,"-treenode-motion"),Me),style:He},te.map(function(We){var Ke=We.data,Be=Ke.key,Ve=Object(s.a)(Ke,["key"]),Xe=We.isStart,ne=We.isEnd;delete Ve.children;var V=Object(i.f)(Be,K);return j.createElement(t.a,Object.assign({},Ve,V,{active:B,data:We.data,key:Be,isStart:Xe,isEnd:ne}))}))}):j.createElement(t.a,Object.assign({domRef:pe,className:ae,style:se},M,{active:B}))};v.displayName="MotionTreeNode";var p=j.forwardRef(v),m=p;function b(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],pe=ee.length,ae=ye.length;if(Math.abs(pe-ae)!==1)return{add:!1,key:null};function se(_e,te){var k=new Map;_e.forEach(function(C){k.set(C,!0)});var A=te.filter(function(C){return!k.has(C)});return A.length===1?A[0]:null}return pe<ae?{add:!0,key:se(ee,ye)}:{add:!1,key:se(ye,ee)}}function _(ee,ye,pe){var ae=ee.findIndex(function(k){var A=k.data;return A.key===pe}),se=ee[ae+1],_e=ye.findIndex(function(k){var A=k.data;return A.key===pe});if(se){var te=ye.findIndex(function(k){var A=k.data;return A.key===se.data.key});return ye.slice(_e+1,te)}return ye.slice(_e+1)}var o={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},f=function(){},l="RC_TREE_MOTION_".concat(Math.random()),h={key:l},E={key:l,level:0,index:0,pos:"0",node:h},y={parent:null,children:[],pos:E.pos,data:h,isStart:[],isEnd:[]};function T(ee,ye,pe,ae){return ye===!1||!pe?ee:ee.slice(0,Math.ceil(pe/ae)+1)}function L(ee){var ye=ee.data.key,pe=ee.pos;return Object(i.e)(ye,pe)}function D(ee){for(var ye=String(ee.data.key),pe=ee;pe.parent;)pe=pe.parent,ye="".concat(pe.data.key," > ").concat(ye);return ye}var x=function(ye,pe){var ae=ye.prefixCls,se=ye.data,_e=ye.selectable,te=ye.checkable,k=ye.expandedKeys,A=ye.selectedKeys,C=ye.checkedKeys,B=ye.loadedKeys,K=ye.loadingKeys,M=ye.halfCheckedKeys,ie=ye.keyEntities,Ee=ye.disabled,Oe=ye.dragging,q=ye.dragOverNodeKey,de=ye.dropPosition,Te=ye.motion,xe=ye.height,Pe=ye.itemHeight,Ne=ye.virtual,Re=ye.focusable,Me=ye.activeItem,He=ye.focused,We=ye.tabIndex,Ke=ye.onKeyDown,Be=ye.onFocus,Ve=ye.onBlur,Xe=ye.onActiveChange,ne=ye.onListChangeStart,V=ye.onListChangeEnd,G=Object(s.a)(ye,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),Z=j.useRef(null);j.useImperativeHandle(pe,function(){return{scrollTo:function(it){Z.current.scrollTo(it)}}});var re=j.useState(k),X=Object(d.a)(re,2),Q=X[0],oe=X[1],he=j.useState(se),De=Object(d.a)(he,2),Ie=De[0],Ue=De[1],Ye=j.useState(se),Je=Object(d.a)(Ye,2),Ze=Je[0],dt=Je[1],at=j.useState([]),$e=Object(d.a)(at,2),Nt=$e[0],bt=$e[1],Ut=j.useState(null),Lt=Object(d.a)(Ut,2),ot=Lt[0],Ft=Lt[1];function Jt(){Ue(se),dt(se),bt([]),Ft(null),V()}j.useEffect(function(){oe(k);var qe=b(Q,k);if(qe.key!==null)if(qe.add){var it=Ie.findIndex(function(pt){var yt=pt.data.key;return yt===qe.key}),ft=T(_(Ie,se,qe.key),Ne,xe,Pe),It=Ie.slice();It.splice(it+1,0,y),dt(It),bt(ft),Ft("show")}else{var $t=se.findIndex(function(pt){var yt=pt.data.key;return yt===qe.key}),ln=T(_(se,Ie,qe.key),Ne,xe,Pe),Bt=se.slice();Bt.splice($t+1,0,y),dt(Bt),bt(ln),Ft("hide")}else Ie!==se&&(Ue(se),dt(se))},[k,se]),j.useEffect(function(){Oe||Jt()},[Oe]);var Vt=Te?Ze:se,rn={expandedKeys:k,selectedKeys:A,loadedKeys:B,loadingKeys:K,checkedKeys:C,halfCheckedKeys:M,dragOverNodeKey:q,dropPosition:de,keyEntities:ie};return j.createElement(j.Fragment,null,He&&Me&&j.createElement("span",{style:o,"aria-live":"assertive"},D(Me)),j.createElement("div",{role:"tree"},j.createElement("input",{style:o,disabled:Re===!1||Ee,tabIndex:Re!==!1?We:null,onKeyDown:Ke,onFocus:Be,onBlur:Ve,value:"",onChange:f})),j.createElement(r.a,Object.assign({},G,{data:Vt,itemKey:L,height:xe,fullHeight:!1,virtual:Ne,itemHeight:Pe,prefixCls:"".concat(ae,"-list"),ref:Z}),function(qe){var it=qe.pos,ft=qe.data,It=ft.key,$t=Object(s.a)(ft,["key"]),ln=qe.isStart,Bt=qe.isEnd,pt=Object(i.e)(It,it);delete $t.children;var yt=Object(i.f)(pt,rn);return j.createElement(m,Object.assign({},$t,yt,{active:Me&&It===Me.data.key,pos:it,data:qe.data,isStart:ln,isEnd:Bt,motion:Te,motionNodes:It===l?Nt:null,motionType:ot,onMotionStart:ne,onMotionEnd:Jt,treeNodeRequiredProps:rn,onMouseMove:function(){Xe(null)}}))}))},P=j.forwardRef(x);P.displayName="NodeList";var H=P,I=U("NvD2"),z=function(ee){Object(O.a)(pe,ee);var ye=Object(F.a)(pe);function pe(){var ae;return Object(N.a)(this,pe),ae=ye.apply(this,arguments),ae.destroyed=!1,ae.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},ae.listRef=j.createRef(),ae.onNodeDragStart=function(se,_e){var te=ae.state,k=te.expandedKeys,A=te.keyEntities,C=ae.props.onDragStart,B=_e.props.eventKey;ae.dragNode=_e;var K=Object(a.b)(k,B);ae.setState({dragging:!0,dragNodesKeys:Object(a.g)(B,A)}),ae.setExpandedKeys(K),C&&C({event:se,node:Object(i.b)(_e.props)})},ae.onNodeDragEnter=function(se,_e){var te=ae.state,k=te.expandedKeys,A=te.keyEntities,C=te.dragNodesKeys,B=ae.props.onDragEnter,K=_e.props,M=K.pos,ie=K.eventKey;if(!ae.dragNode||C.indexOf(ie)!==-1)return;var Ee=Object(a.c)(se,_e);if(ae.dragNode.props.eventKey===ie&&Ee===0){ae.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ae.setState({dragOverNodeKey:ie,dropPosition:Ee}),ae.delayedDragEnterLogic||(ae.delayedDragEnterLogic={}),Object.keys(ae.delayedDragEnterLogic).forEach(function(Oe){clearTimeout(ae.delayedDragEnterLogic[Oe])}),ae.delayedDragEnterLogic[M]=window.setTimeout(function(){if(!ae.state.dragging)return;var Oe=Object(R.a)(k),q=A[ie];q&&(q.children||[]).length&&(Oe=Object(a.a)(k,ie)),"expandedKeys"in ae.props||ae.setExpandedKeys(Oe),B&&B({event:se,node:Object(i.b)(_e.props),expandedKeys:Oe})},400)},0)},ae.onNodeDragOver=function(se,_e){var te=ae.state.dragNodesKeys,k=ae.props.onDragOver,A=_e.props.eventKey;if(te.indexOf(A)!==-1)return;if(ae.dragNode&&A===ae.state.dragOverNodeKey){var C=Object(a.c)(se,_e);if(C===ae.state.dropPosition)return;ae.setState({dropPosition:C})}k&&k({event:se,node:Object(i.b)(_e.props)})},ae.onNodeDragLeave=function(se,_e){var te=ae.props.onDragLeave;ae.setState({dragOverNodeKey:""}),te&&te({event:se,node:Object(i.b)(_e.props)})},ae.onNodeDragEnd=function(se,_e){var te=ae.props.onDragEnd;ae.setState({dragOverNodeKey:""}),ae.cleanDragState(),te&&te({event:se,node:Object(i.b)(_e.props)}),ae.dragNode=null},ae.onNodeDrop=function(se,_e){var te=ae.state,k=te.dragNodesKeys,A=k===void 0?[]:k,C=te.dropPosition,B=ae.props.onDrop,K=_e.props,M=K.eventKey,ie=K.pos;if(ae.setState({dragOverNodeKey:""}),ae.cleanDragState(),A.indexOf(M)!==-1){Object(w.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Ee=Object(a.k)(ie),Oe={event:se,node:Object(i.b)(_e.props),dragNode:ae.dragNode?Object(i.b)(ae.dragNode.props):null,dragNodesKeys:A.slice(),dropPosition:C+Number(Ee[Ee.length-1]),dropToGap:!1};C!==0&&(Oe.dropToGap=!0),B&&B(Oe),ae.dragNode=null},ae.cleanDragState=function(){var se=ae.state.dragging;se&&ae.setState({dragging:!1})},ae.onNodeClick=function(se,_e){var te=ae.props.onClick;te&&te(se,_e)},ae.onNodeDoubleClick=function(se,_e){var te=ae.props.onDoubleClick;te&&te(se,_e)},ae.onNodeSelect=function(se,_e){var te=ae.state.selectedKeys,k=ae.state.keyEntities,A=ae.props,C=A.onSelect,B=A.multiple,K=_e.selected,M=_e.key,ie=!K;ie?B?te=Object(a.a)(te,M):te=[M]:te=Object(a.b)(te,M);var Ee=te.map(function(Oe){var q=k[Oe];return q?q.node:null}).filter(function(Oe){return Oe});ae.setUncontrolledState({selectedKeys:te}),C&&C(te,{event:"select",selected:ie,node:_e,selectedNodes:Ee,nativeEvent:se.nativeEvent})},ae.onNodeCheck=function(se,_e,te){var k=ae.state,A=k.keyEntities,C=k.checkedKeys,B=k.halfCheckedKeys,K=ae.props,M=K.checkStrictly,ie=K.onCheck,Ee=_e.key,Oe,q={event:"check",node:_e,checked:te,nativeEvent:se.nativeEvent};if(M){var de=te?Object(a.a)(C,Ee):Object(a.b)(C,Ee),Te=Object(a.b)(B,Ee);Oe={checked:de,halfChecked:Te},q.checkedNodes=de.map(function(He){return A[He]}).filter(function(He){return He}).map(function(He){return He.node}),ae.setUncontrolledState({checkedKeys:de})}else{var xe=Object(I.a)([].concat(Object(R.a)(C),[Ee]),!0,A),Pe=xe.checkedKeys,Ne=xe.halfCheckedKeys;if(!te){var Re=new Set(Pe);Re.delete(Ee);var Me=Object(I.a)(Array.from(Re),{checked:!1,halfCheckedKeys:Ne},A);Pe=Me.checkedKeys,Ne=Me.halfCheckedKeys}Oe=Pe,q.checkedNodes=[],q.checkedNodesPositions=[],q.halfCheckedKeys=Ne,Pe.forEach(function(He){var We=A[He];if(!We)return;var Ke=We.node,Be=We.pos;q.checkedNodes.push(Ke),q.checkedNodesPositions.push({node:Ke,pos:Be})}),ae.setUncontrolledState({checkedKeys:Pe},!1,{halfCheckedKeys:Ne})}ie&&ie(Oe,q)},ae.onNodeLoad=function(se){return new Promise(function(_e){ae.setState(function(te){var k=te.loadedKeys,A=k===void 0?[]:k,C=te.loadingKeys,B=C===void 0?[]:C,K=ae.props,M=K.loadData,ie=K.onLoad,Ee=se.key;if(!M||A.indexOf(Ee)!==-1||B.indexOf(Ee)!==-1)return{};var Oe=M(se);return Oe.then(function(){var q=ae.state,de=q.loadedKeys,Te=q.loadingKeys,xe=Object(a.a)(de,Ee),Pe=Object(a.b)(Te,Ee);ie&&ie(xe,{event:"load",node:se}),ae.setUncontrolledState({loadedKeys:xe}),ae.setState({loadingKeys:Pe}),_e()}),{loadingKeys:Object(a.a)(B,Ee)}})})},ae.onNodeMouseEnter=function(se,_e){var te=ae.props.onMouseEnter;te&&te({event:se,node:_e})},ae.onNodeMouseLeave=function(se,_e){var te=ae.props.onMouseLeave;te&&te({event:se,node:_e})},ae.onNodeContextMenu=function(se,_e){var te=ae.props.onRightClick;te&&(se.preventDefault(),te({event:se,node:_e}))},ae.onFocus=function(){var se=ae.props.onFocus;ae.setState({focused:!0}),se&&se.apply(void 0,arguments)},ae.onBlur=function(){var se=ae.props.onBlur;ae.setState({focused:!1}),ae.onActiveChange(null),se&&se.apply(void 0,arguments)},ae.getTreeNodeRequiredProps=function(){var se=ae.state,_e=se.expandedKeys,te=se.selectedKeys,k=se.loadedKeys,A=se.loadingKeys,C=se.checkedKeys,B=se.halfCheckedKeys,K=se.dragOverNodeKey,M=se.dropPosition,ie=se.keyEntities;return{expandedKeys:_e||[],selectedKeys:te||[],loadedKeys:k||[],loadingKeys:A||[],checkedKeys:C||[],halfCheckedKeys:B||[],dragOverNodeKey:K,dropPosition:M,keyEntities:ie}},ae.setExpandedKeys=function(se){var _e=ae.state.treeData,te=Object(i.d)(_e,se);ae.setUncontrolledState({expandedKeys:se,flattenNodes:te},!0)},ae.onNodeExpand=function(se,_e){var te=ae.state.expandedKeys,k=ae.state.listChanging,A=ae.props,C=A.onExpand,B=A.loadData,K=_e.key,M=_e.expanded;if(k)return;var ie=te.indexOf(K),Ee=!M;if(Object(w.a)(M&&ie!==-1||!M&&ie===-1,"Expand state not sync with index check"),Ee?te=Object(a.a)(te,K):te=Object(a.b)(te,K),ae.setExpandedKeys(te),C&&C(te,{node:_e,expanded:Ee,nativeEvent:se.nativeEvent}),Ee&&B){var Oe=ae.onNodeLoad(_e);Oe&&Oe.then(function(){var q=Object(i.d)(ae.state.treeData,te);ae.setUncontrolledState({flattenNodes:q})})}},ae.onListChangeStart=function(){ae.setUncontrolledState({listChanging:!0})},ae.onListChangeEnd=function(){setTimeout(function(){ae.setUncontrolledState({listChanging:!1})})},ae.onActiveChange=function(se){var _e=ae.state.activeKey,te=ae.props.onActiveChange;if(_e===se)return;ae.setState({activeKey:se}),se!==null&&ae.scrollTo({key:se}),te&&te(se)},ae.getActiveItem=function(){var se=ae.state,_e=se.activeKey,te=se.flattenNodes;return _e===null?null:te.find(function(k){var A=k.data.key;return A===_e})||null},ae.offsetActiveKey=function(se){var _e=ae.state,te=_e.flattenNodes,k=_e.activeKey,A=te.findIndex(function(K){var M=K.data.key;return M===k});A===-1&&se<0&&(A=te.length),A=(A+se+te.length)%te.length;var C=te[A];if(C){var B=C.data.key;ae.onActiveChange(B)}else ae.onActiveChange(null)},ae.onKeyDown=function(se){var _e=ae.state,te=_e.activeKey,k=_e.expandedKeys,A=_e.checkedKeys,C=ae.props,B=C.onKeyDown,K=C.checkable,M=C.selectable;switch(se.which){case e.a.UP:{ae.offsetActiveKey(-1),se.preventDefault();break}case e.a.DOWN:{ae.offsetActiveKey(1),se.preventDefault();break}}var ie=ae.getActiveItem();if(ie&&ie.data){var Ee=ae.getTreeNodeRequiredProps(),Oe=ie.data.isLeaf===!1||!!(ie.data.children||[]).length,q=Object(i.b)(Object(W.a)(Object(W.a)({},Object(i.f)(te,Ee)),{},{data:ie.data,active:!0}));switch(se.which){case e.a.LEFT:{Oe&&k.includes(te)?ae.onNodeExpand({},q):ie.parent&&ae.onActiveChange(ie.parent.data.key),se.preventDefault();break}case e.a.RIGHT:{Oe&&!k.includes(te)?ae.onNodeExpand({},q):ie.children&&ie.children.length&&ae.onActiveChange(ie.children[0].data.key),se.preventDefault();break}case e.a.ENTER:case e.a.SPACE:{K&&!q.disabled&&q.checkable!==!1&&!q.disableCheckbox?ae.onNodeCheck({},q,!A.includes(te)):!K&&M&&!q.disabled&&q.selectable!==!1&&ae.onNodeSelect({},q);break}}}B&&B(se)},ae.setUncontrolledState=function(se){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ae.destroyed)return;var k=!1,A=!0,C={};Object.keys(se).forEach(function(B){if(B in ae.props){A=!1;return}k=!0,C[B]=se[B]}),k&&(!_e||A)&&ae.setState(Object(W.a)(Object(W.a)({},C),te))},ae.scrollTo=function(se){ae.listRef.current.scrollTo(se)},ae}return Object(S.a)(pe,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var se,_e=this.state,te=_e.focused,k=_e.flattenNodes,A=_e.keyEntities,C=_e.dragging,B=_e.activeKey,K=this.props,M=K.prefixCls,ie=K.className,Ee=K.style,Oe=K.showLine,q=K.focusable,de=K.tabIndex,Te=de===void 0?0:de,xe=K.selectable,Pe=K.showIcon,Ne=K.icon,Re=K.switcherIcon,Me=K.draggable,He=K.checkable,We=K.checkStrictly,Ke=K.disabled,Be=K.motion,Ve=K.loadData,Xe=K.filterTreeNode,ne=K.height,V=K.itemHeight,G=K.virtual,Z=K.titleRender,re=K.onContextMenu,X=Object(a.f)(this.props);return j.createElement(u.a.Provider,{value:{prefixCls:M,selectable:xe,showIcon:Pe,icon:Ne,switcherIcon:Re,draggable:Me,checkable:He,checkStrictly:We,disabled:Ke,keyEntities:A,loadData:Ve,filterTreeNode:Xe,titleRender:Z,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},j.createElement("div",{className:c()(M,ie,(se={},Object(ue.a)(se,"".concat(M,"-show-line"),Oe),Object(ue.a)(se,"".concat(M,"-focused"),te),Object(ue.a)(se,"".concat(M,"-active-focused"),B!==null),se))},j.createElement(H,Object.assign({ref:this.listRef,prefixCls:M,style:Ee,data:k,disabled:Ke,selectable:xe,checkable:!!He,motion:Be,dragging:C,height:ne,itemHeight:V,virtual:G,focusable:q,focused:te,tabIndex:Te,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:re},this.getTreeNodeRequiredProps(),X))))}}],[{key:"getDerivedStateFromProps",value:function(se,_e){var te=_e.prevProps,k={prevProps:se};function A(Ne){return!te&&Ne in se||te&&te[Ne]!==se[Ne]}var C;if(A("treeData")?C=se.treeData:A("children")&&(Object(w.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),C=Object(i.c)(se.children)),C){k.treeData=C;var B=Object(i.a)(C);k.keyEntities=Object(W.a)(Object(ue.a)({},l,E),B.keyEntities)}var K=k.keyEntities||_e.keyEntities;if(A("expandedKeys")||te&&A("autoExpandParent"))k.expandedKeys=se.autoExpandParent||!te&&se.defaultExpandParent?Object(a.e)(se.expandedKeys,K):se.expandedKeys;else if(!te&&se.defaultExpandAll){var M=Object(W.a)({},K);delete M[l],k.expandedKeys=Object.keys(M).map(function(Ne){return M[Ne].key})}else!te&&se.defaultExpandedKeys&&(k.expandedKeys=se.autoExpandParent||se.defaultExpandParent?Object(a.e)(se.defaultExpandedKeys,K):se.defaultExpandedKeys);if(k.expandedKeys||delete k.expandedKeys,C||k.expandedKeys){var ie=Object(i.d)(C||_e.treeData,k.expandedKeys||_e.expandedKeys);k.flattenNodes=ie}if(se.selectable&&(A("selectedKeys")?k.selectedKeys=Object(a.d)(se.selectedKeys,se):!te&&se.defaultSelectedKeys&&(k.selectedKeys=Object(a.d)(se.defaultSelectedKeys,se))),se.checkable){var Ee;if(A("checkedKeys")?Ee=Object(a.j)(se.checkedKeys)||{}:!te&&se.defaultCheckedKeys?Ee=Object(a.j)(se.defaultCheckedKeys)||{}:C&&(Ee=Object(a.j)(se.checkedKeys)||{checkedKeys:_e.checkedKeys,halfCheckedKeys:_e.halfCheckedKeys}),Ee){var Oe=Ee,q=Oe.checkedKeys,de=q===void 0?[]:q,Te=Oe.halfCheckedKeys,xe=Te===void 0?[]:Te;if(!se.checkStrictly){var Pe=Object(I.a)(de,!0,K);de=Pe.checkedKeys,xe=Pe.halfCheckedKeys}k.checkedKeys=de,k.halfCheckedKeys=xe}}return A("loadedKeys")&&(k.loadedKeys=se.loadedKeys),k}}]),pe}(j.Component);z.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},z.TreeNode=t.a;var $=z,fe=be.b=$},fjLI:function(Ge,be,U){"use strict";U.d(be,"f",function(){return u}),U.d(be,"b",function(){return a}),U.d(be,"a",function(){return i}),U.d(be,"d",function(){return d}),U.d(be,"e",function(){return s}),U.d(be,"c",function(){return r});var ue=U("8HAY"),W=U("Vhoy"),R=U("MI8n"),N=U("JYp7"),S=U("pmY6"),O=U("24hK"),F=U("nnTU"),j=U("T8No"),e=U("Cg/j"),w=U("t9D7"),g=function(n,t,v,p){var m=arguments.length,b=m<3?t:p===null?p=Object.getOwnPropertyDescriptor(t,v):p,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,t,v,p);else for(var o=n.length-1;o>=0;o--)(_=n[o])&&(b=(m<3?_(b):m>3?_(t,v,b):_(t,v))||b);return m>3&&b&&Object.defineProperty(t,v,b),b},c=function(n,t){return function(v,p){t(v,p,n)}};function u(n){return n.command!==void 0}class a{constructor(n){this.id=a._idPool++,this._debugName=n}}a._idPool=0,a.CommandPalette=new a("CommandPalette"),a.EditorContext=new a("EditorContext"),a.SimpleEditorContext=new a("SimpleEditorContext"),a.EditorContextCopy=new a("EditorContextCopy"),a.EditorContextPeek=new a("EditorContextPeek"),a.MenubarEditMenu=new a("MenubarEditMenu"),a.MenubarCopy=new a("MenubarCopy"),a.MenubarGoMenu=new a("MenubarGoMenu"),a.MenubarSelectionMenu=new a("MenubarSelectionMenu"),a.InlineCompletionsActions=new a("InlineCompletionsActions");const i=Object(e.c)("menuService"),d=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new R.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:n=>n===a.CommandPalette}}addCommand(n){return this.addCommands(N.a.single(n))}addCommands(n){for(const t of n)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(S.i)(()=>{let t=!1;for(const v of n)t=this._commands.delete(v.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((t,v)=>n.set(v,t)),n}appendMenuItem(n,t){return this.appendMenuItems(N.a.single({id:n,item:t}))}appendMenuItems(n){const t=new Set,v=new O.a;for(const{id:p,item:m}of n){let b=this._menuItems.get(p);b||(b=new O.a,this._menuItems.set(p,b)),v.push(b.push(m)),t.add(p)}return this._onDidChangeMenu.fire(t),Object(S.i)(()=>{if(v.size>0){for(let p of v)p();this._onDidChangeMenu.fire(t),v.clear()}})}getMenuItems(n){let t;return this._menuItems.has(n)?t=[...this._menuItems.get(n)]:t=[],n===a.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(n){const t=new Set;for(const v of n)u(v)&&(t.add(v.command.id),v.alt&&t.add(v.alt.id));this._commands.forEach((v,p)=>{t.has(p)||n.push({command:v})})}};class s extends ue.e{constructor(n,t,v,p){super(`submenuitem.${n.submenu.id}`,typeof n.title=="string"?n.title:n.title.value,[],"submenu");this.item=n,this._menuService=t,this._contextKeyService=v,this._options=p}get actions(){const n=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),v=t.getActions(this._options);t.dispose();for(const[,p]of v)p.length>0&&(n.push(...p),n.push(new ue.d));return n.length&&n.pop(),n}}let r=class n{constructor(t,v,p,m,b){var _,o;if(this._commandService=b,this.id=t.id,this.label=(p==null?void 0:p.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(o=typeof t.tooltip=="string"?t.tooltip:(_=t.tooltip)===null||_===void 0?void 0:_.value)!==null&&o!==void 0?o:"",this.enabled=!t.precondition||m.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const f=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=m.contextMatchesRules(f.condition),this.checked&&f.tooltip&&(this.tooltip=typeof f.tooltip=="string"?f.tooltip:f.tooltip.value),f.title&&(this.label=typeof f.title=="string"?f.title:f.title.value)}this.item=t,this.alt=v?new n(v,void 0,p,m,b):void 0,this._options=p,w.d.isThemeIcon(t.icon)&&(this.class=W.a.asClassName(t.icon))}dispose(){}run(...t){var v,p;let m=[];return((v=this._options)===null||v===void 0?void 0:v.arg)&&(m=[...m,this._options.arg]),((p=this._options)===null||p===void 0?void 0:p.shouldForwardArgs)&&(m=[...m,...t]),this._commandService.executeCommand(this.id,...m)}};r=g([c(3,j.b),c(4,F.b)],r)},ic2d:function(Ge,be,U){"use strict";U.d(be,"a",function(){return N});var ue=U("FWmy"),W=U("746U");class R{constructor(){this.data=new Map}add(S,O){ue.a(W.l(S)),ue.a(W.k(O)),ue.a(!this.data.has(S),"There is already an extension with this id"),this.data.set(S,O)}as(S){return this.data.get(S)||null}}const N=new R},iris:function(Ge,be,U){"use strict";U.d(be,"a",function(){return u});var ue=U("qVdP"),W=U("jsC+"),R=U("lUTK"),N=U("BvKs"),S=U("tJVT"),O=U("q1tI"),F=U.n(O),j=U("Q0Vu"),e=U.n(j),w=[{name:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{name:"\u5355\u9009\u9898",value:"SINGLE"},{name:"\u591A\u9009\u9898",value:"MULTIPLE"},{name:"\u5224\u65AD\u9898",value:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",value:"COMPLETION"},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{name:"\u7EC4\u5408\u9898",value:"COMBINATION"}],g=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],c=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],u=function(i){var d=i.showSelectAll,s=d===void 0?!1:d,r=i.disciplinesData,n=r===void 0?[]:r,t=i.knowledgeData,v=t===void 0?[]:t,p=i.directionValue,m=i.subDisciplineValue,b=i.typeValue,_=i.knowledgeValue,o=i.showKnowledge,f=o===void 0?!1:o,l=i.showRandomType,h=l===void 0?!1:l,E=i.difficultyValue,y=i.randomValue,T=i.selectAll,L=i.languagesvalue,D=i.className,x=i.languages,P=x===void 0?[]:x,H=i.isprogram_homework,I=i.showShixun,z=I===void 0?!1:I,$=i.showItemType,fe=$===void 0?!0:$,ee=i.onShixunChange,ye=ee===void 0?function(){}:ee,pe=i.onDirectionChange,ae=pe===void 0?function(){}:pe,se=i.onTypeChange,_e=se===void 0?function(){}:se,te=i.onDifficultyChange,k=te===void 0?function(){}:te,A=i.handlelanguagesChange,C=A===void 0?function(){}:A,B=i.onKnowledgeChange,K=B===void 0?function(){}:B,M=i.onRandomChange,ie=M===void 0?function(){}:M,Ee=i.showTeachGroup,Oe=Ee===void 0?!1:Ee,q=i.teachGroupData,de=q===void 0?[]:q,Te=i.onTeachGroupChange,xe=Te===void 0?function(){}:Te,Pe=i.teachGroupValue,Ne=Object(O.useState)(0),Re=Object(S.a)(Ne,2),Me=Re[0],He=Re[1],We=Object(O.useRef)(null),Ke=Object(O.useState)(0),Be=Object(S.a)(Ke,2),Ve=Be[0],Xe=Be[1],ne=Object(O.useRef)(null);Object(O.useEffect)(function(){if(n.length!==0){var G;(We==null||((G=We.current)===null||G===void 0)?void 0:G.clientHeight)>108?He(1):He(0)}n.length===0&&He(0)},[n]),Object(O.useEffect)(function(){if(console.log(v.length===0,"\u6570\u91CF"),v.length!==0){var G,Z;console.log(ne==null||((G=ne.current)===null||G===void 0)?void 0:G.clientHeight,"\u9AD8\u5EA6"),(ne==null||((Z=ne.current)===null||Z===void 0)?void 0:Z.clientHeight)>108?Xe(1):Xe(0)}v.length===0&&Xe(0)},[v]);var V=function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],re=arguments.length>1?arguments[1]:void 0;return F.a.createElement(N.a,{className:e.a.subMenu},Z.map(function(X){return F.a.createElement(N.a.Item,{key:X.id},F.a.createElement("a",{className:"".concat(e.a.subItem," ").concat(m===X.id?e.a.subActive:""),onClick:function(){return ae(re,X.id)}},X.name))}))};return F.a.createElement("aside",{className:D?"".concat(e.a.main," ").concat(D):e.a.main},F.a.createElement("div",{className:e.a.wrap},H&&F.a.createElement("div",{className:e.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Oe&&F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u56E2\u961F"),F.a.createElement("div",{className:e.a.directionContentWrap},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(Pe?"":e.a.active," "),onClick:function(){return xe(null)}},"\u5168\u90E8"),de==null?void 0:de.map(function(G){return F.a.createElement("li",{key:G.group_id,className:"".concat(e.a.directionItem," ").concat(Pe===G.group_id?e.a.active:""," "),onClick:function(){return xe(G.group_id)}},G.name)}))),F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u65B9\u5411"),F.a.createElement("span",null),F.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:Me===1?88:"auto"}},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p?"":e.a.active," "),onClick:function(){return ae(null)}},"\u5168\u90E8"),n.map(function(G){var Z;return F.a.createElement(F.a.Fragment,{key:G.id},((Z=G.sub_disciplines)===null||Z===void 0?void 0:Z.length)>0?F.a.createElement(W.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(X){return X.parentNode},overlay:function(){return V(G.sub_disciplines,G.id)}},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===G.id?e.a.active:""," "),onClick:function(){return ae(G.id)}},G.name)):F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===G.id?e.a.active:""," "),onClick:function(){return ae(G.id)}},G.name))})),F.a.createElement("div",{className:e.a.directionContentWrap,ref:We,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},n.map(function(G){var Z;return F.a.createElement(F.a.Fragment,{key:G.id},((Z=G.sub_disciplines)===null||Z===void 0?void 0:Z.length)>0?F.a.createElement(W.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(X){return X.parentNode},overlay:function(){return V(G.sub_disciplines,G.id)}},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===G.id?e.a.active:""," "),onClick:function(){return ae(G.id)}},G.name)):F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(p===G.id?e.a.active:""," "),onClick:function(){return ae(G.id)}},G.name))})),!!Me&&F.a.createElement("div",{className:e.a.action},Me===1&&F.a.createElement("span",{onClick:function(){return He(2)}},"\u5C55\u5F00",F.a.createElement("i",{className:"iconfont icon-xiala"})),Me===2&&F.a.createElement("span",{onClick:function(){return He(1)}},"\u6536\u8D77",F.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),f&&F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u77E5\u8BC6\u70B9"),F.a.createElement("div",{className:e.a.directionContentWrap,style:{overflow:"hidden",height:Ve===1?106:"auto"}},F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(_===-1?e.a.active:""," "),onClick:function(){return K(-1)}},"\u5168\u90E8"),v.map(function(G){return F.a.createElement("li",{key:G.id,className:"".concat(e.a.directionItem," ").concat(_===G.id?e.a.active:""," "),onClick:function(){return K(G.id)}},G.name)})),F.a.createElement("div",{ref:ne,className:e.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},v.map(function(G){return F.a.createElement("li",{key:G.id,className:"".concat(e.a.directionItem," ").concat(_===G.id?e.a.active:""," "),onClick:function(){return K(G.id)}},G.name)})),!!Ve&&F.a.createElement("div",{className:e.a.action},Ve===1&&F.a.createElement("span",{onClick:function(){return Xe(2)}},"\u5C55\u5F00",F.a.createElement("i",{className:"iconfont icon-xiala"})),Ve===2&&F.a.createElement("span",{onClick:function(){return Xe(1)}},"\u6536\u8D77",F.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),fe&&!H&&F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u9898\u578B"),F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(b?"":e.a.active," "),onClick:function(){return _e(null)}},"\u5168\u90E8"),F.a.createElement("div",{className:e.a.directionContentWrap},w.map(function(G){return F.a.createElement("li",{key:G.name,className:"".concat(e.a.directionItem," ").concat(b===G.value?e.a.active:""," "),onClick:function(){return _e(G.value)}},G.name)}),z&&F.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:e.a.directionItem,onClick:function(){return ye()}},"\u5B9E\u8BAD\u9898"))),F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u96BE\u5EA6"),F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(E?"":e.a.active," "),onClick:function(){return k(null)}},"\u5168\u90E8"),F.a.createElement("div",{className:e.a.directionContentWrap},g.map(function(G){return F.a.createElement("li",{key:G.name,className:"".concat(e.a.directionItem," ").concat(E===G.value?e.a.active:""," "),onClick:function(){return k(G.value)}},G.name)}))),h&&F.a.createElement("div",{className:e.a.content},F.a.createElement("span",{className:e.a.name},"\u7C7B\u578B"),F.a.createElement("li",{className:"".concat(e.a.directionItem," ").concat(y?"":e.a.active," "),onClick:function(){return ie(null)}},"\u5168\u90E8"),F.a.createElement("div",{className:e.a.directionContentWrap},c.map(function(G){return F.a.createElement("li",{key:G.name,className:"".concat(e.a.directionItem," ").concat(y===G.value?e.a.active:""," "),onClick:function(){return ie(G.value)}},G.name)})))))}},jcZT:function(Ge,be,U){"use strict";var ue=U("2qtc"),W=U("kLXV"),R=U("5NDa"),N=U("5rEg"),S=U("miYZ"),O=U("tsqr"),F=U("9og8"),j=U("tJVT"),e=U("WmNS"),w=U.n(e),g=U("q1tI"),c=U.n(g),u=U("d5o6"),a=U.n(u),i=U("P/tu"),d=U("WCUW"),s=U("9kvl"),r=function(t){var v=t.problemset,p=t.dispatch,m=t.onOk,b=Object(g.useState)(""),_=Object(j.a)(b,2),o=_[0],f=_[1],l=Object(g.useState)([0]),h=Object(j.a)(l,2),E=h[0],y=h[1],T=function(){p({type:"problemset/setActionTabs",payload:{}})};Object(g.useEffect)(function(){if(v.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var D,x;y([(D=v.actionTabs)===null||D===void 0||((x=D.params)===null||x===void 0)?void 0:x.group_id]),f("")}},[v.actionTabs.key]);var L=function(){var D=Object(F.a)(w.a.mark(function x(){var P,H,I;return w.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:if(P=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],o.trim()){$.next=4;break}return O.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),$.abrupt("return");case 4:if(!(o.charAt(0)===" ")){$.next=7;break}return O.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),$.abrupt("return");case 7:H=0;case 8:if(!(H<o.length)){$.next=15;break}if(!P.includes(o.charAt(H))){$.next=12;break}return O.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),$.abrupt("return",!1);case 12:H++,$.next=8;break;case 15:return $.next=17,Object(d.p)({parent_id:E.length>0?E[0]:0,name:o});case 17:I=$.sent,I.status===0&&(T(),m(I==null?void 0:I.id));case 19:case"end":return $.stop()}},x)}));return function(){return D.apply(this,arguments)}}();return c.a.createElement(W.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:v.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:T,onOk:L,destroyOnClose:!0},c.a.createElement("div",{className:a.a.addModal},c.a.createElement("div",{className:a.a.row},c.a.createElement("span",{className:a.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),c.a.createElement(N.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:o,onChange:function(x){return f(x.target.value)}})),c.a.createElement("div",{className:a.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},c.a.createElement("span",{className:a.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),c.a.createElement(i.a,{value:E,onChange:function(x){return y(x)}}))))};be.a=Object(s.a)(function(n){var t=n.problemset;return{problemset:t}})(r)},k3GJ:function(Ge,be,U){"use strict";U.d(be,"a",function(){return Hi});var ue=U("rePB"),W=U("ODXe"),R=U("Ff2n"),N=U("VTBJ"),S=U("q1tI"),O=U("TSYQ"),F=U.n(O),j=U("Zm9Q"),e=U("6cGi"),w=U("KQm4"),g=U("xEkU"),c=U.n(g),u=U("t23M");function a(ce){var Se=Object(S.useRef)(),we=Object(S.useRef)(!1);function ge(){for(var Y=arguments.length,le=new Array(Y),J=0;J<Y;J++)le[J]=arguments[J];we.current||(c.a.cancel(Se.current),Se.current=c()(function(){ce.apply(void 0,le)}))}return Object(S.useEffect)(function(){return function(){we.current=!0,c.a.cancel(Se.current)}},[]),ge}function i(ce){var Se=Object(S.useRef)([]),we=Object(S.useState)({}),ge=Object(W.a)(we,2),Y=ge[1],le=Object(S.useRef)(typeof ce=="function"?ce():ce),J=a(function(){var ve=le.current;Se.current.forEach(function(Ce){ve=Ce(ve)}),Se.current=[],le.current=ve,Y({})});function me(ve){Se.current.push(ve),J()}return[le.current,me]}var d=U("4IlW");function s(ce,Se){var we,ge=ce.prefixCls,Y=ce.id,le=ce.active,J=ce.rtl,me=ce.tab,ve=me.key,Ce=me.tab,Ae=me.disabled,Le=me.closeIcon,ke=ce.tabBarGutter,Fe=ce.tabPosition,je=ce.closable,ze=ce.renderWrapper,st=ce.removeAriaLabel,gt=ce.editable,lt=ce.onClick,_t=ce.onRemove,vt=ce.onFocus,ct="".concat(ge,"-tab");S.useEffect(function(){return _t},[]);var ht={};Fe==="top"||Fe==="bottom"?ht[J?"marginLeft":"marginRight"]=ke:ht.marginBottom=ke;var At=gt&&je!==!1&&!Ae;function Et(rt){if(Ae)return;lt(rt)}function zt(rt){rt.preventDefault(),rt.stopPropagation(),gt.onEdit("remove",{key:ve,event:rt})}var Pt=S.createElement("div",{key:ve,ref:Se,className:F()(ct,(we={},Object(ue.a)(we,"".concat(ct,"-with-remove"),At),Object(ue.a)(we,"".concat(ct,"-active"),le),Object(ue.a)(we,"".concat(ct,"-disabled"),Ae),we)),style:ht,onClick:Et},S.createElement("div",{role:"tab","aria-selected":le,id:Y&&"".concat(Y,"-tab-").concat(ve),className:"".concat(ct,"-btn"),"aria-controls":Y&&"".concat(Y,"-panel-").concat(ve),"aria-disabled":Ae,tabIndex:Ae?null:0,onClick:function(nt){nt.stopPropagation(),Et(nt)},onKeyDown:function(nt){[d.a.SPACE,d.a.ENTER].includes(nt.which)&&(nt.preventDefault(),Et(nt))},onFocus:vt},Ce),At&&S.createElement("button",{type:"button","aria-label":st||"remove",tabIndex:0,className:"".concat(ct,"-remove"),onClick:function(nt){nt.stopPropagation(),zt(nt)}},Le||gt.removeIcon||"\xD7"));return ze&&(Pt=ze(Pt)),Pt}var r=S.forwardRef(s),n={width:0,height:0,left:0,top:0};function t(ce,Se,we){return Object(S.useMemo)(function(){for(var ge,Y=new Map,le=Se.get((ge=ce[0])===null||ge===void 0?void 0:ge.key)||n,J=le.left+le.width,me=0;me<ce.length;me+=1){var ve=ce[me].key,Ce=Se.get(ve);if(!Ce){var Ae;Ce=Se.get((Ae=ce[me-1])===null||Ae===void 0?void 0:Ae.key)||n}var Le=Y.get(ve)||Object(N.a)({},Ce);Le.right=J-Le.left-Le.width,Y.set(ve,Le)}return Y},[ce.map(function(ge){return ge.key}).join("_"),Se,we])}var v={width:0,height:0,left:0,top:0,right:0};function p(ce,Se,we,ge,Y){var le=Y.tabs,J=Y.tabPosition,me=Y.rtl,ve,Ce,Ae;["top","bottom"].includes(J)?(ve="width",Ce=me?"right":"left",Ae=Math.abs(Se.left)):(ve="height",Ce="top",Ae=-Se.top);var Le=Se[ve],ke=we[ve],Fe=ge[ve],je=Le;return ke+Fe>Le&&(je=Le-Fe),Object(S.useMemo)(function(){if(!le.length)return[0,0];for(var ze=le.length,st=ze,gt=0;gt<ze;gt+=1){var lt=ce.get(le[gt].key)||v;if(lt[Ce]+lt[ve]>Ae+je){st=gt-1;break}}for(var _t=0,vt=ze-1;vt>=0;vt-=1){var ct=ce.get(le[vt].key)||v;if(ct[Ce]<Ae){_t=vt+1;break}}return[_t,st]},[ce,Ae,je,J,le.map(function(ze){return ze.key}).join("_"),me])}var m=U("wx14"),b=U("1OyB"),_=U("vuIU"),o=U("JX7q"),f=U("Ji7U"),l=U("LK+K"),h=U("I8Z2"),E=U("bT9E"),y=U("2GS6"),T=U("Gytx"),L=U.n(T),D=U("U8pU"),x=/iPhone/i,P=/iPod/i,H=/iPad/i,I=/\bAndroid(?:.+)Mobile\b/i,z=/Android/i,$=/\bAndroid(?:.+)SD4930UR\b/i,fe=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,ee=/Windows Phone/i,ye=/\bWindows(?:.+)ARM\b/i,pe=/BlackBerry/i,ae=/BB10/i,se=/Opera Mini/i,_e=/\b(CriOS|Chrome)(?:.+)Mobile/i,te=/Mobile(?:.+)Firefox\b/i;function k(ce,Se){return ce.test(Se)}function A(ce){var Se=ce||(typeof navigator!="undefined"?navigator.userAgent:""),we=(Se||"").split("[FBAN");if(typeof we[1]!="undefined"){var ge=we,Y=Object(W.a)(ge,1);Se=Y[0]}if(we=Se.split("Twitter"),typeof we[1]!="undefined"){var le=we,J=Object(W.a)(le,1);Se=J[0]}var me={apple:{phone:k(x,Se)&&!k(ee,Se),ipod:k(P,Se),tablet:!k(x,Se)&&k(H,Se)&&!k(ee,Se),device:(k(x,Se)||k(P,Se)||k(H,Se))&&!k(ee,Se)},amazon:{phone:k($,Se),tablet:!k($,Se)&&k(fe,Se),device:k($,Se)||k(fe,Se)},android:{phone:!k(ee,Se)&&k($,Se)||!k(ee,Se)&&k(I,Se),tablet:!k(ee,Se)&&!k($,Se)&&!k(I,Se)&&(k(fe,Se)||k(z,Se)),device:!k(ee,Se)&&(k($,Se)||k(fe,Se)||k(I,Se)||k(z,Se))||k(/\bokhttp\b/i,Se)},windows:{phone:k(ee,Se),tablet:k(ye,Se),device:k(ee,Se)||k(ye,Se)},other:{blackberry:k(pe,Se),blackberry10:k(ae,Se),opera:k(se,Se),firefox:k(te,Se),chrome:k(_e,Se),device:k(pe,Se)||k(ae,Se)||k(se,Se)||k(te,Se)||k(_e,Se)},any:null,phone:null,tablet:null};return me.any=me.apple.device||me.android.device||me.windows.device||me.other.device,me.phone=me.apple.phone||me.android.phone||me.windows.phone,me.tablet=me.apple.tablet||me.android.tablet||me.windows.tablet,me}var C=Object(N.a)(Object(N.a)({},A()),{},{isMobile:A}),B=C;function K(){}function M(ce,Se,we){var ge=Se||"";return ce.key||"".concat(ge,"item_").concat(we)}function ie(ce){return"".concat(ce,"-menu-")}function Ee(ce,Se){var we=-1;S.Children.forEach(ce,function(ge){we+=1,ge&&ge.type&&ge.type.isMenuItemGroup?S.Children.forEach(ge.props.children,function(Y){we+=1,Se(Y,we)}):Se(ge,we)})}function Oe(ce,Se,we){if(!ce||we.find)return;S.Children.forEach(ce,function(ge){if(ge){var Y=ge.type;if(!Y||!(Y.isSubMenu||Y.isMenuItem||Y.isMenuItemGroup))return;Se.indexOf(ge.key)!==-1?we.find=!0:ge.props.children&&Oe(ge.props.children,Se,we)}})}var q=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],de=function(Se){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=Se&&typeof Se.getBoundingClientRect=="function"&&Se.getBoundingClientRect().width;if(ge){if(we){var Y=getComputedStyle(Se),le=Y.marginLeft,J=Y.marginRight;ge+=+le.replace("px","")+ +J.replace("px","")}ge=+ge.toFixed(6)}return ge||0},Te=function(Se,we,ge){Se&&Object(D.a)(Se.style)==="object"&&(Se.style[we]=ge)},xe=function(){return B.any},Pe=U("bdgK"),Ne=U("i8i4"),Re=U.n(Ne),Me=U("wgJM"),He=U("l4aY"),We=U("m+aA"),Ke=U("c+Xe"),Be=U("zT1h"),Ve=U("QC+M");function Xe(ce,Se,we){return we?ce[0]===Se[0]:ce[0]===Se[0]&&ce[1]===Se[1]}function ne(ce,Se,we){var ge=ce[Se]||{};return Object(N.a)(Object(N.a)({},ge),we)}function V(ce,Se,we,ge){for(var Y=we.points,le=Object.keys(ce),J=0;J<le.length;J+=1){var me=le[J];if(Xe(ce[me].points,Y,ge))return"".concat(Se,"-placement-").concat(me)}return""}var G=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var ce=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ce)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ce==null?void 0:ce.substr(0,4)))},Z=U("MNnm");function re(ce,Se){var we={};return we[ce.toLowerCase()]=Se.toLowerCase(),we["Webkit".concat(ce)]="webkit".concat(Se),we["Moz".concat(ce)]="moz".concat(Se),we["ms".concat(ce)]="MS".concat(Se),we["O".concat(ce)]="o".concat(Se.toLowerCase()),we}function X(ce,Se){var we={animationend:re("Animation","AnimationEnd"),transitionend:re("Transition","TransitionEnd")};return ce&&("AnimationEvent"in Se||delete we.animationend.animation,"TransitionEvent"in Se||delete we.transitionend.transition),we}var Q=X(Object(Z.a)(),typeof window!="undefined"?window:{}),oe={};if(Object(Z.a)()){var he=document.createElement("div");oe=he.style}var De={};function Ie(ce){if(De[ce])return De[ce];var Se=Q[ce];if(Se)for(var we=Object.keys(Se),ge=we.length,Y=0;Y<ge;Y+=1){var le=we[Y];if(Object.prototype.hasOwnProperty.call(Se,le)&&le in oe)return De[ce]=Se[le],De[ce]}return""}var Ue=Ie("animationend"),Ye=Ie("transitionend"),Je=!!(Ue&&Ye),Ze=Ue||"animationend",dt=Ye||"transitionend";function at(ce,Se){if(!ce)return null;if(Object(D.a)(ce)==="object"){var we=Se.replace(/-\w/g,function(ge){return ge[1].toUpperCase()});return ce[we]}return"".concat(ce,"-").concat(Se)}var $e="none",Nt="appear",bt="enter",Ut="leave",Lt="none",ot="prepare",Ft="start",Jt="active",Vt="end";function rn(ce){var Se=Object(S.useRef)(!1),we=Object(S.useState)(ce),ge=Object(W.a)(we,2),Y=ge[0],le=ge[1];function J(me){Se.current||le(me)}return Object(S.useEffect)(function(){return function(){Se.current=!0}},[]),[Y,J]}var qe=Object(Z.a)()?S.useLayoutEffect:S.useEffect,it=qe,ft=function(){var ce=S.useRef(null);function Se(){Me.a.cancel(ce.current)}function we(ge){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Se();var le=Object(Me.a)(function(){Y<=1?ge({isCanceled:function(){return le!==ce.current}}):we(ge,Y-1)});ce.current=le}return S.useEffect(function(){return function(){Se()}},[]),[we,Se]},It=[ot,Ft,Jt,Vt],$t=!1,ln=!0;function Bt(ce){return ce===Jt||ce===Vt}var pt=function(ce,Se){var we=S.useState(Lt),ge=Object(W.a)(we,2),Y=ge[0],le=ge[1],J=ft(),me=Object(W.a)(J,2),ve=me[0],Ce=me[1];function Ae(){le(ot)}return it(function(){if(Y!==Lt&&Y!==Vt){var Le=It.indexOf(Y),ke=It[Le+1],Fe=Se(Y);Fe===$t?le(ke):ve(function(je){function ze(){if(je.isCanceled())return;le(ke)}Fe===!0?ze():Promise.resolve(Fe).then(ze)})}},[ce,Y]),S.useEffect(function(){return function(){Ce()}},[]),[Ae,Y]},yt=function(ce){var Se=Object(S.useRef)(),we=Object(S.useRef)(ce);we.current=ce;var ge=S.useCallback(function(J){we.current(J)},[]);function Y(J){J&&(J.removeEventListener(dt,ge),J.removeEventListener(Ze,ge))}function le(J){Se.current&&Se.current!==J&&Y(Se.current),J&&J!==Se.current&&(J.addEventListener(dt,ge),J.addEventListener(Ze,ge),Se.current=J)}return S.useEffect(function(){return function(){Y(Se.current)}},[]),[le,Y]};function ut(ce,Se,we,ge){var Y=ge.motionEnter,le=Y===void 0?!0:Y,J=ge.motionAppear,me=J===void 0?!0:J,ve=ge.motionLeave,Ce=ve===void 0?!0:ve,Ae=ge.motionDeadline,Le=ge.motionLeaveImmediately,ke=ge.onAppearPrepare,Fe=ge.onEnterPrepare,je=ge.onLeavePrepare,ze=ge.onAppearStart,st=ge.onEnterStart,gt=ge.onLeaveStart,lt=ge.onAppearActive,_t=ge.onEnterActive,vt=ge.onLeaveActive,ct=ge.onAppearEnd,ht=ge.onEnterEnd,At=ge.onLeaveEnd,Et=ge.onVisibleChanged,zt=rn(),Pt=Object(W.a)(zt,2),rt=Pt[0],nt=Pt[1],Tt=rn($e),St=Object(W.a)(Tt,2),Qe=St[0],wt=St[1],Wt=rn(null),Ct=Object(W.a)(Wt,2),kt=Ct[0],Gt=Ct[1],an=Object(S.useRef)(!1),cn=Object(S.useRef)(null),Yt=Object(S.useRef)(!1),hn=Object(S.useRef)(null);function vn(){var Ht=we();return Ht||hn.current}var fn=Object(S.useRef)(!1);function pn(Ht){var Dt=vn();if(Ht&&!Ht.deadline&&Ht.target!==Dt)return;var on;Qe===Nt&&fn.current?on=ct==null?void 0:ct(Dt,Ht):Qe===bt&&fn.current?on=ht==null?void 0:ht(Dt,Ht):Qe===Ut&&fn.current&&(on=At==null?void 0:At(Dt,Ht)),on!==!1&&!Yt.current&&(wt($e),Gt(null))}var Zt=yt(pn),un=Object(W.a)(Zt,1),sn=un[0],tn=S.useMemo(function(){var Ht,Dt,on;switch(Qe){case"appear":return Ht={},Object(ue.a)(Ht,ot,ke),Object(ue.a)(Ht,Ft,ze),Object(ue.a)(Ht,Jt,lt),Ht;case"enter":return Dt={},Object(ue.a)(Dt,ot,Fe),Object(ue.a)(Dt,Ft,st),Object(ue.a)(Dt,Jt,_t),Dt;case"leave":return on={},Object(ue.a)(on,ot,je),Object(ue.a)(on,Ft,gt),Object(ue.a)(on,Jt,vt),on;default:return{}}},[Qe]),bn=pt(Qe,function(Ht){if(Ht===ot){var Dt=tn[ot];return Dt?Dt(vn()):$t}if(jt in tn){var on;Gt(((on=tn[jt])===null||on===void 0?void 0:on.call(tn,vn(),null))||null)}return jt===Jt&&(sn(vn()),Ae>0&&(clearTimeout(cn.current),cn.current=setTimeout(function(){pn({deadline:!0})},Ae))),ln}),En=Object(W.a)(bn,2),An=En[0],jt=En[1],yn=Bt(jt);fn.current=yn,it(function(){nt(Se);var Ht=an.current;if(an.current=!0,!ce)return;var Dt;!Ht&&Se&&me&&(Dt=Nt),Ht&&Se&&le&&(Dt=bt),(Ht&&!Se&&Ce||!Ht&&Le&&!Se&&Ce)&&(Dt=Ut),Dt&&(wt(Dt),An())},[Se]),Object(S.useEffect)(function(){(Qe===Nt&&!me||Qe===bt&&!le||Qe===Ut&&!Ce)&&wt($e)},[me,le,Ce]),Object(S.useEffect)(function(){return function(){clearTimeout(cn.current),Yt.current=!0}},[]),Object(S.useEffect)(function(){rt!==void 0&&Qe===$e&&(Et==null||Et(rt))},[rt,Qe]);var wn=kt;return tn[ot]&&jt===Ft&&(wn=Object(N.a)({transition:"none"},wn)),[Qe,jt,wn,rt!=null?rt:Se]}var Qt=function(ce){Object(f.a)(we,ce);var Se=Object(l.a)(we);function we(){return Object(b.a)(this,we),Se.apply(this,arguments)}return Object(_.a)(we,[{key:"render",value:function(){return this.props.children}}]),we}(S.Component),Rt=Qt;function dn(ce){var Se=ce;Object(D.a)(ce)==="object"&&(Se=ce.transitionSupport);function we(Y){return!!(Y.motionName&&Se)}var ge=S.forwardRef(function(Y,le){var J=Y.visible,me=J===void 0?!0:J,ve=Y.removeOnLeave,Ce=ve===void 0?!0:ve,Ae=Y.forceRender,Le=Y.children,ke=Y.motionName,Fe=Y.leavedClassName,je=Y.eventProps,ze=we(Y),st=Object(S.useRef)(),gt=Object(S.useRef)();function lt(){try{return Object(We.a)(st.current||gt.current)}catch(wt){return null}}var _t=ut(ze,me,lt,Y),vt=Object(W.a)(_t,4),ct=vt[0],ht=vt[1],At=vt[2],Et=vt[3],zt=S.useRef(Et);Et&&(zt.current=!0);var Pt=Object(S.useRef)(le);Pt.current=le;var rt=S.useCallback(function(wt){st.current=wt,Object(Ke.b)(Pt.current,wt)},[]),nt,Tt=Object(N.a)(Object(N.a)({},je),{},{visible:me});if(!Le)nt=null;else if(ct===$e||!we(Y))Et?nt=Le(Object(N.a)({},Tt),rt):!Ce&&zt.current?nt=Le(Object(N.a)(Object(N.a)({},Tt),{},{className:Fe}),rt):Ae?nt=Le(Object(N.a)(Object(N.a)({},Tt),{},{style:{display:"none"}}),rt):nt=null;else{var St,Qe;ht===ot?Qe="prepare":Bt(ht)?Qe="active":ht===Ft&&(Qe="start"),nt=Le(Object(N.a)(Object(N.a)({},Tt),{},{className:F()(at(ke,ct),(St={},Object(ue.a)(St,at(ke,"".concat(ct,"-").concat(Qe)),Qe),Object(ue.a)(St,ke,typeof ke=="string"),St)),style:At}),rt)}return S.createElement(Rt,{ref:gt},nt)});return ge.displayName="CSSMotion",ge}var Kt=dn(Je),gn="add",xn="keep",Sn="remove",Cn="removed";function ti(ce){var Se;return ce&&Object(D.a)(ce)==="object"&&"key"in ce?Se=ce:Se={key:ce},Object(N.a)(Object(N.a)({},Se),{},{key:String(Se.key)})}function en(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ce.map(ti)}function ni(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],we=[],ge=0,Y=Se.length,le=en(ce),J=en(Se);le.forEach(function(Ce){for(var Ae=!1,Le=ge;Le<Y;Le+=1){var ke=J[Le];if(ke.key===Ce.key){ge<Le&&(we=we.concat(J.slice(ge,Le).map(function(Fe){return Object(N.a)(Object(N.a)({},Fe),{},{status:gn})})),ge=Le),we.push(Object(N.a)(Object(N.a)({},ke),{},{status:xn})),ge+=1,Ae=!0;break}}Ae||we.push(Object(N.a)(Object(N.a)({},Ce),{},{status:Sn}))}),ge<Y&&(we=we.concat(J.slice(ge).map(function(Ce){return Object(N.a)(Object(N.a)({},Ce),{},{status:gn})})));var me={};we.forEach(function(Ce){var Ae=Ce.key;me[Ae]=(me[Ae]||0)+1});var ve=Object.keys(me).filter(function(Ce){return me[Ce]>1});return ve.forEach(function(Ce){we=we.filter(function(Ae){var Le=Ae.key,ke=Ae.status;return Le!==Ce||ke!==Sn}),we.forEach(function(Ae){Ae.key===Ce&&(Ae.status=xn)})}),we}var ii=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function ri(ce){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Kt,we=function(ge){Object(f.a)(le,ge);var Y=Object(l.a)(le);function le(){var J;return Object(b.a)(this,le),J=Y.apply(this,arguments),J.state={keyEntities:[]},J.removeKey=function(me){J.setState(function(ve){var Ce=ve.keyEntities;return{keyEntities:Ce.map(function(Ae){return Ae.key!==me?Ae:Object(N.a)(Object(N.a)({},Ae),{},{status:Cn})})}})},J}return Object(_.a)(le,[{key:"render",value:function(){var me=this,ve=this.state.keyEntities,Ce=this.props,Ae=Ce.component,Le=Ce.children,ke=Ce.onVisibleChanged,Fe=Object(R.a)(Ce,["component","children","onVisibleChanged"]),je=Ae||S.Fragment,ze={};return ii.forEach(function(st){ze[st]=Fe[st],delete Fe[st]}),delete Fe.keys,S.createElement(je,Fe,ve.map(function(st){var gt=st.status,lt=Object(R.a)(st,["status"]),_t=gt===gn||gt===xn;return S.createElement(Se,Object(m.a)({},ze,{key:lt.key,visible:_t,eventProps:lt,onVisibleChanged:function(ct){ke==null||ke(ct,{key:lt.key}),ct||me.removeKey(lt.key)}}),Le)}))}}],[{key:"getDerivedStateFromProps",value:function(me,ve){var Ce=me.keys,Ae=ve.keyEntities,Le=en(Ce),ke=ni(Ae,Le);return{keyEntities:ke.filter(function(Fe){var je=Ae.find(function(ze){var st=ze.key;return Fe.key===st});return!(je&&je.status===Cn&&Fe.status===Sn)})}}}]),le}(S.Component);return we.defaultProps={component:"div"},we}var Ai=ri(Je),On=Kt;function Hn(ce){var Se=ce.prefixCls,we=ce.motion,ge=ce.animation,Y=ce.transitionName;return we||(ge?{motionName:"".concat(Se,"-").concat(ge)}:Y?{motionName:Y}:null)}function Kn(ce){var Se=ce.prefixCls,we=ce.visible,ge=ce.zIndex,Y=ce.mask,le=ce.maskMotion,J=ce.maskAnimation,me=ce.maskTransitionName;if(!Y)return null;var ve={};return(le||me||J)&&(ve=Object(N.a)({motionAppear:!0},Hn({motion:le,prefixCls:Se,transitionName:me,animation:J}))),S.createElement(On,Object(m.a)({},ve,{visible:we,removeOnLeave:!0}),function(Ce){var Ae=Ce.className;return S.createElement("div",{style:{zIndex:ge},className:F()("".concat(Se,"-mask"),Ae)})})}var ai=U("9mu1"),Gn=U("o0o1"),zn=U.n(Gn),si=U("HaE+"),Ln=["measure","align",null,"motion"],oi=function(ce,Se){var we=Object(S.useState)(null),ge=Object(W.a)(we,2),Y=ge[0],le=ge[1],J=Object(S.useRef)(),me=Object(S.useRef)(!1);function ve(Le){me.current||le(Le)}function Ce(){Me.a.cancel(J.current)}function Ae(Le){Ce(),J.current=Object(Me.a)(function(){ve(function(ke){switch(Y){case"align":return"motion";case"motion":return"stable";default:}return ke}),Le==null||Le()})}return Object(S.useEffect)(function(){ve("measure")},[ce]),Object(S.useEffect)(function(){switch(Y){case"measure":Se();break;default:}Y&&(J.current=Object(Me.a)(Object(si.a)(zn.a.mark(function Le(){var ke,Fe;return zn.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:ke=Ln.indexOf(Y),Fe=Ln[ke+1],Fe&&ke!==-1&&ve(Fe);case 3:case"end":return ze.stop()}},Le)}))))},[Y]),Object(S.useEffect)(function(){return function(){me.current=!0,Ce()}},[]),[Y,Ae]},Vn=function(ce){var Se=S.useState({width:0,height:0}),we=Object(W.a)(Se,2),ge=we[0],Y=we[1];function le(me){Y({width:me.offsetWidth,height:me.offsetHeight})}var J=S.useMemo(function(){var me={};if(ce){var ve=ge.width,Ce=ge.height;ce.indexOf("height")!==-1&&Ce?me.height=Ce:ce.indexOf("minHeight")!==-1&&Ce&&(me.minHeight=Ce),ce.indexOf("width")!==-1&&ve?me.width=ve:ce.indexOf("minWidth")!==-1&&ve&&(me.minWidth=ve)}return me},[ce,ge]);return[J,le]},Xn=S.forwardRef(function(ce,Se){var we=ce.visible,ge=ce.prefixCls,Y=ce.className,le=ce.style,J=ce.children,me=ce.zIndex,ve=ce.stretch,Ce=ce.destroyPopupOnHide,Ae=ce.forceRender,Le=ce.align,ke=ce.point,Fe=ce.getRootDomNode,je=ce.getClassNameFromAlign,ze=ce.onAlign,st=ce.onMouseEnter,gt=ce.onMouseLeave,lt=ce.onMouseDown,_t=ce.onTouchStart,vt=Object(S.useRef)(),ct=Object(S.useRef)(),ht=Object(S.useState)(),At=Object(W.a)(ht,2),Et=At[0],zt=At[1],Pt=Vn(ve),rt=Object(W.a)(Pt,2),nt=rt[0],Tt=rt[1];function St(){ve&&Tt(Fe())}var Qe=oi(we,St),wt=Object(W.a)(Qe,2),Wt=wt[0],Ct=wt[1],kt=Object(S.useRef)();function Gt(){return ke||Fe}function an(){var Zt;(Zt=vt.current)===null||Zt===void 0||Zt.forceAlign()}function cn(Zt,un){var sn=je(un);Et!==sn&&zt(sn),Wt==="align"&&(Et!==sn?Promise.resolve().then(function(){an()}):Ct(function(){var tn;(tn=kt.current)===null||tn===void 0||tn.call(kt)}),ze==null||ze(Zt,un))}var Yt=Object(N.a)({},Hn(ce));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Zt){var un=Yt[Zt];Yt[Zt]=function(sn,tn){return Ct(),un==null?void 0:un(sn,tn)}});function hn(){return new Promise(function(Zt){kt.current=Zt})}S.useEffect(function(){!Yt.motionName&&Wt==="motion"&&Ct()},[Yt.motionName,Wt]),S.useImperativeHandle(Se,function(){return{forceAlign:an,getElement:function(){return ct.current}}});var vn=Object(N.a)(Object(N.a)({},nt),{},{zIndex:me,opacity:Wt==="motion"||Wt==="stable"||!we?void 0:0,pointerEvents:Wt==="stable"?void 0:"none"},le),fn=!0;(Le==null?void 0:Le.points)&&(Wt==="align"||Wt==="stable")&&(fn=!1);var pn=J;return S.Children.count(J)>1&&(pn=S.createElement("div",{className:"".concat(ge,"-content")},J)),S.createElement(On,Object(m.a)({visible:we,ref:ct,leavedClassName:"".concat(ge,"-hidden")},Yt,{onAppearPrepare:hn,onEnterPrepare:hn,removeOnLeave:Ce,forceRender:Ae}),function(Zt,un){var sn=Zt.className,tn=Zt.style,bn=F()(ge,Y,Et,sn);return S.createElement(ai.a,{target:Gt(),key:"popup",ref:vt,monitorWindowResize:!0,disabled:fn,align:Le,onAlign:cn},S.createElement("div",{ref:un,className:bn,onMouseEnter:st,onMouseLeave:gt,onMouseDownCapture:lt,onTouchStartCapture:_t,style:Object(N.a)(Object(N.a)({},tn),vn)},pn))})});Xn.displayName="PopupInner";var li=Xn,Yn=S.forwardRef(function(ce,Se){var we=ce.prefixCls,ge=ce.visible,Y=ce.zIndex,le=ce.children,J=ce.mobile;J=J===void 0?{}:J;var me=J.popupClassName,ve=J.popupStyle,Ce=J.popupMotion,Ae=Ce===void 0?{}:Ce,Le=J.popupRender,ke=S.useRef();S.useImperativeHandle(Se,function(){return{forceAlign:function(){},getElement:function(){return ke.current}}});var Fe=Object(N.a)({zIndex:Y},ve),je=le;return S.Children.count(le)>1&&(je=S.createElement("div",{className:"".concat(we,"-content")},le)),Le&&(je=Le(je)),S.createElement(On,Object(m.a)({visible:ge,ref:ke,removeOnLeave:!0},Ae),function(ze,st){var gt=ze.className,lt=ze.style,_t=F()(we,me,gt);return S.createElement("div",{ref:st,className:_t,style:Object(N.a)(Object(N.a)({},lt),Fe)},je)})});Yn.displayName="MobilePopupInner";var ui=Yn,di=["visible","mobile"],$n=S.forwardRef(function(ce,Se){var we=ce.visible,ge=ce.mobile,Y=Object(R.a)(ce,di),le=Object(S.useState)(we),J=Object(W.a)(le,2),me=J[0],ve=J[1],Ce=Object(S.useState)(!1),Ae=Object(W.a)(Ce,2),Le=Ae[0],ke=Ae[1],Fe=Object(N.a)(Object(N.a)({},Y),{},{visible:me});Object(S.useEffect)(function(){ve(we),we&&ge&&ke(G())},[we,ge]);var je=Le?S.createElement(ui,Object(m.a)({},Fe,{mobile:ge,ref:Se})):S.createElement(li,Object(m.a)({},Fe,{ref:Se}));return S.createElement("div",null,S.createElement(Kn,Fe),je)});$n.displayName="Popup";var ci=$n,hi=S.createContext(null),Qn=hi;function tt(){}function et(){return""}function mt(ce){return ce?ce.ownerDocument:window.document}var Ot=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function qt(ce){var Se=function(we){Object(f.a)(Y,we);var ge=Object(l.a)(Y);function Y(le){var J;Object(b.a)(this,Y),J=ge.call(this,le),J.popupRef=S.createRef(),J.triggerRef=S.createRef(),J.attachId=void 0,J.clickOutsideHandler=void 0,J.touchOutsideHandler=void 0,J.contextMenuOutsideHandler1=void 0,J.contextMenuOutsideHandler2=void 0,J.mouseDownTimeout=void 0,J.focusTime=void 0,J.preClickTime=void 0,J.preTouchTime=void 0,J.delayTimer=void 0,J.hasPopupMouseDown=void 0,J.onMouseEnter=function(ve){var Ce=J.props.mouseEnterDelay;J.fireEvents("onMouseEnter",ve),J.delaySetPopupVisible(!0,Ce,Ce?null:ve)},J.onMouseMove=function(ve){J.fireEvents("onMouseMove",ve),J.setPoint(ve)},J.onMouseLeave=function(ve){J.fireEvents("onMouseLeave",ve),J.delaySetPopupVisible(!1,J.props.mouseLeaveDelay)},J.onPopupMouseEnter=function(){J.clearDelayTimer()},J.onPopupMouseLeave=function(ve){var Ce;if(ve.relatedTarget&&!ve.relatedTarget.setTimeout&&Object(He.a)((Ce=J.popupRef.current)===null||Ce===void 0?void 0:Ce.getElement(),ve.relatedTarget))return;J.delaySetPopupVisible(!1,J.props.mouseLeaveDelay)},J.onFocus=function(ve){J.fireEvents("onFocus",ve),J.clearDelayTimer(),J.isFocusToShow()&&(J.focusTime=Date.now(),J.delaySetPopupVisible(!0,J.props.focusDelay))},J.onMouseDown=function(ve){J.fireEvents("onMouseDown",ve),J.preClickTime=Date.now()},J.onTouchStart=function(ve){J.fireEvents("onTouchStart",ve),J.preTouchTime=Date.now()},J.onBlur=function(ve){J.fireEvents("onBlur",ve),J.clearDelayTimer(),J.isBlurToHide()&&J.delaySetPopupVisible(!1,J.props.blurDelay)},J.onContextMenu=function(ve){ve.preventDefault(),J.fireEvents("onContextMenu",ve),J.setPopupVisible(!0,ve)},J.onContextMenuClose=function(){J.isContextMenuToShow()&&J.close()},J.onClick=function(ve){if(J.fireEvents("onClick",ve),J.focusTime){var Ce;if(J.preClickTime&&J.preTouchTime?Ce=Math.min(J.preClickTime,J.preTouchTime):J.preClickTime?Ce=J.preClickTime:J.preTouchTime&&(Ce=J.preTouchTime),Math.abs(Ce-J.focusTime)<20)return;J.focusTime=0}J.preClickTime=0,J.preTouchTime=0,J.isClickToShow()&&(J.isClickToHide()||J.isBlurToHide())&&ve&&ve.preventDefault&&ve.preventDefault();var Ae=!J.state.popupVisible;(J.isClickToHide()&&!Ae||Ae&&J.isClickToShow())&&J.setPopupVisible(!J.state.popupVisible,ve)},J.onPopupMouseDown=function(){if(J.hasPopupMouseDown=!0,clearTimeout(J.mouseDownTimeout),J.mouseDownTimeout=window.setTimeout(function(){J.hasPopupMouseDown=!1},0),J.context){var ve;(ve=J.context).onPopupMouseDown.apply(ve,arguments)}},J.onDocumentClick=function(ve){if(J.props.mask&&!J.props.maskClosable)return;var Ce=ve.target,Ae=J.getRootDomNode(),Le=J.getPopupDomNode();(!Object(He.a)(Ae,Ce)||J.isContextMenuOnly())&&!Object(He.a)(Le,Ce)&&!J.hasPopupMouseDown&&J.close()},J.getRootDomNode=function(){var ve=J.props.getTriggerDOMNode;if(ve)return ve(J.triggerRef.current);try{var Ce=Object(We.a)(J.triggerRef.current);if(Ce)return Ce}catch(Ae){}return Re.a.findDOMNode(Object(o.a)(J))},J.getPopupClassNameFromAlign=function(ve){var Ce=[],Ae=J.props,Le=Ae.popupPlacement,ke=Ae.builtinPlacements,Fe=Ae.prefixCls,je=Ae.alignPoint,ze=Ae.getPopupClassNameFromAlign;return Le&&ke&&Ce.push(V(ke,Fe,ve,je)),ze&&Ce.push(ze(ve)),Ce.join(" ")},J.getComponent=function(){var ve=J.props,Ce=ve.prefixCls,Ae=ve.destroyPopupOnHide,Le=ve.popupClassName,ke=ve.onPopupAlign,Fe=ve.popupMotion,je=ve.popupAnimation,ze=ve.popupTransitionName,st=ve.popupStyle,gt=ve.mask,lt=ve.maskAnimation,_t=ve.maskTransitionName,vt=ve.maskMotion,ct=ve.zIndex,ht=ve.popup,At=ve.stretch,Et=ve.alignPoint,zt=ve.mobile,Pt=ve.forceRender,rt=J.state,nt=rt.popupVisible,Tt=rt.point,St=J.getPopupAlign(),Qe={};return J.isMouseEnterToShow()&&(Qe.onMouseEnter=J.onPopupMouseEnter),J.isMouseLeaveToHide()&&(Qe.onMouseLeave=J.onPopupMouseLeave),Qe.onMouseDown=J.onPopupMouseDown,Qe.onTouchStart=J.onPopupMouseDown,S.createElement(ci,Object(m.a)({prefixCls:Ce,destroyPopupOnHide:Ae,visible:nt,point:Et&&Tt,className:Le,align:St,onAlign:ke,animation:je,getClassNameFromAlign:J.getPopupClassNameFromAlign},Qe,{stretch:At,getRootDomNode:J.getRootDomNode,style:st,mask:gt,zIndex:ct,transitionName:ze,maskAnimation:lt,maskTransitionName:_t,maskMotion:vt,ref:J.popupRef,motion:Fe,mobile:zt,forceRender:Pt}),typeof ht=="function"?ht():ht)},J.attachParent=function(ve){Me.a.cancel(J.attachId);var Ce=J.props,Ae=Ce.getPopupContainer,Le=Ce.getDocument,ke=J.getRootDomNode(),Fe;Ae?(ke||Ae.length===0)&&(Fe=Ae(ke)):Fe=Le(J.getRootDomNode()).body,Fe?Fe.appendChild(ve):J.attachId=Object(Me.a)(function(){J.attachParent(ve)})},J.getContainer=function(){var ve=J.props.getDocument,Ce=ve(J.getRootDomNode()).createElement("div");return Ce.style.position="absolute",Ce.style.top="0",Ce.style.left="0",Ce.style.width="100%",J.attachParent(Ce),Ce},J.setPoint=function(ve){var Ce=J.props.alignPoint;if(!Ce||!ve)return;J.setState({point:{pageX:ve.pageX,pageY:ve.pageY}})},J.handlePortalUpdate=function(){J.state.prevPopupVisible!==J.state.popupVisible&&J.props.afterPopupVisibleChange(J.state.popupVisible)},J.triggerContextValue={onPopupMouseDown:J.onPopupMouseDown};var me;return"popupVisible"in le?me=!!le.popupVisible:me=!!le.defaultPopupVisible,J.state={prevPopupVisible:me,popupVisible:me},Ot.forEach(function(ve){J["fire".concat(ve)]=function(Ce){J.fireEvents(ve,Ce)}}),J}return Object(_.a)(Y,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var J=this.props,me=this.state;if(me.popupVisible){var ve;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ve=J.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Be.a)(ve,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ve=ve||J.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Be.a)(ve,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ve=ve||J.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Be.a)(ve,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Be.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),Me.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var J;return((J=this.popupRef.current)===null||J===void 0?void 0:J.getElement())||null}},{key:"getPopupAlign",value:function(){var J=this.props,me=J.popupPlacement,ve=J.popupAlign,Ce=J.builtinPlacements;return me&&Ce?ne(Ce,me,ve):ve}},{key:"setPopupVisible",value:function(J,me){var ve=this.props.alignPoint,Ce=this.state.popupVisible;this.clearDelayTimer(),Ce!==J&&("popupVisible"in this.props||this.setState({popupVisible:J,prevPopupVisible:Ce}),this.props.onPopupVisibleChange(J)),ve&&me&&J&&this.setPoint(me)}},{key:"delaySetPopupVisible",value:function(J,me,ve){var Ce=this,Ae=me*1e3;if(this.clearDelayTimer(),Ae){var Le=ve?{pageX:ve.pageX,pageY:ve.pageY}:null;this.delayTimer=window.setTimeout(function(){Ce.setPopupVisible(J,Le),Ce.clearDelayTimer()},Ae)}else this.setPopupVisible(J,ve)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(J){var me=this.props.children.props,ve=this.props;return me[J]&&ve[J]?this["fire".concat(J)]:me[J]||ve[J]}},{key:"isClickToShow",value:function(){var J=this.props,me=J.action,ve=J.showAction;return me.indexOf("click")!==-1||ve.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var J=this.props.action;return J==="contextMenu"||J.length===1&&J[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var J=this.props,me=J.action,ve=J.showAction;return me.indexOf("contextMenu")!==-1||ve.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var J=this.props,me=J.action,ve=J.hideAction;return me.indexOf("click")!==-1||ve.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var J=this.props,me=J.action,ve=J.showAction;return me.indexOf("hover")!==-1||ve.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var J=this.props,me=J.action,ve=J.hideAction;return me.indexOf("hover")!==-1||ve.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var J=this.props,me=J.action,ve=J.showAction;return me.indexOf("focus")!==-1||ve.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var J=this.props,me=J.action,ve=J.hideAction;return me.indexOf("focus")!==-1||ve.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var J;(J=this.popupRef.current)===null||J===void 0||J.forceAlign()}}},{key:"fireEvents",value:function(J,me){var ve=this.props.children.props[J];ve&&ve(me);var Ce=this.props[J];Ce&&Ce(me)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var J=this.state.popupVisible,me=this.props,ve=me.children,Ce=me.forceRender,Ae=me.alignPoint,Le=me.className,ke=me.autoDestroy,Fe=S.Children.only(ve),je={key:"trigger"};this.isContextMenuToShow()?je.onContextMenu=this.onContextMenu:je.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(je.onClick=this.onClick,je.onMouseDown=this.onMouseDown,je.onTouchStart=this.onTouchStart):(je.onClick=this.createTwoChains("onClick"),je.onMouseDown=this.createTwoChains("onMouseDown"),je.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(je.onMouseEnter=this.onMouseEnter,Ae&&(je.onMouseMove=this.onMouseMove)):je.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?je.onMouseLeave=this.onMouseLeave:je.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(je.onFocus=this.onFocus,je.onBlur=this.onBlur):(je.onFocus=this.createTwoChains("onFocus"),je.onBlur=this.createTwoChains("onBlur"));var ze=F()(Fe&&Fe.props&&Fe.props.className,Le);ze&&(je.className=ze);var st=Object(N.a)({},je);Object(Ke.c)(Fe)&&(st.ref=Object(Ke.a)(this.triggerRef,Fe.ref));var gt=S.cloneElement(Fe,st),lt;return(J||this.popupRef.current||Ce)&&(lt=S.createElement(ce,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!J&&ke&&(lt=null),S.createElement(Qn.Provider,{value:this.triggerContextValue},gt,lt)}}],[{key:"getDerivedStateFromProps",value:function(J,me){var ve=J.popupVisible,Ce={};return ve!==void 0&&me.popupVisible!==ve&&(Ce.popupVisible=ve,Ce.prevPopupVisible=me.popupVisible),Ce}}]),Y}(S.Component);return Se.contextType=Qn,Se.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:et,getDocument:mt,onPopupVisibleChange:tt,afterPopupVisibleChange:tt,onPopupAlign:tt,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Se}var Xt=qt(Ve.a),_n={adjustX:1,adjustY:1},wi={topLeft:{points:["bl","tl"],overflow:_n,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_n,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:_n,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:_n,offset:[4,0]}},mr={topLeft:{points:["bl","tl"],overflow:_n,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:_n,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:_n,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:_n,offset:[4,0]}},ha=wi,Ci=0,gr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Pn=function(Se,we,ge){var Y=ie(we),le=Se.getState();Se.setState({defaultActiveFirst:Object(N.a)(Object(N.a)({},le.defaultActiveFirst),{},Object(ue.a)({},Y,ge))})},Oi=function(ce){Object(f.a)(we,ce);var Se=Object(l.a)(we);function we(ge){var Y;Object(b.a)(this,we),Y=Se.call(this,ge),Y.onDestroy=function(Ae){Y.props.onDestroy(Ae)},Y.onKeyDown=function(Ae){var Le=Ae.keyCode,ke=Y.menuInstance,Fe=Y.props.store,je=Y.getVisible();if(Le===d.a.ENTER)return Y.onTitleClick(Ae),Pn(Fe,Y.props.eventKey,!0),!0;if(Le===d.a.RIGHT)return je?ke.onKeyDown(Ae):(Y.triggerOpenChange(!0),Pn(Fe,Y.props.eventKey,!0)),!0;if(Le===d.a.LEFT){var ze;if(je)ze=ke.onKeyDown(Ae);else return;return ze||(Y.triggerOpenChange(!1),ze=!0),ze}return je&&(Le===d.a.UP||Le===d.a.DOWN)?ke.onKeyDown(Ae):void 0},Y.onOpenChange=function(Ae){Y.props.onOpenChange(Ae)},Y.onPopupVisibleChange=function(Ae){Y.triggerOpenChange(Ae,Ae?"mouseenter":"mouseleave")},Y.onMouseEnter=function(Ae){var Le=Y.props,ke=Le.eventKey,Fe=Le.onMouseEnter,je=Le.store;Pn(je,Y.props.eventKey,!1),Fe({key:ke,domEvent:Ae})},Y.onMouseLeave=function(Ae){var Le=Y.props,ke=Le.parentMenu,Fe=Le.eventKey,je=Le.onMouseLeave;ke.subMenuInstance=Object(o.a)(Y),je({key:Fe,domEvent:Ae})},Y.onTitleMouseEnter=function(Ae){var Le=Y.props,ke=Le.eventKey,Fe=Le.onItemHover,je=Le.onTitleMouseEnter;Fe({key:ke,hover:!0}),je({key:ke,domEvent:Ae})},Y.onTitleMouseLeave=function(Ae){var Le=Y.props,ke=Le.parentMenu,Fe=Le.eventKey,je=Le.onItemHover,ze=Le.onTitleMouseLeave;ke.subMenuInstance=Object(o.a)(Y),je({key:Fe,hover:!1}),ze({key:Fe,domEvent:Ae})},Y.onTitleClick=function(Ae){var Le=Object(o.a)(Y),ke=Le.props;if(ke.onTitleClick({key:ke.eventKey,domEvent:Ae}),ke.triggerSubMenuAction==="hover")return;Y.triggerOpenChange(!Y.getVisible(),"click"),Pn(ke.store,Y.props.eventKey,!1)},Y.onSubMenuClick=function(Ae){typeof Y.props.onClick=="function"&&Y.props.onClick(Y.addKeyPath(Ae))},Y.onSelect=function(Ae){Y.props.onSelect(Ae)},Y.onDeselect=function(Ae){Y.props.onDeselect(Ae)},Y.getPrefixCls=function(){return"".concat(Y.props.rootPrefixCls,"-submenu")},Y.getActiveClassName=function(){return"".concat(Y.getPrefixCls(),"-active")},Y.getDisabledClassName=function(){return"".concat(Y.getPrefixCls(),"-disabled")},Y.getSelectedClassName=function(){return"".concat(Y.getPrefixCls(),"-selected")},Y.getOpenClassName=function(){return"".concat(Y.props.rootPrefixCls,"-submenu-open")},Y.getVisible=function(){return Y.state.isOpen},Y.getMode=function(){return Y.state.mode},Y.saveMenuInstance=function(Ae){Y.menuInstance=Ae},Y.addKeyPath=function(Ae){return Object(N.a)(Object(N.a)({},Ae),{},{keyPath:(Ae.keyPath||[]).concat(Y.props.eventKey)})},Y.triggerOpenChange=function(Ae,Le){var ke=Y.props.eventKey,Fe=function(){Y.onOpenChange({key:ke,item:Object(o.a)(Y),trigger:Le,open:Ae})};Le==="mouseenter"?Y.mouseenterTimeout=setTimeout(function(){Fe()},0):Fe()},Y.isChildrenSelected=function(){var Ae={find:!1};return Oe(Y.props.children,Y.props.selectedKeys,Ae),Ae.find},Y.isInlineMode=function(){return Y.getMode()==="inline"},Y.adjustWidth=function(){if(!Y.subMenuTitle||!Y.menuInstance)return;var Ae=Ne.findDOMNode(Y.menuInstance);if(Ae.offsetWidth>=Y.subMenuTitle.offsetWidth)return;Ae.style.minWidth="".concat(Y.subMenuTitle.offsetWidth,"px")},Y.saveSubMenuTitle=function(Ae){Y.subMenuTitle=Ae},Y.getBaseProps=function(){var Ae=Object(o.a)(Y),Le=Ae.props,ke=Y.getMode();return{mode:ke==="horizontal"?"vertical":ke,visible:Y.getVisible(),level:Le.level+1,inlineIndent:Le.inlineIndent,focusable:!1,onClick:Y.onSubMenuClick,onSelect:Y.onSelect,onDeselect:Y.onDeselect,onDestroy:Y.onDestroy,selectedKeys:Le.selectedKeys,eventKey:"".concat(Le.eventKey,"-menu-"),openKeys:Le.openKeys,motion:Le.motion,onOpenChange:Y.onOpenChange,subMenuOpenDelay:Le.subMenuOpenDelay,parentMenu:Object(o.a)(Y),subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,triggerSubMenuAction:Le.triggerSubMenuAction,builtinPlacements:Le.builtinPlacements,defaultActiveFirst:Le.store.getState().defaultActiveFirst[ie(Le.eventKey)],multiple:Le.multiple,prefixCls:Le.rootPrefixCls,id:Y.internalMenuId,manualRef:Y.saveMenuInstance,itemIcon:Le.itemIcon,expandIcon:Le.expandIcon,direction:Le.direction}},Y.getMotion=function(Ae,Le){var ke=Object(o.a)(Y),Fe=ke.haveRendered,je=Y.props,ze=je.motion,st=je.rootPrefixCls,gt=Object(N.a)(Object(N.a)({},ze),{},{leavedClassName:"".concat(st,"-hidden"),removeOnLeave:!1,motionAppear:Fe||!Le||Ae!=="inline"});return gt};var le=ge.store,J=ge.eventKey,me=le.getState(),ve=me.defaultActiveFirst;Y.isRootMenu=!1;var Ce=!1;return ve&&(Ce=ve[J]),Pn(le,J,Ce),Y.state={mode:ge.mode,isOpen:ge.isOpen},Y}return Object(_.a)(we,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var Y=this,le=this.props,J=le.mode,me=le.parentMenu,ve=le.manualRef,Ce=le.isOpen,Ae=function(){Y.setState({mode:J,isOpen:Ce})},Le=Ce!==this.state.isOpen,ke=J!==this.state.mode;if((ke||Le)&&(Me.a.cancel(this.updateStateRaf),ke?this.updateStateRaf=Object(Me.a)(Ae):Ae()),ve&&ve(this),J!=="horizontal"||!(me==null?void 0:me.isRootMenu)||!Ce)return;this.minWidthTimeout=setTimeout(function(){return Y.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var Y=this.props,le=Y.onDestroy,J=Y.eventKey;le&&le(J),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),Me.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(Y,le){var J=this.getBaseProps();return S.createElement(Pi,Object(m.a)({},J,{id:this.internalMenuId,className:Y,style:le}),this.props.children)}},{key:"renderChildren",value:function(){var Y=this,le=this.getBaseProps(),J=le.mode,me=le.visible,ve=le.forceSubMenuRender,Ce=le.direction,Ae=this.getMotion(J,me);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||me||ve,!this.haveOpened)return S.createElement("div",null);var Le=F()("".concat(le.prefixCls,"-sub"),Object(ue.a)({},"".concat(le.prefixCls,"-rtl"),Ce==="rtl"));return this.isInlineMode()?S.createElement(On,Object(m.a)({visible:le.visible,forceRender:ve},Ae),function(ke){var Fe=ke.className,je=ke.style,ze=F()(Le,Fe);return Y.renderPopupMenu(ze,je)}):this.renderPopupMenu(Le)}},{key:"render",value:function(){var Y,le,J,me=Object(N.a)({},this.props),ve=this.getVisible(),Ce=this.getPrefixCls(),Ae=this.isInlineMode(),Le=this.getMode(),ke=F()(Ce,"".concat(Ce,"-").concat(Le),(Y={},Object(ue.a)(Y,me.className,!!me.className),Object(ue.a)(Y,this.getOpenClassName(),ve),Object(ue.a)(Y,this.getActiveClassName(),me.active||ve&&!Ae),Object(ue.a)(Y,this.getDisabledClassName(),me.disabled),Object(ue.a)(Y,this.getSelectedClassName(),this.isChildrenSelected()),Y));this.internalMenuId||(me.eventKey?this.internalMenuId="".concat(me.eventKey,"$Menu"):(Ci+=1,this.internalMenuId="$__$".concat(Ci,"$Menu")));var Fe={},je={},ze={};me.disabled||(Fe={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},je={onClick:this.onTitleClick},ze={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var st={},gt=me.direction,lt=gt==="rtl";Ae&&(lt?st.paddingRight=me.inlineIndent*me.level:st.paddingLeft=me.inlineIndent*me.level);var _t={};this.getVisible()&&(_t={"aria-owns":this.internalMenuId});var vt=null;Le!=="horizontal"&&(vt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(vt=S.createElement(this.props.expandIcon,Object(N.a)({},this.props))));var ct=S.createElement("div",Object(m.a)({ref:this.saveSubMenuTitle,style:st,className:"".concat(Ce,"-title"),role:"button"},ze,je,{"aria-expanded":ve},_t,{"aria-haspopup":"true",title:typeof me.title=="string"?me.title:void 0}),me.title,vt||S.createElement("i",{className:"".concat(Ce,"-arrow")})),ht=this.renderChildren(),At=((le=me.parentMenu)===null||le===void 0?void 0:le.isRootMenu)?me.parentMenu.props.getPopupContainer:function(Gt){return Gt.parentNode},Et=gr[Le],zt=me.popupOffset?{offset:me.popupOffset}:{},Pt=F()((J={},Object(ue.a)(J,me.popupClassName,me.popupClassName&&!Ae),Object(ue.a)(J,"".concat(Ce,"-rtl"),lt),J)),rt=me.disabled,nt=me.triggerSubMenuAction,Tt=me.subMenuOpenDelay,St=me.forceSubMenuRender,Qe=me.subMenuCloseDelay,wt=me.builtinPlacements;q.forEach(function(Gt){return delete me[Gt]}),delete me.onClick;var Wt=lt?Object(N.a)(Object(N.a)({},mr),wt):Object(N.a)(Object(N.a)({},wi),wt);delete me.direction;var Ct=this.getBaseProps(),kt=Ae?null:this.getMotion(Ct.mode,Ct.visible);return S.createElement("li",Object(m.a)({},me,Fe,{className:ke,role:"menuitem"}),S.createElement(Xt,{prefixCls:Ce,popupClassName:F()("".concat(Ce,"-popup"),Pt),getPopupContainer:At,builtinPlacements:Wt,popupPlacement:Et,popupVisible:Ae?!1:ve,popupAlign:zt,popup:Ae?null:ht,action:rt||Ae?[]:[nt],mouseEnterDelay:Tt,mouseLeaveDelay:Qe,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:St,popupMotion:kt},ct),Ae?ht:null)}}]),we}(S.Component);Oi.defaultProps={onMouseEnter:K,onMouseLeave:K,onTitleMouseEnter:K,onTitleMouseLeave:K,onTitleClick:K,manualRef:K,mode:"vertical",title:""};var Ri=Object(h.b)(function(ce,Se){var we=ce.openKeys,ge=ce.activeKey,Y=ce.selectedKeys,le=Se.eventKey,J=Se.subMenuKey;return{isOpen:we.indexOf(le)>-1,active:ge[J]===le,selectedKeys:Y}})(Oi);Ri.isSubMenu=!0;var vr=Ri,Ii="menuitem-overflowed",yr=.5,Di=function(ce){Object(f.a)(we,ce);var Se=Object(l.a)(we);function we(){var ge;return Object(b.a)(this,we),ge=Se.apply(this,arguments),ge.resizeObserver=null,ge.mutationObserver=null,ge.originalTotalWidth=0,ge.overflowedItems=[],ge.menuItemSizes=[],ge.cancelFrameId=null,ge.state={lastVisibleIndex:void 0},ge.childRef=S.createRef(),ge.getMenuItemNodes=function(){var Y=ge.props.prefixCls,le=ge.childRef.current;return le?[].slice.call(le.children).filter(function(J){return J.className.split(" ").indexOf("".concat(Y,"-overflowed-submenu"))<0}):[]},ge.getOverflowedSubMenuItem=function(Y,le,J){var me=ge.props,ve=me.overflowedIndicator,Ce=me.level,Ae=me.mode,Le=me.prefixCls,ke=me.theme;if(Ce!==1||Ae!=="horizontal")return null;var Fe=ge.props.children[0],je=Fe.props,ze=je.children,st=je.title,gt=je.style,lt=Object(R.a)(je,["children","title","style"]),_t=Object(N.a)({},gt),vt="".concat(Y,"-overflowed-indicator"),ct="".concat(Y,"-overflowed-indicator");le.length===0&&J!==!0?_t=Object(N.a)(Object(N.a)({},_t),{},{display:"none"}):J&&(_t=Object(N.a)(Object(N.a)({},_t),{},{visibility:"hidden",position:"absolute"}),vt="".concat(vt,"-placeholder"),ct="".concat(ct,"-placeholder"));var ht=ke?"".concat(Le,"-").concat(ke):"",At={};return q.forEach(function(Et){lt[Et]!==void 0&&(At[Et]=lt[Et])}),S.createElement(vr,Object(m.a)({title:ve,className:"".concat(Le,"-overflowed-submenu"),popupClassName:ht},At,{key:vt,eventKey:ct,disabled:!1,style:_t}),le)},ge.setChildrenWidthAndResize=function(){if(ge.props.mode!=="horizontal")return;var Y=ge.childRef.current;if(!Y)return;var le=Y.children;if(!le||le.length===0)return;var J=Y.children[le.length-1];Te(J,"display","inline-block");var me=ge.getMenuItemNodes(),ve=me.filter(function(Ce){return Ce.className.split(" ").indexOf(Ii)>=0});ve.forEach(function(Ce){Te(Ce,"display","inline-block")}),ge.menuItemSizes=me.map(function(Ce){return de(Ce,!0)}),ve.forEach(function(Ce){Te(Ce,"display","none")}),ge.overflowedIndicatorWidth=de(Y.children[Y.children.length-1],!0),ge.originalTotalWidth=ge.menuItemSizes.reduce(function(Ce,Ae){return Ce+Ae},0),ge.handleResize(),Te(J,"display","none")},ge.handleResize=function(){if(ge.props.mode!=="horizontal")return;var Y=ge.childRef.current;if(!Y)return;var le=de(Y);ge.overflowedItems=[];var J=0,me;ge.originalTotalWidth>le+yr&&(me=-1,ge.menuItemSizes.forEach(function(ve){J+=ve,J+ge.overflowedIndicatorWidth<=le&&(me+=1)})),ge.setState({lastVisibleIndex:me})},ge}return Object(_.a)(we,[{key:"componentDidMount",value:function(){var Y=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var le=this.childRef.current;if(!le)return;this.resizeObserver=new Pe.default(function(J){J.forEach(function(){var me=Y.cancelFrameId;cancelAnimationFrame(me),Y.cancelFrameId=requestAnimationFrame(Y.setChildrenWidthAndResize)})}),[].slice.call(le.children).concat(le).forEach(function(J){Y.resizeObserver.observe(J)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){Y.resizeObserver.disconnect(),[].slice.call(le.children).concat(le).forEach(function(J){Y.resizeObserver.observe(J)}),Y.setChildrenWidthAndResize()}),this.mutationObserver.observe(le,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(Y){var le=this,J=this.state.lastVisibleIndex;return(Y||[]).reduce(function(me,ve,Ce){var Ae=ve;if(le.props.mode==="horizontal"){var Le=le.getOverflowedSubMenuItem(ve.props.eventKey,[]);J!==void 0&&le.props.className.indexOf("".concat(le.props.prefixCls,"-root"))!==-1&&(Ce>J&&(Ae=S.cloneElement(ve,{style:{display:"none"},eventKey:"".concat(ve.props.eventKey,"-hidden"),className:"".concat(Ii)})),Ce===J+1&&(le.overflowedItems=Y.slice(J+1).map(function(Fe){return S.cloneElement(Fe,{key:Fe.props.eventKey,mode:"vertical-left"})}),Le=le.getOverflowedSubMenuItem(ve.props.eventKey,le.overflowedItems)));var ke=[].concat(Object(w.a)(me),[Le,Ae]);return Ce===Y.length-1&&ke.push(le.getOverflowedSubMenuItem(ve.props.eventKey,[],!0)),ke}return[].concat(Object(w.a)(me),[Ae])},[])}},{key:"render",value:function(){var Y=this.props,le=Y.visible,J=Y.prefixCls,me=Y.overflowedIndicator,ve=Y.mode,Ce=Y.level,Ae=Y.tag,Le=Y.children,ke=Y.theme,Fe=Object(R.a)(Y,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),je=Ae;return S.createElement(je,Object(m.a)({ref:this.childRef},Fe),this.renderChildren(Le))}}]),we}(S.Component);Di.defaultProps={tag:"div",className:""};var _r=Di;function br(ce){return ce.length?ce.every(function(Se){return!!Se.props.disabled}):!0}function Zn(ce,Se,we){var ge=ce.getState();ce.setState({activeKey:Object(N.a)(Object(N.a)({},ge.activeKey),{},Object(ue.a)({},Se,we))})}function Rn(ce){return ce.eventKey||"0-menu-"}function Jn(ce,Se){var we=Se,ge=ce.children,Y=ce.eventKey;if(we){var le;if(Ee(ge,function(J,me){J&&J.props&&!J.props.disabled&&we===M(J,Y,me)&&(le=!0)}),le)return we}return we=null,ce.defaultActiveFirst&&Ee(ge,function(J,me){!we&&J&&!J.props.disabled&&(we=M(J,Y,me))}),we}function Er(ce){if(!ce)return;var Se=this.instanceArray.indexOf(ce);Se!==-1?this.instanceArray[Se]=ce:this.instanceArray.push(ce)}var Li=function(ce){Object(f.a)(we,ce);var Se=Object(l.a)(we);function we(ge){var Y;return Object(b.a)(this,we),Y=Se.call(this,ge),Y.onKeyDown=function(le,J){var me=le.keyCode,ve;if(Y.getFlatInstanceArray().forEach(function(Ae){Ae&&Ae.props.active&&Ae.onKeyDown&&(ve=Ae.onKeyDown(le))}),ve)return 1;var Ce=null;return(me===d.a.UP||me===d.a.DOWN)&&(Ce=Y.step(me===d.a.UP?-1:1)),Ce?(le.preventDefault(),Zn(Y.props.store,Rn(Y.props),Ce.props.eventKey),typeof J=="function"&&J(Ce),1):void 0},Y.onItemHover=function(le){var J=le.key,me=le.hover;Zn(Y.props.store,Rn(Y.props),me?J:null)},Y.onDeselect=function(le){Y.props.onDeselect(le)},Y.onSelect=function(le){Y.props.onSelect(le)},Y.onClick=function(le){Y.props.onClick(le)},Y.onOpenChange=function(le){Y.props.onOpenChange(le)},Y.onDestroy=function(le){Y.props.onDestroy(le)},Y.getFlatInstanceArray=function(){return Y.instanceArray},Y.step=function(le){var J=Y.getFlatInstanceArray(),me=Y.props.store.getState().activeKey[Rn(Y.props)],ve=J.length;if(!ve)return null;le<0&&(J=J.concat().reverse());var Ce=-1;if(J.every(function(Fe,je){return Fe&&Fe.props.eventKey===me?(Ce=je,!1):!0}),!Y.props.defaultActiveFirst&&Ce!==-1&&br(J.slice(Ce,ve-1)))return;var Ae=(Ce+1)%ve,Le=Ae;do{var ke=J[Le];if(!ke||ke.props.disabled)Le=(Le+1)%ve;else return ke}while(Le!==Ae);return null},Y.renderCommonMenuItem=function(le,J,me){var ve=Y.props.store.getState(),Ce=Object(o.a)(Y),Ae=Ce.props,Le=M(le,Ae.eventKey,J),ke=le.props;if(!ke||typeof le.type=="string")return le;var Fe=Le===ve.activeKey,je=Object(N.a)(Object(N.a)({mode:ke.mode||Ae.mode,level:Ae.level,inlineIndent:Ae.inlineIndent,renderMenuItem:Y.renderMenuItem,rootPrefixCls:Ae.prefixCls,index:J,parentMenu:Ae.parentMenu,manualRef:ke.disabled?void 0:Object(y.a)(le.ref,Er.bind(Object(o.a)(Y))),eventKey:Le,active:!ke.disabled&&Fe,multiple:Ae.multiple,onClick:function(st){(ke.onClick||K)(st),Y.onClick(st)},onItemHover:Y.onItemHover,motion:Ae.motion,subMenuOpenDelay:Ae.subMenuOpenDelay,subMenuCloseDelay:Ae.subMenuCloseDelay,forceSubMenuRender:Ae.forceSubMenuRender,onOpenChange:Y.onOpenChange,onDeselect:Y.onDeselect,onSelect:Y.onSelect,builtinPlacements:Ae.builtinPlacements,itemIcon:ke.itemIcon||Y.props.itemIcon,expandIcon:ke.expandIcon||Y.props.expandIcon},me),{},{direction:Ae.direction});return(Ae.mode==="inline"||xe())&&(je.triggerSubMenuAction="click"),S.cloneElement(le,Object(N.a)(Object(N.a)({},je),{},{key:Le||J}))},Y.renderMenuItem=function(le,J,me){if(!le)return null;var ve=Y.props.store.getState(),Ce={openKeys:ve.openKeys,selectedKeys:ve.selectedKeys,triggerSubMenuAction:Y.props.triggerSubMenuAction,subMenuKey:me};return Y.renderCommonMenuItem(le,J,Ce)},ge.store.setState({activeKey:Object(N.a)(Object(N.a)({},ge.store.getState().activeKey),{},Object(ue.a)({},ge.eventKey,Jn(ge,ge.activeKey)))}),Y.instanceArray=[],Y}return Object(_.a)(we,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(Y){return this.props.visible||Y.visible||this.props.className!==Y.className||!L()(this.props.style,Y.style)}},{key:"componentDidUpdate",value:function(Y){var le=this.props,J="activeKey"in le?le.activeKey:le.store.getState().activeKey[Rn(le)],me=Jn(le,J);if(me!==J)Zn(le.store,Rn(le),me);else if("activeKey"in Y){var ve=Jn(Y,Y.activeKey);me!==ve&&Zn(le.store,Rn(le),me)}}},{key:"render",value:function(){var Y=this,le=Object(m.a)({},this.props);this.instanceArray=[];var J=F()(le.prefixCls,le.className,"".concat(le.prefixCls,"-").concat(le.mode)),me={className:J,role:le.role||"menu"};le.id&&(me.id=le.id),le.focusable&&(me.tabIndex=0,me.onKeyDown=this.onKeyDown);var ve=le.prefixCls,Ce=le.eventKey,Ae=le.visible,Le=le.level,ke=le.mode,Fe=le.overflowedIndicator,je=le.theme;return q.forEach(function(ze){return delete le[ze]}),delete le.onClick,S.createElement(_r,Object(m.a)({},le,{prefixCls:ve,mode:ke,tag:"ul",level:Le,theme:je,visible:Ae,overflowedIndicator:Fe},me),Object(j.a)(le.children).map(function(ze,st){return Y.renderMenuItem(ze,st,Ce||"0-menu-")}))}}]),we}(S.Component);Li.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:K};var Tr=Object(h.b)()(Li),Pi=Tr,xr=U("Kwbf");function Sr(ce,Se,we){var ge=ce.prefixCls,Y=ce.motion,le=ce.defaultMotions,J=le===void 0?{}:le,me=ce.openAnimation,ve=ce.openTransitionName,Ce=Se.switchingModeFromInline;if(Y)return Y;if(Object(D.a)(me)==="object"&&me)Object(xr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof me=="string")return{motionName:"".concat(ge,"-open-").concat(me)};if(ve)return{motionName:ve};var Ae=J[we];return Ae||(Ce?null:J.other)}var Mi=function(ce){Object(f.a)(we,ce);var Se=Object(l.a)(we);function we(ge){var Y;Object(b.a)(this,we),Y=Se.call(this,ge),Y.onSelect=function(me){var ve=Object(o.a)(Y),Ce=ve.props;if(Ce.selectable){var Ae=Y.store.getState(),Le=Ae.selectedKeys,ke=me.key;Ce.multiple?Le=Le.concat([ke]):Le=[ke],"selectedKeys"in Ce||Y.store.setState({selectedKeys:Le}),Ce.onSelect(Object(N.a)(Object(N.a)({},me),{},{selectedKeys:Le}))}},Y.onClick=function(me){var ve=Y.getRealMenuMode(),Ce=Object(o.a)(Y),Ae=Ce.store,Le=Ce.props.onOpenChange;ve!=="inline"&&!("openKeys"in Y.props)&&(Ae.setState({openKeys:[]}),Le([])),Y.props.onClick(me)},Y.onKeyDown=function(me,ve){Y.innerMenu.getWrappedInstance().onKeyDown(me,ve)},Y.onOpenChange=function(me){var ve=Object(o.a)(Y),Ce=ve.props,Ae=Y.store.getState().openKeys.concat(),Le=!1,ke=function(je){var ze=!1;if(je.open)ze=Ae.indexOf(je.key)===-1,ze&&Ae.push(je.key);else{var st=Ae.indexOf(je.key);ze=st!==-1,ze&&Ae.splice(st,1)}Le=Le||ze};Array.isArray(me)?me.forEach(ke):ke(me),Le&&("openKeys"in Y.props||Y.store.setState({openKeys:Ae}),Ce.onOpenChange(Ae))},Y.onDeselect=function(me){var ve=Object(o.a)(Y),Ce=ve.props;if(Ce.selectable){var Ae=Y.store.getState().selectedKeys.concat(),Le=me.key,ke=Ae.indexOf(Le);ke!==-1&&Ae.splice(ke,1),"selectedKeys"in Ce||Y.store.setState({selectedKeys:Ae}),Ce.onDeselect(Object(N.a)(Object(N.a)({},me),{},{selectedKeys:Ae}))}},Y.onMouseEnter=function(me){Y.restoreModeVerticalFromInline();var ve=Y.props.onMouseEnter;ve&&ve(me)},Y.onTransitionEnd=function(me){var ve=me.propertyName==="width"&&me.target===me.currentTarget,Ce=me.target.className,Ae=Object.prototype.toString.call(Ce)==="[object SVGAnimatedString]"?Ce.animVal:Ce,Le=me.propertyName==="font-size"&&Ae.indexOf("anticon")>=0;(ve||Le)&&Y.restoreModeVerticalFromInline()},Y.setInnerMenu=function(me){Y.innerMenu=me},Y.isRootMenu=!0;var le=ge.defaultSelectedKeys,J=ge.defaultOpenKeys;return"selectedKeys"in ge&&(le=ge.selectedKeys||[]),"openKeys"in ge&&(J=ge.openKeys||[]),Y.store=Object(h.c)({selectedKeys:le,openKeys:J,activeKey:{"0-menu-":Jn(ge,ge.activeKey)}}),Y.state={switchingModeFromInline:!1,prevProps:ge,inlineOpenKeys:[],store:Y.store},Y}return Object(_.a)(we,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(Y){var le=this.props,J=le.siderCollapsed,me=le.inlineCollapsed,ve=le.onOpenChange;(!Y.inlineCollapsed&&me||!Y.siderCollapsed&&J)&&ve([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var Y=this.props.collapsedWidth,le=this.store,J=this.prevOpenKeys,me=this.getInlineCollapsed()&&(Y===0||Y==="0"||Y==="0px");me?(this.prevOpenKeys=le.getState().openKeys.concat(),this.store.setState({openKeys:[]})):J&&(this.store.setState({openKeys:J}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var Y=this.props.mode,le=this.state.switchingModeFromInline,J=this.getInlineCollapsed();return le&&J?"inline":J?"vertical":Y}},{key:"getInlineCollapsed",value:function(){var Y=this.props,le=Y.inlineCollapsed,J=Y.siderCollapsed;return J!==void 0?J:le}},{key:"restoreModeVerticalFromInline",value:function(){var Y=this.state.switchingModeFromInline;Y&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var Y=Object(N.a)({},Object(E.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),le=this.getRealMenuMode();return Y.className+=" ".concat(Y.prefixCls,"-root"),Y.direction==="rtl"&&(Y.className+=" ".concat(Y.prefixCls,"-rtl")),Y=Object(N.a)(Object(N.a)({},Y),{},{mode:le,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Sr(this.props,this.state,le)}),delete Y.openAnimation,delete Y.openTransitionName,S.createElement(h.a,{store:this.store},S.createElement(Pi,Object(m.a)({},Y,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(Y,le){var J=le.prevProps,me=le.store,ve=me.getState(),Ce={},Ae={prevProps:Y};return J.mode==="inline"&&Y.mode!=="inline"&&(Ae.switchingModeFromInline=!0),"openKeys"in Y?Ce.openKeys=Y.openKeys||[]:((Y.inlineCollapsed&&!J.inlineCollapsed||Y.siderCollapsed&&!J.siderCollapsed)&&(Ae.switchingModeFromInline=!0,Ae.inlineOpenKeys=ve.openKeys,Ce.openKeys=[]),(!Y.inlineCollapsed&&J.inlineCollapsed||!Y.siderCollapsed&&J.siderCollapsed)&&(Ce.openKeys=le.inlineOpenKeys,Ae.inlineOpenKeys=[])),Object.keys(Ce).length&&me.setState(Ce),Ae}}]),we}(S.Component);Mi.defaultProps={selectable:!0,onClick:K,onSelect:K,onOpenChange:K,onDeselect:K,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:S.createElement("span",null,"\xB7\xB7\xB7")};var Ar=Mi,fi=function(ce){Object(f.a)(we,ce);var Se=Object(l.a)(we);function we(){var ge;return Object(b.a)(this,we),ge=Se.apply(this,arguments),ge.onKeyDown=function(Y){var le=Y.keyCode;return le===d.a.ENTER?(ge.onClick(Y),!0):void 0},ge.onMouseLeave=function(Y){var le=ge.props,J=le.eventKey,me=le.onItemHover,ve=le.onMouseLeave;me({key:J,hover:!1}),ve({key:J,domEvent:Y})},ge.onMouseEnter=function(Y){var le=ge.props,J=le.eventKey,me=le.onItemHover,ve=le.onMouseEnter;me({key:J,hover:!0}),ve({key:J,domEvent:Y})},ge.onClick=function(Y){var le=ge.props,J=le.eventKey,me=le.multiple,ve=le.onClick,Ce=le.onSelect,Ae=le.onDeselect,Le=le.isSelected,ke={key:J,keyPath:[J],item:Object(o.a)(ge),domEvent:Y};ve(ke),me?Le?Ae(ke):Ce(ke):Le||Ce(ke)},ge.saveNode=function(Y){ge.node=Y},ge}return Object(_.a)(we,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var Y=this.props;Y.onDestroy&&Y.onDestroy(Y.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var Y,le=Object(N.a)({},this.props),J=F()(this.getPrefixCls(),le.className,(Y={},Object(ue.a)(Y,this.getActiveClassName(),!le.disabled&&le.active),Object(ue.a)(Y,this.getSelectedClassName(),le.isSelected),Object(ue.a)(Y,this.getDisabledClassName(),le.disabled),Y)),me=Object(N.a)(Object(N.a)({},le.attribute),{},{title:typeof le.title=="string"?le.title:void 0,className:J,role:le.role||"menuitem","aria-disabled":le.disabled});le.role==="option"?me=Object(N.a)(Object(N.a)({},me),{},{role:"option","aria-selected":le.isSelected}):(le.role===null||le.role==="none")&&(me.role="none");var ve={onClick:le.disabled?null:this.onClick,onMouseLeave:le.disabled?null:this.onMouseLeave,onMouseEnter:le.disabled?null:this.onMouseEnter},Ce=Object(N.a)({},le.style);le.mode==="inline"&&(le.direction==="rtl"?Ce.paddingRight=le.inlineIndent*le.level:Ce.paddingLeft=le.inlineIndent*le.level),q.forEach(function(Le){return delete le[Le]}),delete le.direction;var Ae=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ae=S.createElement(this.props.itemIcon,this.props)),S.createElement("li",Object(m.a)({},Object(E.a)(le,["onClick","onMouseEnter","onMouseLeave","onSelect"]),me,ve,{style:Ce,ref:this.saveNode}),le.children,Ae)}}]),we}(S.Component);fi.isMenuItem=!0,fi.defaultProps={onSelect:K,onMouseEnter:K,onMouseLeave:K,manualRef:K};var wr=Object(h.b)(function(ce,Se){var we=ce.activeKey,ge=ce.selectedKeys,Y=Se.eventKey,le=Se.subMenuKey;return{active:we[le]===Y,isSelected:Array.isArray(ge)?ge.indexOf(Y)!==-1:ge===Y}})(fi),Cr=wr,pi=function(ce){Object(f.a)(we,ce);var Se=Object(l.a)(we);function we(){var ge;return Object(b.a)(this,we),ge=Se.apply(this,arguments),ge.renderInnerMenuItem=function(Y){var le=ge.props,J=le.renderMenuItem,me=le.index;return J(Y,me,ge.props.subMenuKey)},ge}return Object(_.a)(we,[{key:"render",value:function(){var Y=Object(m.a)({},this.props),le=Y.className,J=le===void 0?"":le,me=Y.rootPrefixCls,ve="".concat(me,"-item-group-title"),Ce="".concat(me,"-item-group-list"),Ae=Y.title,Le=Y.children;return q.forEach(function(ke){return delete Y[ke]}),delete Y.direction,S.createElement("li",Object(m.a)({},Y,{onClick:function(Fe){return Fe.stopPropagation()},className:"".concat(J," ").concat(me,"-item-group")}),S.createElement("div",{className:ve,title:typeof Ae=="string"?Ae:void 0},Ae),S.createElement("ul",{className:Ce},S.Children.map(Le,this.renderInnerMenuItem)))}}]),we}(S.Component);pi.isMenuItemGroup=!0,pi.defaultProps={disabled:!0};var fa=pi,ki=function(Se){var we=Se.className,ge=Se.rootPrefixCls,Y=Se.style;return S.createElement("li",{className:"".concat(we," ").concat(ge,"-item-divider"),style:Y})};ki.defaultProps={disabled:!0,className:"",style:{}};var pa=ki,Or=Ar,Rr=U("eDIo");function Ir(ce,Se){var we=ce.prefixCls,ge=ce.editable,Y=ce.locale,le=ce.style;return!ge||ge.showAdd===!1?null:S.createElement("button",{ref:Se,type:"button",className:"".concat(we,"-nav-add"),style:le,"aria-label":(Y==null?void 0:Y.addAriaLabel)||"Add tab",onClick:function(me){ge.onEdit("add",{event:me})}},ge.addIcon||"+")}var Ni=S.forwardRef(Ir);function Dr(ce,Se){var we=ce.prefixCls,ge=ce.id,Y=ce.tabs,le=ce.locale,J=ce.mobile,me=ce.moreIcon,ve=me===void 0?"More":me,Ce=ce.moreTransitionName,Ae=ce.style,Le=ce.className,ke=ce.editable,Fe=ce.tabBarGutter,je=ce.rtl,ze=ce.onTabClick,st=Object(S.useState)(!1),gt=Object(W.a)(st,2),lt=gt[0],_t=gt[1],vt=Object(S.useState)(null),ct=Object(W.a)(vt,2),ht=ct[0],At=ct[1],Et="".concat(ge,"-more-popup"),zt="".concat(we,"-dropdown"),Pt=ht!==null?"".concat(Et,"-").concat(ht):null,rt=le==null?void 0:le.dropdownAriaLabel,nt=S.createElement(Or,{onClick:function(kt){var Gt=kt.key,an=kt.domEvent;ze(Gt,an),_t(!1)},id:Et,tabIndex:-1,role:"listbox","aria-activedescendant":Pt,selectedKeys:[ht],"aria-label":rt!==void 0?rt:"expanded dropdown"},Y.map(function(Ct){return S.createElement(Cr,{key:Ct.key,id:"".concat(Et,"-").concat(Ct.key),role:"option","aria-controls":ge&&"".concat(ge,"-panel-").concat(Ct.key),disabled:Ct.disabled},Ct.tab)}));function Tt(Ct){for(var kt=Y.filter(function(hn){return!hn.disabled}),Gt=kt.findIndex(function(hn){return hn.key===ht})||0,an=kt.length,cn=0;cn<an;cn+=1){Gt=(Gt+Ct+an)%an;var Yt=kt[Gt];if(!Yt.disabled){At(Yt.key);return}}}function St(Ct){var kt=Ct.which;if(!lt){[d.a.DOWN,d.a.SPACE,d.a.ENTER].includes(kt)&&(_t(!0),Ct.preventDefault());return}switch(kt){case d.a.UP:Tt(-1),Ct.preventDefault();break;case d.a.DOWN:Tt(1),Ct.preventDefault();break;case d.a.ESC:_t(!1);break;case d.a.SPACE:case d.a.ENTER:ht!==null&&ze(ht,Ct);break}}Object(S.useEffect)(function(){var Ct=document.getElementById(Pt);Ct&&Ct.scrollIntoView&&Ct.scrollIntoView(!1)},[ht]),Object(S.useEffect)(function(){lt||At(null)},[lt]);var Qe=Object(ue.a)({},je?"marginLeft":"marginRight",Fe);Y.length||(Qe.visibility="hidden",Qe.order=1);var wt=F()(Object(ue.a)({},"".concat(zt,"-rtl"),je)),Wt=J?null:S.createElement(Rr.a,{prefixCls:zt,overlay:nt,trigger:["hover"],visible:lt,transitionName:Ce,onVisibleChange:_t,overlayClassName:wt,mouseEnterDelay:.1,mouseLeaveDelay:.1},S.createElement("button",{type:"button",className:"".concat(we,"-nav-more"),style:Qe,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Et,id:"".concat(ge,"-more"),"aria-expanded":lt,onKeyDown:St},ve));return S.createElement("div",{className:F()("".concat(we,"-nav-operations"),Le),style:Ae,ref:Se},Wt,S.createElement(Ni,{prefixCls:we,locale:le,editable:ke}))}var Lr=S.forwardRef(Dr),mi=Object(S.createContext)(null),Pr=.1,Ui=.01,qn=20,Bi=Math.pow(.995,qn);function Mr(){var ce=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ce)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ce.substr(0,4)))}function kr(ce,Se){var we=Object(S.useState)(),ge=Object(W.a)(we,2),Y=ge[0],le=ge[1],J=Object(S.useState)(0),me=Object(W.a)(J,2),ve=me[0],Ce=me[1],Ae=Object(S.useState)(0),Le=Object(W.a)(Ae,2),ke=Le[0],Fe=Le[1],je=Object(S.useState)(),ze=Object(W.a)(je,2),st=ze[0],gt=ze[1],lt=Object(S.useRef)();function _t(rt){var nt=rt.touches[0],Tt=nt.screenX,St=nt.screenY;le({x:Tt,y:St}),window.clearInterval(lt.current)}function vt(rt){if(!Y)return;rt.preventDefault();var nt=rt.touches[0],Tt=nt.screenX,St=nt.screenY;le({x:Tt,y:St});var Qe=Tt-Y.x,wt=St-Y.y;Se(Qe,wt);var Wt=Date.now();Ce(Wt),Fe(Wt-ve),gt({x:Qe,y:wt})}function ct(){if(!Y)return;if(le(null),gt(null),st){var rt=st.x/ke,nt=st.y/ke,Tt=Math.abs(rt),St=Math.abs(nt);if(Math.max(Tt,St)<Pr)return;var Qe=rt,wt=nt;lt.current=window.setInterval(function(){if(Math.abs(Qe)<Ui&&Math.abs(wt)<Ui){window.clearInterval(lt.current);return}Qe*=Bi,wt*=Bi,Se(Qe*qn,wt*qn)},qn)}}var ht=Object(S.useRef)(0),At=Object(S.useRef)(!1),Et=Object(S.useRef)();function zt(rt){var nt=rt.deltaX,Tt=rt.deltaY,St=0,Qe=Math.abs(nt),wt=Math.abs(Tt);Qe===wt?St=Et.current==="x"?nt:Tt:Qe>wt?(St=nt,Et.current="x"):(St=Tt,Et.current="y");var Wt=Date.now();Wt-ht.current>100&&(At.current=!1),(Se(-St,-St)||At.current)&&(rt.preventDefault(),At.current=!0),ht.current=Wt}var Pt=Object(S.useRef)(null);Pt.current={onTouchStart:_t,onTouchMove:vt,onTouchEnd:ct,onWheel:zt},S.useEffect(function(){function rt(Qe){Pt.current.onTouchStart(Qe)}function nt(Qe){Pt.current.onTouchMove(Qe)}function Tt(Qe){Pt.current.onTouchEnd(Qe)}function St(Qe){Pt.current.onWheel(Qe)}return document.addEventListener("touchmove",nt,{passive:!1}),document.addEventListener("touchend",Tt,{passive:!1}),ce.current.addEventListener("touchstart",rt,{passive:!1}),ce.current.addEventListener("wheel",St),function(){document.removeEventListener("touchmove",nt),document.removeEventListener("touchend",Tt)}},[])}function Nr(){var ce=Object(S.useRef)(new Map);function Se(ge){return ce.current.has(ge)||ce.current.set(ge,S.createRef()),ce.current.get(ge)}function we(ge){ce.current.delete(ge)}return[Se,we]}function ji(ce,Se){var we=S.useRef(ce),ge=S.useState({}),Y=Object(W.a)(ge,2),le=Y[1];function J(me){var ve=typeof me=="function"?me(we.current):me;ve!==we.current&&Se(ve,we.current),we.current=ve,le({})}return[we.current,J]}var Fi=function(Se){var we=Se.position,ge=Se.prefixCls,Y=Se.extra;if(!Y)return null;var le,J=Y;return we==="right"&&(le=J.right||!J.left&&J||null),we==="left"&&(le=J.left||null),le?S.createElement("div",{className:"".concat(ge,"-extra-content")},le):null};function Ur(ce,Se){var we,ge=S.useContext(mi),Y=ge.prefixCls,le=ge.tabs,J=ce.className,me=ce.style,ve=ce.id,Ce=ce.animated,Ae=ce.activeKey,Le=ce.rtl,ke=ce.extra,Fe=ce.editable,je=ce.locale,ze=ce.tabPosition,st=ce.tabBarGutter,gt=ce.children,lt=ce.onTabClick,_t=ce.onTabScroll,vt=Object(S.useRef)(),ct=Object(S.useRef)(),ht=Object(S.useRef)(),At=Object(S.useRef)(),Et=Nr(),zt=Object(W.a)(Et,2),Pt=zt[0],rt=zt[1],nt=ze==="top"||ze==="bottom",Tt=ji(0,function(Mt,xt){nt&&_t&&_t({direction:Mt>xt?"left":"right"})}),St=Object(W.a)(Tt,2),Qe=St[0],wt=St[1],Wt=ji(0,function(Mt,xt){!nt&&_t&&_t({direction:Mt>xt?"top":"bottom"})}),Ct=Object(W.a)(Wt,2),kt=Ct[0],Gt=Ct[1],an=Object(S.useState)(0),cn=Object(W.a)(an,2),Yt=cn[0],hn=cn[1],vn=Object(S.useState)(0),fn=Object(W.a)(vn,2),pn=fn[0],Zt=fn[1],un=Object(S.useState)(0),sn=Object(W.a)(un,2),tn=sn[0],bn=sn[1],En=Object(S.useState)(0),An=Object(W.a)(En,2),jt=An[0],yn=An[1],wn=Object(S.useState)(null),Ht=Object(W.a)(wn,2),Dt=Ht[0],on=Ht[1],Hr=Object(S.useState)(null),zi=Object(W.a)(Hr,2),In=zi[0],Kr=zi[1],Gr=Object(S.useState)(0),Vi=Object(W.a)(Gr,2),zr=Vi[0],Vr=Vi[1],Xr=Object(S.useState)(0),Xi=Object(W.a)(Xr,2),Yr=Xi[0],$r=Xi[1],Qr=i(new Map),Yi=Object(W.a)(Qr,2),Zr=Yi[0],Jr=Yi[1],ei=t(le,Zr,Yt),$i="".concat(Y,"-nav-operations-hidden"),Mn=0,kn=0;nt?Le?(Mn=0,kn=Math.max(0,Yt-Dt)):(Mn=Math.min(0,Dt-Yt),kn=0):(Mn=Math.min(0,In-pn),kn=0);function gi(Mt){return Mt<Mn?[Mn,!1]:Mt>kn?[kn,!1]:[Mt,!0]}var Qi=Object(S.useRef)(),qr=Object(S.useState)(),Zi=Object(W.a)(qr,2),vi=Zi[0],Ji=Zi[1];function yi(){Ji(Date.now())}function _i(){window.clearTimeout(Qi.current)}kr(vt,function(Mt,xt){var nn=!1;function mn(Un,Bn){Un(function(jn){var Fn=gi(jn+Bn),Dn=Object(W.a)(Fn,2),xi=Dn[0],Si=Dn[1];return nn=Si,xi})}if(nt){if(Dt>=Yt)return nn;mn(wt,Mt)}else{if(In>=pn)return nn;mn(Gt,xt)}return _i(),yi(),nn}),Object(S.useEffect)(function(){return _i(),vi&&(Qi.current=window.setTimeout(function(){Ji(0)},100)),_i},[vi]);function qi(){var Mt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ae,xt=ei.get(Mt);if(!xt)return;if(nt){var nn=Qe;Le?xt.right<Qe?nn=xt.right:xt.right+xt.width>Qe+Dt&&(nn=xt.right+xt.width-Dt):xt.left<-Qe?nn=-xt.left:xt.left+xt.width>-Qe+Dt&&(nn=-(xt.left+xt.width-Dt)),Gt(0),wt(gi(nn)[0])}else{var mn=kt;xt.top<-kt?mn=-xt.top:xt.top+xt.height>-kt+In&&(mn=-(xt.top+xt.height-In)),wt(0),Gt(gi(mn)[0])}}var ea=p(ei,{width:Dt,height:In,left:Qe,top:kt},{width:tn,height:jt},{width:zr,height:Yr},Object(N.a)(Object(N.a)({},ce),{},{tabs:le})),er=Object(W.a)(ea,2),ta=er[0],na=er[1],ia=le.map(function(Mt){var xt=Mt.key;return S.createElement(r,{id:ve,prefixCls:Y,key:xt,rtl:Le,tab:Mt,closable:Mt.closable,editable:Fe,active:xt===Ae,tabPosition:ze,tabBarGutter:st,renderWrapper:gt,removeAriaLabel:je==null?void 0:je.removeAriaLabel,ref:Pt(xt),onClick:function(mn){lt(xt,mn)},onRemove:function(){rt(xt)},onFocus:function(){qi(xt),yi(),Le||(vt.current.scrollLeft=0),vt.current.scrollTop=0}})}),bi=a(function(){var Mt,xt,nn,mn,Un,Bn,jn,Fn,Dn,xi=((Mt=vt.current)===null||Mt===void 0?void 0:Mt.offsetWidth)||0,Si=((xt=vt.current)===null||xt===void 0?void 0:xt.offsetHeight)||0,lr=((nn=At.current)===null||nn===void 0?void 0:nn.offsetWidth)||0,ur=((mn=At.current)===null||mn===void 0?void 0:mn.offsetHeight)||0,ua=((Un=ht.current)===null||Un===void 0?void 0:Un.offsetWidth)||0,da=((Bn=ht.current)===null||Bn===void 0?void 0:Bn.offsetHeight)||0;on(xi),Kr(Si),Vr(lr),$r(ur);var dr=(((jn=ct.current)===null||jn===void 0?void 0:jn.offsetWidth)||0)-lr,cr=(((Fn=ct.current)===null||Fn===void 0?void 0:Fn.offsetHeight)||0)-ur;hn(dr),Zt(cr);var hr=(Dn=ht.current)===null||Dn===void 0?void 0:Dn.className.includes($i);bn(dr-(hr?0:ua)),yn(cr-(hr?0:da)),Jr(function(){var fr=new Map;return le.forEach(function(ca){var pr=ca.key,Wn=Pt(pr).current;Wn&&fr.set(pr,{width:Wn.offsetWidth,height:Wn.offsetHeight,left:Wn.offsetLeft,top:Wn.offsetTop})}),fr})}),ra=le.slice(0,ta),aa=le.slice(na+1),tr=[].concat(Object(w.a)(ra),Object(w.a)(aa)),sa=Object(S.useState)(),nr=Object(W.a)(sa,2),oa=nr[0],la=nr[1],Tn=ei.get(Ae),ir=Object(S.useRef)();function rr(){c.a.cancel(ir.current)}Object(S.useEffect)(function(){var Mt={};return Tn&&(nt?(Le?Mt.right=Tn.right:Mt.left=Tn.left,Mt.width=Tn.width):(Mt.top=Tn.top,Mt.height=Tn.height)),rr(),ir.current=c()(function(){la(Mt)}),rr},[Tn,nt,Le]),Object(S.useEffect)(function(){qi()},[Ae,Tn,ei,nt]),Object(S.useEffect)(function(){bi()},[Le,st,Ae,le.map(function(Mt){return Mt.key}).join("_")]);var ar=!!tr.length,Nn="".concat(Y,"-nav-wrap"),Ei,Ti,sr,or;return nt?Le?(Ti=Qe>0,Ei=Qe+Dt<Yt):(Ei=Qe<0,Ti=-Qe+Dt<Yt):(sr=kt<0,or=-kt+In<pn),S.createElement("div",{ref:Se,role:"tablist",className:F()("".concat(Y,"-nav"),J),style:me,onKeyDown:function(){yi()}},S.createElement(Fi,{position:"left",extra:ke,prefixCls:Y}),S.createElement(u.a,{onResize:bi},S.createElement("div",{className:F()(Nn,(we={},Object(ue.a)(we,"".concat(Nn,"-ping-left"),Ei),Object(ue.a)(we,"".concat(Nn,"-ping-right"),Ti),Object(ue.a)(we,"".concat(Nn,"-ping-top"),sr),Object(ue.a)(we,"".concat(Nn,"-ping-bottom"),or),we)),ref:vt},S.createElement(u.a,{onResize:bi},S.createElement("div",{ref:ct,className:"".concat(Y,"-nav-list"),style:{transform:"translate(".concat(Qe,"px, ").concat(kt,"px)"),transition:vi?"none":void 0}},ia,S.createElement(Ni,{ref:At,prefixCls:Y,locale:je,editable:Fe,style:{visibility:ar?"hidden":null}}),S.createElement("div",{className:F()("".concat(Y,"-ink-bar"),Object(ue.a)({},"".concat(Y,"-ink-bar-animated"),Ce.inkBar)),style:oa}))))),S.createElement(Lr,Object.assign({},ce,{ref:ht,prefixCls:Y,tabs:tr,className:!ar&&$i})),S.createElement(Fi,{position:"right",extra:ke,prefixCls:Y}))}var Wi=S.forwardRef(Ur);function Br(ce){var Se=ce.id,we=ce.activeKey,ge=ce.animated,Y=ce.tabPosition,le=ce.rtl,J=ce.destroyInactiveTabPane,me=S.useContext(mi),ve=me.prefixCls,Ce=me.tabs,Ae=ge.tabPane,Le=Ce.findIndex(function(ke){return ke.key===we});return S.createElement("div",{className:F()("".concat(ve,"-content-holder"))},S.createElement("div",{className:F()("".concat(ve,"-content"),"".concat(ve,"-content-").concat(Y),Object(ue.a)({},"".concat(ve,"-content-animated"),Ae)),style:Le&&Ae?Object(ue.a)({},le?"marginRight":"marginLeft","-".concat(Le,"00%")):null},Ce.map(function(ke){return S.cloneElement(ke.node,{key:ke.key,prefixCls:ve,tabKey:ke.key,id:Se,animated:Ae,active:ke.key===we,destroyInactiveTabPane:J})})))}function Hi(ce){var Se=ce.prefixCls,we=ce.forceRender,ge=ce.className,Y=ce.style,le=ce.id,J=ce.active,me=ce.animated,ve=ce.destroyInactiveTabPane,Ce=ce.tabKey,Ae=ce.children,Le=S.useState(we),ke=Object(W.a)(Le,2),Fe=ke[0],je=ke[1];S.useEffect(function(){J?je(!0):ve&&je(!1)},[J,ve]);var ze={};return J||(me?(ze.visibility="hidden",ze.height=0,ze.overflowY="hidden"):ze.display="none"),S.createElement("div",{id:le&&"".concat(le,"-panel-").concat(Ce),role:"tabpanel",tabIndex:J?0:-1,"aria-labelledby":le&&"".concat(le,"-tab-").concat(Ce),"aria-hidden":!J,style:Object(N.a)(Object(N.a)({},ze),Y),className:F()("".concat(Se,"-tabpane"),J&&"".concat(Se,"-tabpane-active"),ge)},(J||Fe||we)&&Ae)}var Ki=0;function jr(ce){return Object(j.a)(ce).map(function(Se){if(S.isValidElement(Se)){var we=Se.key!==void 0?String(Se.key):void 0;return Object(N.a)(Object(N.a)({key:we},Se.props),{},{node:Se})}return null}).filter(function(Se){return Se})}function Fr(ce,Se){var we,ge=ce.id,Y=ce.prefixCls,le=Y===void 0?"rc-tabs":Y,J=ce.className,me=ce.children,ve=ce.direction,Ce=ce.activeKey,Ae=ce.defaultActiveKey,Le=ce.editable,ke=ce.animated,Fe=ce.tabPosition,je=Fe===void 0?"top":Fe,ze=ce.tabBarGutter,st=ce.tabBarStyle,gt=ce.tabBarExtraContent,lt=ce.locale,_t=ce.moreIcon,vt=ce.moreTransitionName,ct=ce.destroyInactiveTabPane,ht=ce.renderTabBar,At=ce.onChange,Et=ce.onTabClick,zt=ce.onTabScroll,Pt=Object(R.a)(ce,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),rt=jr(me),nt=ve==="rtl",Tt;ke===!1?Tt={inkBar:!1,tabPane:!1}:Tt=Object(N.a)({inkBar:!0,tabPane:!1},ke!==!0?ke:null);var St=Object(S.useState)(!1),Qe=Object(W.a)(St,2),wt=Qe[0],Wt=Qe[1];Object(S.useEffect)(function(){Wt(Mr())},[]);var Ct=Object(e.a)(function(){var jt;return(jt=rt[0])===null||jt===void 0?void 0:jt.key},{value:Ce,defaultValue:Ae}),kt=Object(W.a)(Ct,2),Gt=kt[0],an=kt[1],cn=Object(S.useState)(function(){return rt.findIndex(function(jt){return jt.key===Gt})}),Yt=Object(W.a)(cn,2),hn=Yt[0],vn=Yt[1];Object(S.useEffect)(function(){var jt=rt.findIndex(function(wn){return wn.key===Gt});if(jt===-1){var yn;jt=Math.max(0,Math.min(hn,rt.length-1)),an((yn=rt[jt])===null||yn===void 0?void 0:yn.key)}vn(jt)},[rt.map(function(jt){return jt.key}).join("_"),Gt,hn]);var fn=Object(e.a)(null,{value:ge}),pn=Object(W.a)(fn,2),Zt=pn[0],un=pn[1],sn=je;wt&&!["left","right"].includes(je)&&(sn="top"),Object(S.useEffect)(function(){ge||(un("rc-tabs-".concat(Ki)),Ki+=1)},[]);function tn(jt,yn){Et==null||Et(jt,yn),an(jt),At==null||At(jt)}var bn={id:Zt,activeKey:Gt,animated:Tt,tabPosition:sn,rtl:nt,mobile:wt},En,An=Object(N.a)(Object(N.a)({},bn),{},{editable:Le,locale:lt,moreIcon:_t,moreTransitionName:vt,tabBarGutter:ze,onTabClick:tn,onTabScroll:zt,extra:gt,style:st,panes:me});return ht?En=ht(An,Wi):En=S.createElement(Wi,Object.assign({},An)),S.createElement(mi.Provider,{value:{tabs:rt,prefixCls:le}},S.createElement("div",Object.assign({ref:Se,id:ge,className:F()(le,"".concat(le,"-").concat(sn),(we={},Object(ue.a)(we,"".concat(le,"-mobile"),wt),Object(ue.a)(we,"".concat(le,"-editable"),Le),Object(ue.a)(we,"".concat(le,"-rtl"),nt),we),J)},Pt),En,S.createElement(Br,Object.assign({destroyInactiveTabPane:ct},bn,{animated:Tt}))))}var Gi=S.forwardRef(Fr);Gi.TabPane=Hi;var Wr=Gi,ma=be.b=Wr},nEHx:function(Ge,be,U){"use strict";U.d(be,"a",function(){return ue});var ue;(function(W){W.DARK="dark",W.LIGHT="light",W.HIGH_CONTRAST="hc"})(ue||(ue={}))},nnTU:function(Ge,be,U){"use strict";U.d(be,"b",function(){return F}),U.d(be,"a",function(){return j});var ue=U("MI8n"),W=U("JYp7"),R=U("pmY6"),N=U("24hK"),S=U("746U"),O=U("Cg/j");const F=Object(O.c)("commandService"),j=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ue.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,w){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!w)throw new Error("invalid command");return this.registerCommand({id:e,handler:w})}if(e.description){const i=[];for(let s of e.description.args)i.push(s.constraint);const d=e.handler;e.handler=function(s,...r){return Object(S.o)(r,i),d(s,...r)}}const{id:g}=e;let c=this._commands.get(g);c||(c=new N.a,this._commands.set(g,c));let u=c.unshift(e),a=Object(R.i)(()=>{u();const i=this._commands.get(g);(i==null?void 0:i.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),a}registerCommandAlias(e,w){return j.registerCommand(e,(g,...c)=>g.get(F).executeCommand(w,...c))}getCommand(e){const w=this._commands.get(e);return!w||w.isEmpty()?void 0:W.a.first(w)}getCommands(){const e=new Map;for(const w of this._commands.keys()){const g=this.getCommand(w);g&&e.set(w,g)}return e}};j.registerCommand("noop",()=>{})},p5ED:function(Ge,be,U){"use strict";var ue=U("+L6B"),W=U("2/Rp"),R=U("5Dmo"),N=U("3S7+"),S=U("k1fw"),O=U("9og8"),F=U("tJVT"),j=U("WmNS"),e=U.n(j),w=U("q1tI"),g=U.n(w),c=U("vHTk"),u=U.n(c),a=U("yEEn"),i=U("ZW9T"),d=U("1vsH"),s=U("V0Rq"),r=U("m3rI");be.a=function(n){var t,v,p,m,b,_,o,f=n.editOffice,l=f===void 0?"view":f,h=n.data,E=n.theme,y=n.type,T=n.filename,L=n.monacoEditor,D=n.className,x=n.style,P=n.close,H=n.onClose,I=n.hasMask,z=n.disabledDownload,$=Object(w.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),fe=Object(F.a)($,2),ee=fe[0],ye=fe[1],pe=Object(w.useState)(""),ae=Object(F.a)(pe,2),se=ae[0],_e=ae[1],te=Object(w.useState)(),k=Object(F.a)(te,2),A=k[0],C=k[1],B=window.ENV==="build"?"/react/build":"",K=r.a.PROXY_SERVER||location.origin,M,ie=1024*1024,Ee=10*ie,Oe=Object(w.useRef)();(t=h)!==null&&t!==void 0&&t.startsWith("/api")&&y!=="txt"&&(h=(r.a.API_SERVER||location.origin)+h),y==="office"&&(M=Object(d.T)(h).filesize,M>Ee&&(y="other")),T&&L&&(L.filename=T),Object(w.useEffect)(function(){var xe,Pe,Ne=(xe=document.cookie)===null||xe===void 0||((Pe=xe.replace(/\s/g,""))===null||Pe===void 0)?void 0:Pe.split(";");Ne==null||Ne.map(function(Re){var Me=Re.split("=");Me[0]==="_educoder_session"&&_e(Me[1])})},[]),Object(w.useEffect)(function(){y==="office"&&q()},[y,h]);var q=function(){var xe=Object(O.a)(e.a.mark(function Pe(){var Ne,Re,Me;return e.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:return console.log("data:",h),Ne=h,h.startsWith("http")||(Ne=location.origin+Ne),Re=new URL(Ne).pathname.split("/").pop(),We.next=6,Object(s.V)({attachment_id:Re});case 6:Me=We.sent,C(Me);case 8:case"end":return We.stop()}},Pe)}));return function(){return xe.apply(this,arguments)}}(),de=function(){if(h.startsWith("http")||h.startsWith("blob:")){Te();return}Object(d.z)(T||"educoder",h,T)},Te=function(){Object(d.x)(T||"educoder",decodeURIComponent(h))};return g.a.createElement("div",{style:Object(S.a)({},x||{}),className:"".concat(I&&u.a.bgBlack," ").concat(y?u.a.wrp:"hide")},P&&g.a.createElement("div",{className:u.a.close,ref:Oe},!z&&g.a.createElement(N.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Oe.current}},g.a.createElement("span",{onClick:Te},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(N.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Oe.current}},g.a.createElement("span",{className:"",onClick:H},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(u.a[D]," ").concat(D," ").concat(u.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&g.a.createElement(i.b,L)),y==="audio"&&g.a.createElement("audio",{src:"".concat(((v=h)===null||v===void 0?void 0:v.indexOf("http://"))>-1||((p=h)===null||p===void 0?void 0:p.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(h),autoPlay:!0}),y==="video"&&g.a.createElement(g.a.Fragment,null,((m=h)===null||m===void 0?void 0:m.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),y==="office"&&A&&g.a.createElement("iframe",{src:"".concat(B,"/office.html?key=").concat(A.key,"&url=").concat(K+A.url,"&callbackUrl=").concat(K+A.callbackUrl,"&fileType=").concat(A.fileType,"&title=").concat(A.title,"&model=").concat(l,"&officeServer=").concat(r.a.OFFICE_SERVER,"&disabledDownload=").concat(!!z)}),y==="html"&&g.a.createElement("iframe",{src:h+"&disposition=inline"}),y==="pdf"&&g.a.createElement("iframe",{src:"".concat(B,"/js/pdfview/index.html?url=").concat(h,"&disabledDownload=").concat(!!z)}),y==="image"&&g.a.createElement("img",{src:"".concat(((b=h)===null||b===void 0?void 0:b.indexOf("http://"))>-1||((_=h)===null||_===void 0?void 0:_.indexOf("https://"))>-1||(o=h)!==null&&o!==void 0&&o.startsWith("/api")?"":"data:image/png;base64,").concat(h)}),y==="other"&&g.a.createElement("div",null,g.a.createElement(W.a,{type:"primary",size:"large",onClick:de},g.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&g.a.createElement(W.a,{type:"primary",size:"large",onClick:de},g.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Ge,be,U){"use strict";U.d(be,"h",function(){return w}),U.d(be,"g",function(){return c}),U.d(be,"f",function(){return u}),U.d(be,"e",function(){return a}),U.d(be,"i",function(){return i}),U.d(be,"b",function(){return d}),U.d(be,"a",function(){return s}),U.d(be,"d",function(){return r}),U.d(be,"c",function(){return n});var ue=U("C/vA"),W=U("JYp7");const R=!1;let N=null;function S(t){N=t}if(R){const t="__is_disposable_tracked__";S(new class{trackDisposable(v){const p=new Error("Potentially leaked disposable").stack;setTimeout(()=>{v[t]||console.log(p)},3e3)}setParent(v,p){if(v&&v!==s.None)try{v[t]=!0}catch(m){}}markAsDisposed(v){if(v&&v!==s.None)try{v[t]=!0}catch(p){}}markAsSingleton(v){}})}function O(t){return N==null||N.trackDisposable(t),t}function F(t){N==null||N.markAsDisposed(t)}function j(t,v){N==null||N.setParent(t,v)}function e(t,v){if(!N)return;for(const p of t)N.setParent(p,v)}function w(t){return N==null||N.markAsSingleton(t),t}class g extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function c(t){return typeof t.dispose=="function"&&t.dispose.length===0}function u(t){if(W.a.is(t)){let v=[];for(const p of t)if(p)try{p.dispose()}catch(m){v.push(m)}if(v.length===1)throw v[0];if(v.length>1)throw new g(v);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function a(...t){const v=i(()=>u(t));return e(t,v),v}function i(t){const v=O({dispose:Object(ue.a)(()=>{F(v),t()})});return v}class d{constructor(){this._toDispose=new Set,this._isDisposed=!1,O(this)}dispose(){if(this._isDisposed)return;F(this),this._isDisposed=!0,this.clear()}clear(){try{u(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return j(t,this),this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}}d.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new d,O(this),j(this._store,this)}dispose(){F(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}s.None=Object.freeze({dispose(){}});class r{constructor(){this._isDisposed=!1,O(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var v;if(this._isDisposed||t===this._value)return;(v=this._value)===null||v===void 0||v.dispose(),t&&j(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,F(this),(t=this._value)===null||t===void 0||t.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&j(t,null),t}}class n{constructor(t){this.object=t}dispose(){}}},psGv:function(Ge,be,U){var ue,W;(function(){var R;(function(){"use strict";var F=[,,function(g){function c(i){this.__parent=i,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}c.prototype.clone_empty=function(){var i=new c(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},c.prototype.item=function(i){return i<0?this.__items[this.__items.length+i]:this.__items[i]},c.prototype.has_match=function(i){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(i))return!0;return!1},c.prototype.set_indent=function(i,d){this.is_empty()&&(this.__indent_count=i||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},c.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},c.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},c.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var i=this.__parent.current_line;return i.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),i.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),i.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,i.__items[0]===" "&&(i.__items.splice(0,1),i.__character_count-=1),!0}return!1},c.prototype.is_empty=function(){return this.__items.length===0},c.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},c.prototype.push=function(i){this.__items.push(i);var d=i.lastIndexOf(`
`);d!==-1?this.__character_count=i.length-d:this.__character_count+=i.length},c.prototype.pop=function(){var i=null;return this.is_empty()||(i=this.__items.pop(),this.__character_count-=i.length),i},c.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},c.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},c.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},c.prototype.toString=function(){var i="";return this.is_empty()?this.__parent.indent_empty_lines&&(i=this.__parent.get_indent_string(this.__indent_count)):(i=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),i+=this.__items.join("")),i};function u(i,d){this.__cache=[""],this.__indent_size=i.indent_size,this.__indent_string=i.indent_char,i.indent_with_tabs||(this.__indent_string=new Array(i.indent_size+1).join(i.indent_char)),d=d||"",i.indent_level>0&&(d=new Array(i.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}u.prototype.get_indent_size=function(i,d){var s=this.__base_string_length;return d=d||0,i<0&&(s=0),s+=i*this.__indent_size,s+=d,s},u.prototype.get_indent_string=function(i,d){var s=this.__base_string;return d=d||0,i<0&&(i=0,s=""),d+=i*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},u.prototype.__ensure_cache=function(i){for(;i>=this.__cache.length;)this.__add_column()},u.prototype.__add_column=function(){var i=this.__cache.length,d=0,s="";this.__indent_size&&i>=this.__indent_size&&(d=Math.floor(i/this.__indent_size),i-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),i&&(s+=new Array(i+1).join(" ")),this.__cache.push(s)};function a(i,d){this.__indent_cache=new u(i,d),this.raw=!1,this._end_with_newline=i.end_with_newline,this.indent_size=i.indent_size,this.wrap_line_length=i.wrap_line_length,this.indent_empty_lines=i.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new c(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(i,d){return this.__indent_cache.get_indent_string(i,d)},a.prototype.get_indent_size=function(i,d){return this.__indent_cache.get_indent_size(i,d)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(i){return this.is_empty()||!i&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(i){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return i!==`
`&&(s=s.replace(/[\n]/g,i)),s},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(i,d){return i=i||0,d=d||0,this.next_line.set_indent(i,d),this.__lines.length>1?(this.current_line.set_indent(i,d),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(i){for(var d=0;d<i.newlines;d++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(i.whitespace_before),this.current_line.push(i.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(i){this.__add_space_before_token(),this.current_line.push(i),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},a.prototype.remove_indent=function(i){for(var d=this.__lines.length;i<d;)this.__lines[i]._remove_indent(),i++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(i){for(i=i===void 0?!1:i,this.current_line.trim();i&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(i,d){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(i)!==0&&r.item(-1)!==d){this.__lines.splice(s+1,0,new c(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},g.exports.Output=a},function(g){function c(u,a,i,d){this.type=u,this.text=a,this.comments_before=null,this.newlines=i||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=c},,,function(g){function c(i,d){this.raw_options=u(i,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}c.prototype._get_array=function(i,d){var s=this.raw_options[i],r=d||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},c.prototype._get_boolean=function(i,d){var s=this.raw_options[i],r=s===void 0?!!d:!!s;return r},c.prototype._get_characters=function(i,d){var s=this.raw_options[i],r=d||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},c.prototype._get_number=function(i,d){var s=this.raw_options[i];d=parseInt(d,10),isNaN(d)&&(d=0);var r=parseInt(s,10);return isNaN(r)&&(r=d),r},c.prototype._get_selection=function(i,d,s){var r=this._get_selection_list(i,d,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+i+`' can only be one of the following values:
`+d+`
You passed in: '`+this.raw_options[i]+"'");return r[0]},c.prototype._get_selection_list=function(i,d,s){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[d[0]],!this._is_valid_selection(s,d))throw new Error("Invalid Default Value!");var r=this._get_array(i,s);if(!this._is_valid_selection(r,d))throw new Error("Invalid Option Value: The option '"+i+`' can contain only the following values:
`+d+`
You passed in: '`+this.raw_options[i]+"'");return r},c.prototype._is_valid_selection=function(i,d){return i.length&&d.length&&!i.some(function(s){return d.indexOf(s)===-1})};function u(i,d){var s={};i=a(i);var r;for(r in i)r!==d&&(s[r]=i[r]);if(d&&i[d])for(r in i[d])s[r]=i[d][r];return s}function a(i){var d={},s;for(s in i){var r=s.replace(/-/g,"_");d[r]=i[s]}return d}g.exports.Options=c,g.exports.normalizeOpts=a,g.exports.mergeOpts=u},,function(g){var c=RegExp.prototype.hasOwnProperty("sticky");function u(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}u.prototype.restart=function(){this.__position=0},u.prototype.back=function(){this.__position>0&&(this.__position-=1)},u.prototype.hasNext=function(){return this.__position<this.__input_length},u.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},u.prototype.peek=function(a){var i=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(i=this.__input.charAt(a)),i},u.prototype.__match=function(a,i){a.lastIndex=i;var d=a.exec(this.__input);return d&&!(c&&a.sticky)&&(d.index!==i&&(d=null)),d},u.prototype.test=function(a,i){return i=i||0,i+=this.__position,i>=0&&i<this.__input_length?!!this.__match(a,i):!1},u.prototype.testChar=function(a,i){var d=this.peek(i);return a.lastIndex=0,d!==null&&a.test(d)},u.prototype.match=function(a){var i=this.__match(a,this.__position);return i?this.__position+=i[0].length:i=null,i},u.prototype.read=function(a,i,d){var s="",r;return a&&(r=this.match(a),r&&(s+=r[0])),i&&(r||!a)&&(s+=this.readUntil(i,d)),s},u.prototype.readUntil=function(a,i){var d="",s=this.__position;a.lastIndex=this.__position;var r=a.exec(this.__input);return r?(s=r.index,i&&(s+=r[0].length)):s=this.__input_length,d=this.__input.substring(this.__position,s),this.__position=s,d},u.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},u.prototype.get_regexp=function(a,i){var d=null,s="g";return i&&c&&(s="y"),typeof a=="string"&&a!==""?d=new RegExp(a,s):a&&(d=new RegExp(a.source,s)),d},u.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},u.prototype.peekUntilAfter=function(a){var i=this.__position,d=this.readUntilAfter(a);return this.__position=i,d},u.prototype.lookBack=function(a){var i=this.__position-1;return i>=a.length&&this.__input.substring(i-a.length,i).toLowerCase()===a},g.exports.InputScanner=u},function(g,c,u){var a=u(8).InputScanner,i=u(3).Token,d=u(10).TokenStream,s=u(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},n=function(t,v){this._input=new a(t),this._options=v||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};n.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var t,v=new i(r.START,""),p=null,m=[],b=new d;v.type!==r.EOF;){for(t=this._get_next_token(v,p);this._is_comment(t);)b.add(t),t=this._get_next_token(v,p);b.isEmpty()||(t.comments_before=b,b=new d),t.parent=p,this._is_opening(t)?(m.push(p),p=t):p&&this._is_closing(t,p)&&(t.opened=p,p.closed=t,p=m.pop(),t.parent=p),t.previous=v,v.next=t,this.__tokens.add(t),v=t}return this.__tokens},n.prototype._is_first_token=function(){return this.__tokens.isEmpty()},n.prototype._reset=function(){},n.prototype._get_next_token=function(t,v){this._readWhitespace();var p=this._input.read(/.+/g);return p?this._create_token(r.RAW,p):this._create_token(r.EOF,"")},n.prototype._is_comment=function(t){return!1},n.prototype._is_opening=function(t){return!1},n.prototype._is_closing=function(t,v){return!1},n.prototype._create_token=function(t,v){var p=new i(t,v,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return p},n.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=n,g.exports.TOKEN=r},function(g){function c(u){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=u}c.prototype.restart=function(){this.__position=0},c.prototype.isEmpty=function(){return this.__tokens_length===0},c.prototype.hasNext=function(){return this.__position<this.__tokens_length},c.prototype.next=function(){var u=null;return this.hasNext()&&(u=this.__tokens[this.__position],this.__position+=1),u},c.prototype.peek=function(u){var a=null;return u=u||0,u+=this.__position,u>=0&&u<this.__tokens_length&&(a=this.__tokens[u]),a},c.prototype.add=function(u){this.__parent_token&&(u.parent=this.__parent_token),this.__tokens.push(u),this.__tokens_length+=1},g.exports.TokenStream=c},function(g,c,u){var a=u(12).Pattern;function i(d,s){a.call(this,d,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}i.prototype=new a,i.prototype.__set_whitespace_patterns=function(d,s){d+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+d+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},i.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var d=this._input.read(this._match_pattern);if(d===" ")this.whitespace_before_token=" ";else if(d){var s=this.__split(this._newline_regexp,d);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return d},i.prototype.matching=function(d,s){var r=this._create();return r.__set_whitespace_patterns(d,s),r._update(),r},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(d,s){d.lastIndex=0;for(var r=0,n=[],t=d.exec(s);t;)n.push(s.substring(r,t.index)),r=t.index+t[0].length,t=d.exec(s);return r<s.length?n.push(s.substring(r,s.length)):n.push(""),n},g.exports.WhitespacePattern=i},function(g){function c(u,a){this._input=u,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}c.prototype.read=function(){var u=this._input.read(this._starting_pattern);return(!this._starting_pattern||u)&&(u+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),u},c.prototype.read_match=function(){return this._input.match(this._match_pattern)},c.prototype.until_after=function(u){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(u),a._update(),a},c.prototype.until=function(u){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(u),a._update(),a},c.prototype.starting_with=function(u){var a=this._create();return a._starting_pattern=this._input.get_regexp(u,!0),a._update(),a},c.prototype.matching=function(u){var a=this._create();return a._match_pattern=this._input.get_regexp(u,!0),a._update(),a},c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){},g.exports.Pattern=c},function(g){function c(u,a){u=typeof u=="string"?u:u.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(u+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(u+/\sbeautify\signore:end\s/.source+a,"g")}c.prototype.get_directives=function(u){if(!u.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(u);i;)a[i[1]]=i[2],i=this.__directive_pattern.exec(u);return a},c.prototype.readIgnored=function(u){return u.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=c},function(g,c,u){var a=u(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function d(s,r){a.call(this,s,r),this.__template_pattern=null,this._disabled=Object.assign({},i),this._excluded=Object.assign({},i),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var n=new a(s);this.__patterns={handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:n.starting_with(/{{{/).until_after(/}}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),php:n.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new a,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},d.prototype.read_options=function(s){var r=this._create();for(var n in i)r._disabled[n]=s.templating.indexOf(n)===-1;return r._update(),r},d.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},d.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),s+=r,r=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},d.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},d.prototype._read_template=function(){var s="",r=this._input.peek();if(r==="<"){var n=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&n==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&n==="%"&&(s=s||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},g.exports.TemplatablePattern=d},,,,function(g,c,u){var a=u(19).Beautifier,i=u(20).Options;function d(s,r,n,t){var v=new a(s,r,n,t);return v.beautify()}g.exports=d,g.exports.defaultOptions=function(){return new i}},function(g,c,u){var a=u(20).Options,i=u(2).Output,d=u(21).Tokenizer,s=u(21).TOKEN,r=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,t=function(E,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new i(E,y)};t.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},t.prototype.set_space_before_token=function(E,y){this._output.space_before_token=E,this._output.non_breaking_space=y},t.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},t.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},t.prototype.print_preserved_newlines=function(E){var y=0;E.type!==s.TEXT&&E.previous.type!==s.TEXT&&(y=E.newlines?1:0),this.preserve_newlines&&(y=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var T=0;T<y;T++)this.print_newline(T>0);return y!==0},t.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},t.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},t.prototype.print_newline=function(E){this._output.add_new_line(E)},t.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var v=function(E){for(var y=null,T=E.next;T.type!==s.EOF&&E.closed!==T;){if(T.type===s.ATTRIBUTE&&T.text==="type"){T.next&&T.next.type===s.EQUALS&&T.next.next&&T.next.next.type===s.VALUE&&(y=T.next.next.text);break}T=T.next}return y},p=function(E,y){var T=null,L=null;return y.closed?(E==="script"?T="text/javascript":E==="style"&&(T="text/css"),T=v(y)||T,T.search("text/css")>-1?L="css":T.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?L="javascript":T.search(/(text|application|dojo)\/(x-)?(html)/)>-1?L="html":T.search(/test\/null/)>-1&&(L="null"),L):null};function m(E,y){return y.indexOf(E)!==-1}function b(E,y,T){this.parent=E||null,this.tag=y?y.tag_name:"",this.indent_level=T||0,this.parser_token=y||null}function _(E){this._printer=E,this._current_frame=null}_.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_.prototype.record_tag=function(E){var y=new b(this._current_frame,E,this._printer.indent_level);this._current_frame=y},_.prototype._try_pop_frame=function(E){var y=null;return E&&(y=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),y},_.prototype._get_frame=function(E,y){for(var T=this._current_frame;T&&!(E.indexOf(T.tag)!==-1);){if(y&&y.indexOf(T.tag)!==-1){T=null;break}T=T.parent}return T},_.prototype.try_pop=function(E,y){var T=this._get_frame([E],y);return this._try_pop_frame(T)},_.prototype.indent_to_tag=function(E){var y=this._get_frame(E);y&&(this._printer.indent_level=y.indent_level)};function o(E,y,T,L){this._source_text=E||"",y=y||{},this._js_beautify=T,this._css_beautify=L,this._tag_stack=null;var D=new a(y,"html");this._options=D,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}o.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
`,E&&r.test(E)&&(y=E.match(r)[0])),E=E.replace(n,`
`);var T=E.match(/^[\t ]*/)[0],L={text:"",type:""},D=new f,x=new t(this._options,T),P=new d(E,this._options).tokenize();this._tag_stack=new _(x);for(var H=null,I=P.next();I.type!==s.EOF;)I.type===s.TAG_OPEN||I.type===s.COMMENT?(H=this._handle_tag_open(x,I,D,L),D=H):I.type===s.ATTRIBUTE||I.type===s.EQUALS||I.type===s.VALUE||I.type===s.TEXT&&!D.tag_complete?H=this._handle_inside_tag(x,I,D,P):I.type===s.TAG_CLOSE?H=this._handle_tag_close(x,I,D):I.type===s.TEXT?H=this._handle_text(x,I,D):x.add_raw_token(I),L=H,I=P.next();var z=x._output.get_code(y);return z},o.prototype._handle_tag_close=function(E,y,T){var L={text:y.text,type:y.type};return E.alignment_size=0,T.tag_complete=!0,E.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),T.is_unformatted?E.add_raw_token(y):(T.tag_start_char==="<"&&(E.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&T.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(y)),T.indent_content&&!(T.is_unformatted||T.is_content_unformatted)&&(E.indent(),T.indent_content=!1),!T.is_inline_element&&!(T.is_unformatted||T.is_content_unformatted)&&E.set_wrap_point(),L},o.prototype._handle_inside_tag=function(E,y,T,L){var D=T.has_wrapped_attrs,x={text:y.text,type:y.type};if(E.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),T.is_unformatted)E.add_raw_token(y);else if(T.tag_start_char==="{"&&y.type===s.TEXT)E.print_preserved_newlines(y)?(y.newlines=0,E.add_raw_token(y)):E.print_token(y);else{if(y.type===s.ATTRIBUTE?(E.set_space_before_token(!0),T.attr_count+=1):(y.type===s.EQUALS||y.type===s.VALUE&&y.previous.type===s.EQUALS)&&E.set_space_before_token(!1),y.type===s.ATTRIBUTE&&T.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(y),D=D||y.newlines!==0),this._is_wrap_attributes_force)){var P=T.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&T.attr_count===1){var H=!0,I=0,z;do{if(z=L.peek(I),z.type===s.ATTRIBUTE){H=!1;break}I+=1}while(I<4&&z.type!==s.EOF&&z.type!==s.TAG_CLOSE);P=!H}P&&(E.print_newline(!1),D=!0)}E.print_token(y),D=D||E.previous_token_wrapped(),T.has_wrapped_attrs=D}return x},o.prototype._handle_text=function(E,y,T){var L={text:y.text,type:"TK_CONTENT"};return T.custom_beautifier_name?this._print_custom_beatifier_text(E,y,T):T.is_unformatted||T.is_content_unformatted?E.add_raw_token(y):(E.traverse_whitespace(y),E.print_token(y)),L},o.prototype._print_custom_beatifier_text=function(E,y,T){var L=this;if(y.text!==""){var D=y.text,x,P=1,H="",I="";T.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?x=this._js_beautify:T.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?x=this._css_beautify:T.custom_beautifier_name==="html"&&(x=function(pe,ae){var se=new o(pe,ae,L._js_beautify,L._css_beautify);return se.beautify()}),this._options.indent_scripts==="keep"?P=0:this._options.indent_scripts==="separate"&&(P=-E.indent_level);var z=E.get_full_indent(P);if(D=D.replace(/\n[ \t]*$/,""),T.custom_beautifier_name!=="html"&&D[0]==="<"&&D.match(/^(<!--|<!\[CDATA\[)/)){var $=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(D);if(!$){E.add_raw_token(y);return}H=z+$[1]+`
`,D=$[4],$[5]&&(I=z+$[5]),D=D.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(`
`)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(y.whitespace_before=$[0]))}if(D)if(x){var fe=function(){this.eol=`
`};fe.prototype=this._options.raw_options;var ee=new fe;D=x(z+D,ee)}else{var ye=y.whitespace_before;ye&&(D=D.replace(new RegExp(`
(`+ye+")?","g"),`
`)),D=z+D.replace(/\n/g,`
`+z)}H&&(D?D=H+D+`
`+I:D=H+I),E.print_newline(!1),D&&(y.text=D,y.whitespace_before="",y.newlines=0,E.add_raw_token(y),E.print_newline(!0))}},o.prototype._handle_tag_open=function(E,y,T,L){var D=this._get_tag_open_token(y);return(T.is_unformatted||T.is_content_unformatted)&&!T.is_empty_element&&y.type===s.TAG_OPEN&&y.text.indexOf("</")===0?(E.add_raw_token(y),D.start_tag_token=this._tag_stack.try_pop(D.tag_name)):(E.traverse_whitespace(y),this._set_tag_position(E,y,D,T,L),D.is_inline_element||E.set_wrap_point(),E.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(D.alignment_size=y.text.length+1),!D.tag_complete&&!D.is_unformatted&&(E.alignment_size=D.alignment_size),D};var f=function(E,y){if(this.parent=E||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!y)this.tag_complete=!0;else{var T;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(T=y.text.match(/^<([^\s>]*)/),this.tag_check=T?T[1]:""):(T=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=T?T[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||y.closed&&y.closed.text==="/>";var L=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(L=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(L)))}};o.prototype._get_tag_open_token=function(E){var y=new f(this._tag_stack.get_parser_token(),E);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||m(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&m(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&m(y.tag_check,this._options.content_unformatted),y.is_inline_element=m(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},o.prototype._set_tag_position=function(E,y,T,L,D){if(T.is_empty_element||(T.is_end_tag?T.start_tag_token=this._tag_stack.try_pop(T.tag_name):(this._do_optional_end_element(T)&&(T.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(T),(T.tag_name==="script"||T.tag_name==="style")&&!(T.is_unformatted||T.is_content_unformatted)&&(T.custom_beautifier_name=p(T.tag_check,y)))),m(T.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),T.is_empty_element){if(T.tag_start_char==="{"&&T.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),T.indent_content=!0;var x=E.current_line_has_match(/{{#if/);x||E.print_newline(!1)}T.tag_name==="!--"&&D.type===s.TAG_CLOSE&&L.is_end_tag&&T.text.indexOf(`
`)===-1||(T.is_inline_element||T.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,T))}else if(T.is_end_tag){var P=!1;P=T.start_tag_token&&T.start_tag_token.multiline_content,P=P||!T.is_inline_element&&!(L.is_inline_element||L.is_unformatted)&&!(D.type===s.TAG_CLOSE&&T.start_tag_token===L)&&D.type!=="TK_CONTENT",(T.is_content_unformatted||T.is_unformatted)&&(P=!1),P&&E.print_newline(!1)}else T.indent_content=!T.custom_beautifier_name,T.tag_start_char==="<"&&(T.tag_name==="html"?T.indent_content=this._options.indent_inner_html:T.tag_name==="head"?T.indent_content=this._options.indent_head_inner_html:T.tag_name==="body"&&(T.indent_content=this._options.indent_body_inner_html)),!(T.is_inline_element||T.is_unformatted)&&(D.type!=="TK_CONTENT"||T.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,T)},o.prototype._calcluate_parent_multiline=function(E,y){y.parent&&E._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var l=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],h=["a","audio","del","ins","map","noscript","video"];o.prototype._do_optional_end_element=function(E){var y=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(E.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&l.indexOf(E.tag_name)!==-1){var T=E.parent.parent;(!T||h.indexOf(T.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),y},g.exports.Beautifier=o},function(g,c,u){var a=u(6).Options;function i(d){a.call(this,d,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}i.prototype=new a,g.exports.Options=i},function(g,c,u){var a=u(9).Tokenizer,i=u(9).TOKEN,d=u(13).Directives,s=u(14).TemplatablePattern,r=u(12).Pattern,n={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:i.START,RAW:i.RAW,EOF:i.EOF},t=new d(/<\!--/,/-->/),v=function(p,m){a.call(this,p,m),this._current_tag_name="";var b=new s(this._input).read_options(this._options),_=new r(this._input);if(this.__patterns={word:b.until(/[\n\r\t <]/),single_quote:b.until_after(/'/),double_quote:b.until_after(/"/),attribute:b.until(/[\n\r\t =>]|\/>/),element_name:b.until(/[\n\r\t >\/]/),handlebars_comment:_.starting_with(/{{!--/).until_after(/--}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),handlebars_open:_.until(/[\n\r\t }]/),handlebars_raw_close:_.until(/}}/),comment:_.starting_with(/<!--/).until_after(/-->/),cdata:_.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:_.starting_with(/<!\[/).until_after(/]>/),processing:_.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=_.matching(o).until_after(o)}};v.prototype=new a,v.prototype._is_comment=function(p){return!1},v.prototype._is_opening=function(p){return p.type===n.TAG_OPEN},v.prototype._is_closing=function(p,m){return p.type===n.TAG_CLOSE&&m&&((p.text===">"||p.text==="/>")&&m.text[0]==="<"||p.text==="}}"&&m.text[0]==="{"&&m.text[1]==="{")},v.prototype._reset=function(){this._current_tag_name=""},v.prototype._get_next_token=function(p,m){var b=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(n.EOF,""):(b=b||this._read_open_handlebars(_,m),b=b||this._read_attribute(_,p,m),b=b||this._read_close(_,m),b=b||this._read_raw_content(_,p,m),b=b||this._read_content_word(_),b=b||this._read_comment_or_cdata(_),b=b||this._read_processing(_),b=b||this._read_open(_,m),b=b||this._create_token(n.UNKNOWN,this._input.next()),b)},v.prototype._read_comment_or_cdata=function(p){var m=null,b=null,_=null;if(p==="<"){var o=this._input.peek(1);o==="!"&&(b=this.__patterns.comment.read(),b?(_=t.get_directives(b),_&&_.ignore==="start"&&(b+=t.readIgnored(this._input))):b=this.__patterns.cdata.read()),b&&(m=this._create_token(n.COMMENT,b),m.directives=_)}return m},v.prototype._read_processing=function(p){var m=null,b=null,_=null;if(p==="<"){var o=this._input.peek(1);(o==="!"||o==="?")&&(b=this.__patterns.conditional_comment.read(),b=b||this.__patterns.processing.read()),b&&(m=this._create_token(n.COMMENT,b),m.directives=_)}return m},v.prototype._read_open=function(p,m){var b=null,_=null;return m||p==="<"&&(b=this._input.next(),this._input.peek()==="/"&&(b+=this._input.next()),b+=this.__patterns.element_name.read(),_=this._create_token(n.TAG_OPEN,b)),_},v.prototype._read_open_handlebars=function(p,m){var b=null,_=null;return m||this._options.indent_handlebars&&p==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(b=this.__patterns.handlebars_comment.read(),b=b||this.__patterns.handlebars.read(),_=this._create_token(n.COMMENT,b)):(b=this.__patterns.handlebars_open.read(),_=this._create_token(n.TAG_OPEN,b))),_},v.prototype._read_close=function(p,m){var b=null,_=null;return m&&(m.text[0]==="<"&&(p===">"||p==="/"&&this._input.peek(1)===">")?(b=this._input.next(),p==="/"&&(b+=this._input.next()),_=this._create_token(n.TAG_CLOSE,b)):m.text[0]==="{"&&p==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),_=this._create_token(n.TAG_CLOSE,"}}"))),_},v.prototype._read_attribute=function(p,m,b){var _=null,o="";if(b&&b.text[0]==="<")if(p==="=")_=this._create_token(n.EQUALS,this._input.next());else if(p==='"'||p==="'"){var f=this._input.next();p==='"'?f+=this.__patterns.double_quote.read():f+=this.__patterns.single_quote.read(),_=this._create_token(n.VALUE,f)}else o=this.__patterns.attribute.read(),o&&(m.type===n.EQUALS?_=this._create_token(n.VALUE,o):_=this._create_token(n.ATTRIBUTE,o));return _},v.prototype._is_content_unformatted=function(p){return this._options.void_elements.indexOf(p)===-1&&(this._options.content_unformatted.indexOf(p)!==-1||this._options.unformatted.indexOf(p)!==-1)},v.prototype._read_raw_content=function(p,m,b){var _="";if(b&&b.text[0]==="{")_=this.__patterns.handlebars_raw_close.read();else if(m.type===n.TAG_CLOSE&&m.opened.text[0]==="<"&&m.text[0]!=="/"){var o=m.opened.text.substr(1).toLowerCase();if(o==="script"||o==="style"){var f=this._read_comment_or_cdata(p);if(f)return f.type=n.TEXT,f;_=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(_=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(n.TEXT,_):null},v.prototype._read_content_word=function(p){var m="";if(this._options.unformatted_content_delimiter&&(p===this._options.unformatted_content_delimiter[0]&&(m=this.__patterns.unformatted_content_delimiter.read())),m||(m=this.__patterns.word.read()),m)return this._create_token(n.TEXT,m)},g.exports.Tokenizer=v,g.exports.TOKEN=n}],j={};function e(g){var c=j[g];if(c!==void 0)return c.exports;var u=j[g]={exports:{}};return F[g](u,u.exports,e),u.exports}var w=e(18);R=w})();var N=R;if(!0)!(ue=[U,U("6UM0"),U("TXwP")],W=function(F){var j=U("6UM0"),e=U("TXwP");return{html_beautify:function(w,g){return N(w,g,j.js_beautify,e.css_beautify)}}}.apply(be,ue),W!==void 0&&(Ge.exports=W));else var S,O})()},"rAM+":function(Ge,be,U){"use strict";U.d(be,"a",function(){return W});var ue=U("Qw5x");function W(R,N){var S;if(typeof Symbol=="undefined"||R[Symbol.iterator]==null){if(Array.isArray(R)||(S=Object(ue.a)(R))||N&&R&&typeof R.length=="number"){S&&(R=S);var O=0,F=function(){};return{s:F,n:function(){return O>=R.length?{done:!0}:{done:!1,value:R[O++]}},e:function(c){throw c},f:F}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var j=!0,e=!1,w;return{s:function(){S=R[Symbol.iterator]()},n:function(){var c=S.next();return j=c.done,c},e:function(c){e=!0,w=c},f:function(){try{!j&&S.return!=null&&S.return()}finally{if(e)throw w}}}}},rUJ1:function(Ge,be){const U=/[&<>"']/,ue=/[&<>"']/g,W=/[<>"']|&(?!#?\w+;)/,R=/[<>"']|&(?!#?\w+;)/g,N={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},S=_=>N[_];function O(_,o){if(o){if(U.test(_))return _.replace(ue,S)}else if(W.test(_))return _.replace(R,S);return _}const F=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function j(_){return _.replace(F,(o,f)=>(f=f.toLowerCase(),f==="colon"?":":f.charAt(0)==="#"?f.charAt(1)==="x"?String.fromCharCode(parseInt(f.substring(2),16)):String.fromCharCode(+f.substring(1)):""))}const e=/(^|[^\[])\^/g;function w(_,o){_=_.source||_,o=o||"";const f={replace:(l,h)=>(h=h.source||h,h=h.replace(e,"$1"),_=_.replace(l,h),f),getRegex:()=>new RegExp(_,o)};return f}const g=/[^\w:]/g,c=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(_,o,f){if(_){let l;try{l=decodeURIComponent(j(f)).replace(g,"").toLowerCase()}catch(h){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}o&&!c.test(f)&&(f=r(o,f));try{f=encodeURI(f).replace(/%25/g,"%")}catch(l){return null}return f}const a={},i=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(_,o){a[" "+_]||(i.test(_)?a[" "+_]=_+"/":a[" "+_]=p(_,"/",!0)),_=a[" "+_];const f=_.indexOf(":")===-1;return o.substring(0,2)==="//"?f?o:_.replace(d,"$1")+o:o.charAt(0)==="/"?f?o:_.replace(s,"$1")+o:_+o}const n={exec:function(){}};function t(_){let o=1,f,l;for(;o<arguments.length;o++){f=arguments[o];for(l in f)Object.prototype.hasOwnProperty.call(f,l)&&(_[l]=f[l])}return _}function v(_,o){const f=_.replace(/\|/g,(E,y,T)=>{let L=!1,D=y;for(;--D>=0&&T[D]==="\\";)L=!L;return L?"|":" |"}),l=f.split(/ \|/);let h=0;if(l.length>o)l.splice(o);else for(;l.length<o;)l.push("");for(;h<l.length;h++)l[h]=l[h].trim().replace(/\\\|/g,"|");return l}function p(_,o,f){const l=_.length;if(l===0)return"";let h=0;for(;h<l;){const E=_.charAt(l-h-1);if(E===o&&!f)h++;else if(E!==o&&f)h++;else break}return _.substr(0,l-h)}function m(_,o){if(_.indexOf(o[1])===-1)return-1;const f=_.length;let l=0,h=0;for(;h<f;h++)if(_[h]==="\\")h++;else if(_[h]===o[0])l++;else if(_[h]===o[1]&&(l--,l<0))return h;return-1}function b(_){_&&_.sanitize&&!_.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Ge.exports={escape:O,unescape:j,edit:w,cleanUrl:u,resolveUrl:r,noopTest:n,merge:t,splitCells:v,rtrim:p,findClosingBracket:m,checkSanitizeDeprecation:b}},sboe:function(Ge,be,U){"use strict";U.d(be,"a",function(){return R});var ue=U("q1tI"),W=U.n(ue),R=ue.createContext(null)},spXi:function(Ge,be,U){Ge.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},t23M:function(Ge,be,U){"use strict";var ue=U("VTBJ"),W=U("1OyB"),R=U("vuIU"),N=U("Ji7U"),S=U("LK+K"),O=U("q1tI"),F=U.n(O),j=U("m+aA"),e=U("Zm9Q"),w=U("Kwbf"),g=U("c+Xe"),c=U("bdgK"),u="rc-observer-key",a=function(i){Object(N.a)(s,i);var d=Object(S.a)(s);function s(){var r;return Object(W.a)(this,s),r=d.apply(this,arguments),r.resizeObserver=null,r.childNode=null,r.currentElement=null,r.state={width:0,height:0,offsetHeight:0,offsetWidth:0},r.onResize=function(n){var t=r.props.onResize,v=n[0].target,p=v.getBoundingClientRect(),m=p.width,b=p.height,_=v.offsetWidth,o=v.offsetHeight,f=Math.floor(m),l=Math.floor(b);if(r.state.width!==f||r.state.height!==l||r.state.offsetWidth!==_||r.state.offsetHeight!==o){var h={width:f,height:l,offsetWidth:_,offsetHeight:o};r.setState(h),t&&Promise.resolve().then(function(){t(Object(ue.a)(Object(ue.a)({},h),{},{offsetWidth:_,offsetHeight:o}))})}},r.setChildNode=function(n){r.childNode=n},r}return Object(R.a)(s,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var n=this.props.disabled;if(n){this.destroyObserver();return}var t=Object(j.a)(this.childNode||this),v=t!==this.currentElement;v&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new c.default(this.onResize),this.resizeObserver.observe(t))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var n=this.props.children,t=Object(e.a)(n);if(t.length>1)Object(w.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(t.length===0)return Object(w.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var v=t[0];if(O.isValidElement(v)&&Object(g.c)(v)){var p=v.ref;t[0]=O.cloneElement(v,{ref:Object(g.a)(p,this.setChildNode)})}return t.length===1?t[0]:t.map(function(m,b){return!O.isValidElement(m)||"key"in m&&m.key!==null?m:O.cloneElement(m,{key:"".concat(u,"-").concat(b)})})}}]),s}(O.Component);a.displayName="ResizeObserver",be.a=a},t9D7:function(Ge,be,U){"use strict";U.d(be,"b",function(){return F}),U.d(be,"g",function(){return e}),U.d(be,"d",function(){return w}),U.d(be,"e",function(){return g}),U.d(be,"a",function(){return c}),U.d(be,"f",function(){return i}),U.d(be,"c",function(){return d});var ue=U("Vhoy"),W=U("MI8n"),R=U("pmY6"),N=U("Cg/j"),S=U("ic2d"),O=U("nEHx");const F=Object(N.c)("themeService");var j;(function(s){function r(n){return n&&typeof n=="object"&&typeof n.id=="string"}s.isThemeColor=r})(j||(j={}));function e(s){return{id:s}}var w;(function(s){function r(b){return b&&typeof b=="object"&&typeof b.id=="string"&&(typeof b.color=="undefined"||j.isThemeColor(b.color))}s.isThemeIcon=r;const n=new RegExp(`^\\$\\((${ue.a.iconNameExpression}(?:${ue.a.iconModifierExpression})?)\\)$`);function t(b){const _=n.exec(b);if(!_)return;let[,o]=_;return{id:o}}s.fromString=t;function v(b,_){let o=b.id;const f=o.lastIndexOf("~");return f!==-1&&(o=o.substring(0,f)),_&&(o=`${o}~${_}`),{id:o}}s.modify=v;function p(b,_){var o,f;return b.id===_.id&&((o=b.color)===null||o===void 0?void 0:o.id)===((f=_.color)===null||f===void 0?void 0:f.id)}s.isEqual=p;function m(b,_){return{id:b.id,color:_?e(_):void 0}}s.asThemeIcon=m,s.asClassNameArray=ue.a.asClassNameArray,s.asClassName=ue.a.asClassName,s.asCSSSelector=ue.a.asCSSSelector})(w||(w={}));function g(s){switch(s){case O.a.DARK:return"vs-dark";case O.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const c={ThemingContribution:"base.contributions.theming"};class u{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new W.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(R.i)(()=>{const r=this.themingParticipants.indexOf(s);this.themingParticipants.splice(r,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new u;S.a.add(c.ThemingContribution,a);function i(s){return a.onColorThemeChange(s)}class d extends R.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(r=>this.onThemeChange(r)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(Ge,be,U){typeof window!="undefined"&&function(W,R){Ge.exports=R()}(this,function(){return function(ue){var W={};function R(N){if(W[N])return W[N].exports;var S=W[N]={i:N,l:!1,exports:{}};return ue[N].call(S.exports,S,S.exports,R),S.l=!0,S.exports}return R.m=ue,R.c=W,R.d=function(N,S,O){R.o(N,S)||Object.defineProperty(N,S,{enumerable:!0,get:O})},R.r=function(N){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(N,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(N,"__esModule",{value:!0})},R.t=function(N,S){if(S&1&&(N=R(N)),S&8)return N;if(S&4&&typeof N=="object"&&N&&N.__esModule)return N;var O=Object.create(null);if(R.r(O),Object.defineProperty(O,"default",{enumerable:!0,value:N}),S&2&&typeof N!="string")for(var F in N)R.d(O,F,function(j){return N[j]}.bind(null,F));return O},R.n=function(N){var S=N&&N.__esModule?function(){return N.default}:function(){return N};return R.d(S,"a",S),S},R.o=function(N,S){return Object.prototype.hasOwnProperty.call(N,S)},R.p="/dist/",R(R.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ue,W,R){"use strict";var N=Object.prototype.hasOwnProperty,S="~";function O(){}Object.create&&(O.prototype=Object.create(null),new O().__proto__||(S=!1));function F(g,c,u){this.fn=g,this.context=c,this.once=u||!1}function j(g,c,u,a,i){if(typeof u!="function")throw new TypeError("The listener must be a function");var d=new F(u,a||g,i),s=S?S+c:c;return g._events[s]?g._events[s].fn?g._events[s]=[g._events[s],d]:g._events[s].push(d):(g._events[s]=d,g._eventsCount++),g}function e(g,c){--g._eventsCount===0?g._events=new O:delete g._events[c]}function w(){this._events=new O,this._eventsCount=0}w.prototype.eventNames=function(){var c=[],u,a;if(this._eventsCount===0)return c;for(a in u=this._events)N.call(u,a)&&c.push(S?a.slice(1):a);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},w.prototype.listeners=function(c){var u=S?S+c:c,a=this._events[u];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,d=a.length,s=new Array(d);i<d;i++)s[i]=a[i].fn;return s},w.prototype.listenerCount=function(c){var u=S?S+c:c,a=this._events[u];return a?a.fn?1:a.length:0},w.prototype.emit=function(c,u,a,i,d,s){var r=S?S+c:c;if(!this._events[r])return!1;var n=this._events[r],t=arguments.length,v,p;if(n.fn){n.once&&this.removeListener(c,n.fn,void 0,!0);switch(t){case 1:return n.fn.call(n.context),!0;case 2:return n.fn.call(n.context,u),!0;case 3:return n.fn.call(n.context,u,a),!0;case 4:return n.fn.call(n.context,u,a,i),!0;case 5:return n.fn.call(n.context,u,a,i,d),!0;case 6:return n.fn.call(n.context,u,a,i,d,s),!0}for(p=1,v=new Array(t-1);p<t;p++)v[p-1]=arguments[p];n.fn.apply(n.context,v)}else{var m=n.length,b;for(p=0;p<m;p++){n[p].once&&this.removeListener(c,n[p].fn,void 0,!0);switch(t){case 1:n[p].fn.call(n[p].context);break;case 2:n[p].fn.call(n[p].context,u);break;case 3:n[p].fn.call(n[p].context,u,a);break;case 4:n[p].fn.call(n[p].context,u,a,i);break;default:if(!v)for(b=1,v=new Array(t-1);b<t;b++)v[b-1]=arguments[b];n[p].fn.apply(n[p].context,v)}}}return!0},w.prototype.on=function(c,u,a){return j(this,c,u,a,!1)},w.prototype.once=function(c,u,a){return j(this,c,u,a,!0)},w.prototype.removeListener=function(c,u,a,i){var d=S?S+c:c;if(!this._events[d])return this;if(!u)return e(this,d),this;var s=this._events[d];if(s.fn)s.fn===u&&(!i||s.once)&&(!a||s.context===a)&&e(this,d);else{for(var r=0,n=[],t=s.length;r<t;r++)(s[r].fn!==u||i&&!s[r].once||a&&s[r].context!==a)&&n.push(s[r]);n.length?this._events[d]=n.length===1?n[0]:n:e(this,d)}return this},w.prototype.removeAllListeners=function(c){var u;return c?(u=S?S+c:c,this._events[u]&&e(this,u)):(this._events=new O,this._eventsCount=0),this},w.prototype.off=w.prototype.removeListener,w.prototype.addListener=w.prototype.on,w.prefixed=S,w.EventEmitter=w,ue.exports=w},"./node_modules/url-toolkit/src/url-toolkit.js":function(ue,W,R){(function(N){var S=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,O=/^([^\/?#]*)([^]*)$/,F=/(?:\/|^)\.(?=\/)/g,j=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(w,g,c){if(c=c||{},w=w.trim(),g=g.trim(),!g){if(!c.alwaysNormalize)return w;var u=e.parseURL(w);if(!u)throw new Error("Error trying to parse base URL.");return u.path=e.normalizePath(u.path),e.buildURLFromParts(u)}var a=e.parseURL(g);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return c.alwaysNormalize?(a.path=e.normalizePath(a.path),e.buildURLFromParts(a)):g;var i=e.parseURL(w);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&i.path[0]!=="/"){var d=O.exec(i.path);i.netLoc=d[1],i.path=d[2]}i.netLoc&&!i.path&&(i.path="/");var s={scheme:i.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(s.netLoc=i.netLoc,a.path[0]!=="/"))if(!a.path)s.path=i.path,a.params||(s.params=i.params,a.query||(s.query=i.query));else{var r=i.path,n=r.substring(0,r.lastIndexOf("/")+1)+a.path;s.path=e.normalizePath(n)}return s.path===null&&(s.path=c.alwaysNormalize?e.normalizePath(a.path):a.path),e.buildURLFromParts(s)},parseURL:function(w){var g=S.exec(w);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(w){for(w=w.split("").reverse().join("").replace(F,"");w.length!==(w=w.replace(j,"")).length;);return w.split("").reverse().join("")},buildURLFromParts:function(w){return w.scheme+w.netLoc+w.path+w.params+w.query+w.fragment}};ue.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(ue,W,R){function N(c){var u={};function a(d){if(u[d])return u[d].exports;var s=u[d]={i:d,l:!1,exports:{}};return c[d].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=c,a.c=u,a.i=function(d){return d},a.d=function(d,s,r){a.o(d,s)||Object.defineProperty(d,s,{configurable:!1,enumerable:!0,get:r})},a.r=function(d){Object.defineProperty(d,"__esModule",{value:!0})},a.n=function(d){var s=d&&d.__esModule?function(){return d.default}:function(){return d};return a.d(s,"a",s),s},a.o=function(d,s){return Object.prototype.hasOwnProperty.call(d,s)},a.p="/",a.oe=function(d){throw console.error(d),d};var i=a(a.s=ENTRY_MODULE);return i.default||i}var S="[\\.|\\-|\\+|\\w|/|@]+",O="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+S+").*?\\)";function F(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function j(c){return!isNaN(1*c)}function e(c,u,a){var i={};i[a]=[];var d=u.toString(),s=d.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return i;for(var r=s[1],n=new RegExp("(\\\\n|\\W)"+F(r)+O,"g"),t;t=n.exec(d);){if(t[3]==="dll-reference")continue;i[a].push(t[3])}for(n=new RegExp("\\("+F(r)+'\\("(dll-reference\\s('+S+'))"\\)\\)'+O,"g");t=n.exec(d);)c[t[2]]||(i[a].push(t[1]),c[t[2]]=R(t[1]).m),i[t[2]]=i[t[2]]||[],i[t[2]].push(t[4]);for(var v=Object.keys(i),p=0;p<v.length;p++)for(var m=0;m<i[v[p]].length;m++)j(i[v[p]][m])&&(i[v[p]][m]=1*i[v[p]][m]);return i}function w(c){var u=Object.keys(c);return u.reduce(function(a,i){return a||c[i].length>0},!1)}function g(c,u){for(var a={main:[u]},i={main:[]},d={main:{}};w(a);)for(var s=Object.keys(a),r=0;r<s.length;r++){var n=s[r],t=a[n],v=t.pop();if(d[n]=d[n]||{},d[n][v]||!c[n][v])continue;d[n][v]=!0,i[n]=i[n]||[],i[n].push(v);for(var p=e(c,c[n][v],n),m=Object.keys(p),b=0;b<m.length;b++)a[m[b]]=a[m[b]]||[],a[m[b]]=a[m[b]].concat(p[m[b]])}return i}ue.exports=function(c,u){u=u||{};var a={main:R.m},i=u.all?{main:Object.keys(a.main)}:g(a,c),d="";Object.keys(i).filter(function(v){return v!=="main"}).forEach(function(v){for(var p=0;i[v][p];)p++;i[v].push(p),a[v][p]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",d=d+"var "+v+" = ("+N.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+i[v].map(function(m){return""+JSON.stringify(m)+": "+a[v][m].toString()}).join(",")+`});
`}),d=d+"new (("+N.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+i.main.map(function(v){return""+JSON.stringify(v)+": "+a.main[v].toString()}).join(",")+"}))(self);";var s=new window.Blob([d],{type:"text/javascript"});if(u.bare)return s;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,n=r.createObjectURL(s),t=new window.Worker(n);return t.objectURL=n,t}},"./src/config.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"hlsDefaultConfig",function(){return b}),R.d(W,"mergeConfig",function(){return o}),R.d(W,"enableStreamingMode",function(){return f});var N=R("./src/controller/abr-controller.ts"),S=R("./src/controller/audio-stream-controller.ts"),O=R("./src/controller/audio-track-controller.ts"),F=R("./src/controller/subtitle-stream-controller.ts"),j=R("./src/controller/subtitle-track-controller.ts"),e=R("./src/controller/buffer-controller.ts"),w=R("./src/controller/timeline-controller.ts"),g=R("./src/controller/cap-level-controller.ts"),c=R("./src/controller/fps-controller.ts"),u=R("./src/controller/eme-controller.ts"),a=R("./src/controller/cmcd-controller.ts"),i=R("./src/utils/xhr-loader.ts"),d=R("./src/utils/fetch-loader.ts"),s=R("./src/utils/cues.ts"),r=R("./src/utils/mediakeys-helper.ts"),n=R("./src/utils/logger.ts");function t(){return t=Object.assign||function(l){for(var h=1;h<arguments.length;h++){var E=arguments[h];for(var y in E)Object.prototype.hasOwnProperty.call(E,y)&&(l[y]=E[y])}return l},t.apply(this,arguments)}function v(l,h){var E=Object.keys(l);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(l);h&&(y=y.filter(function(T){return Object.getOwnPropertyDescriptor(l,T).enumerable})),E.push.apply(E,y)}return E}function p(l){for(var h=1;h<arguments.length;h++){var E=arguments[h]!=null?arguments[h]:{};h%2?v(Object(E),!0).forEach(function(y){m(l,y,E[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(E)):v(Object(E)).forEach(function(y){Object.defineProperty(l,y,Object.getOwnPropertyDescriptor(E,y))})}return l}function m(l,h,E){return h in l?Object.defineProperty(l,h,{value:E,enumerable:!0,configurable:!0,writable:!0}):l[h]=E,l}var b=p(p({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:i.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:N.default,bufferController:e.default,capLevelController:g.default,fpsController:c.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},_()),{},{subtitleStreamController:F.SubtitleStreamController,subtitleTrackController:j.default,timelineController:w.TimelineController,audioStreamController:S.default,audioTrackController:O.default,emeController:u.default,cmcdController:a.default});function _(){return{cueHandler:s.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function o(l,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},l,h)}function f(l){var h=l.loader;if(h!==d.default&&h!==i.default)n.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),l.progressive=!1;else{var E=Object(d.fetchSupported)();E&&(l.loader=d.default,l.progressive=!0,l.enableSoftwareAES=!0,n.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/polyfills/number.ts"),S=R("./src/utils/ewma-bandwidth-estimator.ts"),O=R("./src/events.ts"),F=R("./src/utils/buffer-helper.ts"),j=R("./src/errors.ts"),e=R("./src/types/loader.ts"),w=R("./src/utils/logger.ts");function g(a,i){for(var d=0;d<i.length;d++){var s=i[d];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function c(a,i,d){return i&&g(a.prototype,i),d&&g(a,d),a}var u=function(){function a(d){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=d;var s=d.config;this.bwEstimator=new S.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var i=a.prototype;return i.registerListeners=function(){var s=this.hls;s.on(O.Events.FRAG_LOADING,this.onFragLoading,this),s.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(O.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var s=this.hls;s.off(O.Events.FRAG_LOADING,this.onFragLoading,this),s.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(O.Events.ERROR,this.onError,this)},i.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},i.onFragLoading=function(s,r){var n=r.frag;if(n.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=n,this.partCurrent=(t=r.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},i.onLevelLoaded=function(s,r){var n=this.hls.config;r.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},i._abandonRulesCheck=function(){var s=this.fragCurrent,r=this.partCurrent,n=this.hls,t=n.autoLevelEnabled,v=n.config,p=n.media;if(!s||!p)return;var m=r?r.stats:s.stats,b=r?r.duration:s.duration;if(m.aborted){w.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||p.paused||!p.playbackRate||!p.readyState)return;var _=performance.now()-m.loading.start,o=Math.abs(p.playbackRate);if(_<=500*b/o)return;var f=n.levels,l=n.minAutoLevel,h=f[s.level],E=m.total||Math.max(m.loaded,Math.round(b*h.maxBitrate/8)),y=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/_),T=(E-m.loaded)/y,L=p.currentTime,D=(F.BufferHelper.bufferInfo(p,L,v.maxBufferHole).end-L)/o;if(D>=2*b/o||T<=D)return;var x=Number.POSITIVE_INFINITY,P;for(P=s.level-1;P>l;P--){var H=f[P].maxBitrate;if(x=b*H/(8*.8*y),x<D)break}if(x>=T)return;var I=this.bwEstimator.getEstimate();w.logger.warn("Fragment "+s.sn+(r?" part "+r.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+P+`
Current BW estimate: `+(Object(N.isFiniteNumber)(I)?(I/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+T.toFixed(3)+` s
Estimated load time for the next fragment: `+x.toFixed(3)+` s
Time to underbuffer: `+D.toFixed(3)+" s"),n.nextLoadLevel=P,this.bwEstimator.sample(_,m.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),n.trigger(O.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:r,stats:m})},i.onFragLoaded=function(s,r){var n=r.frag,t=r.part;if(n.type===e.PlaylistLevelType.MAIN&&Object(N.isFiniteNumber)(n.sn)){var v=t?t.stats:n.stats,p=t?t.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[n.level],b=(m.loaded?m.loaded.bytes:0)+v.loaded,_=(m.loaded?m.loaded.duration:0)+p;m.loaded={bytes:b,duration:_},m.realBitrate=Math.round(8*b/_)}if(n.bitrateTest){var o={stats:v,frag:n,part:t,id:n.type};this.onFragBuffered(O.Events.FRAG_BUFFERED,o),n.bitrateTest=!1}}},i.onFragBuffered=function(s,r){var n=r.frag,t=r.part,v=t?t.stats:n.stats;if(v.aborted)return;if(n.type!==e.PlaylistLevelType.MAIN||n.sn==="initSegment")return;var p=v.parsing.end-v.loading.start;this.bwEstimator.sample(p,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=p/1e3:this.bitrateTestDelay=0},i.onError=function(s,r){switch(r.details){case j.ErrorDetails.FRAG_LOAD_ERROR:case j.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},i.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},i.getNextABRAutoLevel=function(){var s=this.fragCurrent,r=this.partCurrent,n=this.hls,t=n.maxAutoLevel,v=n.config,p=n.minAutoLevel,m=n.media,b=r?r.duration:s?s.duration:0,_=m?m.currentTime:0,o=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,f=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,l=(F.BufferHelper.bufferInfo(m,_,v.maxBufferHole).end-_)/o,h=this.findBestLevel(f,p,t,l,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(h>=0)return h;w.logger.trace((l?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=b?Math.min(b,v.maxStarvationDelay):v.maxStarvationDelay,y=v.abrBandWidthFactor,T=v.abrBandWidthUpFactor;if(!l){var L=this.bitrateTestDelay;if(L){var D=b?Math.min(b,v.maxLoadingDelay):v.maxLoadingDelay;E=D-L,w.logger.trace("bitrate test took "+Math.round(1e3*L)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),y=T=1}}return h=this.findBestLevel(f,p,t,l+E,y,T),Math.max(h,0)},i.findBestLevel=function(s,r,n,t,v,p){for(var m,b=this.fragCurrent,_=this.partCurrent,o=this.lastLoadedFragLevel,f=this.hls.levels,l=f[o],h=!!(l!=null&&(m=l.details)!==null&&m!==void 0&&m.live),E=l==null?void 0:l.codecSet,y=_?_.duration:b?b.duration:0,T=n;T>=r;T--){var L=f[T];if(!L||E&&L.codecSet!==E)continue;var D=L.details,x=(_?D==null?void 0:D.partTarget:D==null?void 0:D.averagetargetduration)||y,P=void 0;T<=o?P=v*s:P=p*s;var H=f[T].maxBitrate,I=H*x/P;if(w.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+T+"/"+Math.round(P)+"/"+H+"/"+x+"/"+t+"/"+I),P>H&&(!I||h&&!this.bitrateTestDelay||I<t))return T}return-1},c(a,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,r=this.bwEstimator;if(s!==-1&&(!r||!r.canEstimate()))return s;var n=this.getNextABRAutoLevel();return s!==-1&&(n=Math.min(s,n)),n},set:function(s){this._nextAutoLevel=s}}]),a}();W.default=u},"./src/controller/audio-stream-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/polyfills/number.ts"),S=R("./src/controller/base-stream-controller.ts"),O=R("./src/events.ts"),F=R("./src/utils/buffer-helper.ts"),j=R("./src/controller/fragment-tracker.ts"),e=R("./src/types/level.ts"),w=R("./src/types/loader.ts"),g=R("./src/loader/fragment.ts"),c=R("./src/demux/chunk-cache.ts"),u=R("./src/demux/transmuxer-interface.ts"),a=R("./src/types/transmuxer.ts"),i=R("./src/controller/fragment-finders.ts"),d=R("./src/utils/discontinuities.ts"),s=R("./src/errors.ts"),r=R("./src/utils/logger.ts");function n(){return n=Object.assign||function(b){for(var _=1;_<arguments.length;_++){var o=arguments[_];for(var f in o)Object.prototype.hasOwnProperty.call(o,f)&&(b[f]=o[f])}return b},n.apply(this,arguments)}function t(b,_){b.prototype=Object.create(_.prototype),b.prototype.constructor=b,v(b,_)}function v(b,_){return v=Object.setPrototypeOf||function(f,l){return f.__proto__=l,f},v(b,_)}var p=100,m=function(b){t(_,b);function _(f,l){var h;return h=b.call(this,f,l,"[audio-stream-controller]")||this,h.videoBuffer=null,h.videoTrackCC=-1,h.waitingVideoCC=-1,h.audioSwitch=!1,h.trackId=-1,h.waitingData=null,h.mainDetails=null,h.bufferFlushed=!1,h._registerListeners(),h}var o=_.prototype;return o.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},o._registerListeners=function(){var l=this.hls;l.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.on(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.on(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(O.Events.ERROR,this.onError,this),l.on(O.Events.BUFFER_RESET,this.onBufferReset,this),l.on(O.Events.BUFFER_CREATED,this.onBufferCreated,this),l.on(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.on(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},o._unregisterListeners=function(){var l=this.hls;l.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),l.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),l.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(O.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),l.off(O.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),l.off(O.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(O.Events.ERROR,this.onError,this),l.off(O.Events.BUFFER_RESET,this.onBufferReset,this),l.off(O.Events.BUFFER_CREATED,this.onBufferCreated,this),l.off(O.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),l.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),l.off(O.Events.FRAG_BUFFERED,this.onFragBuffered,this)},o.onInitPtsFound=function(l,h){var E=h.frag,y=h.id,T=h.initPTS;if(y==="main"){var L=E.cc;this.initPTS[E.cc]=T,this.log("InitPTS for cc: "+L+" found from main: "+T),this.videoTrackCC=L,this.state===S.State.WAITING_INIT_PTS&&this.tick()}},o.startLoad=function(l){if(!this.levels){this.startPosition=l,this.state=S.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(p),this.fragLoadError=0,h>0&&l===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=S.State.IDLE):(this.loadedmetadata=!1,this.state=S.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=l,this.tick()},o.doTick=function(){switch(this.state){case S.State.IDLE:this.doTickIdle();break;case S.State.WAITING_TRACK:{var l,h=this.levels,E=this.trackId,y=h==null||((l=h[E])===null||l===void 0)?void 0:l.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=S.State.WAITING_INIT_PTS}break}case S.State.FRAG_LOADING_WAITING_RETRY:{var T,L=performance.now(),D=this.retryDate;(!D||L>=D||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=S.State.IDLE);break}case S.State.WAITING_INIT_PTS:{var x=this.waitingData;if(x){var P=x.frag,H=x.part,I=x.cache,z=x.complete;if(this.initPTS[P.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=S.State.FRAG_LOADING;var $=I.flush(),fe={frag:P,part:H,payload:$,networkDetails:null};this._handleFragmentLoadProgress(fe),z&&b.prototype._handleFragmentLoadComplete.call(this,fe)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+P.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ee=this.getLoadPosition(),ye=F.BufferHelper.bufferInfo(this.mediaBuffer,ee,this.config.maxBufferHole),pe=Object(i.fragmentWithinToleranceTest)(ye.end,this.config.maxFragLookUpTolerance,P);pe<0&&(r.logger.log("Waiting fragment cc ("+P.cc+") @ "+P.start+" cancelled because another fragment at "+ye.end+" is needed"),this.clearWaitingFragment())}}else this.state=S.State.IDLE}}this.onTickEnd()},o.clearWaitingFragment=function(){var l=this.waitingData;l&&(this.fragmentTracker.removeFragment(l.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=S.State.IDLE)},o.onTickEnd=function(){var l=this.media;if(!l||!l.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:l,E=h.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=l.currentTime},o.doTickIdle=function(){var l,h,E=this.hls,y=this.levels,T=this.media,L=this.trackId,D=E.config;if(!y||!y[L])return;if(!T&&(this.startFragRequested||!D.startFragPrefetch))return;var x=y[L],P=x.details;if(!P||P.live&&this.levelLastLoaded!==L||this.waitForCdnTuneIn(P)){this.state=S.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,w.PlaylistLevelType.AUDIO));var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,w.PlaylistLevelType.AUDIO);if(H===null)return;var I=H.len,z=this.getMaxBufferLength(),$=this.audioSwitch;if(I>=z&&!$)return;if(!$&&this._streamEnded(H,P)){E.trigger(O.Events.BUFFER_EOS,{type:"audio"}),this.state=S.State.ENDED;return}var fe=P.fragments,ee=fe[0].start,ye=H.end;if($){var pe=this.getLoadPosition();ye=pe,P.PTSKnown&&pe<ee&&((H.end>ee||H.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),T.currentTime=ee+.05))}var ae=this.getNextFragment(ye,P);if(!ae){this.bufferFlushed=!0;return}((l=ae.decryptdata)===null||l===void 0?void 0:l.keyFormat)==="identity"&&!((h=ae.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(ae,P):this.loadFragment(ae,P,ye)},o.getMaxBufferLength=function(){var l=b.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,w.PlaylistLevelType.MAIN);return h===null?l:Math.max(l,h.len)},o.onMediaDetaching=function(){this.videoBuffer=null,b.prototype.onMediaDetaching.call(this)},o.onAudioTracksUpdated=function(l,h){var E=h.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(y){return new e.Level(y)})},o.onAudioTrackSwitching=function(l,h){var E=!!h.url;this.trackId=h.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(p):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=S.State.IDLE):this.state=S.State.STOPPED,this.tick()},o.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},o.onLevelLoaded=function(l,h){this.mainDetails=h.details},o.onAudioTrackLoaded=function(l,h){var E,y=this.levels,T=h.details,L=h.id;if(!y){this.warn("Audio tracks were reset while loading level "+L);return}this.log("Track "+L+" loaded ["+T.startSN+","+T.endSN+"],duration:"+T.totalduration);var D=y[L],x=0;if(T.live||(E=D.details)!==null&&E!==void 0&&E.live){var P=this.mainDetails;if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed||!P)return;!D.details&&T.hasProgramDateTime&&P.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(T,P),x=T.fragments[0].start):x=this.alignPlaylists(T,D.details)}D.details=T,this.levelLastLoaded=L,!this.startFragRequested&&(this.mainDetails||!T.live)&&this.setStartPosition(D.details,x),this.state===S.State.WAITING_TRACK&&!this.waitForCdnTuneIn(T)&&(this.state=S.State.IDLE),this.tick()},o._handleFragmentLoadProgress=function(l){var h,E=l.frag,y=l.part,T=l.payload,L=this.config,D=this.trackId,x=this.levels;if(!x){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var P=x[D];console.assert(P,"Audio track is defined on fragment load progress");var H=P.details;console.assert(H,"Audio track details are defined on fragment load progress");var I=L.defaultAudioCodec||P.audioCodec||"mp4a.40.2",z=this.transmuxer;z||(z=this.transmuxer=new u.default(this.hls,w.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[E.cc],fe=(h=E.initSegment)===null||h===void 0?void 0:h.data;if($!==void 0){var ee=!1,ye=y?y.index:-1,pe=ye!==-1,ae=new a.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,T.byteLength,ye,pe);z.push(T,fe,I,"",E,y,H.totalduration,ee,ae,$)}else{r.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+H.startSN+" ,"+H.endSN+"],track "+D);var se=this.waitingData=this.waitingData||{frag:E,part:y,cache:new c.default,complete:!1},_e=se.cache;_e.push(new Uint8Array(T)),this.waitingVideoCC=this.videoTrackCC,this.state=S.State.WAITING_INIT_PTS}},o._handleFragmentLoadComplete=function(l){if(this.waitingData){this.waitingData.complete=!0;return}b.prototype._handleFragmentLoadComplete.call(this,l)},o.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},o.onBufferCreated=function(l,h){var E=h.tracks.audio;E&&(this.mediaBuffer=E.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},o.onFragBuffered=function(l,h){var E=h.frag,y=h.part;if(E.type!==w.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(y?" p: "+y.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,y)},o.onError=function(l,h){switch(h.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.PlaylistLevelType.AUDIO,h);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==S.State.ERROR&&this.state!==S.State.STOPPED&&(this.state=h.fatal?S.State.ERROR:S.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="audio"&&(this.state===S.State.PARSING||this.state===S.State.PARSED)){var E=!0,y=this.getFwdBufferInfo(this.mediaBuffer,w.PlaylistLevelType.AUDIO);y&&y.len>.5&&(E=!this.reduceMaxBufferLength(y.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,b.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},o.onBufferFlushed=function(l,h){var E=h.type;E===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},o._handleTransmuxComplete=function(l){var h,E="audio",y=this.hls,T=l.remuxResult,L=l.chunkMeta,D=this.getCurrentContext(L);if(!D){this.warn("The loading context changed while buffering fragment "+L.sn+" of level "+L.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(L.level);return}var x=D.frag,P=D.part,H=T.audio,I=T.text,z=T.id3,$=T.initSegment;if(this.fragContextChanged(x))return;if(this.state=S.State.PARSING,this.audioSwitch&&H&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,x,L),y.trigger(O.Events.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:E,tracks:$.tracks})),H){var fe=H.startPTS,ee=H.endPTS,ye=H.startDTS,pe=H.endDTS;P&&(P.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:fe,endPTS:ee,startDTS:ye,endDTS:pe}),x.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,fe,ee,ye,pe),this.bufferFragmentData(H,x,P,L)}if(z!=null&&(h=z.samples)!==null&&h!==void 0&&h.length){var ae=n({frag:x,id:E},z);y.trigger(O.Events.FRAG_PARSING_METADATA,ae)}if(I){var se=n({frag:x,id:E},I);y.trigger(O.Events.FRAG_PARSING_USERDATA,se)}},o._bufferInitSegment=function(l,h,E){if(this.state!==S.State.PARSING)return;l.video&&delete l.video;var y=l.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(O.Events.BUFFER_CODECS,l);var T=y.initSegment;if(T!=null&&T.byteLength){var L={type:"audio",frag:h,part:null,chunkMeta:E,parent:h.type,data:T};this.hls.trigger(O.Events.BUFFER_APPENDING,L)}this.tick()},o.loadFragment=function(l,h,E){var y=this.fragmentTracker.getState(l);this.fragCurrent=l,(this.audioSwitch||y===j.FragmentState.NOT_LOADED||y===j.FragmentState.PARTIAL)&&(l.sn==="initSegment"?this._loadInitSegment(l):h.live&&!Object(N.isFiniteNumber)(this.initPTS[l.cc])?(this.log("Waiting for video PTS in continuity counter "+l.cc+" of live stream before loading audio fragment "+l.sn+" of level "+this.trackId),this.state=S.State.WAITING_INIT_PTS):(this.startFragRequested=!0,b.prototype.loadFragment.call(this,l,h,E)))},o.completeAudioSwitch=function(){var l=this.hls,h=this.media,E=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),b.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,l.trigger(O.Events.AUDIO_TRACK_SWITCHED,{id:E})},_}(S.default);W.default=m},"./src/controller/audio-track-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/errors.ts"),O=R("./src/controller/base-playlist-controller.ts"),F=R("./src/types/loader.ts");function j(u,a){for(var i=0;i<a.length;i++){var d=a[i];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(u,d.key,d)}}function e(u,a,i){return a&&j(u.prototype,a),i&&j(u,i),u}function w(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,g(u,a)}function g(u,a){return g=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},g(u,a)}var c=function(u){w(a,u);function a(d){var s;return s=u.call(this,d,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var i=a.prototype;return i.registerListeners=function(){var s=this.hls;s.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(N.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var s=this.hls;s.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(N.Events.ERROR,this.onError,this)},i.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,u.prototype.destroy.call(this)},i.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},i.onManifestParsed=function(s,r){this.tracks=r.audioTracks||[]},i.onAudioTrackLoaded=function(s,r){var n=r.id,t=r.details,v=this.tracksInGroup[n];if(!v){this.warn("Invalid audio track id "+n);return}var p=v.details;v.details=r.details,this.log("audioTrack "+n+" loaded ["+t.startSN+"-"+t.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,r,p))},i.onLevelLoading=function(s,r){this.switchLevel(r.level)},i.onLevelSwitching=function(s,r){this.switchLevel(r.level)},i.switchLevel=function(s){var r=this.hls.levels[s];if(!(r!=null&&r.audioGroupIds))return;var n=r.audioGroupIds[r.urlId];if(this.groupId!==n){this.groupId=n;var t=this.tracks.filter(function(p){return!n||p.groupId===n});this.selectDefaultTrack&&!t.some(function(p){return p.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var v={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(N.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},i.onError=function(s,r){if(u.prototype.onError.call(this,s,r),r.fatal||!r.context)return;r.context.type===F.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},i.setAudioTrack=function(s){var r=this.tracksInGroup;if(s<0||s>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var n=r[this.trackId];this.log("Now switching to audio-track index "+s);var t=r[s],v=t.id,p=t.groupId,m=p===void 0?"":p,b=t.name,_=t.type,o=t.url;if(this.trackId=s,this.trackName=b,this.selectDefaultTrack=!1,this.hls.trigger(N.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:m,name:b,type:_,url:o}),t.details&&!t.details.live)return;var f=this.switchParams(t.url,n==null?void 0:n.details);this.loadPlaylist(f)},i.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,n=this.findTrackId(r)||this.findTrackId();n!==-1?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},i.findTrackId=function(s){for(var r=this.tracksInGroup,n=0;n<r.length;n++){var t=r[n];if((!this.selectDefaultTrack||t.default)&&(!s||s===t.name))return t.id}return-1},i.loadPlaylist=function(s){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var n=r.id,t=r.groupId,v=r.url;if(s)try{v=s.addDirectives(v)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(N.Events.AUDIO_TRACK_LOADING,{url:v,id:n,groupId:t,deliveryDirectives:s||null})}},e(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),a}(O.default);W.default=c},"./src/controller/base-playlist-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return e});var N=R("./src/polyfills/number.ts"),S=R("./src/types/level.ts"),O=R("./src/controller/level-helper.ts"),F=R("./src/utils/logger.ts"),j=R("./src/errors.ts"),e=function(){function w(c,u){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=F.logger.log.bind(F.logger,u+":"),this.warn=F.logger.warn.bind(F.logger,u+":"),this.hls=c}var g=w.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(u,a){a.fatal&&a.type===j.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(u,a){var i=a==null?void 0:a.renditionReports;if(i)for(var d=0;d<i.length;d++){var s=i[d],r=""+s.URI;if(r===u.substr(-r.length)){var n=parseInt(s["LAST-MSN"]),t=parseInt(s["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var v=Math.min(a.age-a.partTarget,a.targetduration);t!==void 0&&v>a.partTarget&&(t+=1)}if(Object(N.isFiniteNumber)(n))return new S.HlsUrlParameters(n,Object(N.isFiniteNumber)(t)?t:void 0,S.HlsSkip.No)}}},g.loadPlaylist=function(u){},g.shouldLoadTrack=function(u){return this.canLoad&&u&&!!u.url&&(!u.details||u.details.live)},g.playlistLoaded=function(u,a,i){var d=this,s=a.details,r=a.stats,n=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(s.advancedDateTime=Date.now()-n,s.live||i!=null&&i.live){if(s.reloaded(i),i&&this.log("live playlist "+u+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),i&&s.fragments.length>0&&Object(O.mergeDetails)(i,s),!this.canLoad||!s.live)return;var t,v=void 0,p=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var m=this.hls.config.lowLatencyMode,b=s.lastPartSn,_=s.endSN,o=s.lastPartIndex,f=o!==-1,l=b===_,h=m?0:o;f?(v=l?_+1:b,p=l?h:o+1):v=_+1;var E=s.age,y=E+s.ageHeader,T=Math.min(y-s.partTarget,s.targetduration*1.5);if(T>0){if(i&&T>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+i.tuneInGoal+" to: "+T+" with playlist age: "+s.age),T=0;else{var L=Math.floor(T/s.targetduration);if(v+=L,p!==void 0){var D=Math.round(T%s.targetduration/s.partTarget);p+=D}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+T+" skip sn "+L+" to part "+p)}s.tuneInGoal=T}if(t=this.getDeliveryDirectives(s,a.deliveryDirectives,v,p),m||!l){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(s,a.deliveryDirectives,v,p);var x=Object(O.computeReloadInterval)(s,r);v!==void 0&&s.canBlockReload&&(x-=s.partTarget||1),this.log("reload live playlist "+u+" in "+Math.round(x)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(t)},x)}else this.clearTimer()},g.getDeliveryDirectives=function(u,a,i,d){var s=Object(S.getSkipValue)(u,i);return a!=null&&a.skip&&u.deltaUpdateFailed&&(i=a.msn,d=a.part,s=S.HlsSkip.No),new S.HlsUrlParameters(i,d,s)},g.retryLoadingOrFail=function(u){var a=this,i=this.hls.config,d=this.retryCount<i.levelLoadingMaxRetry;if(d){var s;if(this.retryCount++,u.details.indexOf("LoadTimeOut")>-1&&(s=u.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+u.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+u.details+'"')}}else this.warn('cannot recover from error "'+u.details+'"'),this.clearTimer(),u.fatal=!0;return d},w}()},"./src/controller/base-stream-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"State",function(){return _}),R.d(W,"default",function(){return o});var N=R("./src/polyfills/number.ts"),S=R("./src/task-loop.ts"),O=R("./src/controller/fragment-tracker.ts"),F=R("./src/utils/buffer-helper.ts"),j=R("./src/utils/logger.ts"),e=R("./src/events.ts"),w=R("./src/errors.ts"),g=R("./src/types/transmuxer.ts"),c=R("./src/utils/mp4-tools.ts"),u=R("./src/utils/discontinuities.ts"),a=R("./src/controller/fragment-finders.ts"),i=R("./src/controller/level-helper.ts"),d=R("./src/loader/fragment-loader.ts"),s=R("./src/crypt/decrypter.ts"),r=R("./src/utils/time-ranges.ts"),n=R("./src/types/loader.ts");function t(f,l){for(var h=0;h<l.length;h++){var E=l[h];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(f,E.key,E)}}function v(f,l,h){return l&&t(f.prototype,l),h&&t(f,h),f}function p(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f}function m(f,l){f.prototype=Object.create(l.prototype),f.prototype.constructor=f,b(f,l)}function b(f,l){return b=Object.setPrototypeOf||function(E,y){return E.__proto__=y,E},b(f,l)}var _={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},o=function(f){m(l,f);function l(E,y,T){var L;return L=f.call(this)||this,L.hls=void 0,L.fragPrevious=null,L.fragCurrent=null,L.fragmentTracker=void 0,L.transmuxer=null,L._state=_.STOPPED,L.media=void 0,L.mediaBuffer=void 0,L.config=void 0,L.bitrateTest=!1,L.lastCurrentTime=0,L.nextLoadPosition=0,L.startPosition=0,L.loadedmetadata=!1,L.fragLoadError=0,L.retryDate=0,L.levels=null,L.fragmentLoader=void 0,L.levelLastLoaded=null,L.startFragRequested=!1,L.decrypter=void 0,L.initPTS=[],L.onvseeking=null,L.onvended=null,L.logPrefix="",L.log=void 0,L.warn=void 0,L.logPrefix=T,L.log=j.logger.log.bind(j.logger,T+":"),L.warn=j.logger.warn.bind(j.logger,T+":"),L.hls=E,L.fragmentLoader=new d.default(E.config),L.fragmentTracker=y,L.config=E.config,L.decrypter=new s.default(E,E.config),E.on(e.Events.KEY_LOADED,L.onKeyLoaded,p(L)),L}var h=l.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(y){},h.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_.STOPPED},h._streamEnded=function(y,T){var L=this.fragCurrent,D=this.fragmentTracker;if(!T.live&&L&&L.sn===T.endSN&&!y.nextStart){var x=D.getState(L);return x===O.FragmentState.PARTIAL||x===O.FragmentState.OK}return!1},h.onMediaAttached=function(y,T){var L=this.media=this.mediaBuffer=T.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),L.addEventListener("seeking",this.onvseeking),L.addEventListener("ended",this.onvended);var D=this.config;this.levels&&D.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(D.startPosition)},h.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},h.onMediaSeeking=function(){var y=this.config,T=this.fragCurrent,L=this.media,D=this.mediaBuffer,x=this.state,P=L?L.currentTime:0,H=F.BufferHelper.bufferInfo(D||L,P,y.maxBufferHole);if(this.log("media seeking to "+(Object(N.isFiniteNumber)(P)?P.toFixed(3):P)+", state: "+x),x===_.ENDED)this.resetLoadingState();else if(T&&!H.len){var I=y.maxFragLookUpTolerance,z=T.start-I,$=T.start+T.duration+I,fe=P>$;(P<z||fe)&&(fe&&T.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),T.loader.abort()),this.resetLoadingState())}L&&(this.lastCurrentTime=P),!this.loadedmetadata&&!H.len&&(this.nextLoadPosition=this.startPosition=P),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(y,T){if(this.state!==_.KEY_LOADING||T.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var L=this.levels[T.frag.level].details;L&&this.loadFragment(T.frag,L,T.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),f.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=_.STOPPED,this.hls.off(e.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,f.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(y,T){this.log("Loading key for "+y.sn+" of ["+T.startSN+"-"+T.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=_.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(e.Events.KEY_LOADING,{frag:y})},h.loadFragment=function(y,T,L){this._loadFragForPlayback(y,T,L)},h._loadFragForPlayback=function(y,T,L){var D=this,x=function(H){if(D.fragContextChanged(y)){D.warn("Fragment "+y.sn+(H.part?" p: "+H.part.index:"")+" of level "+y.level+" was dropped during download."),D.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,D._handleFragmentLoadProgress(H)};this._doFragLoad(y,T,L,x).then(function(P){if(!P)return;D.fragLoadError=0;var H=D.state;if(D.fragContextChanged(y)){(H===_.FRAG_LOADING||H===_.BACKTRACKING||!D.fragCurrent&&H===_.PARSING)&&(D.fragmentTracker.removeFragment(y),D.state=_.IDLE);return}if("payload"in P&&(D.log("Loaded fragment "+y.sn+" of level "+y.level),D.hls.trigger(e.Events.FRAG_LOADED,P),D.state===_.BACKTRACKING)){D.fragmentTracker.backtrack(y,P),D.resetFragmentLoading(y);return}D._handleFragmentLoadComplete(P)}).catch(function(P){D.warn(P),D.resetFragmentLoading(y)})},h.flushMainBuffer=function(y,T,L){if(L===void 0&&(L=null),!(y-T))return;var D={startOffset:y,endOffset:T,type:L};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,D)},h._loadInitSegment=function(y){var T=this;this._doFragLoad(y).then(function(L){if(!L||T.fragContextChanged(y)||!T.levels)throw new Error("init load aborted");return L}).then(function(L){var D=T.hls,x=L.payload,P=y.decryptdata;if(x&&x.byteLength>0&&P&&P.key&&P.iv&&P.method==="AES-128"){var H=self.performance.now();return T.decrypter.webCryptoDecrypt(new Uint8Array(x),P.key.buffer,P.iv.buffer).then(function(I){var z=self.performance.now();return D.trigger(e.Events.FRAG_DECRYPTED,{frag:y,payload:I,stats:{tstart:H,tdecrypt:z}}),L.payload=I,L})}return L}).then(function(L){var D=T.fragCurrent,x=T.hls,P=T.levels;if(!P)throw new Error("init load aborted, missing levels");var H=P[y.level].details;console.assert(H,"Level details are defined when init segment is loaded");var I=y.stats;T.state=_.IDLE,T.fragLoadError=0,y.data=new Uint8Array(L.payload),I.parsing.start=I.buffering.start=self.performance.now(),I.parsing.end=I.buffering.end=self.performance.now(),L.frag===D&&x.trigger(e.Events.FRAG_BUFFERED,{stats:I,frag:D,part:null,id:y.type}),T.tick()}).catch(function(L){T.warn(L),T.resetFragmentLoading(y)})},h.fragContextChanged=function(y){var T=this.fragCurrent;return!y||!T||y.level!==T.level||y.sn!==T.sn||y.urlId!==T.urlId},h.fragBufferedComplete=function(y,T){var L=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(T?" part: "+T.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+r.default.toString(F.BufferHelper.getBuffered(L))),this.state=_.IDLE,this.tick()},h._handleFragmentLoadComplete=function(y){var T=this.transmuxer;if(!T)return;var L=y.frag,D=y.part,x=y.partsLoaded,P=!x||x.length===0||x.some(function(I){return!I}),H=new g.ChunkMetadata(L.level,L.sn,L.stats.chunkCount+1,0,D?D.index:-1,!P);T.flush(H)},h._handleFragmentLoadProgress=function(y){},h._doFragLoad=function(y,T,L,D){var x=this;if(L===void 0&&(L=null),!this.levels)throw new Error("frag load aborted, missing levels");if(L=Math.max(y.start,L||0),this.config.lowLatencyMode&&T){var P=T.partList;if(P&&D){L>y.end&&T.fragmentHint&&(y=T.fragmentHint);var H=this.getNextPart(P,y,L);if(H>-1){var I=P[H];return this.log("Loading part sn: "+y.sn+" p: "+I.index+" cc: "+y.cc+" of playlist ["+T.startSN+"-"+T.endSN+"] parts [0-"+H+"-"+(P.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(L.toFixed(3))),this.nextLoadPosition=I.start+I.duration,this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:y,part:P[H],targetBufferTime:L}),this.doFragPartsLoad(y,P,H,D).catch(function(z){return x.handleFragLoadError(z)})}else if(!y.url||this.loadedEndOfParts(P,L))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(T?"of ["+T.startSN+"-"+T.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(L.toFixed(3))),Object(N.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:y,targetBufferTime:L}),this.fragmentLoader.load(y,D).catch(function(z){return x.handleFragLoadError(z)})},h.doFragPartsLoad=function(y,T,L,D){var x=this;return new Promise(function(P,H){var I=[],z=function $(fe){var ee=T[fe];x.fragmentLoader.loadPart(y,ee,D).then(function(ye){I[ee.index]=ye;var pe=ye.part;x.hls.trigger(e.Events.FRAG_LOADED,ye);var ae=T[fe+1];if(ae&&ae.fragment===y)$(fe+1);else return P({frag:y,part:pe,partsLoaded:I})}).catch(H)};z(L)})},h.handleFragLoadError=function(y){var T=y.data;return T&&T.details===w.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(T.frag,T.part):this.hls.trigger(e.Events.ERROR,T),null},h._handleTransmuxerFlush=function(y){var T=this.getCurrentContext(y);if(!T||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var L=T.frag,D=T.part,x=T.level,P=self.performance.now();L.stats.parsing.end=P,D&&(D.stats.parsing.end=P),this.updateLevelTiming(L,D,x,y.partial)},h.getCurrentContext=function(y){var T=this.levels,L=y.level,D=y.sn,x=y.part;if(!T||!T[L])return this.warn("Levels object was unset while buffering fragment "+D+" of level "+L+". The current chunk will not be buffered."),null;var P=T[L],H=x>-1?Object(i.getPartWith)(P,D,x):null,I=H?H.fragment:Object(i.getFragmentWithSN)(P,D,this.fragCurrent);return I?{frag:I,part:H,level:P}:null},h.bufferFragmentData=function(y,T,L,D){if(!y||this.state!==_.PARSING)return;var x=y.data1,P=y.data2,H=x;if(x&&P&&(H=Object(c.appendUint8Array)(x,P)),!H||!H.length)return;var I={type:y.type,frag:T,part:L,chunkMeta:D,parent:T.type,data:H};this.hls.trigger(e.Events.BUFFER_APPENDING,I),y.dropped&&y.independent&&!L&&this.flushBufferGap(T)},h.flushBufferGap=function(y){var T=this.media;if(!T)return;if(!F.BufferHelper.isBuffered(T,T.currentTime)){this.flushMainBuffer(0,y.start);return}var L=T.currentTime,D=F.BufferHelper.bufferInfo(T,L,0),x=y.duration,P=Math.min(this.config.maxFragLookUpTolerance*2,x*.25),H=Math.max(Math.min(y.start-P,D.end-P),L+P);y.start-H>P&&this.flushMainBuffer(H,y.start)},h.getFwdBufferInfo=function(y,T){var L=this.config,D=this.getLoadPosition();if(!Object(N.isFiniteNumber)(D))return null;var x=F.BufferHelper.bufferInfo(y,D,L.maxBufferHole);if(x.len===0&&x.nextStart!==void 0){var P=this.fragmentTracker.getBufferedFrag(D,T);if(P&&x.nextStart<P.end)return F.BufferHelper.bufferInfo(y,D,Math.max(x.nextStart,L.maxBufferHole))}return x},h.getMaxBufferLength=function(y){var T=this.config,L;return y?L=Math.max(8*T.maxBufferSize/y,T.maxBufferLength):L=T.maxBufferLength,Math.min(L,T.maxMaxBufferLength)},h.reduceMaxBufferLength=function(y){var T=this.config,L=y||T.maxBufferLength;return T.maxMaxBufferLength>=L?(T.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+T.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(y,T){var L,D,x=T.fragments,P=x.length;if(!P)return null;var H=this.config,I=x[0].start,z;if(T.live){var $=H.initialLiveManifestSize;if(P<$)return this.warn("Not enough fragments to start playback (have: "+P+", need: "+$+")"),null;!T.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(z=this.getInitialLiveFragment(T,x),this.startPosition=z?this.hls.liveSyncPosition||z.start:y)}else y<=I&&(z=x[0]);if(!z){var fe=H.lowLatencyMode?T.partEnd:T.fragmentEnd;z=this.getFragmentAtPosition(y,fe,T)}return(L=z)!==null&&L!==void 0&&L.initSegment&&!((D=z)!==null&&D!==void 0&&D.initSegment.data)&&!this.bitrateTest&&(z=z.initSegment),z},h.getNextPart=function(y,T,L){for(var D=-1,x=!1,P=!0,H=0,I=y.length;H<I;H++){var z=y[H];if(P=P&&!z.independent,D>-1&&L<z.start)break;var $=z.loaded;!$&&(x||z.independent||P)&&z.fragment===T&&(D=H),x=$}return D},h.loadedEndOfParts=function(y,T){var L=y[y.length-1];return L&&T>L.start&&L.loaded},h.getInitialLiveFragment=function(y,T){var L=this.fragPrevious,D=null;if(L){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+L.programDateTime),D=Object(a.findFragmentByPDT)(T,L.endProgramDateTime,this.config.maxFragLookUpTolerance)),!D){var x=L.sn+1;if(x>=y.startSN&&x<=y.endSN){var P=T[x-y.startSN];L.cc===P.cc&&(D=P,this.log("Live playlist, switching playlist, load frag with next SN: "+D.sn))}D||(D=Object(a.findFragWithCC)(T,L.cc),D&&this.log("Live playlist, switching playlist, load frag with same CC: "+D.sn))}}else{var H=this.hls.liveSyncPosition;H!==null&&(D=this.getFragmentAtPosition(H,this.bitrateTest?y.fragmentEnd:y.edge,y))}return D},h.getFragmentAtPosition=function(y,T,L){var D=this.config,x=this.fragPrevious,P=L.fragments,H=L.endSN,I=L.fragmentHint,z=D.maxFragLookUpTolerance,$=!!(D.lowLatencyMode&&L.partList&&I);$&&I&&!this.bitrateTest&&(P=P.concat(I),H=I.sn);var fe;if(y<T){var ee=y>T-z?0:z;fe=Object(a.findFragmentByPTS)(x,P,y,ee)}else fe=P[P.length-1];if(fe){var ye=fe.sn-L.startSN,pe=x&&fe.level===x.level,ae=P[ye+1],se=this.fragmentTracker.getState(fe);if(se===O.FragmentState.BACKTRACKED){fe=null;for(var _e=ye;P[_e]&&this.fragmentTracker.getState(P[_e])===O.FragmentState.BACKTRACKED;)x?fe=P[_e--]:fe=P[--_e];fe||(fe=ae)}else x&&fe.sn===x.sn&&!$&&(pe&&(fe.sn<H&&this.fragmentTracker.getState(ae)!==O.FragmentState.OK?(this.log("SN "+fe.sn+" just loaded, load next one: "+ae.sn),fe=ae):fe=null))}return fe},h.synchronizeToLiveEdge=function(y){var T=this.config,L=this.media;if(!L)return;var D=this.hls.liveSyncPosition,x=L.currentTime,P=y.fragments[0].start,H=y.edge,I=x>=P-T.maxFragLookUpTolerance&&x<=H;if(D!==null&&L.duration>D&&(x<D||!I)){var z=T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:T.liveMaxLatencyDurationCount*y.targetduration;(!I&&L.readyState<4||x<H-z)&&(this.loadedmetadata||(this.nextLoadPosition=D),L.readyState&&(this.warn("Playback: "+x.toFixed(3)+" is located too far from the end of live sliding playlist: "+H+", reset currentTime to : "+D.toFixed(3)),L.currentTime=D))}},h.alignPlaylists=function(y,T){var L=this.levels,D=this.levelLastLoaded,x=this.fragPrevious,P=D!==null?L[D]:null,H=y.fragments.length;if(!H)return this.warn("No fragments in live playlist"),0;var I=y.fragments[0].start,z=!T,$=y.alignedSliding&&Object(N.isFiniteNumber)(I);if(z||!$&&!I){Object(u.alignStream)(x,P,y);var fe=y.fragments[0].start;return this.log("Live playlist sliding: "+fe.toFixed(2)+" start-sn: "+(T?T.startSN:"na")+"->"+y.startSN+" prev-sn: "+(x?x.sn:"na")+" fragments: "+H),fe}return I},h.waitForCdnTuneIn=function(y){var T=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*T)},h.setStartPosition=function(y,T){var L=this.startPosition;if(L<T&&(L=-1),L===-1||this.lastCurrentTime===-1){var D=y.startTimeOffset;Object(N.isFiniteNumber)(D)?(L=T+D,D<0&&(L+=y.totalduration),L=Math.min(Math.max(T,L),T+y.totalduration),this.log("Start time offset "+D+" found in playlist, adjust startPosition to "+L),this.startPosition=L):y.live?L=this.hls.liveSyncPosition||T:this.startPosition=L=0,this.lastCurrentTime=L}this.nextLoadPosition=L},h.getLoadPosition=function(){var y=this.media,T=0;return this.loadedmetadata&&y?T=y.currentTime:this.nextLoadPosition&&(T=this.nextLoadPosition),T},h.handleFragLoadAborted=function(y,T){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(T?" part"+T.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},h.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=_.IDLE)},h.onFragmentOrKeyLoadError=function(y,T){if(T.fatal)return;var L=T.frag;if(!L||L.type!==y)return;var D=this.fragCurrent;console.assert(D&&L.sn===D.sn&&L.level===D.level&&L.urlId===D.urlId,"Frag load error must match current frag to retry");var x=this.config;if(this.fragLoadError+1<=x.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(L.level))return;var P=Math.min(Math.pow(2,this.fragLoadError)*x.fragLoadingRetryDelay,x.fragLoadingMaxRetryTimeout);this.warn("Fragment "+L.sn+" of "+y+" "+L.level+" failed to load, retrying in "+P+"ms"),this.retryDate=self.performance.now()+P,this.fragLoadError++,this.state=_.FRAG_LOADING_WAITING_RETRY}else T.levelRetry?(y===n.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(j.logger.error(T.details+" reaches max retry, redispatch as fatal ..."),T.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},h.afterBufferFlushed=function(y,T,L){if(!y)return;var D=F.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(T,D,L),this.state===_.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},h.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var T=this.levels?this.levels[y].details:null;if(T!=null&&T.live)return this.startPosition=-1,this.setStartPosition(T,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(y,T,L,D){var x=this,P=L.details;console.assert(!!P,"level.details must be defined");var H=Object.keys(y.elementaryStreams).reduce(function(I,z){var $=y.elementaryStreams[z];if($){var fe=$.endPTS-$.startPTS;if(fe<=0)return x.warn("Could not parse fragment "+y.sn+" "+z+" duration reliably ("+fe+") resetting transmuxer to fallback to playlist timing"),x.resetTransmuxer(),I||!1;var ee=D?0:Object(i.updateFragPTSDTS)(P,y,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return x.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:P,level:L,drift:ee,type:z,frag:y,start:$.startPTS,end:$.endPTS}),!0}return I},!1);H?(this.state=_.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:y,part:T})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(l,[{key:"state",get:function(){return this._state},set:function(y){var T=this._state;T!==y&&(this._state=y,this.log(T+"->"+y))}}]),l}(S.default)},"./src/controller/buffer-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return a});var N=R("./src/polyfills/number.ts"),S=R("./src/events.ts"),O=R("./src/utils/logger.ts"),F=R("./src/errors.ts"),j=R("./src/utils/buffer-helper.ts"),e=R("./src/utils/mediasource-helper.ts"),w=R("./src/loader/fragment.ts"),g=R("./src/controller/buffer-operation-queue.ts"),c=Object(e.getMediaSource)(),u=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function i(s){var r=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var n=r.hls,t=r.media,v=r.mediaSource;O.logger.log("[buffer-controller]: Media source opened"),t&&(r.updateMediaElementDuration(),n.trigger(S.Events.MEDIA_ATTACHED,{media:t})),v&&v.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){O.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){O.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var d=i.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var r=this.hls;r.on(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(S.Events.BUFFER_RESET,this.onBufferReset,this),r.on(S.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(S.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(S.Events.BUFFER_EOS,this.onBufferEos,this),r.on(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(S.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(S.Events.FRAG_PARSED,this.onFragParsed,this),r.on(S.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var r=this.hls;r.off(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(S.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(S.Events.BUFFER_RESET,this.onBufferReset,this),r.off(S.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(S.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(S.Events.BUFFER_EOS,this.onBufferEos,this),r.off(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(S.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(S.Events.FRAG_PARSED,this.onFragParsed,this),r.off(S.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(r,n){var t=2;(n.audio&&!n.video||!n.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,O.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(r,n){var t=this.media=n.media;if(t&&c){var v=this.mediaSource=new c;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(v),this._objectUrl=t.src}},d.onMediaDetaching=function(){var r=this.media,n=this.mediaSource,t=this._objectUrl;if(n){if(O.logger.log("[buffer-controller]: media source detaching"),n.readyState==="open")try{n.endOfStream()}catch(v){O.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),n.removeEventListener("sourceopen",this._onMediaSourceOpen),n.removeEventListener("sourceended",this._onMediaSourceEnded),n.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(t&&self.URL.revokeObjectURL(t),r.src===t?(r.removeAttribute("src"),r.load()):O.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(S.Events.MEDIA_DETACHED,void 0)},d.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(n){var t=r.sourceBuffer[n];try{t&&(r.removeBufferListeners(n),r.mediaSource&&r.mediaSource.removeSourceBuffer(t),r.sourceBuffer[n]=void 0)}catch(v){O.logger.warn("[buffer-controller]: Failed to reset the "+n+" buffer",v)}}),this._initSourceBuffer()},d.onBufferCodecs=function(r,n){var t=this,v=this.getSourceBufferTypes().length;if(Object.keys(n).forEach(function(p){if(v){var m=t.tracks[p];if(m&&typeof m.buffer.changeType=="function"){var b=n[p],_=b.codec,o=b.levelCodec,f=b.container,l=(m.levelCodec||m.codec).replace(u,"$1"),h=(o||_).replace(u,"$1");if(l!==h){var E=f+";codecs="+(o||_);t.appendChangeType(p,E)}}}else t.pendingTracks[p]=n[p]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(r,n){var t=this,v=this.operationQueue,p={execute:function(){var b=t.sourceBuffer[r];b&&(O.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+n),b.changeType(n)),v.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(b){O.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",b)}};v.append(p,r)},d.onBufferAppending=function(r,n){var t=this,v=this.hls,p=this.operationQueue,m=this.tracks,b=n.data,_=n.type,o=n.frag,f=n.part,l=n.chunkMeta,h=l.buffering[_],E=self.performance.now();h.start=E;var y=o.stats.buffering,T=f?f.stats.buffering:null;y.start===0&&(y.start=E),T&&T.start===0&&(T.start=E);var L=m.audio,D=_==="audio"&&l.id===1&&(L==null?void 0:L.container)==="audio/mpeg",x={execute:function(){if(h.executeStart=self.performance.now(),D){var H=t.sourceBuffer[_];if(H){var I=o.start-H.timestampOffset;Math.abs(I)>=.1&&(O.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+o.start+" (delta: "+I+") sn: "+o.sn+")"),H.timestampOffset=o.start)}}t.appendExecutor(b,_)},onStart:function(){},onComplete:function(){var H=self.performance.now();h.executeEnd=h.end=H,y.first===0&&(y.first=H),T&&T.first===0&&(T.first=H);var I=t.sourceBuffer,z={};for(var $ in I)z[$]=j.BufferHelper.getBuffered(I[$]);t.appendError=0,t.hls.trigger(S.Events.BUFFER_APPENDED,{type:_,frag:o,part:f,chunkMeta:l,parent:o.type,timeRanges:z})},onError:function(H){O.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",H);var I={type:F.ErrorTypes.MEDIA_ERROR,parent:o.type,details:F.ErrorDetails.BUFFER_APPEND_ERROR,err:H,fatal:!1};H.code===DOMException.QUOTA_EXCEEDED_ERR?I.details=F.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,I.details=F.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>v.config.appendErrorMaxRetry&&(O.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),I.fatal=!0)),v.trigger(S.Events.ERROR,I)}};p.append(x,_)},d.onBufferFlushing=function(r,n){var t=this,v=this.operationQueue,p=function(b){return{execute:t.removeExecutor.bind(t,b,n.startOffset,n.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(S.Events.BUFFER_FLUSHED,{type:b})},onError:function(o){O.logger.warn("[buffer-controller]: Failed to remove from "+b+" SourceBuffer",o)}}};n.type?v.append(p(n.type),n.type):this.getSourceBufferTypes().forEach(function(m){v.append(p(m),m)})},d.onFragParsed=function(r,n){var t=this,v=n.frag,p=n.part,m=[],b=p?p.elementaryStreams:v.elementaryStreams;b[w.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(b[w.ElementaryStreamTypes.AUDIO]&&m.push("audio"),b[w.ElementaryStreamTypes.VIDEO]&&m.push("video"));var _=function(){var f=self.performance.now();v.stats.buffering.end=f,p&&(p.stats.buffering.end=f);var l=p?p.stats:v.stats;t.hls.trigger(S.Events.FRAG_BUFFERED,{frag:v,part:p,stats:l,id:v.type})};m.length===0&&O.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(_,m)},d.onFragChanged=function(r,n){this.flushBackBuffer()},d.onBufferEos=function(r,n){var t=this,v=this.getSourceBufferTypes().reduce(function(p,m){var b=t.sourceBuffer[m];return(!n.type||n.type===m)&&(b&&!b.ended&&(b.ended=!0,O.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),p&&!!(!b||b.ended)},!0);v&&this.blockBuffers(function(){var p=t.mediaSource;if(!p||p.readyState!=="open")return;p.endOfStream()})},d.onLevelUpdated=function(r,n){var t=n.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var r=this.hls,n=this.details,t=this.media,v=this.sourceBuffer;if(!t||n===null)return;var p=this.getSourceBufferTypes();if(!p.length)return;var m=n.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(N.isFiniteNumber)(m)||m<0)return;var b=t.currentTime,_=n.levelTargetDuration,o=Math.max(m,_),f=Math.floor(b/_)*_-o;p.forEach(function(l){var h=v[l];if(h){var E=j.BufferHelper.getBuffered(h);E.length>0&&f>E.start(0)&&(r.trigger(S.Events.BACK_BUFFER_REACHED,{bufferEnd:f}),n.live&&r.trigger(S.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:f}),r.trigger(S.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:f,type:l}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,n=this.hls,t=this.media,v=this.mediaSource,p=r.fragments[0].start+r.totalduration,m=t.duration,b=Object(N.isFiniteNumber)(v.duration)?v.duration:0;r.live&&n.config.liveDurationInfinity?(O.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(r)):(p>b&&p>m||!Object(N.isFiniteNumber)(m))&&(O.logger.log("[buffer-controller]: Updating Media Source duration to "+p.toFixed(3)),v.duration=p)},d.updateSeekableRange=function(r){var n=this.mediaSource,t=r.fragments,v=t.length;if(v&&r.live&&n!==null&&n!==void 0&&n.setLiveSeekableRange){var p=Math.max(0,t[0].start),m=Math.max(p,p+r.totalduration);n.setLiveSeekableRange(p,m)}},d.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,n=this.operationQueue,t=this.pendingTracks,v=Object.keys(t).length;if(v&&!r||v===2){this.createSourceBuffers(t),this.pendingTracks={};var p=this.getSourceBufferTypes();if(p.length===0){this.hls.trigger(S.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}p.forEach(function(m){n.executeNext(m)})}},d.createSourceBuffers=function(r){var n=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var p in r)if(!n[p]){var m=r[p];if(!m)throw Error("source buffer exists for track "+p+", however track does not");var b=m.levelCodec||m.codec,_=m.container+";codecs="+b;O.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var o=n[p]=t.addSourceBuffer(_),f=p;this.addBufferListener(f,"updatestart",this._onSBUpdateStart),this.addBufferListener(f,"updateend",this._onSBUpdateEnd),this.addBufferListener(f,"error",this._onSBUpdateError),this.tracks[p]={buffer:o,codec:b,container:m.container,levelCodec:m.levelCodec,id:m.id},v++}catch(l){O.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+l.message),this.hls.trigger(S.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:l,mimeType:_})}}v&&this.hls.trigger(S.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(r){var n=this.operationQueue,t=n.current(r);t.onStart()},d._onSBUpdateEnd=function(r){var n=this.operationQueue,t=n.current(r);t.onComplete(),n.shiftAndExecuteNext(r)},d._onSBUpdateError=function(r,n){O.logger.error("[buffer-controller]: "+r+" SourceBuffer error",n),this.hls.trigger(S.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(r);t&&t.onError(n)},d.removeExecutor=function(r,n,t){var v=this.media,p=this.mediaSource,m=this.operationQueue,b=this.sourceBuffer,_=b[r];if(!v||!p||!_){O.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(r);return}var o=Object(N.isFiniteNumber)(v.duration)?v.duration:Infinity,f=Object(N.isFiniteNumber)(p.duration)?p.duration:Infinity,l=Math.max(0,n),h=Math.min(t,o,f);h>l?(O.logger.log("[buffer-controller]: Removing ["+l+","+h+"] from the "+r+" SourceBuffer"),console.assert(!_.updating,r+" sourceBuffer must not be updating"),_.remove(l,h)):m.shiftAndExecuteNext(r)},d.appendExecutor=function(r,n){var t=this.operationQueue,v=this.sourceBuffer,p=v[n];if(!p){O.logger.warn("[buffer-controller]: Attempting to append to the "+n+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(n);return}p.ended=!1,console.assert(!p.updating,n+" sourceBuffer must not be updating"),p.appendBuffer(r)},d.blockBuffers=function(r,n){var t=this;if(n===void 0&&(n=this.getSourceBufferTypes()),!n.length){O.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var v=this.operationQueue,p=n.map(function(m){return v.appendBlocker(m)});Promise.all(p).then(function(){r(),n.forEach(function(m){var b=t.sourceBuffer[m];(!b||!b.updating)&&v.shiftAndExecuteNext(m)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(r,n,t){var v=this.sourceBuffer[r];if(!v)return;var p=t.bind(this,r);this.listeners[r].push({event:n,listener:p}),v.addEventListener(n,p)},d.removeBufferListeners=function(r){var n=this.sourceBuffer[r];if(!n)return;this.listeners[r].forEach(function(t){n.removeEventListener(t.event,t.listener)})},i}()},"./src/controller/buffer-operation-queue.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return S});var N=R("./src/utils/logger.ts"),S=function(){function O(j){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=j}var F=O.prototype;return F.append=function(e,w){var g=this.queues[w];g.push(e),g.length===1&&this.buffers[w]&&this.executeNext(w)},F.insertAbort=function(e,w){var g=this.queues[w];g.unshift(e),this.executeNext(w)},F.appendBlocker=function(e){var w,g=new Promise(function(u){w=u}),c={execute:w,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(c,e),g},F.executeNext=function(e){var w=this.buffers,g=this.queues,c=w[e],u=g[e];if(u.length){var a=u[0];try{a.execute()}catch(i){N.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(i),(!c||!c.updating)&&(u.shift(),this.executeNext(e))}}},F.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},F.current=function(e){return this.queues[e][0]},O}()},"./src/controller/cap-level-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts");function S(j,e){for(var w=0;w<e.length;w++){var g=e[w];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(j,g.key,g)}}function O(j,e,w){return e&&S(j.prototype,e),w&&S(j,w),j}var F=function(){function j(w){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=w,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=j.prototype;return e.setStreamController=function(g){this.streamController=g},e.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},e.registerListeners=function(){var g=this.hls;g.on(N.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var g=this.hls;g.off(N.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(N.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(g,c){j.isLevelAllowed(c.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(c.droppedLevel)},e.onMediaAttaching=function(g,c){this.media=c.media instanceof HTMLVideoElement?c.media:null},e.onManifestParsed=function(g,c){var u=this.hls;this.restrictedLevels=[],this.firstLevel=c.firstLevel,u.config.capLevelToPlayerSize&&c.video&&this.startCapping()},e.onBufferCodecs=function(g,c){var u=this.hls;u.config.capLevelToPlayerSize&&c.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var c=this.hls;c.autoLevelCapping=this.getMaxLevel(g.length-1),c.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=c.autoLevelCapping}}},e.getMaxLevel=function(g){var c=this,u=this.hls.levels;if(!u.length)return-1;var a=u.filter(function(i,d){return j.isLevelAllowed(d,c.restrictedLevels)&&d<=g});return this.clientRect=null,j.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},e.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},e.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},e.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,c={width:0,height:0};if(g){var u=g.getBoundingClientRect();c.width=u.width,c.height=u.height,!c.width&&!c.height&&(c.width=u.right-u.left||g.width||0,c.height=u.bottom-u.top||g.height||0)}return this.clientRect=c,c},j.isLevelAllowed=function(g,c){return c===void 0&&(c=[]),c.indexOf(g)===-1},j.getMaxLevelByMediaSize=function(g,c,u){if(!g||!g.length)return-1;for(var a=function(n,t){return t?n.width!==t.width||n.height!==t.height:!0},i=g.length-1,d=0;d<g.length;d+=1){var s=g[d];if((s.width>=c||s.height>=u)&&a(s,g[d+1])){i=d;break}}return i},O(j,[{key:"mediaWidth",get:function(){return this.getDimensions().width*j.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*j.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(c){}return g}}]),j}();W.default=F},"./src/controller/cmcd-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return a});var N=R("./src/events.ts"),S=R("./src/types/cmcd.ts"),O=R("./src/utils/buffer-helper.ts"),F=R("./src/utils/logger.ts");function j(i,d){for(var s=0;s<d.length;s++){var r=d[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,r.key,r)}}function e(i,d,s){return d&&j(i.prototype,d),s&&j(i,s),i}function w(i,d){var s=typeof Symbol!="undefined"&&i[Symbol.iterator]||i["@@iterator"];if(s)return(s=s.call(i)).next.bind(s);if(Array.isArray(i)||(s=g(i))||d&&i&&typeof i.length=="number"){s&&(i=s);var r=0;return function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g(i,d){if(!i)return;if(typeof i=="string")return c(i,d);var s=Object.prototype.toString.call(i).slice(8,-1);if(s==="Object"&&i.constructor&&(s=i.constructor.name),s==="Map"||s==="Set")return Array.from(i);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return c(i,d)}function c(i,d){(d==null||d>i.length)&&(d=i.length);for(var s=0,r=new Array(d);s<d;s++)r[s]=i[s];return r}function u(){return u=Object.assign||function(i){for(var d=1;d<arguments.length;d++){var s=arguments[d];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(i[r]=s[r])}return i},u.apply(this,arguments)}var a=function(){function i(s){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(v){try{r.apply(v,{ot:S.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(p){F.logger.warn("Could not generate manifest CMCD data.",p)}},this.applyFragmentData=function(v){try{var p=v.frag,m=r.hls.levels[p.level],b=r.getObjectType(p),_={d:p.duration*1e3,ot:b};(b===S.CMCDObjectType.VIDEO||b===S.CMCDObjectType.AUDIO||b==S.CMCDObjectType.MUXED)&&(_.br=m.bitrate/1e3,_.tb=r.getTopBandwidth(b),_.bl=r.getBufferLength(b)),r.apply(v,_)}catch(o){F.logger.warn("Could not generate segment CMCD data.",o)}},this.hls=s;var n=this.config=s.config,t=n.cmcd;t!=null&&(n.pLoader=this.createPlaylistLoader(),n.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||i.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var d=i.prototype;return d.registerListeners=function(){var r=this.hls;r.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(N.Events.BUFFER_CREATED,this.onBufferCreated,this)},d.unregisterListeners=function(){var r=this.hls;r.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(N.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},d.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},d.onMediaAttached=function(r,n){this.media=n.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},d.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},d.onBufferCreated=function(r,n){var t,v;this.audioBuffer=(t=n.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(v=n.tracks.video)===null||v===void 0?void 0:v.buffer},d.createData=function(){var r;return{v:S.CMCDVersion,sf:S.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},d.apply=function(r,n){n===void 0&&(n={}),u(n,this.createData());var t=n.ot===S.CMCDObjectType.INIT||n.ot===S.CMCDObjectType.VIDEO||n.ot===S.CMCDObjectType.MUXED;if(this.starved&&t&&(n.bs=!0,n.su=!0,this.starved=!1),n.su==null&&(n.su=this.buffering),this.useHeaders){var v=i.toHeaders(n);if(!Object.keys(v).length)return;r.headers||(r.headers={}),u(r.headers,v)}else{var p=i.toQuery(n);if(!p)return;r.url=i.appendQueryToUri(r.url,p)}},d.getObjectType=function(r){var n=r.type;return n==="subtitle"?S.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?S.CMCDObjectType.INIT:n==="audio"?S.CMCDObjectType.AUDIO:n==="main"?this.hls.audioTracks.length?S.CMCDObjectType.VIDEO:S.CMCDObjectType.MUXED:void 0},d.getTopBandwidth=function(r){for(var n=0,t=r===S.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=w(t),p;!(p=v()).done;){var m=p.value;m.bitrate>n&&(n=m.bitrate)}return n>0?n:NaN},d.getBufferLength=function(r){var n=this.hls.media,t=r===S.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!n)return NaN;var v=O.BufferHelper.bufferInfo(t,n.currentTime,this.config.maxBufferHole);return v.len*1e3},d.createPlaylistLoader=function(){var r=this.config.pLoader,n=this.applyPlaylistData,t=r||this.config.loader;return function(){function v(m){this.loader=void 0,this.loader=new t(m)}var p=v.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(b,_,o){n(b),this.loader.load(b,_,o)},e(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},d.createFragmentLoader=function(){var r=this.config.fLoader,n=this.applyFragmentData,t=r||this.config.loader;return function(){function v(m){this.loader=void 0,this.loader=new t(m)}var p=v.prototype;return p.destroy=function(){this.loader.destroy()},p.abort=function(){this.loader.abort()},p.load=function(b,_,o){n(b),this.loader.load(b,_,o)},e(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},i.uuid=function(){var r=URL.createObjectURL(new Blob),n=r.toString();return URL.revokeObjectURL(r),n.substr(n.lastIndexOf("/")+1)},i.serialize=function(r){for(var n=[],t=function(D){return!Number.isNaN(D)&&D!=null&&D!==""&&D!==!1},v=function(D){return Math.round(D)},p=function(D){return v(D/100)*100},m=function(D){return encodeURIComponent(D)},b={br:v,d:v,bl:p,dl:p,mtp:p,nor:m,rtp:p,tb:v},_=Object.keys(r||{}).sort(),o=w(_),f;!(f=o()).done;){var l=f.value,h=r[l];if(!t(h))continue;if(l==="v"&&h===1)continue;if(l=="pr"&&h===1)continue;var E=b[l];E&&(h=E(h));var y=typeof h,T=void 0;l==="ot"||l==="sf"||l==="st"?T=l+"="+h:y==="boolean"?T=l:y==="number"?T=l+"="+h:T=l+"="+JSON.stringify(h),n.push(T)}return n.join(",")},i.toHeaders=function(r){for(var n=Object.keys(r),t={},v=["Object","Request","Session","Status"],p=[{},{},{},{}],m={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},b=0,_=n;b<_.length;b++){var o=_[b],f=m[o]!=null?m[o]:1;p[f][o]=r[o]}for(var l=0;l<p.length;l++){var h=i.serialize(p[l]);h&&(t["CMCD-"+v[l]]=h)}return t},i.toQuery=function(r){return"CMCD="+encodeURIComponent(i.serialize(r))},i.appendQueryToUri=function(r,n){if(!n)return r;var t=r.includes("?")?"&":"?";return""+r+t+n},i}()},"./src/controller/eme-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),F=R("./src/utils/mediakeys-helper.ts");function j(a,i){for(var d=0;d<i.length;d++){var s=i[d];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,i,d){return i&&j(a.prototype,i),d&&j(a,d),a}var w=3,g=function(i,d,s){var r={audioCapabilities:[],videoCapabilities:[]};return i.forEach(function(n){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+n+'"',robustness:s.audioRobustness||""})}),d.forEach(function(n){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+n+'"',robustness:s.videoRobustness||""})}),[r]},c=function(i,d,s,r){switch(i){case F.KeySystems.WIDEVINE:return g(d,s,r);default:throw new Error("Unknown key-system: "+i)}},u=function(){function a(d){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=d,this._config=d.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var i=a.prototype;return i.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},i._registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i._unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(N.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i.getLicenseServerUrl=function(s){switch(s){case F.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},i._attemptKeySystemAccess=function(s,r,n){var t=this,v=c(s,r,n,this._drmSystemOptions);O.logger.log("Requesting encrypted media key-system access");var p=this.requestMediaKeySystemAccess(s,v);this.mediaKeysPromise=p.then(function(m){return t._onMediaKeySystemAccessObtained(s,m)}),p.catch(function(m){O.logger.error('Failed to obtain key-system "'+s+'" access:',m)})},i._onMediaKeySystemAccessObtained=function(s,r){var n=this;O.logger.log('Access for key-system "'+s+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:s};this._mediaKeysList.push(t);var v=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(p){return t.mediaKeys=p,O.logger.log('Media-keys created for key-system "'+s+'"'),n._onMediaKeysCreated(),p});return v.catch(function(p){O.logger.error("Failed to create media-keys:",p)}),v},i._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),s._onNewMediaKeySession(r.mediaKeysSession))})},i._onNewMediaKeySession=function(s){var r=this;O.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(n){r._onKeySessionMessage(s,n.message)},!1)},i._onKeySessionMessage=function(s,r){O.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(n){O.logger.log("Received license data (length: "+(n&&n.byteLength)+"), updating key-session"),s.update(n)})},i.onMediaEncrypted=function(s){var r=this;if(O.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var n=function(v){if(!r._media)return;r._attemptSetMediaKeys(v),r._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(n).catch(n)},i._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){O.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}O.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},i._generateRequestWithPreferredKeySession=function(s,r){var n=this,t=this._mediaKeysList[0];if(!t){O.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){O.logger.warn("Key-Session already initialized but requested again");return}var v=t.mediaKeysSession;if(!v){O.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){O.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}O.logger.log('Generating key-session request for "'+s+'" init data type'),t.mediaKeysSessionInitialized=!0,v.generateRequest(s,r).then(function(){O.logger.debug("Key-session generation succeeded")}).catch(function(p){O.logger.error("Error generating key-session request:",p),n.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},i._createLicenseXhr=function(s,r,n){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,s,r,n);var v=this._licenseXhrSetup;if(v)try{v.call(this.hls,t,s),v=void 0}catch(p){O.logger.error(p)}try{t.readyState||t.open("POST",s,!0),v&&v.call(this.hls,t,s)}catch(p){throw new Error("issue setting up KeySystem license XHR "+p)}return t},i._onLicenseRequestReadyStageChange=function(s,r,n,t){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,O.logger.log("License request succeeded");var v=s.response,p=this._licenseResponseCallback;if(p)try{v=p.call(this.hls,s,r)}catch(b){O.logger.error(b)}t(v)}else{if(O.logger.error("License Request XHR failed ("+r+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>w){this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=w-this._requestLicenseFailureCount+1;O.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(n,t)}break}},i._generateLicenseRequestChallenge=function(s,r){switch(s.mediaKeySystemDomain){case F.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},i._requestLicense=function(s,r){O.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n){O.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(n.mediaKeySystemDomain),v=this._createLicenseXhr(t,s,r);O.logger.log("Sending license request to URL: "+t);var p=this._generateLicenseRequestChallenge(n,s);v.send(p)}catch(m){O.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.KEY_SYSTEM_ERROR,details:S.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},i.onMediaAttached=function(s,r){if(!this._emeEnabled)return;var n=r.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)},i.onMediaDetached=function(){var s=this._media,r=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(n){if(n.mediaKeysSession)return n.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},i.onManifestParsed=function(s,r){if(!this._emeEnabled)return;var n=r.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),t=r.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(F.KeySystems.WIDEVINE,n,t)},e(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();W.default=u},"./src/controller/fps-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/utils/logger.ts"),O=function(){function F(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}var j=F.prototype;return j.setStreamController=function(w){this.streamController=w},j.registerListeners=function(){this.hls.on(N.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},j.unregisterListeners=function(){this.hls.off(N.Events.MEDIA_ATTACHING,this.onMediaAttaching)},j.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},j.onMediaAttaching=function(w,g){var c=this.hls.config;if(c.capLevelOnFPSDrop){var u=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=u,u&&typeof u.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),c.fpsDroppedMonitoringPeriod)}},j.checkFPS=function(w,g,c){var u=performance.now();if(g){if(this.lastTime){var a=u-this.lastTime,i=c-this.lastDroppedFrames,d=g-this.lastDecodedFrames,s=1e3*i/a,r=this.hls;if(r.trigger(N.Events.FPS_DROP,{currentDropped:i,currentDecoded:d,totalDroppedFrames:c}),s>0&&i>r.config.fpsDroppedMonitoringThreshold*d){var n=r.currentLevel;S.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+n),n>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=n)&&(n=n-1,r.trigger(N.Events.FPS_DROP_LEVEL_CAPPING,{level:n,droppedLevel:r.currentLevel}),r.autoLevelCapping=n,this.streamController.nextLevelSwitch())}}this.lastTime=u,this.lastDroppedFrames=c,this.lastDecodedFrames=g}},j.checkFPSInterval=function(){var w=this.media;if(w)if(this.isVideoPlaybackQualityAvailable){var g=w.getVideoPlaybackQuality();this.checkFPS(w,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(w,w.webkitDecodedFrameCount,w.webkitDroppedFrameCount)},F}();W.default=O},"./src/controller/fragment-finders.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"findFragmentByPDT",function(){return O}),R.d(W,"findFragmentByPTS",function(){return F}),R.d(W,"fragmentWithinToleranceTest",function(){return j}),R.d(W,"pdtWithinToleranceTest",function(){return e}),R.d(W,"findFragWithCC",function(){return w});var N=R("./src/polyfills/number.ts"),S=R("./src/utils/binary-search.ts");function O(g,c,u){if(c===null||!Array.isArray(g)||!g.length||!Object(N.isFiniteNumber)(c))return null;var a=g[0].programDateTime;if(c<(a||0))return null;var i=g[g.length-1].endProgramDateTime;if(c>=(i||0))return null;u=u||0;for(var d=0;d<g.length;++d){var s=g[d];if(e(c,u,s))return s}return null}function F(g,c,u,a){u===void 0&&(u=0),a===void 0&&(a=0);var i=null;if(g?i=c[g.sn-c[0].sn+1]||null:u===0&&c[0].start===0&&(i=c[0]),i&&j(u,a,i)===0)return i;var d=S.default.search(c,j.bind(null,u,a));return d||i}function j(g,c,u){g===void 0&&(g=0),c===void 0&&(c=0);var a=Math.min(c,u.duration+(u.deltaPTS?u.deltaPTS:0));return u.start+u.duration-a<=g?1:u.start-a>g&&u.start?-1:0}function e(g,c,u){var a=Math.min(c,u.duration+(u.deltaPTS?u.deltaPTS:0))*1e3,i=u.endProgramDateTime||0;return i-a>g}function w(g,c){return S.default.search(g,function(u){return u.cc<c?1:u.cc>c?-1:0})}},"./src/controller/fragment-tracker.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"FragmentState",function(){return O}),R.d(W,"FragmentTracker",function(){return F});var N=R("./src/events.ts"),S=R("./src/types/loader.ts"),O;(function(w){w.NOT_LOADED="NOT_LOADED",w.BACKTRACKED="BACKTRACKED",w.APPENDING="APPENDING",w.PARTIAL="PARTIAL",w.OK="OK"})(O||(O={}));var F=function(){function w(c){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=c,this._registerListeners()}var g=w.prototype;return g._registerListeners=function(){var u=this.hls;u.on(N.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(N.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var u=this.hls;u.off(N.Events.BUFFER_APPENDED,this.onBufferAppended,this),u.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(N.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(u,a){if(a===S.PlaylistLevelType.MAIN){var i=this.activeFragment,d=this.activeParts;if(!i)return null;if(d)for(var s=d.length;s--;){var r=d[s],n=r?r.end:i.appendedPTS;if(r.start<=u&&n!==void 0&&u<=n)return s>9&&(this.activeParts=d.slice(s-9)),r}else if(i.start<=u&&i.appendedPTS!==void 0&&u<=i.appendedPTS)return i}return this.getBufferedFrag(u,a)},g.getBufferedFrag=function(u,a){for(var i=this.fragments,d=Object.keys(i),s=d.length;s--;){var r=i[d[s]];if((r==null?void 0:r.body.type)===a&&r.buffered){var n=r.body;if(n.start<=u&&u<=n.end)return n}}return null},g.detectEvictedFragments=function(u,a,i){var d=this;Object.keys(this.fragments).forEach(function(s){var r=d.fragments[s];if(!r)return;if(!r.buffered){r.body.type===i&&d.removeFragment(r.body);return}var n=r.range[u];if(!n)return;n.time.some(function(t){var v=!d.isTimeBuffered(t.startPTS,t.endPTS,a);return v&&d.removeFragment(r.body),v})})},g.detectPartialFragments=function(u){var a=this,i=this.timeRanges,d=u.frag,s=u.part;if(!i||d.sn==="initSegment")return;var r=e(d),n=this.fragments[r];if(!n)return;Object.keys(i).forEach(function(t){var v=d.elementaryStreams[t];if(!v)return;var p=i[t],m=s!==null||v.partial===!0;n.range[t]=a.getBufferedTimes(d,s,m,p)}),n.backtrack=n.loaded=null,Object.keys(n.range).length?n.buffered=!0:this.removeFragment(n.body)},g.fragBuffered=function(u){var a=e(u),i=this.fragments[a];i&&(i.backtrack=i.loaded=null,i.buffered=!0)},g.getBufferedTimes=function(u,a,i,d){for(var s={time:[],partial:i},r=a?a.start:u.start,n=a?a.end:u.end,t=u.minEndPTS||n,v=u.maxStartPTS||r,p=0;p<d.length;p++){var m=d.start(p)-this.bufferPadding,b=d.end(p)+this.bufferPadding;if(v>=m&&t<=b){s.time.push({startPTS:Math.max(r,d.start(p)),endPTS:Math.min(n,d.end(p))});break}else if(r<b&&n>m)s.partial=!0,s.time.push({startPTS:Math.max(r,d.start(p)),endPTS:Math.min(n,d.end(p))});else if(n<=m)break}return s},g.getPartialFragment=function(u){var a=null,i,d,s,r=0,n=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(v){var p=t[v];if(!p)return;j(p)&&(d=p.body.start-n,s=p.body.end+n,u>=d&&u<=s&&(i=Math.min(u-d,s-u),r<=i&&(a=p.body,r=i)))}),a},g.getState=function(u){var a=e(u),i=this.fragments[a];return i?i.buffered?j(i)?O.PARTIAL:O.OK:i.backtrack?O.BACKTRACKED:O.APPENDING:O.NOT_LOADED},g.backtrack=function(u,a){var i=e(u),d=this.fragments[i];if(!d||d.backtrack)return null;var s=d.backtrack=a||d.loaded;return d.loaded=null,s},g.getBacktrackData=function(u){var a=e(u),i=this.fragments[a];if(i){var d,s=i.backtrack;if(s!=null&&(d=s.payload)!==null&&d!==void 0&&d.byteLength)return s;this.removeFragment(u)}return null},g.isTimeBuffered=function(u,a,i){for(var d,s,r=0;r<i.length;r++){if(d=i.start(r)-this.bufferPadding,s=i.end(r)+this.bufferPadding,u>=d&&a<=s)return!0;if(a<=d)return!1}return!1},g.onFragLoaded=function(u,a){var i=a.frag,d=a.part;if(i.sn==="initSegment"||i.bitrateTest||d)return;var s=e(i);this.fragments[s]={body:i,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(u,a){var i=this,d=a.frag,s=a.part,r=a.timeRanges;if(d.type===S.PlaylistLevelType.MAIN)if(this.activeFragment=d,s){var n=this.activeParts;n||(this.activeParts=n=[]),n.push(s)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(t){var v=r[t];if(i.detectEvictedFragments(t,v),!s)for(var p=0;p<v.length;p++)d.appendedPTS=Math.max(v.end(p),d.appendedPTS||0)})},g.onFragBuffered=function(u,a){this.detectPartialFragments(a)},g.hasFragment=function(u){var a=e(u);return!!this.fragments[a]},g.removeFragmentsInRange=function(u,a,i){var d=this;Object.keys(this.fragments).forEach(function(s){var r=d.fragments[s];if(!r)return;if(r.buffered){var n=r.body;n.type===i&&n.start<a&&n.end>u&&d.removeFragment(n)}})},g.removeFragment=function(u){var a=e(u);u.stats.loaded=0,u.clearElementaryStreamInfo(),delete this.fragments[a]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},w}();function j(w){var g,c;return w.buffered&&(((g=w.range.video)===null||g===void 0?void 0:g.partial)||((c=w.range.audio)===null||c===void 0?void 0:c.partial))}function e(w){return w.type+"_"+w.level+"_"+w.urlId+"_"+w.sn}},"./src/controller/gap-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"STALL_MINIMUM_DURATION_MS",function(){return j}),R.d(W,"MAX_START_GAP_JUMP",function(){return e}),R.d(W,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return w}),R.d(W,"SKIP_BUFFER_RANGE_START",function(){return g}),R.d(W,"default",function(){return c});var N=R("./src/utils/buffer-helper.ts"),S=R("./src/errors.ts"),O=R("./src/events.ts"),F=R("./src/utils/logger.ts"),j=250,e=2,w=.1,g=.05,c=function(){function u(i,d,s,r){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=i,this.media=d,this.fragmentTracker=s,this.hls=r}var a=u.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(d){var s=this.config,r=this.media,n=this.stalled,t=r.currentTime,v=r.seeking,p=this.seeking&&!v,m=!this.seeking&&v;if(this.seeking=v,t!==d){if(this.moved=!0,n!==null){if(this.stallReported){var b=self.performance.now()-n;F.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(b)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||p)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!N.BufferHelper.getBuffered(r).length)return;var _=N.BufferHelper.bufferInfo(r,t,0),o=_.len>0,f=_.nextStart||0;if(!o&&!f)return;if(v){var l=_.len>e,h=!f||f-t>e&&!this.fragmentTracker.getPartialFragment(t);if(l||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,y=Math.max(f,_.start||0)-t,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,L=T==null||((E=T.details)===null||E===void 0)?void 0:E.live,D=L?T.details.targetduration*2:e;if(y>0&&y<=D){this._trySkipBufferHole(null);return}}var x=self.performance.now();if(n===null){this.stalled=x;return}var P=x-n;!v&&P>=j&&this._reportStall(_.len);var H=N.BufferHelper.bufferInfo(r,t,s.maxBufferHole);this._tryFixBufferStall(H,P)},a._tryFixBufferStall=function(d,s){var r=this.config,n=this.fragmentTracker,t=this.media,v=t.currentTime,p=n.getPartialFragment(v);if(p){var m=this._trySkipBufferHole(p);if(m)return}d.len>r.maxBufferHole&&s>r.highBufferWatchdogPeriod*1e3&&(F.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(d){var s=this.hls,r=this.media,n=this.stallReported;n||(this.stallReported=!0,F.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+d+")"),s.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},a._trySkipBufferHole=function(d){for(var s=this.config,r=this.hls,n=this.media,t=n.currentTime,v=0,p=N.BufferHelper.getBuffered(n),m=0;m<p.length;m++){var b=p.start(m);if(t+s.maxBufferHole>=v&&t<b){var _=Math.max(b+g,n.currentTime+w);return F.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+_),this.moved=!0,this.stalled=null,n.currentTime=_,d&&r.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+_,frag:d}),_}v=p.end(m)}return 0},a._tryNudgeBuffer=function(){var d=this.config,s=this.hls,r=this.media,n=r.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<d.nudgeMaxRetry){var v=n+t*d.nudgeOffset;F.logger.warn("Nudging 'currentTime' from "+n+" to "+v),r.currentTime=v,s.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else F.logger.error("Playhead still not moving while enough data buffered @"+n+" after "+d.nudgeMaxRetry+" nudges"),s.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},u}()},"./src/controller/id3-track-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/utils/texttrack-utils.ts"),O=R("./src/demux/id3.ts"),F=.25,j=function(){function e(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var w=e.prototype;return w.destroy=function(){this._unregisterListeners()},w._registerListeners=function(){var c=this.hls;c.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(N.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var c=this.hls;c.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(N.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.onMediaAttached=function(c,u){this.media=u.media},w.onMediaDetaching=function(){if(!this.id3Track)return;Object(S.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},w.getID3Track=function(c){if(!this.media)return;for(var u=0;u<c.length;u++){var a=c[u];if(a.kind==="metadata"&&a.label==="id3")return Object(S.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},w.onFragParsingMetadata=function(c,u){if(!this.media)return;var a=u.frag,i=u.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<i.length;s++){var r=O.getID3Frames(i[s].data);if(r){var n=i[s].pts,t=s<i.length-1?i[s+1].pts:a.end,v=t-n;v<=0&&(t=n+F);for(var p=0;p<r.length;p++){var m=r[p];if(!O.isTimeStampFrame(m)){var b=new d(n,t,"");b.value=m,this.id3Track.addCue(b)}}}}},w.onBufferFlushing=function(c,u){var a=u.startOffset,i=u.endOffset,d=u.type;if(!d||d==="audio"){var s=this.id3Track;s&&Object(S.removeCuesInRange)(s,a,i)}},e}();W.default=j},"./src/controller/latency-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return e});var N=R("./src/errors.ts"),S=R("./src/events.ts"),O=R("./src/utils/logger.ts");function F(w,g){for(var c=0;c<g.length;c++){var u=g[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(w,u.key,u)}}function j(w,g,c){return g&&F(w.prototype,g),c&&F(w,c),w}var e=function(){function w(c){var u=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return u.timeupdate()},this.hls=c,this.config=c.config,this.registerListeners()}var g=w.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(S.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(S.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(S.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(S.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(S.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(S.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(S.Events.ERROR,this.onError)},g.onMediaAttached=function(u,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(u,a){var i=a.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(u,a){if(a.details!==N.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,O.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var u=this.media,a=this.levelDetails;if(!u||!a)return;this.currentTime=u.currentTime;var i=this.computeLatency();if(i===null)return;this._latency=i;var d=this.config,s=d.lowLatencyMode,r=d.maxLiveSyncPlaybackRate;if(!s||r===1)return;var n=this.targetLatency;if(n===null)return;var t=i-n,v=Math.min(this.maxLatency,n+a.targetduration),p=t<v;if(a.live&&p&&t>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,r)),b=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;u.playbackRate=Math.min(m,Math.max(1,b))}else u.playbackRate!==1&&u.playbackRate!==0&&(u.playbackRate=1)},g.estimateLiveEdge=function(){var u=this.levelDetails;return u===null?null:u.edge+u.age},g.computeLatency=function(){var u=this.estimateLiveEdge();return u===null?null:u-this.currentTime},j(w,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var u=this.config,a=this.levelDetails;return u.liveMaxLatencyDuration!==void 0?u.liveMaxLatencyDuration:a?u.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var u=this.levelDetails;if(u===null)return null;var a=u.holdBack,i=u.partHoldBack,d=u.targetduration,s=this.config,r=s.liveSyncDuration,n=s.liveSyncDurationCount,t=s.lowLatencyMode,v=this.hls.userConfig,p=t&&i||a;(v.liveSyncDuration||v.liveSyncDurationCount||p===0)&&(p=r!==void 0?r:n*d);var m=d,b=1;return p+Math.min(this.stallCount*b,m)}},{key:"liveSyncPosition",get:function(){var u=this.estimateLiveEdge(),a=this.targetLatency,i=this.levelDetails;if(u===null||a===null||i===null)return null;var d=i.edge,s=u-a-this.edgeStalled,r=d-i.totalduration,n=d-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(r,s),n)}},{key:"drift",get:function(){var u=this.levelDetails;return u===null?1:u.drift}},{key:"edgeStalled",get:function(){var u=this.levelDetails;if(u===null)return 0;var a=(this.config.lowLatencyMode&&u.partTarget||u.targetduration)*3;return Math.max(u.age-a,0)}},{key:"forwardBufferLength",get:function(){var u=this.media,a=this.levelDetails;if(!u||!a)return 0;var i=u.buffered.length;return i?u.buffered.end(i-1):a.edge-this.currentTime}}]),w}()},"./src/controller/level-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return s});var N=R("./src/types/level.ts"),S=R("./src/events.ts"),O=R("./src/errors.ts"),F=R("./src/utils/codecs.ts"),j=R("./src/controller/level-helper.ts"),e=R("./src/controller/base-playlist-controller.ts"),w=R("./src/types/loader.ts");function g(){return g=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(r[v]=t[v])}return r},g.apply(this,arguments)}function c(r,n){for(var t=0;t<n.length;t++){var v=n[t];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(r,v.key,v)}}function u(r,n,t){return n&&c(r.prototype,n),t&&c(r,t),r}function a(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,i(r,n)}function i(r,n){return i=Object.setPrototypeOf||function(v,p){return v.__proto__=p,v},i(r,n)}var d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(r){a(n,r);function n(v){var p;return p=r.call(this,v,"[level-controller]")||this,p._levels=[],p._firstLevel=-1,p._startLevel=void 0,p.currentLevelIndex=-1,p.manualLevelIndex=-1,p.onParsedComplete=void 0,p._registerListeners(),p}var t=n.prototype;return t._registerListeners=function(){var p=this.hls;p.on(S.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.on(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.on(S.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.on(S.Events.FRAG_LOADED,this.onFragLoaded,this),p.on(S.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var p=this.hls;p.off(S.Events.MANIFEST_LOADED,this.onManifestLoaded,this),p.off(S.Events.LEVEL_LOADED,this.onLevelLoaded,this),p.off(S.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),p.off(S.Events.FRAG_LOADED,this.onFragLoaded,this),p.off(S.Events.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},t.startLoad=function(){var p=this._levels;p.forEach(function(m){m.loadError=0}),r.prototype.startLoad.call(this)},t.onManifestLoaded=function(p,m){var b=[],_=[],o=[],f,l={},h,E=!1,y=!1,T=!1;if(m.levels.forEach(function(P){var H=P.attrs;E=E||!!(P.width&&P.height),y=y||!!P.videoCodec,T=T||!!P.audioCodec,d&&P.audioCodec&&P.audioCodec.indexOf("mp4a.40.34")!==-1&&(P.audioCodec=void 0);var I=P.bitrate+"-"+P.attrs.RESOLUTION+"-"+P.attrs.CODECS;h=l[I],h?h.url.push(P.url):(h=new N.Level(P),l[I]=h,b.push(h)),H&&(H.AUDIO&&Object(j.addGroupId)(h,"audio",H.AUDIO),H.SUBTITLES&&Object(j.addGroupId)(h,"text",H.SUBTITLES))}),(E||y)&&T&&(b=b.filter(function(P){var H=P.videoCodec,I=P.width,z=P.height;return!!H||!!(I&&z)})),b=b.filter(function(P){var H=P.audioCodec,I=P.videoCodec;return(!H||Object(F.isCodecSupportedInMp4)(H,"audio"))&&(!I||Object(F.isCodecSupportedInMp4)(I,"video"))}),m.audioTracks&&(_=m.audioTracks.filter(function(P){return!P.audioCodec||Object(F.isCodecSupportedInMp4)(P.audioCodec,"audio")}),Object(j.assignTrackIdsByGroup)(_)),m.subtitles&&(o=m.subtitles,Object(j.assignTrackIdsByGroup)(o)),b.length>0){f=b[0].bitrate,b.sort(function(P,H){return P.bitrate-H.bitrate}),this._levels=b;for(var L=0;L<b.length;L++)if(b[L].bitrate===f){this._firstLevel=L,this.log("manifest loaded, "+b.length+" level(s) found, first bitrate: "+f);break}var D=T&&!y,x={levels:b,audioTracks:_,subtitleTracks:o,firstLevel:this._firstLevel,stats:m.stats,audio:T,video:y,altAudio:!D&&_.some(function(P){return!!P.url})};this.hls.trigger(S.Events.MANIFEST_PARSED,x),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(S.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:m.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(p,m){if(r.prototype.onError.call(this,p,m),m.fatal)return;var b=m.context,_=this._levels[this.currentLevelIndex];if(b&&(b.type===w.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&b.groupId===_.audioGroupIds[_.urlId]||b.type===w.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&b.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var o=!1,f=!0,l;switch(m.details){case O.ErrorDetails.FRAG_LOAD_ERROR:case O.ErrorDetails.FRAG_LOAD_TIMEOUT:case O.ErrorDetails.KEY_LOAD_ERROR:case O.ErrorDetails.KEY_LOAD_TIMEOUT:if(m.frag){var h=this._levels[m.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(l=m.frag.level)):l=m.frag.level}break;case O.ErrorDetails.LEVEL_LOAD_ERROR:case O.ErrorDetails.LEVEL_LOAD_TIMEOUT:b&&(b.deliveryDirectives&&(f=!1),l=b.level),o=!0;break;case O.ErrorDetails.REMUX_ALLOC_ERROR:l=m.level,o=!0;break}l!==void 0&&this.recoverLevel(m,l,o,f)},t.recoverLevel=function(p,m,b,_){var o=p.details,f=this._levels[m];if(f.loadError++,b){var l=this.retryLoadingOrFail(p);if(l)p.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var h=f.url.length;if(h>1&&f.loadError<h)p.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var E=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(o+": switch to "+E),p.levelRetry=!0,this.hls.nextAutoLevel=E)}}},t.redundantFailover=function(p){var m=this._levels[p],b=m.url.length;if(b>1){var _=(m.urlId+1)%b;this.warn("Switching to redundant URL-id "+_),this._levels.forEach(function(o){o.urlId=_}),this.level=p}},t.onFragLoaded=function(p,m){var b=m.frag;if(b!==void 0&&b.type===w.PlaylistLevelType.MAIN){var _=this._levels[b.level];_!==void 0&&(_.fragmentError=0,_.loadError=0)}},t.onLevelLoaded=function(p,m){var b,_=m.level,o=m.details,f=this._levels[_];if(!f){var l;this.warn("Invalid level index "+_),(l=m.deliveryDirectives)!==null&&l!==void 0&&l.skip&&(o.deltaUpdateFailed=!0);return}_===this.currentLevelIndex?(f.fragmentError===0&&(f.loadError=0,this.retryCount=0),this.playlistLoaded(_,m,f.details)):(b=m.deliveryDirectives)!==null&&b!==void 0&&b.skip&&(o.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(p,m){var b=this.hls.levels[this.currentLevelIndex];if(!b)return;if(b.audioGroupIds){for(var _=-1,o=this.hls.audioTracks[m.id].groupId,f=0;f<b.audioGroupIds.length;f++)if(b.audioGroupIds[f]===o){_=f;break}_!==b.urlId&&(b.urlId=_,this.startLoad())}},t.loadPlaylist=function(p){var m=this.currentLevelIndex,b=this._levels[m];if(this.canLoad&&b&&b.url.length>0){var _=b.urlId,o=b.url[_];if(p)try{o=p.addDirectives(o)}catch(f){this.warn("Could not construct new URL with HLS Delivery Directives: "+f)}this.log("Attempt loading level index "+m+(p?" at sn "+p.msn+" part "+p.part:"")+" with URL-id "+_+" "+o),this.clearTimer(),this.hls.trigger(S.Events.LEVEL_LOADING,{url:o,level:m,id:_,deliveryDirectives:p||null})}},t.removeLevel=function(p,m){var b=function(f,l){return l!==m},_=this._levels.filter(function(o,f){return f!==p?!0:o.url.length>1&&m!==void 0?(o.url=o.url.filter(b),o.audioGroupIds&&(o.audioGroupIds=o.audioGroupIds.filter(b)),o.textGroupIds&&(o.textGroupIds=o.textGroupIds.filter(b)),o.urlId=0,!0):!1}).map(function(o,f){var l=o.details;return l!=null&&l.fragments&&l.fragments.forEach(function(h){h.level=f}),o});this._levels=_,this.hls.trigger(S.Events.LEVELS_UPDATED,{levels:_})},u(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(p){var m,b=this._levels;if(b.length===0)return;if(this.currentLevelIndex===p&&(m=b[p])!==null&&m!==void 0&&m.details)return;if(p<0||p>=b.length){var _=p<0;if(this.hls.trigger(S.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.LEVEL_SWITCH_ERROR,level:p,fatal:_,reason:"invalid level idx"}),_)return;p=Math.min(p,b.length-1)}this.clearTimer();var o=this.currentLevelIndex,f=b[o],l=b[p];this.log("switching to level "+p+" from "+o),this.currentLevelIndex=p;var h=g({},l,{level:p,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete h._urlId,this.hls.trigger(S.Events.LEVEL_SWITCHING,h);var E=l.details;if(!E||E.live){var y=this.switchParams(l.uri,f==null?void 0:f.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(p){this.manualLevelIndex=p,this._startLevel===void 0&&(this._startLevel=p),p!==-1&&(this.level=p)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(p){this._firstLevel=p}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var p=this.hls.config.startLevel;return p!==void 0?p:this._firstLevel}else return this._startLevel},set:function(p){this._startLevel=p}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(p){this.level=p,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=p)}}]),n}(e.default)},"./src/controller/level-helper.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"addGroupId",function(){return O}),R.d(W,"assignTrackIdsByGroup",function(){return F}),R.d(W,"updatePTS",function(){return j}),R.d(W,"updateFragPTSDTS",function(){return w}),R.d(W,"mergeDetails",function(){return g}),R.d(W,"mapPartIntersection",function(){return c}),R.d(W,"mapFragmentIntersection",function(){return u}),R.d(W,"adjustSliding",function(){return a}),R.d(W,"addSliding",function(){return i}),R.d(W,"computeReloadInterval",function(){return d}),R.d(W,"getFragmentWithSN",function(){return s}),R.d(W,"getPartWith",function(){return r});var N=R("./src/polyfills/number.ts"),S=R("./src/utils/logger.ts");function O(n,t,v){switch(t){case"audio":n.audioGroupIds||(n.audioGroupIds=[]),n.audioGroupIds.push(v);break;case"text":n.textGroupIds||(n.textGroupIds=[]),n.textGroupIds.push(v);break}}function F(n){var t={};n.forEach(function(v){var p=v.groupId||"";v.id=t[p]=t[p]||0,t[p]++})}function j(n,t,v){var p=n[t],m=n[v];e(p,m)}function e(n,t){var v=t.startPTS;if(Object(N.isFiniteNumber)(v)){var p=0,m;t.sn>n.sn?(p=v-n.start,m=n):(p=n.start-v,m=t),m.duration!==p&&(m.duration=p)}else if(t.sn>n.sn){var b=n.cc===t.cc;b&&n.minEndPTS?t.start=n.start+(n.minEndPTS-n.start):t.start=n.start+n.duration}else t.start=Math.max(n.start-t.duration,0)}function w(n,t,v,p,m,b){var _=p-v;_<=0&&(S.logger.warn("Fragment should have a positive duration",t),p=v+t.duration,b=m+t.duration);var o=v,f=p,l=t.startPTS,h=t.endPTS;if(Object(N.isFiniteNumber)(l)){var E=Math.abs(l-v);Object(N.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(E,t.deltaPTS):t.deltaPTS=E,o=Math.max(v,l),v=Math.min(v,l),m=Math.min(m,t.startDTS),f=Math.min(p,h),p=Math.max(p,h),b=Math.max(b,t.endDTS)}t.duration=p-v;var y=v-t.start;t.appendedPTS=p,t.start=t.startPTS=v,t.maxStartPTS=o,t.startDTS=m,t.endPTS=p,t.minEndPTS=f,t.endDTS=b;var T=t.sn;if(!n||T<n.startSN||T>n.endSN)return 0;var L,D=T-n.startSN,x=n.fragments;for(x[D]=t,L=D;L>0;L--)e(x[L],x[L-1]);for(L=D;L<x.length-1;L++)e(x[L],x[L+1]);return n.fragmentHint&&e(x[x.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,y}function g(n,t){for(var v=null,p=n.fragments,m=p.length-1;m>=0;m--){var b=p[m].initSegment;if(b){v=b;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;var _=0,o;if(u(n,t,function(L,D){L.relurl&&(_=L.cc-D.cc),Object(N.isFiniteNumber)(L.startPTS)&&Object(N.isFiniteNumber)(L.endPTS)&&(D.start=D.startPTS=L.startPTS,D.startDTS=L.startDTS,D.appendedPTS=L.appendedPTS,D.maxStartPTS=L.maxStartPTS,D.endPTS=L.endPTS,D.endDTS=L.endDTS,D.minEndPTS=L.minEndPTS,D.duration=L.endPTS-L.startPTS,D.duration&&(o=D),t.PTSKnown=t.alignedSliding=!0),D.elementaryStreams=L.elementaryStreams,D.loader=L.loader,D.stats=L.stats,D.urlId=L.urlId,L.initSegment&&(D.initSegment=L.initSegment,v=L.initSegment)}),v){var f=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;f.forEach(function(L){var D;(!L.initSegment||L.initSegment.relurl===((D=v)===null||D===void 0?void 0:D.relurl))&&(L.initSegment=v)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(L){return!L}),t.deltaUpdateFailed)){S.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var l=t.skippedSegments;l--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var h=t.fragments;if(_){S.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<h.length;E++)h[E].cc+=_}t.skippedSegments&&(t.startCC=t.fragments[0].cc),c(n.partList,t.partList,function(L,D){D.elementaryStreams=L.elementaryStreams,D.stats=L.stats}),o?w(t,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS):a(n,t),h.length&&(t.totalduration=t.edge-h[0].start),t.driftStartTime=n.driftStartTime,t.driftStart=n.driftStart;var y=t.advancedDateTime;if(t.advanced&&y){var T=t.edge;t.driftStart||(t.driftStartTime=y,t.driftStart=T),t.driftEndTime=y,t.driftEnd=T}else t.driftEndTime=n.driftEndTime,t.driftEnd=n.driftEnd,t.advancedDateTime=n.advancedDateTime}function c(n,t,v){if(n&&t)for(var p=0,m=0,b=n.length;m<=b;m++){var _=n[m],o=t[m+p];_&&o&&_.index===o.index&&_.fragment.sn===o.fragment.sn?v(_,o):p--}}function u(n,t,v){for(var p=t.skippedSegments,m=Math.max(n.startSN,t.startSN)-t.startSN,b=(n.fragmentHint?1:0)+(p?t.endSN:Math.min(n.endSN,t.endSN))-t.startSN,_=t.startSN-n.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,f=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,l=m;l<=b;l++){var h=f[_+l],E=o[l];p&&!E&&l<p&&(E=t.fragments[l]=h),h&&E&&v(h,E)}}function a(n,t){var v=t.startSN+t.skippedSegments-n.startSN,p=n.fragments;if(v<0||v>=p.length)return;i(t,p[v].start)}function i(n,t){if(t){for(var v=n.fragments,p=n.skippedSegments;p<v.length;p++)v[p].start+=t;n.fragmentHint&&(n.fragmentHint.start+=t)}}function d(n,t){var v=1e3*n.levelTargetDuration,p=v/2,m=n.age,b=m>0&&m<v*3,_=t.loading.end-t.loading.start,o,f=n.availabilityDelay;if(n.updated===!1)if(b){var l=333*n.misses;o=Math.max(Math.min(p,_*2),l),n.availabilityDelay=(n.availabilityDelay||0)+o}else o=p;else b?(f=Math.min(f||v/2,m),n.availabilityDelay=f,o=f+v-m):o=v-_;return Math.round(o)}function s(n,t,v){if(!n||!n.details)return null;var p=n.details,m=p.fragments[t-p.startSN];return m||(m=p.fragmentHint,m&&m.sn===t?m:t<p.startSN&&v&&v.sn===t?v:null)}function r(n,t,v){if(!n||!n.details)return null;var p=n.details.partList;if(p)for(var m=p.length;m--;){var b=p[m];if(b.index===v&&b.fragment.sn===t)return b}return null}},"./src/controller/stream-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return p});var N=R("./src/polyfills/number.ts"),S=R("./src/controller/base-stream-controller.ts"),O=R("./src/is-supported.ts"),F=R("./src/events.ts"),j=R("./src/utils/buffer-helper.ts"),e=R("./src/controller/fragment-tracker.ts"),w=R("./src/types/loader.ts"),g=R("./src/loader/fragment.ts"),c=R("./src/demux/transmuxer-interface.ts"),u=R("./src/types/transmuxer.ts"),a=R("./src/controller/gap-controller.ts"),i=R("./src/errors.ts"),d=R("./src/utils/logger.ts");function s(m,b){for(var _=0;_<b.length;_++){var o=b[_];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}function r(m,b,_){return b&&s(m.prototype,b),_&&s(m,_),m}function n(m,b){m.prototype=Object.create(b.prototype),m.prototype.constructor=m,t(m,b)}function t(m,b){return t=Object.setPrototypeOf||function(o,f){return o.__proto__=f,o},t(m,b)}var v=100,p=function(m){n(b,m);function b(o,f){var l;return l=m.call(this,o,f,"[stream-controller]")||this,l.audioCodecSwap=!1,l.gapController=null,l.level=-1,l._forceStartLoad=!1,l.altAudio=!1,l.audioOnly=!1,l.fragPlaying=null,l.onvplaying=null,l.onvseeked=null,l.fragLastKbps=0,l.stalled=!1,l.couldBacktrack=!1,l.audioCodecSwitch=!1,l.videoBuffer=null,l._registerListeners(),l}var _=b.prototype;return _._registerListeners=function(){var f=this.hls;f.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),f.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.on(F.Events.ERROR,this.onError,this),f.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var f=this.hls;f.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),f.off(F.Events.ERROR,this.onError,this),f.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(F.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),f.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(F.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),f.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(f){if(this.levels){var l=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=h.startLevel;E===-1&&(h.config.testBandwidth?(E=0,this.bitrateTest=!0):E=h.nextAutoLevel),this.level=h.nextLoadLevel=E,this.loadedmetadata=!1}l>0&&f===-1&&(this.log("Override startPosition with lastCurrentTime @"+l.toFixed(3)),f=l),this.state=S.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()}else this._forceStartLoad=!0,this.state=S.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case S.State.IDLE:this.doTickIdle();break;case S.State.WAITING_LEVEL:{var f,l=this.levels,h=this.level,E=l==null||((f=l[h])===null||f===void 0)?void 0:f.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=S.State.IDLE;break}break}case S.State.FRAG_LOADING_WAITING_RETRY:{var y,T=self.performance.now(),L=this.retryDate;(!L||T>=L||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=S.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var f,l,h=this.hls,E=this.levelLastLoaded,y=this.levels,T=this.media,L=h.config,D=h.nextLoadLevel;if(E===null||!T&&(this.startFragRequested||!L.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[D])return;var x=y[D];this.level=h.nextLoadLevel=D;var P=x.details;if(!P||this.state===S.State.WAITING_LEVEL||P.live&&this.levelLastLoaded!==D){this.state=S.State.WAITING_LEVEL;return}var H=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:T,w.PlaylistLevelType.MAIN);if(H===null)return;var I=H.len,z=this.getMaxBufferLength(x.maxBitrate);if(I>=z)return;if(this._streamEnded(H,P)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(F.Events.BUFFER_EOS,$),this.state=S.State.ENDED;return}var fe=H.end,ee=this.getNextFragment(fe,P);if(this.couldBacktrack&&!this.fragPrevious&&ee&&ee.sn!=="initSegment"){var ye=ee.sn-P.startSN;ye>1&&(ee=P.fragments[ye-1],this.fragmentTracker.removeFragment(ee))}if(ee&&this.fragmentTracker.getState(ee)===e.FragmentState.OK&&this.nextLoadPosition>fe){var pe=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(T,pe,w.PlaylistLevelType.MAIN),ee=this.getNextFragment(this.nextLoadPosition,P)}if(!ee)return;ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),((f=ee.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((l=ee.decryptdata)!==null&&l!==void 0&&l.key)?this.loadKey(ee,P):this.loadFragment(ee,P,fe)},_.loadFragment=function(f,l,h){var E,y=this.fragmentTracker.getState(f);if(this.fragCurrent=f,y===e.FragmentState.BACKTRACKED){var T=this.fragmentTracker.getBacktrackData(f);if(T){this._handleFragmentLoadProgress(T),this._handleFragmentLoadComplete(T);return}else y=e.FragmentState.NOT_LOADED}y===e.FragmentState.NOT_LOADED||y===e.FragmentState.PARTIAL?f.sn==="initSegment"?this._loadInitSegment(f):this.bitrateTest?(f.bitrateTest=!0,this.log("Fragment "+f.sn+" of level "+f.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(f)):(this.startFragRequested=!0,m.prototype.loadFragment.call(this,f,l,h)):y===e.FragmentState.APPENDING?this.reduceMaxBufferLength(f.duration)&&this.fragmentTracker.removeFragment(f):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(f){var l=this.fragmentTracker.getAppendedFrag(f,w.PlaylistLevelType.MAIN);return l&&"fragment"in l?l.fragment:l},_.getBufferedFrag=function(f){return this.fragmentTracker.getBufferedFrag(f,w.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(f){return f?this.getBufferedFrag(f.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var f=this.levels,l=this.media;if(l!=null&&l.readyState){var h,E=this.getAppendedFrag(l.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!l.paused&&f){var y=this.hls.nextLoadLevel,T=f[y],L=this.fragLastKbps;L&&this.fragCurrent?h=this.fragCurrent.duration*T.maxBitrate/(1e3*L)+1:h=0}else h=0;var D=this.getBufferedFrag(l.currentTime+h);if(D){var x=this.followingBufferedFrag(D);if(x){this.abortCurrentFrag();var P=x.maxStartPTS?x.maxStartPTS:x.start,H=x.duration,I=Math.max(D.end,P+Math.min(Math.max(H-this.config.maxFragLookUpTolerance,H*.5),H*.75));this.flushMainBuffer(I,Number.POSITIVE_INFINITY)}}}},_.abortCurrentFrag=function(){var f=this.fragCurrent;this.fragCurrent=null,f!=null&&f.loader&&f.loader.abort(),this.state===S.State.KEY_LOADING&&(this.state=S.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},_.flushMainBuffer=function(f,l){m.prototype.flushMainBuffer.call(this,f,l,this.altAudio?"video":null)},_.onMediaAttached=function(f,l){m.prototype.onMediaAttached.call(this,f,l);var h=l.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),h.addEventListener("playing",this.onvplaying),h.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,h,this.fragmentTracker,this.hls)},_.onMediaDetaching=function(){var f=this.media;f&&(f.removeEventListener("playing",this.onvplaying),f.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),m.prototype.onMediaDetaching.call(this)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var f=this.media,l=f?f.currentTime:null;Object(N.isFiniteNumber)(l)&&this.log("Media seeked to "+l.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(F.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},_.onManifestParsed=function(f,l){var h=!1,E=!1,y;l.levels.forEach(function(T){y=T.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(h=!0),y.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=h&&E&&!Object(O.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=l.levels,this.startFragRequested=!1},_.onLevelLoading=function(f,l){var h=this.levels;if(!h||this.state!==S.State.IDLE)return;var E=h[l.level];(!E.details||E.details.live&&this.levelLastLoaded!==l.level||this.waitForCdnTuneIn(E.details))&&(this.state=S.State.WAITING_LEVEL)},_.onLevelLoaded=function(f,l){var h,E=this.levels,y=l.level,T=l.details,L=T.totalduration;if(!E){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+T.startSN+","+T.endSN+"], cc ["+T.startCC+", "+T.endCC+"] duration:"+L);var D=this.fragCurrent;D&&(this.state===S.State.FRAG_LOADING||this.state===S.State.FRAG_LOADING_WAITING_RETRY)&&(D.level!==l.level&&D.loader&&(this.state=S.State.IDLE,D.loader.abort()));var x=E[y],P=0;if(T.live||(h=x.details)!==null&&h!==void 0&&h.live){if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed)return;P=this.alignPlaylists(T,x.details)}if(x.details=T,this.levelLastLoaded=y,this.hls.trigger(F.Events.LEVEL_UPDATED,{details:T,level:y}),this.state===S.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(T))return;this.state=S.State.IDLE}this.startFragRequested?T.live&&this.synchronizeToLiveEdge(T):this.setStartPosition(T,P),this.tick()},_._handleFragmentLoadProgress=function(f){var l,h=f.frag,E=f.part,y=f.payload,T=this.levels;if(!T){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var L=T[h.level],D=L.details;if(!D){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var x=L.videoCodec,P=D.PTSKnown||!D.live,H=(l=h.initSegment)===null||l===void 0?void 0:l.data,I=this._getAudioCodec(L),z=this.transmuxer=this.transmuxer||new c.default(this.hls,w.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=E?E.index:-1,fe=$!==-1,ee=new u.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,y.byteLength,$,fe),ye=this.initPTS[h.cc];z.push(y,H,I,x,h,E,D.totalduration,P,ee,ye)},_.onAudioTrackSwitching=function(f,l){var h=this.altAudio,E=!!l.url,y=l.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var T=this.fragCurrent;T!=null&&T.loader&&(this.log("Switching to main audio track, cancel main fragment load"),T.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var L=this.hls;h&&L.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),L.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:y})}},_.onAudioTrackSwitched=function(f,l){var h=l.id,E=!!this.hls.audioTracks[h].url;if(E){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=E,this.tick()},_.onBufferCreated=function(f,l){var h=l.tracks,E,y,T=!1;for(var L in h){var D=h[L];if(D.id==="main"){if(y=L,E=D,L==="video"){var x=h[L];x&&(this.videoBuffer=x.buffer)}}else T=!0}T&&E?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(f,l){var h=l.frag,E=l.part;if(h&&h.type!==w.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(E?" p: "+E.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===S.State.PARSED&&(this.state=S.State.IDLE);return}var y=E?E.stats:h.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,E)},_.onError=function(f,l){switch(l.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.PlaylistLevelType.MAIN,l);break;case i.ErrorDetails.LEVEL_LOAD_ERROR:case i.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==S.State.ERROR&&(l.fatal?(this.warn(""+l.details),this.state=S.State.ERROR):!l.levelRetry&&this.state===S.State.WAITING_LEVEL&&(this.state=S.State.IDLE));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(l.parent==="main"&&(this.state===S.State.PARSING||this.state===S.State.PARSED)){var h=!0,E=this.getFwdBufferInfo(this.media,w.PlaylistLevelType.MAIN);E&&E.len>.5&&(h=!this.reduceMaxBufferLength(E.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.checkBuffer=function(){var f=this.media,l=this.gapController;if(!f||!l||!f.readyState)return;var h=j.BufferHelper.getBuffered(f);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):l.poll(this.lastCurrentTime),this.lastCurrentTime=f.currentTime},_.onFragLoadEmergencyAborted=function(){this.state=S.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(f,l){var h=l.type;if(h!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(h===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,h,w.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(f,l){this.levels=l.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.seekToStartPos=function(){var f=this.media,l=f.currentTime,h=this.startPosition;if(h>=0&&l<h){if(f.seeking){d.logger.log("could not seek to "+h+", already seeking at "+l);return}var E=j.BufferHelper.getBuffered(f),y=E.length?E.start(0):0,T=y-h;T>0&&(T<this.config.maxBufferHole||T<this.config.maxFragLookUpTolerance)&&(d.logger.log("adjusting start position by "+T+" to match buffer start"),h+=T,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+l),f.currentTime=h}},_._getAudioCodec=function(f){var l=this.config.defaultAudioCodec||f.audioCodec;return this.audioCodecSwap&&l&&(this.log("Swapping audio codec"),l.indexOf("mp4a.40.5")!==-1?l="mp4a.40.2":l="mp4a.40.5"),l},_._loadBitrateTestFrag=function(f){var l=this;this._doFragLoad(f).then(function(h){var E=l.hls;if(!h||E.nextLoadLevel||l.fragContextChanged(f))return;l.fragLoadError=0,l.state=S.State.IDLE,l.startFragRequested=!1,l.bitrateTest=!1;var y=f.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),E.trigger(F.Events.FRAG_LOADED,h)})},_._handleTransmuxComplete=function(f){var l,h="main",E=this.hls,y=f.remuxResult,T=f.chunkMeta,L=this.getCurrentContext(T);if(!L){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(T.level);return}var D=L.frag,x=L.part,P=L.level,H=y.video,I=y.text,z=y.id3,$=y.initSegment,fe=this.altAudio?void 0:y.audio;if(this.fragContextChanged(D))return;if(this.state=S.State.PARSING,$){$.tracks&&(this._bufferInitSegment(P,$.tracks,D,T),E.trigger(F.Events.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:h,tracks:$.tracks}));var ee=$.initPTS,ye=$.timescale;Object(N.isFiniteNumber)(ee)&&(this.initPTS[D.cc]=ee,E.trigger(F.Events.INIT_PTS_FOUND,{frag:D,id:h,initPTS:ee,timescale:ye}))}if(H&&y.independent!==!1){if(P.details){var pe=H.startPTS,ae=H.endPTS,se=H.startDTS,_e=H.endDTS;if(x)x.elementaryStreams[H.type]={startPTS:pe,endPTS:ae,startDTS:se,endDTS:_e};else if(H.firstKeyFrame&&H.independent&&(this.couldBacktrack=!0),H.dropped&&H.independent){var te=this.getLoadPosition()+this.config.maxBufferHole;if(te<pe){this.backtrack(D);return}D.setElementaryStreamInfo(H.type,D.start,ae,D.start,_e,!0)}D.setElementaryStreamInfo(H.type,pe,ae,se,_e),this.bufferFragmentData(H,D,x,T)}}else if(y.independent===!1){this.backtrack(D);return}if(fe){var k=fe.startPTS,A=fe.endPTS,C=fe.startDTS,B=fe.endDTS;x&&(x.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:k,endPTS:A,startDTS:C,endDTS:B}),D.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,k,A,C,B),this.bufferFragmentData(fe,D,x,T)}if(z!=null&&(l=z.samples)!==null&&l!==void 0&&l.length){var K={frag:D,id:h,samples:z.samples};E.trigger(F.Events.FRAG_PARSING_METADATA,K)}if(I){var M={frag:D,id:h,samples:I.samples};E.trigger(F.Events.FRAG_PARSING_USERDATA,M)}},_._bufferInitSegment=function(f,l,h,E){var y=this;if(this.state!==S.State.PARSING)return;this.audioOnly=!!l.audio&&!l.video,this.altAudio&&!this.audioOnly&&delete l.audio;var T=l.audio,L=l.video,D=l.audiovideo;if(T){var x=f.audioCodec,P=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(x&&(x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),T.metadata.channelCount!==1&&P.indexOf("firefox")===-1&&(x="mp4a.40.5")),P.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(x="mp4a.40.2",this.log("Android: force audio codec to "+x)),f.audioCodec&&f.audioCodec!==x&&this.log('Swapping manifest audio codec "'+f.audioCodec+'" for "'+x+'"'),T.levelCodec=x,T.id="main",this.log("Init audio buffer, container:"+T.container+", codecs[selected/level/parsed]=["+(x||"")+"/"+(f.audioCodec||"")+"/"+T.codec+"]")}L&&(L.levelCodec=f.videoCodec,L.id="main",this.log("Init video buffer, container:"+L.container+", codecs[level/parsed]=["+(f.videoCodec||"")+"/"+L.codec+"]")),D&&this.log("Init audiovideo buffer, container:"+D.container+", codecs[level/parsed]=["+(f.attrs.CODECS||"")+"/"+D.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,l),Object.keys(l).forEach(function(H){var I=l[H],z=I.initSegment;z!=null&&z.byteLength&&y.hls.trigger(F.Events.BUFFER_APPENDING,{type:H,data:z,frag:h,part:null,chunkMeta:E,parent:h.type})}),this.tick()},_.backtrack=function(f){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(f);var l=this.fragmentTracker.backtrack(f);this.fragPrevious=null,this.nextLoadPosition=f.start,l?this.resetFragmentLoading(f):this.state=S.State.BACKTRACKING},_.checkFragmentChanged=function(){var f=this.media,l=null;if(f&&f.readyState>1&&f.seeking===!1){var h=f.currentTime;if(j.BufferHelper.isBuffered(f,h)?l=this.getAppendedFrag(h):j.BufferHelper.isBuffered(f,h+.1)&&(l=this.getAppendedFrag(h+.1)),l){var E=this.fragPlaying,y=l.level;(!E||l.sn!==E.sn||E.level!==y||l.urlId!==E.urlId)&&(this.hls.trigger(F.Events.FRAG_CHANGED,{frag:l}),(!E||E.level!==y)&&this.hls.trigger(F.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=l)}}},r(b,[{key:"nextLevel",get:function(){var f=this.nextBufferedFrag;return f?f.level:-1}},{key:"currentLevel",get:function(){var f=this.media;if(f){var l=this.getAppendedFrag(f.currentTime);if(l)return l.level}return-1}},{key:"nextBufferedFrag",get:function(){var f=this.media;if(f){var l=this.getAppendedFrag(f.currentTime);return this.followingBufferedFrag(l)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),b}(S.default)},"./src/controller/subtitle-stream-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"SubtitleStreamController",function(){return n});var N=R("./src/events.ts"),S=R("./src/utils/logger.ts"),O=R("./src/utils/buffer-helper.ts"),F=R("./src/controller/fragment-finders.ts"),j=R("./src/utils/discontinuities.ts"),e=R("./src/controller/level-helper.ts"),w=R("./src/controller/fragment-tracker.ts"),g=R("./src/controller/base-stream-controller.ts"),c=R("./src/types/loader.ts"),u=R("./src/types/level.ts");function a(t,v){for(var p=0;p<v.length;p++){var m=v[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}function i(t,v,p){return v&&a(t.prototype,v),p&&a(t,p),t}function d(t,v){t.prototype=Object.create(v.prototype),t.prototype.constructor=t,s(t,v)}function s(t,v){return s=Object.setPrototypeOf||function(m,b){return m.__proto__=b,m},s(t,v)}var r=500,n=function(t){d(v,t);function v(m,b){var _;return _=t.call(this,m,b,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var p=v.prototype;return p.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},p._registerListeners=function(){var b=this.hls;b.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(N.Events.ERROR,this.onError,this),b.on(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),b.on(N.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),b.on(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),b.on(N.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),b.on(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p._unregisterListeners=function(){var b=this.hls;b.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(N.Events.ERROR,this.onError,this),b.off(N.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),b.off(N.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),b.off(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),b.off(N.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),b.off(N.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},p.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(r),this.tick()},p.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},p.onLevelLoaded=function(b,_){this.mainDetails=_.details},p.onSubtitleFragProcessed=function(b,_){var o=_.frag,f=_.success;if(this.fragPrevious=o,this.state=g.State.IDLE,!f)return;var l=this.tracksBuffered[this.currentTrackId];if(!l)return;for(var h,E=o.start,y=0;y<l.length;y++)if(E>=l[y].start&&E<=l[y].end){h=l[y];break}var T=o.start+o.duration;h?h.end=T:(h={start:E,end:T},l.push(h)),this.fragmentTracker.fragBuffered(o)},p.onBufferFlushing=function(b,_){var o=_.startOffset,f=_.endOffset;if(o===0&&f!==Number.POSITIVE_INFINITY){var l=this.currentTrackId,h=this.levels;if(!h.length||!h[l]||!h[l].details)return;var E=h[l].details,y=E.targetduration,T=f-y;if(T<=0)return;_.endOffsetSubtitles=Math.max(0,T),this.tracksBuffered.forEach(function(L){for(var D=0;D<L.length;){if(L[D].end<=T){L.shift();continue}else if(L[D].start<T)L[D].start=T;else break;D++}}),this.fragmentTracker.removeFragmentsInRange(o,T,c.PlaylistLevelType.SUBTITLE)}},p.onError=function(b,_){var o,f=_.frag;if(!f||f.type!==c.PlaylistLevelType.SUBTITLE)return;(o=this.fragCurrent)!==null&&o!==void 0&&o.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},p.onSubtitleTracksUpdated=function(b,_){var o=this,f=_.subtitleTracks;this.tracksBuffered=[],this.levels=f.map(function(l){return new u.Level(l)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(l){o.tracksBuffered[l.id]=[]}),this.mediaBuffer=null},p.onSubtitleTrackSwitch=function(b,_){if(this.currentTrackId=_.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var o=this.levels[this.currentTrackId];o!=null&&o.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,o&&this.setInterval(r)},p.onSubtitleTrackLoaded=function(b,_){var o,f=_.details,l=_.id,h=this.currentTrackId,E=this.levels;if(!E.length)return;var y=E[h];if(l>=E.length||l!==h||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,f.live||(o=y.details)!==null&&o!==void 0&&o.live){var T=this.mainDetails;if(f.deltaUpdateFailed||!T)return;var L=T.fragments[0];if(!y.details)f.hasProgramDateTime&&T.hasProgramDateTime?Object(j.alignMediaPlaylistByPDT)(f,T):L&&Object(e.addSliding)(f,L.start);else{var D=this.alignPlaylists(f,y.details);D===0&&L&&Object(e.addSliding)(f,L.start)}}if(y.details=f,this.levelLastLoaded=l,this.tick(),f.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var x=Object(F.findFragmentByPTS)(null,f.fragments,this.media.currentTime,0);x||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},p._handleFragmentLoadComplete=function(b){var _=b.frag,o=b.payload,f=_.decryptdata,l=this.hls;if(this.fragContextChanged(_))return;if(o&&o.byteLength>0&&f&&f.key&&f.iv&&f.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(o),f.key.buffer,f.iv.buffer).then(function(E){var y=performance.now();l.trigger(N.Events.FRAG_DECRYPTED,{frag:_,payload:E,stats:{tstart:h,tdecrypt:y}})})}},p.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var b,_=this.currentTrackId,o=this.levels;if(!o.length||!o[_]||!o[_].details)return;var f=o[_].details,l=f.targetduration,h=this.config,E=this.media,y=O.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-l,h.maxBufferHole),T=y.end,L=y.len,D=this.getMaxBufferLength()+l;if(L>D)return;console.assert(f,"Subtitle track details are defined on idle subtitle stream controller tick");var x=f.fragments,P=x.length,H=f.edge,I,z=this.fragPrevious;if(T<H){var $=h.maxFragLookUpTolerance;z&&f.hasProgramDateTime&&(I=Object(F.findFragmentByPDT)(x,z.endProgramDateTime,$)),I||(I=Object(F.findFragmentByPTS)(z,x,T,$),!I&&z&&z.start<x[0].start&&(I=x[0]))}else I=x[P-1];(b=I)!==null&&b!==void 0&&b.encrypted?(S.logger.log("Loading key for "+I.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(N.Events.KEY_LOADING,{frag:I})):I&&this.fragmentTracker.getState(I)===w.FragmentState.NOT_LOADED&&this.loadFragment(I,f,T)}},p.loadFragment=function(b,_,o){this.fragCurrent=b,t.prototype.loadFragment.call(this,b,_,o)},i(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(g.default)},"./src/controller/subtitle-track-controller.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/events.ts"),S=R("./src/utils/texttrack-utils.ts"),O=R("./src/controller/base-playlist-controller.ts"),F=R("./src/types/loader.ts");function j(a,i){for(var d=0;d<i.length;d++){var s=i[d];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,i,d){return i&&j(a.prototype,i),d&&j(a,d),a}function w(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,g(a,i)}function g(a,i){return g=Object.setPrototypeOf||function(s,r){return s.__proto__=r,s},g(a,i)}var c=function(a){w(i,a);function i(s){var r;return r=a.call(this,s,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var d=i.prototype;return d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},d.registerListeners=function(){var r=this.hls;r.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(N.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(N.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var r=this.hls;r.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(N.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(N.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(N.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(N.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(N.Events.ERROR,this.onError,this)},d.onMediaAttached=function(r,n){if(this.media=n.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},d.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},d.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var r=u(this.media.textTracks);r.forEach(function(n){Object(S.clearCurrentCues)(n)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(r,n){this.tracks=n.subtitleTracks},d.onSubtitleTrackLoaded=function(r,n){var t=n.id,v=n.details,p=this.trackId,m=this.tracksInGroup[p];if(!m){this.warn("Invalid subtitle track id "+t);return}var b=m.details;m.details=n.details,this.log("subtitle track "+t+" loaded ["+v.startSN+"-"+v.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,n,b))},d.onLevelLoading=function(r,n){this.switchLevel(n.level)},d.onLevelSwitching=function(r,n){this.switchLevel(n.level)},d.switchLevel=function(r){var n=this.hls.levels[r];if(!(n!=null&&n.textGroupIds))return;var t=n.textGroupIds[n.urlId];if(this.groupId!==t){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,p=this.tracks.filter(function(_){return!t||_.groupId===t});this.tracksInGroup=p;var m=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=t;var b={subtitleTracks:p};this.log("Updating subtitle tracks, "+p.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(N.Events.SUBTITLE_TRACKS_UPDATED,b),m!==-1&&this.setSubtitleTrack(m,v)}},d.findTrackId=function(r){for(var n=this.tracksInGroup,t=0;t<n.length;t++){var v=n[t];if((!this.selectDefaultTrack||v.default)&&(!r||r===v.name))return v.id}return-1},d.onError=function(r,n){if(a.prototype.onError.call(this,r,n),n.fatal||!n.context)return;n.context.type===F.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},d.loadPlaylist=function(r){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var t=n.id,v=n.groupId,p=n.url;if(r)try{p=r.addDirectives(p)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(N.Events.SUBTITLE_TRACK_LOADING,{url:p,id:t,groupId:v,deliveryDirectives:r||null})}},d.toggleTrackModes=function(r){var n=this,t=this.media,v=this.subtitleDisplay,p=this.trackId;if(!t)return;var m=u(t.textTracks),b=m.filter(function(f){return f.groupId===n.groupId});if(r===-1)[].slice.call(m).forEach(function(f){f.mode="disabled"});else{var _=b[p];_&&(_.mode="disabled")}var o=b[r];o&&(o.mode=v?"showing":"hidden")},d.setSubtitleTrack=function(r,n){var t,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(t=v[r])!==null&&t!==void 0&&t.details)||r<-1||r>=v.length)return;this.clearTimer();var p=v[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,p){var m=p.id,b=p.groupId,_=b===void 0?"":b,o=p.name,f=p.type,l=p.url;this.hls.trigger(N.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:_,name:o,type:f,url:l});var h=this.switchParams(p.url,n==null?void 0:n.details);this.loadPlaylist(h)}else this.hls.trigger(N.Events.SUBTITLE_TRACK_SWITCH,{id:r})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,n=u(this.media.textTracks),t=0;t<n.length;t++)if(n[t].mode==="hidden")r=t;else if(n[t].mode==="showing"){r=t;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},e(i,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,n)}}]),i}(O.default);function u(a){for(var i=[],d=0;d<a.length;d++){var s=a[d];s.kind==="subtitles"&&s.label&&i.push(a[d])}return i}W.default=c},"./src/controller/timeline-controller.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"TimelineController",function(){return u});var N=R("./src/polyfills/number.ts"),S=R("./src/events.ts"),O=R("./src/utils/cea-608-parser.ts"),F=R("./src/utils/output-filter.ts"),j=R("./src/utils/webvtt-parser.ts"),e=R("./src/utils/texttrack-utils.ts"),w=R("./src/utils/imsc1-ttml-parser.ts"),g=R("./src/types/loader.ts"),c=R("./src/utils/logger.ts"),u=function(){function s(n){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this.captionsProperties=void 0,this.hls=n,this.config=n.config,this.Cues=n.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new F.default(this,"textTrack1"),v=new F.default(this,"textTrack2"),p=new F.default(this,"textTrack3"),m=new F.default(this,"textTrack4");this.cea608Parser1=new O.default(1,t,v),this.cea608Parser2=new O.default(3,p,m)}n.on(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(S.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.on(S.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.on(S.Events.FRAG_LOADING,this.onFragLoading,this),n.on(S.Events.FRAG_LOADED,this.onFragLoaded,this),n.on(S.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.on(S.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.on(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.on(S.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.on(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=s.prototype;return r.destroy=function(){var t=this.hls;t.off(S.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(S.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(S.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(S.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(S.Events.FRAG_LOADING,this.onFragLoading,this),t.off(S.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(S.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(S.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(S.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(S.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(S.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(t,v,p,m,b){for(var _=!1,o=b.length;o--;){var f=b[o],l=i(f[0],f[1],v,p);if(l>=0&&(f[0]=Math.min(f[0],v),f[1]=Math.max(f[1],p),_=!0,l/(p-v)>.5))return}if(_||b.push([v,p]),this.config.renderTextTracksNatively){var h=this.captionsTracks[t];this.Cues.newCue(h,v,p,m)}else{var E=this.Cues.newCue(null,v,p,m);this.hls.trigger(S.Events.CUES_PARSED,{type:"captions",cues:E,track:t})}},r.onInitPtsFound=function(t,v){var p=this,m=v.frag,b=v.id,_=v.initPTS,o=v.timescale,f=this.unparsedVttFrags;b==="main"&&(this.initPTS[m.cc]=_,this.timescale[m.cc]=o),f.length&&(this.unparsedVttFrags=[],f.forEach(function(l){p.onFragLoaded(S.Events.FRAG_LOADED,l)}))},r.getExistingTrack=function(t){var v=this.media;if(v)for(var p=0;p<v.textTracks.length;p++){var m=v.textTracks[p];if(m[t])return m}return null},r.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},r.createNativeTrack=function(t){if(this.captionsTracks[t])return;var v=this.captionsProperties,p=this.captionsTracks,m=this.media,b=v[t],_=b.label,o=b.languageCode,f=this.getExistingTrack(t);if(f)p[t]=f,Object(e.clearCurrentCues)(p[t]),Object(e.sendAddTrackEvent)(p[t],m);else{var l=this.createTextTrack("captions",_,o);l&&(l[t]=!0,p[t]=l)}},r.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var v=this.captionsProperties[t];if(!v)return;var p=v.label,m={_id:t,label:p,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[t]=m,this.hls.trigger(S.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},r.createTextTrack=function(t,v,p){var m=this.media;return m?m.addTextTrack(t,v,p):void 0},r.onMediaAttaching=function(t,v){this.media=v.media,this._cleanTracks()},r.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(v){Object(e.clearCurrentCues)(t[v]),delete t[v]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=d(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},r._cleanTracks=function(){var t=this.media;if(!t)return;var v=t.textTracks;if(v)for(var p=0;p<v.length;p++)Object(e.clearCurrentCues)(v[p])},r.onSubtitleTracksUpdated=function(t,v){var p=this;this.textTracks=[];var m=v.subtitleTracks||[],b=m.some(function(l){return l.textCodec===w.IMSC1_CODEC});if(this.config.enableWebVTT||b&&this.config.enableIMSC1){var _=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var o=this.media?this.media.textTracks:[];this.tracks.forEach(function(l,h){var E;if(h<o.length){for(var y=null,T=0;T<o.length;T++)if(a(o[T],l)){y=o[T];break}y&&(E=y)}E?Object(e.clearCurrentCues)(E):(E=p.createTextTrack("subtitles",l.name,l.lang),E&&(E.mode="disabled")),E&&(E.groupId=l.groupId,p.textTracks.push(E))})}else if(!_&&this.tracks&&this.tracks.length){var f=this.tracks.map(function(l){return{label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}});this.hls.trigger(S.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:f})}}},r.onManifestLoaded=function(t,v){var p=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(m){var b=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!b)return;var _="textTrack"+b[1],o=p.captionsProperties[_];if(!o)return;o.label=m.name,m.lang&&(o.languageCode=m.lang),o.media=m})},r.onFragLoading=function(t,v){var p=this.cea608Parser1,m=this.cea608Parser2,b=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(p&&m))return;if(v.frag.type===g.PlaylistLevelType.MAIN){var o,f,l=v.frag.sn,h=(o=v==null||((f=v.part)===null||f===void 0)?void 0:f.index)!=null?o:-1;l===b+1||l===b&&h===_+1||(p.reset(),m.reset()),this.lastSn=l,this.lastPartIndex=h}},r.onFragLoaded=function(t,v){var p=v.frag,m=v.payload,b=this.initPTS,_=this.unparsedVttFrags;if(p.type===g.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(N.isFiniteNumber)(b[p.cc])){_.push(v),b.length&&this.hls.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Missing initial subtitle PTS")});return}var o=p.decryptdata;if(o==null||o.key==null||o.method!=="AES-128"){var f=this.tracks[p.level],l=this.vttCCs;l[p.cc]||(l[p.cc]={start:p.start,prevCC:this.prevCC,new:!0},this.prevCC=p.cc),f&&f.textCodec===w.IMSC1_CODEC?this._parseIMSC1(p,m):this._parseVTTs(p,m,l)}}else this.hls.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:p,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(t,v){var p=this,m=this.hls;Object(w.parseIMSC1)(v,this.initPTS[t.cc],this.timescale[t.cc],function(b){p._appendCues(b,t.level),m.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(b){c.logger.log("Failed to parse IMSC1: "+b),m.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:b})})},r._parseVTTs=function(t,v,p){var m=this,b=this.hls;Object(j.parseWebVTT)(v,this.initPTS[t.cc],this.timescale[t.cc],p,t.cc,t.start,function(_){m._appendCues(_,t.level),b.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(_){m._fallbackToIMSC1(t,v),c.logger.log("Failed to parse VTT cue: "+_),b.trigger(S.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:_})})},r._fallbackToIMSC1=function(t,v){var p=this,m=this.tracks[t.level];m.textCodec||Object(w.parseIMSC1)(v,this.initPTS[t.cc],this.timescale[t.cc],function(){m.textCodec=w.IMSC1_CODEC,p._parseIMSC1(t,v)},function(){m.textCodec="wvtt"})},r._appendCues=function(t,v){var p=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[v];if(m.mode==="disabled")return;t.forEach(function(o){return Object(e.addCueToTrack)(m,o)})}else{var b=this.tracks[v],_=b.default?"default":"subtitles"+v;p.trigger(S.Events.CUES_PARSED,{type:"subtitles",cues:t,track:_})}},r.onFragDecrypted=function(t,v){var p=v.frag;if(p.type===g.PlaylistLevelType.SUBTITLE){if(!Object(N.isFiniteNumber)(this.initPTS[p.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(S.Events.FRAG_LOADED,v)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(t,v){var p=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(p&&m))return;for(var b=0;b<v.samples.length;b++){var _=v.samples[b].bytes;if(_){var o=this.extractCea608Data(_);p.addData(v.samples[b].pts,o[0]),m.addData(v.samples[b].pts,o[1])}}},r.onBufferFlushing=function(t,v){var p=v.startOffset,m=v.endOffset,b=v.endOffsetSubtitles,_=v.type,o=this.media;if(!o||o.currentTime<m)return;if(!_||_==="video"){var f=this.captionsTracks;Object.keys(f).forEach(function(h){return Object(e.removeCuesInRange)(f[h],p,m)})}if(this.config.renderTextTracksNatively&&(p===0&&b!==void 0)){var l=this.textTracks;Object.keys(l).forEach(function(h){return Object(e.removeCuesInRange)(l[h],p,b)})}},r.extractCea608Data=function(t){for(var v=t[0]&31,p=2,m=[[],[]],b=0;b<v;b++){var _=t[p++],o=127&t[p++],f=127&t[p++],l=(4&_)!==0,h=3&_;if(o===0&&f===0)continue;l&&((h===0||h===1)&&(m[h].push(o),m[h].push(f)))}return m},s}();function a(s,r){return s&&s.label===r.name&&!(s.textTrack1||s.textTrack2)}function i(s,r,n,t){return Math.min(r,t)-Math.max(s,n)}function d(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function S(F,j){this.subtle=void 0,this.aesIV=void 0,this.subtle=F,this.aesIV=j}var O=S.prototype;return O.decrypt=function(j,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,j)},S}()},"./src/crypt/aes-decryptor.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"removePadding",function(){return S}),R.d(W,"default",function(){return O});var N=R("./src/utils/typed-array.ts");function S(F){var j=F.byteLength,e=j&&new DataView(F.buffer).getUint8(j-1);return e?Object(N.sliceUint8)(F,0,j-e):F}var O=function(){function F(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var j=F.prototype;return j.uint8ArrayToUint32Array_=function(w){for(var g=new DataView(w),c=new Uint32Array(4),u=0;u<4;u++)c[u]=g.getUint32(u*4);return c},j.initTable=function(){var w=this.sBox,g=this.invSBox,c=this.subMix,u=c[0],a=c[1],i=c[2],d=c[3],s=this.invSubMix,r=s[0],n=s[1],t=s[2],v=s[3],p=new Uint32Array(256),m=0,b=0,_=0;for(_=0;_<256;_++)_<128?p[_]=_<<1:p[_]=_<<1^283;for(_=0;_<256;_++){var o=b^b<<1^b<<2^b<<3^b<<4;o=o>>>8^o&255^99,w[m]=o,g[o]=m;var f=p[m],l=p[f],h=p[l],E=p[o]*257^o*16843008;u[m]=E<<24|E>>>8,a[m]=E<<16|E>>>16,i[m]=E<<8|E>>>24,d[m]=E,E=h*16843009^l*65537^f*257^m*16843008,r[o]=E<<24|E>>>8,n[o]=E<<16|E>>>16,t[o]=E<<8|E>>>24,v[o]=E,m?(m=f^p[p[p[h^f]]],b^=p[p[b]]):m=b=1}},j.expandKey=function(w){for(var g=this.uint8ArrayToUint32Array_(w),c=!0,u=0;u<g.length&&c;)c=g[u]===this.key[u],u++;if(c)return;this.key=g;var a=this.keySize=g.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var i=this.ksRows=(a+6+1)*4,d,s,r=this.keySchedule=new Uint32Array(i),n=this.invKeySchedule=new Uint32Array(i),t=this.sBox,v=this.rcon,p=this.invSubMix,m=p[0],b=p[1],_=p[2],o=p[3],f,l;for(d=0;d<i;d++){if(d<a){f=r[d]=g[d];continue}l=f,d%a===0?(l=l<<8|l>>>24,l=t[l>>>24]<<24|t[l>>>16&255]<<16|t[l>>>8&255]<<8|t[l&255],l^=v[d/a|0]<<24):a>6&&d%a===4&&(l=t[l>>>24]<<24|t[l>>>16&255]<<16|t[l>>>8&255]<<8|t[l&255]),r[d]=f=(r[d-a]^l)>>>0}for(s=0;s<i;s++)d=i-s,s&3?l=r[d]:l=r[d-4],s<4||d<=4?n[s]=l:n[s]=m[t[l>>>24]]^b[t[l>>>16&255]]^_[t[l>>>8&255]]^o[t[l&255]],n[s]=n[s]>>>0},j.networkToHostOrderSwap=function(w){return w<<24|(w&65280)<<8|(w&16711680)>>8|w>>>24},j.decrypt=function(w,g,c){for(var u=this.keySize+6,a=this.invKeySchedule,i=this.invSBox,d=this.invSubMix,s=d[0],r=d[1],n=d[2],t=d[3],v=this.uint8ArrayToUint32Array_(c),p=v[0],m=v[1],b=v[2],_=v[3],o=new Int32Array(w),f=new Int32Array(o.length),l,h,E,y,T,L,D,x,P,H,I,z,$,fe,ee=this.networkToHostOrderSwap;g<o.length;){for(P=ee(o[g]),H=ee(o[g+1]),I=ee(o[g+2]),z=ee(o[g+3]),T=P^a[0],L=z^a[1],D=I^a[2],x=H^a[3],$=4,fe=1;fe<u;fe++)l=s[T>>>24]^r[L>>16&255]^n[D>>8&255]^t[x&255]^a[$],h=s[L>>>24]^r[D>>16&255]^n[x>>8&255]^t[T&255]^a[$+1],E=s[D>>>24]^r[x>>16&255]^n[T>>8&255]^t[L&255]^a[$+2],y=s[x>>>24]^r[T>>16&255]^n[L>>8&255]^t[D&255]^a[$+3],T=l,L=h,D=E,x=y,$=$+4;l=i[T>>>24]<<24^i[L>>16&255]<<16^i[D>>8&255]<<8^i[x&255]^a[$],h=i[L>>>24]<<24^i[D>>16&255]<<16^i[x>>8&255]<<8^i[T&255]^a[$+1],E=i[D>>>24]<<24^i[x>>16&255]<<16^i[T>>8&255]<<8^i[L&255]^a[$+2],y=i[x>>>24]<<24^i[T>>16&255]<<16^i[L>>8&255]<<8^i[D&255]^a[$+3],f[g]=ee(l^p),f[g+1]=ee(y^m),f[g+2]=ee(E^b),f[g+3]=ee(h^_),p=P,m=H,b=I,_=z,g=g+4}return f.buffer},F}()},"./src/crypt/decrypter.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return g});var N=R("./src/crypt/aes-crypto.ts"),S=R("./src/crypt/fast-aes-key.ts"),O=R("./src/crypt/aes-decryptor.ts"),F=R("./src/utils/logger.ts"),j=R("./src/utils/mp4-tools.ts"),e=R("./src/utils/typed-array.ts"),w=16,g=function(){function c(a,i,d){var s=d===void 0?{}:d,r=s.removePKCS7Padding,n=r===void 0?!0:r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=a,this.config=i,this.removePKCS7Padding=n,n)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var u=c.prototype;return u.destroy=function(){this.observer=null},u.isSync=function(){return this.config.enableSoftwareAES},u.flush=function(){var i=this.currentResult;if(!i){this.reset();return}var d=new Uint8Array(i);return this.reset(),this.removePKCS7Padding?Object(O.removePadding)(d):d},u.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},u.decrypt=function(i,d,s,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(i),d,s);var n=this.flush();n&&r(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(i),d,s).then(r)},u.softwareDecrypt=function(i,d,s){var r=this.currentIV,n=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(i=Object(j.appendUint8Array)(t,i),this.remainderData=null);var v=this.getValidChunk(i);if(!v.length)return null;r&&(s=r);var p=this.softwareDecrypter;p||(p=this.softwareDecrypter=new O.default),p.expandKey(d);var m=n;return this.currentResult=p.decrypt(v.buffer,0,s),this.currentIV=Object(e.sliceUint8)(v,-16).buffer,m||null},u.webCryptoDecrypt=function(i,d,s){var r=this,n=this.subtle;return(this.key!==d||!this.fastAesKey)&&(this.key=d,this.fastAesKey=new S.default(n,d)),this.fastAesKey.expandKey().then(function(t){if(!n)return Promise.reject(new Error("web crypto not initialized"));var v=new N.default(n,s);return v.decrypt(i.buffer,t)}).catch(function(t){return r.onWebCryptoError(t,i,d,s)})},u.onWebCryptoError=function(i,d,s,r){return F.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",i),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(d,s,r)},u.getValidChunk=function(i){var d=i,s=i.length-i.length%w;return s!==i.length&&(d=Object(e.sliceUint8)(i,0,s),this.remainderData=Object(e.sliceUint8)(i,s)),d},u.logOnce=function(i){if(!this.logEnabled)return;F.logger.log("[decrypter.ts]: "+i),this.logEnabled=!1},c}()},"./src/crypt/fast-aes-key.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function S(F,j){this.subtle=void 0,this.key=void 0,this.subtle=F,this.key=j}var O=S.prototype;return O.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},S}()},"./src/demux/aacdemuxer.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/demux/base-audio-demuxer.ts"),S=R("./src/demux/adts.ts"),O=R("./src/utils/logger.ts"),F=R("./src/demux/id3.ts");function j(g,c){g.prototype=Object.create(c.prototype),g.prototype.constructor=g,e(g,c)}function e(g,c){return e=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},e(g,c)}var w=function(g){j(c,g);function c(a,i){var d;return d=g.call(this)||this,d.observer=void 0,d.config=void 0,d.observer=a,d.config=i,d}var u=c.prototype;return u.resetInitSegment=function(i,d,s){g.prototype.resetInitSegment.call(this,i,d,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:i,duration:s,inputTimeScale:9e4,dropped:0}},c.probe=function(i){if(!i)return!1;for(var d=F.getID3Data(i,0)||[],s=d.length,r=i.length;s<r;s++)if(S.probe(i,s))return O.logger.log("ADTS sync word found !"),!0;return!1},u.canParse=function(i,d){return S.canParse(i,d)},u.appendFrame=function(i,d,s){S.initTrackConfig(i,this.observer,d,s,i.manifestCodec);var r=S.appendFrame(i,d,s,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},c}(N.default);w.minProbeByteLength=9,W.default=w},"./src/demux/adts.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"getAudioConfig",function(){return F}),R.d(W,"isHeaderPattern",function(){return j}),R.d(W,"getHeaderLength",function(){return e}),R.d(W,"getFullFrameLength",function(){return w}),R.d(W,"canGetFrameLength",function(){return g}),R.d(W,"isHeader",function(){return c}),R.d(W,"canParse",function(){return u}),R.d(W,"probe",function(){return a}),R.d(W,"initTrackConfig",function(){return i}),R.d(W,"getFrameDuration",function(){return d}),R.d(W,"parseFrameHeader",function(){return s}),R.d(W,"appendFrame",function(){return r});var N=R("./src/utils/logger.ts"),S=R("./src/errors.ts"),O=R("./src/events.ts");function F(n,t,v,p){var m,b,_,o,f=navigator.userAgent.toLowerCase(),l=p,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((t[v+2]&192)>>>6)+1;var E=(t[v+2]&60)>>>2;if(E>h.length-1){n.trigger(O.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return _=(t[v+2]&1)<<2,_|=(t[v+3]&192)>>>6,N.logger.log("manifest codec:"+p+", ADTS type:"+m+", samplingIndex:"+E),/firefox/i.test(f)?E>=6?(m=5,o=new Array(4),b=E-3):(m=2,o=new Array(2),b=E):f.indexOf("android")!==-1?(m=2,o=new Array(2),b=E):(m=5,o=new Array(4),p&&(p.indexOf("mp4a.40.29")!==-1||p.indexOf("mp4a.40.5")!==-1)||!p&&E>=6?b=E-3:((p&&p.indexOf("mp4a.40.2")!==-1&&(E>=6&&_===1||/vivaldi/i.test(f))||!p&&_===1)&&(m=2,o=new Array(2)),b=E)),o[0]=m<<3,o[0]|=(E&14)>>1,o[1]|=(E&1)<<7,o[1]|=_<<3,m===5&&(o[1]|=(b&14)>>1,o[2]=(b&1)<<7,o[2]|=2<<2,o[3]=0),{config:o,samplerate:h[E],channelCount:_,codec:"mp4a.40."+m,manifestCodec:l}}function j(n,t){return n[t]===255&&(n[t+1]&246)===240}function e(n,t){return n[t+1]&1?7:9}function w(n,t){return(n[t+3]&3)<<11|n[t+4]<<3|(n[t+5]&224)>>>5}function g(n,t){return t+5<n.length}function c(n,t){return t+1<n.length&&j(n,t)}function u(n,t){return g(n,t)&&j(n,t)&&w(n,t)<=n.length-t}function a(n,t){if(c(n,t)){var v=e(n,t);if(t+v>=n.length)return!1;var p=w(n,t);if(p<=v)return!1;var m=t+p;return m===n.length||c(n,m)}return!1}function i(n,t,v,p,m){if(!n.samplerate){var b=F(t,v,p,m);if(!b)return;n.config=b.config,n.samplerate=b.samplerate,n.channelCount=b.channelCount,n.codec=b.codec,n.manifestCodec=b.manifestCodec,N.logger.log("parsed codec:"+n.codec+", rate:"+b.samplerate+", channels:"+b.channelCount)}}function d(n){return 1024*9e4/n}function s(n,t,v,p,m){var b=e(n,t),_=w(n,t);if(_-=b,_>0){var o=v+p*m;return{headerLength:b,frameLength:_,stamp:o}}}function r(n,t,v,p,m){var b=d(n.samplerate),_=s(t,v,p,m,b);if(_){var o=_.frameLength,f=_.headerLength,l=_.stamp,h=f+o,E=Math.max(0,v+h-t.length),y;E?(y=new Uint8Array(h-f),y.set(t.subarray(v+f,t.length),0)):y=t.subarray(v+f,v+h);var T={unit:y,pts:l};return E||n.samples.push(T),{sample:T,length:h,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"initPTSFn",function(){return w});var N=R("./src/polyfills/number.ts"),S=R("./src/demux/id3.ts"),O=R("./src/demux/dummy-demuxed-track.ts"),F=R("./src/utils/mp4-tools.ts"),j=R("./src/utils/typed-array.ts"),e=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var c=g.prototype;return c.resetInitSegment=function(a,i,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},c.resetTimeStamp=function(){},c.resetContiguity=function(){},c.canParse=function(a,i){return!1},c.appendFrame=function(a,i,d){},c.demux=function(a,i){this.cachedData&&(a=Object(F.appendUint8Array)(this.cachedData,a),this.cachedData=null);var d=S.getID3Data(a,0),s=d?d.length:0,r,n,t=this._audioTrack,v=this._id3Track,p=d?S.getTimeStamp(d):void 0,m=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=w(p,i)),d&&d.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),n=this.initPTS;s<m;){if(this.canParse(a,s)){var b=this.appendFrame(t,a,s);b?(this.frameIndex++,n=b.sample.pts,s+=b.length,r=s):s=m}else S.canParse(a,s)?(d=S.getID3Data(a,s),v.samples.push({pts:n,dts:n,data:d}),s+=d.length,r=s):s++;if(s===m&&r!==m){var _=Object(j.sliceUint8)(a,r);this.cachedData?this.cachedData=Object(F.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:t,avcTrack:Object(O.dummyTrack)(),id3Track:v,textTrack:Object(O.dummyTrack)()}},c.demuxSampleAes=function(a,i,d){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},c.flush=function(a){var i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(O.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(O.dummyTrack)()}},c.destroy=function(){},g}(),w=function(c,u){return Object(N.isFiniteNumber)(c)?c*90:u*9e4};W.default=e},"./src/demux/chunk-cache.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function O(){this.chunks=[],this.dataLength=0}var F=O.prototype;return F.push=function(e){this.chunks.push(e),this.dataLength+=e.length},F.flush=function(){var e=this.chunks,w=this.dataLength,g;if(e.length)e.length===1?g=e[0]:g=S(e,w);else return new Uint8Array(0);return this.reset(),g},F.reset=function(){this.chunks.length=0,this.dataLength=0},O}();function S(O,F){for(var j=new Uint8Array(F),e=0,w=0;w<O.length;w++){var g=O[w];j.set(g,e),e+=g.length}return j}},"./src/demux/dummy-demuxed-track.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"dummyTrack",function(){return N});function N(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/logger.ts"),S=function(){function O(j){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=j,this.bytesAvailable=j.byteLength,this.word=0,this.bitsAvailable=0}var F=O.prototype;return F.loadWord=function(){var e=this.data,w=this.bytesAvailable,g=e.byteLength-w,c=new Uint8Array(4),u=Math.min(4,w);if(u===0)throw new Error("no bytes available");c.set(e.subarray(g,g+u)),this.word=new DataView(c.buffer).getUint32(0),this.bitsAvailable=u*8,this.bytesAvailable-=u},F.skipBits=function(e){var w;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,w=e>>3,e-=w>>3,this.bytesAvailable-=w,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},F.readBits=function(e){var w=Math.min(this.bitsAvailable,e),g=this.word>>>32-w;return e>32&&N.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=w,this.bitsAvailable>0?this.word<<=w:this.bytesAvailable>0&&this.loadWord(),w=e-w,w>0&&this.bitsAvailable?g<<w|this.readBits(w):g},F.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if((this.word&2147483648>>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},F.skipUEG=function(){this.skipBits(1+this.skipLZ())},F.skipEG=function(){this.skipBits(1+this.skipLZ())},F.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},F.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},F.readBoolean=function(){return this.readBits(1)===1},F.readUByte=function(){return this.readBits(8)},F.readUShort=function(){return this.readBits(16)},F.readUInt=function(){return this.readBits(32)},F.skipScalingList=function(e){for(var w=8,g=8,c,u=0;u<e;u++)g!==0&&(c=this.readEG(),g=(w+c+256)%256),w=g===0?w:g},F.readSPS=function(){var e=0,w=0,g=0,c=0,u,a,i,d=this.readUByte.bind(this),s=this.readBits.bind(this),r=this.readUEG.bind(this),n=this.readBoolean.bind(this),t=this.skipBits.bind(this),v=this.skipEG.bind(this),p=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);d();var b=d();if(s(5),t(3),d(),p(),b===100||b===110||b===122||b===244||b===44||b===83||b===86||b===118||b===128){var _=r();if(_===3&&t(1),p(),p(),t(1),n())for(a=_!==3?8:12,i=0;i<a;i++)n()&&(i<6?m(16):m(64))}p();var o=r();if(o===0)r();else if(o===1)for(t(1),v(),v(),u=r(),i=0;i<u;i++)v();p(),t(1);var f=r(),l=r(),h=s(1);h===0&&t(1),t(1),n()&&(e=r(),w=r(),g=r(),c=r());var E=[1,1];if(n()&&n()){var y=d();switch(y){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[d()<<8|d(),d()<<8|d()];break}}}return{width:Math.ceil((f+1)*16-e*2-w*2),height:(2-h)*(l+1)*16-(h?2:4)*(g+c),pixelRatio:E}},F.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},O}();W.default=S},"./src/demux/id3.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"isHeader",function(){return N}),R.d(W,"isFooter",function(){return S}),R.d(W,"getID3Data",function(){return O}),R.d(W,"canParse",function(){return j}),R.d(W,"getTimeStamp",function(){return e}),R.d(W,"isTimeStampFrame",function(){return w}),R.d(W,"getID3Frames",function(){return c}),R.d(W,"decodeFrame",function(){return u}),R.d(W,"utf8ArrayToStr",function(){return r}),R.d(W,"testables",function(){return n});var N=function(m,b){return b+10<=m.length&&(m[b]===73&&m[b+1]===68&&m[b+2]===51&&(m[b+3]<255&&m[b+4]<255&&(m[b+6]<128&&m[b+7]<128&&m[b+8]<128&&m[b+9]<128)))},S=function(m,b){return b+10<=m.length&&(m[b]===51&&m[b+1]===68&&m[b+2]===73&&(m[b+3]<255&&m[b+4]<255&&(m[b+6]<128&&m[b+7]<128&&m[b+8]<128&&m[b+9]<128)))},O=function(m,b){for(var _=b,o=0;N(m,b);){o+=10;var f=F(m,b+6);o+=f,S(m,b+10)&&(o+=10),b+=o}return o>0?m.subarray(_,_+o):void 0},F=function(m,b){var _=0;return _=(m[b]&127)<<21,_|=(m[b+1]&127)<<14,_|=(m[b+2]&127)<<7,_|=m[b+3]&127,_},j=function(m,b){return N(m,b)&&F(m,b+6)+10<=m.length-b},e=function(m){for(var b=c(m),_=0;_<b.length;_++){var o=b[_];if(w(o))return s(o)}return},w=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},g=function(m){var b=String.fromCharCode(m[0],m[1],m[2],m[3]),_=F(m,4),o=10;return{type:b,size:_,data:m.subarray(o,o+_)}},c=function(m){for(var b=0,_=[];N(m,b);){var o=F(m,b+6);b+=10;for(var f=b+o;b+8<f;){var l=g(m.subarray(b)),h=u(l);h&&_.push(h),b+=l.size+10}S(m,b)&&(b+=10)}return _},u=function(m){return m.type==="PRIV"?a(m):m.type[0]==="W"?d(m):i(m)},a=function(m){if(m.size<2)return;var b=r(m.data,!0),_=new Uint8Array(m.data.subarray(b.length+1));return{key:m.type,info:b,data:_.buffer}},i=function(m){if(m.size<2)return;if(m.type==="TXXX"){var b=1,_=r(m.data.subarray(b),!0);b+=_.length+1;var o=r(m.data.subarray(b));return{key:m.type,info:_,data:o}}var f=r(m.data.subarray(1));return{key:m.type,data:f}},d=function(m){if(m.type==="WXXX"){if(m.size<2)return;var b=1,_=r(m.data.subarray(b),!0);b+=_.length+1;var o=r(m.data.subarray(b));return{key:m.type,info:_,data:o}}var f=r(m.data);return{key:m.type,data:f}},s=function(m){if(m.data.byteLength===8){var b=new Uint8Array(m.data),_=b[3]&1,o=(b[4]<<23)+(b[5]<<15)+(b[6]<<7)+b[7];return o/=45,_&&(o+=4772185884e-2),Math.round(o)}return},r=function(m,b){b===void 0&&(b=!1);var _=v();if(_){var o=_.decode(m);if(b){var f=o.indexOf("\0");return f!==-1?o.substring(0,f):o}return o.replace(/\0/g,"")}for(var l=m.length,h,E,y,T="",L=0;L<l;){if(h=m[L++],h===0&&b)return T;if(h===0||h===3)continue;switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:T+=String.fromCharCode(h);break;case 12:case 13:E=m[L++],T+=String.fromCharCode((h&31)<<6|E&63);break;case 14:E=m[L++],y=m[L++],T+=String.fromCharCode((h&15)<<12|(E&63)<<6|(y&63)<<0);break;default:}}return T},n={decodeTextFrame:i},t;function v(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/demux/base-audio-demuxer.ts"),S=R("./src/demux/id3.ts"),O=R("./src/utils/logger.ts"),F=R("./src/demux/mpegaudio.ts");function j(g,c){g.prototype=Object.create(c.prototype),g.prototype.constructor=g,e(g,c)}function e(g,c){return e=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},e(g,c)}var w=function(g){j(c,g);function c(){return g.apply(this,arguments)||this}var u=c.prototype;return u.resetInitSegment=function(i,d,s){g.prototype.resetInitSegment.call(this,i,d,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:i,duration:s,inputTimeScale:9e4,dropped:0}},c.probe=function(i){if(!i)return!1;for(var d=S.getID3Data(i,0)||[],s=d.length,r=i.length;s<r;s++)if(F.probe(i,s))return O.logger.log("MPEG Audio sync word found !"),!0;return!1},u.canParse=function(i,d){return F.canParse(i,d)},u.appendFrame=function(i,d,s){return this.initPTS===null?void 0:F.appendFrame(i,d,s,this.initPTS,this.frameIndex)},c}(N.default);w.minProbeByteLength=4,W.default=w},"./src/demux/mp4demuxer.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/mp4-tools.ts"),S=R("./src/demux/dummy-demuxed-track.ts"),O=function(){function F(e,w){this.remainderData=null,this.config=void 0,this.config=w}var j=F.prototype;return j.resetTimeStamp=function(){},j.resetInitSegment=function(){},j.resetContiguity=function(){},F.probe=function(w){return Object(N.findBox)({data:w,start:0,end:Math.min(w.length,16384)},["moof"]).length>0},j.demux=function(w){var g=w,c=Object(S.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(N.appendUint8Array)(this.remainderData,w));var u=Object(N.segmentValidRange)(g);this.remainderData=u.remainder,c.samples=u.valid||new Uint8Array}else c.samples=g;return{audioTrack:Object(S.dummyTrack)(),avcTrack:c,id3Track:Object(S.dummyTrack)(),textTrack:Object(S.dummyTrack)()}},j.flush=function(){var w=Object(S.dummyTrack)();return w.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(S.dummyTrack)(),avcTrack:w,id3Track:Object(S.dummyTrack)(),textTrack:Object(S.dummyTrack)()}},j.demuxSampleAes=function(w,g,c){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},j.destroy=function(){},F}();O.minProbeByteLength=1024,W.default=O},"./src/demux/mpegaudio.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"appendFrame",function(){return e}),R.d(W,"parseHeader",function(){return w}),R.d(W,"isHeaderPattern",function(){return g}),R.d(W,"isHeader",function(){return c}),R.d(W,"canParse",function(){return u}),R.d(W,"probe",function(){return a});var N=null,S=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],O=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],F=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],j=[0,1,1,4];function e(i,d,s,r,n){if(s+24>d.length)return;var t=w(d,s);if(t&&s+t.frameLength<=d.length){var v=t.samplesPerFrame*9e4/t.sampleRate,p=r+n*v,m={unit:d.subarray(s,s+t.frameLength),pts:p,dts:p};return i.config=[],i.channelCount=t.channelCount,i.samplerate=t.sampleRate,i.samples.push(m),{sample:m,length:t.frameLength,missing:0}}}function w(i,d){var s=i[d+1]>>3&3,r=i[d+1]>>1&3,n=i[d+2]>>4&15,t=i[d+2]>>2&3;if(s!==1&&n!==0&&n!==15&&t!==3){var v=i[d+2]>>1&1,p=i[d+3]>>6,m=s===3?3-r:r===3?3:4,b=S[m*14+n-1]*1e3,_=s===3?0:s===2?1:2,o=O[_*3+t],f=p===3?1:2,l=F[s][r],h=j[r],E=l*8*h,y=Math.floor(l*b/o+v)*h;if(N===null){var T=navigator.userAgent||"",L=T.match(/Chrome\/(\d+)/i);N=L?parseInt(L[1]):0}var D=!!N&&N<=87;return D&&r===2&&b>=224e3&&p===0&&(i[d+3]=i[d+3]|128),{sampleRate:o,channelCount:f,frameLength:y,samplesPerFrame:E}}}function g(i,d){return i[d]===255&&(i[d+1]&224)===224&&(i[d+1]&6)!==0}function c(i,d){return d+1<i.length&&g(i,d)}function u(i,d){var s=4;return g(i,d)&&s<=i.length-d}function a(i,d){if(d+1<i.length&&g(i,d)){var s=4,r=w(i,d),n=s;r!=null&&r.frameLength&&(n=r.frameLength);var t=d+n;return t===i.length||c(i,t)}return!1}},"./src/demux/sample-aes.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/crypt/decrypter.ts"),S=R("./src/demux/tsdemuxer.ts"),O=function(){function F(e,w,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new N.default(e,w,{removePKCS7Padding:!1})}var j=F.prototype;return j.decryptBuffer=function(w,g){this.decrypter.decrypt(w,this.keyData.key.buffer,this.keyData.iv.buffer,g)},j.decryptAacSample=function(w,g,c,u){var a=w[g].unit,i=a.subarray(16,a.length-a.length%16),d=i.buffer.slice(i.byteOffset,i.byteOffset+i.length),s=this;this.decryptBuffer(d,function(r){var n=new Uint8Array(r);a.set(n,16),u||s.decryptAacSamples(w,g+1,c)})},j.decryptAacSamples=function(w,g,c){for(;;g++){if(g>=w.length){c();return}if(w[g].unit.length<32)continue;var u=this.decrypter.isSync();if(this.decryptAacSample(w,g,c,u),!u)return}},j.getAvcEncryptedData=function(w){for(var g=Math.floor((w.length-48)/160)*16+16,c=new Int8Array(g),u=0,a=32;a<=w.length-16;a+=160,u+=16)c.set(w.subarray(a,a+16),u);return c},j.getAvcDecryptedUnit=function(w,g){for(var c=new Uint8Array(g),u=0,a=32;a<=w.length-16;a+=160,u+=16)w.set(c.subarray(u,u+16),a);return w},j.decryptAvcSample=function(w,g,c,u,a,i){var d=Object(S.discardEPB)(a.data),s=this.getAvcEncryptedData(d),r=this;this.decryptBuffer(s.buffer,function(n){a.data=r.getAvcDecryptedUnit(d,n),i||r.decryptAvcSamples(w,g,c+1,u)})},j.decryptAvcSamples=function(w,g,c,u){if(w instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,c=0){if(g>=w.length){u();return}for(var a=w[g].units;!(c>=a.length);c++){var i=a[c];if(i.data.length<=48||i.type!==1&&i.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(w,g,c,u,i,d),!d)return}}},F}();W.default=O},"./src/demux/transmuxer-interface.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return a});var N=R("./node_modules/webworkify-webpack/index.js"),S=R.n(N),O=R("./src/events.ts"),F=R("./src/demux/transmuxer.ts"),j=R("./src/utils/logger.ts"),e=R("./src/errors.ts"),w=R("./src/utils/mediasource-helper.ts"),g=R("./node_modules/eventemitter3/index.js"),c=R.n(g),u=Object(w.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function i(s,r,n,t){var v=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=s,this.id=r,this.onTransmuxComplete=n,this.onFlush=t;var p=s.config,m=function(l,h){h=h||{},h.frag=v.frag,h.id=v.id,s.trigger(l,h)};this.observer=new g.EventEmitter,this.observer.on(O.Events.FRAG_DECRYPTED,m),this.observer.on(O.Events.ERROR,m);var b={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(p.enableWorker&&typeof Worker!="undefined"){j.logger.log("demuxing in webworker");var o;try{o=this.worker=N("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),o.addEventListener("message",this.onwmsg),o.onerror=function(f){s.trigger(O.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(f.message+" ("+f.filename+":"+f.lineno+")")})},o.postMessage({cmd:"init",typeSupported:b,vendor:_,id:r,config:JSON.stringify(p)})}catch(f){j.logger.warn("Error in worker:",f),j.logger.error("Error while initializing DemuxerWorker, fallback to inline"),o&&self.URL.revokeObjectURL(o.objectURL),this.transmuxer=new F.default(this.observer,b,p,_,r),this.worker=null}}else this.transmuxer=new F.default(this.observer,b,p,_,r)}var d=i.prototype;return d.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var n=this.transmuxer;n&&(n.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},d.push=function(r,n,t,v,p,m,b,_,o,f){var l=this;o.transmuxing.start=self.performance.now();var h=this.transmuxer,E=this.worker,y=m?m.start:p.start,T=p.decryptdata,L=this.frag,D=!(L&&p.cc===L.cc),x=!(L&&o.level===L.level),P=L?o.sn-L.sn:-1,H=this.part?o.part-this.part.index:1,I=!x&&(P===1||P===0&&H===1),z=self.performance.now();(x||P||p.stats.parsing.start===0)&&(p.stats.parsing.start=z),m&&(H||!I)&&(m.stats.parsing.start=z);var $=new F.TransmuxState(D,I,_,x,y);if(!I||D){j.logger.log("[transmuxer-interface, "+p.type+"]: Starting new transmux session for sn: "+o.sn+" p: "+o.part+" level: "+o.level+" id: "+o.id+`
discontinuity: `+D+`
trackSwitch: `+x+`
contiguous: `+I+`
accurateTimeOffset: `+_+`
timeOffset: `+y);var fe=new F.TransmuxConfig(t,v,n,b,f);this.configureTransmuxer(fe)}if(this.frag=p,this.part=m,E)E.postMessage({cmd:"demux",data:r,decryptdata:T,chunkMeta:o,state:$},r instanceof ArrayBuffer?[r]:[]);else if(h){var ee=h.push(r,T,o,$);Object(F.isPromise)(ee)?ee.then(function(ye){l.handleTransmuxComplete(ye)}):this.handleTransmuxComplete(ee)}},d.flush=function(r){var n=this;r.transmuxing.start=self.performance.now();var t=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:r});else if(t){var p=t.flush(r);Object(F.isPromise)(p)?p.then(function(m){n.handleFlushResult(m,r)}):this.handleFlushResult(p,r)}},d.handleFlushResult=function(r,n){var t=this;r.forEach(function(v){t.handleTransmuxComplete(v)}),this.onFlush(n)},d.onWorkerMessage=function(r){var n=r.data,t=this.hls;switch(n.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(n.data);break}case"flush":{this.onFlush(n.data);break}default:{n.data=n.data||{},n.data.frag=this.frag,n.data.id=this.id,t.trigger(n.event,n.data);break}}},d.configureTransmuxer=function(r){var n=this.worker,t=this.transmuxer;n?n.postMessage({cmd:"configure",config:r}):t&&t.configure(r)},d.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},i}()},"./src/demux/transmuxer-worker.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return e});var N=R("./src/demux/transmuxer.ts"),S=R("./src/events.ts"),O=R("./src/utils/logger.ts"),F=R("./node_modules/eventemitter3/index.js"),j=R.n(F);function e(a){var i=new F.EventEmitter,d=function(r,n){a.postMessage({event:r,data:n})};i.on(S.Events.FRAG_DECRYPTED,d),i.on(S.Events.ERROR,d),a.addEventListener("message",function(s){var r=s.data;switch(r.cmd){case"init":{var n=JSON.parse(r.config);a.transmuxer=new N.default(i,r.typeSupported,n,r.vendor,r.id),Object(O.enableLogs)(n.debug),d("init",null);break}case"configure":{a.transmuxer.configure(r.config);break}case"demux":{var t=a.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(N.isPromise)(t)?t.then(function(m){w(a,m)}):w(a,t);break}case"flush":{var v=r.chunkMeta,p=a.transmuxer.flush(v);Object(N.isPromise)(p)?p.then(function(m){c(a,m,v)}):c(a,p,v);break}default:break}})}function w(a,i){if(u(i.remuxResult))return;var d=[],s=i.remuxResult,r=s.audio,n=s.video;r&&g(d,r),n&&g(d,n),a.postMessage({event:"transmuxComplete",data:i},d)}function g(a,i){i.data1&&a.push(i.data1.buffer),i.data2&&a.push(i.data2.buffer)}function c(a,i,d){i.forEach(function(s){w(a,s)}),a.postMessage({event:"flush",data:d})}function u(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n}),R.d(W,"isPromise",function(){return p}),R.d(W,"TransmuxConfig",function(){return m}),R.d(W,"TransmuxState",function(){return b});var N=R("./src/events.ts"),S=R("./src/errors.ts"),O=R("./src/crypt/decrypter.ts"),F=R("./src/demux/aacdemuxer.ts"),j=R("./src/demux/mp4demuxer.ts"),e=R("./src/demux/tsdemuxer.ts"),w=R("./src/demux/mp3demuxer.ts"),g=R("./src/remux/mp4-remuxer.ts"),c=R("./src/remux/passthrough-remuxer.ts"),u=R("./src/demux/chunk-cache.ts"),a=R("./src/utils/mp4-tools.ts"),i=R("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(_){i.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var s=[{demux:e.default,remux:g.default},{demux:j.default,remux:c.default},{demux:F.default,remux:g.default},{demux:w.default,remux:g.default}],r=1024;s.forEach(function(_){var o=_.demux;r=Math.max(r,o.minProbeByteLength)});var n=function(){function _(f,l,h,E,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new u.default,this.observer=f,this.typeSupported=l,this.config=h,this.vendor=E,this.id=y}var o=_.prototype;return o.configure=function(l){this.transmuxConfig=l,this.decrypter&&this.decrypter.reset()},o.push=function(l,h,E,y){var T=this,L=E.transmuxing;L.executeStart=d();var D=new Uint8Array(l),x=this.cache,P=this.config,H=this.currentTransmuxState,I=this.transmuxConfig;y&&(this.currentTransmuxState=y);var z=t(D,h);if(z&&z.method==="AES-128"){var $=this.getDecrypter();if(P.enableSoftwareAES){var fe=$.softwareDecrypt(D,z.key.buffer,z.iv.buffer);if(!fe)return L.executeEnd=d(),v(E);D=new Uint8Array(fe)}else return this.decryptionPromise=$.webCryptoDecrypt(D,z.key.buffer,z.iv.buffer).then(function(Ee){var Oe=T.push(Ee,null,E);return T.decryptionPromise=null,Oe}),this.decryptionPromise}var ee=y||H,ye=ee.contiguous,pe=ee.discontinuity,ae=ee.trackSwitch,se=ee.accurateTimeOffset,_e=ee.timeOffset,te=I.audioCodec,k=I.videoCodec,A=I.defaultInitPts,C=I.duration,B=I.initSegmentData;if((pe||ae)&&this.resetInitSegment(B,te,k,C),pe&&this.resetInitialTimestamp(A),ye||this.resetContiguity(),this.needsProbing(D,pe,ae)){if(x.dataLength){var K=x.flush();D=Object(a.appendUint8Array)(K,D)}this.configureTransmuxer(D,I)}var M=this.transmux(D,z,_e,se,E),ie=this.currentTransmuxState;return ie.contiguous=!0,ie.discontinuity=!1,ie.trackSwitch=!1,L.executeEnd=d(),M},o.flush=function(l){var h=this,E=l.transmuxing;E.executeStart=d();var y=this.decrypter,T=this.cache,L=this.currentTransmuxState,D=this.decryptionPromise;if(D)return D.then(function(){return h.flush(l)});var x=[],P=L.timeOffset;if(y){var H=y.flush();H&&x.push(this.push(H,null,l))}var I=T.dataLength;T.reset();var z=this.demuxer,$=this.remuxer;if(!z||!$)return I>=r&&this.observer.emit(N.Events.ERROR,N.Events.ERROR,{type:S.ErrorTypes.MEDIA_ERROR,details:S.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=d(),[v(l)];var fe=z.flush(P);return p(fe)?fe.then(function(ee){return h.flushRemux(x,ee,l),x}):(this.flushRemux(x,fe,l),x)},o.flushRemux=function(l,h,E){var y=h.audioTrack,T=h.avcTrack,L=h.id3Track,D=h.textTrack,x=this.currentTransmuxState,P=x.accurateTimeOffset,H=x.timeOffset;i.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var I=this.remuxer.remux(y,T,L,D,H,P,!0,this.id);l.push({remuxResult:I,chunkMeta:E}),E.transmuxing.executeEnd=d()},o.resetInitialTimestamp=function(l){var h=this.demuxer,E=this.remuxer;if(!h||!E)return;h.resetTimeStamp(l),E.resetTimeStamp(l)},o.resetContiguity=function(){var l=this.demuxer,h=this.remuxer;if(!l||!h)return;l.resetContiguity(),h.resetNextTimestamp()},o.resetInitSegment=function(l,h,E,y){var T=this.demuxer,L=this.remuxer;if(!T||!L)return;T.resetInitSegment(h,E,y),L.resetInitSegment(l,h,E)},o.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},o.transmux=function(l,h,E,y,T){var L;return h&&h.method==="SAMPLE-AES"?L=this.transmuxSampleAes(l,h,E,y,T):L=this.transmuxUnencrypted(l,E,y,T),L},o.transmuxUnencrypted=function(l,h,E,y){var T=this.demuxer.demux(l,h,!1,!this.config.progressive),L=T.audioTrack,D=T.avcTrack,x=T.id3Track,P=T.textTrack,H=this.remuxer.remux(L,D,x,P,h,E,!1,this.id);return{remuxResult:H,chunkMeta:y}},o.transmuxSampleAes=function(l,h,E,y,T){var L=this;return this.demuxer.demuxSampleAes(l,h,E).then(function(D){var x=L.remuxer.remux(D.audioTrack,D.avcTrack,D.id3Track,D.textTrack,E,y,!1,L.id);return{remuxResult:x,chunkMeta:T}})},o.configureTransmuxer=function(l,h){for(var E=this.config,y=this.observer,T=this.typeSupported,L=this.vendor,D=h.audioCodec,x=h.defaultInitPts,P=h.duration,H=h.initSegmentData,I=h.videoCodec,z,$=0,fe=s.length;$<fe;$++)if(s[$].demux.probe(l)){z=s[$];break}z||(i.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),z={demux:j.default,remux:c.default});var ee=this.demuxer,ye=this.remuxer,pe=z.remux,ae=z.demux;(!ye||!(ye instanceof pe))&&(this.remuxer=new pe(y,E,T,L)),(!ee||!(ee instanceof ae))&&(this.demuxer=new ae(y,E,T),this.probe=ae.probe),this.resetInitSegment(H,D,I,P),this.resetInitialTimestamp(x)},o.needsProbing=function(l,h,E){return!this.demuxer||!this.remuxer||h||E},o.getDecrypter=function(){var l=this.decrypter;return l||(l=this.decrypter=new O.default(this.observer,this.config)),l},_}();function t(_,o){var f=null;return _.byteLength>0&&o!=null&&o.key!=null&&o.iv!==null&&o.method!=null&&(f=o),f}var v=function(o){return{remuxResult:{},chunkMeta:o}};function p(_){return"then"in _&&_.then instanceof Function}var m=function(o,f,l,h,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=o,this.videoCodec=f,this.initSegmentData=l,this.duration=h,this.defaultInitPts=E},b=function(o,f,l,h,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=o,this.contiguous=f,this.accurateTimeOffset=l,this.trackSwitch=h,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"discardEPB",function(){return v});var N=R("./src/demux/adts.ts"),S=R("./src/demux/mpegaudio.ts"),O=R("./src/demux/exp-golomb.ts"),F=R("./src/demux/id3.ts"),j=R("./src/demux/sample-aes.ts"),e=R("./src/events.ts"),w=R("./src/utils/mp4-tools.ts"),g=R("./src/utils/logger.ts"),c=R("./src/errors.ts"),u={video:1,audio:2,id3:3,text:4},a=function(){function p(b,_,o){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=b,this.config=_,this.typeSupported=o}p.probe=function(_){var o=p.syncOffset(_);return o<0?!1:(o&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+o+", junk ahead ?"),!0)},p.syncOffset=function(_){for(var o=Math.min(1e3,_.length-3*188),f=0;f<o;){if(_[f]===71&&_[f+188]===71&&_[f+2*188]===71)return f;f++}return-1},p.createTrack=function(_,o){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:u[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?o:void 0}};var m=p.prototype;return m.resetInitSegment=function(_,o,f){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=p.createTrack("video",f),this._audioTrack=p.createTrack("audio",f),this._id3Track=p.createTrack("id3",f),this._txtTrack=p.createTrack("text",f),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=_,this.videoCodec=o,this._duration=f},m.resetTimeStamp=function(){},m.resetContiguity=function(){var _=this._audioTrack,o=this._avcTrack,f=this._id3Track;_&&(_.pesData=null),o&&(o.pesData=null),f&&(f.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(_,o,f,l){f===void 0&&(f=!1),l===void 0&&(l=!1),f||(this.sampleAes=null);var h,E=this._avcTrack,y=this._audioTrack,T=this._id3Track,L=E.pid,D=E.pesData,x=y.pid,P=T.pid,H=y.pesData,I=T.pesData,z=!1,$=this.pmtParsed,fe=this._pmtId,ee=_.length;if(this.remainderData&&(_=Object(w.appendUint8Array)(this.remainderData,_),ee=_.length,this.remainderData=null),ee<188&&!l)return this.remainderData=_,{audioTrack:y,avcTrack:E,id3Track:T,textTrack:this._txtTrack};var ye=Math.max(0,p.syncOffset(_));ee-=(ee+ye)%188,ee<_.byteLength&&!l&&(this.remainderData=new Uint8Array(_.buffer,ee,_.buffer.byteLength-ee));for(var pe=ye;pe<ee;pe+=188)if(_[pe]===71){var ae=!!(_[pe+1]&64),se=((_[pe+1]&31)<<8)+_[pe+2],_e=(_[pe+3]&48)>>4,te=void 0;if(_e>1){if(te=pe+5+_[pe+4],te===pe+188)continue}else te=pe+4;switch(se){case L:ae&&(D&&(h=r(D))&&this.parseAVCPES(h,!1),D={data:[],size:0}),D&&(D.data.push(_.subarray(te,pe+188)),D.size+=pe+188-te);break;case x:ae&&(H&&(h=r(H))&&(y.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),H={data:[],size:0}),H&&(H.data.push(_.subarray(te,pe+188)),H.size+=pe+188-te);break;case P:ae&&(I&&(h=r(I))&&this.parseID3PES(h),I={data:[],size:0}),I&&(I.data.push(_.subarray(te,pe+188)),I.size+=pe+188-te);break;case 0:ae&&(te+=_[te]+1),fe=this._pmtId=d(_,te);break;case fe:{ae&&(te+=_[te]+1);var k=s(_,te,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,f);L=k.avc,L>0&&(E.pid=L),x=k.audio,x>0&&(y.pid=x,y.isAAC=k.isAAC),P=k.id3,P>0&&(T.pid=P),z&&!$&&(g.logger.log("reparse from beginning"),z=!1,pe=ye-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:z=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=D,y.pesData=H,T.pesData=I;var A={audioTrack:y,avcTrack:E,id3Track:T,textTrack:this._txtTrack};return l&&this.extractRemainingSamples(A),A},m.flush=function(){var _=this.remainderData;this.remainderData=null;var o;return _?o=this.demux(_,-1,!1,!0):o={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(o),this.sampleAes?this.decrypt(o,this.sampleAes):o},m.extractRemainingSamples=function(_){var o=_.audioTrack,f=_.avcTrack,l=_.id3Track,h=f.pesData,E=o.pesData,y=l.pesData,T;h&&(T=r(h))?(this.parseAVCPES(T,!0),f.pesData=null):f.pesData=h,E&&(T=r(E))?(o.isAAC?this.parseAACPES(T):this.parseMPEGPES(T),o.pesData=null):(E!=null&&E.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),o.pesData=E),y&&(T=r(y))?(this.parseID3PES(T),l.pesData=null):l.pesData=y},m.demuxSampleAes=function(_,o,f){var l=this.demux(_,f,!0,!this.config.progressive),h=this.sampleAes=new j.default(this.observer,this.config,o);return this.decrypt(l,h)},m.decrypt=function(_,o){return new Promise(function(f){var l=_.audioTrack,h=_.avcTrack;l.samples&&l.isAAC?o.decryptAacSamples(l.samples,0,function(){h.samples?o.decryptAvcSamples(h.samples,0,0,function(){f(_)}):f(_)}):h.samples&&o.decryptAvcSamples(h.samples,0,0,function(){f(_)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(_,o){var f=this,l=this._avcTrack,h=this.parseAVCNALu(_.data),E=!1,y=this.avcSample,T,L=!1;_.data=null,y&&h.length&&!l.audFound&&(n(y,l),y=this.avcSample=i(!1,_.pts,_.dts,"")),h.forEach(function(D){switch(D.type){case 1:{T=!0,y||(y=f.avcSample=i(!0,_.pts,_.dts,"")),E&&(y.debug+="NDR "),y.frame=!0;var x=D.data;if(L&&x.length>4){var P=new O.default(x).readSliceType();(P===2||P===4||P===7||P===9)&&(y.key=!0)}break}case 5:T=!0,y||(y=f.avcSample=i(!0,_.pts,_.dts,"")),E&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{T=!0,E&&y&&(y.debug+="SEI ");var H=new O.default(v(D.data));H.readUByte();for(var I=0,z=0,$=!1,fe=0;!$&&H.bytesAvailable>1;){I=0;do fe=H.readUByte(),I+=fe;while(fe===255);z=0;do fe=H.readUByte(),z+=fe;while(fe===255);if(I===4&&H.bytesAvailable!==0){$=!0;var ee=H.readUByte();if(ee===181){var ye=H.readUShort();if(ye===49){var pe=H.readUInt();if(pe===1195456820){var ae=H.readUByte();if(ae===3){for(var se=H.readUByte(),_e=H.readUByte(),te=31&se,k=[se,_e],A=0;A<te;A++)k.push(H.readUByte()),k.push(H.readUByte()),k.push(H.readUByte());t(f._txtTrack.samples,{type:3,pts:_.pts,bytes:k})}}}}}else if(I===5&&H.bytesAvailable!==0){if($=!0,z>16){for(var C=[],B=0;B<16;B++)C.push(H.readUByte().toString(16)),(B===3||B===5||B===7||B===9)&&C.push("-");for(var K=z-16,M=new Uint8Array(K),ie=0;ie<K;ie++)M[ie]=H.readUByte();t(f._txtTrack.samples,{pts:_.pts,payloadType:I,uuid:C.join(""),userData:Object(F.utf8ArrayToStr)(M),userDataBytes:M})}}else if(z<H.bytesAvailable)for(var Ee=0;Ee<z;Ee++)H.readUByte()}break}case 7:if(T=!0,L=!0,E&&y&&(y.debug+="SPS "),!l.sps){var Oe=new O.default(D.data),q=Oe.readSPS();l.width=q.width,l.height=q.height,l.pixelRatio=q.pixelRatio,l.sps=[D.data],l.duration=f._duration;for(var de=D.data.subarray(1,4),Te="avc1.",xe=0;xe<3;xe++){var Pe=de[xe].toString(16);Pe.length<2&&(Pe="0"+Pe),Te+=Pe}l.codec=Te}break;case 8:T=!0,E&&y&&(y.debug+="PPS "),l.pps||(l.pps=[D.data]);break;case 9:T=!1,l.audFound=!0,y&&n(y,l),y=f.avcSample=i(!1,_.pts,_.dts,E?"AUD ":"");break;case 12:T=!1;break;default:T=!1,y&&(y.debug+="unknown NAL "+D.type+" ");break}if(y&&T){var Ne=y.units;Ne.push(D)}}),o&&y&&(n(y,l),this.avcSample=null)},m.getLastNalUnit=function(){var _,o=this.avcSample,f;if(!o||o.units.length===0){var l=this._avcTrack.samples;o=l[l.length-1]}if((_=o)!==null&&_!==void 0&&_.units){var h=o.units;f=h[h.length-1]}return f},m.parseAVCNALu=function(_){var o=_.byteLength,f=this._avcTrack,l=f.naluState||0,h=l,E=[],y=0,T,L,D,x=-1,P=0;for(l===-1&&(x=0,P=_[0]&31,l=0,y=1);y<o;){if(T=_[y++],!l){l=T?0:1;continue}if(l===1){l=T?0:2;continue}if(!T)l=3;else if(T===1){if(x>=0){var H={data:_.subarray(x,y-l-1),type:P};E.push(H)}else{var I=this.getLastNalUnit();if(I&&(h&&y<=4-h&&(I.state&&(I.data=I.data.subarray(0,I.data.byteLength-h))),L=y-l-1,L>0)){var z=new Uint8Array(I.data.byteLength+L);z.set(I.data,0),z.set(_.subarray(0,L),I.data.byteLength),I.data=z,I.state=0}}y<o?(D=_[y]&31,x=y,P=D,l=0):l=-1}else l=0}if(x>=0&&l>=0){var $={data:_.subarray(x,o),type:P,state:l};E.push($)}if(E.length===0){var fe=this.getLastNalUnit();if(fe){var ee=new Uint8Array(fe.data.byteLength+_.byteLength);ee.set(fe.data,0),ee.set(_,fe.data.byteLength),fe.data=ee}}return f.naluState=l,E},m.parseAACPES=function(_){var o=0,f=this._audioTrack,l=this.aacOverFlow,h=_.data;if(l){this.aacOverFlow=null;var E=l.sample.unit.byteLength,y=Math.min(l.missing,E),T=E-y;l.sample.unit.set(h.subarray(0,y),T),f.samples.push(l.sample),o=l.missing}var L,D;for(L=o,D=h.length;L<D-1&&!N.isHeader(h,L);L++);if(L!==o){var x,P;if(L<D-1?(x="AAC PES did not start with ADTS header,offset:"+L,P=!1):(x="no ADTS header found in AAC PES",P=!0),g.logger.warn("parsing error:"+x),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.FRAG_PARSING_ERROR,fatal:P,reason:x}),P)return}N.initTrackConfig(f,this.observer,h,L,this.audioCodec);var H;if(_.pts!==void 0)H=_.pts;else if(l){var I=N.getFrameDuration(f.samplerate);H=l.sample.pts+I}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var z=0;L<D;)if(N.isHeader(h,L)){if(L+5<D){var $=N.appendFrame(f,h,L,H,z);if($)if($.missing)this.aacOverFlow=$;else{L+=$.length,z++;continue}}break}else L++},m.parseMPEGPES=function(_){var o=_.data,f=o.length,l=0,h=0,E=_.pts;if(E===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<f;)if(S.isHeader(o,h)){var y=S.appendFrame(this._audioTrack,o,h,E,l);if(y)h+=y.length,l++;else break}else h++},m.parseID3PES=function(_){if(_.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(_)},p}();a.minProbeByteLength=188;function i(p,m,b,_){return{key:p,frame:!1,pts:m,dts:b,units:[],debug:_,length:0}}function d(p,m){return(p[m+10]&31)<<8|p[m+11]}function s(p,m,b,_){var o={audio:-1,avc:-1,id3:-1,isAAC:!0},f=(p[m+1]&15)<<8|p[m+2],l=m+3+f-4,h=(p[m+10]&15)<<8|p[m+11];for(m+=12+h;m<l;){var E=(p[m+1]&31)<<8|p[m+2];switch(p[m]){case 207:if(!_){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:o.audio===-1&&(o.audio=E);break;case 21:o.id3===-1&&(o.id3=E);break;case 219:if(!_){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:o.avc===-1&&(o.avc=E);break;case 3:case 4:b?o.audio===-1&&(o.audio=E,o.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}m+=((p[m+3]&15)<<8|p[m+4])+5}return o}function r(p){var m=0,b,_,o,f,l,h=p.data;if(!p||p.size===0)return null;for(;h[0].length<19&&h.length>1;){var E=new Uint8Array(h[0].length+h[1].length);E.set(h[0]),E.set(h[1],h[0].length),h[0]=E,h.splice(1,1)}b=h[0];var y=(b[0]<<16)+(b[1]<<8)+b[2];if(y===1){if(_=(b[4]<<8)+b[5],_&&_>p.size-6)return null;var T=b[7];T&192&&(f=(b[9]&14)*536870912+(b[10]&255)*4194304+(b[11]&254)*16384+(b[12]&255)*128+(b[13]&254)/2,T&64?(l=(b[14]&14)*536870912+(b[15]&255)*4194304+(b[16]&254)*16384+(b[17]&255)*128+(b[18]&254)/2,f-l>60*9e4&&(g.logger.warn(Math.round((f-l)/9e4)+"s delta between PTS and DTS, align them"),f=l)):l=f),o=b[8];var L=o+9;if(p.size<=L)return null;p.size-=L;for(var D=new Uint8Array(p.size),x=0,P=h.length;x<P;x++){b=h[x];var H=b.byteLength;if(L)if(L>H){L-=H;continue}else b=b.subarray(L),H-=L,L=0;D.set(b,m),m+=H}return _&&(_-=o+3),{data:D,pts:f,dts:l,len:_}}return null}function n(p,m){if(p.units.length&&p.frame){if(p.pts===void 0){var b=m.samples,_=b.length;if(_){var o=b[_-1];p.pts=o.pts,p.dts=o.dts}else{m.dropped++;return}}m.samples.push(p)}p.debug.length&&g.logger.log(p.pts+"/"+p.dts+":"+p.debug)}function t(p,m){var b=p.length;if(b>0){if(m.pts>=p[b-1].pts)p.push(m);else for(var _=b-1;_>=0;_--)if(m.pts<p[_].pts){p.splice(_,0,m);break}}else p.push(m)}function v(p){for(var m=p.byteLength,b=[],_=1;_<m-2;)p[_]===0&&p[_+1]===0&&p[_+2]===3?(b.push(_+2),_+=2):_++;if(b.length===0)return p;var o=m-b.length,f=new Uint8Array(o),l=0;for(_=0;_<o;l++,_++)l===b[0]&&(l++,b.shift()),f[_]=p[l];return f}W.default=a},"./src/errors.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"ErrorTypes",function(){return N}),R.d(W,"ErrorDetails",function(){return S});var N;(function(O){O.NETWORK_ERROR="networkError",O.MEDIA_ERROR="mediaError",O.KEY_SYSTEM_ERROR="keySystemError",O.MUX_ERROR="muxError",O.OTHER_ERROR="otherError"})(N||(N={}));var S;(function(O){O.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",O.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",O.KEY_SYSTEM_NO_SESSION="keySystemNoSession",O.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",O.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",O.MANIFEST_LOAD_ERROR="manifestLoadError",O.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",O.MANIFEST_PARSING_ERROR="manifestParsingError",O.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",O.LEVEL_EMPTY_ERROR="levelEmptyError",O.LEVEL_LOAD_ERROR="levelLoadError",O.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",O.LEVEL_SWITCH_ERROR="levelSwitchError",O.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",O.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",O.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",O.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",O.FRAG_LOAD_ERROR="fragLoadError",O.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",O.FRAG_DECRYPT_ERROR="fragDecryptError",O.FRAG_PARSING_ERROR="fragParsingError",O.REMUX_ALLOC_ERROR="remuxAllocError",O.KEY_LOAD_ERROR="keyLoadError",O.KEY_LOAD_TIMEOUT="keyLoadTimeOut",O.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",O.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",O.BUFFER_APPEND_ERROR="bufferAppendError",O.BUFFER_APPENDING_ERROR="bufferAppendingError",O.BUFFER_STALLED_ERROR="bufferStalledError",O.BUFFER_FULL_ERROR="bufferFullError",O.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",O.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",O.INTERNAL_EXCEPTION="internalException",O.INTERNAL_ABORTED="aborted",O.UNKNOWN="unknown"})(S||(S={}))},"./src/events.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"Events",function(){return N});var N;(function(S){S.MEDIA_ATTACHING="hlsMediaAttaching",S.MEDIA_ATTACHED="hlsMediaAttached",S.MEDIA_DETACHING="hlsMediaDetaching",S.MEDIA_DETACHED="hlsMediaDetached",S.BUFFER_RESET="hlsBufferReset",S.BUFFER_CODECS="hlsBufferCodecs",S.BUFFER_CREATED="hlsBufferCreated",S.BUFFER_APPENDING="hlsBufferAppending",S.BUFFER_APPENDED="hlsBufferAppended",S.BUFFER_EOS="hlsBufferEos",S.BUFFER_FLUSHING="hlsBufferFlushing",S.BUFFER_FLUSHED="hlsBufferFlushed",S.MANIFEST_LOADING="hlsManifestLoading",S.MANIFEST_LOADED="hlsManifestLoaded",S.MANIFEST_PARSED="hlsManifestParsed",S.LEVEL_SWITCHING="hlsLevelSwitching",S.LEVEL_SWITCHED="hlsLevelSwitched",S.LEVEL_LOADING="hlsLevelLoading",S.LEVEL_LOADED="hlsLevelLoaded",S.LEVEL_UPDATED="hlsLevelUpdated",S.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",S.LEVELS_UPDATED="hlsLevelsUpdated",S.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",S.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",S.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",S.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",S.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",S.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",S.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",S.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",S.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",S.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",S.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",S.CUES_PARSED="hlsCuesParsed",S.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",S.INIT_PTS_FOUND="hlsInitPtsFound",S.FRAG_LOADING="hlsFragLoading",S.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",S.FRAG_LOADED="hlsFragLoaded",S.FRAG_DECRYPTED="hlsFragDecrypted",S.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",S.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",S.FRAG_PARSING_METADATA="hlsFragParsingMetadata",S.FRAG_PARSED="hlsFragParsed",S.FRAG_BUFFERED="hlsFragBuffered",S.FRAG_CHANGED="hlsFragChanged",S.FPS_DROP="hlsFpsDrop",S.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",S.ERROR="hlsError",S.DESTROYING="hlsDestroying",S.KEY_LOADING="hlsKeyLoading",S.KEY_LOADED="hlsKeyLoaded",S.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",S.BACK_BUFFER_REACHED="hlsBackBufferReached"})(N||(N={}))},"./src/hls.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return p});var N=R("./node_modules/url-toolkit/src/url-toolkit.js"),S=R.n(N),O=R("./src/loader/playlist-loader.ts"),F=R("./src/loader/key-loader.ts"),j=R("./src/controller/id3-track-controller.ts"),e=R("./src/controller/latency-controller.ts"),w=R("./src/controller/level-controller.ts"),g=R("./src/controller/fragment-tracker.ts"),c=R("./src/controller/stream-controller.ts"),u=R("./src/is-supported.ts"),a=R("./src/utils/logger.ts"),i=R("./src/config.ts"),d=R("./node_modules/eventemitter3/index.js"),s=R.n(d),r=R("./src/events.ts"),n=R("./src/errors.ts");function t(m,b){for(var _=0;_<b.length;_++){var o=b[_];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}function v(m,b,_){return b&&t(m.prototype,b),_&&t(m,_),m}var p=function(){m.isSupported=function(){return Object(u.isSupported)()};function m(_){_===void 0&&(_={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new d.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var o=this.config=Object(i.mergeConfig)(m.DefaultConfig,_);this.userConfig=_,Object(a.enableLogs)(o.debug),this._autoLevelCapping=-1,o.progressive&&Object(i.enableStreamingMode)(o);var f=o.abrController,l=o.bufferController,h=o.capLevelController,E=o.fpsController,y=this.abrController=new f(this),T=this.bufferController=new l(this),L=this.capLevelController=new h(this),D=new E(this),x=new O.default(this),P=new F.default(this),H=new j.default(this),I=this.levelController=new w.default(this),z=new g.FragmentTracker(this),$=this.streamController=new c.default(this,z);L.setStreamController($),D.setStreamController($);var fe=[I,$];this.networkControllers=fe;var ee=[x,P,y,T,L,D,H,z];this.audioTrackController=this.createController(o.audioTrackController,null,fe),this.createController(o.audioStreamController,z,fe),this.subtitleTrackController=this.createController(o.subtitleTrackController,null,fe),this.createController(o.subtitleStreamController,z,fe),this.createController(o.timelineController,null,ee),this.emeController=this.createController(o.emeController,null,ee),this.cmcdController=this.createController(o.cmcdController,null,ee),this.latencyController=this.createController(e.default,null,ee),this.coreComponents=ee}var b=m.prototype;return b.createController=function(o,f,l){if(o){var h=f?new o(this,f):new o(this);return l&&l.push(h),h}return null},b.on=function(o,f,l){l===void 0&&(l=this),this._emitter.on(o,f,l)},b.once=function(o,f,l){l===void 0&&(l=this),this._emitter.once(o,f,l)},b.removeAllListeners=function(o){this._emitter.removeAllListeners(o)},b.off=function(o,f,l,h){l===void 0&&(l=this),this._emitter.off(o,f,l,h)},b.listeners=function(o){return this._emitter.listeners(o)},b.emit=function(o,f,l){return this._emitter.emit(o,f,l)},b.trigger=function(o,f){if(this.config.debug)return this.emit(o,o,f);try{return this.emit(o,o,f)}catch(l){a.logger.error("An internal error happened while handling event "+o+'. Error message: "'+l.message+'". Here is a stacktrace:',l),this.trigger(r.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:o,error:l})}return!1},b.listenerCount=function(o){return this._emitter.listenerCount(o)},b.destroy=function(){a.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(o){return o.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(o){return o.destroy()}),this.coreComponents.length=0},b.attachMedia=function(o){a.logger.log("attachMedia"),this._media=o,this.trigger(r.Events.MEDIA_ATTACHING,{media:o})},b.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},b.loadSource=function(o){this.stopLoad();var f=this.media,l=this.url,h=this.url=N.buildAbsoluteURL(self.location.href,o,{alwaysNormalize:!0});a.logger.log("loadSource:"+h),f&&l&&l!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(f)),this.trigger(r.Events.MANIFEST_LOADING,{url:o})},b.startLoad=function(o){o===void 0&&(o=-1),a.logger.log("startLoad("+o+")"),this.networkControllers.forEach(function(f){f.startLoad(o)})},b.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(o){o.stopLoad()})},b.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},b.recoverMediaError=function(){a.logger.log("recoverMediaError");var o=this._media;this.detachMedia(),o&&this.attachMedia(o)},b.removeLevel=function(o,f){f===void 0&&(f=0),this.levelController.removeLevel(o,f)},v(m,[{key:"levels",get:function(){var o=this.levelController.levels;return o||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(o){a.logger.log("set currentLevel:"+o),this.loadLevel=o,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(o){a.logger.log("set nextLevel:"+o),this.levelController.manualLevel=o,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(o){a.logger.log("set loadLevel:"+o),this.levelController.manualLevel=o}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(o){this.levelController.nextLoadLevel=o}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(o){a.logger.log("set firstLevel:"+o),this.levelController.firstLevel=o}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(o){a.logger.log("set startLevel:"+o),o!==-1&&(o=Math.max(o,this.minAutoLevel)),this.levelController.startLevel=o}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(o){var f=!!o;f!==this.config.capLevelToPlayerSize&&(f?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=f)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(o){this._autoLevelCapping!==o&&(a.logger.log("set autoLevelCapping:"+o),this._autoLevelCapping=o)}},{key:"bandwidthEstimate",get:function(){var o=this.abrController.bwEstimator;return o?o.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var o=this.levels,f=this.config.minAutoBitrate;if(!o)return 0;for(var l=o.length,h=0;h<l;h++)if(o[h].maxBitrate>f)return h;return 0}},{key:"maxAutoLevel",get:function(){var o=this.levels,f=this.autoLevelCapping,l;return f===-1&&o&&o.length?l=o.length-1:l=f,l}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(o){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,o)}},{key:"audioTracks",get:function(){var o=this.audioTrackController;return o?o.audioTracks:[]}},{key:"audioTrack",get:function(){var o=this.audioTrackController;return o?o.audioTrack:-1},set:function(o){var f=this.audioTrackController;f&&(f.audioTrack=o)}},{key:"subtitleTracks",get:function(){var o=this.subtitleTrackController;return o?o.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var o=this.subtitleTrackController;return o?o.subtitleTrack:-1},set:function(o){var f=this.subtitleTrackController;f&&(f.subtitleTrack=o)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var o=this.subtitleTrackController;return o?o.subtitleDisplay:!1},set:function(o){var f=this.subtitleTrackController;f&&(f.subtitleDisplay=o)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(o){this.config.lowLatencyMode=o}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return r.Events}},{key:"ErrorTypes",get:function(){return n.ErrorTypes}},{key:"ErrorDetails",get:function(){return n.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:i.hlsDefaultConfig},set:function(o){m.defaultConfig=o}}]),m}();p.defaultConfig=void 0},"./src/is-supported.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"isSupported",function(){return O}),R.d(W,"changeTypeSupported",function(){return F});var N=R("./src/utils/mediasource-helper.ts");function S(){return self.SourceBuffer||self.WebKitSourceBuffer}function O(){var j=Object(N.getMediaSource)();if(!j)return!1;var e=S(),w=j&&typeof j.isTypeSupported=="function"&&j.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!w&&!!g}function F(){var j,e=S();return typeof(e==null||((j=e.prototype)===null||j===void 0)?void 0:j.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return a}),R.d(W,"LoadError",function(){return d});var N=R("./src/polyfills/number.ts"),S=R("./src/errors.ts");function O(s,r){s.prototype=Object.create(r.prototype),s.prototype.constructor=s,g(s,r)}function F(s){var r=typeof Map=="function"?new Map:void 0;return F=function(t){if(t===null||!w(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(t))return r.get(t);r.set(t,v)}function v(){return j(t,arguments,c(this).constructor)}return v.prototype=Object.create(t.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g(v,t)},F(s)}function j(s,r,n){return e()?j=Reflect.construct:j=function(v,p,m){var b=[null];b.push.apply(b,p);var _=Function.bind.apply(v,b),o=new _;return m&&g(o,m.prototype),o},j.apply(null,arguments)}function e(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}function w(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function g(s,r){return g=Object.setPrototypeOf||function(t,v){return t.__proto__=v,t},g(s,r)}function c(s){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},c(s)}var u=Math.pow(2,17),a=function(){function s(n){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=n}var r=s.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(t,v){var p=this,m=t.url;if(!m)return Promise.reject(new d({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var b=this.config,_=b.fLoader,o=b.loader;return new Promise(function(f,l){p.loader&&p.loader.destroy();var h=p.loader=t.loader=_?new _(b):new o(b),E=i(t),y={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:b.fragLoadingMaxRetryTimeout,highWaterMark:u};t.stats=h.stats,h.load(E,y,{onSuccess:function(L,D,x,P){p.resetLoader(t,h),f({frag:t,part:null,payload:L.data,networkDetails:P})},onError:function(L,D,x){p.resetLoader(t,h),l(new d({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:L,networkDetails:x}))},onAbort:function(L,D,x){p.resetLoader(t,h),l(new d({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:x}))},onTimeout:function(L,D,x){p.resetLoader(t,h),l(new d({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:x}))},onProgress:function(L,D,x,P){v&&v({frag:t,part:null,payload:x,networkDetails:P})}})})},r.loadPart=function(t,v,p){var m=this;this.abort();var b=this.config,_=b.fLoader,o=b.loader;return new Promise(function(f,l){m.loader&&m.loader.destroy();var h=m.loader=t.loader=_?new _(b):new o(b),E=i(t,v),y={timeout:b.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:b.fragLoadingMaxRetryTimeout,highWaterMark:u};v.stats=h.stats,h.load(E,y,{onSuccess:function(L,D,x,P){m.resetLoader(t,h),m.updateStatsFromPart(t,v);var H={frag:t,part:v,payload:L.data,networkDetails:P};p(H),f(H)},onError:function(L,D,x){m.resetLoader(t,h),l(new d({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:v,response:L,networkDetails:x}))},onAbort:function(L,D,x){t.stats.aborted=v.stats.aborted,m.resetLoader(t,h),l(new d({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:v,networkDetails:x}))},onTimeout:function(L,D,x){m.resetLoader(t,h),l(new d({type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:v,networkDetails:x}))}})})},r.updateStatsFromPart=function(t,v){var p=t.stats,m=v.stats,b=m.total;if(p.loaded+=m.loaded,b){var _=Math.round(t.duration/v.duration),o=Math.min(Math.round(p.loaded/b),_),f=_-o,l=f*Math.round(p.loaded/o);p.total=p.loaded+l}else p.total=Math.max(p.loaded,p.total);var h=p.loading,E=m.loading;h.start?h.first+=E.first-E.start:(h.start=E.start,h.first=E.first),h.end=E.end},r.resetLoader=function(t,v){t.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},s}();function i(s,r){r===void 0&&(r=null);var n=r||s,t={frag:s,part:r,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},v=n.byteRangeStartOffset,p=n.byteRangeEndOffset;return Object(N.isFiniteNumber)(v)&&Object(N.isFiniteNumber)(p)&&(t.rangeStart=v,t.rangeEnd=p),t}var d=function(s){O(r,s);function r(n){for(var t,v=arguments.length,p=new Array(v>1?v-1:0),m=1;m<v;m++)p[m-1]=arguments[m];return t=s.call.apply(s,[this].concat(p))||this,t.data=void 0,t.data=n,t}return r}(F(Error))},"./src/loader/fragment.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"ElementaryStreamTypes",function(){return a}),R.d(W,"BaseSegment",function(){return i}),R.d(W,"Fragment",function(){return d}),R.d(W,"Part",function(){return s});var N=R("./src/polyfills/number.ts"),S=R("./node_modules/url-toolkit/src/url-toolkit.js"),O=R.n(S),F=R("./src/utils/logger.ts"),j=R("./src/loader/level-key.ts"),e=R("./src/loader/load-stats.ts");function w(r,n){r.prototype=Object.create(n.prototype),r.prototype.constructor=r,g(r,n)}function g(r,n){return g=Object.setPrototypeOf||function(v,p){return v.__proto__=p,v},g(r,n)}function c(r,n){for(var t=0;t<n.length;t++){var v=n[t];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(r,v.key,v)}}function u(r,n,t){return n&&c(r.prototype,n),t&&c(r,t),r}var a;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(a||(a={}));var i=function(){function r(t){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[a.AUDIO]=null,v[a.VIDEO]=null,v[a.AUDIOVIDEO]=null,v),this.baseurl=t}var n=r.prototype;return n.setByteRange=function(v,p){var m=v.split("@",2),b=[];m.length===1?b[0]=p?p.byteRangeEndOffset:0:b[0]=parseInt(m[1]),b[1]=parseInt(m[0])+b[0],this._byteRange=b},u(r,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(S.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),r}(),d=function(r){w(n,r);function n(v,p){var m;return m=r.call(this,p)||this,m._decryptdata=null,m.rawProgramDateTime=null,m.programDateTime=null,m.tagList=[],m.duration=0,m.sn=0,m.levelkey=void 0,m.type=void 0,m.loader=null,m.level=-1,m.cc=0,m.startPTS=void 0,m.endPTS=void 0,m.appendedPTS=void 0,m.startDTS=void 0,m.endDTS=void 0,m.start=0,m.deltaPTS=void 0,m.maxStartPTS=void 0,m.minEndPTS=void 0,m.stats=new e.LoadStats,m.urlId=0,m.data=void 0,m.bitrateTest=!1,m.title=null,m.initSegment=null,m.type=v,m}var t=n.prototype;return t.createInitializationVector=function(p){for(var m=new Uint8Array(16),b=12;b<16;b++)m[b]=p>>8*(15-b)&255;return m},t.setDecryptDataFromLevelKey=function(p,m){var b=p;return(p==null?void 0:p.method)==="AES-128"&&p.uri&&!p.iv&&(b=j.LevelKey.fromURI(p.uri),b.method=p.method,b.iv=this.createInitializationVector(m),b.keyFormat="identity"),b},t.setElementaryStreamInfo=function(p,m,b,_,o,f){f===void 0&&(f=!1);var l=this.elementaryStreams,h=l[p];if(!h){l[p]={startPTS:m,endPTS:b,startDTS:_,endDTS:o,partial:f};return}h.startPTS=Math.min(h.startPTS,m),h.endPTS=Math.max(h.endPTS,b),h.startDTS=Math.min(h.startDTS,_),h.endDTS=Math.max(h.endDTS,o)},t.clearElementaryStreamInfo=function(){var p=this.elementaryStreams;p[a.AUDIO]=null,p[a.VIDEO]=null,p[a.AUDIOVIDEO]=null},u(n,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var p=this.sn;typeof p!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&F.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),p=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,p)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(N.isFiniteNumber)(this.programDateTime))return null;var p=Object(N.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+p*1e3}},{key:"encrypted",get:function(){var p;return!!((p=this.decryptdata)!==null&&p!==void 0&&p.keyFormat&&this.decryptdata.uri)}}]),n}(i),s=function(r){w(n,r);function n(t,v,p,m,b){var _;_=r.call(this,p)||this,_.fragOffset=0,_.duration=0,_.gap=!1,_.independent=!1,_.relurl=void 0,_.fragment=void 0,_.index=void 0,_.stats=new e.LoadStats,_.duration=t.decimalFloatingPoint("DURATION"),_.gap=t.bool("GAP"),_.independent=t.bool("INDEPENDENT"),_.relurl=t.enumeratedString("URI"),_.fragment=v,_.index=m;var o=t.enumeratedString("BYTERANGE");return o&&_.setByteRange(o,b),b&&(_.fragOffset=b.fragOffset+b.duration),_}return u(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),n}(i)},"./src/loader/key-loader.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return F});var N=R("./src/events.ts"),S=R("./src/errors.ts"),O=R("./src/utils/logger.ts"),F=function(){function j(w){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=w,this._registerListeners()}var e=j.prototype;return e._registerListeners=function(){this.hls.on(N.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(N.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var c=this.loaders[g];c&&c.destroy()}this.loaders={}},e.onKeyLoading=function(g,c){var u=c.frag,a=u.type,i=this.loaders[a];if(!u.decryptdata){O.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=u.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(i&&(O.logger.warn("abort previous key loader for type:"+a),i.abort()),!d){O.logger.warn("key uri is falsy");return}var r=s.loader,n=u.loader=this.loaders[a]=new r(s);this.decrypturl=d,this.decryptkey=null;var t={url:d,frag:u,responseType:"arraybuffer"},v={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};n.load(t,v,p)}else this.decryptkey&&(u.decryptdata.key=this.decryptkey,this.hls.trigger(N.Events.KEY_LOADED,{frag:u}))},e.loadsuccess=function(g,c,u){var a=u.frag;if(!a.decryptdata){O.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(g.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(N.Events.KEY_LOADED,{frag:a})},e.loaderror=function(g,c){var u=c.frag,a=u.loader;a&&a.abort(),delete this.loaders[u.type],this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:u,response:g})},e.loadtimeout=function(g,c){var u=c.frag,a=u.loader;a&&a.abort(),delete this.loaders[u.type],this.hls.trigger(N.Events.ERROR,{type:S.ErrorTypes.NETWORK_ERROR,details:S.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:u})},j}()},"./src/loader/level-details.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"LevelDetails",function(){return j});var N=R("./src/polyfills/number.ts");function S(e,w){for(var g=0;g<w.length;g++){var c=w[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,c.key,c)}}function O(e,w,g){return w&&S(e.prototype,w),g&&S(e,g),e}var F=10,j=function(){function e(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var w=e.prototype;return w.reloaded=function(c){if(!c){this.advanced=!0,this.updated=!0;return}var u=this.lastPartSn-c.lastPartSn,a=this.lastPartIndex-c.lastPartIndex;this.updated=this.endSN!==c.endSN||!!a||!!u,this.advanced=this.endSN>c.endSN||u>0||u===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(c.misses*.6):this.misses=c.misses+1,this.availabilityDelay=c.availabilityDelay},O(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(N.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||F}},{key:"drift",get:function(){var c=this.driftEndTime-this.driftStartTime;if(c>0){var u=this.driftEnd-this.driftStart;return u*1e3/c}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var c;return(c=this.fragments)!==null&&c!==void 0&&c.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var c;return(c=this.partList)!==null&&c!==void 0&&c.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"LevelKey",function(){return j});var N=R("./node_modules/url-toolkit/src/url-toolkit.js"),S=R.n(N);function O(e,w){for(var g=0;g<w.length;g++){var c=w[g];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,c.key,c)}}function F(e,w,g){return w&&O(e.prototype,w),g&&O(e,g),e}var j=function(){e.fromURL=function(g,c){return new e(g,c)},e.fromURI=function(g){return new e(g)};function e(w,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(N.buildAbsoluteURL)(w,g,{alwaysNormalize:!0}):this._uri=w}return F(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"LoadStats",function(){return N});var N=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n});var N=R("./src/polyfills/number.ts"),S=R("./node_modules/url-toolkit/src/url-toolkit.js"),O=R.n(S),F=R("./src/loader/fragment.ts"),j=R("./src/loader/level-details.ts"),e=R("./src/loader/level-key.ts"),w=R("./src/utils/attr-list.ts"),g=R("./src/utils/logger.ts"),c=R("./src/utils/codecs.ts"),u=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,i=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),d=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function r(b){var _,o;return s.test((_=(o=S.parseURL(b))===null||o===void 0?void 0:o.path)!=null?_:"")}var n=function(){function b(){}return b.findGroup=function(o,f){for(var l=0;l<o.length;l++){var h=o[l];if(h.id===f)return h}},b.convertAVC1ToAVCOTI=function(o){var f=o.split(".");if(f.length>2){var l=f.shift()+".";return l+=parseInt(f.shift()).toString(16),l+=("000"+parseInt(f.shift()).toString(16)).substr(-4),l}return o},b.resolve=function(o,f){return S.buildAbsoluteURL(f,o,{alwaysNormalize:!0})},b.parseMasterPlaylist=function(o,f){var l=[],h={},E=!1;u.lastIndex=0;for(var y;(y=u.exec(o))!=null;)if(y[1]){var T=new w.AttrList(y[1]),L={attrs:T,bitrate:T.decimalInteger("AVERAGE-BANDWIDTH")||T.decimalInteger("BANDWIDTH"),name:T.NAME,url:b.resolve(y[2],f)},D=T.decimalResolution("RESOLUTION");D&&(L.width=D.width,L.height=D.height),t((T.CODECS||"").split(/[ ,]+/).filter(function(P){return P}),L),L.videoCodec&&L.videoCodec.indexOf("avc1")!==-1&&(L.videoCodec=b.convertAVC1ToAVCOTI(L.videoCodec)),l.push(L)}else if(y[3]){var x=new w.AttrList(y[3]);x["DATA-ID"]&&(E=!0,h[x["DATA-ID"]]=x)}return{levels:l,sessionData:E?h:null}},b.parseMasterPlaylistMedia=function(o,f,l,h){h===void 0&&(h=[]);var E,y=[],T=0;for(a.lastIndex=0;(E=a.exec(o))!==null;){var L=new w.AttrList(E[1]);if(L.TYPE===l){var D={attrs:L,bitrate:0,id:T++,groupId:L["GROUP-ID"],instreamId:L["INSTREAM-ID"],name:L.NAME||L.LANGUAGE||"",type:l,default:L.bool("DEFAULT"),autoselect:L.bool("AUTOSELECT"),forced:L.bool("FORCED"),lang:L.LANGUAGE,url:L.URI?b.resolve(L.URI,f):""};if(h.length){var x=b.findGroup(h,D.groupId)||h[0];v(D,x,"audioCodec"),v(D,x,"textCodec")}y.push(D)}}return y},b.parseLevelPlaylist=function(o,f,l,h,E){var y=new j.LevelDetails(f),T=y.fragments,L=null,D=0,x=0,P=0,H=0,I=null,z=new F.Fragment(h,f),$,fe,ee,ye=-1,pe=!1;for(i.lastIndex=0,y.m3u8=o;($=i.exec(o))!==null;){pe&&(pe=!1,z=new F.Fragment(h,f),z.start=P,z.sn=D,z.cc=H,z.level=l,L&&(z.initSegment=L,z.rawProgramDateTime=L.rawProgramDateTime));var ae=$[1];if(ae){z.duration=parseFloat(ae);var se=(" "+$[2]).slice(1);z.title=se||null,z.tagList.push(se?["INF",ae,se]:["INF",ae])}else if($[3])Object(N.isFiniteNumber)(z.duration)&&(z.start=P,ee&&(z.levelkey=ee),z.sn=D,z.level=l,z.cc=H,z.urlId=E,T.push(z),z.relurl=(" "+$[3]).slice(1),m(z,I),I=z,P+=z.duration,D++,x=0,pe=!0);else if($[4]){var _e=(" "+$[4]).slice(1);I?z.setByteRange(_e,I):z.setByteRange(_e)}else if($[5])z.rawProgramDateTime=(" "+$[5]).slice(1),z.tagList.push(["PROGRAM-DATE-TIME",z.rawProgramDateTime]),ye===-1&&(ye=T.length);else{if($=$[0].match(d),!$){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(fe=1;fe<$.length&&!(typeof $[fe]!="undefined");fe++);var te=(" "+$[fe]).slice(1),k=(" "+$[fe+1]).slice(1),A=$[fe+2]?(" "+$[fe+2]).slice(1):"";switch(te){case"PLAYLIST-TYPE":y.type=k.toUpperCase();break;case"MEDIA-SEQUENCE":D=y.startSN=parseInt(k);break;case"SKIP":{var C=new w.AttrList(k),B=C.decimalInteger("SKIPPED-SEGMENTS");if(Object(N.isFiniteNumber)(B)){y.skippedSegments=B;for(var K=B;K--;)T.unshift(null);D+=B}var M=C.enumeratedString("RECENTLY-REMOVED-DATERANGES");M&&(y.recentlyRemovedDateranges=M.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(k);break;case"VERSION":y.version=parseInt(k);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(k||A)&&z.tagList.push(A?[k,A]:[k]);break;case"DIS":H++;case"GAP":z.tagList.push([te]);break;case"BITRATE":z.tagList.push([te,k]);break;case"DISCONTINUITY-SEQ":H=parseInt(k);break;case"KEY":{var ie,Ee=new w.AttrList(k),Oe=Ee.enumeratedString("METHOD"),q=Ee.URI,de=Ee.hexadecimalInteger("IV"),Te=Ee.enumeratedString("KEYFORMATVERSIONS"),xe=Ee.enumeratedString("KEYID"),Pe=(ie=Ee.enumeratedString("KEYFORMAT"))!=null?ie:"identity",Ne=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Ne.indexOf(Pe)>-1){g.logger.warn("Keyformat "+Pe+" is not supported from the manifest");continue}else if(Pe!=="identity")continue;Oe&&(ee=e.LevelKey.fromURL(f,q),q&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Oe)>=0&&(ee.method=Oe,ee.keyFormat=Pe,xe&&(ee.keyID=xe),Te&&(ee.keyFormatVersions=Te),ee.iv=de));break}case"START":{var Re=new w.AttrList(k),Me=Re.decimalFloatingPoint("TIME-OFFSET");Object(N.isFiniteNumber)(Me)&&(y.startTimeOffset=Me);break}case"MAP":{var He=new w.AttrList(k);z.relurl=He.URI,He.BYTERANGE&&z.setByteRange(He.BYTERANGE),z.level=l,z.sn="initSegment",ee&&(z.levelkey=ee),z.initSegment=null,L=z,pe=!0;break}case"SERVER-CONTROL":{var We=new w.AttrList(k);y.canBlockReload=We.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=We.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&We.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=We.optionalFloat("PART-HOLD-BACK",0),y.holdBack=We.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ke=new w.AttrList(k);y.partTarget=Ke.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Be=y.partList;Be||(Be=y.partList=[]);var Ve=x>0?Be[Be.length-1]:void 0,Xe=x++,ne=new F.Part(new w.AttrList(k),z,f,Xe,Ve);Be.push(ne),z.duration+=ne.duration;break}case"PRELOAD-HINT":{var V=new w.AttrList(k);y.preloadHint=V;break}case"RENDITION-REPORT":{var G=new w.AttrList(k);y.renditionReports=y.renditionReports||[],y.renditionReports.push(G);break}default:g.logger.warn("line parsed but not handled: "+$);break}}}I&&!I.relurl?(T.pop(),P-=I.duration,y.partList&&(y.fragmentHint=I)):y.partList&&(m(z,I),z.cc=H,y.fragmentHint=z);var Z=T.length,re=T[0],X=T[Z-1];if(P+=y.skippedSegments*y.targetduration,P>0&&Z&&X){y.averagetargetduration=P/Z;var Q=X.sn;y.endSN=Q!=="initSegment"?Q:0,re&&(y.startCC=re.cc,re.initSegment||y.fragments.every(function(oe){return oe.relurl&&r(oe.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),z=new F.Fragment(h,f),z.relurl=X.relurl,z.level=l,z.sn="initSegment",re.initSegment=z,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(P+=y.fragmentHint.duration),y.totalduration=P,y.endCC=H,ye>0&&p(T,ye),y},b}();function t(b,_){["video","audio","text"].forEach(function(o){var f=b.filter(function(h){return Object(c.isCodecType)(h,o)});if(f.length){var l=f.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});_[o+"Codec"]=l.length>0?l[0]:f[0],b=b.filter(function(h){return f.indexOf(h)===-1})}}),_.unknownCodecs=b}function v(b,_,o){var f=_[o];f&&(b[o]=f)}function p(b,_){for(var o=b[_],f=_;f--;){var l=b[f];if(!l)return;l.programDateTime=o.programDateTime-l.duration*1e3,o=l}}function m(b,_){b.rawProgramDateTime?b.programDateTime=Date.parse(b.rawProgramDateTime):_!=null&&_.programDateTime&&(b.programDateTime=_.endProgramDateTime),Object(N.isFiniteNumber)(b.programDateTime)||(b.programDateTime=null,b.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/polyfills/number.ts"),S=R("./src/events.ts"),O=R("./src/errors.ts"),F=R("./src/utils/logger.ts"),j=R("./src/utils/mp4-tools.ts"),e=R("./src/loader/m3u8-parser.ts"),w=R("./src/types/loader.ts"),g=R("./src/utils/attr-list.ts");function c(i){var d=i.type;switch(d){case w.PlaylistContextType.AUDIO_TRACK:return w.PlaylistLevelType.AUDIO;case w.PlaylistContextType.SUBTITLE_TRACK:return w.PlaylistLevelType.SUBTITLE;default:return w.PlaylistLevelType.MAIN}}function u(i,d){var s=i.url;return(s===void 0||s.indexOf("data:")===0)&&(s=d.url),s}var a=function(){function i(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var d=i.prototype;return d.registerListeners=function(){var r=this.hls;r.on(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(S.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(S.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(S.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var r=this.hls;r.off(S.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(S.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(S.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(S.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(r){var n=this.hls.config,t=n.pLoader,v=n.loader,p=t||v,m=new p(n);return r.loader=m,this.loaders[r.type]=m,m},d.getInternalLoader=function(r){return this.loaders[r.type]},d.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},d.destroyInternalLoaders=function(){for(var r in this.loaders){var n=this.loaders[r];n&&n.destroy(),this.resetInternalLoader(r)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(r,n){var t=n.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:w.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},d.onLevelLoading=function(r,n){var t=n.id,v=n.level,p=n.url,m=n.deliveryDirectives;this.load({id:t,groupId:null,level:v,responseType:"text",type:w.PlaylistContextType.LEVEL,url:p,deliveryDirectives:m})},d.onAudioTrackLoading=function(r,n){var t=n.id,v=n.groupId,p=n.url,m=n.deliveryDirectives;this.load({id:t,groupId:v,level:null,responseType:"text",type:w.PlaylistContextType.AUDIO_TRACK,url:p,deliveryDirectives:m})},d.onSubtitleTrackLoading=function(r,n){var t=n.id,v=n.groupId,p=n.url,m=n.deliveryDirectives;this.load({id:t,groupId:v,level:null,responseType:"text",type:w.PlaylistContextType.SUBTITLE_TRACK,url:p,deliveryDirectives:m})},d.load=function(r){var n,t=this.hls.config,v=this.getInternalLoader(r);if(v){var p=v.context;if(p&&p.url===r.url){F.logger.trace("[playlist-loader]: playlist request ongoing");return}F.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),v.abort()}var m,b,_,o;switch(r.type){case w.PlaylistContextType.MANIFEST:m=t.manifestLoadingMaxRetry,b=t.manifestLoadingTimeOut,_=t.manifestLoadingRetryDelay,o=t.manifestLoadingMaxRetryTimeout;break;case w.PlaylistContextType.LEVEL:case w.PlaylistContextType.AUDIO_TRACK:case w.PlaylistContextType.SUBTITLE_TRACK:m=0,b=t.levelLoadingTimeOut;break;default:m=t.levelLoadingMaxRetry,b=t.levelLoadingTimeOut,_=t.levelLoadingRetryDelay,o=t.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(r),(n=r.deliveryDirectives)!==null&&n!==void 0&&n.part){var f;if(r.type===w.PlaylistContextType.LEVEL&&r.level!==null?f=this.hls.levels[r.level].details:r.type===w.PlaylistContextType.AUDIO_TRACK&&r.id!==null?f=this.hls.audioTracks[r.id].details:r.type===w.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(f=this.hls.subtitleTracks[r.id].details),f){var l=f.partTarget,h=f.targetduration;l&&h&&(b=Math.min(Math.max(l*3,h*.8)*1e3,b))}}var E={timeout:b,maxRetry:m,retryDelay:_,maxRetryDelay:o,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(r,E,y)},d.loadsuccess=function(r,n,t,v){if(v===void 0&&(v=null),t.isSidxRequest){this.handleSidxRequest(r,t),this.handlePlaylistLoaded(r,n,t,v);return}this.resetInternalLoader(t.type);var p=r.data;if(p.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,t,"no EXTM3U delimiter",v);return}n.parsing.start=performance.now(),p.indexOf("#EXTINF:")>0||p.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,n,t,v):this.handleMasterPlaylist(r,n,t,v)},d.loaderror=function(r,n,t){t===void 0&&(t=null),this.handleNetworkError(n,t,!1,r)},d.loadtimeout=function(r,n,t){t===void 0&&(t=null),this.handleNetworkError(n,t,!0)},d.handleMasterPlaylist=function(r,n,t,v){var p=this.hls,m=r.data,b=u(r,t),_=e.default.parseMasterPlaylist(m,b),o=_.levels,f=_.sessionData;if(!o.length){this.handleManifestParsingError(r,t,"no level found in manifest",v);return}var l=o.map(function(D){return{id:D.attrs.AUDIO,audioCodec:D.audioCodec}}),h=o.map(function(D){return{id:D.attrs.SUBTITLES,textCodec:D.textCodec}}),E=e.default.parseMasterPlaylistMedia(m,b,"AUDIO",l),y=e.default.parseMasterPlaylistMedia(m,b,"SUBTITLES",h),T=e.default.parseMasterPlaylistMedia(m,b,"CLOSED-CAPTIONS");if(E.length){var L=E.some(function(D){return!D.url});!L&&o[0].audioCodec&&!o[0].attrs.AUDIO&&(F.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}p.trigger(S.Events.MANIFEST_LOADED,{levels:o,audioTracks:E,subtitles:y,captions:T,url:b,stats:n,networkDetails:v,sessionData:f})},d.handleTrackOrLevelPlaylist=function(r,n,t,v){var p=this.hls,m=t.id,b=t.level,_=t.type,o=u(r,t),f=Object(N.isFiniteNumber)(m)?m:0,l=Object(N.isFiniteNumber)(b)?b:f,h=c(t),E=e.default.parseLevelPlaylist(r.data,o,l,h,f);if(!E.fragments.length){p.trigger(S.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:o,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(_===w.PlaylistContextType.MANIFEST){var y={attrs:new g.AttrList({}),bitrate:0,details:E,name:"",url:o};p.trigger(S.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:o,stats:n,networkDetails:v,sessionData:null})}if(n.parsing.end=performance.now(),E.needSidxRanges){var T,L=(T=E.fragments[0].initSegment)===null||T===void 0?void 0:T.url;this.load({url:L,isSidxRequest:!0,type:_,level:b,levelDetails:E,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=E,this.handlePlaylistLoaded(r,n,t,v)},d.handleSidxRequest=function(r,n){var t=Object(j.parseSegmentIndex)(new Uint8Array(r.data));if(!t)return;var v=t.references,p=n.levelDetails;v.forEach(function(m,b){var _=m.info,o=p.fragments[b];o.byteRange.length===0&&o.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),o.initSegment&&o.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(r,n,t,v){this.hls.trigger(S.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:n.type===w.PlaylistContextType.MANIFEST,url:r.url,reason:t,response:r,context:n,networkDetails:v})},d.handleNetworkError=function(r,n,t,v){t===void 0&&(t=!1),F.logger.warn("[playlist-loader]: A network "+(t?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var p=O.ErrorDetails.UNKNOWN,m=!1,b=this.getInternalLoader(r);switch(r.type){case w.PlaylistContextType.MANIFEST:p=t?O.ErrorDetails.MANIFEST_LOAD_TIMEOUT:O.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case w.PlaylistContextType.LEVEL:p=t?O.ErrorDetails.LEVEL_LOAD_TIMEOUT:O.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case w.PlaylistContextType.AUDIO_TRACK:p=t?O.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case w.PlaylistContextType.SUBTITLE_TRACK:p=t?O.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:O.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}b&&this.resetInternalLoader(r.type);var _={type:O.ErrorTypes.NETWORK_ERROR,details:p,fatal:m,url:r.url,loader:b,context:r,networkDetails:n};v&&(_.response=v),this.hls.trigger(S.Events.ERROR,_)},d.handlePlaylistLoaded=function(r,n,t,v){var p=t.type,m=t.level,b=t.id,_=t.groupId,o=t.loader,f=t.levelDetails,l=t.deliveryDirectives;if(!(f!=null&&f.targetduration)){this.handleManifestParsingError(r,t,"invalid target duration",v);return}if(!o)return;f.live&&(o.getCacheAge&&(f.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(f.ageHeader))&&(f.ageHeader=0));switch(p){case w.PlaylistContextType.MANIFEST:case w.PlaylistContextType.LEVEL:this.hls.trigger(S.Events.LEVEL_LOADED,{details:f,level:m||0,id:b||0,stats:n,networkDetails:v,deliveryDirectives:l});break;case w.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(S.Events.AUDIO_TRACK_LOADED,{details:f,id:b||0,groupId:_||"",stats:n,networkDetails:v,deliveryDirectives:l});break;case w.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(S.Events.SUBTITLE_TRACK_LOADED,{details:f,id:b||0,groupId:_||"",stats:n,networkDetails:v,deliveryDirectives:l});break}},i}();W.default=a},"./src/polyfills/number.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"isFiniteNumber",function(){return N}),R.d(W,"MAX_SAFE_INTEGER",function(){return S});var N=Number.isFinite||function(O){return typeof O=="number"&&isFinite(O)},S=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ue,W,R){"use strict";R.r(W);var N=function(){function S(){}return S.getSilentFrame=function(F,j){switch(F){case"mp4a.40.2":if(j===1)return new Uint8Array([0,200,0,128,35,128]);if(j===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(j===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(j===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(j===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(j===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(j===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(j===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},S}();W.default=N},"./src/remux/mp4-generator.ts":function(ue,W,R){"use strict";R.r(W);var N=Math.pow(2,32)-1,S=function(){function O(){}return O.init=function(){O.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var j;for(j in O.types)O.types.hasOwnProperty(j)&&(O.types[j]=[j.charCodeAt(0),j.charCodeAt(1),j.charCodeAt(2),j.charCodeAt(3)]);var e=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),w=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);O.HDLR_TYPES={video:e,audio:w};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),c=new Uint8Array([0,0,0,0,0,0,0,0]);O.STTS=O.STSC=O.STCO=c,O.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),O.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),O.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),O.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var u=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);O.FTYP=O.box(O.types.ftyp,u,i,u,a),O.DINF=O.box(O.types.dinf,O.box(O.types.dref,g))},O.box=function(j){for(var e=8,w=arguments.length,g=new Array(w>1?w-1:0),c=1;c<w;c++)g[c-1]=arguments[c];for(var u=g.length,a=u;u--;)e+=g[u].byteLength;var i=new Uint8Array(e);for(i[0]=e>>24&255,i[1]=e>>16&255,i[2]=e>>8&255,i[3]=e&255,i.set(j,4),u=0,e=8;u<a;u++)i.set(g[u],e),e+=g[u].byteLength;return i},O.hdlr=function(j){return O.box(O.types.hdlr,O.HDLR_TYPES[j])},O.mdat=function(j){return O.box(O.types.mdat,j)},O.mdhd=function(j,e){e*=j;var w=Math.floor(e/(N+1)),g=Math.floor(e%(N+1));return O.box(O.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,j>>24&255,j>>16&255,j>>8&255,j&255,w>>24,w>>16&255,w>>8&255,w&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},O.mdia=function(j){return O.box(O.types.mdia,O.mdhd(j.timescale,j.duration),O.hdlr(j.type),O.minf(j))},O.mfhd=function(j){return O.box(O.types.mfhd,new Uint8Array([0,0,0,0,j>>24,j>>16&255,j>>8&255,j&255]))},O.minf=function(j){return j.type==="audio"?O.box(O.types.minf,O.box(O.types.smhd,O.SMHD),O.DINF,O.stbl(j)):O.box(O.types.minf,O.box(O.types.vmhd,O.VMHD),O.DINF,O.stbl(j))},O.moof=function(j,e,w){return O.box(O.types.moof,O.mfhd(j),O.traf(w,e))},O.moov=function(j){for(var e=j.length,w=[];e--;)w[e]=O.trak(j[e]);return O.box.apply(null,[O.types.moov,O.mvhd(j[0].timescale,j[0].duration)].concat(w).concat(O.mvex(j)))},O.mvex=function(j){for(var e=j.length,w=[];e--;)w[e]=O.trex(j[e]);return O.box.apply(null,[O.types.mvex].concat(w))},O.mvhd=function(j,e){e*=j;var w=Math.floor(e/(N+1)),g=Math.floor(e%(N+1)),c=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,j>>24&255,j>>16&255,j>>8&255,j&255,w>>24,w>>16&255,w>>8&255,w&255,g>>24,g>>16&255,g>>8&255,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return O.box(O.types.mvhd,c)},O.sdtp=function(j){var e=j.samples||[],w=new Uint8Array(4+e.length),g,c;for(g=0;g<e.length;g++)c=e[g].flags,w[g+4]=c.dependsOn<<4|c.isDependedOn<<2|c.hasRedundancy;return O.box(O.types.sdtp,w)},O.stbl=function(j){return O.box(O.types.stbl,O.stsd(j),O.box(O.types.stts,O.STTS),O.box(O.types.stsc,O.STSC),O.box(O.types.stsz,O.STSZ),O.box(O.types.stco,O.STCO))},O.avc1=function(j){var e=[],w=[],g,c,u;for(g=0;g<j.sps.length;g++)c=j.sps[g],u=c.byteLength,e.push(u>>>8&255),e.push(u&255),e=e.concat(Array.prototype.slice.call(c));for(g=0;g<j.pps.length;g++)c=j.pps[g],u=c.byteLength,w.push(u>>>8&255),w.push(u&255),w=w.concat(Array.prototype.slice.call(c));var a=O.box(O.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|j.sps.length].concat(e).concat([j.pps.length]).concat(w))),i=j.width,d=j.height,s=j.pixelRatio[0],r=j.pixelRatio[1];return O.box(O.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>8&255,i&255,d>>8&255,d&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,O.box(O.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),O.box(O.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,r>>24,r>>16&255,r>>8&255,r&255])))},O.esds=function(j){var e=j.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(j.config).concat([6,1,2]))},O.mp4a=function(j){var e=j.samplerate;return O.box(O.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),O.box(O.types.esds,O.esds(j)))},O.mp3=function(j){var e=j.samplerate;return O.box(O.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,j.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},O.stsd=function(j){return j.type==="audio"?!j.isAAC&&j.codec==="mp3"?O.box(O.types.stsd,O.STSD,O.mp3(j)):O.box(O.types.stsd,O.STSD,O.mp4a(j)):O.box(O.types.stsd,O.STSD,O.avc1(j))},O.tkhd=function(j){var e=j.id,w=j.duration*j.timescale,g=j.width,c=j.height,u=Math.floor(w/(N+1)),a=Math.floor(w%(N+1));return O.box(O.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,a>>24,a>>16&255,a>>8&255,a&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,g>>8&255,g&255,0,0,c>>8&255,c&255,0,0]))},O.traf=function(j,e){var w=O.sdtp(j),g=j.id,c=Math.floor(e/(N+1)),u=Math.floor(e%(N+1));return O.box(O.types.traf,O.box(O.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),O.box(O.types.tfdt,new Uint8Array([1,0,0,0,c>>24,c>>16&255,c>>8&255,c&255,u>>24,u>>16&255,u>>8&255,u&255])),O.trun(j,w.length+16+20+8+16+8+8),w)},O.trak=function(j){return j.duration=j.duration||4294967295,O.box(O.types.trak,O.tkhd(j),O.mdia(j))},O.trex=function(j){var e=j.id;return O.box(O.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},O.trun=function(j,e){var w=j.samples||[],g=w.length,c=12+16*g,u=new Uint8Array(c),a,i,d,s,r,n;for(e+=8+c,u.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),a=0;a<g;a++)i=w[a],d=i.duration,s=i.size,r=i.flags,n=i.cts,u.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,n>>>24&255,n>>>16&255,n>>>8&255,n&255],12+16*a);return O.box(O.types.trun,u)},O.initSegment=function(j){O.types||O.init();var e=O.moov(j),w=new Uint8Array(O.FTYP.byteLength+e.byteLength);return w.set(O.FTYP),w.set(e,O.FTYP.byteLength),w},O}();S.types=void 0,S.HDLR_TYPES=void 0,S.STTS=void 0,S.STSC=void 0,S.STCO=void 0,S.STSZ=void 0,S.VMHD=void 0,S.SMHD=void 0,S.STSD=void 0,S.FTYP=void 0,S.DINF=void 0,W.default=S},"./src/remux/mp4-remuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return n}),R.d(W,"normalizePts",function(){return t});var N=R("./src/polyfills/number.ts"),S=R("./src/remux/aac-helper.ts"),O=R("./src/remux/mp4-generator.ts"),F=R("./src/events.ts"),j=R("./src/errors.ts"),e=R("./src/utils/logger.ts"),w=R("./src/types/loader.ts"),g=R("./src/utils/timescale-conversion.ts");function c(){return c=Object.assign||function(b){for(var _=1;_<arguments.length;_++){var o=arguments[_];for(var f in o)Object.prototype.hasOwnProperty.call(o,f)&&(b[f]=o[f])}return b},c.apply(this,arguments)}var u=10*1e3,a=1024,i=1152,d=null,s=null,r=!1,n=function(){function b(o,f,l,h){if(h===void 0&&(h=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=o,this.config=f,this.typeSupported=l,this.ISGenerated=!1,d===null){var E=navigator.userAgent||"",y=E.match(/Chrome\/(\d+)/i);d=y?parseInt(y[1]):0}if(s===null){var T=navigator.userAgent.match(/Safari\/(\d+)/i);s=T?parseInt(T[1]):0}r=!!d&&d<75||!!s&&s<600}var _=b.prototype;return _.destroy=function(){},_.resetTimeStamp=function(f){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=f},_.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},_.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},_.getVideoStartPts=function(f){var l=!1,h=f.reduce(function(E,y){var T=y.pts-E;return T<-4294967296?(l=!0,t(E,y.pts)):T>0?E:y.pts},f[0].pts);return l&&e.logger.debug("PTS rollover detected"),h},_.remux=function(f,l,h,E,y,T,L,D){var x,P,H,I,z,$,fe=y,ee=y,ye=f.pid>-1,pe=l.pid>-1,ae=l.samples.length,se=f.samples.length>0,_e=ae>1,te=(!ye||se)&&(!pe||_e)||this.ISGenerated||L;if(te){this.ISGenerated||(H=this.generateIS(f,l,y));var k=this.isVideoContiguous,A=-1;if(_e&&(A=v(l.samples),!k&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,A>0){e.logger.warn("[mp4-remuxer]: Dropped "+A+" out of "+ae+" video samples due to a missing keyframe");var C=this.getVideoStartPts(l.samples);l.samples=l.samples.slice(A),l.dropped+=A,ee+=(l.samples[0].pts-C)/(l.timescale||9e4)}else A===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+ae+" video samples"),$=!1);if(this.ISGenerated){if(se&&_e){var B=this.getVideoStartPts(l.samples),K=t(f.samples[0].pts,B)-B,M=K/l.inputTimeScale;fe+=Math.max(0,M),ee+=Math.max(0,-M)}if(se){if(f.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),H=this.generateIS(f,l,y)),P=this.remuxAudio(f,fe,this.isAudioContiguous,T,pe||_e||D===w.PlaylistLevelType.AUDIO?ee:void 0),_e){var ie=P?P.endPTS-P.startPTS:0;l.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),H=this.generateIS(f,l,y)),x=this.remuxVideo(l,ee,k,ie)}}else _e&&(x=this.remuxVideo(l,ee,k,0));x&&(x.firstKeyFrame=A,x.independent=A!==-1)}}return this.ISGenerated&&(h.samples.length&&(z=this.remuxID3(h,y)),E.samples.length&&(I=this.remuxText(E,y))),{audio:P,video:x,initSegment:H,independent:$,text:I,id3:z}},_.generateIS=function(f,l,h){var E=f.samples,y=l.samples,T=this.typeSupported,L={},D=!Object(N.isFiniteNumber)(this._initPTS),x="audio/mp4",P,H,I;if(D&&(P=H=Infinity),f.config&&E.length&&(f.timescale=f.samplerate,f.isAAC||(T.mpeg?(x="audio/mpeg",f.codec=""):T.mp3&&(f.codec="mp3")),L.audio={id:"audio",container:x,codec:f.codec,initSegment:!f.isAAC&&T.mpeg?new Uint8Array(0):O.default.initSegment([f]),metadata:{channelCount:f.channelCount}},D&&(I=f.inputTimeScale,P=H=E[0].pts-Math.round(I*h))),l.sps&&l.pps&&y.length&&(l.timescale=l.inputTimeScale,L.video={id:"main",container:"video/mp4",codec:l.codec,initSegment:O.default.initSegment([l]),metadata:{width:l.width,height:l.height}},D)){I=l.inputTimeScale;var z=this.getVideoStartPts(y),$=Math.round(I*h);H=Math.min(H,t(y[0].dts,z)-$),P=Math.min(P,z-$)}if(Object.keys(L).length)return this.ISGenerated=!0,D&&(this._initPTS=P,this._initDTS=H),{tracks:L,initPTS:P,timescale:I}},_.remuxVideo=function(f,l,h,E){var y=f.inputTimeScale,T=f.samples,L=[],D=T.length,x=this._initPTS,P=this.nextAvcDts,H=8,I,z,$,fe=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,ye=0,pe=!1;if(!h||P===null){var ae=l*y,se=T[0].pts-t(T[0].dts,T[0].pts);P=ae-se}for(var _e=0;_e<D;_e++){var te=T[_e];if(te.pts=t(te.pts-x,P),te.dts=t(te.dts-x,P),te.dts>te.pts){var k=9e4*.2;ye=Math.max(Math.min(ye,te.pts-te.dts),-1*k)}te.dts<T[_e>0?_e-1:_e].dts&&(pe=!0)}pe&&T.sort(function(dt,at){var $e=dt.dts-at.dts,Nt=dt.pts-at.pts;return $e||Nt}),z=T[0].dts,$=T[T.length-1].dts;var A=Math.round(($-z)/(D-1));if(ye<0){if(ye<A*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-A,!0)+" ms");for(var C=ye,B=0;B<D;B++)T[B].dts=C=Math.max(C,T[B].pts-A),T[B].pts=Math.max(C,T[B].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(ye,!0)+" ms to overcome this issue");for(var K=0;K<D;K++)T[K].dts=T[K].dts+ye}z=T[0].dts}if(h){var M=z-P,ie=M>A,Ee=M<-1;if(ie||Ee){ie?e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(M,!0)+" ms ("+M+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-M,!0)+" ms ("+M+"dts) overlapping between fragments detected"),z=P;var Oe=T[0].pts-M;T[0].dts=z,T[0].pts=Oe,e.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(Oe,!0)+"/"+Object(g.toMsFromMpegTsClock)(z,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(M,!0)+" ms")}}r&&(z=Math.max(0,z));for(var q=0,de=0,Te=0;Te<D;Te++){for(var xe=T[Te],Pe=xe.units,Ne=Pe.length,Re=0,Me=0;Me<Ne;Me++)Re+=Pe[Me].data.length;de+=Re,q+=Ne,xe.length=Re,xe.dts=Math.max(xe.dts,z),xe.pts=Math.max(xe.pts,xe.dts,0),fe=Math.min(xe.pts,fe),ee=Math.max(xe.pts,ee)}$=T[D-1].dts;var He=de+4*q+8,We;try{We=new Uint8Array(He)}catch(dt){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:j.ErrorTypes.MUX_ERROR,details:j.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:He,reason:"fail allocating video mdat "+He});return}var Ke=new DataView(We.buffer);Ke.setUint32(0,He),We.set(O.default.types.mdat,4);for(var Be=0;Be<D;Be++){for(var Ve=T[Be],Xe=Ve.units,ne=0,V=0,G=Xe.length;V<G;V++){var Z=Xe[V],re=Z.data,X=Z.data.byteLength;Ke.setUint32(H,X),H+=4,We.set(re,H),H+=X,ne+=4+X}if(Be<D-1)I=T[Be+1].dts-Ve.dts;else{var Q=this.config,oe=Ve.dts-T[Be>0?Be-1:Be].dts;if(Q.stretchShortVideoTrack&&this.nextAudioPts!==null){var he=Math.floor(Q.maxBufferHole*y),De=(E?fe+E*y:this.nextAudioPts)-Ve.pts;De>he?(I=De-oe,I<0&&(I=oe),e.logger.log("[mp4-remuxer]: It is approximately "+De/90+" ms to the next segment; using duration "+I/90+" ms for the last video frame.")):I=oe}else I=oe}var Ie=Math.round(Ve.pts-Ve.dts);L.push(new p(Ve.key,I,ne,Ie))}if(L.length&&d&&d<70){var Ue=L[0].flags;Ue.dependsOn=2,Ue.isNonSync=0}console.assert(I!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=P=$+I,this.isVideoContiguous=!0;var Ye=O.default.moof(f.sequenceNumber++,z,c({},f,{samples:L})),Je="video",Ze={data1:Ye,data2:We,startPTS:fe/y,endPTS:(ee+I)/y,startDTS:z/y,endDTS:P/y,type:Je,hasAudio:!1,hasVideo:!0,nb:L.length,dropped:f.dropped};return f.samples=[],f.dropped=0,console.assert(We.length,"MDAT length must not be zero"),Ze},_.remuxAudio=function(f,l,h,E,y){var T=f.inputTimeScale,L=f.samplerate?f.samplerate:T,D=T/L,x=f.isAAC?a:i,P=x*D,H=this._initPTS,I=!f.isAAC&&this.typeSupported.mpeg,z=[],$=f.samples,fe=I?0:8,ee=this.nextAudioPts||-1,ye=l*T;if(this.isAudioContiguous=h=h||$.length&&ee>0&&(E&&Math.abs(ye-ee)<9e3||Math.abs(t($[0].pts-H,ye)-ee)<20*P),$.forEach(function(re){re.pts=t(re.pts-H,ye)}),!h||ee<0){if($=$.filter(function(re){return re.pts>=0}),!$.length)return;y===0?ee=0:E?ee=Math.max(0,ye):ee=$[0].pts}if(f.isAAC)for(var pe=y!==void 0,ae=this.config.maxAudioFramesDrift,se=0,_e=ee;se<$.length;se++){var te=$[se],k=te.pts,A=k-_e,C=Math.abs(1e3*A/T);if(A<=-ae*P&&pe)se===0&&(e.logger.warn("Audio frame @ "+(k/T).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*A/T)+" ms."),this.nextAudioPts=ee=_e=k);else if(A>=ae*P&&C<u&&pe){var B=Math.round(A/P);_e=k-B*P,_e<0&&(B--,_e+=P),se===0&&(this.nextAudioPts=ee=_e),e.logger.warn("[mp4-remuxer]: Injecting "+B+" audio frame @ "+(_e/T).toFixed(3)+"s due to "+Math.round(1e3*A/T)+" ms gap.");for(var K=0;K<B;K++){var M=Math.max(_e,0),ie=S.default.getSilentFrame(f.manifestCodec||f.codec,f.channelCount);ie||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),ie=te.unit.subarray()),$.splice(se,0,{unit:ie,pts:M}),_e+=P,se++}}te.pts=_e,_e+=P}for(var Ee=null,Oe=null,q,de=0,Te=$.length;Te--;)de+=$[Te].unit.byteLength;for(var xe=0,Pe=$.length;xe<Pe;xe++){var Ne=$[xe],Re=Ne.unit,Me=Ne.pts;if(Oe!==null){var He=z[xe-1];He.duration=Math.round((Me-Oe)/D)}else if(h&&f.isAAC&&(Me=ee),Ee=Me,de>0){de+=fe;try{q=new Uint8Array(de)}catch(re){this.observer.emit(F.Events.ERROR,F.Events.ERROR,{type:j.ErrorTypes.MUX_ERROR,details:j.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:de,reason:"fail allocating audio mdat "+de});return}if(!I){var We=new DataView(q.buffer);We.setUint32(0,de),q.set(O.default.types.mdat,4)}}else return;q.set(Re,fe);var Ke=Re.byteLength;fe+=Ke,z.push(new p(!0,x,Ke,0)),Oe=Me}var Be=z.length;if(!Be)return;var Ve=z[z.length-1];this.nextAudioPts=ee=Oe+D*Ve.duration;var Xe=I?new Uint8Array(0):O.default.moof(f.sequenceNumber++,Ee/D,c({},f,{samples:z}));f.samples=[];var ne=Ee/T,V=ee/T,G="audio",Z={data1:Xe,data2:q,startPTS:ne,endPTS:V,startDTS:ne,endDTS:V,type:G,hasAudio:!0,hasVideo:!1,nb:Be};return this.isAudioContiguous=!0,console.assert(q.length,"MDAT length must not be zero"),Z},_.remuxEmptyAudio=function(f,l,h,E){var y=f.inputTimeScale,T=f.samplerate?f.samplerate:y,L=y/T,D=this.nextAudioPts,x=(D!==null?D:E.startDTS*y)+this._initDTS,P=E.endDTS*y+this._initDTS,H=L*a,I=Math.ceil((P-x)/H),z=S.default.getSilentFrame(f.manifestCodec||f.codec,f.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],fe=0;fe<I;fe++){var ee=x+fe*H;$.push({unit:z,pts:ee,dts:ee})}return f.samples=$,this.remuxAudio(f,l,h,!1)},_.remuxID3=function(f,l){var h=f.samples.length;if(!h)return;for(var E=f.inputTimeScale,y=this._initPTS,T=this._initDTS,L=0;L<h;L++){var D=f.samples[L];D.pts=t(D.pts-y,l*E)/E,D.dts=t(D.dts-T,l*E)/E}var x=f.samples;return f.samples=[],{samples:x}},_.remuxText=function(f,l){var h=f.samples.length;if(!h)return;for(var E=f.inputTimeScale,y=this._initPTS,T=0;T<h;T++){var L=f.samples[T];L.pts=t(L.pts-y,l*E)/E}f.samples.sort(function(x,P){return x.pts-P.pts});var D=f.samples;return f.samples=[],{samples:D}},b}();function t(b,_){var o;if(_===null)return b;for(_<b?o=-8589934592:o=8589934592;Math.abs(b-_)>4294967296;)b+=o;return b}function v(b){for(var _=0;_<b.length;_++)if(b[_].key)return _;return-1}var p=function(_,o,f,l){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=o,this.size=f,this.cts=l,this.flags=new m(_)},m=function(_){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=_?2:1,this.isNonSync=_?0:1}},"./src/remux/passthrough-remuxer.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/polyfills/number.ts"),S=R("./src/utils/mp4-tools.ts"),O=R("./src/loader/fragment.ts"),F=R("./src/utils/logger.ts"),j=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var c=g.prototype;return c.destroy=function(){},c.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},c.resetNextTimestamp=function(){this.lastEndDTS=null},c.resetInitSegment=function(a,i,d){this.audioCodec=i,this.videoCodec=d,this.generateInitSegment(a),this.emitInitSegment=!0},c.generateInitSegment=function(a){var i=this.audioCodec,d=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(S.parseInitSegment)(a);i||(i=w(s.audio,O.ElementaryStreamTypes.AUDIO)),d||(d=w(s.video,O.ElementaryStreamTypes.VIDEO));var r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:i+","+d,initSegment:a,id:"main"}:s.audio?r.audio={container:"audio/mp4",codec:i,initSegment:a,id:"audio"}:s.video?r.video={container:"video/mp4",codec:d,initSegment:a,id:"main"}:F.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},c.remux=function(a,i,d,s,r){var n=this.initPTS,t=this.lastEndDTS,v={audio:void 0,video:void 0,text:s,id3:d,initSegment:void 0};Object(N.isFiniteNumber)(t)||(t=this.lastEndDTS=r||0);var p=i.samples;if(!p||!p.length)return v;var m={initPTS:void 0,timescale:1},b=this.initData;if((!b||!b.length)&&(this.generateInitSegment(p),b=this.initData),!b||!b.length)return F.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(N.isFiniteNumber)(n)||(this.initPTS=m.initPTS=n=e(b,p,t));var _=Object(S.getDuration)(p,b),o=t,f=_+o;Object(S.offsetStartDTS)(b,p,n),_>0?this.lastEndDTS=f:(F.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var l=!!b.audio,h=!!b.video,E="";l&&(E+="audio"),h&&(E+="video");var y={data1:p,startPTS:o,startDTS:o,endPTS:f,endDTS:f,type:E,hasAudio:l,hasVideo:h,nb:1,dropped:0};return v.audio=y.type==="audio"?y:void 0,v.video=y.type!=="audio"?y:void 0,v.text=s,v.id3=d,v.initSegment=m,v},g}(),e=function(c,u,a){return Object(S.getStartDTS)(c,u)-a};function w(g,c){var u=g==null?void 0:g.codec;return u&&u.length>4?u:u==="hvc1"?"hvc1.1.c.L120.90":u==="av01"?"av01.0.04M.08":u==="avc1"||c===O.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}W.default=j},"./src/task-loop.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function S(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var O=S.prototype;return O.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},O.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},O.onHandlerDestroyed=function(){},O.hasInterval=function(){return!!this._tickInterval},O.hasNextTick=function(){return!!this._tickTimer},O.setInterval=function(j){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,j),!0)},O.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},O.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},O.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},O.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},O.doTick=function(){},S}()},"./src/types/cmcd.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"CMCDVersion",function(){return N}),R.d(W,"CMCDObjectType",function(){return S}),R.d(W,"CMCDStreamingFormat",function(){return O}),R.d(W,"CMCDStreamType",function(){return F});var N=1,S;(function(j){j.MANIFEST="m",j.AUDIO="a",j.VIDEO="v",j.MUXED="av",j.INIT="i",j.CAPTION="c",j.TIMED_TEXT="tt",j.KEY="k",j.OTHER="o"})(S||(S={}));var O;(function(j){j.DASH="d",j.HLS="h",j.SMOOTH="s",j.OTHER="o"})(O||(O={}));var F;(function(j){j.VOD="v",j.LIVE="l"})(F||(F={}))},"./src/types/level.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"HlsSkip",function(){return O}),R.d(W,"getSkipValue",function(){return F}),R.d(W,"HlsUrlParameters",function(){return j}),R.d(W,"Level",function(){return e});function N(w,g){for(var c=0;c<g.length;c++){var u=g[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(w,u.key,u)}}function S(w,g,c){return g&&N(w.prototype,g),c&&N(w,c),w}var O;(function(w){w.No="",w.Yes="YES",w.v2="v2"})(O||(O={}));function F(w,g){var c=w.canSkipUntil,u=w.canSkipDateRanges,a=w.endSN,i=g!==void 0?g-a:0;return c&&i<c?u?O.v2:O.Yes:O.No}var j=function(){function w(c,u,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=c,this.part=u,this.skip=a}var g=w.prototype;return g.addDirectives=function(u){var a=new self.URL(u);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},w}(),e=function(){function w(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(c){return c}).join(",").replace(/\.[^.,]+/g,"")}return S(w,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(c){var u=c%this.url.length;this._urlId!==u&&(this.details=void 0,this._urlId=u)}}]),w}()},"./src/types/loader.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"PlaylistContextType",function(){return N}),R.d(W,"PlaylistLevelType",function(){return S});var N;(function(O){O.MANIFEST="manifest",O.LEVEL="level",O.AUDIO_TRACK="audioTrack",O.SUBTITLE_TRACK="subtitleTrack"})(N||(N={}));var S;(function(O){O.MAIN="main",O.AUDIO="audio",O.SUBTITLE="subtitle"})(S||(S={}))},"./src/types/transmuxer.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"ChunkMetadata",function(){return N});var N=function(F,j,e,w,g,c){w===void 0&&(w=0),g===void 0&&(g=-1),c===void 0&&(c=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=S(),this.buffering={audio:S(),video:S(),audiovideo:S()},this.level=F,this.sn=j,this.id=e,this.size=w,this.part=g,this.partial=c};function S(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"AttrList",function(){return O});var N=/^(\d+)x(\d+)$/,S=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,O=function(){function F(e){typeof e=="string"&&(e=F.parseAttrList(e));for(var w in e)e.hasOwnProperty(w)&&(this[w]=e[w])}var j=F.prototype;return j.decimalInteger=function(w){var g=parseInt(this[w],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},j.hexadecimalInteger=function(w){if(this[w]){var g=(this[w]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var c=new Uint8Array(g.length/2),u=0;u<g.length/2;u++)c[u]=parseInt(g.slice(u*2,u*2+2),16);return c}else return null},j.hexadecimalIntegerAsNumber=function(w){var g=parseInt(this[w],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},j.decimalFloatingPoint=function(w){return parseFloat(this[w])},j.optionalFloat=function(w,g){var c=this[w];return c?parseFloat(c):g},j.enumeratedString=function(w){return this[w]},j.bool=function(w){return this[w]==="YES"},j.decimalResolution=function(w){var g=N.exec(this[w]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},F.parseAttrList=function(w){var g,c={},u='"';for(S.lastIndex=0;(g=S.exec(w))!==null;){var a=g[2];a.indexOf(u)===0&&a.lastIndexOf(u)===a.length-1&&(a=a.slice(1,-1)),c[g[1]]=a}return c},F}()},"./src/utils/binary-search.ts":function(ue,W,R){"use strict";R.r(W);var N={search:function(O,F){for(var j=0,e=O.length-1,w=null,g=null;j<=e;){w=(j+e)/2|0,g=O[w];var c=F(g);if(c>0)j=w+1;else if(c<0)e=w-1;else return g}return null}};W.default=N},"./src/utils/buffer-helper.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"BufferHelper",function(){return O});var N=R("./src/utils/logger.ts"),S={length:0,start:function(){return 0},end:function(){return 0}},O=function(){function F(){}return F.isBuffered=function(e,w){try{if(e){for(var g=F.getBuffered(e),c=0;c<g.length;c++)if(w>=g.start(c)&&w<=g.end(c))return!0}}catch(u){}return!1},F.bufferInfo=function(e,w,g){try{if(e){var c=F.getBuffered(e),u=[],a;for(a=0;a<c.length;a++)u.push({start:c.start(a),end:c.end(a)});return this.bufferedInfo(u,w,g)}}catch(i){}return{len:0,start:w,end:w,nextStart:void 0}},F.bufferedInfo=function(e,w,g){w=Math.max(0,w),e.sort(function(m,b){var _=m.start-b.start;return _||b.end-m.end});var c=[];if(g)for(var u=0;u<e.length;u++){var a=c.length;if(a){var i=c[a-1].end;e[u].start-i<g?e[u].end>i&&(c[a-1].end=e[u].end):c.push(e[u])}else c.push(e[u])}else c=e;for(var d=0,s,r=w,n=w,t=0;t<c.length;t++){var v=c[t].start,p=c[t].end;if(w+g>=v&&w<p)r=v,n=p,d=n-w;else if(w+g<v){s=v;break}}return{len:d,start:r||0,end:n||0,nextStart:s}},F.getBuffered=function(e){try{return e.buffered}catch(w){return N.logger.log("failed to get media.buffered",w),S}},F}()},"./src/utils/cea-608-parser.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"Row",function(){return n}),R.d(W,"CaptionScreen",function(){return t});var N=R("./src/utils/logger.ts"),S={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},O=function(f){var l=f;return S.hasOwnProperty(f)&&(l=S[f]),String.fromCharCode(l)},F=15,j=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},w={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},c={25:2,26:4,29:6,30:8,31:10,27:13,28:15},u=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(o){o[o.ERROR=0]="ERROR",o[o.TEXT=1]="TEXT",o[o.WARNING=2]="WARNING",o[o.INFO=2]="INFO",o[o.DEBUG=3]="DEBUG",o[o.DATA=3]="DATA"})(a||(a={}));var i=function(){function o(){this.time=null,this.verboseLevel=a.ERROR}var f=o.prototype;return f.log=function(h,E){this.verboseLevel>=h&&N.logger.log(this.time+" ["+h+"] "+E)},o}(),d=function(f){for(var l=[],h=0;h<f.length;h++)l.push(f[h].toString(16));return l},s=function(){function o(l,h,E,y,T){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=l||"white",this.underline=h||!1,this.italics=E||!1,this.background=y||"black",this.flash=T||!1}var f=o.prototype;return f.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},f.setStyles=function(h){for(var E=["foreground","underline","italics","background","flash"],y=0;y<E.length;y++){var T=E[y];h.hasOwnProperty(T)&&(this[T]=h[T])}},f.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},f.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},f.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},f.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},o}(),r=function(){function o(l,h,E,y,T,L){this.uchar=void 0,this.penState=void 0,this.uchar=l||" ",this.penState=new s(h,E,y,T,L)}var f=o.prototype;return f.reset=function(){this.uchar=" ",this.penState.reset()},f.setChar=function(h,E){this.uchar=h,this.penState.copy(E)},f.setPenState=function(h){this.penState.copy(h)},f.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},f.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},f.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},o}(),n=function(){function o(l){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var h=0;h<j;h++)this.chars.push(new r);this.logger=l,this.pos=0,this.currPenState=new s}var f=o.prototype;return f.equals=function(h){for(var E=!0,y=0;y<j;y++)if(!this.chars[y].equals(h.chars[y])){E=!1;break}return E},f.copy=function(h){for(var E=0;E<j;E++)this.chars[E].copy(h.chars[E])},f.isEmpty=function(){for(var h=!0,E=0;E<j;E++)if(!this.chars[E].isEmpty()){h=!1;break}return h},f.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>j&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=j)},f.moveCursor=function(h){var E=this.pos+h;if(h>1)for(var y=this.pos+1;y<E+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(E)},f.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},f.insertChar=function(h){h>=144&&this.backSpace();var E=O(h);if(this.pos>=j){this.logger.log(a.ERROR,"Cannot insert "+h.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},f.clearFromPos=function(h){var E;for(E=h;E<j;E++)this.chars[E].reset()},f.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},f.clearToEndOfRow=function(){this.clearFromPos(this.pos)},f.getTextString=function(){for(var h=[],E=!0,y=0;y<j;y++){var T=this.chars[y].uchar;T!==" "&&(E=!1),h.push(T)}return E?"":h.join("")},f.setPenStyles=function(h){this.currPenState.setStyles(h);var E=this.chars[this.pos];E.setPenState(this.currPenState)},o}(),t=function(){function o(l){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var h=0;h<F;h++)this.rows.push(new n(l));this.logger=l,this.currRow=F-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var f=o.prototype;return f.reset=function(){for(var h=0;h<F;h++)this.rows[h].clear();this.currRow=F-1},f.equals=function(h){for(var E=!0,y=0;y<F;y++)if(!this.rows[y].equals(h.rows[y])){E=!1;break}return E},f.copy=function(h){for(var E=0;E<F;E++)this.rows[E].copy(h.rows[E])},f.isEmpty=function(){for(var h=!0,E=0;E<F;E++)if(!this.rows[E].isEmpty()){h=!1;break}return h},f.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},f.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},f.insertChar=function(h){var E=this.rows[this.currRow];E.insertChar(h)},f.setPen=function(h){var E=this.rows[this.currRow];E.setPenStyles(h)},f.moveCursor=function(h){var E=this.rows[this.currRow];E.moveCursor(h)},f.setCursor=function(h){this.logger.log(a.INFO,"setCursor: "+h);var E=this.rows[this.currRow];E.setCursor(h)},f.setPAC=function(h){this.logger.log(a.INFO,"pacData = "+JSON.stringify(h));var E=h.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var y=0;y<F;y++)this.rows[y].clear();var T=this.currRow+1-this.nrRollUpRows,L=this.lastOutputScreen;if(L){var D=L.rows[T].cueStartTime,x=this.logger.time;if(D&&x!==null&&D<x)for(var P=0;P<this.nrRollUpRows;P++)this.rows[E-this.nrRollUpRows+P+1].copy(L.rows[T+P])}}this.currRow=E;var H=this.rows[this.currRow];if(h.indent!==null){var I=h.indent,z=Math.max(I-1,0);H.setCursor(h.indent),h.color=H.chars[z].penState.foreground}var $={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen($)},f.setBkgData=function(h){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},f.setRollUpRows=function(h){this.nrRollUpRows=h},f.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(h,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(a.INFO,"Rolling up")},f.getDisplayText=function(h){h=h||!1;for(var E=[],y="",T=-1,L=0;L<F;L++){var D=this.rows[L].getTextString();D&&(T=L+1,h?E.push("Row "+T+": '"+D+"'"):E.push(D.trim()))}return E.length>0&&(h?y="["+E.join(" | ")+"]":y=E.join(`
`)),y},f.getTextAndFormat=function(){return this.rows},o}(),v=function(){function o(l,h,E){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=l,this.outputFilter=h,this.mode=null,this.verbose=0,this.displayedMemory=new t(E),this.nonDisplayedMemory=new t(E),this.lastOutputScreen=new t(E),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var f=o.prototype;return f.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[F-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},f.getHandler=function(){return this.outputFilter},f.setHandler=function(h){this.outputFilter=h},f.setPAC=function(h){this.writeScreen.setPAC(h)},f.setBkgData=function(h){this.writeScreen.setBkgData(h)},f.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(a.INFO,"MODE="+h),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=h},f.insertChars=function(h){for(var E=0;E<h.length;E++)this.writeScreen.insertChar(h[E]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},f.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},f.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},f.ccAOF=function(){},f.ccAON=function(){},f.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},f.ccRU=function(h){this.logger.log(a.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},f.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},f.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},f.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},f.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},f.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},f.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},f.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},f.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},f.ccTO=function(h){this.logger.log(a.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},f.ccMIDROW=function(h){var E={flash:!1};if(E.underline=h%2===1,E.italics=h>=46,E.italics)E.foreground="white";else{var y=Math.floor(h/2)-16,T=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=T[y]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},f.outputDataUpdate=function(h){h===void 0&&(h=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},f.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},o}(),p=function(){function o(l,h,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new i;this.channels=[null,new v(l,h,y),new v(l+1,E,y)],this.cmdHistory=_(),this.logger=y}var f=o.prototype;return f.getHandler=function(h){return this.channels[h].getHandler()},f.setHandler=function(h,E){this.channels[h].setHandler(E)},f.addData=function(h,E){var y,T,L,D=!1;this.logger.time=h;for(var x=0;x<E.length;x+=2){if(T=E[x]&127,L=E[x+1]&127,T===0&&L===0)continue;if(this.logger.log(a.DATA,"["+d([E[x],E[x+1]])+"] -> ("+d([T,L])+")"),y=this.parseCmd(T,L),y||(y=this.parseMidrow(T,L)),y||(y=this.parsePAC(T,L)),y||(y=this.parseBackgroundAttributes(T,L)),!y&&(D=this.parseChars(T,L),D)){var P=this.currentChannel;if(P&&P>0){var H=this.channels[P];H.insertChars(D)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!D&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+d([T,L])+" orig: "+d([E[x],E[x+1]]))}},f.parseCmd=function(h,E){var y=this.cmdHistory,T=(h===20||h===28||h===21||h===29)&&E>=32&&E<=47,L=(h===23||h===31)&&E>=33&&E<=35;if(!(T||L))return!1;if(b(h,E,y))return m(null,null,y),this.logger.log(a.DEBUG,"Repeated command ("+d([h,E])+") is dropped"),!0;var D=h===20||h===21||h===23?1:2,x=this.channels[D];return h===20||h===21||h===28||h===29?E===32?x.ccRCL():E===33?x.ccBS():E===34?x.ccAOF():E===35?x.ccAON():E===36?x.ccDER():E===37?x.ccRU(2):E===38?x.ccRU(3):E===39?x.ccRU(4):E===40?x.ccFON():E===41?x.ccRDC():E===42?x.ccTR():E===43?x.ccRTD():E===44?x.ccEDM():E===45?x.ccCR():E===46?x.ccENM():E===47&&x.ccEOC():x.ccTO(E-32),m(h,E,y),this.currentChannel=D,!0},f.parseMidrow=function(h,E){var y=0;if((h===17||h===25)&&E>=32&&E<=47){if(h===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var T=this.channels[y];return T?(T.ccMIDROW(E),this.logger.log(a.DEBUG,"MIDROW ("+d([h,E])+")"),!0):!1}return!1},f.parsePAC=function(h,E){var y,T=this.cmdHistory,L=(h>=17&&h<=23||h>=25&&h<=31)&&E>=64&&E<=127,D=(h===16||h===24)&&E>=64&&E<=95;if(!(L||D))return!1;if(b(h,E,T))return m(null,null,T),!0;var x=h<=23?1:2;E>=64&&E<=95?y=x===1?e[h]:g[h]:y=x===1?w[h]:c[h];var P=this.channels[x];return P?(P.setPAC(this.interpretPAC(y,E)),m(h,E,T),this.currentChannel=x,!0):!1},f.interpretPAC=function(h,E){var y,T={color:null,italics:!1,indent:null,underline:!1,row:h};return E>95?y=E-96:y=E-64,T.underline=(y&1)===1,y<=13?T.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(T.italics=!0,T.color="white"):T.indent=Math.floor((y-16)/2)*4,T},f.parseChars=function(h,E){var y,T=null,L=null;if(h>=25?(y=2,L=h-8):(y=1,L=h),L>=17&&L<=19){var D;L===17?D=E+80:L===18?D=E+112:D=E+144,this.logger.log(a.INFO,"Special char '"+O(D)+"' in channel "+y),T=[D]}else h>=32&&h<=127&&(T=E===0?[h]:[h,E]);if(T){var x=d(T);this.logger.log(a.DEBUG,"Char codes = "+x.join(",")),m(h,E,this.cmdHistory)}return T},f.parseBackgroundAttributes=function(h,E){var y=(h===16||h===24)&&E>=32&&E<=47,T=(h===23||h===31)&&E>=45&&E<=47;if(!(y||T))return!1;var L,D={};h===16||h===24?(L=Math.floor((E-32)/2),D.background=u[L],E%2===1&&(D.background=D.background+"_semi")):E===45?D.background="transparent":(D.foreground="black",E===47&&(D.underline=!0));var x=h<=23?1:2,P=this.channels[x];return P.setBkgData(D),m(h,E,this.cmdHistory),!0},f.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var E=this.channels[h];E&&E.reset()}this.cmdHistory=_()},f.cueSplitAtTime=function(h){for(var E=0;E<this.channels.length;E++){var y=this.channels[E];y&&y.cueSplitAtTime(h)}},o}();function m(o,f,l){l.a=o,l.b=f}function b(o,f,l){return l.a===o&&l.b===f}function _(){return{a:null,b:null}}W.default=p},"./src/utils/codecs.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"isCodecType",function(){return S}),R.d(W,"isCodecSupportedInMp4",function(){return O});var N={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function S(F,j){var e=N[j];return!!e&&e[F.slice(0,4)]===!0}function O(F,j){return MediaSource.isTypeSupported((j||"video")+'/mp4;codecs="'+F+'"')}},"./src/utils/cues.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/vttparser.ts"),S=R("./src/utils/webvtt-parser.ts"),O=R("./src/utils/texttrack-utils.ts"),F=/\s/,j={newCue:function(w,g,c,u){for(var a=[],i,d,s,r,n,t=self.VTTCue||self.TextTrackCue,v=0;v<u.rows.length;v++)if(i=u.rows[v],s=!0,r=0,n="",!i.isEmpty()){for(var p=0;p<i.chars.length;p++)F.test(i.chars[p].uchar)&&s?r++:(n+=i.chars[p].uchar,s=!1);i.cueStartTime=g,g===c&&(c+=1e-4),r>=16?r--:r++;var m=Object(N.fixLineBreaks)(n.trim()),b=Object(S.generateCueId)(g,c,m);(!w||!w.cues||!w.cues.getCueById(b))&&(d=new t(g,c,m),d.id=b,d.line=v+1,d.align="left",d.position=10+Math.min(80,Math.floor(r*8/32)*10),a.push(d))}return w&&a.length&&(a.sort(function(_,o){return _.line==="auto"||o.line==="auto"?0:_.line>8&&o.line>8?o.line-_.line:_.line-o.line}),a.forEach(function(_){return Object(O.addCueToTrack)(w,_)})),a}};W.default=j},"./src/utils/discontinuities.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"findFirstFragWithCC",function(){return F}),R.d(W,"shouldAlignOnDiscontinuities",function(){return j}),R.d(W,"findDiscontinuousReferenceFrag",function(){return e}),R.d(W,"adjustSlidingStart",function(){return g}),R.d(W,"alignStream",function(){return c}),R.d(W,"alignPDT",function(){return a}),R.d(W,"alignFragmentByPDTDelta",function(){return i}),R.d(W,"alignMediaPlaylistByPDT",function(){return d});var N=R("./src/polyfills/number.ts"),S=R("./src/utils/logger.ts"),O=R("./src/controller/level-helper.ts");function F(s,r){for(var n=null,t=0,v=s.length;t<v;t++){var p=s[t];if(p&&p.cc===r){n=p;break}}return n}function j(s,r,n){return!!(r.details&&(n.endCC>n.startCC||s&&s.cc<n.startCC))}function e(s,r){var n=s.fragments,t=r.fragments;if(!t.length||!n.length){S.logger.log("No fragments to align");return}var v=F(n,t[0].cc);if(!v||v&&!v.startPTS){S.logger.log("No frag in previous level to align on");return}return v}function w(s,r){if(s){var n=s.start+r;s.start=s.startPTS=n,s.endPTS=n+s.duration}}function g(s,r){for(var n=r.fragments,t=0,v=n.length;t<v;t++)w(n[t],s);r.fragmentHint&&w(r.fragmentHint,s),r.alignedSliding=!0}function c(s,r,n){if(!r)return;u(s,n,r),!n.alignedSliding&&r.details&&a(n,r.details),!n.alignedSliding&&r.details&&!n.skippedSegments&&Object(O.adjustSliding)(r.details,n)}function u(s,r,n){if(j(s,n,r)){var t=e(n.details,r);t&&Object(N.isFiniteNumber)(t.start)&&(S.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),g(t.start,r))}}function a(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,t=s.fragments[0].programDateTime,v=(t-n)/1e3+r.fragments[0].start;v&&Object(N.isFiniteNumber)(v)&&(S.logger.log("Adjusting PTS using programDateTime delta "+(t-n)+"ms, sliding:"+v.toFixed(3)+" "+s.url+" "),g(v,s))}function i(s,r){var n=s.programDateTime;if(!n)return;var t=(n-r)/1e3;s.start=s.startPTS=t,s.endPTS=t+s.duration}function d(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var n=r.fragments[0].programDateTime,t=r.fragments[0].start,v=n-t*1e3;s.fragments.forEach(function(p){i(p,v)}),s.fragmentHint&&i(s.fragmentHint,v),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/ewma.ts"),S=function(){function O(j,e,w){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=w,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new N.default(j),this.fast_=new N.default(e)}var F=O.prototype;return F.update=function(e,w){var g=this.slow_,c=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new N.default(e,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==w&&(this.fast_=new N.default(w,c.getEstimate(),c.getTotalWeight()))},F.sample=function(e,w){e=Math.max(e,this.minDelayMs_);var g=8*w,c=e/1e3,u=g/c;this.fast_.sample(c,u),this.slow_.sample(c,u)},F.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},F.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},F.destroy=function(){},O}();W.default=S},"./src/utils/ewma.ts":function(ue,W,R){"use strict";R.r(W);var N=function(){function S(F,j,e){j===void 0&&(j=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=F,this.alpha_=F?Math.exp(Math.log(.5)/F):0,this.estimate_=j,this.totalWeight_=e}var O=S.prototype;return O.sample=function(j,e){var w=Math.pow(this.alpha_,j);this.estimate_=e*(1-w)+w*this.estimate_,this.totalWeight_+=j},O.getTotalWeight=function(){return this.totalWeight_},O.getEstimate=function(){if(this.alpha_){var j=1-Math.pow(this.alpha_,this.totalWeight_);if(j)return this.estimate_/j}return this.estimate_},S}();W.default=N},"./src/utils/fetch-loader.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"fetchSupported",function(){return i});var N=R("./src/polyfills/number.ts"),S=R("./src/loader/load-stats.ts"),O=R("./src/demux/chunk-cache.ts");function F(t,v){t.prototype=Object.create(v.prototype),t.prototype.constructor=t,c(t,v)}function j(t){var v=typeof Map=="function"?new Map:void 0;return j=function(m){if(m===null||!g(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(m))return v.get(m);v.set(m,b)}function b(){return e(m,arguments,u(this).constructor)}return b.prototype=Object.create(m.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),c(b,m)},j(t)}function e(t,v,p){return w()?e=Reflect.construct:e=function(b,_,o){var f=[null];f.push.apply(f,_);var l=Function.bind.apply(b,f),h=new l;return o&&c(h,o.prototype),h},e.apply(null,arguments)}function w(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function g(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function c(t,v){return c=Object.setPrototypeOf||function(m,b){return m.__proto__=b,m},c(t,v)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(p){return p.__proto__||Object.getPrototypeOf(p)},u(t)}function a(){return a=Object.assign||function(t){for(var v=1;v<arguments.length;v++){var p=arguments[v];for(var m in p)Object.prototype.hasOwnProperty.call(p,m)&&(t[m]=p[m])}return t},a.apply(this,arguments)}function i(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var d=function(){function t(p){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=p.fetchSetup||r,this.controller=new self.AbortController,this.stats=new S.LoadStats}var v=t.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(m,b,_){var o=this,f=this.stats;if(f.loading.start)throw new Error("Loader can only be used once.");f.loading.start=self.performance.now();var l=s(m,this.controller.signal),h=_.onProgress,E=m.responseType==="arraybuffer",y=E?"byteLength":"length";this.context=m,this.config=b,this.callbacks=_,this.request=this.fetchSetup(m,l),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){o.abortInternal(),_.onTimeout(f,m,o.response)},b.timeout),self.fetch(this.request).then(function(T){if(o.response=o.loader=T,!T.ok){var L=T.status,D=T.statusText;throw new n(D||"fetch, bad network response",L,T)}return f.loading.first=Math.max(self.performance.now(),f.loading.start),f.total=parseInt(T.headers.get("Content-Length")||"0"),h&&Object(N.isFiniteNumber)(b.highWaterMark)?o.loadProgressively(T,f,m,b.highWaterMark,h):E?T.arrayBuffer():T.text()}).then(function(T){var L=o.response;self.clearTimeout(o.requestTimeout),f.loading.end=Math.max(self.performance.now(),f.loading.first),f.loaded=f.total=T[y];var D={url:L.url,data:T};h&&!Object(N.isFiniteNumber)(b.highWaterMark)&&h(f,m,T,L),_.onSuccess(D,f,m,L)}).catch(function(T){if(self.clearTimeout(o.requestTimeout),f.aborted)return;var L=T.code||0;_.onError({code:L,text:T.message},m,T.details)})},v.getCacheAge=function(){var m=null;if(this.response){var b=this.response.headers.get("age");m=b?parseFloat(b):null}return m},v.loadProgressively=function(m,b,_,o,f){o===void 0&&(o=0);var l=new O.default,h=m.body.getReader(),E=function y(){return h.read().then(function(T){if(T.done)return l.dataLength&&f(b,_,l.flush(),m),Promise.resolve(new ArrayBuffer(0));var L=T.value,D=L.length;return b.loaded+=D,D<o||l.dataLength?(l.push(L),l.dataLength>=o&&f(b,_,l.flush(),m)):f(b,_,L,m),y()}).catch(function(){return Promise.reject()})};return E()},t}();function s(t,v){var p={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(a({},t.headers))};return t.rangeEnd&&p.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),p}function r(t,v){return new self.Request(t.url,v)}var n=function(t){F(v,t);function v(p,m,b){var _;return _=t.call(this,p)||this,_.code=void 0,_.details=void 0,_.code=m,_.details=b,_}return v}(j(Error));W.default=d},"./src/utils/imsc1-ttml-parser.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"IMSC1_CODEC",function(){return g}),R.d(W,"parseIMSC1",function(){return i});var N=R("./src/utils/mp4-tools.ts"),S=R("./src/utils/vttparser.ts"),O=R("./src/utils/vttcue.ts"),F=R("./src/demux/id3.ts"),j=R("./src/utils/timescale-conversion.ts"),e=R("./src/utils/webvtt-parser.ts");function w(){return w=Object.assign||function(o){for(var f=1;f<arguments.length;f++){var l=arguments[f];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(o[h]=l[h])}return o},w.apply(this,arguments)}var g="stpp.ttml.im1t",c=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,u=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function i(o,f,l,h,E){var y=Object(N.findBox)(new Uint8Array(o),["mdat"]);if(y.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var T=y[0],L=Object(F.utf8ArrayToStr)(new Uint8Array(o,T.start,T.end-T.start)),D=Object(j.toTimescaleFromScale)(f,1,l);try{h(d(L,D))}catch(x){E(x)}}function d(o,f){var l=new DOMParser,h=l.parseFromString(o,"text/xml"),E=h.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},T=Object.keys(y).reduce(function(H,I){return H[I]=E.getAttribute("ttp:"+I)||y[I],H},{}),L=E.getAttribute("xml:space")!=="preserve",D=r(s(E,"styling","style")),x=r(s(E,"layout","region")),P=s(E,"body","[begin]");return[].map.call(P,function(H){var I=n(H,L);if(!I||!H.hasAttribute("begin"))return null;var z=m(H.getAttribute("begin"),T),$=m(H.getAttribute("dur"),T),fe=m(H.getAttribute("end"),T);if(z===null)throw p(H);if(fe===null){if($===null)throw p(H);fe=z+$}var ee=new O.default(z-f,fe-f,I);ee.id=Object(e.generateCueId)(ee.startTime,ee.endTime,ee.text);var ye=x[H.getAttribute("region")],pe=D[H.getAttribute("style")];ee.position=10,ee.size=80;var ae=t(ye,pe),se=ae.textAlign;if(se){var _e=a[se];_e&&(ee.lineAlign=_e),ee.align=se}return w(ee,ae),ee}).filter(function(H){return H!==null})}function s(o,f,l){var h=o.getElementsByTagName(f)[0];return h?[].slice.call(h.querySelectorAll(l)):[]}function r(o){return o.reduce(function(f,l){var h=l.getAttribute("xml:id");return h&&(f[h]=l),f},{})}function n(o,f){return[].slice.call(o.childNodes).reduce(function(l,h,E){var y;return h.nodeName==="br"&&E?l+`
`:(y=h.childNodes)!==null&&y!==void 0&&y.length?n(h,f):f?l+h.textContent.trim().replace(/\s+/g," "):l+h.textContent},"")}function t(o,f){var l="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(E,y){var T=v(f,l,y)||v(o,l,y);return T&&(E[y]=T),E},{})}function v(o,f,l){return o.hasAttributeNS(f,l)?o.getAttributeNS(f,l):null}function p(o){return new Error("Could not parse ttml timestamp "+o)}function m(o,f){if(!o)return null;var l=Object(S.parseTimeStamp)(o);return l===null&&(c.test(o)?l=b(o,f):u.test(o)&&(l=_(o,f))),l}function b(o,f){var l=c.exec(o),h=(l[4]|0)+(l[5]|0)/f.subFrameRate;return(l[1]|0)*3600+(l[2]|0)*60+(l[3]|0)+h/f.frameRate}function _(o,f){var l=u.exec(o),h=Number(l[1]),E=l[2];switch(E){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/f.frameRate;case"t":return h/f.tickRate}return h}},"./src/utils/logger.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"enableLogs",function(){return e}),R.d(W,"logger",function(){return w});var N=function(){},S={trace:N,debug:N,log:N,warn:N,info:N,error:N},O=S;function F(g){var c=self.console[g];return c?c.bind(self.console,"["+g+"] >"):N}function j(g){for(var c=arguments.length,u=new Array(c>1?c-1:0),a=1;a<c;a++)u[a-1]=arguments[a];u.forEach(function(i){O[i]=g[i]?g[i].bind(g):F(i)})}function e(g){if(self.console&&g===!0||typeof g=="object"){j(g,"debug","log","info","warn","error");try{O.log()}catch(c){O=S}}else O=S}var w=O},"./src/utils/mediakeys-helper.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"KeySystems",function(){return N}),R.d(W,"requestMediaKeySystemAccess",function(){return S});var N;(function(O){O.WIDEVINE="com.widevine.alpha",O.PLAYREADY="com.microsoft.playready"})(N||(N={}));var S=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"getMediaSource",function(){return N});function N(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"bin2str",function(){return j}),R.d(W,"readUint16",function(){return e}),R.d(W,"readUint32",function(){return w}),R.d(W,"writeUint32",function(){return g}),R.d(W,"findBox",function(){return c}),R.d(W,"parseSegmentIndex",function(){return u}),R.d(W,"parseInitSegment",function(){return a}),R.d(W,"getStartDTS",function(){return i}),R.d(W,"getDuration",function(){return d}),R.d(W,"computeRawDurationFromSamples",function(){return s}),R.d(W,"offsetStartDTS",function(){return r}),R.d(W,"segmentValidRange",function(){return n}),R.d(W,"appendUint8Array",function(){return t});var N=R("./src/utils/typed-array.ts"),S=R("./src/loader/fragment.ts"),O=Math.pow(2,32)-1,F=[].push;function j(v){return String.fromCharCode.apply(null,v)}function e(v,p){"data"in v&&(p+=v.start,v=v.data);var m=v[p]<<8|v[p+1];return m<0?65536+m:m}function w(v,p){"data"in v&&(p+=v.start,v=v.data);var m=v[p]<<24|v[p+1]<<16|v[p+2]<<8|v[p+3];return m<0?4294967296+m:m}function g(v,p,m){"data"in v&&(p+=v.start,v=v.data),v[p]=m>>24,v[p+1]=m>>16&255,v[p+2]=m>>8&255,v[p+3]=m&255}function c(v,p){var m=[];if(!p.length)return m;var b,_,o;"data"in v?(b=v.data,_=v.start,o=v.end):(b=v,_=0,o=b.byteLength);for(var f=_;f<o;){var l=w(b,f),h=j(b.subarray(f+4,f+8)),E=l>1?f+l:o;if(h===p[0])if(p.length===1)m.push({data:b,start:f+8,end:E});else{var y=c({data:b,start:f+8,end:E},p.slice(1));y.length&&F.apply(m,y)}f=E}return m}function u(v){var p=c(v,["moov"]),m=p[0],b=m?m.end:null,_=c(v,["sidx"]);if(!_||!_[0])return null;var o=[],f=_[0],l=f.data[0],h=l===0?8:16,E=w(f,h);h+=4;var y=0,T=0;l===0?h+=8:h+=16,h+=2;var L=f.end+T,D=e(f,h);h+=2;for(var x=0;x<D;x++){var P=h,H=w(f,P);P+=4;var I=H&2147483647,z=(H&2147483648)>>>31;if(z===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=w(f,P);P+=4,o.push({referenceSize:I,subsegmentDuration:$,info:{duration:$/E,start:L,end:L+I-1}}),L+=I,P+=4,h=P}return{earliestPresentationTime:y,timescale:E,version:l,referencesCount:D,references:o,moovEndOffset:b}}function a(v){for(var p=[],m=c(v,["moov","trak"]),b=0;b<m.length;b++){var _=m[b],o=c(_,["tkhd"])[0];if(o){var f=o.data[o.start],l=f===0?12:20,h=w(o,l),E=c(_,["mdia","mdhd"])[0];if(E){f=E.data[E.start],l=f===0?12:20;var y=w(E,l),T=c(_,["mdia","hdlr"])[0];if(T){var L=j(T.data.subarray(T.start+8,T.start+12)),D={soun:S.ElementaryStreamTypes.AUDIO,vide:S.ElementaryStreamTypes.VIDEO}[L];if(D){var x=c(_,["mdia","minf","stbl","stsd"])[0],P=void 0;x&&(P=j(x.data.subarray(x.start+12,x.start+16))),p[h]={timescale:y,type:D},p[D]={timescale:y,id:h,codec:P}}}}}}var H=c(v,["moov","mvex","trex"]);return H.forEach(function(I){var z=w(I,4),$=p[z];$&&($.default={duration:w(I,12),flags:w(I,20)})}),p}function i(v,p){return c(p,["moof","traf"]).reduce(function(m,b){var _=c(b,["tfdt"])[0],o=_.data[_.start],f=c(b,["tfhd"]).reduce(function(l,h){var E=w(h,4),y=v[E];if(y){var T=w(_,4);o===1&&(T*=Math.pow(2,32),T+=w(_,8));var L=y.timescale||9e4,D=T/L;if(isFinite(D)&&(l===null||D<l))return D}return l},null);return f!==null&&isFinite(f)&&(m===null||f<m)?f:m},null)||0}function d(v,p){for(var m=0,b=0,_=0,o=c(v,["moof","traf"]),f=0;f<o.length;f++){var l=o[f],h=c(l,["tfhd"])[0],E=w(h,4),y=p[E];if(!y)continue;var T=y.default,L=w(h,0)|(T==null?void 0:T.flags),D=T==null?void 0:T.duration;L&8&&(L&2?D=w(h,12):D=w(h,8));for(var x=y.timescale||9e4,P=c(l,["trun"]),H=0;H<P.length;H++){if(D){var I=w(P[H],4);m=D*I}else m=s(P[H]);y.type===S.ElementaryStreamTypes.VIDEO?b+=m/x:y.type===S.ElementaryStreamTypes.AUDIO&&(_+=m/x)}}if(b===0&&_===0){var z=u(v);if(z!=null&&z.references)return z.references.reduce(function($,fe){return $+fe.info.duration||0},0)}return b||_}function s(v){var p=w(v,0),m=8;p&1&&(m+=4),p&4&&(m+=4);for(var b=0,_=w(v,4),o=0;o<_;o++){if(p&256){var f=w(v,m);b+=f,m+=4}p&512&&(m+=4),p&1024&&(m+=4),p&2048&&(m+=4)}return b}function r(v,p,m){c(p,["moof","traf"]).forEach(function(b){c(b,["tfhd"]).forEach(function(_){var o=w(_,4),f=v[o];if(!f)return;var l=f.timescale||9e4;c(b,["tfdt"]).forEach(function(h){var E=h.data[h.start],y=w(h,4);if(E===0)g(h,4,y-m*l);else{y*=Math.pow(2,32),y+=w(h,8),y-=m*l,y=Math.max(y,0);var T=Math.floor(y/(O+1)),L=Math.floor(y%(O+1));g(h,4,T),g(h,8,L)}})})})}function n(v){var p={valid:null,remainder:null},m=c(v,["moof"]);if(m){if(m.length<2)return p.remainder=v,p}else return p;var b=m[m.length-1];return p.valid=Object(N.sliceUint8)(v,0,b.start-8),p.remainder=Object(N.sliceUint8)(v,b.start-8),p}function t(v,p){var m=new Uint8Array(v.length+p.length);return m.set(v),m.set(p,v.length),m}},"./src/utils/output-filter.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"default",function(){return N});var N=function(){function S(F,j){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=F,this.trackName=j}var O=S.prototype;return O.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},O.newCue=function(j,e,w){(this.startTime===null||this.startTime>j)&&(this.startTime=j),this.endTime=e,this.screen=w,this.timelineController.createCaptionsTrack(this.trackName)},O.reset=function(){this.cueRanges=[]},S}()},"./src/utils/texttrack-utils.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"sendAddTrackEvent",function(){return S}),R.d(W,"addCueToTrack",function(){return O}),R.d(W,"clearCurrentCues",function(){return F}),R.d(W,"removeCuesInRange",function(){return j}),R.d(W,"getCuesInRange",function(){return w});var N=R("./src/utils/logger.ts");function S(g,c){var u;try{u=new Event("addtrack")}catch(a){u=document.createEvent("Event"),u.initEvent("addtrack",!1,!1)}u.track=g,c.dispatchEvent(u)}function O(g,c){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(c.id))try{if(g.addCue(c),!g.cues.getCueById(c.id))throw new Error("addCue is failed for: "+c)}catch(i){N.logger.debug("[texttrack-utils]: "+i);var a=new self.TextTrackCue(c.startTime,c.endTime,c.text);a.id=c.id,g.addCue(a)}u==="disabled"&&(g.mode=u)}function F(g){var c=g.mode;if(c==="disabled"&&(g.mode="hidden"),g.cues)for(var u=g.cues.length;u--;)g.removeCue(g.cues[u]);c==="disabled"&&(g.mode=c)}function j(g,c,u){var a=g.mode;if(a==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var i=w(g.cues,c,u),d=0;d<i.length;d++)g.removeCue(i[d]);a==="disabled"&&(g.mode=a)}function e(g,c){if(c<g[0].startTime)return 0;var u=g.length-1;if(c>g[u].endTime)return-1;for(var a=0,i=u;a<=i;){var d=Math.floor((i+a)/2);if(c<g[d].startTime)i=d-1;else if(c>g[d].startTime&&a<u)a=d+1;else return d}return g[a].startTime-c<c-g[i].startTime?a:i}function w(g,c,u){var a=[],i=e(g,c);if(i>-1)for(var d=i,s=g.length;d<s;d++){var r=g[d];if(r.startTime>=c&&r.endTime<=u)a.push(r);else if(r.startTime>u)return a}return a}},"./src/utils/time-ranges.ts":function(ue,W,R){"use strict";R.r(W);var N={toString:function(O){for(var F="",j=O.length,e=0;e<j;e++)F+="["+O.start(e).toFixed(3)+","+O.end(e).toFixed(3)+"]";return F}};W.default=N},"./src/utils/timescale-conversion.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"toTimescaleFromBase",function(){return S}),R.d(W,"toTimescaleFromScale",function(){return O}),R.d(W,"toMsFromMpegTsClock",function(){return F}),R.d(W,"toMpegTsClockFromTimescale",function(){return j});var N=9e4;function S(e,w,g,c){g===void 0&&(g=1),c===void 0&&(c=!1);var u=e*w*g;return c?Math.round(u):u}function O(e,w,g,c){return g===void 0&&(g=1),c===void 0&&(c=!1),S(e,w,1/g,c)}function F(e,w){return w===void 0&&(w=!1),S(e,1e3,1/N,w)}function j(e,w){return w===void 0&&(w=1),S(e,N,1/w)}},"./src/utils/typed-array.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"sliceUint8",function(){return N});function N(S,O,F){return Uint8Array.prototype.slice?S.slice(O,F):new Uint8Array(Array.prototype.slice.call(S,O,F))}},"./src/utils/vttcue.ts":function(ue,W,R){"use strict";R.r(W),W.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var N=["","lr","rl"],S=["start","middle","end","left","right"];function O(g,c){if(typeof c!="string")return!1;if(!Array.isArray(g))return!1;var u=c.toLowerCase();return~g.indexOf(u)?u:!1}function F(g){return O(N,g)}function j(g){return O(S,g)}function e(g){for(var c=arguments.length,u=new Array(c>1?c-1:0),a=1;a<c;a++)u[a-1]=arguments[a];for(var i=1;i<arguments.length;i++){var d=arguments[i];for(var s in d)g[s]=d[s]}return g}function w(g,c,u){var a=this,i={enumerable:!0};a.hasBeenReset=!1;var d="",s=!1,r=g,n=c,t=u,v=null,p="",m=!0,b="auto",_="start",o=50,f="middle",l=50,h="middle";Object.defineProperty(a,"id",e({},i,{get:function(){return d},set:function(y){d=""+y}})),Object.defineProperty(a,"pauseOnExit",e({},i,{get:function(){return s},set:function(y){s=!!y}})),Object.defineProperty(a,"startTime",e({},i,{get:function(){return r},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");r=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",e({},i,{get:function(){return n},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");n=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",e({},i,{get:function(){return t},set:function(y){t=""+y,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",e({},i,{get:function(){return v},set:function(y){v=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",e({},i,{get:function(){return p},set:function(y){var T=F(y);if(T===!1)throw new SyntaxError("An invalid or illegal string was specified.");p=T,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",e({},i,{get:function(){return m},set:function(y){m=!!y,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",e({},i,{get:function(){return b},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");b=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",e({},i,{get:function(){return _},set:function(y){var T=j(y);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");_=T,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",e({},i,{get:function(){return o},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");o=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",e({},i,{get:function(){return f},set:function(y){var T=j(y);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");f=T,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",e({},i,{get:function(){return l},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");l=y,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",e({},i,{get:function(){return h},set:function(y){var T=j(y);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");h=T,this.hasBeenReset=!0}})),a.displayState=void 0}return w.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},w}()},"./src/utils/vttparser.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"parseTimeStamp",function(){return O}),R.d(W,"fixLineBreaks",function(){return c}),R.d(W,"VTTParser",function(){return u});var N=R("./src/utils/vttcue.ts"),S=function(){function a(){}var i=a.prototype;return i.decode=function(s,r){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},a}();function O(a){function i(s,r,n,t){return(s|0)*3600+(r|0)*60+(n|0)+parseFloat(t||0)}var d=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?i(d[2],d[3],0,d[4]):i(d[1],d[2],d[3],d[4]):null}var F=function(){function a(){this.values=Object.create(null)}var i=a.prototype;return i.set=function(s,r){!this.get(s)&&r!==""&&(this.values[s]=r)},i.get=function(s,r,n){return n?this.has(s)?this.values[s]:r[n]:this.has(s)?this.values[s]:r},i.has=function(s){return s in this.values},i.alt=function(s,r,n){for(var t=0;t<n.length;++t)if(r===n[t]){this.set(s,r);break}},i.integer=function(s,r){/^-?\d+$/.test(r)&&this.set(s,parseInt(r,10))},i.percent=function(s,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var n=parseFloat(r);if(n>=0&&n<=100)return this.set(s,n),!0}return!1},a}();function j(a,i,d,s){var r=s?a.split(s):[a];for(var n in r){if(typeof r[n]!="string")continue;var t=r[n].split(d);if(t.length!==2)continue;var v=t[0],p=t[1];i(v,p)}}var e=new N.default(0,0,""),w=e.align==="middle"?"middle":"center";function g(a,i,d){var s=a;function r(){var v=O(a);if(v===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),v}function n(v,p){var m=new F;j(v,function(o,f){var l;switch(o){case"region":for(var h=d.length-1;h>=0;h--)if(d[h].id===f){m.set(o,d[h].region);break}break;case"vertical":m.alt(o,f,["rl","lr"]);break;case"line":l=f.split(","),m.integer(o,l[0]),m.percent(o,l[0])&&m.set("snapToLines",!1),m.alt(o,l[0],["auto"]),l.length===2&&m.alt("lineAlign",l[1],["start",w,"end"]);break;case"position":l=f.split(","),m.percent(o,l[0]),l.length===2&&m.alt("positionAlign",l[1],["start",w,"end","line-left","line-right","auto"]);break;case"size":m.percent(o,f);break;case"align":m.alt(o,f,["start",w,"end","left","right"]);break}},/:/,/\s/),p.region=m.get("region",null),p.vertical=m.get("vertical","");var b=m.get("line","auto");b==="auto"&&e.line===-1&&(b=-1),p.line=b,p.lineAlign=m.get("lineAlign","start"),p.snapToLines=m.get("snapToLines",!0),p.size=m.get("size",100),p.align=m.get("align",w);var _=m.get("position","auto");_==="auto"&&e.position===50&&(_=p.align==="start"||p.align==="left"?0:p.align==="end"||p.align==="right"?100:50),p.position=_}function t(){a=a.replace(/^\s+/,"")}if(t(),i.startTime=r(),t(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.substr(3),t(),i.endTime=r(),t(),n(a,i)}function c(a){return a.replace(/<br(?: \/)?>/gi,`
`)}var u=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new S,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var i=a.prototype;return i.parse=function(s){var r=this;s&&(r.buffer+=r.decoder.decode(s,{stream:!0}));function n(){var _=r.buffer,o=0;for(_=c(_);o<_.length&&_[o]!=="\r"&&_[o]!==`
`;)++o;var f=_.substr(0,o);return _[o]==="\r"&&++o,_[o]===`
`&&++o,r.buffer=_.substr(o),f}function t(_){j(_,function(o,f){},/:/)}try{var v="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;v=n();var p=v.match(/^()?WEBVTT([ \t].*)?$/);if(!p||!p[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var m=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;m?m=!1:v=n();switch(r.state){case"HEADER":/:/.test(v)?t(v):v||(r.state="ID");continue;case"NOTE":v||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){r.state="NOTE";break}if(!v)continue;if(r.cue=new N.default(0,0,""),r.state="CUE",v.indexOf("-->")===-1){r.cue.id=v;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{g(v,r.cue,r.regionList)}catch(_){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var b=v.indexOf("-->")!==-1;if(!v||b&&(m=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
`),r.cue.text+=v}continue;case"BADCUE":v||(r.state="ID")}}}catch(_){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},i.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){s.onparsingerror&&s.onparsingerror(r)}return s.onflush&&s.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(ue,W,R){"use strict";R.r(W),R.d(W,"generateCueId",function(){return u}),R.d(W,"parseWebVTT",function(){return i});var N=R("./src/polyfills/number.ts"),S=R("./src/utils/vttparser.ts"),O=R("./src/demux/id3.ts"),F=R("./src/utils/timescale-conversion.ts"),j=R("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,w=function(s,r,n){return n===void 0&&(n=0),s.substr(n,r.length)===r},g=function(s){var r=parseInt(s.substr(-3)),n=parseInt(s.substr(-6,2)),t=parseInt(s.substr(-9,2)),v=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(N.isFiniteNumber)(r)||!Object(N.isFiniteNumber)(n)||!Object(N.isFiniteNumber)(t)||!Object(N.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return r+=1e3*n,r+=60*1e3*t,r+=60*60*1e3*v,r},c=function(s){for(var r=5381,n=s.length;n;)r=r*33^s.charCodeAt(--n);return(r>>>0).toString()};function u(d,s,r){return c(d.toString())+c(s.toString())+c(r)}var a=function(s,r,n){var t=s[r],v=s[t.prevCC];if(!v||!v.new&&t.new){s.ccOffset=s.presentationOffset=t.start,t.new=!1;return}for(;(p=v)!==null&&p!==void 0&&p.new;){var p;s.ccOffset+=t.start-v.start,t.new=!1,t=v,v=s[t.prevCC]}s.presentationOffset=n};function i(d,s,r,n,t,v,p,m){var b=new S.VTTParser,_=Object(O.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(e,`
`).split(`
`),o=[],f=Object(F.toMpegTsClockFromTimescale)(s,r),l="00:00.000",h=0,E=0,y,T=!0,L=!1;b.oncue=function(D){var x=n[t],P=n.ccOffset,H=(h-f)/9e4;if(x!=null&&x.new&&(E!==void 0?P=n.ccOffset=x.start:a(n,t,H)),H&&(P=H-n.presentationOffset),L){var I=D.endTime-D.startTime,z=Object(j.normalizePts)((D.startTime+P-E)*9e4,v*9e4)/9e4;D.startTime=z,D.endTime=z+I}var $=D.text.trim();D.text=decodeURIComponent(encodeURIComponent($)),D.id||(D.id=u(D.startTime,D.endTime,$)),D.endTime>0&&o.push(D)},b.onparsingerror=function(D){y=D},b.onflush=function(){if(y){m(y);return}p(o)},_.forEach(function(D){if(T)if(w(D,"X-TIMESTAMP-MAP=")){T=!1,L=!0,D.substr(16).split(",").forEach(function(x){w(x,"LOCAL:")?l=x.substr(6):w(x,"MPEGTS:")&&(h=parseInt(x.substr(7)))});try{E=g(l)/1e3}catch(x){L=!1,y=x}return}else D===""&&(T=!1);b.parse(D+`
`)}),b.flush()}},"./src/utils/xhr-loader.ts":function(ue,W,R){"use strict";R.r(W);var N=R("./src/utils/logger.ts"),S=R("./src/loader/load-stats.ts"),O=/^age:\s*[\d.]+\s*$/m,F=function(){function j(w){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=w?w.xhrSetup:null,this.stats=new S.LoadStats,this.retryDelay=0}var e=j.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},e.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(g,c,u){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=c,this.callbacks=u,this.retryDelay=c.retryDelay,this.loadInternal()},e.loadInternal=function(){var g=this.config,c=this.context;if(!g)return;var u=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var i=this.xhrSetup;try{if(i)try{i(u,c.url)}catch(r){u.open("GET",c.url,!0),i(u,c.url)}u.readyState||u.open("GET",c.url,!0);var d=this.context.headers;if(d)for(var s in d)u.setRequestHeader(s,d[s])}catch(r){this.callbacks.onError({code:u.status,text:r.message},c,u);return}c.rangeEnd&&u.setRequestHeader("Range","bytes="+c.rangeStart+"-"+(c.rangeEnd-1)),u.onreadystatechange=this.readystatechange.bind(this),u.onprogress=this.loadprogress.bind(this),u.responseType=c.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),u.send()},e.readystatechange=function(){var g=this.context,c=this.loader,u=this.stats;if(!g||!c)return;var a=c.readyState,i=this.config;if(u.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),u.loading.first===0&&(u.loading.first=Math.max(self.performance.now(),u.loading.start)),a===4){c.onreadystatechange=null,c.onprogress=null;var d=c.status;if(d>=200&&d<300){u.loading.end=Math.max(self.performance.now(),u.loading.first);var s,r;if(g.responseType==="arraybuffer"?(s=c.response,r=s.byteLength):(s=c.responseText,r=s.length),u.loaded=u.total=r,!this.callbacks)return;var n=this.callbacks.onProgress;if(n&&n(u,g,s,c),!this.callbacks)return;var t={url:c.responseURL,data:s};this.callbacks.onSuccess(t,u,g,c)}else u.retry>=i.maxRetry||d>=400&&d<499?(N.logger.error(d+" while loading "+g.url),this.callbacks.onError({code:d,text:c.statusText},g,c)):(N.logger.warn(d+" while loading "+g.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,i.maxRetryDelay),u.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout)},e.loadtimeout=function(){N.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(g){var c=this.stats;c.loaded=g.loaded,g.lengthComputable&&(c.total=g.total)},e.getCacheAge=function(){var g=null;if(this.loader&&O.test(this.loader.getAllResponseHeaders())){var c=this.loader.getResponseHeader("age");g=c?parseFloat(c):null}return g},j}();W.default=F}}).default})},vHTk:function(Ge,be,U){Ge.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},xTzM:function(Ge,be){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAqRJREFUWEfNmE1o02AYx/9JzJaltHatZRVR5hSRXHYYbCpMmTIRexAsDD0L8+Rphx10DIQddvDowbugCB68iWOKDqeb7tKD+MGKA8vo3Nzch7ZLlsibJjPrkjRvE8hySUiej9/7/PO+b54wmqZx2IMH4wqWv3kIS19HIcTOgVUP1uRX2XmUVl+DxX10vHpX097FwBmMQC3kP4JtSFElYPiKefnLGJrSd+sFdAb70PMQm8o1KiirMR8D5FXv7pzwE5wyjuSJQbQ9KDiDvWwrgIu2eI8ckOXWWhGtvZ3OYONHlYBS0YeJtT52BnueVMAYMTVAvyZnu8N85mS/67kGMAygGQHNa/PcEC+6gCUqFUueBaQRgD9AP3IaD3kR+HQbWHqje9UG63wE7GumSVG/rbIMTF+nAKs/Fb2nd7An9MH9eEz3eaxY11O39dmYEUHNEgBTWY9gp575GT+97/srFrDl0QGo6h1Ai9JH8lFQNQXwJ3cG2Aab7T+CaPNcoEBUwY4Bje3/PSYvGRUjYGIkPDAmDjRdNsBUYBuMfI9968tBbJGoBhqksXgV4Iy3aPKi5R37nB1CJDUcZC6qWEIHIJ6puEx0W8EyEoR0Tt+7nPYwqkyGsdd4wn4gesMGjNwicrKN4cmZ7Af4RFXFCBiRk+PDkzN+oSLnDil1sIwERsjVo1ggPmIKSNyyATPl3PwbnpyHh6qWC3PIRE55Izw501lgZtBmryRylkvhyjn7wmETJ7NzvRienL/m9O5q9xcskXNjPhw5VRlQSsDvgh1YRsLaQnhybpWBP+sOzchU+1toWlfNnaB6ZaddN6zdEfE14ynymH0zMtNzGivfJ8CH1FpGjnc7d0lkhi7m76H8o5e2EL7sGW4E51eG3f/2+Mrgz3nPgv0D9Cc+LoUg84gAAAAASUVORK5CYII="}}]);