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.
393 lines
981 KiB
393 lines
981 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[100,5,7,8],{"+92d":function(Me,ne,B){Me.exports=B.p+"static/b1.8d46544a.svg"},"+ua5":function(Me,ne,B){},"/cxE":function(Me,ne,B){"use strict";B.d(ne,"f",function(){return I}),B.d(ne,"g",function(){return W}),B.d(ne,"h",function(){return P}),B.d(ne,"e",function(){return K}),B.d(ne,"b",function(){return N}),B.d(ne,"c",function(){return e}),B.d(ne,"d",function(){return C}),B.d(ne,"a",function(){return E});class Q{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
|
|
|
|
`+g.stack):g},0)}}emit(g){this.listeners.forEach(h=>{h(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const H=new Q;function I(g){K(g)||H.onUnexpectedError(g);return}function W(g){K(g)||H.onUnexpectedExternalError(g);return}function P(g){if(g instanceof Error){let{name:h,message:a}=g;const i=g.stacktrace||g.stack;return{$isError:!0,name:h,message:a,stack:i}}return g}const R="Canceled";function K(g){return g instanceof Error&&g.name===R&&g.message===R}function N(){const g=new Error(R);return g.name=g.message,g}function e(g){return g?new Error(`Illegal argument: ${g}`):new Error("Illegal argument")}function C(g){return g?new Error(`Illegal state: ${g}`):new Error("Illegal state")}class E extends Error{constructor(g){super("NotSupported");g&&(this.message=g)}}},"24hK":function(Me,ne,B){"use strict";B.d(ne,"a",function(){return H});class Q{constructor(I){this.element=I,this.next=Q.Undefined,this.prev=Q.Undefined}}Q.Undefined=new Q(void 0);class H{constructor(){this._first=Q.Undefined,this._last=Q.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Q.Undefined}clear(){let I=this._first;for(;I!==Q.Undefined;){const W=I.next;I.prev=Q.Undefined,I.next=Q.Undefined,I=W}this._first=Q.Undefined,this._last=Q.Undefined,this._size=0}unshift(I){return this._insert(I,!1)}push(I){return this._insert(I,!0)}_insert(I,W){const P=new Q(I);if(this._first===Q.Undefined)this._first=P,this._last=P;else if(W){const K=this._last;this._last=P,P.prev=K,K.next=P}else{const K=this._first;this._first=P,P.next=K,K.prev=P}this._size+=1;let R=!1;return()=>{R||(R=!0,this._remove(P))}}shift(){if(this._first===Q.Undefined)return;{const I=this._first.element;return this._remove(this._first),I}}pop(){if(this._last===Q.Undefined)return;{const I=this._last.element;return this._remove(this._last),I}}_remove(I){if(I.prev!==Q.Undefined&&I.next!==Q.Undefined){const W=I.prev;W.next=I.next,I.next.prev=W}else I.prev===Q.Undefined&&I.next===Q.Undefined?(this._first=Q.Undefined,this._last=Q.Undefined):I.next===Q.Undefined?(this._last=this._last.prev,this._last.next=Q.Undefined):I.prev===Q.Undefined&&(this._first=this._first.next,this._first.prev=Q.Undefined);this._size-=1}*[Symbol.iterator](){let I=this._first;for(;I!==Q.Undefined;)yield I.element,I=I.next}}},"3/fG":function(Me,ne,B){"use strict";B.d(ne,"a",function(){return H});function Q(I,W){let P;return W.length===0?P=I:P=I.replace(/\{(\d+)\}/g,function(R,K){const N=K[0];return typeof W[N]!="undefined"?W[N]:R}),P}function H(I,W,...P){return Q(W,P)}},"55Ip":function(Me,ne,B){"use strict";B.d(ne,"a",function(){return r});var Q=B("Ty5D"),H=B("dI71"),I=B("q1tI"),W=B.n(I),P=B("YS25"),R=B("17x9"),K=B.n(R),N=B("wx14"),e=B("zLVn"),C=B("9R94"),E=function(u){Object(H.a)(o,u);function o(){for(var _,p=arguments.length,d=new Array(p),A=0;A<p;A++)d[A]=arguments[A];return _=u.call.apply(u,[this].concat(d))||this,_.history=Object(P.a)(_.props),_}var c=o.prototype;return c.render=function(){return W.a.createElement(Q.c,{history:this.history,children:this.props.children})},o}(W.a.Component),g=function(u){Object(H.a)(o,u);function o(){for(var _,p=arguments.length,d=new Array(p),A=0;A<p;A++)d[A]=arguments[A];return _=u.call.apply(u,[this].concat(d))||this,_.history=Object(P.b)(_.props),_}var c=o.prototype;return c.render=function(){return W.a.createElement(Q.c,{history:this.history,children:this.props.children})},o}(W.a.Component),h=function(o,c){return typeof o=="function"?o(c):o},a=function(o,c){return typeof o=="string"?Object(P.c)(o,null,null,c):o},i=function(o){return o},l=W.a.forwardRef;typeof l=="undefined"&&(l=i);function s(u){return!!(u.metaKey||u.altKey||u.ctrlKey||u.shiftKey)}var n=l(function(u,o){var c=u.innerRef,_=u.navigate,p=u.onClick,d=Object(e.a)(u,["innerRef","navigate","onClick"]),A=d.target,D=Object(N.a)({},d,{onClick:function(L){try{p&&p(L)}catch(M){throw L.preventDefault(),M}!L.defaultPrevented&&L.button===0&&(!A||A==="_self")&&!s(L)&&(L.preventDefault(),_())}});return i!==l?D.ref=o||c:D.ref=c,W.a.createElement("a",D)}),r=l(function(u,o){var c=u.component,_=c===void 0?n:c,p=u.replace,d=u.to,A=u.innerRef,D=Object(e.a)(u,["component","replace","to","innerRef"]);return W.a.createElement(Q.e.Consumer,null,function(S){S||Object(C.a)(!1);var L=S.history,M=a(h(d,S.location),S.location),O=M?L.createHref(M):"",j=Object(N.a)({},D,{href:O,navigate:function(){var X=h(d,S.location),ee=p?L.replace:L.push;ee(X)}});return i!==l?j.ref=o||A:j.innerRef=A,W.a.createElement(_,j)})});if(!1)var t,b;var v=function(o){return o},m=W.a.forwardRef;typeof m=="undefined"&&(m=v);function T(){for(var u=arguments.length,o=new Array(u),c=0;c<u;c++)o[c]=arguments[c];return o.filter(function(_){return _}).join(" ")}var y=m(function(u,o){var c=u["aria-current"],_=c===void 0?"page":c,p=u.activeClassName,d=p===void 0?"active":p,A=u.activeStyle,D=u.className,S=u.exact,L=u.isActive,M=u.location,O=u.sensitive,j=u.strict,G=u.style,X=u.to,ee=u.innerRef,he=Object(e.a)(u,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return W.a.createElement(Q.e.Consumer,null,function(ge){ge||Object(C.a)(!1);var de=M||ge.location,Te=a(h(X,de),de),xe=Te.pathname,ce=xe&&xe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ae=ce?Object(Q.f)(de.pathname,{path:ce,exact:S,sensitive:O,strict:j}):null,Le=!!(L?L(ae,de):ae),Ye=Le?T(D,d):D,Fe=Le?Object(N.a)({},G,{},A):G,We=Object(N.a)({"aria-current":Le&&_||null,className:Ye,style:Fe,to:Te},he);return v!==m?We.ref=o||ee:We.innerRef=ee,W.a.createElement(r,We)})});if(!1)var f},"5VLF":function(Me,ne,B){"use strict";var Q,H;function I(W,P,R){var K=function(N,e){return W.js_beautify(N,e)};return K.js=W.js_beautify,K.css=P.css_beautify,K.html=R.html_beautify,K.js_beautify=W.js_beautify,K.css_beautify=P.css_beautify,K.html_beautify=R.html_beautify,K}!(Q=[B("6UM0"),B("TXwP"),B("psGv")],H=function(W,P,R){return I(W,P,R)}.apply(ne,Q),H!==void 0&&(Me.exports=H))},"5Y4S":function(Me,ne,B){"use strict";B.d(ne,"a",function(){return I});var Q=B("MNsG");const H=Q.b.performance&&typeof Q.b.performance.now=="function";class I{constructor(W){this._highResolution=H&&W,this._startTime=this._now(),this._stopTime=-1}static create(W=!0){return new I(W)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Q.b.performance.now():Date.now()}}},"6+eU":function(Me,ne,B){"use strict";B.d(ne,"a",function(){return m});var Q=B("wx14"),H=B("rePB"),I=B("VTBJ"),W=B("1OyB"),P=B("vuIU"),R=B("Ji7U"),K=B("LK+K"),N=B("q1tI"),e=B.n(N),C=B("TSYQ"),E=B.n(C),g=function(y){var f,u="".concat(y.rootPrefixCls,"-item"),o=E()(u,"".concat(u,"-").concat(y.page),(f={},Object(H.a)(f,"".concat(u,"-active"),y.active),Object(H.a)(f,y.className,!!y.className),Object(H.a)(f,"".concat(u,"-disabled"),!y.page),f)),c=function(){y.onClick(y.page)},_=function(d){y.onKeyPress(d,y.onClick,y.page)};return e.a.createElement("li",{title:y.showTitle?y.page:null,className:o,onClick:c,onKeyPress:_,tabIndex:"0"},y.itemRender(y.page,"page",e.a.createElement("a",{rel:"nofollow"},y.page)))},h=g,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(T){Object(R.a)(f,T);var y=Object(K.a)(f);function f(){var u;Object(W.a)(this,f);for(var o=arguments.length,c=new Array(o),_=0;_<o;_++)c[_]=arguments[_];return u=y.call.apply(y,[this].concat(c)),u.state={goInputText:""},u.buildOptionText=function(p){return"".concat(p," ").concat(u.props.locale.items_per_page)},u.changeSize=function(p){u.props.changeSize(Number(p))},u.handleChange=function(p){u.setState({goInputText:p.target.value})},u.handleBlur=function(p){var d=u.props,A=d.goButton,D=d.quickGo,S=d.rootPrefixCls,L=u.state.goInputText;if(A||L==="")return;if(p.relatedTarget&&(p.relatedTarget.className.indexOf("".concat(S,"-prev"))>=0||p.relatedTarget.className.indexOf("".concat(S,"-next"))>=0))return;u.setState({goInputText:""}),D(u.getValidValue())},u.go=function(p){var d=u.state.goInputText;if(d==="")return;(p.keyCode===a.ENTER||p.type==="click")&&(u.setState({goInputText:""}),u.props.quickGo(u.getValidValue()))},u}return Object(P.a)(f,[{key:"getValidValue",value:function(){var o=this.state,c=o.goInputText,_=o.current;return!c||isNaN(c)?_:Number(c)}},{key:"getPageSizeOptions",value:function(){var o=this.props,c=o.pageSize,_=o.pageSizeOptions;return _.some(function(p){return p.toString()===c.toString()})?_:_.concat([c.toString()]).sort(function(p,d){var A=isNaN(Number(p))?0:Number(p),D=isNaN(Number(d))?0:Number(d);return A-D})}},{key:"render",value:function(){var o=this,c=this.props,_=c.pageSize,p=c.locale,d=c.rootPrefixCls,A=c.changeSize,D=c.quickGo,S=c.goButton,L=c.selectComponentClass,M=c.buildOptionText,O=c.selectPrefixCls,j=c.disabled,G=this.state.goInputText,X="".concat(d,"-options"),ee=L,he=null,ge=null,de=null;if(!A&&!D)return null;var Te=this.getPageSizeOptions();if(A&&ee){var xe=Te.map(function(ce,ae){return e.a.createElement(ee.Option,{key:ae,value:ce.toString()},(M||o.buildOptionText)(ce))});he=e.a.createElement(ee,{disabled:j,prefixCls:O,showSearch:!1,className:"".concat(X,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(_||Te[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ae){return ae.parentNode}},xe)}return D&&(S&&(de=typeof S=="boolean"?e.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:j,className:"".concat(X,"-quick-jumper-button")},p.jump_to_confirm):e.a.createElement("span",{onClick:this.go,onKeyUp:this.go},S)),ge=e.a.createElement("div",{className:"".concat(X,"-quick-jumper")},p.jump_to,e.a.createElement("input",{disabled:j,type:"text",value:G,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),p.page,de)),e.a.createElement("li",{className:"".concat(X)},he,ge)}}]),f}(e.a.Component);i.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=i,s=B("N2Kk");function n(){}function r(T){return typeof T=="number"&&isFinite(T)&&Math.floor(T)===T}function t(T,y,f){return f}function b(T,y,f){var u=typeof T=="undefined"?y.pageSize:T;return Math.floor((f.total-1)/u)+1}var v=function(T){Object(R.a)(f,T);var y=Object(K.a)(f);function f(u){var o;Object(W.a)(this,f),o=y.call(this,u),o.getJumpPrevPage=function(){return Math.max(1,o.state.current-(o.props.showLessItems?3:5))},o.getJumpNextPage=function(){return Math.min(b(void 0,o.state,o.props),o.state.current+(o.props.showLessItems?3:5))},o.getItemIcon=function(A,D){var S=o.props.prefixCls,L=A||e.a.createElement("button",{type:"button","aria-label":D,className:"".concat(S,"-item-link")});return typeof A=="function"&&(L=e.a.createElement(A,Object(I.a)({},o.props))),L},o.savePaginationNode=function(A){o.paginationNode=A},o.isValid=function(A){return r(A)&&A!==o.state.current},o.shouldDisplayQuickJumper=function(){var A=o.props,D=A.showQuickJumper,S=A.pageSize,L=A.total;return L<=S?!1:D},o.handleKeyDown=function(A){(A.keyCode===a.ARROW_UP||A.keyCode===a.ARROW_DOWN)&&A.preventDefault()},o.handleKeyUp=function(A){var D=o.getValidValue(A),S=o.state.currentInputValue;D!==S&&o.setState({currentInputValue:D}),A.keyCode===a.ENTER?o.handleChange(D):A.keyCode===a.ARROW_UP?o.handleChange(D-1):A.keyCode===a.ARROW_DOWN&&o.handleChange(D+1)},o.changePageSize=function(A){var D=o.state.current,S=b(A,o.state,o.props);D=D>S?S:D,S===0&&(D=o.state.current),typeof A=="number"&&("pageSize"in o.props||o.setState({pageSize:A}),"current"in o.props||o.setState({current:D,currentInputValue:D})),o.props.onShowSizeChange(D,A),"onChange"in o.props&&o.props.onChange&&o.props.onChange(D,A)},o.handleChange=function(A){var D=o.props.disabled,S=A;if(o.isValid(S)&&!D){var L=b(void 0,o.state,o.props);S>L?S=L:S<1&&(S=1),"current"in o.props||o.setState({current:S,currentInputValue:S});var M=o.state.pageSize;return o.props.onChange(S,M),S}return o.state.current},o.prev=function(){o.hasPrev()&&o.handleChange(o.state.current-1)},o.next=function(){o.hasNext()&&o.handleChange(o.state.current+1)},o.jumpPrev=function(){o.handleChange(o.getJumpPrevPage())},o.jumpNext=function(){o.handleChange(o.getJumpNextPage())},o.hasPrev=function(){return o.state.current>1},o.hasNext=function(){return o.state.current<b(void 0,o.state,o.props)},o.runIfEnter=function(A,D){if(A.key==="Enter"||A.charCode===13){for(var S=arguments.length,L=new Array(S>2?S-2:0),M=2;M<S;M++)L[M-2]=arguments[M];D.apply(void 0,L)}},o.runIfEnterPrev=function(A){o.runIfEnter(A,o.prev)},o.runIfEnterNext=function(A){o.runIfEnter(A,o.next)},o.runIfEnterJumpPrev=function(A){o.runIfEnter(A,o.jumpPrev)},o.runIfEnterJumpNext=function(A){o.runIfEnter(A,o.jumpNext)},o.handleGoTO=function(A){(A.keyCode===a.ENTER||A.type==="click")&&o.handleChange(o.state.currentInputValue)};var c=u.onChange!==n,_="current"in u;_&&!c&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var p=u.defaultCurrent;"current"in u&&(p=u.current);var d=u.defaultPageSize;return"pageSize"in u&&(d=u.pageSize),p=Math.min(p,b(d,void 0,u)),o.state={current:p,currentInputValue:p,pageSize:d},o}return Object(P.a)(f,[{key:"componentDidUpdate",value:function(o,c){var _=this.props.prefixCls;if(c.current!==this.state.current&&this.paginationNode){var p=this.paginationNode.querySelector(".".concat(_,"-item-").concat(c.current));p&&document.activeElement===p&&p.blur()}}},{key:"getValidValue",value:function(o){var c=o.target.value,_=b(void 0,this.state,this.props),p=this.state.currentInputValue,d;return c===""?d=c:isNaN(Number(c))?d=p:c>=_?d=_:d=Number(c),d}},{key:"getShowSizeChanger",value:function(){var o=this.props,c=o.showSizeChanger,_=o.total,p=o.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:_>p}},{key:"renderPrev",value:function(o){var c=this.props,_=c.prevIcon,p=c.itemRender,d=p(o,"prev",this.getItemIcon(_,"prev page")),A=!this.hasPrev();return Object(N.isValidElement)(d)?Object(N.cloneElement)(d,{disabled:A}):d}},{key:"renderNext",value:function(o){var c=this.props,_=c.nextIcon,p=c.itemRender,d=p(o,"next",this.getItemIcon(_,"next page")),A=!this.hasNext();return Object(N.isValidElement)(d)?Object(N.cloneElement)(d,{disabled:A}):d}},{key:"render",value:function(){var o=this,c=this.props,_=c.prefixCls,p=c.className,d=c.style,A=c.disabled,D=c.hideOnSinglePage,S=c.total,L=c.locale,M=c.showQuickJumper,O=c.showLessItems,j=c.showTitle,G=c.showTotal,X=c.simple,ee=c.itemRender,he=c.showPrevNextJumpers,ge=c.jumpPrevIcon,de=c.jumpNextIcon,Te=c.selectComponentClass,xe=c.selectPrefixCls,ce=c.pageSizeOptions,ae=this.state,Le=ae.current,Ye=ae.pageSize,Fe=ae.currentInputValue;if(D===!0&&S<=Ye)return null;var We=b(void 0,this.state,this.props),be=[],Ee=null,Ae=null,Ie=null,$=null,se=null,ue=M&&M.goButton,pe=O?1:2,Se=Le-1>0?Le-1:0,Pe=Le+1<We?Le+1:We,De=Object.keys(this.props).reduce(function(V,Y){return(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&(V[Y]=o.props[Y]),V},{});if(X)return ue&&(typeof ue=="boolean"?se=e.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},L.jump_to_confirm):se=e.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ue),se=e.a.createElement("li",{title:j?"".concat(L.jump_to).concat(Le,"/").concat(We):null,className:"".concat(_,"-simple-pager")},se)),e.a.createElement("ul",Object(Q.a)({className:E()(_,"".concat(_,"-simple"),Object(H.a)({},"".concat(_,"-disabled"),A),p),style:d,ref:this.savePaginationNode},De),e.a.createElement("li",{title:j?L.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:E()("".concat(_,"-prev"),Object(H.a)({},"".concat(_,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Se)),e.a.createElement("li",{title:j?"".concat(Le,"/").concat(We):null,className:"".concat(_,"-simple-pager")},e.a.createElement("input",{type:"text",value:Fe,disabled:A,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),e.a.createElement("span",{className:"".concat(_,"-slash")},"/"),We),e.a.createElement("li",{title:j?L.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:E()("".concat(_,"-next"),Object(H.a)({},"".concat(_,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Pe)),se);if(We<=3+pe*2){var ke={locale:L,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:j,itemRender:ee};We||be.push(e.a.createElement(h,Object(Q.a)({},ke,{key:"noPager",page:We,className:"".concat(_,"-disabled")})));for(var Be=1;Be<=We;Be+=1){var Ke=Le===Be;be.push(e.a.createElement(h,Object(Q.a)({},ke,{key:Be,page:Be,active:Ke})))}}else{var oe=O?L.prev_3:L.prev_5,me=O?L.next_3:L.next_5;he&&(Ee=e.a.createElement("li",{title:j?oe:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:E()("".concat(_,"-jump-prev"),Object(H.a)({},"".concat(_,"-jump-prev-custom-icon"),!!ge))},ee(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(ge,"prev page"))),Ae=e.a.createElement("li",{title:j?me:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:E()("".concat(_,"-jump-next"),Object(H.a)({},"".concat(_,"-jump-next-custom-icon"),!!de))},ee(this.getJumpNextPage(),"jump-next",this.getItemIcon(de,"next page")))),$=e.a.createElement(h,{locale:L,last:!0,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:We,page:We,active:!1,showTitle:j,itemRender:ee}),Ie=e.a.createElement(h,{locale:L,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:j,itemRender:ee});var _e=Math.max(1,Le-pe),we=Math.min(Le+pe,We);Le-1<=pe&&(we=1+pe*2),We-Le<=pe&&(_e=We-pe*2);for(var fe=_e;fe<=we;fe+=1){var ye=Le===fe;be.push(e.a.createElement(h,{locale:L,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:fe,page:fe,active:ye,showTitle:j,itemRender:ee}))}Le-1>=pe*2&&Le!==1+2&&(be[0]=Object(N.cloneElement)(be[0],{className:"".concat(_,"-item-after-jump-prev")}),be.unshift(Ee)),We-Le>=pe*2&&Le!==We-2&&(be[be.length-1]=Object(N.cloneElement)(be[be.length-1],{className:"".concat(_,"-item-before-jump-next")}),be.push(Ae)),_e!==1&&be.unshift(Ie),we!==We&&be.push($)}var re=null;G&&(re=e.a.createElement("li",{className:"".concat(_,"-total-text")},G(S,[S===0?0:(Le-1)*Ye+1,Le*Ye>S?S:Le*Ye])));var Z=!this.hasPrev()||!We,J=!this.hasNext()||!We;return e.a.createElement("ul",Object(Q.a)({className:E()(_,p,Object(H.a)({},"".concat(_,"-disabled"),A)),style:d,unselectable:"unselectable",ref:this.savePaginationNode},De),re,e.a.createElement("li",{title:j?L.prev_page:null,onClick:this.prev,tabIndex:Z?null:0,onKeyPress:this.runIfEnterPrev,className:E()("".concat(_,"-prev"),Object(H.a)({},"".concat(_,"-disabled"),Z)),"aria-disabled":Z},this.renderPrev(Se)),be,e.a.createElement("li",{title:j?L.next_page:null,onClick:this.next,tabIndex:J?null:0,onKeyPress:this.runIfEnterNext,className:E()("".concat(_,"-next"),Object(H.a)({},"".concat(_,"-disabled"),J)),"aria-disabled":J},this.renderNext(Pe)),e.a.createElement(l,{disabled:A,locale:L,rootPrefixCls:_,selectComponentClass:Te,selectPrefixCls:xe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Le,pageSize:Ye,pageSizeOptions:ce,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ue}))}}],[{key:"getDerivedStateFromProps",value:function(o,c){var _={};if("current"in o&&(_.current=o.current,o.current!==c.current&&(_.currentInputValue=_.current)),"pageSize"in o&&o.pageSize!==c.pageSize){var p=c.current,d=b(o.pageSize,c,o);p=p>d?d:p,"current"in o||(_.current=p,_.currentInputValue=p),_.pageSize=o.pageSize}return _}}]),f}(e.a.Component);v.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:s.a,style:{},itemRender:t,totalBoundaryShowSizeChanger:50};var m=v},"6RRn":function(Me,ne,B){"use strict";var Q=B("wCXF"),H=B("n6Qo");B.d(ne,"b",function(){return H.a});var I=B("IBYe"),W=B("6eGT"),P=B("hW8S");B.d(ne,"a",function(){return P.a}),ne.c=Q.b},"6UM0":function(Me,ne,B){var Q,H;(function(){var I;(function(){"use strict";var P=[function(e,C,E){var g=E(1).Beautifier,h=E(5).Options;function a(i,l){var s=new g(i,l);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new h}},function(e,C,E){var g=E(2).Output,h=E(3).Token,a=E(4),i=E(5).Options,l=E(7).Tokenizer,s=E(7).line_starters,n=E(7).positionable_operators,r=E(7).TOKEN;function t(O,j){return j.indexOf(O)!==-1}function b(O){return O.replace(/^\s+/g,"")}function v(O){for(var j={},G=0;G<O.length;G++)j[O[G].replace(/-/g,"_")]=O[G];return j}function m(O,j){return O&&O.type===r.RESERVED&&O.text===j}function T(O,j){return O&&O.type===r.RESERVED&&t(O.text,j)}var y=["case","return","do","if","throw","else","await","break","continue","async"],f=["before-newline","after-newline","preserve-newline"],u=v(f),o=[u.before_newline,u.preserve_newline],c={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(O,j){if(j.multiline_frame||j.mode===c.ForInitializer||j.mode===c.Conditional)return;O.remove_indent(j.start_line_index)}function p(O){O=O.replace(a.allLineBreaks,`
|
|
`);for(var j=[],G=O.indexOf(`
|
|
`);G!==-1;)j.push(O.substring(0,G)),O=O.substring(G+1),G=O.indexOf(`
|
|
`);return O.length&&j.push(O),j}function d(O){return O===c.ArrayLiteral}function A(O){return t(O,[c.Expression,c.ForInitializer,c.Conditional])}function D(O,j){for(var G=0;G<O.length;G++){var X=O[G].trim();if(X.charAt(0)!==j)return!1}return!0}function S(O,j){for(var G=0,X=O.length,ee;G<X;G++)if(ee=O[G],ee&&ee.indexOf(j)!==0)return!1;return!0}function L(O,j){j=j||{},this._source_text=O||"",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(j)}L.prototype.create_flags=function(O,j){var G=0;O&&(G=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>G&&(G=O.line_indent_level));var X={mode:j,parent:O,last_token:O?O.last_token:new h(r.START_BLOCK,""),last_word:O?O.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:G,alignment:0,line_indent_level:O?O.line_indent_level:G,start_line_index:this._output.get_line_number(),ternary_depth:0};return X},L.prototype._reset=function(O){var j=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,j),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var G=new l(O,this._options);return this._tokens=G.tokenize(),O},L.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,j=this._reset(this._source_text),G=this._options.eol;this._options.eol==="auto"&&(G=`
|
|
`,j&&a.lineBreak.test(j||"")&&(G=j.match(a.lineBreak)[0]));for(var X=this._tokens.next();X;)this.handle_token(X),this._last_last_text=this._flags.last_token.text,this._flags.last_token=X,X=this._tokens.next();return O=this._output.get_code(G),O},L.prototype.handle_token=function(O,j){O.type===r.START_EXPR?this.handle_start_expr(O):O.type===r.END_EXPR?this.handle_end_expr(O):O.type===r.START_BLOCK?this.handle_start_block(O):O.type===r.END_BLOCK?this.handle_end_block(O):O.type===r.WORD?this.handle_word(O):O.type===r.RESERVED?this.handle_word(O):O.type===r.SEMICOLON?this.handle_semicolon(O):O.type===r.STRING?this.handle_string(O):O.type===r.EQUALS?this.handle_equals(O):O.type===r.OPERATOR?this.handle_operator(O):O.type===r.COMMA?this.handle_comma(O):O.type===r.BLOCK_COMMENT?this.handle_block_comment(O,j):O.type===r.COMMENT?this.handle_comment(O,j):O.type===r.DOT?this.handle_dot(O):O.type===r.EOF?this.handle_eof(O):O.type===r.UNKNOWN?this.handle_unknown(O,j):this.handle_unknown(O,j)},L.prototype.handle_whitespace_and_comments=function(O,j){var G=O.newlines,X=this._options.keep_array_indentation&&d(this._flags.mode);if(O.comments_before)for(var ee=O.comments_before.next();ee;)this.handle_whitespace_and_comments(ee,j),this.handle_token(ee,j),ee=O.comments_before.next();if(X)for(var he=0;he<G;he+=1)this.print_newline(he>0,j);else if(this._options.max_preserve_newlines&&G>this._options.max_preserve_newlines&&(G=this._options.max_preserve_newlines),this._options.preserve_newlines&&G>1){this.print_newline(!1,j);for(var ge=1;ge<G;ge+=1)this.print_newline(!0,j)}};var M=["async","break","continue","return","throw","yield"];L.prototype.allow_wrap_or_preserved_newline=function(O,j){if(j=j===void 0?!1:j,this._output.just_added_newline())return;var G=this._options.preserve_newlines&&O.newlines||j,X=t(this._flags.last_token.text,n)||t(O.text,n);if(X){var ee=t(this._flags.last_token.text,n)&&t(this._options.operator_position,o)||t(O.text,n);G=G&&ee}if(G)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(T(this._flags.last_token,M))return;this._output.set_wrap_point()}},L.prototype.print_newline=function(O,j){if(!j&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var G=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&m(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},L.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||d(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.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))},L.prototype.print_token=function(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.previous.type===r.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var j=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(j),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},L.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.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))},L.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},L.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},L.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||T(this._flags.last_token,["get","set"]))},L.prototype.start_of_statement=function(O){var j=!1;return j=j||T(this._flags.last_token,["var","let","const"])&&O.type===r.WORD,j=j||m(this._flags.last_token,"do"),j=j||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&T(this._flags.last_token,M)&&!O.newlines,j=j||m(this._flags.last_token,"else")&&!(m(O,"if")&&!O.comments_before),j=j||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),j=j||this._flags.last_token.type===r.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==r.WORD&&O.type!==r.RESERVED,j=j||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||T(this._flags.last_token,["get","set"])),j?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,T(O,["do","for","if","while"])),!0):!1},L.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var j=c.Expression;if(O.text==="["){if(this._flags.last_token.type===r.WORD||this._flags.last_token.text===")"){T(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(j),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}j=c.ArrayLiteral,d(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,[r.START_EXPR,r.END_EXPR,r.WORD,r.OPERATOR,r.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===r.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,j=c.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,j=c.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.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===r.EQUALS||this._flags.last_token.type===r.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===r.WORD){this._output.space_before_token=!1;var G=this._tokens.peek(-3);if(this._options.space_after_named_function&&G){var X=this._tokens.peek(-4);T(G,["async","function"])||G.text==="*"&&T(X,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(G.text==="{"||G.text===","||G.text==="*"&&(X.text==="{"||X.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(O);(this._flags.last_token.type===r.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===c.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===r.START_BLOCK?this.print_newline():(this._flags.last_token.type===r.END_EXPR||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===r.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(j),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},L.prototype.handle_end_expr=function(O){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&d(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===r.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(O),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},L.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var j=this._tokens.peek(),G=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===r.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):G&&(t(G.text,[":",","])&&t(j.type,[r.STRING,r.WORD,r.RESERVED])||t(j.text,["get","set","..."])&&t(G.type,[r.WORD,r.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(G.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===r.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):t(this._flags.last_token.type,[r.EQUALS,r.START_EXPR,r.COMMA,r.OPERATOR])||T(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(T(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var X=!j.comments_before&&j.text==="}",ee=X&&this._flags.last_word==="function"&&this._flags.last_token.type===r.END_EXPR;if(this._options.brace_preserve_inline){var he=0,ge=null;this._flags.inline_frame=!0;do if(he+=1,ge=this._tokens.peek(he-1),ge.newlines){this._flags.inline_frame=!1;break}while(ge.type!==r.EOF&&!(ge.type===r.END_BLOCK&&ge.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==r.OPERATOR&&(ee||this._flags.last_token.type===r.EQUALS||T(this._flags.last_token,y)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(d(this._previous_flags.mode)&&(this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.COMMA)&&((this._flags.last_token.type===r.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==r.OPERATOR&&this._flags.last_token.type!==r.START_EXPR&&(this._flags.last_token.type===r.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!X&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},L.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===c.Statement;)this.restore_mode();var j=this._flags.last_token.type===r.START_BLOCK;this._flags.inline_frame&&!j?this._output.space_before_token=!0:this._options.brace_style==="expand"?j||this.print_newline():j||(d(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(O)},L.prototype.handle_word=function(O){if(O.type===r.RESERVED){if(t(O.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)O.type=r.WORD;else if(O.text==="import"&&t(this._tokens.peek().text,["(","."]))O.type=r.WORD;else if(t(O.text,["as","from"])&&!this._flags.import_block)O.type=r.WORD;else if(this._flags.mode===c.ObjectLiteral){var j=this._tokens.peek();j.text===":"&&(O.type=r.WORD)}}if(this.start_of_statement(O)?T(this._flags.last_token,["var","let","const"])&&O.type===r.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!A(this._flags.mode)&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==r.EQUALS&&(this._options.preserve_newlines||!T(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(m(O,"while")){this._output.space_before_token=!0,this.print_token(O),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(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&T(O,["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(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),m(O,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===r.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD?T(this._flags.last_token,["get","set","new","export"])||T(this._flags.last_token,M)?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===r.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(A(this._flags.mode)||d(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var G="NONE";if(this._flags.last_token.type===r.END_BLOCK?this._previous_flags.inline_frame?G="SPACE":T(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?G="NEWLINE":(G="SPACE",this._output.space_before_token=!0):G="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&this._flags.mode===c.BlockStatement?G="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&A(this._flags.mode)?G="SPACE":this._flags.last_token.type===r.STRING?G="NEWLINE":this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&t(this._last_last_text,["{",","]))?G="SPACE":this._flags.last_token.type===r.START_BLOCK?this._flags.inline_frame?G="SPACE":G="NEWLINE":this._flags.last_token.type===r.END_EXPR&&(this._output.space_before_token=!0,G="NEWLINE"),T(O,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?G="SPACE":G="NEWLINE"),T(O,["else","catch","finally"]))if((!(this._flags.last_token.type===r.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var X=this._output.current_line;X.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else G==="NEWLINE"?T(this._flags.last_token,y)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&T(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==r.END_EXPR?(this._flags.last_token.type!==r.START_EXPR||!T(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(m(O,"if")&&m(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):T(O,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&d(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():G==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===r.WORD||O.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===r.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&m(O,"from")&&(this._flags.import_block=!1))},L.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var j=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&m(j,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},L.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},L.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},L.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(A(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(O)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},L.prototype.handle_operator=function(O){var j=O.text==="*"&&(T(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),G=t(O.text,["-","+"])&&(t(this._flags.last_token.type,[r.START_BLOCK,r.START_EXPR,r.EQUALS,r.OPERATOR])||t(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var X=!j;this.handle_whitespace_and_comments(O,X)}if(O.text==="*"&&this._flags.last_token.type===r.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===r.OPERATOR&&t(this._options.operator_position,o)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==r.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,he=!0,ge=!1;if(O.text===":"?this._flags.ternary_depth===0?ee=!1:(this._flags.ternary_depth-=1,ge=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!G&&!j&&this._options.preserve_newlines&&t(O.text,n)){var de=O.text===":",Te=de&&ge,xe=de&&!ge;switch(this._options.operator_position){case u.before_newline:this._output.space_before_token=!xe,this.print_token(O),(!de||Te)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case u.after_newline:this._output.space_before_token=!0,!de||Te?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case u.preserve_newline:xe||this.allow_wrap_or_preserved_newline(O),ee=!(this._output.just_added_newline()||xe),this._output.space_before_token=ee,this.print_token(O),this._output.space_before_token=!0;return}}if(j){this.allow_wrap_or_preserved_newline(O),ee=!1;var ce=this._tokens.peek();he=ce&&t(ce.type,[r.WORD,r.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),ee=this._flags.last_token.type===r.START_BLOCK,he=!1;else if(t(O.text,["--","++","!","~"])||G){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),ee=!1,he=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var ae=T(this._flags.last_token,y)&&O.newlines;ae&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ae,!0)}this._flags.last_token.text===";"&&A(this._flags.mode)&&(ee=!0),this._flags.last_token.type===r.RESERVED?ee=!0:this._flags.last_token.type===r.END_EXPR?ee=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===r.OPERATOR&&(ee=t(O.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(O.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(he=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.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(O),this._output.space_before_token=he},L.prototype.handle_block_comment=function(O,j){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,j),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,j)},L.prototype.print_block_commment=function(O,j){var G=p(O.text),X,ee=!1,he=!1,ge=O.whitespace_before,de=ge.length;if(this.print_newline(!1,j),this.print_token_line_indentation(O),this._output.add_token(G[0]),this.print_newline(!1,j),G.length>1){for(G=G.slice(1),ee=D(G,"*"),he=S(G,ge),ee&&(this._flags.alignment=1),X=0;X<G.length;X++)ee?(this.print_token_line_indentation(O),this._output.add_token(b(G[X]))):he&&G[X]?(this.print_token_line_indentation(O),this._output.add_token(G[X].substring(de))):(this._output.current_line.set_indent(-1),this._output.add_token(G[X])),this.print_newline(!1,j);this._flags.alignment=0}},L.prototype.handle_comment=function(O,j){O.newlines?this.print_newline(!1,j):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,j)},L.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),T(this._flags.last_token,y)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,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(O)},L.prototype.handle_unknown=function(O,j){this.print_token(O),O.text[O.text.length-1]===`
|
|
`&&this.print_newline(!1,j)},L.prototype.handle_eof=function(O){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},e.exports.Beautifier=L},function(e){function C(h){this.__parent=h,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 h=new C(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},C.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},C.prototype.has_match=function(h){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(h))return!0;return!1},C.prototype.set_indent=function(h,a){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=a||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 h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__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(h){this.__items.push(h);var a=h.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=h.length-a:this.__character_count+=h.length},C.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},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 h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function E(h,a){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),a=a||"",h.indent_level>0&&(a=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}E.prototype.get_indent_size=function(h,a){var i=this.__base_string_length;return a=a||0,h<0&&(i=0),i+=h*this.__indent_size,i+=a,i},E.prototype.get_indent_string=function(h,a){var i=this.__base_string;return a=a||0,h<0&&(h=0,i=""),a+=h*this.__indent_size,this.__ensure_cache(a),i+=this.__cache[a],i},E.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},E.prototype.__add_column=function(){var h=this.__cache.length,a=0,i="";this.__indent_size&&h>=this.__indent_size&&(a=Math.floor(h/this.__indent_size),h-=a*this.__indent_size,i=new Array(a+1).join(this.__indent_string)),h&&(i+=new Array(h+1).join(" ")),this.__cache.push(i)};function g(h,a){this.__indent_cache=new E(h,a),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.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()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(h,a){return this.__indent_cache.get_indent_string(h,a)},g.prototype.get_indent_size=function(h,a){return this.__indent_cache.get_indent_size(h,a)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(h){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 h!==`
|
|
`&&(i=i.replace(/[\n]/g,h)),i},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(h,a){return h=h||0,a=a||0,this.next_line.set_indent(h,a),this.__lines.length>1?(this.current_line.set_indent(h,a),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(h){for(var a=0;a<h.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.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(" "))},g.prototype.remove_indent=function(h){for(var a=this.__lines.length;h<a;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(h,a){for(var i=this.__lines.length-2;i>=0;){var l=this.__lines[i];if(l.is_empty())break;if(l.item(0).indexOf(h)!==0&&l.item(-1)!==a){this.__lines.splice(i+1,0,new C(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=g},function(e){function C(E,g,h,a){this.type=E,this.text=g,this.comments_before=null,this.newlines=h||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=C},function(e,C){var E="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\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}|["+E+h+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+g+h+a+"])*";C.identifier=new RegExp(i+l,"g"),C.identifierStart=new RegExp(i),C.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+h+a+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;C.newline=/[\n\r\u2028\u2029]/,C.lineBreak=new RegExp(`\r
|
|
|`+C.newline.source),C.allLineBreaks=new RegExp(C.lineBreak.source,"g")},function(e,C,E){var g=E(6).Options,h=["before-newline","after-newline","preserve-newline"];function a(i){g.call(this,i,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="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 n=0;n<s.length;n++)s[n]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[n];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",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new g,e.exports.Options=a},function(e){function C(h,a){this.raw_options=E(h,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"])}C.prototype._get_array=function(h,a){var i=this.raw_options[h],l=a||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(l=i.concat()):typeof i=="string"&&(l=i.split(/[^a-zA-Z0-9_\/\-]+/)),l},C.prototype._get_boolean=function(h,a){var i=this.raw_options[h],l=i===void 0?!!a:!!i;return l},C.prototype._get_characters=function(h,a){var i=this.raw_options[h],l=a||"";return typeof i=="string"&&(l=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),l},C.prototype._get_number=function(h,a){var i=this.raw_options[h];a=parseInt(a,10),isNaN(a)&&(a=0);var l=parseInt(i,10);return isNaN(l)&&(l=a),l},C.prototype._get_selection=function(h,a,i){var l=this._get_selection_list(h,a,i);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[h]+"'");return l[0]},C.prototype._get_selection_list=function(h,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 l=this._get_array(h,i);if(!this._is_valid_selection(l,a))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[h]+"'");return l},C.prototype._is_valid_selection=function(h,a){return h.length&&a.length&&!h.some(function(i){return a.indexOf(i)===-1})};function E(h,a){var i={};h=g(h);var l;for(l in h)l!==a&&(i[l]=h[l]);if(a&&h[a])for(l in h[a])i[l]=h[a][l];return i}function g(h){var a={},i;for(i in h){var l=i.replace(/-/g,"_");a[l]=h[i]}return a}e.exports.Options=C,e.exports.normalizeOpts=g,e.exports.mergeOpts=E},function(e,C,E){var g=E(8).InputScanner,h=E(9).Tokenizer,a=E(9).TOKEN,i=E(13).Directives,l=E(4),s=E(12).Pattern,n=E(14).TemplatablePattern;function r(D,S){return S.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},b=new i(/\/\*/,/\*\//),v=/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]/,T=/[^\d\.]/,y=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),f=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";f=f.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),f="\\?\\.(?!\\d) "+f,f=f.replace(/ /g,"|");var u=new RegExp(f),o="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=o.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+c.join("|")+")$"),p,d=function(D,S){h.call(this,D,S),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var L=new s(this._input),M=new n(this._input).read_options(this._options);this.__patterns={template:M,identifier:M.starting_with(l.identifier).matching(l.identifierMatch),number:L.matching(v),punct:L.matching(u),comment:L.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:L.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:L.matching(/<!--/),html_comment_end:L.matching(/-->/),include:L.starting_with(/#include/).until_after(l.lineBreak),shebang:L.starting_with(/#!/).until_after(l.lineBreak),xml:L.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:M.until(/['\\\n\r\u2028\u2029]/),double_quote:M.until(/["\\\n\r\u2028\u2029]/),template_text:M.until(/[`\\$]/),template_expression:M.until(/[`}\\]/)}};d.prototype=new h,d.prototype._is_comment=function(D){return D.type===t.COMMENT||D.type===t.BLOCK_COMMENT||D.type===t.UNKNOWN},d.prototype._is_opening=function(D){return D.type===t.START_BLOCK||D.type===t.START_EXPR},d.prototype._is_closing=function(D,S){return(D.type===t.END_BLOCK||D.type===t.END_EXPR)&&S&&(D.text==="]"&&S.text==="["||D.text===")"&&S.text==="("||D.text==="}"&&S.text==="{")},d.prototype._reset=function(){p=!1},d.prototype._get_next_token=function(D,S){var L=null;this._readWhitespace();var M=this._input.peek();return M===null?this._create_token(t.EOF,""):(L=L||this._read_non_javascript(M),L=L||this._read_string(M),L=L||this._read_word(D),L=L||this._read_singles(M),L=L||this._read_comment(M),L=L||this._read_regexp(M,D),L=L||this._read_xml(M,D),L=L||this._read_punctuation(),L=L||this._create_token(t.UNKNOWN,this._input.next()),L)},d.prototype._read_word=function(D){var S;if(S=this.__patterns.identifier.read(),S!=="")return S=S.replace(l.allLineBreaks,`
|
|
`),!(D.type===t.DOT||D.type===t.RESERVED&&(D.text==="set"||D.text==="get"))&&_.test(S)?(S==="in"||S==="of")&&(D.type===t.WORD||D.type===t.STRING)?this._create_token(t.OPERATOR,S):this._create_token(t.RESERVED,S):this._create_token(t.WORD,S);if(S=this.__patterns.number.read(),S!=="")return this._create_token(t.WORD,S)},d.prototype._read_singles=function(D){var S=null;return D==="("||D==="["?S=this._create_token(t.START_EXPR,D):D===")"||D==="]"?S=this._create_token(t.END_EXPR,D):D==="{"?S=this._create_token(t.START_BLOCK,D):D==="}"?S=this._create_token(t.END_BLOCK,D):D===";"?S=this._create_token(t.SEMICOLON,D):D==="."&&T.test(this._input.peek(1))?S=this._create_token(t.DOT,D):D===","&&(S=this._create_token(t.COMMA,D)),S&&this._input.next(),S},d.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)},d.prototype._read_non_javascript=function(D){var S="";if(D==="#"){if(this._is_first_token()&&(S=this.__patterns.shebang.read(),S))return this._create_token(t.UNKNOWN,S.trim()+`
|
|
`);if(S=this.__patterns.include.read(),S)return this._create_token(t.UNKNOWN,S.trim()+`
|
|
`);D=this._input.next();var L="#";if(this._input.hasNext()&&this._input.testChar(m)){do D=this._input.next(),L+=D;while(this._input.hasNext()&&D!=="#"&&D!=="=");return D==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(L+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(L+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,L)}this._input.back()}else if(D==="<"&&this._is_first_token()){if(S=this.__patterns.html_comment_start.read(),S){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)S+=this._input.next();return p=!0,this._create_token(t.COMMENT,S)}}else if(p&&D==="-"&&(S=this.__patterns.html_comment_end.read(),S))return p=!1,this._create_token(t.COMMENT,S);return null},d.prototype._read_comment=function(D){var S=null;if(D==="/"){var L="";if(this._input.peek(1)==="*"){L=this.__patterns.block_comment.read();var M=b.get_directives(L);M&&M.ignore==="start"&&(L+=b.readIgnored(this._input)),L=L.replace(l.allLineBreaks,`
|
|
`),S=this._create_token(t.BLOCK_COMMENT,L),S.directives=M}else this._input.peek(1)==="/"&&(L=this.__patterns.comment.read(),S=this._create_token(t.COMMENT,L))}return S},d.prototype._read_string=function(D){if(D==="`"||D==="'"||D==='"'){var S=this._input.next();return this.has_char_escapes=!1,D==="`"?S+=this._read_string_recursive("`",!0,"${"):S+=this._read_string_recursive(D),this.has_char_escapes&&this._options.unescape_strings&&(S=A(S)),this._input.peek()===D&&(S+=this._input.next()),S=S.replace(l.allLineBreaks,`
|
|
`),this._create_token(t.STRING,S)}return null},d.prototype._allow_regexp_or_xml=function(D){return D.type===t.RESERVED&&r(D.text,["return","case","throw","else","do","typeof","yield"])||D.type===t.END_EXPR&&D.text===")"&&D.opened.previous.type===t.RESERVED&&r(D.opened.previous.text,["if","while","for"])||r(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])},d.prototype._read_regexp=function(D,S){if(D==="/"&&this._allow_regexp_or_xml(S)){for(var L=this._input.next(),M=!1,O=!1;this._input.hasNext()&&(M||O||this._input.peek()!==D)&&!this._input.testChar(l.newline);)L+=this._input.peek(),M?M=!1:(M=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===D&&(L+=this._input.next(),L+=this._input.read(l.identifier)),this._create_token(t.STRING,L)}return null},d.prototype._read_xml=function(D,S){if(this._options.e4x&&D==="<"&&this._allow_regexp_or_xml(S)){var L="",M=this.__patterns.xml.read_match();if(M){for(var O=M[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),j=O.indexOf("{")===0,G=0;M;){var X=!!M[1],ee=M[2],he=!!M[M.length-1]||ee.slice(0,8)==="![CDATA[";if(!he&&(ee===O||j&&ee.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(X?--G:++G),L+=M[0],G<=0)break;M=this.__patterns.xml.read_match()}return M||(L+=this._input.match(/[\s\S]*/g)[0]),L=L.replace(l.allLineBreaks,`
|
|
`),this._create_token(t.STRING,L)}}return null};function A(D){for(var S="",L=0,M=new g(D),O=null;M.hasNext();)if(O=M.match(/([\s]|[^\\]|\\\\)+/g),O&&(S+=O[0]),M.peek()==="\\"){if(M.next(),M.peek()==="x")O=M.match(/x([0-9A-Fa-f]{2})/g);else if(M.peek()==="u")O=M.match(/u([0-9A-Fa-f]{4})/g);else{S+="\\",M.hasNext()&&(S+=M.next());continue}if(!O)return D;if(L=parseInt(O[1],16),L>126&&L<=255&&O[0].indexOf("x")===0)return D;if(L>=0&&L<32){S+="\\"+O[0];continue}else L===34||L===39||L===92?S+="\\"+String.fromCharCode(L):S+=String.fromCharCode(L)}return S}d.prototype._read_string_recursive=function(D,S,L){var M,O;D==="'"?O=this.__patterns.single_quote:D==='"'?O=this.__patterns.double_quote:D==="`"?O=this.__patterns.template_text:D==="}"&&(O=this.__patterns.template_expression);for(var j=O.read(),G="";this._input.hasNext();){if(G=this._input.next(),G===D||!S&&l.newline.test(G)){this._input.back();break}else G==="\\"&&this._input.hasNext()?(M=this._input.peek(),M==="x"||M==="u"?this.has_char_escapes=!0:M==="\r"&&this._input.peek(1)===`
|
|
`&&this._input.next(),G+=this._input.next()):L&&(L==="${"&&G==="$"&&this._input.peek()==="{"&&(G+=this._input.next()),L===G&&(D==="`"?G+=this._read_string_recursive("}",S,"`"):G+=this._read_string_recursive("`",S,"${"),this._input.hasNext()&&(G+=this._input.next())));G+=O.read(),j+=G}return j},e.exports.Tokenizer=d,e.exports.TOKEN=t,e.exports.positionable_operators=y.slice(),e.exports.line_starters=o.slice()},function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function E(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},E.prototype.peek=function(g){var h=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(h=this.__input.charAt(g)),h},E.prototype.__match=function(g,h){g.lastIndex=h;var a=g.exec(this.__input);return a&&!(C&&g.sticky)&&(a.index!==h&&(a=null)),a},E.prototype.test=function(g,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(g,h):!1},E.prototype.testChar=function(g,h){var a=this.peek(h);return g.lastIndex=0,a!==null&&g.test(a)},E.prototype.match=function(g){var h=this.__match(g,this.__position);return h?this.__position+=h[0].length:h=null,h},E.prototype.read=function(g,h,a){var i="",l;return g&&(l=this.match(g),l&&(i+=l[0])),h&&(l||!g)&&(i+=this.readUntil(h,a)),i},E.prototype.readUntil=function(g,h){var a="",i=this.__position;g.lastIndex=this.__position;var l=g.exec(this.__input);return l?(i=l.index,h&&(i+=l[0].length)):i=this.__input_length,a=this.__input.substring(this.__position,i),this.__position=i,a},E.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},E.prototype.get_regexp=function(g,h){var a=null,i="g";return h&&C&&(i="y"),typeof g=="string"&&g!==""?a=new RegExp(g,i):g&&(a=new RegExp(g.source,i)),a},E.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(g){var h=this.__position,a=this.readUntilAfter(g);return this.__position=h,a},E.prototype.lookBack=function(g){var h=this.__position-1;return h>=g.length&&this.__input.substring(h-g.length,h).toLowerCase()===g},e.exports.InputScanner=E},function(e,C,E){var g=E(8).InputScanner,h=E(3).Token,a=E(10).TokenStream,i=E(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(n,r){this._input=new g(n),this._options=r||{},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 n,r=new h(l.START,""),t=null,b=[],v=new a;r.type!==l.EOF;){for(n=this._get_next_token(r,t);this._is_comment(n);)v.add(n),n=this._get_next_token(r,t);v.isEmpty()||(n.comments_before=v,v=new a),n.parent=t,this._is_opening(n)?(b.push(t),t=n):t&&this._is_closing(n,t)&&(n.opened=t,t.closed=n,t=b.pop(),n.parent=t),n.previous=r,r.next=n,this.__tokens.add(n),r=n}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(n,r){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(l.RAW,t):this._create_token(l.EOF,"")},s.prototype._is_comment=function(n){return!1},s.prototype._is_opening=function(n){return!1},s.prototype._is_closing=function(n,r){return!1},s.prototype._create_token=function(n,r){var t=new h(n,r,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=l},function(e){function C(E){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=E}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 E=null;return this.hasNext()&&(E=this.__tokens[this.__position],this.__position+=1),E},C.prototype.peek=function(E){var g=null;return E=E||0,E+=this.__position,E>=0&&E<this.__tokens_length&&(g=this.__tokens[E]),g},C.prototype.add=function(E){this.__parent_token&&(E.parent=this.__parent_token),this.__tokens.push(E),this.__tokens_length+=1},e.exports.TokenStream=C},function(e,C,E){var g=E(12).Pattern;function h(a,i){g.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=""}h.prototype=new g,h.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+"]")},h.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},h.prototype.matching=function(a,i){var l=this._create();return l.__set_whitespace_patterns(a,i),l._update(),l},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(a,i){a.lastIndex=0;for(var l=0,s=[],n=a.exec(i);n;)s.push(i.substring(l,n.index)),l=n.index+n[0].length,n=a.exec(i);return l<i.length?s.push(i.substring(l,i.length)):s.push(""),s},e.exports.WhitespacePattern=h},function(e){function C(E,g){this._input=E,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._until_after)}C.prototype.read=function(){var E=this._input.read(this._starting_pattern);return(!this._starting_pattern||E)&&(E+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),E},C.prototype.read_match=function(){return this._input.match(this._match_pattern)},C.prototype.until_after=function(E){var g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(E),g._update(),g},C.prototype.until=function(E){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(E),g._update(),g},C.prototype.starting_with=function(E){var g=this._create();return g._starting_pattern=this._input.get_regexp(E,!0),g._update(),g},C.prototype.matching=function(E){var g=this._create();return g._match_pattern=this._input.get_regexp(E,!0),g._update(),g},C.prototype._create=function(){return new C(this._input,this)},C.prototype._update=function(){},e.exports.Pattern=C},function(e){function C(E,g){E=typeof E=="string"?E:E.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+g,"g")}C.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(E);h;)g[h[1]]=h[2],h=this.__directive_pattern.exec(E);return g},C.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},function(e,C,E){var g=E(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(i,l){g.call(this,i,l),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var s=new g(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 g,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(i){var l=this._create();return l._disabled[i]=!0,l._update(),l},a.prototype.read_options=function(i){var l=this._create();for(var s in h)l._disabled[s]=i.templating.indexOf(s)===-1;return l._update(),l},a.prototype.exclude=function(i){var l=this._create();return l._excluded[i]=!0,l._update(),l},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 l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),i+=l,l=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="",l=this._input.peek();if(l==="<"){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 l==="{"&&(!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}],R={};function K(e){var C=R[e];if(C!==void 0)return C.exports;var E=R[e]={exports:{}};return P[e](E,E.exports,K),E.exports}var N=K(0);I=N})();var W=I;!(Q=[],H=function(){return{js_beautify:W}}.apply(ne,Q),H!==void 0&&(Me.exports=H))})()},"6eGT":function(Me,ne,B){"use strict";function Q(H){return null}ne.a=Q},"746U":function(Me,ne,B){"use strict";B.d(ne,"f",function(){return Q}),B.d(ne,"l",function(){return H}),B.d(ne,"k",function(){return I}),B.d(ne,"j",function(){return W}),B.d(ne,"g",function(){return P}),B.d(ne,"m",function(){return R}),B.d(ne,"h",function(){return K}),B.d(ne,"n",function(){return N}),B.d(ne,"c",function(){return e}),B.d(ne,"a",function(){return C}),B.d(ne,"i",function(){return E}),B.d(ne,"o",function(){return g}),B.d(ne,"e",function(){return i}),B.d(ne,"d",function(){return l}),B.d(ne,"p",function(){return s}),B.d(ne,"b",function(){return n});function Q(r){return Array.isArray(r)}function H(r){return typeof r=="string"}function I(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function W(r){return typeof r=="number"&&!isNaN(r)}function P(r){return r===!0||r===!1}function R(r){return typeof r=="undefined"}function K(r){return!N(r)}function N(r){return R(r)||r===null}function e(r,t){if(!r)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function C(r){if(N(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function E(r){return typeof r=="function"}function g(r,t){const b=Math.min(r.length,t.length);for(let v=0;v<b;v++)h(r[v],t[v])}function h(r,t){if(H(t)){if(typeof r!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(E(t)){try{if(r instanceof t)return}catch(b){}if(!N(r)&&r.constructor===t)return;if(t.length===1&&t.call(void 0,r)===!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(r){let t=[],b=Object.getPrototypeOf(r);for(;Object.prototype!==b;)t=t.concat(Object.getOwnPropertyNames(b)),b=Object.getPrototypeOf(b);return t}function i(r){const t=[];for(const b of a(r))typeof r[b]=="function"&&t.push(b);return t}function l(r,t){const b=m=>function(){const T=Array.prototype.slice.call(arguments,0);return t(m,T)};let v={};for(const m of r)v[m]=b(m);return v}function s(r){return r===null?void 0:r}function n(r,t="Unreachable"){throw new Error(t)}},"815F":function(Me,ne,B){"use strict";B.d(ne,"e",function(){return K}),B.d(ne,"c",function(){return e}),B.d(ne,"d",function(){return C}),B.d(ne,"a",function(){return g}),B.d(ne,"f",function(){return h}),B.d(ne,"b",function(){return a});var Q=B("KQm4"),H=B("VTBJ"),I=B("Ff2n"),W=B("Zm9Q"),P=B("Kwbf"),R=B("OZM5");function K(i,l){return i!=null?i:l}function N(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function s(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(t){var b=t.key,v=t.children;Object(P.a)(b!=null,"Tree node must have a certain key: [".concat(r).concat(b,"]"));var m=String(b);Object(P.a)(!l.has(m)||b===null||b===void 0,"Same 'key' exist in the Tree: ".concat(m)),l.set(m,!0),s(v,"".concat(r).concat(m," > "))})}s(i)}function e(i){function l(s){var n=Object(W.a)(s);return n.map(function(r){if(!Object(R.i)(r))return Object(P.a)(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var t=r.key,b=r.props,v=b.children,m=Object(I.a)(b,["children"]),T=Object(H.a)({key:t},m),y=l(v);return y.length&&(T.children=y),T}).filter(function(r){return r})}return l(i)}function C(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=new Set(l===!0?[]:l),n=[];function r(t){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.map(function(v,m){var T=Object(R.h)(b?b.pos:"0",m),y=K(v.key,T),f=Object(H.a)(Object(H.a)({},v),{},{parent:b,pos:T,children:null,data:v,isStart:[].concat(Object(Q.a)(b?b.isStart:[]),[m===0]),isEnd:[].concat(Object(Q.a)(b?b.isEnd:[]),[m===t.length-1])});return n.push(f),l===!0||s.has(y)?f.children=r(v.children||[],f):f.children=[],f})}return r(i),n}function E(i,l,s){var n;s?typeof s=="string"?n=function(b){return b[s]}:typeof s=="function"&&(n=function(b){return s(b)}):n=function(b,v){return K(b.key,v)};function r(t,b,v){var m=t?t.children:i,T=t?Object(R.h)(v.pos,b):"0";if(t){var y=n(t,T),f={node:t,index:b,pos:T,key:y,parentPos:v.node?v.pos:null,level:v.level+1};l(f)}m&&m.forEach(function(u,o){r(u,o,{node:t,pos:T,level:v?v.level+1:-1})})}r(null)}function g(i){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=l.initWrapper,n=l.processEntity,r=l.onProcessFinished,t=arguments.length>2?arguments[2]:void 0,b={},v={},m={posEntities:b,keyEntities:v};return s&&(m=s(m)||m),E(i,function(T){var y=T.node,f=T.index,u=T.pos,o=T.key,c=T.parentPos,_=T.level,p={node:y,index:f,key:o,pos:u,level:_},d=K(o,u);b[u]=p,v[d]=p,p.parent=b[c],p.parent&&(p.parent.children=p.parent.children||[],p.parent.children.push(p)),n&&n(p,m)},t),r&&r(m),m}function h(i,l){var s=l.expandedKeys,n=l.selectedKeys,r=l.loadedKeys,t=l.loadingKeys,b=l.checkedKeys,v=l.halfCheckedKeys,m=l.dragOverNodeKey,T=l.dropPosition,y=l.keyEntities,f=y[i],u={eventKey:i,expanded:s.indexOf(i)!==-1,selected:n.indexOf(i)!==-1,loaded:r.indexOf(i)!==-1,loading:t.indexOf(i)!==-1,checked:b.indexOf(i)!==-1,halfChecked:v.indexOf(i)!==-1,pos:String(f?f.pos:""),dragOver:m===i&&T===0,dragOverGapTop:m===i&&T===-1,dragOverGapBottom:m===i&&T===1};return u}function a(i){var l=i.data,s=i.expanded,n=i.selected,r=i.checked,t=i.loaded,b=i.loading,v=i.halfChecked,m=i.dragOver,T=i.dragOverGapTop,y=i.dragOverGapBottom,f=i.pos,u=i.active,o=Object(H.a)(Object(H.a)({},l),{},{expanded:s,selected:n,checked:r,loaded:t,loading:b,halfChecked:v,dragOver:m,dragOverGapTop:T,dragOverGapBottom:y,pos:f,active:u});return"props"in o||Object.defineProperty(o,"props",{get:function(){return Object(P.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),i}}),o}},"8HAY":function(Me,ne,B){"use strict";B.d(ne,"a",function(){return P}),B.d(ne,"b",function(){return R}),B.d(ne,"d",function(){return K}),B.d(ne,"e",function(){return N}),B.d(ne,"c",function(){return e});var Q=B("MI8n"),H=B("pmY6"),I=B("3/fG"),W=function(C,E,g,h){function a(i){return i instanceof g?i:new g(function(l){l(i)})}return new(g||(g=Promise))(function(i,l){function s(t){try{r(h.next(t))}catch(b){l(b)}}function n(t){try{r(h.throw(t))}catch(b){l(b)}}function r(t){t.done?i(t.value):a(t.value).then(s,n)}r((h=h.apply(C,E||[])).next())})};class P extends H.a{constructor(C,E="",g="",h=!0,a){super();this._onDidChange=this._register(new Q.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=C,this._label=E,this._cssClass=g,this._enabled=h,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(C){this._setLabel(C)}_setLabel(C){this._label!==C&&(this._label=C,this._onDidChange.fire({label:C}))}get tooltip(){return this._tooltip||""}set tooltip(C){this._setTooltip(C)}_setTooltip(C){this._tooltip!==C&&(this._tooltip=C,this._onDidChange.fire({tooltip:C}))}get class(){return this._cssClass}set class(C){this._setClass(C)}_setClass(C){this._cssClass!==C&&(this._cssClass=C,this._onDidChange.fire({class:C}))}get enabled(){return this._enabled}set enabled(C){this._setEnabled(C)}_setEnabled(C){this._enabled!==C&&(this._enabled=C,this._onDidChange.fire({enabled:C}))}get checked(){return this._checked}set checked(C){this._setChecked(C)}_setChecked(C){this._checked!==C&&(this._checked=C,this._onDidChange.fire({checked:C}))}run(C,E){return W(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(C))})}}class R extends H.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new Q.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Q.b),this.onDidRun=this._onDidRun.event}run(C,E){return W(this,void 0,void 0,function*(){if(!C.enabled)return;this._onBeforeRun.fire({action:C});let g;try{yield this.runAction(C,E)}catch(h){g=h}this._onDidRun.fire({action:C,error:g})})}runAction(C,E){return W(this,void 0,void 0,function*(){yield C.run(E)})}}class K extends P{constructor(C){super(K.ID,C,C?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class N{constructor(C,E,g,h){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=C,this.label=E,this.class=h,this._actions=g}get actions(){return this._actions}dispose(){}run(){return W(this,void 0,void 0,function*(){})}}class e extends P{constructor(){super(e.ID,I.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8hTe":function(Me,ne,B){Me.exports={button:"button___1wy9m"}},"9Bee":function(Me,ne,B){"use strict";var Q=B("DYRE"),H=B("zeV3"),I=B("+L6B"),W=B("2/Rp"),P=B("k1fw"),R=B("9og8"),K=B("tJVT"),N=B("WmNS"),e=B.n(N),C=B("q1tI"),E=B.n(C),g=B("vg9a"),h=B("DlQD"),a=B.n(h),i=B("rUJ1");function l(U,x){var w=U.match(/^(\s+)(?:```)/);if(w===null)return x;var k=w[1];return x.split(`
|
|
`).map(function(z){var F=z.match(/^\s+/);if(F===null)return z;var ie=Object(K.a)(F,1),Ce=ie[0];return Ce.length>=k.length?z.slice(k.length):z}).join(`
|
|
`)}var s=[],n=["<ul>"],r=new a.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){s.length=0,n=["<ul>"]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(U,x,w,k){if(x>=U.length||U[x].level<=w)return x;var z=U[x];k.push("<li><a href='#"+z.anchor+"'>"+z.text+"</a>"),x++;var F=[];return x=m(U,x,z.level,F),F.length>0&&(k.push("<ul>"),F.forEach(function(ie){k.push(ie)}),k.push("</ul>")),k.push("</li>"),x=m(U,x,w,k),x}function T(){return m(s,0,0,n),n.push("</ul>"),n.join("")}var y={heading:function(x){var w=t.exec(x);if(w)return{type:"heading",raw:w[0],depth:w[1].length,text:w[2]}},fences:function(x){var w=this.rules.block.fences.exec(x);if(w){var k=w[0],z=l(k,w[3]||""),F=w[2]?w[2].trim():w[2];if(["latex","katex","math"].indexOf(F)>=0){var ie=o(),Ce=z;z=ie,c[ie]={type:"block",expression:Ce}}return{type:"code",raw:k,lang:F,text:z}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,u=0,o=function(){return"__special_katext_id_".concat(u++,"__")},c={};function _(){return c}function p(){u=0,c={}}function d(U){return U=U.replace(f,function(x,w){var k=o();return c[k]={type:"inline",expression:w},k}),U}var A=r.listitem;r.listitem=function(U){return A(d(U))};var D=r.paragraph;r.paragraph=function(U){return D(d(U))};var S=r.tablecell;r.tablecell=function(U,x){return S(d(U),x)},r.code=function(U,x,w){var k=(x||"").match(/\S*/)[0];return k?["latex","katex","math"].indexOf(k)>=0?"<p class='editormd-tex'>".concat(U,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(x,'">').concat(w?U:Object(i.escape)(U,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(w?U:Object(i.escape)(U,!0))+"</code></pre>"},r.heading=function(U,x,w){var k=this.options.headerPrefix+w.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:k,level:x,text:U}),"<h"+x+' id="'+k+'">'+U+"</h"+x+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:y,renderer:r});var L=a.a,M=B("SJMd"),O=B("ulZh"),j=B.n(O),G=B("m3rI"),X=B("Oy/b"),ee=B("p5ED"),he=B("ErOA");/*! *****************************************************************************
|
|
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 ge=function(U,x){return(ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,k){w.__proto__=k}||function(w,k){for(var z in k)Object.prototype.hasOwnProperty.call(k,z)&&(w[z]=k[z])})(U,x)};function de(U,x){function w(){this.constructor=U}ge(U,x),U.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}function Te(U,x,w,k){return new(w||(w=Promise))(function(z,F){function ie($e){try{je(k.next($e))}catch(Re){F(Re)}}function Ce($e){try{je(k.throw($e))}catch(Re){F(Re)}}function je($e){var Re;$e.done?z($e.value):(Re=$e.value,Re instanceof w?Re:new w(function(Ze){Ze(Re)})).then(ie,Ce)}je((k=k.apply(U,x||[])).next())})}function xe(U,x){var w,k,z,F,ie={label:0,sent:function(){if(1&z[0])throw z[1];return z[1]},trys:[],ops:[]};return F={next:Ce(0),throw:Ce(1),return:Ce(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Ce(je){return function($e){return function(Re){if(w)throw new TypeError("Generator is already executing.");for(;ie;)try{if(w=1,k&&(z=2&Re[0]?k.return:Re[0]?k.throw||((z=k.return)&&z.call(k),0):k.next)&&!(z=z.call(k,Re[1])).done)return z;switch(k=0,z&&(Re=[2&Re[0],z.value]),Re[0]){case 0:case 1:z=Re;break;case 4:return ie.label++,{value:Re[1],done:!1};case 5:ie.label++,k=Re[1],Re=[0];continue;case 7:Re=ie.ops.pop(),ie.trys.pop();continue;default:if(!(z=ie.trys,(z=z.length>0&&z[z.length-1])||Re[0]!==6&&Re[0]!==2)){ie=0;continue}if(Re[0]===3&&(!z||Re[1]>z[0]&&Re[1]<z[3])){ie.label=Re[1];break}if(Re[0]===6&&ie.label<z[1]){ie.label=z[1],z=Re;break}if(z&&ie.label<z[2]){ie.label=z[2],ie.ops.push(Re);break}z[2]&&ie.ops.pop(),ie.trys.pop();continue}Re=x.call(U,ie)}catch(Ze){Re=[6,Ze],k=0}finally{w=z=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([je,$e])}}}function ce(){for(var U=0,x=0,w=arguments.length;x<w;x++)U+=arguments[x].length;var k=Array(U),z=0;for(x=0;x<w;x++)for(var F=arguments[x],ie=0,Ce=F.length;ie<Ce;ie++,z++)k[z]=F[ie];return k}var ae=function(){function U(){}return U.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},U.setAttributes=function(x,w){for(var k=0,z=w;k<z.length;k++){var F=z[k],ie=F[0],Ce=F[1];x.setAttribute(ie,Ce)}},U.createRect=function(x,w,k){var z=document.createElementNS("http://www.w3.org/2000/svg","rect");return z.setAttribute("width",x.toString()),z.setAttribute("height",w.toString()),k&&U.setAttributes(z,k),z},U.createLine=function(x,w,k,z,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",x.toString()),ie.setAttribute("y1",w.toString()),ie.setAttribute("x2",k.toString()),ie.setAttribute("y2",z.toString()),F&&U.setAttributes(ie,F),ie},U.createPolygon=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",x),w&&U.setAttributes(k,w),k},U.createCircle=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(x/2).toString()),k.setAttribute("cy",(x/2).toString()),k.setAttribute("r",x.toString()),w&&U.setAttributes(k,w),k},U.createEllipse=function(x,w,k){var z=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return z.setAttribute("cx",(x/2).toString()),z.setAttribute("cy",(w/2).toString()),z.setAttribute("rx",(x/2).toString()),z.setAttribute("ry",(w/2).toString()),k&&U.setAttributes(z,k),z},U.createGroup=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&U.setAttributes(w,x),w},U.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},U.createMarker=function(x,w,k,z,F,ie,Ce){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return U.setAttributes(je,[["id",x],["orient",w],["markerWidth",k.toString()],["markerHeight",z.toString()],["refX",F.toString()],["refY",ie.toString()]]),je.appendChild(Ce),je},U.createText=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","text");return w.setAttribute("x","0"),w.setAttribute("y","0"),x&&U.setAttributes(w,x),w},U.createTSpan=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=x,w&&U.setAttributes(k,w),k},U.createImage=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&U.setAttributes(w,x),w},U.createPoint=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=x,k.y=w,k},U.createPath=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",x),w&&U.setAttributes(k,w),k},U}(),Le=function(){function U(){}return U.addKey=function(x){U.key=x},Object.defineProperty(U,"isLicensed",{get:function(){return!!U.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(U.key)},enumerable:!1,configurable:!0}),U}(),Ye=function(){function U(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return U.prototype.rasterize=function(x,w,k){var z=this;return new Promise(function(F){var ie=k!==void 0?k:document.createElement("canvas");x===null&&(z.markersOnly=!0,z.naturalSize=!1);var Ce=document.createElementNS("http://www.w3.org/2000/svg","svg");Ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ce.setAttribute("width",w.width.baseVal.valueAsString),Ce.setAttribute("height",w.height.baseVal.valueAsString),Ce.setAttribute("viewBox","0 0 "+w.viewBox.baseVal.width.toString()+" "+w.viewBox.baseVal.height.toString()),Ce.innerHTML=w.innerHTML,z.naturalSize===!0?(Ce.width.baseVal.value=x.naturalWidth,Ce.height.baseVal.value=x.naturalHeight):z.width!==void 0&&z.height!==void 0&&(Ce.width.baseVal.value=z.width,Ce.height.baseVal.value=z.height),ie.width=Ce.width.baseVal.value,ie.height=Ce.height.baseVal.value;var je=Ce.outerHTML,$e=ie.getContext("2d");z.markersOnly!==!0&&$e.drawImage(x,0,0,ie.width,ie.height);var Re=window.URL,Ze=new Image(ie.width,ie.height);Ze.setAttribute("crossOrigin","anonymous");var qe=new Blob([je],{type:"image/svg+xml"}),ft=Re.createObjectURL(qe);Ze.onload=function(){$e.drawImage(Ze,0,0),Re.revokeObjectURL(ft);var Lt=ie.toDataURL(z.imageType,z.imageQuality);F(Lt)},Ze.src=ft})},U}(),Fe=function(){},We=function(){function U(x){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(U.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(U.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(U.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),U.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},U.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},U.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).appendChild(this.styleSheet),this.addRule(new be("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new be("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new be("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ee("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ee("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},U.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},U}(),be=function(U,x){this.selector=U,this.style=x},Ee=function(U,x){this.localName=U,this.style=x},Ae=function(){function U(x,w,k,z,F){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=x,this.displayMode=w,this.markerItems=k,this.uiStyleSettings=z,this.styles=F,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return U.prototype.show=function(x){var w=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var k=document.createElement("div");k.className=this.toolbarBlockStyleClass.name,k.style.whiteSpace="nowrap",this.uiContainer.appendChild(k),this.addActionButton(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(F){var ie=document.createElement("div");ie.className=""+w.toolbarButtonStyleClass.name,ie.setAttribute("data-type-name",F.typeName),ie.innerHTML=F.icon,ie.addEventListener("click",function(){w.markerToolbarButtonClicked(ie,F)}),w.buttons.push(ie),w.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 z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",z.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(z),this.addActionButton(z,'<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(z,'<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()},U.prototype.addButtonClickListener=function(x){this.buttonClickListeners.push(x)},U.prototype.removeButtonClickListener=function(x){this.buttonClickListeners.indexOf(x)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(x),1)},U.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},U.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var x=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var w=0;w<this.markerButtons.length;w++)w<x||w===x&&this.markerButtons.length-1===x?this.markerButtonBlock.appendChild(this.markerButtons[w]):(w===x&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[w]))}},U.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")},U.prototype.resetButtonStyles=function(){var x=this;this.buttons.forEach(function(w){w.className=w.className.replace(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name,"").trim(),w.className=w.className.replace(x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?x.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:x.toolbarActiveButtonStyleColorsClass.name,"").trim(),w.className+=" "+(x.uiStyleSettings.toolbarButtonStyleColorsClassName?x.uiStyleSettings.toolbarButtonStyleColorsClassName:x.toolbarButtonStyleColorsClass.name)})},U.prototype.addActionButton=function(x,w,k){var z=this,F=document.createElement("div");switch(F.className=""+this.toolbarButtonStyleClass.name,F.innerHTML=w,F.setAttribute("data-action",k),F.addEventListener("click",function(){z.actionToolbarButtonClicked(F,k)}),k){case"select":F.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":F.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":F.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":F.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":F.style.fill=this.uiStyleSettings.closeButtonColor}x.appendChild(F),this.buttons.push(F)},U.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ee("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ee("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 Ee("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var x=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ee("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
|
|
padding: `+x+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ee("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ee("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new be("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new be("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},U.prototype.markerToolbarButtonClicked=function(x,w){this.setActiveButton(x),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("marker",w)}),this.markerButtonOverflowBlock.style.display="none"},U.prototype.actionToolbarButtonClicked=function(x,w){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("action",w)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},U.prototype.setActiveButton=function(x){this.resetButtonStyles(),x.className=x.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),x.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},U.prototype.setActiveMarkerButton=function(x){var w=this.markerButtons.find(function(k){return k.getAttribute("data-type-name")===x});w&&this.setActiveButton(w)},U.prototype.setCurrentMarker=function(x){var w=this;this.currentMarker=x,this.buttons.filter(function(k){return/delete|notes/.test(k.getAttribute("data-action"))}).forEach(function(k){w.currentMarker===void 0?(k.style.fillOpacity="0.4",k.style.pointerEvents="none"):(k.style.fillOpacity="1",k.style.pointerEvents="all")})},U}(),Ie=function(){function U(x,w,k,z){this.panels=[],this.panelButtons=[],this.markerjsContainer=x,this.displayMode=w,this.uiStyleSettings=k,this.styles=z,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return U.prototype.addStyles=function(){var x;this.toolboxStyleClass=this.styles.addClass(new Ee("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 Ee("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var w=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ee("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ee("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ee("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 Ee("toolbox-panel-row_colors",`
|
|
background-color: `+((x=this.uiStyleSettings.toolboxBackgroundColor)!==null&&x!==void 0?x:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ee("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*w)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*w)+`px;
|
|
padding: `+w+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ee("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ee("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new be("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new be("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},U.prototype.show=function(x){var w;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=x,this.uiContainer.className=this.toolboxStyleClass.name+" "+((w=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&w!==void 0?w:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},U.prototype.setPanelButtons=function(x){var w,k,z=this;this.panels=x,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((w=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&w!==void 0?w:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(F){var ie;F.uiStyleSettings=z.uiStyleSettings;var Ce=document.createElement("div");Ce.className=z.toolboxButtonStyleClass.name+" "+((ie=z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ie!==void 0?ie:z.toolboxButtonStyleColorsClass.name),Ce.innerHTML=F.icon,Ce.title=F.title,Ce.addEventListener("click",function(){z.panelButtonClick(F)}),z.panelButtons.push(Ce),z.buttonRow.appendChild(Ce)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},U.prototype.panelButtonClick=function(x){var w=this,k=-1;if(x!==this.activePanel){k=this.panels.indexOf(x),this.panelRow.innerHTML="";var z=x.getUi();z.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(z),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=x}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){w.displayMode==="inline"?w.panelRow.style.display="none":w.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(F,ie){var Ce,je;F.className=w.toolboxButtonStyleClass.name+" "+(ie===k?""+((Ce=w.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ce!==void 0?Ce:w.toolboxActiveButtonStyleColorsClass.name):""+((je=w.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&je!==void 0?je:w.toolboxButtonStyleColorsClass.name))})},U}(),$=function(U,x){this.title=U,this.icon=x},se=function(U){function x(w,k,z,F){var ie=U.call(this,w,F||'<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=k,ie.currentColor=z,ie.setCurrentColor=ie.setCurrentColor.bind(ie),ie.getColorBox=ie.getColorBox.bind(ie),ie}return de(x,U),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.overflow="hidden",k.style.whiteSpace="nowrap",this.colors.forEach(function(z){var F=w.getColorBox(z);k.appendChild(F),w.colorBoxes.push(F)}),k},x.prototype.getColorBox=function(w){var k=this,z=this.uiStyleSettings.toolbarHeight/4,F=this.uiStyleSettings.toolbarHeight-z,ie=document.createElement("div");ie.style.display="inline-block",ie.style.boxSizing="content-box",ie.style.width=F-2+"px",ie.style.height=F-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=(F+2)/2+"px",ie.style.borderColor=w===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ie.addEventListener("click",function(){k.setCurrentColor(w,ie)});var Ce=document.createElement("div");return Ce.style.display="inline-block",Ce.style.width=F-2+"px",Ce.style.height=F-2+"px",Ce.style.backgroundColor=w,Ce.style.borderRadius=F/2+"px",w==="transparent"&&(Ce.style.fill=this.uiStyleSettings.toolboxAccentColor,Ce.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(Ce),ie},x.prototype.setCurrentColor=function(w,k){var z=this;this.currentColor=w,this.colorBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(w)},x}($),ue=function(){function U(x,w,k){this._state="new",this._isSelected=!1,this._container=x,this._overlayContainer=w,this.globalSettings=k,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(U.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),U.prototype.ownsTarget=function(x){return!1},Object.defineProperty(U.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),U.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},U.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},U.prototype.pointerDown=function(x,w){},U.prototype.dblClick=function(x,w){},U.prototype.manipulate=function(x){},U.prototype.pointerUp=function(x){this.stateChanged()},U.prototype.dispose=function(){},U.prototype.addMarkerVisualToContainer=function(x){this.container.childNodes.length>0?this.container.insertBefore(x,this.container.childNodes[0]):this.container.appendChild(x)},U.prototype.getState=function(){return{typeName:U.typeName,state:this.state,notes:this.notes}},U.prototype.restoreState=function(x){this._state=x.state,this.notes=x.notes},U.prototype.scale=function(x,w){},U.prototype.colorChanged=function(x){this.onColorChanged&&this.onColorChanged(x),this.stateChanged()},U.prototype.fillColorChanged=function(x){this.onFillColorChanged&&this.onFillColorChanged(x),this.stateChanged()},U.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var x=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),x.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(x)&&this.onStateChanged(this)}},U.typeName="MarkerBase",U}(),pe=function(){function U(){this.findGripByVisual=this.findGripByVisual.bind(this)}return U.prototype.findGripByVisual=function(x){return this.topLeft.ownsTarget(x)?this.topLeft:this.topCenter.ownsTarget(x)?this.topCenter:this.topRight.ownsTarget(x)?this.topRight:this.centerLeft.ownsTarget(x)?this.centerLeft:this.centerRight.ownsTarget(x)?this.centerRight:this.bottomLeft.ownsTarget(x)?this.bottomLeft:this.bottomCenter.ownsTarget(x)?this.bottomCenter:this.bottomRight.ownsTarget(x)?this.bottomRight:void 0},U}(),Se=function(){function U(){this.GRIP_SIZE=10,this.visual=ae.createGroup(),this.visual.appendChild(ae.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ae.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return U.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},U}(),Pe=function(){function U(){}return U.toITransformMatrix=function(x){return{a:x.a,b:x.b,c:x.c,d:x.d,e:x.e,f:x.f}},U.toSVGMatrix=function(x,w){return x.a=w.a,x.b=w.b,x.c=w.c,x.d=w.d,x.e=w.e,x.f=w.f,x},U}(),De=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.left=0,F.top=0,F.width=0,F.height=0,F.defaultSize={x:50,y:20},F.offsetX=0,F.offsetY=0,F.rotationAngle=0,F.CB_DISTANCE=10,F._suppressMarkerCreateEvent=!1,F.container.transform.baseVal.appendItem(ae.createTransform()),F.setupControlBox(),F}return de(x,U),Object.defineProperty(x.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"visual",{get:function(){return this._visual},set:function(w){this._visual=w;var k=ae.createTransform();this._visual.transform.baseVal.appendItem(k)},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(w){return!!U.prototype.ownsTarget.call(this,w)||!!(this.controlGrips.findGripByVisual(w)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(w))},x.prototype.pointerDown=function(w,k){U.prototype.pointerDown.call(this,w,k),this.state==="new"&&(this.left=w.x,this.top=w.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var z=this.unrotatePoint(w);if(this.manipulationStartX=z.x,this.manipulationStartY=z.y,this.offsetX=z.x-this.left,this.offsetY=z.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(k),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k)){this.activeGrip=this.rotatorGrip;var F=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=F.x-this.width/2,this.top=F.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"},x.prototype.pointerUp=function(w){var k=this.state;U.prototype.pointerUp.call(this,w),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(w),this._state="select",k==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},x.prototype.moveVisual=function(w){this.visual.style.transform="translate("+w.x+"px, "+w.y+"px)"},x.prototype.manipulate=function(w){var k=this.unrotatePoint(w);this.state==="creating"?this.resize(w):this.state==="move"?(this.left=this.manipulationStartLeft+(k.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(k.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(k):this.state==="rotate"&&this.rotate(w)},x.prototype.resize=function(w){var k=this.manipulationStartLeft,z=this.manipulationStartWidth,F=this.manipulationStartTop,ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:k=this.manipulationStartLeft+w.x-this.manipulationStartX,z=this.manipulationStartWidth+this.manipulationStartLeft-k;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:z=this.manipulationStartWidth+w.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:F=this.manipulationStartTop+w.y-this.manipulationStartY,ie=this.manipulationStartHeight+this.manipulationStartTop-F;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ie=this.manipulationStartHeight+w.y-this.manipulationStartY}z>=0?(this.left=k,this.width=z):(this.left=k+z,this.width=-z),ie>=0?(this.top=F,this.height=ie):(this.top=F+ie,this.height=-ie),this.setSize()},x.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},x.prototype.rotate=function(w){if(Math.abs(w.x-this.centerX)>.1){var k=Math.sign(w.x-this.centerX);this.rotationAngle=180*Math.atan((w.y-this.centerY)/(w.x-this.centerX))/Math.PI+90*k,this.applyRotation()}},x.prototype.applyRotation=function(){var w=this.container.transform.baseVal.getItem(0);w.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(w,0)},x.prototype.rotatePoint=function(w){if(this.rotationAngle===0)return w;var k=this.container.getCTM(),z=ae.createPoint(w.x,w.y);return{x:(z=z.matrixTransform(k)).x,y:z.y}},x.prototype.unrotatePoint=function(w){if(this.rotationAngle===0)return w;var k=this.container.getCTM();k=k.inverse();var z=ae.createPoint(w.x,w.y);return{x:(z=z.matrixTransform(k)).x,y:z.y}},x.prototype.select=function(){U.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){U.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=ae.createGroup();var w=ae.createTransform();w.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(w),this.container.appendChild(this.controlBox),this.controlRect=ae.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=ae.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 pe,this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){var w=this.controlBox.transform.baseVal.getItem(0);w.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(w,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()},x.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()},x.prototype.createGrip=function(){var w=new Se;return w.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(w.visual),w},x.prototype.positionGrips=function(){var w=this.controlGrips.topLeft.GRIP_SIZE,k=-w/2,z=k,F=(this.width+this.CB_DISTANCE)/2-w/2,ie=(this.height+this.CB_DISTANCE)/2-w/2,Ce=this.height+this.CB_DISTANCE-w/2,je=this.width+this.CB_DISTANCE-w/2;this.positionGrip(this.controlGrips.topLeft.visual,k,z),this.positionGrip(this.controlGrips.topCenter.visual,F,z),this.positionGrip(this.controlGrips.topRight.visual,je,z),this.positionGrip(this.controlGrips.centerLeft.visual,k,ie),this.positionGrip(this.controlGrips.centerRight.visual,je,ie),this.positionGrip(this.controlGrips.bottomLeft.visual,k,Ce),this.positionGrip(this.controlGrips.bottomCenter.visual,F,Ce),this.positionGrip(this.controlGrips.bottomRight.visual,je,Ce),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,F,z-3*this.CB_DISTANCE)},x.prototype.positionGrip=function(w,k,z){var F=w.transform.baseVal.getItem(0);F.setTranslate(k,z),w.transform.baseVal.replaceItem(F,0)},x.prototype.hideControlBox=function(){this.controlBox.style.display="none"},x.prototype.showControlBox=function(){this.controlBox.style.display=""},x.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Pe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Pe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},U.prototype.getState.call(this))},x.prototype.restoreState=function(w){U.prototype.restoreState.call(this,w);var k=w;this.left=k.left,this.top=k.top,this.width=k.width,this.height=k.height,this.rotationAngle=k.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Pe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,k.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Pe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,k.containerTransformMatrix))},x.prototype.scale=function(w,k){U.prototype.scale.call(this,w,k);var z=this.rotatePoint({x:this.left,y:this.top}),F=this.unrotatePoint({x:z.x*w,y:z.y*k});this.left=F.x,this.top=F.y,this.width=this.width*w,this.height=this.height*k,this.adjustControlBox()},x}(ue),ke=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.fillColor="transparent",F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.opacity=1,F.setStrokeColor=F.setStrokeColor.bind(F),F.setFillColor=F.setFillColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.createVisual=F.createVisual.bind(F),F}return de(x,U),x.prototype.ownsTarget=function(w){return!(!U.prototype.ownsTarget.call(this,w)&&w!==this.visual)},x.prototype.createVisual=function(){this.visual=ae.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)},x.prototype.pointerDown=function(w,k){U.prototype.pointerDown.call(this,w,k),this.state==="new"&&(this.createVisual(),this.moveVisual(w),this._state="creating")},x.prototype.manipulate=function(w){U.prototype.manipulate.call(this,w)},x.prototype.resize=function(w){U.prototype.resize.call(this,w),this.setSize()},x.prototype.setSize=function(){U.prototype.setSize.call(this),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(w){U.prototype.pointerUp.call(this,w),this.setSize()},x.prototype.setStrokeColor=function(w){this.strokeColor=w,this.visual&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(w),this.stateChanged()},x.prototype.setFillColor=function(w){this.fillColor=w,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},x.prototype.setStrokeWidth=function(w){this.strokeWidth=w,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(w){this.strokeDasharray=w,this.visual&&ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},U.prototype.getState.call(this))},x.prototype.restoreState=function(w){var k=w;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),U.prototype.restoreState.call(this,w),this.setSize()},x.prototype.scale=function(w,k){U.prototype.scale.call(this,w,k),this.setSize()},x.title="Rectangle marker",x}(De),Be=function(U){function x(w,k,z,F){var ie=U.call(this,w,F||'<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=k,ie.currentWidth=z,ie.setCurrentWidth=ie.setCurrentWidth.bind(ie),ie}return de(x,U),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.widths.forEach(function(z){var F=document.createElement("div");F.style.display="flex",F.style.flexGrow="2",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=z===w.currentWidth?w.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){w.setCurrentWidth(z,F)}),k.appendChild(F);var ie=document.createElement("div");ie.innerText=z.toString(),ie.style.marginRight="5px",F.appendChild(ie);var Ce=document.createElement("div");Ce.style.minHeight="20px",Ce.style.flexGrow="2",Ce.style.display="flex",Ce.style.alignItems="center";var je=document.createElement("hr");je.style.minWidth="20px",je.style.border="0px",je.style.borderTop=z+"px solid "+w.uiStyleSettings.toolboxColor,je.style.flexGrow="2",Ce.appendChild(je),F.appendChild(Ce),w.widthBoxes.push(F)}),k},x.prototype.setCurrentWidth=function(w,k){var z=this;this.currentWidth=w,this.widthBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},x}($),Ke=function(U){function x(w,k,z,F){var ie=U.call(this,w,F||'<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=k,ie.currentStyle=z,ie.setCurrentStyle=ie.setCurrentStyle.bind(ie),ie}return de(x,U),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.styles.forEach(function(z){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/w.styles.length-5+"%",F.style.borderColor=z===w.currentStyle?w.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){w.setCurrentStyle(z,F)}),k.appendChild(F);var ie=document.createElement("div");ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.overflow="hidden";var Ce=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+w.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(z!==""?'stroke-dasharray="'+z+'"':"")+` />
|
|
</svg>`;ie.innerHTML=Ce,F.appendChild(ie),w.styleBoxes.push(F)}),k},x.prototype.setCurrentStyle=function(w,k){var z=this;this.currentStyle=w,this.styleBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},x}($),oe=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.strokeColor=z.defaultColor,F.strokeWidth=z.defaultStrokeWidth,F.strokeDasharray=z.defaultStrokeDasharray,F.strokePanel=new se("Line color",z.defaultColorSet,z.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new Be("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new Ke("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return de(x,U),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=U.prototype.getState.call(this);return w.typeName=x.typeName,w},x.typeName="FrameMarker",x.title="Frame marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',x}(ke),me=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},_e=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.x1=0,F.y1=0,F.x2=0,F.y2=0,F.defaultLength=50,F.manipulationStartX=0,F.manipulationStartY=0,F.manipulationStartX1=0,F.manipulationStartY1=0,F.manipulationStartX2=0,F.manipulationStartY2=0,F.setupControlBox(),F}return de(x,U),x.prototype.ownsTarget=function(w){return!!U.prototype.ownsTarget.call(this,w)||!(!this.grip1.ownsTarget(w)&&!this.grip2.ownsTarget(w))},x.prototype.pointerDown=function(w,k){U.prototype.pointerDown.call(this,w,k),this.manipulationStartX=w.x,this.manipulationStartY=w.y,this.state==="new"&&(this.x1=w.x,this.y1=w.y,this.x2=w.x,this.y2=w.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(k)?this.activeGrip=this.grip1:this.grip2.ownsTarget(k)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},x.prototype.pointerUp=function(w){var k=this.state;U.prototype.pointerUp.call(this,w),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(w),this._state="select",k==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},x.prototype.adjustVisual=function(){},x.prototype.manipulate=function(w){this.state==="creating"?this.resize(w):this.state==="move"?(this.x1=this.manipulationStartX1+w.x-this.manipulationStartX,this.y1=this.manipulationStartY1+w.y-this.manipulationStartY,this.x2=this.manipulationStartX2+w.x-this.manipulationStartX,this.y2=this.manipulationStartY2+w.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(w)},x.prototype.resize=function(w){switch(this.activeGrip){case this.grip1:this.x1=w.x,this.y1=w.y;break;case this.grip2:case void 0:this.x2=w.x,this.y2=w.y}this.adjustVisual(),this.adjustControlBox()},x.prototype.select=function(){U.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},x.prototype.deselect=function(){U.prototype.deselect.call(this),this.controlBox.style.display="none"},x.prototype.setupControlBox=function(){this.controlBox=ae.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},x.prototype.adjustControlBox=function(){this.positionGrips()},x.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},x.prototype.createGrip=function(){var w=new Se;return w.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(w.visual),w},x.prototype.positionGrips=function(){var w=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-w/2,this.y1-w/2),this.positionGrip(this.grip2.visual,this.x2-w/2,this.y2-w/2)},x.prototype.positionGrip=function(w,k,z){var F=w.transform.baseVal.getItem(0);F.setTranslate(k,z),w.transform.baseVal.replaceItem(F,0)},x.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},U.prototype.getState.call(this))},x.prototype.restoreState=function(w){U.prototype.restoreState.call(this,w);var k=w;this.x1=k.x1,this.y1=k.y1,this.x2=k.x2,this.y2=k.y2},x.prototype.scale=function(w,k){U.prototype.scale.call(this,w,k),this.x1=this.x1*w,this.y1=this.y1*k,this.x2=this.x2*w,this.y2=this.y2*k,this.adjustVisual(),this.adjustControlBox()},x}(ue),we=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.strokeColor=z.defaultColor,F.strokeWidth=z.defaultStrokeWidth,F.strokeDasharray=z.defaultStrokeDasharray,F.strokePanel=new se("Line color",z.defaultColorSet,z.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new Be("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new Ke("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return de(x,U),x.prototype.ownsTarget=function(w){return!(!U.prototype.ownsTarget.call(this,w)&&w!==this.visual&&w!==this.selectorLine&&w!==this.visibleLine)},x.prototype.createVisual=function(){this.visual=ae.createGroup(),this.selectorLine=ae.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ae.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)},x.prototype.pointerDown=function(w,k){U.prototype.pointerDown.call(this,w,k),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},x.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()),ae.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setStrokeColor=function(w){this.strokeColor=w,this.adjustVisual(),this.colorChanged(w)},x.prototype.setStrokeWidth=function(w){this.strokeWidth=w,this.adjustVisual()},x.prototype.setStrokeDasharray=function(w){this.strokeDasharray=w,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},U.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){U.prototype.restoreState.call(this,w);var k=w;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.createVisual(),this.adjustVisual()},x.typeName="LineMarker",x.title="Line marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',x}(_e),fe=function(U){function x(w,k,z,F){var ie=U.call(this,w,F||'<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=k,ie.currentFont=z,ie.setCurrentFont=ie.setCurrentFont.bind(ie),ie}return de(x,U),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.overflow="hidden",k.style.flexGrow="2",this.fonts.forEach(function(z){var F=document.createElement("div");F.style.display="inline-block",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/w.fonts.length-5+"%",F.style.borderColor=z===w.currentFont?w.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){w.setCurrentFont(z,F)}),k.appendChild(F);var ie=document.createElement("div");ie.style.display="flex",ie.style.minHeight="20px",ie.style.flexGrow="2",ie.style.fontFamily=z,ie.style.overflow="hidden";var Ce=document.createElement("div");Ce.style.whiteSpace="nowrap",Ce.style.overflow="hidden",Ce.style.textOverflow="ellipsis",Ce.innerHTML="The quick brown fox jumps over the lazy dog",ie.appendChild(Ce),F.appendChild(ie),w.fontBoxes.push(F)}),k},x.prototype.setCurrentFont=function(w,k){var z=this;this.currentFont=w,this.fontBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},x}($),ye=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.color="transparent",F.padding=5,F.DEFAULT_TEXT="your text here",F.text=F.DEFAULT_TEXT,F.isMoved=!1,F.color=z.defaultColor,F.fontFamily=z.defaultFontFamily,F.defaultSize={x:100,y:30},F.setColor=F.setColor.bind(F),F.setFont=F.setFont.bind(F),F.renderText=F.renderText.bind(F),F.sizeText=F.sizeText.bind(F),F.textEditDivClicked=F.textEditDivClicked.bind(F),F.showTextEditor=F.showTextEditor.bind(F),F.setSize=F.setSize.bind(F),F.positionTextEditor=F.positionTextEditor.bind(F),F.colorPanel=new se("Color",z.defaultColorSet,z.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.fontFamilyPanel=new fe("Font",z.defaultFontFamilies,z.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F}return de(x,U),x.prototype.ownsTarget=function(w){if(U.prototype.ownsTarget.call(this,w)||w===this.visual||w===this.textElement||w===this.bgRectangle)return!0;var k=!1;return this.textElement.childNodes.forEach(function(z){z===w&&(k=!0)}),k},x.prototype.createVisual=function(){this.visual=ae.createGroup(),this.bgRectangle=ae.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ae.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},x.prototype.pointerDown=function(w,k){U.prototype.pointerDown.call(this,w,k),this.isMoved=!1,this.pointerDownPoint=w,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(w),this._state="creating")},x.prototype.renderText=function(){var w=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(k){w.textElement.appendChild(ae.createTSpan(k.trim()===""?" ":k.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},x.prototype.getTextScale=function(){var w=this.textElement.getBBox(),k=1;if(w.width>0&&w.height>0){var z=(1*this.width-this.width*this.padding*2/100)/w.width,F=(1*this.height-this.height*this.padding*2/100)/w.height;k=Math.min(z,F)}return k},x.prototype.getTextPosition=function(w){var k=this.textElement.getBBox(),z=0,F=0;return k.width>0&&k.height>0&&(z=(this.width-k.width*w)/2,F=this.height/2-k.height*w/2),{x:z,y:F}},x.prototype.sizeText=function(){var w=this.textElement.getBBox(),k=this.getTextScale(),z=this.getTextPosition(k);z.y-=w.y*k,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+z.x+"px, "+z.y+"px) scale("+k+", "+k+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(z.x,z.y),this.textElement.transform.baseVal.getItem(1).setScale(k,k))},x.prototype.manipulate=function(w){U.prototype.manipulate.call(this,w),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(w.x-this.pointerDownPoint.x)>5||Math.abs(w.y-this.pointerDownPoint.y)>5)},x.prototype.resize=function(w){U.prototype.resize.call(this,w),this.isMoved=!0,this.setSize(),this.sizeText()},x.prototype.setSize=function(){U.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},x.prototype.pointerUp=function(w){var k=this.state;k==="creating"&&(this._suppressMarkerCreateEvent=!0),U.prototype.pointerUp.call(this,w),this.setSize(),(k==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},x.prototype.showTextEditor=function(){var w=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(k){k.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var k=Number.parseFloat(w.textEditor.style.fontSize);w.textEditor.clientWidth>=Number.parseInt(w.textEditor.style.maxWidth)&&k>.9;)k-=.1,w.textEditor.style.fontSize=Math.max(k,.9)+"em"}),this.textEditor.addEventListener("keyup",function(k){k.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(k){if(k.clipboardData){var z=k.clipboardData.getData("text"),F=window.getSelection();if(!F.rangeCount)return!1;F.deleteFromDocument(),F.getRangeAt(0).insertNode(document.createTextNode(z)),k.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){w.textEditDivClicked(w.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},x.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var w=this.getTextScale(),k=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),z=this.textElement.getBBox(),F={x:z.width*w,y:z.height*w};k.x-=F.x/2,k.y-=F.y/2,this.textEditor.style.top=k.y+"px",this.textEditor.style.left=k.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-k.x+"px",this.textEditor.style.fontSize=Math.max(16*w,12)+"px",this.textElement.style.display="none"}},x.prototype.textEditDivClicked=function(w){this.text=w.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},x.prototype.select=function(){U.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},x.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),U.prototype.deselect.call(this)},x.prototype.dblClick=function(w,k){U.prototype.dblClick.call(this,w,k),this.showTextEditor()},x.prototype.setColor=function(w){this.textElement&&ae.setAttributes(this.textElement,[["fill",w]]),this.color=w,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(w)},x.prototype.setFont=function(w){this.textElement&&ae.setAttributes(this.textElement,[["font-family",w]]),this.fontFamily=w,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},x.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},x.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},U.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){var k=w;this.color=k.color,this.fontFamily=k.fontFamily,this.padding=k.padding,this.text=k.text,this.createVisual(),U.prototype.restoreState.call(this,w),this.setSize()},x.prototype.scale=function(w,k){U.prototype.scale.call(this,w,k),this.setSize(),this.sizeText(),this.positionTextEditor()},x.typeName="TextMarker",x.title="Text marker",x.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>',x}(De),re=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.color="transparent",F.lineWidth=3,F.drawing=!1,F.pixelRatio=1,F.color=z.defaultColor,F.lineWidth=z.defaultStrokeWidth,F.pixelRatio=z.freehandPixelRatio,F.setColor=F.setColor.bind(F),F.addCanvas=F.addCanvas.bind(F),F.finishCreation=F.finishCreation.bind(F),F.setLineWidth=F.setLineWidth.bind(F),F.colorPanel=new se("Color",z.defaultColorSet,z.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.lineWidthPanel=new Be("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.lineWidthPanel.onWidthChanged=F.setLineWidth,F}return de(x,U),x.prototype.ownsTarget=function(w){return!(!U.prototype.ownsTarget.call(this,w)&&w!==this.visual&&w!==this.drawingImage)},x.prototype.createVisual=function(){this.visual=ae.createGroup(),this.drawingImage=ae.createImage(),this.visual.appendChild(this.drawingImage);var w=ae.createTransform();this.visual.transform.baseVal.appendItem(w),this.addMarkerVisualToContainer(this.visual)},x.prototype.pointerDown=function(w,k){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(w.x,w.y),this.drawing=!0):U.prototype.pointerDown.call(this,w,k)},x.prototype.manipulate=function(w){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(w.x,w.y),this.canvasContext.stroke()):U.prototype.manipulate.call(this,w)},x.prototype.resize=function(w){U.prototype.resize.call(this,w),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},x.prototype.pointerUp=function(w){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):U.prototype.pointerUp.call(this,w)},x.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)},x.prototype.select=function(){this.state==="creating"&&this.finishCreation(),U.prototype.select.call(this)},x.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),U.prototype.deselect.call(this)},x.prototype.finishCreation=function(){for(var w=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),k=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],z=k[0],F=k[1],ie=k[2],Ce=k[3],je=!1,$e=0;$e<this.canvasElement.height;$e++)for(var Re=0;Re<this.canvasElement.width;Re++)w.data[$e*this.canvasElement.width*4+4*Re+3]>0&&(je=!0,$e<F&&(F=$e),Re<z&&(z=Re),$e>Ce&&(Ce=$e),Re>ie&&(ie=Re));if(je){this.left=z/this.pixelRatio,this.top=F/this.pixelRatio,this.width=(ie-z)/this.pixelRatio,this.height=(Ce-F)/this.pixelRatio;var Ze=document.createElement("canvas");Ze.width=ie-z,Ze.height=Ce-F,Ze.getContext("2d").putImageData(this.canvasContext.getImageData(z,F,ie-z,Ce-F),0,0),this.drawingImgUrl=Ze.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},x.prototype.setDrawingImage=function(){ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},x.prototype.setColor=function(w){this.color=w,this.colorChanged(w)},x.prototype.setLineWidth=function(w){this.lineWidth=w},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({drawingImgUrl:this.drawingImgUrl},U.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){this.createVisual(),U.prototype.restoreState.call(this,w),this.drawingImgUrl=w.drawingImgUrl,this.setDrawingImage()},x.prototype.scale=function(w,k){U.prototype.scale.call(this,w,k),this.setDrawingImage()},x.typeName="FreehandMarker",x.title="Freehand marker",x.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>',x}(De),Z=function(U){function x(w,k,z){var F=U.call(this,w,z||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return F.typeBoxes=[],F.currentType=k,F.setCurrentType=F.setCurrentType.bind(F),F}return de(x,U),x.prototype.getUi=function(){var w=this,k=document.createElement("div");k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2";for(var z=function(Ce){var je="both";switch(Ce){case 0:je="both";break;case 1:je="start";break;case 2:je="end";break;case 3:je="none"}var $e=document.createElement("div");if($e.style.display="flex",$e.style.flexGrow="2",$e.style.alignItems="center",$e.style.justifyContent="space-between",$e.style.padding="5px",$e.style.borderWidth="2px",$e.style.borderStyle="solid",$e.style.borderColor=je===F.currentType?F.uiStyleSettings.toolboxAccentColor:"transparent",$e.addEventListener("click",function(){w.setCurrentType(je,$e)}),k.appendChild($e),je==="both"||je==="start"){var Re=document.createElement("div");Re.style.display="flex",Re.style.alignItems="center",Re.style.minHeight="20px",Re.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="`+(F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Re.style.marginLeft="5px",$e.appendChild(Re)}var Ze=document.createElement("div");Ze.style.display="flex",Ze.style.alignItems="center",Ze.style.minHeight="20px",Ze.style.flexGrow="2";var qe=document.createElement("hr");if(qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop="3px solid "+(F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxColor:"#eeeeee"),qe.style.flexGrow="2",Ze.appendChild(qe),$e.appendChild(Ze),je==="both"||je==="end"){var ft=document.createElement("div");ft.style.display="flex",ft.style.alignItems="center",ft.style.minHeight="20px",ft.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="`+(F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ft.style.marginRight="5px",$e.appendChild(ft)}F.typeBoxes.push($e)},F=this,ie=0;ie<4;ie++)z(ie);return k},x.prototype.setCurrentType=function(w,k){var z=this;this.currentType=w,this.typeBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},x}($),J=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.arrowType="end",F.arrowBaseHeight=10,F.arrowBaseWidth=10,F.getArrowPoints=F.getArrowPoints.bind(F),F.setArrowType=F.setArrowType.bind(F),F.arrowTypePanel=new Z("Arrow type","end"),F.arrowTypePanel.onArrowTypeChanged=F.setArrowType,F}return de(x,U),x.prototype.ownsTarget=function(w){return!(!U.prototype.ownsTarget.call(this,w)&&w!==this.arrow1&&w!==this.arrow2)},x.prototype.getArrowPoints=function(w,k){var z=this.arrowBaseWidth+2*this.strokeWidth,F=this.arrowBaseHeight+2*this.strokeWidth;return w-z/2+","+(k+F/2)+" "+w+","+(k-F/2)+" "+(w+z/2)+","+(k+F/2)},x.prototype.createTips=function(){this.arrow1=ae.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ae.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow2)},x.prototype.pointerDown=function(w,k){U.prototype.pointerDown.call(this,w,k),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(U.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",ae.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ae.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var w=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),k=this.arrow1.transform.baseVal.getItem(0);k.setRotate(w,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(k,0);var z=this.arrow2.transform.baseVal.getItem(0);z.setRotate(w+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(z,0)}},x.prototype.setArrowType=function(w){this.arrowType=w,this.adjustVisual(),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({arrowType:this.arrowType},U.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){U.prototype.restoreState.call(this,w);var k=w;this.arrowType=k.arrowType,this.createTips(),this.adjustVisual()},x.typeName="ArrowMarker",x.title="Arrow marker",x.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',x}(we),V=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.fillColor=z.defaultFillColor,F.strokeWidth=0,F.fillPanel=new se("Color",z.defaultColorSet,z.defaultFillColor),F.fillPanel.onColorChanged=F.setFillColor,F}return de(x,U),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=U.prototype.getState.call(this);return w.typeName=x.typeName,w},x.typeName="CoverMarker",x.title="Cover marker",x.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',x}(ke),Y=function(U){function x(w,k,z,F){var ie=U.call(this,w,F||'<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=k,ie.currentOpacity=z,ie.setCurrentOpacity=ie.setCurrentOpacity.bind(ie),ie}return de(x,U),x.prototype.getUi=function(){var w=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",k.style.justifyContent="space-between",this.opacities.forEach(function(z){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="center",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=z===w.currentOpacity?w.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){w.setCurrentOpacity(z,F)}),k.appendChild(F);var ie=document.createElement("div");ie.innerText=100*z+"%",F.appendChild(ie),w.opacityBoxes.push(F)}),k},x.prototype.setCurrentOpacity=function(w,k){var z=this;this.currentOpacity=w,this.opacityBoxes.forEach(function(F){F.style.borderColor=F===k?z.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},x}($),q=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.setOpacity=F.setOpacity.bind(F),F.fillColor=z.defaultHighlightColor,F.strokeWidth=0,F.opacity=z.defaultHighlightOpacity,F.fillPanel=new se("Color",z.defaultColorSet,F.fillColor),F.fillPanel.onColorChanged=F.setFillColor,F.opacityPanel=new Y("Opacity",z.defaultOpacitySteps,F.opacity),F.opacityPanel.onOpacityChanged=F.setOpacity,F}return de(x,U),x.prototype.setOpacity=function(w){this.opacity=w,this.visual&&ae.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=U.prototype.getState.call(this);return w.typeName=x.typeName,w},x.typeName="HighlightMarker",x.title="Highlight marker",x.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>',x}(V),te='<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>',le=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.bgColor="transparent",F.tipPosition={x:0,y:0},F.tipBase1Position={x:0,y:0},F.tipBase2Position={x:0,y:0},F.tipMoving=!1,F.color=z.defaultStrokeColor,F.bgColor=z.defaultFillColor,F.fontFamily=z.defaultFontFamily,F.defaultSize={x:100,y:30},F.setBgColor=F.setBgColor.bind(F),F.getTipPoints=F.getTipPoints.bind(F),F.positionTip=F.positionTip.bind(F),F.setTipPoints=F.setTipPoints.bind(F),F.colorPanel=new se("Text color",z.defaultColorSet,F.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>'),F.colorPanel.onColorChanged=F.setColor,F.bgColorPanel=new se("Fill color",z.defaultColorSet,F.bgColor,te),F.bgColorPanel.onColorChanged=F.setBgColor,F.fontFamilyPanel=new fe("Font",z.defaultFontFamilies,z.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F.tipGrip=new Se,F.tipGrip.visual.transform.baseVal.appendItem(ae.createTransform()),F.controlBox.appendChild(F.tipGrip.visual),F}return de(x,U),x.prototype.ownsTarget=function(w){return U.prototype.ownsTarget.call(this,w)||this.tipGrip.ownsTarget(w)||this.tip===w},x.prototype.createTip=function(){ae.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ae.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},x.prototype.pointerDown=function(w,k){this.state==="new"&&U.prototype.pointerDown.call(this,w,k),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(k)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):U.prototype.pointerDown.call(this,w,k)},x.prototype.pointerUp=function(w){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,U.prototype.pointerUp.call(this,w);else{var k=this.state==="creating";U.prototype.pointerUp.call(this,w),this.setTipPoints(k),this.positionTip()}},x.prototype.manipulate=function(w){if(this.tipMoving){var k=this.unrotatePoint(w);this.tipPosition={x:k.x-this.manipulationStartLeft,y:k.y-this.manipulationStartTop},this.positionTip()}else U.prototype.manipulate.call(this,w)},x.prototype.setBgColor=function(w){this.bgRectangle&&this.tip&&(ae.setAttributes(this.bgRectangle,[["fill",w]]),ae.setAttributes(this.tip,[["fill",w]])),this.bgColor=w,this.fillColorChanged(w)},x.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},x.prototype.setTipPoints=function(w){w===void 0&&(w=!1);var k=Math.min(this.height/2,15),z=this.height/5;w&&(this.tipPosition={x:k+z/2,y:this.height+20});var F=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?F<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(z=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:0},this.tipBase2Position={x:k+z,y:0}):(this.tipBase1Position={x:0,y:k},this.tipBase2Position={x:0,y:k+z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?F<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(z=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-z,y:0},this.tipBase2Position={x:this.width-k,y:0}):(this.tipBase1Position={x:this.width,y:k},this.tipBase2Position={x:this.width,y:k+z}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?F<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(z=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-z,y:this.height},this.tipBase2Position={x:this.width-k,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-k-z},this.tipBase2Position={x:this.width,y:this.height-k}):F<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(z=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:this.height},this.tipBase2Position={x:k+z,y:this.height}):(this.tipBase1Position={x:0,y:this.height-k},this.tipBase2Position={x:0,y:this.height-k-z})},x.prototype.resize=function(w){U.prototype.resize.call(this,w),this.positionTip()},x.prototype.positionTip=function(){ae.setAttributes(this.tip,[["points",this.getTipPoints()]]);var w=this.tipGrip.visual.transform.baseVal.getItem(0);w.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(w,0)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),x.prototype.select=function(){this.positionTip(),U.prototype.select.call(this)},x.prototype.getState=function(){var w=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},U.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){var k=w;this.bgColor=k.bgColor,this.tipPosition=k.tipPosition,U.prototype.restoreState.call(this,w),this.createTip(),this.setTipPoints()},x.prototype.scale=function(w,k){U.prototype.scale.call(this,w,k),this.tipPosition={x:this.tipPosition.x*w,y:this.tipPosition.y*k},this.positionTip()},x.typeName="CalloutMarker",x.title="Callout marker",x.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>',x}(ye),ve=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.fillColor="transparent",F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.opacity=1,F.strokeColor=z.defaultColor,F.strokeWidth=z.defaultStrokeWidth,F.strokeDasharray=z.defaultStrokeDasharray,F.fillColor=z.defaultFillColor,F.setStrokeColor=F.setStrokeColor.bind(F),F.setFillColor=F.setFillColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.setOpacity=F.setOpacity.bind(F),F.createVisual=F.createVisual.bind(F),F.strokePanel=new se("Line color",ce(z.defaultColorSet,["transparent"]),z.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.fillPanel=new se("Fill color",ce(z.defaultColorSet,["transparent"]),F.fillColor,te),F.fillPanel.onColorChanged=F.setFillColor,F.strokeWidthPanel=new Be("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new Ke("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F.opacityPanel=new Y("Opacity",z.defaultOpacitySteps,F.opacity),F.opacityPanel.onOpacityChanged=F.setOpacity,F}return de(x,U),x.prototype.ownsTarget=function(w){return!(!U.prototype.ownsTarget.call(this,w)&&w!==this.visual)},x.prototype.createVisual=function(){this.visual=ae.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)},x.prototype.pointerDown=function(w,k){U.prototype.pointerDown.call(this,w,k),this.state==="new"&&(this.createVisual(),this.moveVisual(w),this._state="creating")},x.prototype.manipulate=function(w){U.prototype.manipulate.call(this,w)},x.prototype.resize=function(w){U.prototype.resize.call(this,w),this.setSize()},x.prototype.setSize=function(){U.prototype.setSize.call(this),ae.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},x.prototype.pointerUp=function(w){U.prototype.pointerUp.call(this,w),this.setSize()},x.prototype.setStrokeColor=function(w){this.strokeColor=w,this.visual&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(w),this.stateChanged()},x.prototype.setFillColor=function(w){this.fillColor=w,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(w),this.stateChanged()},x.prototype.setStrokeWidth=function(w){this.strokeWidth=w,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},x.prototype.setStrokeDasharray=function(w){this.strokeDasharray=w,this.visual&&ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},x.prototype.setOpacity=function(w){this.opacity=w,this.visual&&ae.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},U.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){var k=w;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),U.prototype.restoreState.call(this,w),this.setSize()},x.prototype.scale=function(w,k){U.prototype.scale.call(this,w,k),this.setSize()},x.typeName="EllipseMarker",x.title="Ellipse marker",x.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>',x}(De),Oe=function(U){function x(w,k,z){return U.call(this,w,k,z)||this}return de(x,U),Object.defineProperty(x.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),x.prototype.ownsTarget=function(w){return!(!U.prototype.ownsTarget.call(this,w)&&w!==this.tip1&&w!==this.tip2)},x.prototype.createTips=function(){this.tip1=ae.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(ae.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ae.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(ae.createTransform()),this.visual.appendChild(this.tip2)},x.prototype.pointerDown=function(w,k){U.prototype.pointerDown.call(this,w,k),this.state==="creating"&&this.createTips()},x.prototype.adjustVisual=function(){if(U.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ae.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()]]),ae.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 w=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),k=this.tip1.transform.baseVal.getItem(0);k.setRotate(w,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(k,0);var z=this.tip2.transform.baseVal.getItem(0);z.setRotate(w+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(z,0)}},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=U.prototype.getState.call(this);return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){U.prototype.restoreState.call(this,w),this.createTips(),this.adjustVisual()},x.typeName="MeasurementMarker",x.title="Measurement marker",x.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>',x}(we),He=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.strokePanel.colors=z.defaultColorSet,F.fillColor="transparent",F}return de(x,U),Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=U.prototype.getState.call(this);return w.typeName=x.typeName,w},x.typeName="EllipseFrameMarker",x.title="Ellipse frame marker",x.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>',x}(ve),ze=function(){function U(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(U.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),U.prototype.addUndoStep=function(x){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(x)||(this.undoStack.push(x),JSON.stringify(this.lastRedoStep)!==JSON.stringify(x)&&this.redoStack.splice(0,this.redoStack.length))},U.prototype.replaceLastUndoStep=function(x){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=x)},U.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},U.prototype.undo=function(){if(this.undoStack.length>1){var x=this.undoStack.pop();return x!==void 0&&this.redoStack.push(x),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},U.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},U}(),Ne=function(U){function x(w,k,z){var F=U.call(this,w,k,z)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.curveX=0,F.curveY=0,F.manipulationStartCurveX=0,F.manipulationStartCurveY=0,F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.positionGrips=F.positionGrips.bind(F),F.addControlGrips=F.addControlGrips.bind(F),F.adjustVisual=F.adjustVisual.bind(F),F.setupControlBox=F.setupControlBox.bind(F),F.resize=F.resize.bind(F),F.strokeColor=z.defaultColor,F.strokeWidth=z.defaultStrokeWidth,F.strokeDasharray=z.defaultStrokeDasharray,F.strokePanel=new se("Line color",z.defaultColorSet,z.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new Be("Line width",z.defaultStrokeWidths,z.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new Ke("Line style",z.defaultStrokeDasharrays,z.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return de(x,U),x.prototype.ownsTarget=function(w){return!(!U.prototype.ownsTarget.call(this,w)&&w!==this.visual&&w!==this.selectorCurve&&w!==this.visibleCurve&&!this.curveGrip.ownsTarget(w))},x.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},x.prototype.createVisual=function(){this.visual=ae.createGroup(),this.selectorCurve=ae.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ae.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)},x.prototype.pointerDown=function(w,k){U.prototype.pointerDown.call(this,w,k),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=w.x,this.curveY=w.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(k)&&(this.activeGrip=this.curveGrip,this._state="resize")},x.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ae.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},x.prototype.setupControlBox=function(){U.prototype.setupControlBox.call(this),this.curveControlLine1=ae.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ae.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)},x.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,U.prototype.addControlGrips.call(this)},x.prototype.positionGrips=function(){U.prototype.positionGrips.call(this);var w=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-w/2,this.curveY-w/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()))},x.prototype.manipulate=function(w){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+w.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+w.y-this.manipulationStartY),U.prototype.manipulate.call(this,w)},x.prototype.resize=function(w){this.activeGrip===this.curveGrip&&(this.curveX=w.x,this.curveY=w.y),U.prototype.resize.call(this,w),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},x.prototype.setStrokeColor=function(w){this.strokeColor=w,this.adjustVisual(),this.colorChanged(w)},x.prototype.setStrokeWidth=function(w){this.strokeWidth=w,this.adjustVisual()},x.prototype.setStrokeDasharray=function(w){this.strokeDasharray=w,this.adjustVisual()},x.prototype.scale=function(w,k){this.curveX=this.curveX*w,this.curveY=this.curveY*k,U.prototype.scale.call(this,w,k)},Object.defineProperty(x.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),x.prototype.getState=function(){var w=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},U.prototype.getState.call(this));return w.typeName=x.typeName,w},x.prototype.restoreState=function(w){U.prototype.restoreState.call(this,w);var k=w;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.curveX=k.curveX,this.curveY=k.curveY,this.createVisual(),this.adjustVisual()},x.typeName="CurveMarker",x.title="Curve marker",x.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>',x}(_e),Je=function(){function U(x,w){w===void 0&&(w=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=x,this.cancelable=w}return Object.defineProperty(U.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),U.prototype.preventDefault=function(){this._defaultPrevented=!0},U}(),Qe=function(U){function x(w,k,z){var F=U.call(this,w,!1)||this;return F.dataUrl=k,F.state=z,F}return de(x,U),x}(Je),Ge=function(U){function x(w,k,z){z===void 0&&(z=!1);var F=U.call(this,w,z)||this;return F.marker=k,F}return de(x,U),x}(Je),at=function(){function U(){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 U.prototype.addEventListener=function(x,w){this[x].push(w)},U.prototype.removeEventListener=function(x,w){var k=this[x].indexOf(w);k>-1&&this[x].splice(k,1)},U}(),nt=function(){function U(x){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new me,this._isOpen=!1,this.undoRedoManager=new ze,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 at,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=U.instanceCounter++,this.styles=new We(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=x,this.targetRoot=document.body,this.width=x.clientWidth,this.height=x.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(U.prototype,"ALL_MARKER_TYPES",{get:function(){return[oe,re,J,ye,He,ve,q,le,Oe,V,we,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[oe,re,J,ye,ve,q,le]},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"BASIC_MARKER_TYPES",{get:function(){return[oe,re,J,ye,q]},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(x){var w=this;this._availableMarkerTypes.splice(0),x.forEach(function(k){if(typeof k=="string"){var z=w.ALL_MARKER_TYPES.find(function(F){return F.typeName===k});z!==void 0&&w._availableMarkerTypes.push(z)}else w._availableMarkerTypes.push(k)})},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(x){this._zoomLevel=x,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(U.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),U.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Le.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},U.prototype.show=function(){var x=this;this.styles.styleSheetRoot===void 0&&Fe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Fe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(w){return w(new Je(x))})},U.prototype.render=function(){return Te(this,void 0,void 0,function(){var x;return xe(this,function(w){switch(w.label){case 0:return this.setCurrentMarker(),(x=new Ye).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.markersOnly=this.renderMarkersOnly,x.width=this.renderWidth,x.height=this.renderHeight,[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return w.sent(),[4,x.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,w.sent()]}})})},U.prototype.close=function(x){var w=this;if(x===void 0&&(x=!1),this.isOpen){var k=!1;x||this.eventListeners.beforeclose.forEach(function(z){var F=new Je(w,!0);z(F),F.defaultPrevented&&(k=!0)}),k||(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(z){return z(new Je(w))}),this.detachEvents(),this._isOpen=!1)}},U.prototype.addMarkersToToolbar=function(){for(var x,w=[],k=0;k<arguments.length;k++)w[k]=arguments[k];(x=this._availableMarkerTypes).push.apply(x,w)},U.prototype.addRenderEventListener=function(x){this.addEventListener("render",function(w){x(w.dataUrl,w.state)})},U.prototype.removeRenderEventListener=function(x){},U.prototype.addCloseEventListener=function(x){this.addEventListener("close",function(){x()})},U.prototype.removeCloseEventListener=function(x){},U.prototype.setupResizeObserver=function(){var x=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return x.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},U.prototype.onPopupTargetResize=function(){var x=1*this.target.clientWidth/this.target.clientHeight,w=this.editorCanvas.clientWidth/x>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*x:this.editorCanvas.clientWidth,k=w<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/x;this.resize(w,k)},U.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},U.prototype.resize=function(x,w){this._isResizing=!0;var k=x/this.imageWidth,z=w/this.imageHeight;this.imageWidth=Math.round(x),this.imageHeight=Math.round(w),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(k,z),this._isResizing=!1},U.prototype.scaleMarkers=function(x,w){var k,z=this;this._currentMarker&&this._currentMarker instanceof ye?this._currentMarker.scale(x,w):(k=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(F){F!==z._currentMarker&&F.scale(x,w)}),k!==void 0&&this.setCurrentMarker(k)},U.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"},U.prototype.setTopLeft=function(){var x=this.editingTarget.getBoundingClientRect(),w=this.editorCanvas.getBoundingClientRect();this.left=x.left-w.left,this.top=x.top-w.top},U.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)},U.prototype.addDefs=function(){for(var x,w=[],k=0;k<arguments.length;k++)w[k]=arguments[k];this.defs=ae.createDefs(),this.addDefsToImage(),(x=this.defs).append.apply(x,w)},U.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},U.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)},U.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},U.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},U.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)},U.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},U.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)},U.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 x=document.createElement("a");x.href="https://markerjs.com/",x.target="_blank",x.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>',x.title="Powered by marker.js",x.style.display="grid",x.style.alignItems="center",x.style.justifyItems="center",x.style.padding="3px",x.style.width="20px",x.style.height="20px",this.logoUI.appendChild(x),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},U.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")},U.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"},U.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},U.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 x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"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 Ae(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 Ie(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},U.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},U.prototype.removeMarker=function(x){this.markerImage.removeChild(x.container),this.markers.indexOf(x)>-1&&this.markers.splice(this.markers.indexOf(x),1),x.dispose()},U.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())},U.prototype.toolbarButtonClicked=function(x,w){if(x==="marker"&&w!==void 0)this.createNewMarker(w);else if(x==="action")switch(w){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()}},U.prototype.deleteSelectedMarker=function(){var x=this;if(this._currentMarker!==void 0){var w=!1;if(this.eventListeners.markerbeforedelete.forEach(function(z){var F=new Ge(x,x._currentMarker,!0);z(F),F.defaultPrevented&&(w=!0)}),!w){var k=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(z){return z(new Ge(x,k))})}}},U.prototype.clear=function(){var x=this,w=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ie){var Ce=new Ge(x,void 0,!0);ie(Ce),Ce.defaultPrevented&&(w=!0)}),!w)){this.setCurrentMarker();for(var k=function(ie){var Ce=z.markers[ie];z.setCurrentMarker(z.markers[ie]),z._currentMarker.dispose(),z.markerImage.removeChild(z._currentMarker.container),z.markers.splice(z.markers.indexOf(z._currentMarker),1),z.eventListeners.markerdelete.forEach(function(je){return je(new Ge(x,Ce))})},z=this,F=this.markers.length-1;F>=0;F--)k(F);this.addUndoStep()}},Object.defineProperty(U.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),U.prototype.showNotesEditor=function(){var x;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=(x=this._currentMarker.notes)!==null&&x!==void 0?x:"",this.overlayContainer.appendChild(this.notesArea))},U.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)},U.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},U.prototype.addUndoStep=function(){var x=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var w=this.getState(),k=this.undoRedoManager.getLastUndoStep();if(!k||k.width===w.width&&k.height===w.height){var z=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(w),z<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(F){return F(new Je(x))})}else this.undoRedoManager.replaceLastUndoStep(w),this.eventListeners.statechange.forEach(function(F){return F(new Je(x))})}},U.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},U.prototype.undoStep=function(){var x=this,w=this.undoRedoManager.undo();w!==void 0&&(this.restoreState(w),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(k){return k(new Je(x))}))},U.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},U.prototype.redoStep=function(){var x=this,w=this.undoRedoManager.redo();w!==void 0&&(this.restoreState(w),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(k){return k(new Je(x))}))},U.prototype.stepZoom=function(){var x=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=x<this.zoomSteps.length-1?this.zoomSteps[x+1]:this.zoomSteps[0]},U.prototype.panTo=function(x){this.contentDiv.scrollBy({left:this.prevPanPoint.x-x.x,top:this.prevPanPoint.y-x.y}),this.prevPanPoint=x},U.prototype.startRenderAndClose=function(){return Te(this,void 0,void 0,function(){var x,w,k=this;return xe(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return x=z.sent(),w=this.getState(),this.eventListeners.render.forEach(function(F){return F(new Qe(k,x,w))}),this.close(!0),[2]}})})},U.prototype.getState=function(x){x===!0&&this.setCurrentMarker();var w={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(k){return w.markers.push(k.getState())}),w},U.prototype.restoreState=function(x){var w=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);x.markers.forEach(function(k){var z=w._availableMarkerTypes.find(function(ie){return ie.typeName===k.typeName});if(z!==void 0){var F=w.addNewMarker(z);F.restoreState(k),w.markers.push(F)}}),x.width&&x.height&&(x.width!==this.imageWidth||x.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/x.width,this.imageHeight/x.height),this.eventListeners.restorestate.forEach(function(k){return k(new Je(w))})},U.prototype.addNewMarker=function(x){var w=ae.createGroup();return this.markerImage.appendChild(w),new x(w,this.overlayContainer,this.settings)},U.prototype.createNewMarker=function(x){var w,k=this;(w=typeof x=="string"?this._availableMarkerTypes.find(function(z){return z.typeName===x}):x)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(w),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(w.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(z){return z(new Ge(k,k._currentMarker))}))},U.prototype.markerCreated=function(x){var w=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(x),this.setCurrentMarker(x),x instanceof re&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(re):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(k){return k(new Ge(w,w._currentMarker))})},U.prototype.colorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=x,this.settings.defaultStrokeColor=x)},U.prototype.fillColorChanged=function(x){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=x)},U.prototype.markerStateChanged=function(x){var w=this;this.eventListeners.markerchange.forEach(function(k){return k(new Ge(w,x))})},U.prototype.setCurrentMarker=function(x){var w=this;this._currentMarker!==x&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(k){return k(new Ge(w,w._currentMarker))})),this._currentMarker=x,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(k){return k(new Ge(w,w._currentMarker))}))},U.prototype.onPointerDown=function(x){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||x.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var w=this.markers.find(function(k){return k.ownsTarget(x.target)});w!==void 0?(this.setCurrentMarker(w),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:x.clientX,y:x.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(x.clientX,x.clientY))},U.prototype.onDblClick=function(x){if(this._isFocused||this.focus(),this.mode==="select"){var w=this.markers.find(function(k){return k.ownsTarget(x.target)});w!==void 0&&w!==this._currentMarker&&this.setCurrentMarker(w),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(x.clientX,x.clientY),x.target):this.setCurrentMarker()}},U.prototype.onPointerMove=function(x){this.touchPoints!==1&&x.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||x.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(x.clientX,x.clientY)):this.zoomLevel>1&&this.panTo({x:x.clientX,y:x.clientY}))},U.prototype.onPointerUp=function(x){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(x.clientX,x.clientY)),this.isDragging=!1,this.addUndoStep()},U.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},U.prototype.onKeyUp=function(x){this._currentMarker===void 0||this.notesArea!==void 0||x.key!=="Delete"&&x.key!=="Backspace"||this.deleteSelectedMarker()},U.prototype.clientToLocalCoordinates=function(x,w){var k=this.markerImage.getBoundingClientRect();return{x:(x-k.left)/this.zoomLevel,y:(w-k.top)/this.zoomLevel}},U.prototype.onWindowResize=function(){this.positionUI()},U.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var x=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=x+"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()},U.prototype.addLicenseKey=function(x){Le.addKey(x)},U.prototype.addEventListener=function(x,w){this.eventListeners.addEventListener(x,w)},U.prototype.removeEventListener=function(x,w){this.eventListeners.removeEventListener(x,w)},U.prototype.renderState=function(x){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(x),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(U.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),U.prototype.focus=function(){var x=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(w){return w(new Je(x))}))},U.prototype.blur=function(){var x=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(w){return w(new Je(x))}))},U.instanceCounter=0,U}();/* **********************************
|
|
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 rt=function(U,x){return(rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,k){w.__proto__=k}||function(w,k){for(var z in k)Object.prototype.hasOwnProperty.call(k,z)&&(w[z]=k[z])})(U,x)};function dt(U,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");function w(){this.constructor=U}rt(U,x),U.prototype=x===null?Object.create(x):(w.prototype=x.prototype,new w)}function et(U,x,w,k){return new(w||(w=Promise))(function(z,F){function ie($e){try{je(k.next($e))}catch(Re){F(Re)}}function Ce($e){try{je(k.throw($e))}catch(Re){F(Re)}}function je($e){var Re;$e.done?z($e.value):(Re=$e.value,Re instanceof w?Re:new w(function(Ze){Ze(Re)})).then(ie,Ce)}je((k=k.apply(U,x||[])).next())})}function st(U,x){var w,k,z,F,ie={label:0,sent:function(){if(1&z[0])throw z[1];return z[1]},trys:[],ops:[]};return F={next:Ce(0),throw:Ce(1),return:Ce(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Ce(je){return function($e){return function(Re){if(w)throw new TypeError("Generator is already executing.");for(;ie;)try{if(w=1,k&&(z=2&Re[0]?k.return:Re[0]?k.throw||((z=k.return)&&z.call(k),0):k.next)&&!(z=z.call(k,Re[1])).done)return z;switch(k=0,z&&(Re=[2&Re[0],z.value]),Re[0]){case 0:case 1:z=Re;break;case 4:return ie.label++,{value:Re[1],done:!1};case 5:ie.label++,k=Re[1],Re=[0];continue;case 7:Re=ie.ops.pop(),ie.trys.pop();continue;default:if(!(z=ie.trys,(z=z.length>0&&z[z.length-1])||Re[0]!==6&&Re[0]!==2)){ie=0;continue}if(Re[0]===3&&(!z||Re[1]>z[0]&&Re[1]<z[3])){ie.label=Re[1];break}if(Re[0]===6&&ie.label<z[1]){ie.label=z[1],z=Re;break}if(z&&ie.label<z[2]){ie.label=z[2],ie.ops.push(Re);break}z[2]&&ie.ops.pop(),ie.trys.pop();continue}Re=x.call(U,ie)}catch(Ze){Re=[6,Ze],k=0}finally{w=z=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([je,$e])}}}var ut=function(){function U(){}return U.addKey=function(x){U.key=x},Object.defineProperty(U,"isLicensed",{get:function(){return!!U.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(U.key)},enumerable:!1,configurable:!0}),U}(),Ue=function(){function U(){}return U.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},U.setAttributes=function(x,w){for(var k=0,z=w;k<z.length;k++){var F=z[k],ie=F[0],Ce=F[1];x.setAttribute(ie,Ce)}},U.createRect=function(x,w,k){var z=document.createElementNS("http://www.w3.org/2000/svg","rect");return z.setAttribute("width",x.toString()),z.setAttribute("height",w.toString()),k&&U.setAttributes(z,k),z},U.createLine=function(x,w,k,z,F){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",x.toString()),ie.setAttribute("y1",w.toString()),ie.setAttribute("x2",k.toString()),ie.setAttribute("y2",z.toString()),F&&U.setAttributes(ie,F),ie},U.createPolygon=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",x),w&&U.setAttributes(k,w),k},U.createCircle=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(x/2).toString()),k.setAttribute("cy",(x/2).toString()),k.setAttribute("r",x.toString()),w&&U.setAttributes(k,w),k},U.createEllipse=function(x,w,k){var z=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return z.setAttribute("cx",(x/2).toString()),z.setAttribute("cy",(w/2).toString()),z.setAttribute("rx",(x/2).toString()),z.setAttribute("ry",(w/2).toString()),k&&U.setAttributes(z,k),z},U.createGroup=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","g");return x&&U.setAttributes(w,x),w},U.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},U.createMarker=function(x,w,k,z,F,ie,Ce){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return U.setAttributes(je,[["id",x],["orient",w],["markerWidth",k.toString()],["markerHeight",z.toString()],["refX",F.toString()],["refY",ie.toString()]]),je.appendChild(Ce),je},U.createText=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","text");return w.setAttribute("x","0"),w.setAttribute("y","0"),x&&U.setAttributes(w,x),w},U.createTSpan=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=x,w&&U.setAttributes(k,w),k},U.createImage=function(x){var w=document.createElementNS("http://www.w3.org/2000/svg","image");return x&&U.setAttributes(w,x),w},U.createPoint=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=x,k.y=w,k},U.createPath=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",x),w&&U.setAttributes(k,w),k},U.createElement=function(x,w){var k=document.createElementNS("http://www.w3.org/2000/svg",x);return w&&U.setAttributes(k,w),k},U.getHollowRectanglePath=function(x,w,k,z,F,ie,Ce,je){return"M"+x+","+w+"V"+(w+z)+"H"+(x+k)+"V"+w+"H"+F+"V"+ie+"H"+(F+Ce)+"V"+(ie+je)+"H"+F+"V"+w+"Z"},U}(),pt=function(){function U(x){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+x+"_"}return Object.defineProperty(U.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(U.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(U.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),U.prototype.addClass=function(x){return this.styleSheet===void 0&&this.addStyleSheet(),x.name=""+this.classNamePrefix+x.localName,this.classes.push(x),this.styleSheet.sheet.insertRule("."+x.name+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length),x},U.prototype.addRule=function(x){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(x),this.styleSheet.sheet.insertRule(x.selector+" {"+x.style+"}",this.styleSheet.sheet.cssRules.length)},U.prototype.addStyleSheet=function(){var x;this.styleSheet=document.createElement("style"),((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).appendChild(this.styleSheet),this.addRule(new Xe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Xe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Xe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ve("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ve("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},U.prototype.removeStyleSheet=function(){var x;this.styleSheet&&(((x=this.styleSheetRoot)!==null&&x!==void 0?x:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},U}(),Xe=function(U,x){this.selector=U,this.style=x},Ve=function(U,x){this.localName=U,this.style=x},tt=function(){function U(){this.blocks=[],this.display=""}return U.prototype.addButtonBlock=function(x){x.className=this.blockClassName,x.buttonClassName=this.buttonClassName,x.buttonColorsClassName=this.buttonColorsClassName,x.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(x)},U.prototype.addElementBlock=function(x){x.className===void 0&&(x.className=this.blockClassName),this.blocks.push(x)},U.prototype.getUI=function(){var x=document.createElement("div");return x.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,x.style.display=this.display,this.blocks.forEach(function(w){return x.appendChild(w.getUI())}),x},U}(),vt=function(){function U(){}return U.prototype.getUI=function(){var x=document.createElement("div");if(x.className=this.className,this.minWidth!==void 0&&(x.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":x.style.justifyContent="flex-start";break;case"center":x.style.justifyContent="center";break;case"end":x.style.justifyContent="flex-end"}return x.style.whiteSpace="nowrap",x},U}(),Et=function(U){function x(){var w=U!==null&&U.apply(this,arguments)||this;return w.buttons=[],w}return dt(x,U),x.prototype.addButton=function(w){w.className=this.buttonClassName,w.colorsClassName=this.buttonColorsClassName,w.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(w)},x.prototype.getUI=function(){var w=U.prototype.getUI.call(this);return this.buttons.forEach(function(k){return w.appendChild(k.getUI())}),w},x}(vt),bt=function(){function U(x,w){this._isActive=!1,this._isHidden=!1,this._icon=x,this.title=w,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(U.prototype,"icon",{get:function(){return this._icon},set:function(x){this._icon=x,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isActive",{get:function(){return this._isActive},set:function(x){this._isActive=x,this.adjustClassName()},enumerable:!1,configurable:!0}),U.prototype.getUI=function(){var x=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 x.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},U.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,"")))},U.prototype.hide=function(){this._isHidden=!0},U}(),Ot=function(U){function x(){var w=U!==null&&U.apply(this,arguments)||this;return w.elements=[],w}return dt(x,U),x.prototype.addElement=function(w){this.elements.push(w)},x.prototype.getUI=function(){var w=U.prototype.getUI.call(this);return this.elements.forEach(function(k){return w.appendChild(k)}),w},x}(vt),Rt=function(){function U(x,w){this.horizontal=x,this.vertical=w}return Object.defineProperty(U.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),U.prototype.getVerticalLength=function(x){return x/this.ratio},U.prototype.getHorizontalLength=function(x){return x*this.ratio},U}(),ct=function(){function U(){}return U.getIcon=function(x,w){if(x>0&&w>0){var k=new Rt(x,w),z=k.ratio>=1?20:k.getHorizontalLength(20),F=k.ratio<1?20:k.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var Ce=Ue.createDefs();ie.appendChild(Ce);var je=Ue.createElement("clipPath",[["id","text-bg-clip"]]);Ce.appendChild(je);var $e=Ue.createPath(Ue.getHollowRectanglePath((24-z)/2,(24-F)/2,z,F,(24-z)/2+2,(24-F)/2+2,z-4,F-4));ie.appendChild($e);var Re=Ue.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Re.appendChild(Ue.createTSpan(x+":"+w)),ie.appendChild(Re);var Ze=Re.getBBox();Ue.setAttributes(Re,[["x",((24-Ze.width)/2).toString()],["y",((24-Ze.height)/2-Ze.y).toString()]]);var qe=Ue.createPath(Ue.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ze.width))/2,(24-Math.ceil(Ze.height))/2,Math.ceil(Ze.width),Math.ceil(Ze.height)));return je.appendChild(qe),Ue.setAttributes($e,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.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>'},U}(),Tt=function(U){function x(w,k,z){var F=U.call(this,w,k)||this;return F.isDropdownOpen=!1,F.onClick=F.dropdownButtonClicked,F.dropdownButtons=z,F}return dt(x,U),x.prototype.setupDropdown=function(){var w=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(k){k.className=w.className,k.colorsClassName=w.colorsClassName,w.dropdownBlock.appendChild(k.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},x.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},x.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},x.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},x.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},x.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},x}(bt),At=function(){function U(x,w){this.GRIP_SIZE=10,this.color=x,this.fillColor=w,this.visual=Ue.createGroup(),this.visual.appendChild(Ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ue.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return U.prototype.ownsTarget=function(x){return x===this.visual||x===this.visual.childNodes[0]||x===this.visual.childNodes[1]},U.prototype.setCenter=function(x,w){this.visual.childNodes.forEach(function(k){return Ue.setAttributes(k,[["cx",x.toString()],["cy",w.toString()]])})},U}(),_t=function(){function U(x,w,k,z){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=x,this.canvasHeight=w,this.margin=k,this.container=z,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(U.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(x){this._aspectRatio=x,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.gridContainer&&Ue.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(x){this._zoomFactor=x,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),U.prototype.open=function(){var x=this;this.cropShadeElement=Ue.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ue.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var w=0;w<this.numberOfGridLines;w++)this.horizontalGridLines.push(Ue.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ue.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(k){return x.gridContainer.appendChild(k)}),this.verticalGridLines.forEach(function(k){return x.gridContainer.appendChild(k)}),this.cropRectElement=Ue.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},U.prototype.setCropRectangle=function(x){this.cropRect=x;var w=Object.assign({},this.cropRect);this.zoomFactor!==1&&(w.width=this.cropRect.width*this.zoomFactor,w.height=this.cropRect.height*this.zoomFactor,w.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-w.width/2,w.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-w.height/2),Ue.setAttributes(this.cropRectElement,[["x",w.x.toString()],["y",w.y.toString()],["width",w.width.toString()],["height",w.height.toString()]]);var k=w.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(F,ie){var Ce=w.y+k*(ie+1);Ue.setAttributes(F,[["x1",""+w.x],["y1",""+Ce],["x2",""+(w.x+w.width)],["y2",""+Ce]])});var z=w.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(F,ie){var Ce=w.x+z*(ie+1);Ue.setAttributes(F,[["x1",""+Ce],["y1",""+w.y],["x2",""+Ce],["y2",""+(w.y+w.height)]])}),Ue.setAttributes(this.cropShadeElement,[["d",Ue.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,w.x,w.y,w.width,w.height)]]),this.topLeftGrip.setCenter(w.x,w.y),this.topRightGrip.setCenter(w.x+w.width,w.y),this.bottomLeftGrip.setCenter(w.x,w.y+w.height),this.bottomRightGrip.setCenter(w.x+w.width,w.y+w.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},U.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)},U.prototype.clientToLocalCoordinates=function(x,w){var k=this.container.getBoundingClientRect();return{x:x-k.left+this.margin,y:w-k.top+this.margin}},U.prototype.onPointerDown=function(x){this.container.setPointerCapture(x.pointerId),this.previousPoint=this.clientToLocalCoordinates(x.clientX,x.clientY),this.cropRectElement===x.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(x.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(x.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(x.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(x.target)&&(this.activeGrip=this.bottomRightGrip)},U.prototype.onPointerMove=function(x){if(this.isMoving)this.move(this.clientToLocalCoordinates(x.clientX,x.clientY));else if(this.activeGrip){var w=this.clientToLocalCoordinates(x.clientX,x.clientY);this.resize(w)}x.preventDefault()},U.prototype.onPointerUp=function(x){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(x.pointerId)},U.prototype.move=function(x){var w=x.x-this.previousPoint.x,k=x.y-this.previousPoint.y;this.zoomFactor!==1&&(w=-w/this.zoomFactor,k=-k/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+w),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+k),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=x},U.prototype.resize=function(x){var w=Object.assign({},this.cropRect),k=x.x-this.previousPoint.x,z=x.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:w.x+k<this.margin&&(k=this.margin-w.x),w.x+=k,w.width=this.cropRect.x+this.cropRect.width-w.x;break;case this.bottomRightGrip:case this.topRightGrip:w.width+k>this.canvasWidth*this.zoomFactor&&(k=this.canvasWidth*this.zoomFactor-w.width),w.width+=k}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(w.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(k),w.height=this.aspectRatio.getVerticalLength(w.width)):(w.y+=z,w.height=this.cropRect.y+this.cropRect.height-w.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?w.height=this.aspectRatio.getVerticalLength(w.width):w.height+=z}w.width<10&&(w.x=this.cropRect.x,w.width=10),w.height<10&&(w.y=this.cropRect.y,w.height=10),this.previousPoint=x,w.x>=this.margin&&w.y>=this.margin&&w.x-this.margin+w.width<=this.canvasWidth&&w.y-this.margin+w.height<=this.canvasHeight&&(this.cropRect=w,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},U.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var x=this.cropRect.x+this.cropRect.width/2,w=this.cropRect.y+this.cropRect.height/2,k=this.aspectRatio.getHorizontalLength(this.cropRect.height),z=this.aspectRatio.getVerticalLength(this.cropRect.width);k/this.canvasWidth<z/this.canvasHeight?this.cropRect.width=k:this.cropRect.height=z,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=x-this.cropRect.width/2,this.cropRect.y=w-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)}},U.prototype.getRescaledRect=function(x,w,k,z,F,ie){var Ce=k/x,je=z/w;return{x:(F.x-ie)*Ce+ie,y:(F.y-ie)*je+ie,width:F.width*Ce,height:F.height*je}},U.prototype.scaleCanvas=function(x,w){var k=this.getRescaledRect(this.canvasWidth,this.canvasHeight,x,w,this.cropRect,this.margin);this.canvasWidth=x,this.canvasHeight=w,this.onCropChange&&this.onCropChange(k),this.setCropRectangle(k)},U}(),Pt=function(){function U(x){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=x,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(U.prototype,"angle",{get:function(){return this._angle},set:function(x){this._angle=x,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),U.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},U.prototype.onPointerDown=function(x){this.controlContainer.setPointerCapture(x.pointerId),this.isDragging=!0,this.previousPoint={x:x.clientX,y:x.clientY}},U.prototype.onPointerMove=function(x){this.isDragging&&(this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.previousPoint.x=x.clientX)},U.prototype.onPointerUp=function(x){this.isDragging&&this.onAngleChange&&this.onAngleChange((x.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(x.pointerId)},U.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var x=this.angleLabelText.getBBox();Ue.setAttributes(this.angleLabelElement,[["x",((this.width-x.width)/2).toString()],["y",(this.height/2).toString()]])}},U.prototype.positionScaleShape=function(){if(this.scaleShape){var x=this.scaleShape.transform.baseVal.getItem(0);x.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(x,0)}},U.prototype.getVisual=function(){var x=document.createElementNS("http://www.w3.org/2000/svg","svg");x.setAttribute("xmlns","http://www.w3.org/2000/svg"),x.setAttribute("width",this.width+"px"),x.setAttribute("height",this.height+"px"),x.setAttribute("viewBox","0 0 "+this.width+" "+this.height),x.style.flexShrink="0",document.body.appendChild(x);for(var w="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,k=1;k<=this.width/5+10;k++){var z=k%5==0?this.height/3:this.height/6;w+="h4v"+-z+"h1v"+z}w+="v1H0Z",this.scaleShape=Ue.createPath(w);var F=Ue.createTransform();this.scaleShape.transform.baseVal.appendItem(F),x.appendChild(this.scaleShape),this.angleLabelElement=Ue.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ue.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=Ue.createTSpan("");return ie.innerHTML="°",this.angleLabelElement.appendChild(ie),x.appendChild(this.angleLabelElement),document.body.removeChild(x),x},U}(),It=function(){function U(){this.naturalSize=!1,this.imageType="image/png"}return U.prototype.rasterize=function(x,w,k,z,F,ie,Ce){var je=this;return new Promise(function($e){var Re=document.createElement("canvas");Re.width=x.width.baseVal.value-2*z,Re.height=x.height.baseVal.value-2*z;var Ze=1,qe=1;je.naturalSize===!0?(Ze=w.naturalWidth/(x.width.baseVal.value-2*z)/ie,qe=w.naturalHeight/(x.height.baseVal.value-2*z)/Ce,Re.width=w.naturalWidth/ie,Re.height=w.naturalHeight/Ce):je.width!==void 0&&je.height!==void 0&&(Ze=je.width/k.width,qe=je.height/k.height,Re.width*=Ze,Re.height*=qe);var ft=Re.getContext("2d");ft.translate(Re.width/2,Re.height/2),ft.rotate(F*Math.PI/180),ft.scale(ie,Ce),ft.translate(-Re.width/2,-Re.height/2),ft.drawImage(w,0,0,Re.width,Re.height);var Lt=document.createElement("canvas");Lt.width=k.width*Ze,Lt.height=k.height*qe,Lt.getContext("2d").putImageData(ft.getImageData((k.x-z)*Ze,(k.y-z)*qe,k.width*Ze,k.height*qe),0,0),$e(Lt.toDataURL(je.imageType,je.imageQuality))})},U}(),Bt=function(){function U(x){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=U.instanceCounter++,this.styles=new pt(this.instanceNo),this.target=x,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(U.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(x){this._zoomToCropEnabled=x,x?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(x){this._isGridVisible=x,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"gridLines",{get:function(){return this._gridLines},set:function(x){this._gridLines=x,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(x){this._rotationAngle=x,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"aspectRatio",{get:function(){var x;return(x=this._aspectRatio)!==null&&x!==void 0?x:this.aspectRatios[0]},set:function(x){this._aspectRatio=x},enumerable:!1,configurable:!0}),U.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},U.prototype.show=function(){this.showUI(),this.open()},U.prototype.close=function(x){x===void 0&&(x=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),x||this.closeEventListeners.forEach(function(w){return w()}),this._isOpen=!1)},U.prototype.addRenderEventListener=function(x){this.renderEventListeners.push(x)},U.prototype.removeRenderEventListener=function(x){this.renderEventListeners.indexOf(x)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(x),1)},U.prototype.addCloseEventListener=function(x){this.closeEventListeners.push(x)},U.prototype.removeCloseEventListener=function(x){this.closeEventListeners.indexOf(x)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(x),1)},U.prototype.setupResizeObserver=function(){var x=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){x.resize(x.target.clientWidth,x.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))},U.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var x=1*this.target.clientWidth/this.target.clientHeight,w=this.contentDiv.clientWidth/x>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*x:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,k=w+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/x;this.resize(w,k)}},U.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},U.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",Ue.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},U.prototype.resize=function(x,w){this.imageWidth=Math.round(x),this.imageHeight=Math.round(w),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()},U.prototype.setEditingTarget=function(){var x=document.createElement("canvas");x.width=this.target.naturalWidth,x.height=this.target.naturalHeight,x.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var w=x.toDataURL();Ue.setAttributes(this.editingTarget,[["href",w]]),this.setEditingTargetSize()},U.prototype.setTopLeft=function(){var x=this.target.getBoundingClientRect(),w=this.editorCanvas.getBoundingClientRect();this.left=x.left-w.left-this.CANVAS_MARGIN,this.top=x.top-w.top-this.CANVAS_MARGIN},U.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=Ue.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ue.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ue.createGroup(),this.editingTargetRotationScaleContainer=Ue.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var x=Ue.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(x);var w=Ue.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(w),this.editingTargetContainer=Ue.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)},U.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},U.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ue.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new _t(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()},U.prototype.zoomToCrop=function(){if(this.cropRect){var x=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,w=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=x+"px "+w+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-x+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-w+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},U.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)},U.prototype.cropRectChanged=function(x){this.cropRect=x,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},U.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},U.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"},U.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},U.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 x=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,w=this.target.offsetTop>x+this.CANVAS_MARGIN?this.target.offsetTop-(x+this.CANVAS_MARGIN):0;this.coverDiv.style.top=w+"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},U.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},U.prototype.addTopToolbar=function(){var x=this;this.topToolbar=new tt,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 w=new Et;w.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(w);var k=[];this.aspectRatios.forEach(function(qe){var ft=new bt(ct.getIcon(qe.horizontal,qe.vertical),qe.horizontal===0&&qe.vertical===0?"FREE":qe.horizontal+":"+qe.vertical);ft.onClick=function(){return x.ratioButtonClicked(qe)},k.push(ft)}),this.aspectRatioButton=new Tt(ct.getIcon(0,0),"Aspect ratio",k),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,w.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var z=new bt('<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");z.isActive=this.isGridVisible,z.onClick=function(){x.isGridVisible=!x.isGridVisible,z.isActive=x.isGridVisible},w.addButton(z);var F=new bt('<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(F.isActive=this.zoomToCropEnabled,F.onClick=function(){x.zoomToCropEnabled=!x.zoomToCropEnabled,F.isActive=x.zoomToCropEnabled},w.addButton(F),!ut.isLicensed){var ie=new Ot;this.topToolbar.addElementBlock(ie);var Ce=document.createElement("div");Ce.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var je=document.createElement("a");je.style.color="currentColor",je.href="https://markerjs.com/products/cropro",je.target="_blank",je.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>',Ce.appendChild(je),ie.addElement(Ce)}var $e=new Et;$e.minWidth=3*this.toolbarHeight+"px",$e.contentAlign="end",this.topToolbar.addButtonBlock($e);var Re=new bt('<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");Re.onClick=this.startRenderAndClose,$e.addButton(Re),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Re.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ze=new bt('<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");Ze.onClick=this.close,$e.addButton(Ze),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ze.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},U.prototype.addBottomToolbar=function(){var x=this;this.bottomToolbar=new tt,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 w=new Et;w.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(w);var k=new bt('<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");k.onClick=this.rotateLeftButtonClicked,w.addButton(k);var z=new bt('<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");z.onClick=this.rotateRightButtonClicked,w.addButton(z);var F=new Ot;F.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(F),this.straightener=new Pt("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($e){x.rotateBy($e),x.straightener.angle=x.rotationAngle},F.addElement(this.straightener.getUI());var ie=new Et;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var Ce=new bt('<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");Ce.onClick=this.flipHorizontallyButtonClicked,ie.addButton(Ce);var je=new bt('<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");je.onClick=this.flipVerticallyButtonClicked,ie.addButton(je)},U.prototype.ratioButtonClicked=function(x){this.aspectRatio=x,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},U.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ct.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},U.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Rt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},U.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},U.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},U.prototype.restoreState=function(x){if(x){var w=this.cropLayer.getRescaledRect(x.width,x.height,this.imageWidth,this.imageHeight,x.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(w),this.cropRectChanged(w),this.flippedHorizontally=x.flippedHorizontally,this.flippedVertically=x.flippedVertically,this.applyFlip(),this.rotationAngle=x.rotationAngle,this.applyRotation()}},U.prototype.clientToLocalCoordinates=function(x,w){var k=this.cropImage.getBoundingClientRect();return{x:x-k.left,y:w-k.top}},U.prototype.onWindowResize=function(){this.positionUI()},U.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var x=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=x+"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()},U.prototype.rotateLeftButtonClicked=function(){var x=this.rotationAngle-90;this.rotationAngle%90!=0&&(x+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(x)},U.prototype.rotateRightButtonClicked=function(){var x=this.rotationAngle+90;this.rotationAngle%90!=0&&(x-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(x)},U.prototype.rotateTo=function(x){x=(x=x>180?x-360:x)<=-180?x+360:x,this.rotationAngle=x,this.applyRotation()},U.prototype.rotateBy=function(x){this.rotateTo((this.rotationAngle+x)%360)},U.prototype.applyRotation=function(){var x=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var w=this.editingTargetRotationContainer.transform.baseVal.getItem(0);w.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(w,0);var k=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/k.width,this.imageHeight/k.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=x},U.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},U.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},U.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},U.prototype.startRenderAndClose=function(){return et(this,void 0,void 0,function(){var x,w;return st(this,function(k){switch(k.label){case 0:return[4,this.render()];case 1:return x=k.sent(),w=this.getState(),this.renderEventListeners.forEach(function(z){return z(x,w)}),this.close(!0),[2]}})})},U.prototype.render=function(){return et(this,void 0,void 0,function(){var x;return st(this,function(w){switch(w.label){case 0:return(x=new It).naturalSize=this.renderAtNaturalSize,x.imageType=this.renderImageType,x.imageQuality=this.renderImageQuality,x.width=this.renderWidth,x.height=this.renderHeight,this.unzoomFromCrop(),Ue.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,x.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 w.sent(),[4,x.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,w.sent()]}})})},U.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ve("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 Ve("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ve("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var x=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ve("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*x)+`px;
|
|
height: `+(this.toolbarHeight-2*x)+`px;
|
|
padding: `+x+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ve("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ve("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new Xe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Xe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ve("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 Ve("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ve("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 Ve("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*x)+`px;
|
|
padding: `+x+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ve("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},U.instanceCounter=0,U}(),Wt=B("8hTe"),Mt=B.n(Wt),Ft=/<pre[^>]*>/g;function Ht(U){var x=document.createElement("div");return x.innerHTML=U,x.childNodes.length===0?"":x.childNodes[0].nodeValue}var Jt=ne.a=function(U){var x=U.value,w=x===void 0?"":x,k=U.edit,z=k===void 0?!1:k,F=U.className,ie=U.showTextOnly,Ce=U.showLines,je=U.replaces,$e=U.zoomImg,Re=U.hasMask,Ze=U.style,qe=Ze===void 0?{}:Ze,ft=U.stylesPrev,Lt=ft===void 0?{}:ft,Ut=String(w),yt=Object(C.useRef)(),Nt=Object(C.useRef)(),rr=Object(C.useState)(""),Qt=Object(K.a)(rr,2),Kt=Qt[0],jt=Qt[1],nr=Object(C.useState)("office"),Zt=Object(K.a)(nr,2),lr=Zt[0],Gt=Zt[1],ir=function(){var it=new Bt(Nt.current);it.displayMode="popup",it.addRenderEventListener(function(){var xt=Object(R.a)(e.a.mark(function ot(wt){var mt;return e.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return yt.current.style.display="none",Ct.next=3,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:wt}});case 3:mt=Ct.sent,mt!=null&&mt.id&&je(Nt.current.getAttribute("src").replace(G.a.API_SERVER,""),"/api/attachments/".concat(mt==null?void 0:mt.id,"?type=").concat(mt.content_type));case 5:case"end":return Ct.stop()}},ot)}));return function(ot){return xt.apply(this,arguments)}}()),it.show()},ur=function(){var it=new nt(Nt.current);it.settings.displayMode="popup",it.addEventListener("render",function(){var xt=Object(R.a)(e.a.mark(function ot(wt){var mt;return e.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:if(yt.current.style.display="none",!Nt.current){Ct.next=6;break}return Ct.next=4,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:wt.dataUrl}});case 4:mt=Ct.sent,mt!=null&&mt.id&&je(Nt.current.getAttribute("src").replace(G.a.API_SERVER,""),"/api/attachments/".concat(mt==null?void 0:mt.id,"?type=").concat(mt.content_type));case 6:case"end":return Ct.stop()}},ot)}));return function(ot){return xt.apply(this,arguments)}}()),it.show(),window.markerArea=it},zt=Object(C.useMemo)(function(){yt.current&&(yt.current.style.zIndex=-1);try{var gt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,it=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ut=Ut.replace(gt,"("+G.a.API_SERVER+"/api/attachments/").replace(it,'"'+G.a.API_SERVER+"/api/attachments/").replace(xt,'"'+G.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(qt){}var ot=L(Ut),wt=_();if(Ut.match(/\[TOC\]/)&&(ot=ot.replace("<p>[TOC]</p>",T()),b()),ot=ot.replace(/(__special_katext_id_\d+__)/g,function(qt,Ct){var sr=wt[Ct],er=sr.type,Xt=sr.expression;return Object(X.renderToString)(Ht(Xt)||"",{displayMode:er==="block",throwOnError:!1,output:"html"})}),ot=ot.replace(/▁/g,"\u2581\u2581\u2581"),p(),ie){var mt=document.createElement("div");return mt.innerHTML=ot,mt.innerText}return setTimeout(function(){return ar()},500),ot},[Ut]),kt=Object(C.useRef)();v.WebkitLineClamp=Ce,Ce&&(qe=Object(P.a)(Object(P.a)({},qe),v));function Vt(gt){var it=gt.target;if(it.tagName.toUpperCase()==="IMG"){if($e){var xt=it.getAttribute("src");jt(xt),Gt("image")}}else if(it.tagName.toUpperCase()==="A"){var ot=it.getAttribute("href");if(ot.indexOf("office")>-1)gt.preventDefault(),jt(ot),Gt("office");else if(ot.indexOf("application/pdf")>-1)gt.preventDefault(),jt(ot),Gt("pdf");else if(ot.indexOf("text/html")>-1)gt.preventDefault(),jt(ot),Gt("html");else if(ot.startsWith("#")){gt.preventDefault();var wt=document.getElementById(ot.replace("#",""));wt&&wt.scrollIntoView(!0)}}}var ar=function(){var it,xt=(it=kt.current)===null||it===void 0?void 0:it.querySelectorAll("video");xt==null||xt.forEach(function(ot){if(ot.oncontextmenu=function(){return!1},ot.src.indexOf(".m3u8")>-1&&!ot.canPlayType("application/vnd.apple.mpegurl")){if(j.a.isSupported()){var wt=new j.a;wt.loadSource(ot.src),wt.attachMedia(ot)}}})};Object(C.useEffect)(function(){if(kt.current&&zt&&(zt.match(Ft)&&window.PR.prettyPrint()),kt.current)return kt.current.addEventListener("click",Vt),function(){kt.current.removeEventListener("click",Vt),p(),b()}},[zt,kt.current,Vt]);var Yt=function(it){if(!z)return;it.target.nodeName==="IMG"?(yt.current.style.zIndex=1,yt.current.style.display="flex",yt.current.style.width=it.target.clientWidth+"px",yt.current.style.height=it.target.clientHeight+"px",yt.current.style.top=it.target.offsetTop+"px",yt.current.style.left=it.target.offsetLeft+"px",Nt.current.src=it.target.getAttribute("src")):yt.current.style.display="none"};return E.a.createElement("div",{style:{position:"relative"}},E.a.createElement("div",{ref:kt,style:Object(P.a)({},qe),className:"".concat(F||""," markdown-body ").concat(Mt.a.mdBody),onMouseOver:Yt,dangerouslySetInnerHTML:{__html:zt}}),E.a.createElement("div",{ref:yt,className:Mt.a.button},E.a.createElement(H.a,null,E.a.createElement(W.a,{onClick:function(){return ir()}},"\u88C1\u526A"),E.a.createElement(W.a,{onClick:function(){return ur()}},"\u7F16\u8F91"))),E.a.createElement("img",{ref:Nt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),E.a.createElement(ee.a,{close:!0,data:Kt,type:Kt!=null&&Kt.length?lr:"",style:Object(P.a)({},Lt),onClose:function(){return jt("")}}))}},BU3w:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return R});var Q=B("MNnm"),H="rc-util-key";function I(K){if(K.attachTo)return K.attachTo;var N=document.querySelector("head");return N||document.body}function W(K){var N,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Q.a)())return null;var C=document.createElement("style");if((N=e.csp)===null||N===void 0?void 0:N.nonce){var E;C.nonce=(E=e.csp)===null||E===void 0?void 0:E.nonce}C.innerHTML=K;var g=I(e),h=g.firstChild;return e.prepend&&g.prepend?g.prepend(C):e.prepend&&h?g.insertBefore(C,h):g.appendChild(C),C}var P=new Map;function R(K,N){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},C=I(e);if(!P.has(C)){var E=W("",e),g=E.parentNode;P.set(C,g),g.removeChild(E)}var h=Array.from(P.get(C).children).find(function(n){return n.tagName==="STYLE"&&n[H]===N});if(h){var a,i;if(((a=e.csp)===null||a===void 0?void 0:a.nonce)&&h.nonce!==((i=e.csp)===null||i===void 0?void 0:i.nonce)){var l;h.nonce=(l=e.csp)===null||l===void 0?void 0:l.nonce}return h.innerHTML!==K&&(h.innerHTML=K),h}var s=W(K,e);return s[H]=N,s}},"C/vA":function(Me,ne,B){"use strict";B.d(ne,"a",function(){return Q});function Q(H){const I=this;let W=!1,P;return function(){return W||(W=!0,P=H.apply(I,arguments)),P}}},"Cg/j":function(Me,ne,B){"use strict";B.d(ne,"b",function(){return Q}),B.d(ne,"a",function(){return H}),B.d(ne,"c",function(){return W}),B.d(ne,"d",function(){return P});var Q;(function(R){R.serviceIds=new Map,R.DI_TARGET="$di$target",R.DI_DEPENDENCIES="$di$dependencies";function K(N){return N[R.DI_DEPENDENCIES]||[]}R.getServiceDependencies=K})(Q||(Q={}));const H=W("instantiationService");function I(R,K,N,e){K[Q.DI_TARGET]===K?K[Q.DI_DEPENDENCIES].push({id:R,index:N,optional:e}):(K[Q.DI_DEPENDENCIES]=[{id:R,index:N,optional:e}],K[Q.DI_TARGET]=K)}function W(R){if(Q.serviceIds.has(R))return Q.serviceIds.get(R);const K=function(N,e,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");I(K,N,C,!1)};return K.toString=()=>R,Q.serviceIds.set(R,K),K}function P(R){return function(K,N,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");I(R,K,e,!0)}}},DlQD:function(Me,ne,B){(function(Q,H){Me.exports=H()})(this,function(){"use strict";function Q(re,Z){for(var J=0;J<Z.length;J++){var V=Z[J];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(re,V.key,V)}}function H(re,Z,J){return Z&&Q(re.prototype,Z),J&&Q(re,J),re}function I(re,Z){if(!re)return;if(typeof re=="string")return W(re,Z);var J=Object.prototype.toString.call(re).slice(8,-1);if(J==="Object"&&re.constructor&&(J=re.constructor.name),J==="Map"||J==="Set")return Array.from(re);if(J==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(J))return W(re,Z)}function W(re,Z){(Z==null||Z>re.length)&&(Z=re.length);for(var J=0,V=new Array(Z);J<Z;J++)V[J]=re[J];return V}function P(re,Z){var J;if(typeof Symbol=="undefined"||re[Symbol.iterator]==null){if(Array.isArray(re)||(J=I(re))||Z&&re&&typeof re.length=="number"){J&&(re=J);var V=0;return function(){return V>=re.length?{done:!0}:{done:!1,value:re[V++]}}}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 J=re[Symbol.iterator](),J.next.bind(J)}function R(re,Z){return Z={exports:{}},re(Z,Z.exports),Z.exports}var K=R(function(re){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 J(V){re.exports.defaults=V}re.exports={defaults:Z(),getDefaults:Z,changeDefaults:J}}),N=K.defaults,e=K.getDefaults,C=K.changeDefaults,E=/[&<>"']/,g=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,i={"&":"&","<":"<",">":">",'"':""","'":"'"},l=function(Z){return i[Z]};function s(re,Z){if(Z){if(E.test(re))return re.replace(g,l)}else if(h.test(re))return re.replace(a,l);return re}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(re){return re.replace(n,function(Z,J){return J=J.toLowerCase(),J==="colon"?":":J.charAt(0)==="#"?J.charAt(1)==="x"?String.fromCharCode(parseInt(J.substring(2),16)):String.fromCharCode(+J.substring(1)):""})}var t=/(^|[^\[])\^/g;function b(re,Z){re=re.source||re,Z=Z||"";var J={replace:function(Y,q){return q=q.source||q,q=q.replace(t,"$1"),re=re.replace(Y,q),J},getRegex:function(){return new RegExp(re,Z)}};return J}var v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(re,Z,J){if(re){var V;try{V=decodeURIComponent(r(J)).replace(v,"").toLowerCase()}catch(Y){return null}if(V.indexOf("javascript:")===0||V.indexOf("vbscript:")===0||V.indexOf("data:")===0)return null}Z&&!m.test(J)&&(J=c(Z,J));try{J=encodeURI(J).replace(/%25/g,"%")}catch(Y){return null}return J}var y={},f=/^[^:]+:\/*[^/]*$/,u=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(re,Z){y[" "+re]||(f.test(re)?y[" "+re]=re+"/":y[" "+re]=A(re,"/",!0)),re=y[" "+re];var J=re.indexOf(":")===-1;return Z.substring(0,2)==="//"?J?Z:re.replace(u,"$1")+Z:Z.charAt(0)==="/"?J?Z:re.replace(o,"$1")+Z:re+Z}var _={exec:function(){}};function p(re){for(var Z=1,J,V;Z<arguments.length;Z++){J=arguments[Z];for(V in J)Object.prototype.hasOwnProperty.call(J,V)&&(re[V]=J[V])}return re}function d(re,Z){var J=re.replace(/\|/g,function(q,te,le){for(var ve=!1,Oe=te;--Oe>=0&&le[Oe]==="\\";)ve=!ve;return ve?"|":" |"}),V=J.split(/ \|/),Y=0;if(V.length>Z)V.splice(Z);else for(;V.length<Z;)V.push("");for(;Y<V.length;Y++)V[Y]=V[Y].trim().replace(/\\\|/g,"|");return V}function A(re,Z,J){var V=re.length;if(V===0)return"";for(var Y=0;Y<V;){var q=re.charAt(V-Y-1);if(q===Z&&!J)Y++;else if(q!==Z&&J)Y++;else break}return re.substr(0,V-Y)}function D(re,Z){if(re.indexOf(Z[1])===-1)return-1;for(var J=re.length,V=0,Y=0;Y<J;Y++)if(re[Y]==="\\")Y++;else if(re[Y]===Z[0])V++;else if(re[Y]===Z[1]&&(V--,V<0))return Y;return-1}function S(re){re&&re.sanitize&&!re.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 L={escape:s,unescape:r,edit:b,cleanUrl:T,resolveUrl:c,noopTest:_,merge:p,splitCells:d,rtrim:A,findClosingBracket:D,checkSanitizeDeprecation:S},M=K.defaults,O=L.rtrim,j=L.splitCells,G=L.escape,X=L.findClosingBracket;function ee(re,Z,J){var V=Z.href,Y=Z.title?G(Z.title):null,q=re[1].replace(/\\([\[\]])/g,"$1");return re[0].charAt(0)!=="!"?{type:"link",raw:J,href:V,title:Y,text:q}:{type:"image",raw:J,href:V,title:Y,text:G(q)}}function he(re,Z){var J=re.match(/^(\s+)(?:```)/);if(J===null)return Z;var V=J[1];return Z.split(`
|
|
`).map(function(Y){var q=Y.match(/^\s+/);if(q===null)return Y;var te=q[0];return te.length>=V.length?Y.slice(V.length):Y}).join(`
|
|
`)}var ge=function(){function re(J){this.options=J||M}var Z=re.prototype;return Z.space=function(V){var Y=this.rules.block.newline.exec(V);if(Y)return Y[0].length>1?{type:"space",raw:Y[0]}:{raw:`
|
|
`}},Z.code=function(V,Y){var q=this.rules.block.code.exec(V);if(q){var te=Y[Y.length-1];if(te&&te.type==="paragraph")return{raw:q[0],text:q[0].trimRight()};var le=q[0].replace(/^ {4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?le:O(le,`
|
|
`)}}},Z.fences=function(V){var Y=this.rules.block.fences.exec(V);if(Y){var q=Y[0],te=he(q,Y[3]||"");return{type:"code",raw:q,lang:Y[2]?Y[2].trim():Y[2],text:te}}},Z.heading=function(V){var Y=this.rules.block.heading.exec(V);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},Z.nptable=function(V){var Y=this.rules.block.nptable.exec(V);if(Y){var q={type:"table",header:j(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
|
|
`):[],raw:Y[0]};if(q.header.length===q.align.length){var te=q.align.length,le;for(le=0;le<te;le++)/^ *-+: *$/.test(q.align[le])?q.align[le]="right":/^ *:-+: *$/.test(q.align[le])?q.align[le]="center":/^ *:-+ *$/.test(q.align[le])?q.align[le]="left":q.align[le]=null;for(te=q.cells.length,le=0;le<te;le++)q.cells[le]=j(q.cells[le],q.header.length);return q}}},Z.hr=function(V){var Y=this.rules.block.hr.exec(V);if(Y)return{type:"hr",raw:Y[0]}},Z.blockquote=function(V){var Y=this.rules.block.blockquote.exec(V);if(Y){var q=Y[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Y[0],text:q}}},Z.list=function(V){var Y=this.rules.block.list.exec(V);if(Y){for(var q=Y[0],te=Y[2],le=te.length>1,ve=te[te.length-1]===")",Oe={type:"list",raw:q,ordered:le,start:le?+te.slice(0,-1):"",loose:!1,items:[]},He=Y[0].match(this.rules.block.item),ze=!1,Ne,Je,Qe,Ge,at,nt,rt,dt=He.length,et=0;et<dt;et++)Ne=He[et],q=Ne,Je=Ne.length,Ne=Ne.replace(/^ *([*+-]|\d+[.)]) */,""),~Ne.indexOf(`
|
|
`)&&(Je-=Ne.length,Ne=this.options.pedantic?Ne.replace(/^ {1,4}/gm,""):Ne.replace(new RegExp("^ {1,"+Je+"}","gm"),"")),et!==dt-1&&(Qe=this.rules.block.bullet.exec(He[et+1])[0],(le?Qe.length===1||!ve&&Qe[Qe.length-1]===")":Qe.length>1||this.options.smartLists&&Qe!==te)&&(Ge=He.slice(et+1).join(`
|
|
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-Ge.length),et=dt-1)),at=ze||/\n\n(?!\s*$)/.test(Ne),et!==dt-1&&(ze=Ne.charAt(Ne.length-1)===`
|
|
`,at||(at=ze)),at&&(Oe.loose=!0),nt=/^\[[ xX]\] /.test(Ne),rt=void 0,nt&&(rt=Ne[1]!==" ",Ne=Ne.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:q,task:nt,checked:rt,loose:at,text:Ne});return Oe}},Z.html=function(V){var Y=this.rules.block.html.exec(V);if(Y)return{type:this.options.sanitize?"paragraph":"html",raw:Y[0],pre:!this.options.sanitizer&&(Y[1]==="pre"||Y[1]==="script"||Y[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Y[0]):G(Y[0]):Y[0]}},Z.def=function(V){var Y=this.rules.block.def.exec(V);if(Y){Y[3]&&(Y[3]=Y[3].substring(1,Y[3].length-1));var q=Y[1].toLowerCase().replace(/\s+/g," ");return{tag:q,raw:Y[0],href:Y[2],title:Y[3]}}},Z.table=function(V){var Y=this.rules.block.table.exec(V);if(Y){var q={type:"table",header:j(Y[1].replace(/^ *| *\| *$/g,"")),align:Y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Y[3]?Y[3].replace(/\n$/,"").split(`
|
|
`):[]};if(q.header.length===q.align.length){q.raw=Y[0];var te=q.align.length,le;for(le=0;le<te;le++)/^ *-+: *$/.test(q.align[le])?q.align[le]="right":/^ *:-+: *$/.test(q.align[le])?q.align[le]="center":/^ *:-+ *$/.test(q.align[le])?q.align[le]="left":q.align[le]=null;for(te=q.cells.length,le=0;le<te;le++)q.cells[le]=j(q.cells[le].replace(/^ *\| *| *\| *$/g,""),q.header.length);return q}}},Z.lheading=function(V){var Y=this.rules.block.lheading.exec(V);if(Y)return{type:"heading",raw:Y[0],depth:Y[2].charAt(0)==="="?1:2,text:Y[1]}},Z.paragraph=function(V){var Y=this.rules.block.paragraph.exec(V);if(Y)return{type:"paragraph",raw:Y[0],text:Y[1].charAt(Y[1].length-1)===`
|
|
`?Y[1].slice(0,-1):Y[1]}},Z.text=function(V,Y){var q=this.rules.block.text.exec(V);if(q){var te=Y[Y.length-1];return te&&te.type==="text"?{raw:q[0],text:q[0]}:{type:"text",raw:q[0],text:q[0]}}},Z.escape=function(V){var Y=this.rules.inline.escape.exec(V);if(Y)return{type:"escape",raw:Y[0],text:G(Y[1])}},Z.tag=function(V,Y,q){var te=this.rules.inline.tag.exec(V);if(te)return!Y&&/^<a /i.test(te[0])?Y=!0:Y&&/^<\/a>/i.test(te[0])&&(Y=!1),!q&&/^<(pre|code|kbd|script)(\s|>)/i.test(te[0])?q=!0:q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(te[0])&&(q=!1),{type:this.options.sanitize?"text":"html",raw:te[0],inLink:Y,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):G(te[0]):te[0]}},Z.link=function(V){var Y=this.rules.inline.link.exec(V);if(Y){var q=X(Y[2],"()");if(q>-1){var te=Y[0].indexOf("!")===0?5:4,le=te+Y[1].length+q;Y[2]=Y[2].substring(0,q),Y[0]=Y[0].substring(0,le).trim(),Y[3]=""}var ve=Y[2],Oe="";if(this.options.pedantic){var He=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ve);He?(ve=He[1],Oe=He[3]):Oe=""}else Oe=Y[3]?Y[3].slice(1,-1):"";ve=ve.trim().replace(/^<([\s\S]*)>$/,"$1");var ze=ee(Y,{href:ve&&ve.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},Y[0]);return ze}},Z.reflink=function(V,Y){var q;if((q=this.rules.inline.reflink.exec(V))||(q=this.rules.inline.nolink.exec(V))){var te=(q[2]||q[1]).replace(/\s+/g," ");if(te=Y[te.toLowerCase()],!te||!te.href){var le=q[0].charAt(0);return{type:"text",raw:le,text:le}}var ve=ee(q,te,q[0]);return ve}},Z.strong=function(V,Y,q){q===void 0&&(q="");var te=this.rules.inline.strong.start.exec(V);if(te&&(!te[1]||te[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){Y=Y.slice(-1*V.length);var le=te[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;le.lastIndex=0;for(var ve;(te=le.exec(Y))!=null;)if(ve=this.rules.inline.strong.middle.exec(Y.slice(0,te.index+3)),ve)return{type:"strong",raw:V.slice(0,ve[0].length),text:V.slice(2,ve[0].length-2)}}},Z.em=function(V,Y,q){q===void 0&&(q="");var te=this.rules.inline.em.start.exec(V);if(te&&(!te[1]||te[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){Y=Y.slice(-1*V.length);var le=te[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;le.lastIndex=0;for(var ve;(te=le.exec(Y))!=null;)if(ve=this.rules.inline.em.middle.exec(Y.slice(0,te.index+2)),ve)return{type:"em",raw:V.slice(0,ve[0].length),text:V.slice(1,ve[0].length-1)}}},Z.codespan=function(V){var Y=this.rules.inline.code.exec(V);if(Y){var q=Y[2].replace(/\n/g," "),te=/[^ ]/.test(q),le=q.startsWith(" ")&&q.endsWith(" ");return te&&le&&(q=q.substring(1,q.length-1)),q=G(q,!0),{type:"codespan",raw:Y[0],text:q}}},Z.br=function(V){var Y=this.rules.inline.br.exec(V);if(Y)return{type:"br",raw:Y[0]}},Z.del=function(V){var Y=this.rules.inline.del.exec(V);if(Y)return{type:"del",raw:Y[0],text:Y[1]}},Z.autolink=function(V,Y){var q=this.rules.inline.autolink.exec(V);if(q){var te,le;return q[2]==="@"?(te=G(this.options.mangle?Y(q[1]):q[1]),le="mailto:"+te):(te=G(q[1]),le=te),{type:"link",raw:q[0],text:te,href:le,tokens:[{type:"text",raw:te,text:te}]}}},Z.url=function(V,Y){var q;if(q=this.rules.inline.url.exec(V)){var te,le;if(q[2]==="@")te=G(this.options.mangle?Y(q[0]):q[0]),le="mailto:"+te;else{var ve;do ve=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(ve!==q[0]);te=G(q[0]),q[1]==="www."?le="http://"+te:le=te}return{type:"link",raw:q[0],text:te,href:le,tokens:[{type:"text",raw:te,text:te}]}}},Z.inlineText=function(V,Y,q){var te=this.rules.inline.text.exec(V);if(te){var le;return Y?le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):G(te[0]):te[0]:le=G(this.options.smartypants?q(te[0]):te[0]),{type:"text",raw:te[0],text:le}}},re}(),de=L.noopTest,Te=L.edit,xe=L.merge,ce={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:de,table:de,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ce.def=Te(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex(),ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ce.item=Te(ce.item,"gm").replace(/bull/g,ce.bullet).getRegex(),ce.list=Te(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex(),ce._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",ce._comment=/<!--(?!-?>)[\s\S]*?-->/,ce.html=Te(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce.paragraph=Te(ce._paragraph).replace("hr",ce.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",ce._tag).getRegex(),ce.blockquote=Te(ce.blockquote).replace("paragraph",ce.paragraph).getRegex(),ce.normal=xe({},ce),ce.gfm=xe({},ce.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*|$)"}),ce.gfm.nptable=Te(ce.gfm.nptable).replace("hr",ce.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",ce._tag).getRegex(),ce.gfm.table=Te(ce.gfm.table).replace("hr",ce.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",ce._tag).getRegex(),ce.pedantic=xe({},ce.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._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:de,paragraph:Te(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:de,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:de,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ae._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ae.punctuation=Te(ae.punctuation).replace(/punctuation/g,ae._punctuation).getRegex(),ae._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ae._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ae.em.start=Te(ae.em.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.middle=Te(ae.em.middle).replace(/punctuation/g,ae._punctuation).replace(/overlapSkip/g,ae._overlapSkip).getRegex(),ae.em.endAst=Te(ae.em.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.endUnd=Te(ae.em.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.start=Te(ae.strong.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.middle=Te(ae.strong.middle).replace(/punctuation/g,ae._punctuation).replace(/blockSkip/g,ae._blockSkip).getRegex(),ae.strong.endAst=Te(ae.strong.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.endUnd=Te(ae.strong.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=Te(ae._blockSkip,"g").getRegex(),ae.overlapSkip=Te(ae._overlapSkip,"g").getRegex(),ae._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._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])?)+(?![-_])/,ae.autolink=Te(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=Te(ae.tag).replace("comment",ce._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=Te(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=Te(ae.reflink).replace("label",ae._label).getRegex(),ae.reflinkSearch=Te(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal=xe({},ae),ae.pedantic=xe({},ae.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:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()}),ae.gfm=xe({},ae.normal,{escape:Te(ae.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ae.gfm.url=Te(ae.gfm.url,"i").replace("email",ae.gfm._extended_email).getRegex(),ae.breaks=xe({},ae.gfm,{br:Te(ae.br).replace("{2,}","*").getRegex(),text:Te(ae.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Le={block:ce,inline:ae},Ye=K.defaults,Fe=Le.block,We=Le.inline;function be(re){return re.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 Ee(re){var Z="",J,V,Y=re.length;for(J=0;J<Y;J++)V=re.charCodeAt(J),Math.random()>.5&&(V="x"+V.toString(16)),Z+="&#"+V+";";return Z}var Ae=function(){function re(J){this.tokens=[],this.tokens.links=Object.create(null),this.options=J||Ye,this.options.tokenizer=this.options.tokenizer||new ge,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var V={block:Fe.normal,inline:We.normal};this.options.pedantic?(V.block=Fe.pedantic,V.inline=We.pedantic):this.options.gfm&&(V.block=Fe.gfm,this.options.breaks?V.inline=We.breaks:V.inline=We.gfm),this.tokenizer.rules=V}re.lex=function(V,Y){var q=new re(Y);return q.lex(V)};var Z=re.prototype;return Z.lex=function(V){return V=V.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(V,this.tokens,!0),this.inline(this.tokens),this.tokens},Z.blockTokens=function(V,Y,q){Y===void 0&&(Y=[]),q===void 0&&(q=!0),V=V.replace(/^ +$/gm,"");for(var te,le,ve,Oe;V;){if(te=this.tokenizer.space(V)){V=V.substring(te.raw.length),te.type&&Y.push(te);continue}if(te=this.tokenizer.code(V,Y)){V=V.substring(te.raw.length),te.type?Y.push(te):(Oe=Y[Y.length-1],Oe.raw+=`
|
|
`+te.raw,Oe.text+=`
|
|
`+te.text);continue}if(te=this.tokenizer.fences(V)){V=V.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.heading(V)){V=V.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.nptable(V)){V=V.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.hr(V)){V=V.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.blockquote(V)){V=V.substring(te.raw.length),te.tokens=this.blockTokens(te.text,[],q),Y.push(te);continue}if(te=this.tokenizer.list(V)){for(V=V.substring(te.raw.length),ve=te.items.length,le=0;le<ve;le++)te.items[le].tokens=this.blockTokens(te.items[le].text,[],!1);Y.push(te);continue}if(te=this.tokenizer.html(V)){V=V.substring(te.raw.length),Y.push(te);continue}if(q&&(te=this.tokenizer.def(V))){V=V.substring(te.raw.length),this.tokens.links[te.tag]||(this.tokens.links[te.tag]={href:te.href,title:te.title});continue}if(te=this.tokenizer.table(V)){V=V.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.lheading(V)){V=V.substring(te.raw.length),Y.push(te);continue}if(q&&(te=this.tokenizer.paragraph(V))){V=V.substring(te.raw.length),Y.push(te);continue}if(te=this.tokenizer.text(V,Y)){V=V.substring(te.raw.length),te.type?Y.push(te):(Oe=Y[Y.length-1],Oe.raw+=`
|
|
`+te.raw,Oe.text+=`
|
|
`+te.text);continue}if(V){var He="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(He);break}else throw new Error(He)}}return Y},Z.inline=function(V){var Y,q,te,le,ve,Oe,He=V.length;for(Y=0;Y<He;Y++){Oe=V[Y];switch(Oe.type){case"paragraph":case"text":case"heading":{Oe.tokens=[],this.inlineTokens(Oe.text,Oe.tokens);break}case"table":{for(Oe.tokens={header:[],cells:[]},le=Oe.header.length,q=0;q<le;q++)Oe.tokens.header[q]=[],this.inlineTokens(Oe.header[q],Oe.tokens.header[q]);for(le=Oe.cells.length,q=0;q<le;q++)for(ve=Oe.cells[q],Oe.tokens.cells[q]=[],te=0;te<ve.length;te++)Oe.tokens.cells[q][te]=[],this.inlineTokens(ve[te],Oe.tokens.cells[q][te]);break}case"blockquote":{this.inline(Oe.tokens);break}case"list":{for(le=Oe.items.length,q=0;q<le;q++)this.inline(Oe.items[q].tokens);break}}}return V},Z.inlineTokens=function(V,Y,q,te,le){Y===void 0&&(Y=[]),q===void 0&&(q=!1),te===void 0&&(te=!1),le===void 0&&(le="");var ve,Oe=V,He;if(this.tokens.links){var ze=Object.keys(this.tokens.links);if(ze.length>0)for(;(He=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)ze.includes(He[0].slice(He[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(He=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;V;){if(ve=this.tokenizer.escape(V)){V=V.substring(ve.raw.length),Y.push(ve);continue}if(ve=this.tokenizer.tag(V,q,te)){V=V.substring(ve.raw.length),q=ve.inLink,te=ve.inRawBlock,Y.push(ve);continue}if(ve=this.tokenizer.link(V)){V=V.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,te)),Y.push(ve);continue}if(ve=this.tokenizer.reflink(V,this.tokens.links)){V=V.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,te)),Y.push(ve);continue}if(ve=this.tokenizer.strong(V,Oe,le)){V=V.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],q,te),Y.push(ve);continue}if(ve=this.tokenizer.em(V,Oe,le)){V=V.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],q,te),Y.push(ve);continue}if(ve=this.tokenizer.codespan(V)){V=V.substring(ve.raw.length),Y.push(ve);continue}if(ve=this.tokenizer.br(V)){V=V.substring(ve.raw.length),Y.push(ve);continue}if(ve=this.tokenizer.del(V)){V=V.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],q,te),Y.push(ve);continue}if(ve=this.tokenizer.autolink(V,Ee)){V=V.substring(ve.raw.length),Y.push(ve);continue}if(!q&&(ve=this.tokenizer.url(V,Ee))){V=V.substring(ve.raw.length),Y.push(ve);continue}if(ve=this.tokenizer.inlineText(V,te,be)){V=V.substring(ve.raw.length),le=ve.raw.slice(-1),Y.push(ve);continue}if(V){var Ne="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(Ne);break}else throw new Error(Ne)}}return Y},H(re,null,[{key:"rules",get:function(){return{block:Fe,inline:We}}}]),re}(),Ie=K.defaults,$=L.cleanUrl,se=L.escape,ue=function(){function re(J){this.options=J||Ie}var Z=re.prototype;return Z.code=function(V,Y,q){var te=(Y||"").match(/\S*/)[0];if(this.options.highlight){var le=this.options.highlight(V,te);le!=null&&le!==V&&(q=!0,V=le)}return te?'<pre><code class="'+this.options.langPrefix+se(te,!0)+'">'+(q?V:se(V,!0))+`</code></pre>
|
|
`:"<pre><code>"+(q?V:se(V,!0))+`</code></pre>
|
|
`},Z.blockquote=function(V){return`<blockquote>
|
|
`+V+`</blockquote>
|
|
`},Z.html=function(V){return V},Z.heading=function(V,Y,q,te){return this.options.headerIds?"<h"+Y+' id="'+this.options.headerPrefix+te.slug(q)+'">'+V+"</h"+Y+`>
|
|
`:"<h"+Y+">"+V+"</h"+Y+`>
|
|
`},Z.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Z.list=function(V,Y,q){var te=Y?"ol":"ul",le=Y&&q!==1?' start="'+q+'"':"";return"<"+te+le+`>
|
|
`+V+"</"+te+`>
|
|
`},Z.listitem=function(V){return"<li>"+V+`</li>
|
|
`},Z.checkbox=function(V){return"<input "+(V?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Z.paragraph=function(V){return"<p>"+V+`</p>
|
|
`},Z.table=function(V,Y){return Y&&(Y="<tbody>"+Y+"</tbody>"),`<table>
|
|
<thead>
|
|
`+V+`</thead>
|
|
`+Y+`</table>
|
|
`},Z.tablerow=function(V){return`<tr>
|
|
`+V+`</tr>
|
|
`},Z.tablecell=function(V,Y){var q=Y.header?"th":"td",te=Y.align?"<"+q+' align="'+Y.align+'">':"<"+q+">";return te+V+"</"+q+`>
|
|
`},Z.strong=function(V){return"<strong>"+V+"</strong>"},Z.em=function(V){return"<em>"+V+"</em>"},Z.codespan=function(V){return"<code>"+V+"</code>"},Z.br=function(){return this.options.xhtml?"<br/>":"<br>"},Z.del=function(V){return"<del>"+V+"</del>"},Z.link=function(V,Y,q){if(V=$(this.options.sanitize,this.options.baseUrl,V),V===null)return q;var te='<a href="'+se(V)+'"';return Y&&(te+=' title="'+Y+'"'),te+=">"+q+"</a>",te},Z.image=function(V,Y,q){if(V=$(this.options.sanitize,this.options.baseUrl,V),V===null)return q;var te='<img src="'+V+'" alt="'+q+'"';return Y&&(te+=' title="'+Y+'"'),te+=this.options.xhtml?"/>":">",te},Z.text=function(V){return V},re}(),pe=function(){function re(){}var Z=re.prototype;return Z.strong=function(V){return V},Z.em=function(V){return V},Z.codespan=function(V){return V},Z.del=function(V){return V},Z.html=function(V){return V},Z.text=function(V){return V},Z.link=function(V,Y,q){return""+q},Z.image=function(V,Y,q){return""+q},Z.br=function(){return""},re}(),Se=function(){function re(){this.seen={}}var Z=re.prototype;return Z.slug=function(V){var Y=V.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Y)){var q=Y;do this.seen[q]++,Y=q+"-"+this.seen[q];while(this.seen.hasOwnProperty(Y))}return this.seen[Y]=0,Y},re}(),Pe=K.defaults,De=L.unescape,ke=function(){function re(J){this.options=J||Pe,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new pe,this.slugger=new Se}re.parse=function(V,Y){var q=new re(Y);return q.parse(V)};var Z=re.prototype;return Z.parse=function(V,Y){Y===void 0&&(Y=!0);var q="",te,le,ve,Oe,He,ze,Ne,Je,Qe,Ge,at,nt,rt,dt,et,st,ut,Ue,pt=V.length;for(te=0;te<pt;te++){Ge=V[te];switch(Ge.type){case"space":continue;case"hr":{q+=this.renderer.hr();continue}case"heading":{q+=this.renderer.heading(this.parseInline(Ge.tokens),Ge.depth,De(this.parseInline(Ge.tokens,this.textRenderer)),this.slugger);continue}case"code":{q+=this.renderer.code(Ge.text,Ge.lang,Ge.escaped);continue}case"table":{for(Je="",Ne="",Oe=Ge.header.length,le=0;le<Oe;le++)Ne+=this.renderer.tablecell(this.parseInline(Ge.tokens.header[le]),{header:!0,align:Ge.align[le]});for(Je+=this.renderer.tablerow(Ne),Qe="",Oe=Ge.cells.length,le=0;le<Oe;le++){for(ze=Ge.tokens.cells[le],Ne="",He=ze.length,ve=0;ve<He;ve++)Ne+=this.renderer.tablecell(this.parseInline(ze[ve]),{header:!1,align:Ge.align[ve]});Qe+=this.renderer.tablerow(Ne)}q+=this.renderer.table(Je,Qe);continue}case"blockquote":{Qe=this.parse(Ge.tokens),q+=this.renderer.blockquote(Qe);continue}case"list":{for(at=Ge.ordered,nt=Ge.start,rt=Ge.loose,Oe=Ge.items.length,Qe="",le=0;le<Oe;le++)et=Ge.items[le],st=et.checked,ut=et.task,dt="",et.task&&(Ue=this.renderer.checkbox(st),rt?et.tokens.length>0&&et.tokens[0].type==="text"?(et.tokens[0].text=Ue+" "+et.tokens[0].text,et.tokens[0].tokens&&et.tokens[0].tokens.length>0&&et.tokens[0].tokens[0].type==="text"&&(et.tokens[0].tokens[0].text=Ue+" "+et.tokens[0].tokens[0].text)):et.tokens.unshift({type:"text",text:Ue}):dt+=Ue),dt+=this.parse(et.tokens,rt),Qe+=this.renderer.listitem(dt,ut,st);q+=this.renderer.list(Qe,at,nt);continue}case"html":{q+=this.renderer.html(Ge.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline(Ge.tokens));continue}case"text":{for(Qe=Ge.tokens?this.parseInline(Ge.tokens):Ge.text;te+1<pt&&V[te+1].type==="text";)Ge=V[++te],Qe+=`
|
|
`+(Ge.tokens?this.parseInline(Ge.tokens):Ge.text);q+=Y?this.renderer.paragraph(Qe):Qe;continue}default:{var Xe='Token with "'+Ge.type+'" type was not found.';if(this.options.silent){console.error(Xe);return}else throw new Error(Xe)}}}return q},Z.parseInline=function(V,Y){Y=Y||this.renderer;var q="",te,le,ve=V.length;for(te=0;te<ve;te++){le=V[te];switch(le.type){case"escape":{q+=Y.text(le.text);break}case"html":{q+=Y.html(le.text);break}case"link":{q+=Y.link(le.href,le.title,this.parseInline(le.tokens,Y));break}case"image":{q+=Y.image(le.href,le.title,le.text);break}case"strong":{q+=Y.strong(this.parseInline(le.tokens,Y));break}case"em":{q+=Y.em(this.parseInline(le.tokens,Y));break}case"codespan":{q+=Y.codespan(le.text);break}case"br":{q+=Y.br();break}case"del":{q+=Y.del(this.parseInline(le.tokens,Y));break}case"text":{q+=Y.text(le.text);break}default:{var Oe='Token with "'+le.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return q},re}(),Be=L.merge,Ke=L.checkSanitizeDeprecation,oe=L.escape,me=K.getDefaults,_e=K.changeDefaults,we=K.defaults;function fe(re,Z,J){if(typeof re=="undefined"||re===null)throw new Error("marked(): input parameter is undefined or null");if(typeof re!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(re)+", string expected");if(typeof Z=="function"&&(J=Z,Z=null),Z=Be({},fe.defaults,Z||{}),Ke(Z),J){var V=Z.highlight,Y;try{Y=Ae.lex(re,Z)}catch(ve){return J(ve)}var q=function(Oe){var He;if(!Oe)try{He=ke.parse(Y,Z)}catch(ze){Oe=ze}return Z.highlight=V,Oe?J(Oe):J(null,He)};if(!V||V.length<3)return q();if(delete Z.highlight,!Y.length)return q();var te=0;fe.walkTokens(Y,function(ve){ve.type==="code"&&(te++,setTimeout(function(){V(ve.text,ve.lang,function(Oe,He){if(Oe)return q(Oe);He!=null&&He!==ve.text&&(ve.text=He,ve.escaped=!0),te--,te===0&&q()})},0))}),te===0&&q();return}try{var le=Ae.lex(re,Z);return Z.walkTokens&&fe.walkTokens(le,Z.walkTokens),ke.parse(le,Z)}catch(ve){if(ve.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Z.silent)return"<p>An error occurred:</p><pre>"+oe(ve.message+"",!0)+"</pre>";throw ve}}fe.options=fe.setOptions=function(re){return Be(fe.defaults,re),_e(fe.defaults),fe},fe.getDefaults=me,fe.defaults=we,fe.use=function(re){var Z=Be({},re);if(re.renderer&&function(){var V=fe.defaults.renderer||new ue,Y=function(le){var ve=V[le];V[le]=function(){for(var Oe=arguments.length,He=new Array(Oe),ze=0;ze<Oe;ze++)He[ze]=arguments[ze];var Ne=re.renderer[le].apply(V,He);return Ne===!1&&(Ne=ve.apply(V,He)),Ne}};for(var q in re.renderer)Y(q);Z.renderer=V}(),re.tokenizer&&function(){var V=fe.defaults.tokenizer||new ge,Y=function(le){var ve=V[le];V[le]=function(){for(var Oe=arguments.length,He=new Array(Oe),ze=0;ze<Oe;ze++)He[ze]=arguments[ze];var Ne=re.tokenizer[le].apply(V,He);return Ne===!1&&(Ne=ve.apply(V,He)),Ne}};for(var q in re.tokenizer)Y(q);Z.tokenizer=V}(),re.walkTokens){var J=fe.defaults.walkTokens;Z.walkTokens=function(V){re.walkTokens(V),J&&J(V)}}fe.setOptions(Z)},fe.walkTokens=function(re,Z){for(var J=P(re),V;!(V=J()).done;){var Y=V.value;Z(Y);switch(Y.type){case"table":{for(var q=P(Y.tokens.header),te;!(te=q()).done;){var le=te.value;fe.walkTokens(le,Z)}for(var ve=P(Y.tokens.cells),Oe;!(Oe=ve()).done;)for(var He=Oe.value,ze=P(He),Ne;!(Ne=ze()).done;){var Je=Ne.value;fe.walkTokens(Je,Z)}break}case"list":{fe.walkTokens(Y.items,Z);break}default:Y.tokens&&fe.walkTokens(Y.tokens,Z)}}},fe.Parser=ke,fe.parser=ke.parse,fe.Renderer=ue,fe.TextRenderer=pe,fe.Lexer=Ae,fe.lexer=Ae.lex,fe.Tokenizer=ge,fe.Slugger=Se,fe.parse=fe;var ye=fe;return ye})},F0VM:function(Me,ne,B){Me.exports={flex_box_center:"flex_box_center___2fDN3",flex_space_between:"flex_space_between___BHBBv",flex_box_vertical_center:"flex_box_vertical_center___tpxsE",flex_box_center_end:"flex_box_center_end___rP7bQ",flex_box_column:"flex_box_column___1_rF-",md:"md___3SObb",title:"title___HfZ1b"}},FWmy:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return Q});function Q(H,I){if(!H)throw new Error(I?`Assertion failed (${I})`:"Assertion Failed")}},IBYe:function(Me,ne,B){"use strict";function Q(H){return null}ne.a=Q},J66h:function(Me,ne,B){(function(Q){var H,I;(function(W,P){Me.exports=P(W)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Q!="undefined"?Q:this,function(W){"use strict";W=W||{};var P=W.Base64,R="2.6.4",K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=function(d){for(var A={},D=0,S=d.length;D<S;D++)A[d.charAt(D)]=D;return A}(K),e=String.fromCharCode,C=function(d){if(d.length<2){var A=d.charCodeAt(0);return A<128?d:A<2048?e(192|A>>>6)+e(128|A&63):e(224|A>>>12&15)+e(128|A>>>6&63)+e(128|A&63)}else{var A=65536+(d.charCodeAt(0)-55296)*1024+(d.charCodeAt(1)-56320);return e(240|A>>>18&7)+e(128|A>>>12&63)+e(128|A>>>6&63)+e(128|A&63)}},E=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(d){return d.replace(E,C)},h=function(d){var A=[0,2,1][d.length%3],D=d.charCodeAt(0)<<16|(d.length>1?d.charCodeAt(1):0)<<8|(d.length>2?d.charCodeAt(2):0),S=[K.charAt(D>>>18),K.charAt(D>>>12&63),A>=2?"=":K.charAt(D>>>6&63),A>=1?"=":K.charAt(D&63)];return S.join("")},a=W.btoa&&typeof W.btoa=="function"?function(d){return W.btoa(d)}:function(d){if(d.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return d.replace(/[\s\S]{1,3}/g,h)},i=function(d){return a(g(String(d)))},l=function(d){return d.replace(/[+\/]/g,function(A){return A=="+"?"-":"_"}).replace(/=/g,"")},s=function(d,A){return A?l(i(d)):i(d)},n=function(d){return s(d,!0)},r;W.Uint8Array&&(r=function(d,A){for(var D="",S=0,L=d.length;S<L;S+=3){var M=d[S],O=d[S+1],j=d[S+2],G=M<<16|O<<8|j;D+=K.charAt(G>>>18)+K.charAt(G>>>12&63)+(typeof O!="undefined"?K.charAt(G>>>6&63):"=")+(typeof j!="undefined"?K.charAt(G&63):"=")}return A?l(D):D});var t=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,b=function(d){switch(d.length){case 4:var A=(7&d.charCodeAt(0))<<18|(63&d.charCodeAt(1))<<12|(63&d.charCodeAt(2))<<6|63&d.charCodeAt(3),D=A-65536;return e((D>>>10)+55296)+e((D&1023)+56320);case 3:return e((15&d.charCodeAt(0))<<12|(63&d.charCodeAt(1))<<6|63&d.charCodeAt(2));default:return e((31&d.charCodeAt(0))<<6|63&d.charCodeAt(1))}},v=function(d){return d.replace(t,b)},m=function(d){var A=d.length,D=A%4,S=(A>0?N[d.charAt(0)]<<18:0)|(A>1?N[d.charAt(1)]<<12:0)|(A>2?N[d.charAt(2)]<<6:0)|(A>3?N[d.charAt(3)]:0),L=[e(S>>>16),e(S>>>8&255),e(S&255)];return L.length-=[0,0,2,1][D],L.join("")},T=W.atob&&typeof W.atob=="function"?function(d){return W.atob(d)}:function(d){return d.replace(/\S{1,4}/g,m)},y=function(d){return T(String(d).replace(/[^A-Za-z0-9\+\/]/g,""))},f=function(d){return v(T(d))},u=function(d){return String(d).replace(/[-_]/g,function(A){return A=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},o=function(d){return f(u(d))},c;W.Uint8Array&&(c=function(d){return Uint8Array.from(y(u(d)),function(A){return A.charCodeAt(0)})});var _=function(){var d=W.Base64;return W.Base64=P,d};if(W.Base64={VERSION:R,atob:y,btoa:a,fromBase64:o,toBase64:s,utob:g,encode:s,encodeURI:n,btou:v,decode:o,noConflict:_,fromUint8Array:r,toUint8Array:c},typeof Object.defineProperty=="function"){var p=function(d){return{value:d,enumerable:!1,writable:!0,configurable:!0}};W.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",p(function(){return o(this)})),Object.defineProperty(String.prototype,"toBase64",p(function(d){return s(this,d)})),Object.defineProperty(String.prototype,"toBase64URI",p(function(){return s(this,!0)}))}}return W.Meteor&&(Base64=W.Base64),Me.exports?Me.exports.Base64=W.Base64:!(H=[],I=function(){return W.Base64}.apply(ne,H),I!==void 0&&(Me.exports=I)),{Base64:W.Base64}})}).call(this,B("IyRk"))},JYp7:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return Q});var Q;(function(H){function I(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}H.is=I;const W=Object.freeze([]);function P(){return W}H.empty=P;function*R(t){yield t}H.single=R;function K(t){return t||W}H.from=K;function N(t){return!t||t[Symbol.iterator]().next().done===!0}H.isEmpty=N;function e(t){return t[Symbol.iterator]().next().value}H.first=e;function C(t,b){for(const v of t)if(b(v))return!0;return!1}H.some=C;function E(t,b){for(const v of t)if(b(v))return v;return}H.find=E;function*g(t,b){for(const v of t)b(v)&&(yield v)}H.filter=g;function*h(t,b){let v=0;for(const m of t)yield b(m,v++)}H.map=h;function*a(...t){for(const b of t)for(const v of b)yield v}H.concat=a;function*i(t){for(const b of t)for(const v of b)yield v}H.concatNested=i;function l(t,b,v){let m=v;for(const T of t)m=b(m,T);return m}H.reduce=l;function*s(t,b,v=t.length){for(b<0&&(b+=t.length),v<0?v+=t.length:v>t.length&&(v=t.length);b<v;b++)yield t[b]}H.slice=s;function n(t,b=Number.POSITIVE_INFINITY){const v=[];if(b===0)return[v,t];const m=t[Symbol.iterator]();for(let T=0;T<b;T++){const y=m.next();if(y.done)return[v,H.empty()];v.push(y.value)}return[v,{[Symbol.iterator](){return m}}]}H.consume=n;function r(t,b,v=(m,T)=>m===T){const m=t[Symbol.iterator](),T=b[Symbol.iterator]();for(;;){const y=m.next(),f=T.next();if(y.done!==f.done)return!1;if(y.done)return!0;if(!v(y.value,f.value))return!1}}H.equals=r})(Q||(Q={}))},LdHM:function(Me,ne,B){"use strict";B.d(ne,"b",function(){return t}),B.d(ne,"a",function(){return v});var Q=B("1OyB"),H=B("vuIU"),I=B("Ji7U"),W=B("LK+K"),P=B("q1tI"),R=B("rePB"),K=B("Ff2n"),N=B("ODXe"),e=B("4IlW"),C=B("bX4T"),E=B("YrtM"),g=B("TSYQ"),h=B.n(g),a=B("+nKL"),i=B("8OUc"),l=function(j,G){var X=j.prefixCls,ee=j.id,he=j.flattenOptions,ge=j.childrenAsData,de=j.values,Te=j.searchValue,xe=j.multiple,ce=j.defaultActiveFirstOption,ae=j.height,Le=j.itemHeight,Ye=j.notFoundContent,Fe=j.open,We=j.menuItemSelectedIcon,be=j.virtual,Ee=j.onSelect,Ae=j.onToggleOpen,Ie=j.onActiveValue,$=j.onScroll,se=j.onMouseEnter,ue="".concat(X,"-item"),pe=Object(E.a)(function(){return he},[Fe,he],function(ye,re){return re[0]&&ye[1]!==re[1]}),Se=P.useRef(null),Pe=function(re){re.preventDefault()},De=function(re){Se.current&&Se.current.scrollTo({index:re})},ke=function(re){for(var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,J=pe.length,V=0;V<J;V+=1){var Y=(re+V*Z+J)%J,q=pe[Y],te=q.group,le=q.data;if(!te&&!le.disabled)return Y}return-1},Be=P.useState(function(){return ke(0)}),Ke=Object(N.a)(Be,2),oe=Ke[0],me=Ke[1],_e=function(re){me(re);var Z=pe[re];if(!Z){Ie(null,-1);return}Ie(Z.data.value,re)};P.useEffect(function(){_e(ce!==!1?ke(0):-1)},[pe.length,Te]),P.useEffect(function(){var ye=setTimeout(function(){if(!xe&&Fe&&de.size===1){var re=Array.from(de)[0],Z=pe.findIndex(function(J){var V=J.data;return V.value===re});_e(Z),De(Z)}});return function(){return clearTimeout(ye)}},[Fe]);var we=function(re){re!==void 0&&Ee(re,{selected:!de.has(re)}),xe||Ae(!1)};if(P.useImperativeHandle(G,function(){return{onKeyDown:function(re){var Z=re.which;switch(Z){case e.a.UP:case e.a.DOWN:{var J=0;if(Z===e.a.UP?J=-1:Z===e.a.DOWN&&(J=1),J!==0){var V=ke(oe+J,J);De(V),_e(V)}break}case e.a.ENTER:{var Y=pe[oe];Y&&!Y.data.disabled?we(Y.data.value):we(void 0),Fe&&re.preventDefault();break}case e.a.ESC:Ae(!1)}},onKeyUp:function(){},scrollTo:function(re){De(re)}}}),pe.length===0)return P.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),className:"".concat(ue,"-empty"),onMouseDown:Pe},Ye);function fe(ye){var re=pe[ye];if(!re)return null;var Z=re.data||{},J=Z.value,V=Z.label,Y=Z.children,q=Object(C.a)(Z,!0),te=ge?Y:V;return re?P.createElement("div",Object.assign({"aria-label":typeof te=="string"?te:null},q,{key:ye,role:"option",id:"".concat(ee,"_list_").concat(ye),"aria-selected":de.has(J)}),J):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},fe(oe-1),fe(oe),fe(oe+1)),P.createElement(a.a,{itemKey:"key",ref:Se,data:pe,height:ae,itemHeight:Le,fullHeight:!1,onMouseDown:Pe,onScroll:$,virtual:be,onMouseEnter:se},function(ye,re){var Z,J=ye.group,V=ye.groupOption,Y=ye.data,q=Y.label,te=Y.key;if(J)return P.createElement("div",{className:h()(ue,"".concat(ue,"-group"))},q!==void 0?q:te);var le=Y.disabled,ve=Y.value,Oe=Y.title,He=Y.children,ze=Y.style,Ne=Y.className,Je=Object(K.a)(Y,["disabled","value","title","children","style","className"]),Qe=de.has(ve),Ge="".concat(ue,"-option"),at=h()(ue,Ge,Ne,(Z={},Object(R.a)(Z,"".concat(Ge,"-grouped"),V),Object(R.a)(Z,"".concat(Ge,"-active"),oe===re&&!le),Object(R.a)(Z,"".concat(Ge,"-disabled"),le),Object(R.a)(Z,"".concat(Ge,"-selected"),Qe),Z)),nt=ge?He:q,rt=!We||typeof We=="function"||Qe;return P.createElement("div",Object.assign({},Je,{"aria-selected":Qe,className:at,title:Oe,onMouseMove:function(){if(oe===re||le)return;_e(re)},onClick:function(){le||we(ve)},style:ze}),P.createElement("div",{className:"".concat(Ge,"-content")},nt||ve),P.isValidElement(We)||Qe,rt&&P.createElement(i.a,{className:"".concat(ue,"-option-state"),customizeIcon:We,customizeIconProps:{isSelected:Qe}},Qe?"\u2713":null))}))},s=P.forwardRef(l);s.displayName="OptionList";var n=s,r=function(){return null};r.isSelectOption=!0;var t=r,b=function(){return null};b.isSelectOptGroup=!0;var v=b,m=B("VTBJ"),T=B("Zm9Q");function y(O){var j=O.key,G=O.props,X=G.children,ee=G.value,he=Object(K.a)(G,["children","value"]);return Object(m.a)({key:j,value:ee!==void 0?ee:j,children:X},he)}function f(O){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(T.a)(O).map(function(G,X){if(!P.isValidElement(G)||!G.type)return null;var ee=G.type.isSelectOptGroup,he=G.key,ge=G.props,de=ge.children,Te=Object(K.a)(ge,["children"]);return j||!ee?y(G):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(he===null?X:he,"__"),label:he},Te),{},{options:f(de)})}).filter(function(G){return G})}var u=B("2Qr1"),o=B("qNPg"),c=B("U8pU"),_=B("Kwbf"),p=B("WKfj");function d(O){var j=O.mode,G=O.options,X=O.children,ee=O.backfill,he=O.allowClear,ge=O.placeholder,de=O.getInputElement,Te=O.showSearch,xe=O.onSearch,ce=O.defaultOpen,ae=O.autoFocus,Le=O.labelInValue,Ye=O.value,Fe=O.inputValue,We=O.optionLabelProp,be=j==="multiple"||j==="tags",Ee=Te!==void 0?Te:be||j==="combobox",Ae=G||f(X);if(Object(_.a)(j!=="tags"||Ae.every(function(ue){return!ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),j==="tags"||j==="combobox"){var Ie=Ae.some(function(ue){return ue.options?ue.options.some(function(pe){return typeof("value"in pe?pe.value:pe.key)=="number"}):typeof("value"in ue?ue.value:ue.key)=="number"});Object(_.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)(j!=="combobox"||!We,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)(j==="combobox"||!ee,"`backfill` only works with `combobox` mode."),Object(_.a)(j==="combobox"||!de,"`getInputElement` only work with `combobox` mode."),Object(_.b)(j!=="combobox"||!de||!he||!ge,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),xe&&!Ee&&j!=="combobox"&&j!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!ce||ae,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ye!=null){var $=Object(p.d)(Ye);Object(_.a)(!Le||$.every(function(ue){return Object(c.a)(ue)==="object"&&("key"in ue||"value"in ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!be||Array.isArray(Ye),"`value` should be array when `mode` is `multiple` or `tags`")}if(X){var se=null;Object(T.a)(X).some(function(ue){if(!P.isValidElement(ue)||!ue.type)return!1;var pe=ue.type;if(pe.isSelectOption)return!1;if(pe.isSelectOptGroup){var Se=Object(T.a)(ue.props.children).every(function(Pe){return!P.isValidElement(Pe)||!ue.type||Pe.type.isSelectOption?!0:(se=Pe.type,!1)});return!Se}return se=pe,!0}),se&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(se.displayName||se.name||se,"`.")),Object(_.a)(Fe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var A=d,D=Object(o.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:f,flattenOptions:u.d,getLabeledValue:u.e,filterOptions:u.b,isValueDisabled:u.g,findValueOption:u.c,warningProps:A,fillOptionsWithMissingValue:u.a}),S=function(O){Object(I.a)(G,O);var j=Object(W.a)(G);function G(){var X;return Object(Q.a)(this,G),X=j.apply(this,arguments),X.selectRef=P.createRef(),X.focus=function(){X.selectRef.current.focus()},X.blur=function(){X.selectRef.current.blur()},X}return Object(H.a)(G,[{key:"render",value:function(){return P.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),G}(P.Component);S.Option=t,S.OptGroup=v;var L=S,M=ne.c=L},MI8n:function(Me,ne,B){"use strict";B.d(ne,"c",function(){return P}),B.d(ne,"b",function(){return e}),B.d(ne,"e",function(){return C}),B.d(ne,"a",function(){return E}),B.d(ne,"d",function(){return g}),B.d(ne,"f",function(){return h});var Q=B("/cxE"),H=B("pmY6"),I=B("24hK"),W=B("5Y4S"),P;(function(a){a.None=()=>H.a.None;function i(d){return(A,D=null,S)=>{let L=!1,M;return M=d(O=>L?void 0:(M?M.dispose():L=!0,A.call(D,O)),null,S),L&&M.dispose(),M}}a.once=i;function l(d,A){return v((D,S=null,L)=>d(M=>D.call(S,A(M)),null,L))}a.map=l;function s(d,A){return v((D,S=null,L)=>d(M=>{A(M),D.call(S,M)},null,L))}a.forEach=s;function n(d,A){return v((D,S=null,L)=>d(M=>A(M)&&D.call(S,M),null,L))}a.filter=n;function r(d){return d}a.signal=r;function t(...d){return(A,D=null,S)=>Object(H.e)(...d.map(L=>L(M=>A.call(D,M),null,S)))}a.any=t;function b(d,A,D){let S=D;return l(d,L=>(S=A(S,L),S))}a.reduce=b;function v(d){let A;const D=new e({onFirstListenerAdd(){A=d(D.fire,D)},onLastListenerRemove(){A.dispose()}});return D.event}function m(d,A,D=100,S=!1,L){let M,O,j,G=0;const X=new e({leakWarningThreshold:L,onFirstListenerAdd(){M=d(ee=>{G++,O=A(O,ee),S&&!j&&(X.fire(O),O=void 0),clearTimeout(j),j=setTimeout(()=>{const he=O;O=void 0,j=void 0,(!S||G>1)&&X.fire(he),G=0},D)})},onLastListenerRemove(){M.dispose()}});return X.event}a.debounce=m;function T(d,A=(D,S)=>D===S){let D=!0,S;return n(d,L=>{const M=D||!A(L,S);return D=!1,S=L,M})}a.latch=T;function y(d,A){return[a.filter(d,A),a.filter(d,D=>!A(D))]}a.split=y;function f(d,A=!1,D=[]){let S=D.slice(),L=d(j=>{S?S.push(j):O.fire(j)});const M=()=>{S&&S.forEach(j=>O.fire(j)),S=null},O=new e({onFirstListenerAdd(){L||(L=d(j=>O.fire(j)))},onFirstListenerDidAdd(){S&&(A?setTimeout(M):M())},onLastListenerRemove(){L&&L.dispose(),L=null}});return O.event}a.buffer=f;class u{constructor(d){this.event=d}map(d){return new u(l(this.event,d))}forEach(d){return new u(s(this.event,d))}filter(d){return new u(n(this.event,d))}reduce(d,A){return new u(b(this.event,d,A))}latch(){return new u(T(this.event))}debounce(d,A=100,D=!1,S){return new u(m(this.event,d,A,D,S))}on(d,A,D){return this.event(d,A,D)}once(d,A,D){return i(this.event)(d,A,D)}}function o(d){return new u(d)}a.chain=o;function c(d,A,D=S=>S){const S=(...j)=>O.fire(D(...j)),L=()=>d.on(A,S),M=()=>d.removeListener(A,S),O=new e({onFirstListenerAdd:L,onLastListenerRemove:M});return O.event}a.fromNodeEventEmitter=c;function _(d,A,D=S=>S){const S=(...j)=>O.fire(D(...j)),L=()=>d.addEventListener(A,S),M=()=>d.removeEventListener(A,S),O=new e({onFirstListenerAdd:L,onLastListenerRemove:M});return O.event}a.fromDOMEventEmitter=_;function p(d){return new Promise(A=>i(d)(A))}a.toPromise=p})(P||(P={}));class R{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${R._idPool++}`}start(a){this._stopWatch=new W.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}}}R._idPool=0;let K=-1;class N{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=K;if(typeof this.customThreshold=="number"&&(i=this.customThreshold),i<=0||a<i)return;this._stacks||(this._stacks=new Map);const l=new Error().stack.split(`
|
|
`).slice(3).join(`
|
|
`),s=this._stacks.get(l)||0;if(this._stacks.set(l,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let n,r=0;for(const[t,b]of this._stacks)(!n||r<b)&&(n=t,r=b);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${r}):`),console.warn(n)}return()=>{const n=this._stacks.get(l)||0;this._stacks.set(l,n-1)}}}class e{constructor(a){var i;this._disposed=!1,this._options=a,this._leakageMon=K>0?new N(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((i=this._options)===null||i===void 0?void 0:i._profName)?new R(this._options._profName):void 0}get event(){return this._event||(this._event=(a,i,l)=>{var s;this._listeners||(this._listeners=new I.a);const n=this._listeners.isEmpty();n&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(i?[a,i]:a);n&&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),b=Object(H.i)(()=>{if(t&&t(),!this._disposed&&(r(),this._options&&this._options.onLastListenerRemove)){const v=this._listeners&&!this._listeners.isEmpty();v||this._options.onLastListenerRemove(this)}});return l instanceof H.b?l.add(b):Array.isArray(l)&&l.push(b),b}),this._event}fire(a){var i,l;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new I.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,n]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,n):s[0].call(s[1],n)}catch(r){Object(Q.f)(r)}}(l=this._perfMon)===null||l===void 0||l.stop()}}dispose(){var a,i,l,s,n;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(i=this._deliveryQueue)===null||i===void 0||i.clear(),(s=(l=this._options)===null||l===void 0?void 0:l.onLastListenerRemove)===null||s===void 0||s.call(l),(n=this._leakageMon)===null||n===void 0||n.dispose())}}class C extends e{constructor(a){super(a);this._isPaused=0,this._eventQueue=new I.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 E extends C{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 g{constructor(){this.buffers=[]}wrapEvent(a){return(i,l,s)=>a(n=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>i.call(l,n)):i.call(l,n)},void 0,s)}bufferEvents(a){const i=[];this.buffers.push(i);const l=a();return this.buffers.pop(),i.forEach(s=>s()),l}}class h{constructor(){this.listening=!1,this.inputEvent=P.None,this.inputEventListener=H.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(Me,ne,B){"use strict";(function(Q,H){B.d(ne,"b",function(){return l}),B.d(ne,"i",function(){return t}),B.d(ne,"f",function(){return b}),B.d(ne,"d",function(){return v}),B.d(ne,"g",function(){return m}),B.d(ne,"h",function(){return T}),B.d(ne,"c",function(){return y}),B.d(ne,"k",function(){return f}),B.d(ne,"j",function(){return u}),B.d(ne,"a",function(){return o}),B.d(ne,"e",function(){return p});var I;const W="en";let P=!1,R=!1,K=!1,N=!1,e=!1,C=!1,E=!1,g,h=W,a,i;const l=typeof self=="object"?self:typeof Q=="object"?Q:{};let s;typeof l.vscode!="undefined"&&typeof l.vscode.process!="undefined"?s=l.vscode.process:typeof H!="undefined"&&(s=H);const n=typeof((I=s==null?void 0:s.versions)===null||I===void 0?void 0:I.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!n)i=navigator.userAgent,P=i.indexOf("Windows")>=0,R=i.indexOf("Macintosh")>=0,E=(i.indexOf("Macintosh")>=0||i.indexOf("iPad")>=0||i.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=i.indexOf("Linux")>=0,C=!0,g=navigator.language,h=g;else if(typeof s=="object"){P=s.platform==="win32",R=s.platform==="darwin",K=s.platform==="linux",N=K&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,g=W,h=W;const d=s.env.VSCODE_NLS_CONFIG;if(d)try{const A=JSON.parse(d),D=A.availableLanguages["*"];g=A.locale,h=D||W,a=A._translationsConfigFile}catch(A){}e=!0}else console.error("Unable to resolve platform.");let r=0;R?r=1:P?r=3:K&&(r=2);const t=P,b=R,v=K,m=e,T=C,y=E,f=i,u=function(){if(l.setImmediate)return l.setImmediate.bind(l);if(typeof l.postMessage=="function"&&!l.importScripts){let D=[];l.addEventListener("message",L=>{if(L.data&&L.data.vscodeSetImmediateId)for(let M=0,O=D.length;M<O;M++){const j=D[M];if(j.id===L.data.vscodeSetImmediateId){D.splice(M,1),j.callback();return}}});let S=0;return L=>{const M=++S;D.push({id:M,callback:L}),l.postMessage({vscodeSetImmediateId:M},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const A=Promise.resolve();return D=>A.then(D)}(),o=R||E?2:P?1:3;let c=!0,_=!1;function p(){if(!_){_=!0;const d=new Uint8Array(2);d[0]=1,d[1]=2;const A=new Uint16Array(d.buffer);c=A[0]===(2<<8)+1}return c}}).call(this,B("IyRk"),B("Q2Ig"))},N0LK:function(Me,ne,B){"use strict";B.d(ne,"C",function(){return Q}),B.d(ne,"v",function(){return I}),B.d(ne,"s",function(){return W}),B.d(ne,"t",function(){return P}),B.d(ne,"U",function(){return R}),B.d(ne,"J",function(){return K}),B.d(ne,"O",function(){return N}),B.d(ne,"p",function(){return e}),B.d(ne,"T",function(){return C}),B.d(ne,"q",function(){return E}),B.d(ne,"N",function(){return g}),B.d(ne,"M",function(){return h}),B.d(ne,"Q",function(){return a}),B.d(ne,"u",function(){return i}),B.d(ne,"x",function(){return l}),B.d(ne,"I",function(){return s}),B.d(ne,"f",function(){return n}),B.d(ne,"h",function(){return r}),B.d(ne,"g",function(){return t}),B.d(ne,"i",function(){return b}),B.d(ne,"G",function(){return v}),B.d(ne,"H",function(){return m}),B.d(ne,"r",function(){return T}),B.d(ne,"R",function(){return y}),B.d(ne,"d",function(){return f}),B.d(ne,"e",function(){return u}),B.d(ne,"E",function(){return o}),B.d(ne,"F",function(){return c}),B.d(ne,"j",function(){return _}),B.d(ne,"z",function(){return p}),B.d(ne,"K",function(){return A}),B.d(ne,"L",function(){return D}),B.d(ne,"m",function(){return L}),B.d(ne,"k",function(){return O}),B.d(ne,"A",function(){return G}),B.d(ne,"a",function(){return X}),B.d(ne,"n",function(){return ee}),B.d(ne,"l",function(){return he}),B.d(ne,"D",function(){return ge}),B.d(ne,"B",function(){return de}),B.d(ne,"b",function(){return Te}),B.d(ne,"S",function(){return xe}),B.d(ne,"o",function(){return ce}),B.d(ne,"P",function(){return ae}),B.d(ne,"w",function(){return Le}),B.d(ne,"c",function(){return Ye}),B.d(ne,"y",function(){return be});function Q($){return!$||typeof $!="string"?!0:$.trim().length===0}const H=/{(\d+)}/g;function I($,...se){return se.length===0?$:$.replace(H,function(ue,pe){const Se=parseInt(pe,10);return isNaN(Se)||Se<0||Se>=se.length?ue:se[Se]})}function W($){return $.replace(/[<>&]/g,function(se){switch(se){case"<":return"<";case">":return">";case"&":return"&";default:return se}})}function P($){return $.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function R($,se=" "){const ue=K($,se);return N(ue,se)}function K($,se){if(!$||!se)return $;const ue=se.length;if(ue===0||$.length===0)return $;let pe=0;for(;$.indexOf(se,pe)===pe;)pe=pe+ue;return $.substring(pe)}function N($,se){if(!$||!se)return $;const ue=se.length,pe=$.length;if(ue===0||pe===0)return $;let Se=pe,Pe=-1;for(;!(Pe=$.lastIndexOf(se,Se-1),Pe===-1||Pe+ue!==Se);){if(Pe===0)return"";Se=Pe}return $.substring(0,Se)}function e($){return $.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function C($){return $.replace(/\*/g,"")}function E($,se,ue={}){if(!$)throw new Error("Cannot create regex from empty string");se||($=P($)),ue.wholeWord&&(/\B/.test($.charAt(0))||($="\\b"+$),/\B/.test($.charAt($.length-1))||($=$+"\\b"));let pe="";return ue.global&&(pe+="g"),ue.matchCase||(pe+="i"),ue.multiline&&(pe+="m"),ue.unicode&&(pe+="u"),new RegExp($,pe)}function g($){if($.source==="^"||$.source==="^$"||$.source==="$"||$.source==="^\\s*$")return!1;const se=$.exec("");return!!(se&&$.lastIndex===0)}function h($){return($.global?"g":"")+($.ignoreCase?"i":"")+($.multiline?"m":"")+($.unicode?"u":"")}function a($){return $.split(/\r\n|\r|\n/)}function i($){for(let se=0,ue=$.length;se<ue;se++){const pe=$.charCodeAt(se);if(pe!==32&&pe!==9)return se}return-1}function l($,se=0,ue=$.length){for(let pe=se;pe<ue;pe++){const Se=$.charCodeAt(pe);if(Se!==32&&Se!==9)return $.substring(se,pe)}return $.substring(se,ue)}function s($,se=$.length-1){for(let ue=se;ue>=0;ue--){const pe=$.charCodeAt(ue);if(pe!==32&&pe!==9)return ue}return-1}function n($,se){return $<se?-1:$>se?1:0}function r($,se,ue=0,pe=$.length,Se=0,Pe=se.length){for(;ue<pe&&Se<Pe;ue++,Se++){let Be=$.charCodeAt(ue),Ke=se.charCodeAt(Se);if(Be<Ke)return-1;if(Be>Ke)return 1}const De=pe-ue,ke=Pe-Se;return De<ke?-1:De>ke?1:0}function t($,se){return b($,se,0,$.length,0,se.length)}function b($,se,ue=0,pe=$.length,Se=0,Pe=se.length){for(;ue<pe&&Se<Pe;ue++,Se++){let Be=$.charCodeAt(ue),Ke=se.charCodeAt(Se);if(Be===Ke)continue;if(Be>=128||Ke>=128)return r($.toLowerCase(),se.toLowerCase(),ue,pe,Se,Pe);v(Be)&&(Be-=32),v(Ke)&&(Ke-=32);const oe=Be-Ke;if(oe===0)continue;return oe}const De=pe-ue,ke=Pe-Se;return De<ke?-1:De>ke?1:0}function v($){return $>=97&&$<=122}function m($){return $>=65&&$<=90}function T($,se){return $.length===se.length&&b($,se)===0}function y($,se){const ue=se.length;return se.length>$.length?!1:b($,se,0,ue)===0}function f($,se){let ue,pe=Math.min($.length,se.length);for(ue=0;ue<pe;ue++)if($.charCodeAt(ue)!==se.charCodeAt(ue))return ue;return pe}function u($,se){let ue,pe=Math.min($.length,se.length);const Se=$.length-1,Pe=se.length-1;for(ue=0;ue<pe;ue++)if($.charCodeAt(Se-ue)!==se.charCodeAt(Pe-ue))return ue;return pe}function o($){return 55296<=$&&$<=56319}function c($){return 56320<=$&&$<=57343}function _($,se){return($-55296<<10)+(se-56320)+65536}function p($,se,ue){const pe=$.charCodeAt(ue);if(o(pe)&&ue+1<se){const Se=$.charCodeAt(ue+1);if(c(Se))return _(pe,Se)}return pe}function d($,se){const ue=$.charCodeAt(se-1);if(c(ue)&&se>1){const pe=$.charCodeAt(se-2);if(o(pe))return _(pe,ue)}return ue}function A($,se){const ue=Fe.getInstance(),pe=se,Se=$.length,Pe=p($,Se,se);se+=Pe>=65536?2:1;let De=ue.getGraphemeBreakType(Pe);for(;se<Se;){const ke=p($,Se,se),Be=ue.getGraphemeBreakType(ke);if(Ye(De,Be))break;se+=ke>=65536?2:1,De=Be}return se-pe}function D($,se){const ue=Fe.getInstance(),pe=se,Se=d($,se);se-=Se>=65536?2:1;let Pe=ue.getGraphemeBreakType(Se);for(;se>0;){const De=d($,se),ke=ue.getGraphemeBreakType(De);if(Ye(ke,Pe))break;se-=De>=65536?2:1,Pe=ke}return pe-se}const S=/(?:[\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 L($){return S.test($)}const M=/(?:[\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 O($){return M.test($)}const j=/^[\t\n\r\x20-\x7E]*$/;function G($){return j.test($)}const X=/[\u2028\u2029]/;function ee($){return X.test($)}function he($){for(let se=0,ue=$.length;se<ue;se++)if(ge($.charCodeAt(se)))return!0;return!1}function ge($){return $=+$,$>=11904&&$<=55215||$>=63744&&$<=64255||$>=65281&&$<=65374}function de($){return $>=127462&&$<=127487||$===8986||$===8987||$===9200||$===9203||$>=9728&&$<=10175||$===11088||$===11093||$>=127744&&$<=128591||$>=128640&&$<=128764||$>=128992&&$<=129003||$>=129280&&$<=129535||$>=129648&&$<=129750}const Te=String.fromCharCode(65279);function xe($){return!!($&&$.length>0&&$.charCodeAt(0)===65279)}function ce($,se=!1){return $?(se&&($=$.replace(/\\./g,"")),$.toLowerCase()!==$):!1}function ae($){const se=90-65+1;return $=$%(2*se),$<se?String.fromCharCode(97+$):String.fromCharCode(65+$-se)}function Le($){const se=Fe.getInstance();return se.getGraphemeBreakType($)}function Ye($,se){return $===0?se!==5&&se!==7:$===2&&se===3?!1:$===4||$===2||$===3||(se===4||se===2||se===3)?!0:$===8&&(se===8||se===9||se===11||se===12)||(($===11||$===9)&&(se===9||se===10)||(($===12||$===10)&&se===10||(se===5||se===13||(se===7||($===1||$===13&&se===14)))))?!1:!($===6&&se===6)}class Fe{constructor(){this._data=We()}static getInstance(){return Fe._INSTANCE||(Fe._INSTANCE=new Fe),Fe._INSTANCE}getGraphemeBreakType($){if($<32)return $===10?3:$===13?2:4;if($<127)return 0;const se=this._data,ue=se.length/3;let pe=1;for(;pe<=ue;)if($<se[3*pe])pe=2*pe;else if($>se[3*pe+1])pe=2*pe+1;else return se[3*pe+2];return 0}}Fe._INSTANCE=null;function We(){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 be($,se){if($===0)return 0;const ue=Ee($,se);if(ue!==void 0)return ue;const pe=d(se,$);return $-=Ae(pe),$}function Ee($,se){let ue=d(se,$);for($-=Ae(ue);Ie(ue)||ue===65039||ue===8419;){if($===0)return;ue=d(se,$),$-=Ae(ue)}if(!de(ue))return;if($>=0){const pe=d(se,$);pe===8205&&($-=Ae(pe))}return $}function Ae($){return $>=65536?2:1}function Ie($){return 127995<=$&&$<=127999}},NvD2:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return R});var Q=B("Kwbf");function H(K,N){var e=new Set;return K.forEach(function(C){N.has(C)||e.add(C)}),e}function I(K){var N=K||{},e=N.disabled,C=N.disableCheckbox,E=N.checkable;return!!(e||C)||E===!1}function W(K,N,e,C){for(var E=new Set(K),g=new Set,h=0;h<=e;h+=1){var a=N.get(h)||new Set;a.forEach(function(n){var r=n.key,t=n.node,b=n.children,v=b===void 0?[]:b;E.has(r)&&!C(t)&&v.filter(function(m){return!C(m.node)}).forEach(function(m){E.add(m.key)})})}for(var i=new Set,l=e;l>=0;l-=1){var s=N.get(l)||new Set;s.forEach(function(n){var r=n.parent,t=n.node;if(C(t)||!n.parent||i.has(n.parent.key))return;if(C(n.parent.node)){i.add(r.key);return}var b=!0,v=!1;(r.children||[]).filter(function(m){return!C(m.node)}).forEach(function(m){var T=m.key,y=E.has(T);b&&!y&&(b=!1),!v&&(y||g.has(T))&&(v=!0)}),b&&E.add(r.key),v&&g.add(r.key),i.add(r.key)})}return{checkedKeys:Array.from(E),halfCheckedKeys:Array.from(H(g,E))}}function P(K,N,e,C,E){for(var g=new Set(K),h=new Set(N),a=0;a<=C;a+=1){var i=e.get(a)||new Set;i.forEach(function(r){var t=r.key,b=r.node,v=r.children,m=v===void 0?[]:v;!g.has(t)&&!h.has(t)&&!E(b)&&m.filter(function(T){return!E(T.node)}).forEach(function(T){g.delete(T.key)})})}h=new Set;for(var l=new Set,s=C;s>=0;s-=1){var n=e.get(s)||new Set;n.forEach(function(r){var t=r.parent,b=r.node;if(E(b)||!r.parent||l.has(r.parent.key))return;if(E(r.parent.node)){l.add(t.key);return}var v=!0,m=!1;(t.children||[]).filter(function(T){return!E(T.node)}).forEach(function(T){var y=T.key,f=g.has(y);v&&!f&&(v=!1),!m&&(f||h.has(y))&&(m=!0)}),v||g.delete(t.key),m&&h.add(t.key),l.add(t.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(H(h,g))}}function R(K,N,e,C){var E=[],g;C?g=C:g=I;var h=new Set(K.filter(function(s){var n=!!e[s];return n||E.push(s),n})),a=new Map,i=0;Object.keys(e).forEach(function(s){var n=e[s],r=n.level,t=a.get(r);t||(t=new Set,a.set(r,t)),t.add(n),i=Math.max(i,r)}),Object(Q.a)(!E.length,"Tree missing follow keys: ".concat(E.slice(0,100).map(function(s){return"'".concat(s,"'")}).join(", ")));var l;return N===!0?l=W(h,a,i,g):l=P(h,N.halfCheckedKeys,a,i,g),l}},OZM5:function(Me,ne,B){"use strict";B.d(ne,"b",function(){return C}),B.d(ne,"a",function(){return E}),B.d(ne,"k",function(){return g}),B.d(ne,"h",function(){return h}),B.d(ne,"i",function(){return a}),B.d(ne,"g",function(){return i}),B.d(ne,"c",function(){return l}),B.d(ne,"d",function(){return s}),B.d(ne,"j",function(){return t}),B.d(ne,"e",function(){return b}),B.d(ne,"f",function(){return v});var Q=B("KQm4"),H=B("U8pU"),I=B("Ff2n"),W=B("q1tI"),P=B.n(W),R=B("Kwbf"),K=B("WaYH"),N=.25,e=2;function C(m,T){var y=m.slice(),f=y.indexOf(T);return f>=0&&y.splice(f,1),y}function E(m,T){var y=m.slice();return y.indexOf(T)===-1&&y.push(T),y}function g(m){return m.split("-")}function h(m,T){return"".concat(m,"-").concat(T)}function a(m){return m&&m.type&&m.type.isTreeNode}function i(m,T){var y=[m],f=T[m];function u(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];o.forEach(function(c){var _=c.key,p=c.children;y.push(_),u(p)})}return u(f.children),y}function l(m,T){var y=m.clientY,f=T.selectHandle.getBoundingClientRect(),u=f.top,o=f.bottom,c=f.height,_=Math.max(c*N,e);return y<=u+_?-1:y>=o-_?1:0}function s(m,T){if(!m)return;var y=T.multiple;return y?m.slice():m.length?[m[0]]:m}var n=function(T){return T};function r(m,T){if(!m)return[];var y=T||{},f=y.processProps,u=f===void 0?n:f,o=Array.isArray(m)?m:[m];return o.map(function(c){var _=c.children,p=Object(I.a)(c,["children"]),d=r(_,T);return P.a.createElement(K.a,Object.assign({},u(p)),d)})}function t(m){if(!m)return null;var T;if(Array.isArray(m))T={checkedKeys:m,halfCheckedKeys:void 0};else if(Object(H.a)(m)==="object")T={checkedKeys:m.checked||void 0,halfCheckedKeys:m.halfChecked||void 0};else return Object(R.a)(!1,"`checkedKeys` is not an array or an object"),null;return T}function b(m,T){var y=new Set;function f(u){if(y.has(u))return;var o=T[u];if(!o)return;y.add(u);var c=o.parent,_=o.node;if(_.disabled)return;c&&f(c.key)}return(m||[]).forEach(function(u){f(u)}),Object(Q.a)(y)}function v(m){var T={};return Object.keys(m).forEach(function(y){(y.startsWith("data-")||y.startsWith("aria-"))&&(T[y]=m[y])}),T}},"SA+Z":function(Me,ne,B){var Q=B("wTVA"),H=B("EbDI"),I=B("ZhPi"),W=B("wkBT");function P(R){return Q(R)||H(R)||I(R)||W()}Me.exports=P,Me.exports.__esModule=!0,Me.exports.default=Me.exports},SJMd:function(Me,ne){/**
|
|
* @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 B,Q,H,I=!1,W,P;window.PR_SHOULD_USE_CONTINUATION=!0;var R,K;(function(){var N=window,e=["break,continue,do,else,for,if,return,while"],C=[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"],E=[C,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[E,"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"],h=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[E,"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",l=[E,"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",n=[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"],r=[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"],b=[g,a,h,l,s,n,r,t],v=/^(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",T="kwd",y="com",f="typ",u="lit",o="pun",c="pln",_="tag",p="dec",d="src",A="atn",D="atv",S="nocode",L="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function M(Ee){for(var Ae=0,Ie=!1,$=!1,se=0,ue=Ee.length;se<ue;++se){var pe=Ee[se];if(pe.ignoreCase)$=!0;else if(/[a-z]/i.test(pe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ie=!0,$=!1;break}}var Se={b:8,t:9,n:10,v:11,f:12,r:13};function Pe(oe){var me=oe.charCodeAt(0);if(me!==92)return me;var _e=oe.charAt(1);return me=Se[_e],me||("0"<=_e&&_e<="7"?parseInt(oe.substring(1),8):_e==="u"||_e==="x"?parseInt(oe.substring(2),16):oe.charCodeAt(1))}function De(oe){if(oe<32)return(oe<16?"\\x0":"\\x")+oe.toString(16);var me=String.fromCharCode(oe);return me==="\\"||me==="-"||me==="]"||me==="^"?"\\"+me:me}function ke(oe){var me=oe.substring(1,oe.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")),_e=[],we=me[0]==="^",fe=["["];we&&fe.push("^");for(var ye=we?1:0,re=me.length;ye<re;++ye){var Z=me[ye];if(/\\[bdsw]/i.test(Z))fe.push(Z);else{var J=Pe(Z),V;ye+2<re&&me[ye+1]==="-"?(V=Pe(me[ye+2]),ye+=2):V=J,_e.push([J,V]),V<65||J>122||(V<65||J>90||_e.push([Math.max(65,J)|32,Math.min(V,90)|32]),V<97||J>122||_e.push([Math.max(97,J)&~32,Math.min(V,122)&~32]))}}_e.sort(function(le,ve){return le[0]-ve[0]||ve[1]-le[1]});for(var Y=[],q=[],ye=0;ye<_e.length;++ye){var te=_e[ye];te[0]<=q[1]+1?q[1]=Math.max(q[1],te[1]):Y.push(q=te)}for(var ye=0;ye<Y.length;++ye){var te=Y[ye];fe.push(De(te[0])),te[1]>te[0]&&(te[1]+1>te[0]&&fe.push("-"),fe.push(De(te[1])))}return fe.push("]"),fe.join("")}function Be(oe){for(var me=oe.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")),_e=me.length,we=[],fe=0,ye=0;fe<_e;++fe){var re=me[fe];if(re==="(")++ye;else if(re.charAt(0)==="\\"){var Z=+re.substring(1);Z&&(Z<=ye?we[Z]=-1:me[fe]=De(Z))}}for(var fe=1;fe<we.length;++fe)we[fe]===-1&&(we[fe]=++Ae);for(var fe=0,ye=0;fe<_e;++fe){var re=me[fe];if(re==="(")++ye,we[ye]||(me[fe]="(?:");else if(re.charAt(0)==="\\"){var Z=+re.substring(1);Z&&Z<=ye&&(me[fe]="\\"+we[Z])}}for(var fe=0;fe<_e;++fe)me[fe]==="^"&&me[fe+1]!=="^"&&(me[fe]="");if(oe.ignoreCase&&Ie)for(var fe=0;fe<_e;++fe){var re=me[fe],J=re.charAt(0);re.length>=2&&J==="["?me[fe]=ke(re):J!=="\\"&&(me[fe]=re.replace(/[a-zA-Z]/g,function(q){var te=q.charCodeAt(0);return"["+String.fromCharCode(te&~32,te|32)+"]"}))}return me.join("")}for(var Ke=[],se=0,ue=Ee.length;se<ue;++se){var pe=Ee[se];if(pe.global||pe.multiline)throw new Error(""+pe);Ke.push("(?:"+Be(pe)+")")}return new RegExp(Ke.join("|"),$?"gi":"g")}function O(Ee,Ae){var Ie=/(?:^|\s)nocode(?:\s|$)/,$=[],se=0,ue=[],pe=0;function Se(Pe){var De=Pe.nodeType;if(De==1){if(Ie.test(Pe.className))return;for(var ke=Pe.firstChild;ke;ke=ke.nextSibling)Se(ke);var Be=Pe.nodeName.toLowerCase();(Be==="br"||Be==="li")&&($[pe]=`
|
|
`,ue[pe<<1]=se++,ue[pe++<<1|1]=Pe)}else if(De==3||De==4){var Ke=Pe.nodeValue;Ke.length&&(Ae?Ke=Ke.replace(/\r\n?/g,`
|
|
`):Ke=Ke.replace(/[ \t\r\n]+/g," "),$[pe]=Ke,ue[pe<<1]=se,se+=Ke.length,ue[pe++<<1|1]=Pe)}}return Se(Ee),{sourceCode:$.join("").replace(/\n$/,""),spans:ue}}function j(Ee,Ae,Ie,$,se){if(!Ie)return;var ue={sourceNode:Ee,pre:1,langExtension:null,numberLines:null,sourceCode:Ie,spans:null,basePos:Ae,decorations:null};$(ue),se.push.apply(se,ue.decorations)}var G=/\S/;function X(Ee){for(var Ae=void 0,Ie=Ee.firstChild;Ie;Ie=Ie.nextSibling){var $=Ie.nodeType;Ae=$===1?Ae?Ee:Ie:$===3&&G.test(Ie.nodeValue)?Ee:Ae}return Ae===Ee?void 0:Ae}function ee(Ee,Ae){var Ie={},$;(function(){for(var pe=Ee.concat(Ae),Se=[],Pe={},De=0,ke=pe.length;De<ke;++De){var Be=pe[De],Ke=Be[3];if(Ke)for(var oe=Ke.length;--oe>=0;)Ie[Ke.charAt(oe)]=Be;var me=Be[1],_e=""+me;Pe.hasOwnProperty(_e)||(Se.push(me),Pe[_e]=null)}Se.push(/[\0-\uffff]/),$=M(Se)})();var se=Ae.length,ue=function(pe){for(var Se=pe.sourceCode,Pe=pe.basePos,De=pe.sourceNode,ke=[Pe,c],Be=0,Ke=Se.match($)||[],oe={},me=0,_e=Ke.length;me<_e;++me){var we=Ke[me],fe=oe[we],ye=void 0,re;if(typeof fe=="string")re=!1;else{var Z=Ie[we.charAt(0)];if(Z)ye=we.match(Z[1]),fe=Z[0];else{for(var J=0;J<se;++J)if(Z=Ae[J],ye=we.match(Z[1]),ye){fe=Z[0];break}ye||(fe=c)}re=fe.length>=5&&fe.substring(0,5)==="lang-",re&&!(ye&&typeof ye[1]=="string")&&(re=!1,fe=d),re||(oe[we]=fe)}var V=Be;if(Be+=we.length,!re)ke.push(Pe+V,fe);else{var Y=ye[1],q=we.indexOf(Y),te=q+Y.length;ye[2]&&(te=we.length-ye[2].length,q=te-Y.length);var le=fe.substring(5);j(De,Pe+V,we.substring(0,q),ue,ke),j(De,Pe+V+q,Y,ae(le,Y),ke),j(De,Pe+V+te,we.substring(te),ue,ke)}}pe.decorations=ke};return ue}function he(Ee){var Ae=[],Ie=[];Ee.tripleQuotedStrings?Ae.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ee.multiLineStrings?Ae.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ae.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ee.verbatimStrings&&Ie.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var $=Ee.hashComments;$&&(Ee.cStyleComments?($>1?Ae.push([y,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ae.push([y,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ae.push([y,/^#[^\r\n]*/,null,"#"])),Ee.cStyleComments&&(Ie.push([y,/^\/\/[^\r\n]*/,null]),Ie.push([y,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var se=Ee.regexLiterals;if(se){var ue=se>1?"":`
|
|
\r`,pe=ue?".":"[\\S\\s]",Se="/(?=[^/*"+ue+"])(?:[^/\\x5B\\x5C"+ue+"]|\\x5C"+pe+"|\\x5B(?:[^\\x5C\\x5D"+ue+"]|\\x5C"+pe+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+L+"("+Se+")")])}var Pe=Ee.types;Pe&&Ie.push([f,Pe]);var De=(""+Ee.keywords).replace(/^ | $/g,"");De.length&&Ie.push([T,new RegExp("^(?:"+De.replace(/[\s,]+/g,"|")+")\\b"),null]),Ae.push([c,/^\s+/,null,` \r
|
|
\xA0`]);var ke="^.[^\\s\\w.$@'\"`/\\\\]*";return Ee.regexLiterals&&(ke+="(?!s*/)"),Ie.push([u,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[u,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[o,new RegExp(ke),null]),ee(Ae,Ie)}var ge=he({keywords:b,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function de(Ee,Ae,Ie){for(var $=/(?:^|\s)nocode(?:\s|$)/,se=/\r\n?|\n/,ue=Ee.ownerDocument,pe=ue.createElement("li");Ee.firstChild;)pe.appendChild(Ee.firstChild);var Se=[pe];function Pe(me){var _e=me.nodeType;if(_e==1&&!$.test(me.className))if(me.nodeName==="br")De(me),me.parentNode&&me.parentNode.removeChild(me);else for(var we=me.firstChild;we;we=we.nextSibling)Pe(we);else if((_e==3||_e==4)&&Ie){var fe=me.nodeValue,ye=fe.match(se);if(ye){var re=fe.substring(0,ye.index);me.nodeValue=re;var Z=fe.substring(ye.index+ye[0].length);if(Z){var J=me.parentNode;J.insertBefore(ue.createTextNode(Z),me.nextSibling)}De(me),re||me.parentNode.removeChild(me)}}}function De(me){for(;!me.nextSibling;)if(me=me.parentNode,!me)return;function _e(ye,re){var Z=re?ye.cloneNode(!1):ye,J=ye.parentNode;if(J){var V=_e(J,1),Y=ye.nextSibling;V.appendChild(Z);for(var q=Y;q;q=Y)Y=q.nextSibling,V.appendChild(q)}return Z}for(var we=_e(me.nextSibling,0),fe;(fe=we.parentNode)&&fe.nodeType===1;)we=fe;Se.push(we)}for(var ke=0;ke<Se.length;++ke)Pe(Se[ke]);Ae===(Ae|0)&&Se[0].setAttribute("value",Ae);var Be=ue.createElement("ol");Be.className="linenums";for(var Ke=Math.max(0,Ae-1|0)||0,ke=0,oe=Se.length;ke<oe;++ke)pe=Se[ke],pe.className="L"+(ke+Ke)%10,pe.firstChild||pe.appendChild(ue.createTextNode("\xA0")),Be.appendChild(pe);Ee.appendChild(Be)}function Te(Ee){var Ae=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ae=Ae&&+Ae[1]<=8;var Ie=/\n/g,$=Ee.sourceCode,se=$.length,ue=0,pe=Ee.spans,Se=pe.length,Pe=0,De=Ee.decorations,ke=De.length,Be=0;De[ke]=se;var Ke,oe;for(oe=Ke=0;oe<ke;)De[oe]!==De[oe+2]?(De[Ke++]=De[oe++],De[Ke++]=De[oe++]):oe+=2;for(ke=Ke,oe=Ke=0;oe<ke;){for(var me=De[oe],_e=De[oe+1],we=oe+2;we+2<=ke&&De[we+1]===_e;)we+=2;De[Ke++]=me,De[Ke++]=_e,oe=we}ke=De.length=Ke;var fe=Ee.sourceNode,ye="";fe&&(ye=fe.style.display,fe.style.display="none");try{for(var re=null;Pe<Se;){var Z=pe[Pe],J=pe[Pe+2]||se,V=De[Be+2]||se,we=Math.min(J,V),Y=pe[Pe+1],q;if(Y.nodeType!==1&&(q=$.substring(ue,we))){Ae&&(q=q.replace(Ie,"\r")),Y.nodeValue=q;var te=Y.ownerDocument,le=te.createElement("span");le.className=De[Be+1];var ve=Y.parentNode;ve.replaceChild(le,Y),le.appendChild(Y),ue<J&&(pe[Pe+1]=Y=te.createTextNode($.substring(we,J)),ve.insertBefore(Y,le.nextSibling))}ue=we,ue>=J&&(Pe+=2),ue>=V&&(Be+=2)}}finally{fe&&(fe.style.display=ye)}}var xe={};function ce(Ee,Ae){for(var Ie=Ae.length;--Ie>=0;){var $=Ae[Ie];xe.hasOwnProperty($)?N.console&&console.warn("cannot override language handler %s",$):xe[$]=Ee}}function ae(Ee,Ae){return Ee&&xe.hasOwnProperty(Ee)||(Ee=/^\s*</.test(Ae)?"default-markup":"default-code"),xe[Ee]}ce(ge,["default-code"]),ce(ee([],[[c,/^[^<?]+/],[p,/^<!\w[^>]*(?:>|$)/],[y,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[o,/^(?:<[%?]|[%?]>)/],["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"]),ce(ee([[c,/^[\s]+/,null,` \r
|
|
`],[D,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[A,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[o,/^[=<>\/]+/],["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"]),ce(ee([],[[D,/^[\s\S]+/]]),["uq.val"]),ce(he({keywords:g,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),ce(he({keywords:"null,true,false"}),["json"]),ce(he({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),ce(he({keywords:h,cStyleComments:!0}),["java"]),ce(he({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ce(he({keywords:n,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ce(he({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ce(he({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ce(he({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ce(he({keywords:i,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ce(ee([],[[m,/^[\s\S]+/]]),["regex"]);function Le(Ee){var Ae=Ee.langExtension;try{var Ie=O(Ee.sourceNode,Ee.pre),$=Ie.sourceCode;Ee.sourceCode=$,Ee.spans=Ie.spans,Ee.basePos=0,ae(Ae,$)(Ee),Te(Ee)}catch(se){N.console&&console.log(se&&se.stack||se)}}function Ye(Ee,Ae,Ie){var $=Ie||!1,se=Ae||null,ue=document.createElement("div");ue.innerHTML="<pre>"+Ee+"</pre>",ue=ue.firstChild,$&&de(ue,$,!0);var pe={langExtension:se,numberLines:$,sourceNode:ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Le(pe),ue.innerHTML}function Fe(Ee,Ae){var Ie=Ae||document.body,$=Ie.ownerDocument||document;function se(Z){return Ie.getElementsByTagName(Z)}for(var ue=[se("pre"),se("code"),se("xmp")],pe=[],Se=0;Se<ue.length;++Se)for(var Pe=0,De=ue[Se].length;Pe<De;++Pe)pe.push(ue[Se][Pe]);ue=null;var ke=Date;ke.now||(ke={now:function(){return+new Date}});var Be=0,Ke=/\blang(?:uage)?-([\w.]+)(?!\S)/,oe=/\bprettyprint\b/,me=/\bprettyprinted\b/,_e=/pre|xmp/i,we=/^code$/i,fe=/^(?:pre|code|xmp)$/i,ye={};function re(){for(var Z=N.PR_SHOULD_USE_CONTINUATION?ke.now()+250:Infinity;Be<pe.length&&ke.now()<Z;Be++){for(var J=pe[Be],V=ye,Y=J;Y=Y.previousSibling;){var q=Y.nodeType,te=(q===7||q===8)&&Y.nodeValue;if(te?!/^\??prettify\b/.test(te):q!==3||/\S/.test(Y.nodeValue))break;if(te){V={},te.replace(/\b(\w+)=([\w:.%+-]+)/g,function(dt,et,st){V[et]=st});break}}var le=J.className;if((V!==ye||oe.test(le))&&!me.test(le)){for(var ve=!1,Oe=J.parentNode;Oe;Oe=Oe.parentNode){var He=Oe.tagName;if(fe.test(He)&&Oe.className&&oe.test(Oe.className)){ve=!0;break}}if(!ve){J.className+=" prettyprinted";var ze=V.lang;if(!ze){ze=le.match(Ke);var Ne;!ze&&(Ne=X(J))&&we.test(Ne.tagName)&&(ze=Ne.className.match(Ke)),ze&&(ze=ze[1])}var Je;if(_e.test(J.tagName))Je=1;else{var Qe=J.currentStyle,Ge=$.defaultView,at=Qe?Qe.whiteSpace:Ge&&Ge.getComputedStyle?Ge.getComputedStyle(J,null).getPropertyValue("white-space"):0;Je=at&&at.substring(0,3)==="pre"}var nt=V.linenums;(nt=nt==="true"||+nt)||(nt=le.match(/\blinenums\b(?::(\d+))?/),nt=nt?nt[1]&&nt[1].length?+nt[1]:!0:!1),nt&&de(J,nt,Je);var rt={langExtension:ze,sourceNode:J,numberLines:nt,pre:Je,sourceCode:null,basePos:null,spans:null,decorations:null};Le(rt)}}}Be<pe.length?N.setTimeout(re,250):typeof Ee=="function"&&Ee()}re()}var We=N.PR={createSimpleLexer:ee,registerLangHandler:ce,sourceDecorator:he,PR_ATTRIB_NAME:A,PR_ATTRIB_VALUE:D,PR_COMMENT:y,PR_DECLARATION:p,PR_KEYWORD:T,PR_LITERAL:u,PR_NOCODE:S,PR_PLAIN:c,PR_PUNCTUATION:o,PR_SOURCE:d,PR_STRING:m,PR_TAG:_,PR_TYPE:f,prettyPrintOne:I?N.prettyPrintOne=Ye:R=Ye,prettyPrint:K=I?N.prettyPrint=Fe:K=Fe},be=N.define;typeof be=="function"&&be.amd&&be("google-code-prettify",[],function(){return We})})()},T8No:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return K}),B.d(ne,"e",function(){return N}),B.d(ne,"c",function(){return o}),B.d(ne,"b",function(){return c}),B.d(ne,"d",function(){return _}),B.d(ne,"f",function(){return A});var Q=B("MNsG"),H=B("N0LK"),I=B("Cg/j");let W=Q.k||"";const P=new Map;P.set("false",!1),P.set("true",!0),P.set("isMac",Q.f),P.set("isLinux",Q.d),P.set("isWindows",Q.i),P.set("isWeb",Q.h),P.set("isMacNative",Q.f&&!Q.h),P.set("isEdge",W.indexOf("Edg/")>=0),P.set("isFirefox",W.indexOf("Firefox")>=0),P.set("isChrome",W.indexOf("Chrome")>=0),P.set("isSafari",W.indexOf("Safari")>=0);const R=Object.prototype.hasOwnProperty;class K{static has(S){return g.create(S)}static equals(S,L){return h.create(S,L)}static regex(S,L){return m.create(S,L)}static not(S){return s.create(S)}static and(...S){return f.create(S,null)}static or(...S){return u.create(S,null,!0)}static deserialize(S,L=!1){return S?this._deserializeOrExpression(S,L):void 0}static _deserializeOrExpression(S,L){let M=S.split("||");return u.create(M.map(O=>this._deserializeAndExpression(O,L)),null,!0)}static _deserializeAndExpression(S,L){let M=S.split("&&");return f.create(M.map(O=>this._deserializeOne(O,L)),null)}static _deserializeOne(S,L){if(S=S.trim(),S.indexOf("!=")>=0){let M=S.split("!=");return l.create(M[0].trim(),this._deserializeValue(M[1],L))}if(S.indexOf("==")>=0){let M=S.split("==");return h.create(M[0].trim(),this._deserializeValue(M[1],L))}if(S.indexOf("=~")>=0){let M=S.split("=~");return m.create(M[0].trim(),this._deserializeRegexValue(M[1],L))}if(S.indexOf(" in ")>=0){let M=S.split(" in ");return a.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(S)){const M=S.split(">=");return t.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(S)){const M=S.split(">");return r.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(S)){const M=S.split("<=");return v.create(M[0].trim(),M[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(S)){const M=S.split("<");return b.create(M[0].trim(),M[1].trim())}return/^\!\s*/.test(S)?s.create(S.substr(1).trim()):g.create(S)}static _deserializeValue(S,L){if(S=S.trim(),S==="true")return!0;if(S==="false")return!1;let M=/^'([^']*)'$/.exec(S);return M?M[1].trim():S}static _deserializeRegexValue(S,L){if(Object(H.C)(S)){if(L)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let M=S.indexOf("/"),O=S.lastIndexOf("/");if(M===O||M<0){if(L)throw new Error(`bad regexp-value '${S}', missing /-enclosure`);return console.warn(`bad regexp-value '${S}', missing /-enclosure`),null}let j=S.slice(M+1,O),G=S[O+1]==="i"?"i":"";try{return new RegExp(j,G)}catch(X){if(L)throw new Error(`bad regexp-value '${S}', parse error: ${X}`);return console.warn(`bad regexp-value '${S}', parse error: ${X}`),null}}}function N(S,L){const M=S?S.substituteConstants():void 0,O=L?L.substituteConstants():void 0;return!M&&!O?!0:!M||!O?!1:M.equals(O)}function e(S,L){return S.cmp(L)}class C{constructor(){this.type=0}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!1}serialize(){return"false"}keys(){return[]}negate(){return E.INSTANCE}}C.INSTANCE=new C;class E{constructor(){this.type=1}cmp(S){return this.type-S.type}equals(S){return S.type===this.type}substituteConstants(){return this}evaluate(S){return!0}serialize(){return"true"}keys(){return[]}negate(){return C.INSTANCE}}E.INSTANCE=new E;class g{constructor(S,L){this.key=S,this.negated=L,this.type=2}static create(S,L=null){const M=P.get(S);return typeof M=="boolean"?M?E.INSTANCE:C.INSTANCE:new g(S,L)}cmp(S){return S.type!==this.type?this.type-S.type:p(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=P.get(this.key);return typeof S=="boolean"?S?E.INSTANCE:C.INSTANCE:this}evaluate(S){return!!S.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 h{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=4}static create(S,L,M=null){if(typeof L=="boolean")return L?g.create(S,M):s.create(S,M);const O=P.get(S);if(typeof O=="boolean"){const j=O?"true":"false";return L===j?E.INSTANCE:C.INSTANCE}return new h(S,L,M)}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=P.get(this.key);if(typeof S=="boolean"){const L=S?"true":"false";return this.value===L?E.INSTANCE:C.INSTANCE}return this}evaluate(S){return S.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this.value,this)),this.negated}}class a{constructor(S,L){this.key=S,this.valueKey=L,this.type=10,this.negated=null}static create(S,L){return new a(S,L)}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.valueKey,S.key,S.valueKey)}equals(S){return S.type===this.type?this.key===S.key&&this.valueKey===S.valueKey:!1}substituteConstants(){return this}evaluate(S){const L=S.getValue(this.valueKey),M=S.getValue(this.key);return Array.isArray(L)?L.indexOf(M)>=0:typeof M=="string"&&typeof L=="object"&&L!==null?R.call(L,M):!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(S){this._actual=S,this.type=11}static create(S){return new i(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class l{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=5}static create(S,L,M=null){if(typeof L=="boolean")return L?s.create(S,M):g.create(S,M);const O=P.get(S);if(typeof O=="boolean"){const j=O?"true":"false";return L===j?C.INSTANCE:E.INSTANCE}return new l(S,L,M)}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){const S=P.get(this.key);if(typeof S=="boolean"){const L=S?"true":"false";return this.value===L?C.INSTANCE:E.INSTANCE}return this}evaluate(S){return S.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h.create(this.key,this.value,this)),this.negated}}class s{constructor(S,L){this.key=S,this.negated=L,this.type=3}static create(S,L=null){const M=P.get(S);return typeof M=="boolean"?M?C.INSTANCE:E.INSTANCE:new s(S,L)}cmp(S){return S.type!==this.type?this.type-S.type:p(this.key,S.key)}equals(S){return S.type===this.type?this.key===S.key:!1}substituteConstants(){const S=P.get(this.key);return typeof S=="boolean"?S?C.INSTANCE:E.INSTANCE:this}evaluate(S){return!S.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this)),this.negated}}function n(S,L){if(typeof S=="string"){const M=parseFloat(S);isNaN(M)||(S=M)}return typeof S=="string"||typeof S=="number"?L(S):C.INSTANCE}class r{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=12}static create(S,L,M=null){return n(L,O=>new r(S,O,M))}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.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 t{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=13}static create(S,L,M=null){return n(L,O=>new t(S,O,M))}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=b.create(this.key,this.value,this)),this.negated}}class b{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=14}static create(S,L,M=null){return n(L,O=>new b(S,O,M))}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.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 v{constructor(S,L,M){this.key=S,this.value=L,this.negated=M,this.type=15}static create(S,L,M=null){return n(L,O=>new v(S,O,M))}cmp(S){return S.type!==this.type?this.type-S.type:d(this.key,this.value,S.key,S.value)}equals(S){return S.type===this.type?this.key===S.key&&this.value===S.value:!1}substituteConstants(){return this}evaluate(S){return typeof this.value=="string"?!1:parseFloat(S.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class m{constructor(S,L){this.key=S,this.regexp=L,this.type=7,this.negated=null}static create(S,L){return new m(S,L)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.key<S.key)return-1;if(this.key>S.key)return 1;const L=this.regexp?this.regexp.source:"",M=S.regexp?S.regexp.source:"";return L<M?-1:L>M?1:0}equals(S){if(S.type===this.type){const L=this.regexp?this.regexp.source:"",M=S.regexp?S.regexp.source:"";return this.key===S.key&&L===M}return!1}substituteConstants(){return this}evaluate(S){let L=S.getValue(this.key);return this.regexp?this.regexp.test(L):!1}serialize(){const S=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${S}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this)),this.negated}}class T{constructor(S){this._actual=S,this.type=8}static create(S){return new T(S)}cmp(S){return S.type!==this.type?this.type-S.type:this._actual.cmp(S._actual)}equals(S){return S.type===this.type?this._actual.equals(S._actual):!1}substituteConstants(){return this}evaluate(S){return!this._actual.evaluate(S)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function y(S){let L=null;for(let M=0,O=S.length;M<O;M++){const j=S[M].substituteConstants();if(S[M]!==j&&L===null){L=[];for(let G=0;G<M;G++)L[G]=S[G]}L!==null&&(L[M]=j)}return L===null?S:L}class f{constructor(S,L){this.expr=S,this.negated=L,this.type=6}static create(S,L){return f._normalizeArr(S,L)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let L=0,M=this.expr.length;L<M;L++){const O=e(this.expr[L],S.expr[L]);if(O!==0)return O}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let L=0,M=this.expr.length;L<M;L++)if(!this.expr[L].equals(S.expr[L]))return!1;return!0}return!1}substituteConstants(){const S=y(this.expr);return S===this.expr?this:f.create(S,this.negated)}evaluate(S){for(let L=0,M=this.expr.length;L<M;L++)if(!this.expr[L].evaluate(S))return!1;return!0}static _normalizeArr(S,L){const M=[];let O=!1;for(const j of S){if(!j)continue;if(j.type===1){O=!0;continue}if(j.type===0)return C.INSTANCE;if(j.type===6){M.push(...j.expr);continue}M.push(j)}if(M.length===0&&O)return E.INSTANCE;if(M.length===0)return;if(M.length===1)return M[0];M.sort(e);for(let j=1;j<M.length;j++)M[j-1].equals(M[j])&&(M.splice(j,1),j--);if(M.length===1)return M[0];for(;M.length>1;){const j=M[M.length-1];if(j.type!==9)break;M.pop();const G=M.pop(),X=M.length===0,ee=u.create(j.expr.map(he=>f.create([he,G],null)),null,X);ee&&(M.push(ee),M.sort(e))}return M.length===1?M[0]:new f(M,L)}serialize(){return this.expr.map(S=>S.serialize()).join(" && ")}keys(){const S=[];for(let L of this.expr)S.push(...L.keys());return S}negate(){if(!this.negated){const S=[];for(let L of this.expr)S.push(L.negate());this.negated=u.create(S,this,!0)}return this.negated}}class u{constructor(S,L){this.expr=S,this.negated=L,this.type=9}static create(S,L,M){return u._normalizeArr(S,L,M)}cmp(S){if(S.type!==this.type)return this.type-S.type;if(this.expr.length<S.expr.length)return-1;if(this.expr.length>S.expr.length)return 1;for(let L=0,M=this.expr.length;L<M;L++){const O=e(this.expr[L],S.expr[L]);if(O!==0)return O}return 0}equals(S){if(S.type===this.type){if(this.expr.length!==S.expr.length)return!1;for(let L=0,M=this.expr.length;L<M;L++)if(!this.expr[L].equals(S.expr[L]))return!1;return!0}return!1}substituteConstants(){const S=y(this.expr);return S===this.expr?this:u.create(S,this.negated,!1)}evaluate(S){for(let L=0,M=this.expr.length;L<M;L++)if(this.expr[L].evaluate(S))return!0;return!1}static _normalizeArr(S,L,M){let O=[],j=!1;if(S){for(let G=0,X=S.length;G<X;G++){const ee=S[G];if(!ee)continue;if(ee.type===0){j=!0;continue}if(ee.type===1)return E.INSTANCE;if(ee.type===9){O=O.concat(ee.expr);continue}O.push(ee)}if(O.length===0&&j)return C.INSTANCE;O.sort(e)}if(O.length===0)return;if(O.length===1)return O[0];for(let G=1;G<O.length;G++)O[G-1].equals(O[G])&&(O.splice(G,1),G--);if(O.length===1)return O[0];if(M){for(let G=0;G<O.length;G++)for(let X=G+1;X<O.length;X++)A(O[G],O[X])&&(O.splice(X,1),X--);if(O.length===1)return O[0]}return new u(O,L)}serialize(){return this.expr.map(S=>S.serialize()).join(" || ")}keys(){const S=[];for(let L of this.expr)S.push(...L.keys());return S}negate(){if(!this.negated){let S=[];for(let L of this.expr)S.push(L.negate());for(;S.length>1;){const L=S.shift(),M=S.shift(),O=[];for(const G of D(L))for(const X of D(M))O.push(f.create([G,X],null));const j=S.length===0;S.unshift(u.create(O,null,j))}this.negated=S[0]}return this.negated}}class o extends g{constructor(S,L,M){super(S,null);this._defaultValue=L,typeof M=="object"?o._info.push(Object.assign(Object.assign({},M),{key:S})):M!==!0&&o._info.push({key:S,description:M,type:L!=null?typeof L:void 0})}static all(){return o._info.values()}bindTo(S){return S.createKey(this.key,this._defaultValue)}getValue(S){return S.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(S){return h.create(this.key,S)}}o._info=[];const c=Object(I.c)("contextKeyService"),_="setContext";function p(S,L){return S<L?-1:S>L?1:0}function d(S,L,M,O){return S<M?-1:S>M?1:L<O?-1:L>O?1:0}function A(S,L){if(L.type===6&&S.type!==9&&S.type!==6){for(const j of L.expr)if(S.equals(j))return!0}const M=S.negate(),O=D(M).concat(D(L));O.sort(e);for(let j=0;j<O.length;j++){const G=O[j],X=G.negate();for(let ee=j+1;ee<O.length;ee++){const he=O[ee];if(X.equals(he))return!0}}return!1}function D(S){return S.type===9?S.expr:[S]}},TXwP:function(Me,ne,B){var Q,H;(function(){var I;(function(){"use strict";var P=[,,function(e){function C(h){this.__parent=h,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 h=new C(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},C.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},C.prototype.has_match=function(h){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(h))return!0;return!1},C.prototype.set_indent=function(h,a){this.is_empty()&&(this.__indent_count=h||0,this.__alignment_count=a||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 h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__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(h){this.__items.push(h);var a=h.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=h.length-a:this.__character_count+=h.length},C.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},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 h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function E(h,a){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),a=a||"",h.indent_level>0&&(a=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}E.prototype.get_indent_size=function(h,a){var i=this.__base_string_length;return a=a||0,h<0&&(i=0),i+=h*this.__indent_size,i+=a,i},E.prototype.get_indent_string=function(h,a){var i=this.__base_string;return a=a||0,h<0&&(h=0,i=""),a+=h*this.__indent_size,this.__ensure_cache(a),i+=this.__cache[a],i},E.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},E.prototype.__add_column=function(){var h=this.__cache.length,a=0,i="";this.__indent_size&&h>=this.__indent_size&&(a=Math.floor(h/this.__indent_size),h-=a*this.__indent_size,i=new Array(a+1).join(this.__indent_string)),h&&(i+=new Array(h+1).join(" ")),this.__cache.push(i)};function g(h,a){this.__indent_cache=new E(h,a),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.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()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(h,a){return this.__indent_cache.get_indent_string(h,a)},g.prototype.get_indent_size=function(h,a){return this.__indent_cache.get_indent_size(h,a)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(h){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 h!==`
|
|
`&&(i=i.replace(/[\n]/g,h)),i},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(h,a){return h=h||0,a=a||0,this.next_line.set_indent(h,a),this.__lines.length>1?(this.current_line.set_indent(h,a),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(h){for(var a=0;a<h.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.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(" "))},g.prototype.remove_indent=function(h){for(var a=this.__lines.length;h<a;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(h,a){for(var i=this.__lines.length-2;i>=0;){var l=this.__lines[i];if(l.is_empty())break;if(l.item(0).indexOf(h)!==0&&l.item(-1)!==a){this.__lines.splice(i+1,0,new C(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=g},,,,function(e){function C(h,a){this.raw_options=E(h,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"])}C.prototype._get_array=function(h,a){var i=this.raw_options[h],l=a||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(l=i.concat()):typeof i=="string"&&(l=i.split(/[^a-zA-Z0-9_\/\-]+/)),l},C.prototype._get_boolean=function(h,a){var i=this.raw_options[h],l=i===void 0?!!a:!!i;return l},C.prototype._get_characters=function(h,a){var i=this.raw_options[h],l=a||"";return typeof i=="string"&&(l=i.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),l},C.prototype._get_number=function(h,a){var i=this.raw_options[h];a=parseInt(a,10),isNaN(a)&&(a=0);var l=parseInt(i,10);return isNaN(l)&&(l=a),l},C.prototype._get_selection=function(h,a,i){var l=this._get_selection_list(h,a,i);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[h]+"'");return l[0]},C.prototype._get_selection_list=function(h,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 l=this._get_array(h,i);if(!this._is_valid_selection(l,a))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[h]+"'");return l},C.prototype._is_valid_selection=function(h,a){return h.length&&a.length&&!h.some(function(i){return a.indexOf(i)===-1})};function E(h,a){var i={};h=g(h);var l;for(l in h)l!==a&&(i[l]=h[l]);if(a&&h[a])for(l in h[a])i[l]=h[a][l];return i}function g(h){var a={},i;for(i in h){var l=i.replace(/-/g,"_");a[l]=h[i]}return a}e.exports.Options=C,e.exports.normalizeOpts=g,e.exports.mergeOpts=E},,function(e){var C=RegExp.prototype.hasOwnProperty("sticky");function E(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},E.prototype.peek=function(g){var h=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(h=this.__input.charAt(g)),h},E.prototype.__match=function(g,h){g.lastIndex=h;var a=g.exec(this.__input);return a&&!(C&&g.sticky)&&(a.index!==h&&(a=null)),a},E.prototype.test=function(g,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(g,h):!1},E.prototype.testChar=function(g,h){var a=this.peek(h);return g.lastIndex=0,a!==null&&g.test(a)},E.prototype.match=function(g){var h=this.__match(g,this.__position);return h?this.__position+=h[0].length:h=null,h},E.prototype.read=function(g,h,a){var i="",l;return g&&(l=this.match(g),l&&(i+=l[0])),h&&(l||!g)&&(i+=this.readUntil(h,a)),i},E.prototype.readUntil=function(g,h){var a="",i=this.__position;g.lastIndex=this.__position;var l=g.exec(this.__input);return l?(i=l.index,h&&(i+=l[0].length)):i=this.__input_length,a=this.__input.substring(this.__position,i),this.__position=i,a},E.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},E.prototype.get_regexp=function(g,h){var a=null,i="g";return h&&C&&(i="y"),typeof g=="string"&&g!==""?a=new RegExp(g,i):g&&(a=new RegExp(g.source,i)),a},E.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(g){var h=this.__position,a=this.readUntilAfter(g);return this.__position=h,a},E.prototype.lookBack=function(g){var h=this.__position-1;return h>=g.length&&this.__input.substring(h-g.length,h).toLowerCase()===g},e.exports.InputScanner=E},,,,,function(e){function C(E,g){E=typeof E=="string"?E:E.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+g,"g")}C.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(E);h;)g[h[1]]=h[2],h=this.__directive_pattern.exec(E);return g},C.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=C},,function(e,C,E){var g=E(16).Beautifier,h=E(17).Options;function a(i,l){var s=new g(i,l);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new h}},function(e,C,E){var g=E(17).Options,h=E(2).Output,a=E(8).InputScanner,i=E(13).Directives,l=new i(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,n=/\r\n|[\r\n]/g,r=/\s/,t=/(?:\s|\n)+/g,b=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,v=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function m(T,y){this._source_text=T||"",this._options=new g(y),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(T){var y="";for(this._ch=this._input.next();this._ch;){if(y+=this._ch,this._ch==="\\")y+=this._input.next();else if(T.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return y},m.prototype.eatWhitespace=function(T){for(var y=r.test(this._input.peek()),f=0;r.test(this._input.peek());)this._ch=this._input.next(),T&&this._ch===`
|
|
`&&((f===0||f<this._options.max_preserve_newlines)&&(f++,this._output.add_new_line(!0)));return y},m.prototype.foundNestedPseudoClass=function(){for(var T=0,y=1,f=this._input.peek(y);f;){if(f==="{")return!0;if(f==="(")T+=1;else if(f===")"){if(T===0)return!1;T-=1}else if(f===";"||f==="}")return!1;y++,f=this._input.peek(y)}return!1},m.prototype.print_string=function(T){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(T)},m.prototype.preserveSingleSpace=function(T){T&&(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 T=this._source_text,y=this._options.eol;y==="auto"&&(y=`
|
|
`,T&&s.test(T||"")&&(y=T.match(s)[0])),T=T.replace(n,`
|
|
`);var f=T.match(/^[\t ]*/)[0];this._output=new h(this._options,f),this._input=new a(T),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var u=0,o=!1,c=!1,_=!1,p=!1,d=!1,A=!1,D=this._ch,S=!1,L,M,O;L=this._input.read(t),M=L!=="",O=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 j=this._input.read(b),G=l.get_directives(j);G&&G.ignore==="start"&&(j+=l.readIgnored(this._input)),this.print_string(j),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(v)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(M),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var X=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);X.match(/[ :]$/)&&(X=this.eatString(": ").replace(/\s$/,""),this.print_string(X),this._output.space_before_token=!0),X=X.replace(/\s$/,""),X==="extend"?p=!0:X==="import"&&(d=!0),X in this.NESTED_AT_RULE?(this._nestedLevel+=1,X in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!o&&u===0&&X.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(M),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),_?(_=!1,o=this._indentLevel>=this._nestedLevel):o=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&o&&(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)):(O==="("?this._output.space_before_token=!1:O!==","&&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(),O==="{"&&this._output.trim(!0),d=!1,p=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),o=!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])){S=!0;break}(o||_)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!p&&u===0?(this.print_string(":"),c||(c=!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 he=O==='"'||O==="'";this.preserveSingleSpace(he||M),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")S=!1,u===0?(c&&(this.outdent(),c=!1),p=!1,d=!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(),u++,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(")")),u&&(u--,this.outdent()));else{var ge=!1;this._input.lookBack("with")&&(ge=!0),this.preserveSingleSpace(M||ge),this.print_string(this._ch),c&&O==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),A=!0):(this.eatWhitespace(),u++,this.indent())}else if(this._ch===")")u&&(u--,this.outdent()),A&&this._input.peek()===";"&&this._options.selector_separator_newline&&(A=!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&&(!c||A)&&u===0&&!d&&!p?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!c&&u===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&&r.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(M),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),r.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 de=O==='"'||O==="'";this.preserveSingleSpace(de||M),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&S&&this._output.add_new_line()}var Te=this._output.get_code(y);return Te},e.exports.Beautifier=m},function(e,C,E){var g=E(6).Options;function h(a){g.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 l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<l.length;s++)l[s]!=="expand"?this.brace_style="collapse":this.brace_style=l[s]}h.prototype=new g,e.exports.Options=h}],R={};function K(e){var C=R[e];if(C!==void 0)return C.exports;var E=R[e]={exports:{}};return P[e](E,E.exports,K),E.exports}var N=K(15);I=N})();var W=I;!(Q=[],H=function(){return{css_beautify:W}}.apply(ne,Q),H!==void 0&&(Me.exports=H))})()},Vhoy:function(Me,ne,B){"use strict";B.d(ne,"d",function(){return W}),B.d(ne,"e",function(){return P}),B.d(ne,"c",function(){return R}),B.d(ne,"b",function(){return K}),B.d(ne,"a",function(){return N});var Q=B("MI8n");class H{constructor(){this._icons=new Map,this._onDidRegister=new Q.b}add(e){const C=this._icons.get(e.id);C?e.description?C.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 I=new H,W=I;function P(e,C){return new K(e,C)}function R(e){return e?e.replace(/\$\((.*?)\)/g,(C,E)=>` ${E} `).trim():""}class K{constructor(e,C,E){this.id=e,this.definition=C,this.description=E,I.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var N;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const C=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function E(a){if(a instanceof K)return["codicon","codicon-"+a.id];const i=C.exec(a.id);if(!i)return E(K.error);let[,l,s]=i;const n=["codicon","codicon-"+l];return s&&n.push("codicon-modifier-"+s.substr(1)),n}e.asClassNameArray=E;function g(a){return E(a).join(" ")}e.asClassName=g;function h(a){return"."+E(a).join(".")}e.asCSSSelector=h})(N||(N={})),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"})}(K||(K={}))},WaYH:function(Me,ne,B){"use strict";var Q=B("rePB"),H=B("Ff2n"),I=B("VTBJ"),W=B("1OyB"),P=B("vuIU"),R=B("JX7q"),K=B("Ji7U"),N=B("LK+K"),e=B("q1tI"),C=B("TSYQ"),E=B.n(C),g=B("sboe"),h=B("OZM5"),a=function(T){var y=T.prefixCls,f=T.level,u=T.isStart,o=T.isEnd;if(!f)return null;for(var c="".concat(y,"-indent-unit"),_=[],p=0;p<f;p+=1){var d;_.push(e.createElement("span",{key:p,className:E()(c,(d={},Object(Q.a)(d,"".concat(c,"-start"),u[p+1]),Object(Q.a)(d,"".concat(c,"-end"),o[p+1]),Object(Q.a)(d,"".concat(c,"-end-first-level"),!p&&o[0]),d))}))}return e.createElement("span",{"aria-hidden":"true",className:"".concat(y,"-indent")},_)},i=a,l=B("815F"),s="open",n="close",r="---",t=function(m){Object(K.a)(y,m);var T=Object(N.a)(y);function y(){var f;return Object(W.a)(this,y),f=T.apply(this,arguments),f.state={dragNodeHighlight:!1},f.onSelectorClick=function(u){var o=f.props.context.onNodeClick;o(u,Object(l.b)(f.props)),f.isSelectable()?f.onSelect(u):f.onCheck(u)},f.onSelectorDoubleClick=function(u){var o=f.props.context.onNodeDoubleClick;o(u,Object(l.b)(f.props))},f.onSelect=function(u){if(f.isDisabled())return;var o=f.props.context.onNodeSelect;u.preventDefault(),o(u,Object(l.b)(f.props))},f.onCheck=function(u){if(f.isDisabled())return;var o=f.props,c=o.disableCheckbox,_=o.checked,p=f.props.context.onNodeCheck;if(!f.isCheckable()||c)return;u.preventDefault();var d=!_;p(u,Object(l.b)(f.props),d)},f.onMouseEnter=function(u){var o=f.props.context.onNodeMouseEnter;o(u,Object(l.b)(f.props))},f.onMouseLeave=function(u){var o=f.props.context.onNodeMouseLeave;o(u,Object(l.b)(f.props))},f.onContextMenu=function(u){var o=f.props.context.onNodeContextMenu;o(u,Object(l.b)(f.props))},f.onDragStart=function(u){var o=f.props.context.onNodeDragStart;u.stopPropagation(),f.setState({dragNodeHighlight:!0}),o(u,Object(R.a)(f));try{u.dataTransfer.setData("text/plain","")}catch(c){}},f.onDragEnter=function(u){var o=f.props.context.onNodeDragEnter;u.preventDefault(),u.stopPropagation(),o(u,Object(R.a)(f))},f.onDragOver=function(u){var o=f.props.context.onNodeDragOver;u.preventDefault(),u.stopPropagation(),o(u,Object(R.a)(f))},f.onDragLeave=function(u){var o=f.props.context.onNodeDragLeave;u.stopPropagation(),o(u,Object(R.a)(f))},f.onDragEnd=function(u){var o=f.props.context.onNodeDragEnd;u.stopPropagation(),f.setState({dragNodeHighlight:!1}),o(u,Object(R.a)(f))},f.onDrop=function(u){var o=f.props.context.onNodeDrop;u.preventDefault(),u.stopPropagation(),f.setState({dragNodeHighlight:!1}),o(u,Object(R.a)(f))},f.onExpand=function(u){var o=f.props.context.onNodeExpand;o(u,Object(l.b)(f.props))},f.setSelectHandle=function(u){f.selectHandle=u},f.getNodeState=function(){var u=f.props.expanded;return f.isLeaf()?null:u?s:n},f.hasChildren=function(){var u=f.props.eventKey,o=f.props.context.keyEntities,c=o[u]||{},_=c.children;return!!(_||[]).length},f.isLeaf=function(){var u=f.props,o=u.isLeaf,c=u.loaded,_=f.props.context.loadData,p=f.hasChildren();return o===!1?!1:o||!_&&!p||_&&c&&!p},f.isDisabled=function(){var u=f.props.disabled,o=f.props.context.disabled;return!!(o||u)},f.isCheckable=function(){var u=f.props.checkable,o=f.props.context.checkable;return!o||u===!1?!1:o},f.syncLoadData=function(u){var o=u.expanded,c=u.loading,_=u.loaded,p=f.props.context,d=p.loadData,A=p.onNodeLoad;if(c)return;d&&o&&!f.isLeaf()&&(!f.hasChildren()&&!_&&A(Object(l.b)(f.props)))},f.renderSwitcher=function(){var u=f.props,o=u.expanded,c=u.switcherIcon,_=f.props.context,p=_.prefixCls,d=_.switcherIcon,A=c||d;if(f.isLeaf())return e.createElement("span",{className:E()("".concat(p,"-switcher"),"".concat(p,"-switcher-noop"))},typeof A=="function"?A(Object(I.a)(Object(I.a)({},f.props),{},{isLeaf:!0})):A);var D=E()("".concat(p,"-switcher"),"".concat(p,"-switcher_").concat(o?s:n));return e.createElement("span",{onClick:f.onExpand,className:D},typeof A=="function"?A(Object(I.a)(Object(I.a)({},f.props),{},{isLeaf:!1})):A)},f.renderCheckbox=function(){var u=f.props,o=u.checked,c=u.halfChecked,_=u.disableCheckbox,p=f.props.context.prefixCls,d=f.isDisabled(),A=f.isCheckable();if(!A)return null;var D=typeof A!="boolean"?A:null;return e.createElement("span",{className:E()("".concat(p,"-checkbox"),o&&"".concat(p,"-checkbox-checked"),!o&&c&&"".concat(p,"-checkbox-indeterminate"),(d||_)&&"".concat(p,"-checkbox-disabled")),onClick:f.onCheck},D)},f.renderIcon=function(){var u=f.props.loading,o=f.props.context.prefixCls;return e.createElement("span",{className:E()("".concat(o,"-iconEle"),"".concat(o,"-icon__").concat(f.getNodeState()||"docu"),u&&"".concat(o,"-icon_loading"))})},f.renderSelector=function(){var u=f.state.dragNodeHighlight,o=f.props,c=o.title,_=o.selected,p=o.icon,d=o.loading,A=o.data,D=f.props.context,S=D.prefixCls,L=D.showIcon,M=D.icon,O=D.draggable,j=D.loadData,G=D.titleRender,X=f.isDisabled(),ee="".concat(S,"-node-content-wrapper"),he;if(L){var ge=p||M;he=ge?e.createElement("span",{className:E()("".concat(S,"-iconEle"),"".concat(S,"-icon__customize"))},typeof ge=="function"?ge(f.props):ge):f.renderIcon()}else j&&d&&(he=f.renderIcon());var de;typeof c=="function"?de=c(A):G?de=G(A):de=c;var Te=e.createElement("span",{className:"".concat(S,"-title")},de);return e.createElement("span",{ref:f.setSelectHandle,title:typeof c=="string"?c:"",className:E()("".concat(ee),"".concat(ee,"-").concat(f.getNodeState()||"normal"),!X&&(_||u)&&"".concat(S,"-node-selected"),!X&&O&&"draggable"),draggable:!X&&O||void 0,"aria-grabbed":!X&&O||void 0,onMouseEnter:f.onMouseEnter,onMouseLeave:f.onMouseLeave,onContextMenu:f.onContextMenu,onClick:f.onSelectorClick,onDoubleClick:f.onSelectorDoubleClick,onDragStart:O?f.onDragStart:void 0},he,Te)},f}return Object(P.a)(y,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var u=this.props.selectable,o=this.props.context.selectable;return typeof u=="boolean"?u:o}},{key:"render",value:function(){var u,o=this.props,c=o.eventKey,_=o.className,p=o.style,d=o.dragOver,A=o.dragOverGapTop,D=o.dragOverGapBottom,S=o.isLeaf,L=o.isStart,M=o.isEnd,O=o.expanded,j=o.selected,G=o.checked,X=o.halfChecked,ee=o.loading,he=o.domRef,ge=o.active,de=o.onMouseMove,Te=Object(H.a)(o,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),xe=this.props.context,ce=xe.prefixCls,ae=xe.filterTreeNode,Le=xe.draggable,Ye=xe.keyEntities,Fe=this.isDisabled(),We=Object(h.f)(Te),be=Ye[c]||{},Ee=be.level,Ae=M[M.length-1];return e.createElement("div",Object.assign({ref:he,className:E()(_,"".concat(ce,"-treenode"),(u={},Object(Q.a)(u,"".concat(ce,"-treenode-disabled"),Fe),Object(Q.a)(u,"".concat(ce,"-treenode-switcher-").concat(O?"open":"close"),!S),Object(Q.a)(u,"".concat(ce,"-treenode-checkbox-checked"),G),Object(Q.a)(u,"".concat(ce,"-treenode-checkbox-indeterminate"),X),Object(Q.a)(u,"".concat(ce,"-treenode-selected"),j),Object(Q.a)(u,"".concat(ce,"-treenode-loading"),ee),Object(Q.a)(u,"".concat(ce,"-treenode-active"),ge),Object(Q.a)(u,"".concat(ce,"-treenode-leaf-last"),Ae),Object(Q.a)(u,"drag-over",!Fe&&d),Object(Q.a)(u,"drag-over-gap-top",!Fe&&A),Object(Q.a)(u,"drag-over-gap-bottom",!Fe&&D),Object(Q.a)(u,"filter-node",ae&&ae(Object(l.b)(this.props))),u)),style:p,onDragEnter:Le?this.onDragEnter:void 0,onDragOver:Le?this.onDragOver:void 0,onDragLeave:Le?this.onDragLeave:void 0,onDrop:Le?this.onDrop:void 0,onDragEnd:Le?this.onDragEnd:void 0,onMouseMove:de},We),e.createElement(i,{prefixCls:ce,level:Ee,isStart:L,isEnd:M}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),y}(e.Component),b=function(T){return e.createElement(g.a.Consumer,null,function(y){return e.createElement(t,Object.assign({},T,{context:y}))})};b.displayName="TreeNode",b.defaultProps={title:r},b.isTreeNode=1;var v=ne.a=b},ZW9T:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return M});var Q=B("k1fw"),H=B("oBTY"),I=B("miYZ"),W=B("tsqr"),P=B("rAM+"),R=B("tJVT"),K=B("PpiC"),N=B("q1tI"),e=B.n(N),C=B("bdgK"),E=B("9og8"),g=B("WmNS"),h=B.n(g),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"]},l={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(`
|
|
`)}]},n=B("5VLF"),r=B.n(n),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"]}},b=function(j,G){return G.map(function(X){return{label:X,kind:j.languages.CompletionItemKind.Keyword,insertText:X}})},v=function(j){return Object.keys(t.tables).map(function(G){return{label:G,kind:j.languages.CompletionItemKind.Variable,insertText:G}})},m=function(j,G){var X=t.tables[j];return X?X.map(function(ee){return{label:ee,kind:G.languages.CompletionItemKind.Field,insertText:ee}}):[]};function T(O,j,G,X,ee){var he=j.getWordUntilPosition(G),ge={startLineNumber:G.lineNumber,endLineNumber:G.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},de=X.map(function(Te){return{label:Te,kind:O.languages.CompletionItemKind.Keyword,insertText:Te,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}});return ee.map(function(Te){de.push(Object(Q.a)(Object(Q.a)({},Te),{},{range:ge}))}),de}var y=function(O){t.languages.map(function(ee){return O.languages.registerDocumentFormattingEditProvider(ee,{provideDocumentFormattingEdits:function(ge,de,Te){return Object(E.a)(h.a.mark(function xe(){var ce;return h.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return ce=r()(ge.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}),Le.abrupt("return",[{range:ge.getFullModelRange(),text:ce}]);case 2:case"end":return Le.stop()}},xe)}))()}}),ee});var j=l.quickKey.map(function(ee){return{label:ee.label,kind:O.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),G=s.quickKey.map(function(ee){return{label:ee.label,kind:O.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),X=i.quickKey.map(function(ee){return{label:ee.label,kind:O.languages.CompletionItemKind.Method,insertText:ee.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}});O.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(he,ge){var de=he.getWordUntilPosition(ge),Te={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},xe=he.getLineContent(ge.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[].concat(Object(H.a)(l.keywords.map(function(ce){return{label:ce,kind:O.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})),Object(H.a)(l.quickKey.map(function(ce){return{label:ce.label,kind:O.languages.CompletionItemKind.Function,documentation:ce.content,insertText:xe.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})))}}}),O.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(he,ge){var de=he.getWordUntilPosition(ge),Te={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn};return{suggestions:Object(H.a)(a.keywords.map(function(xe){return{label:xe,kind:O.languages.CompletionItemKind.Function,documentation:xe,insertText:xe,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}}))}}}),O.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(he,ge){var de=he.getWordUntilPosition(ge),Te={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},xe=he.getLineContent(ge.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[].concat(Object(H.a)(i.keywords.map(function(ce){return{label:ce,kind:O.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})),Object(H.a)(i.quickKey.map(function(ce){return{label:ce.label,kind:O.languages.CompletionItemKind.Function,documentation:ce.content,insertText:xe.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})))}}}),O.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(he,ge){var de=he.getWordUntilPosition(ge),Te={startLineNumber:ge.lineNumber,endLineNumber:ge.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},xe=he.getLineContent(ge.lineNumber).substring(de.startColumn-2,de.endColumn);return{suggestions:[].concat(Object(H.a)(s.keywords.map(function(ce){return{label:ce,kind:O.languages.CompletionItemKind.Function,documentation:ce,insertText:ce,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})),Object(H.a)(s.quickKey.map(function(ce){return{label:ce.label,kind:O.languages.CompletionItemKind.Function,documentation:ce.content,insertText:xe.startsWith("#")?ce.content.replace(/#/,""):ce.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}})))}}})},f="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",u=B("fjLI"),o=B("LvDl"),c=B("+ua5");function _(O){return/^\d+$/.test(O)?"".concat(O,"px"):O}function p(){}var d=!1,A={"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 O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],j=O;if(Array.isArray(O)){for(var G=0;G<O.length;G++){var X=A[O[G]];if(X)return X}return j[0]}return A[j]||j}var S=null,L=ne.b=function(O){var j=O.width,G=j===void 0?"100%":j,X=O.height,ee=X===void 0?"100%":X,he=O.value,ge=O.language,de=ge===void 0?"javascript":ge,Te=O.style,xe=Te===void 0?{}:Te,ce=O.options,ae=ce===void 0?{}:ce,Le=O.overrideServices,Ye=Le===void 0?{}:Le,Fe=O.theme,We=Fe===void 0?"vs-dark":Fe,be=O.onEditBlur,Ee=O.onSave,Ae=O.autoHeight,Ie=Ae===void 0?!1:Ae,$=O.forbidCopy,se=$===void 0?!1:$,ue=O.onChange,pe=ue===void 0?p:ue,Se=O.editorDidMount,Pe=Se===void 0?p:Se,De=O.onFocus,ke=De===void 0?p:De,Be=O.filename,Ke=Be===void 0?"educoder.txt":Be,oe=O.errorLine,me=O.errorContent,_e=me===void 0?"":me,we=Object(K.a)(O,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),fe=Object(N.useRef)(),ye=Object(N.useRef)({}),re=Object(N.useRef)(),Z=Object(N.useRef)(),J=Object(N.useRef)(!1),V=Object(N.useRef)(),Y=Object(N.useState)(!1),q=Object(R.a)(Y,2),te=q[0],le=q[1];function ve(){var Xe;return fe.current&&(Xe=new C.default(function(Ve){var tt=Object(P.a)(Ve),vt;try{for(tt.s();!(vt=tt.n()).done;){var Et=vt.value;(Et.target.offsetHeight>0||Et.target.offsetWidth>0)&&ye.current.instance.layout()}}catch(bt){tt.e(bt)}finally{tt.f()}}),Xe.observe(fe.current)),Xe}function Oe(){W.b.warn(decodeURIComponent(f))}var He=function(){var Ve=ye.current.instance;if(he!=null&&Ve&&te){var tt=Ve.getModel();tt&&he!==tt.getValue()&&(d=!0,tt.setValue(he),Ve.layout(),d=!1)}};Object(N.useEffect)(function(){Z.current&&clearTimeout(Z.current),Z.current=setTimeout(function(){He()},500)},[he,te,ye.current]),Object(N.useEffect)(function(){if(oe&&ye.current&&ye.current.instance){var Xe=ye.current.instance;Xe.changeViewZones(function(tt){var vt=document.createElement("div");vt.style.padding="10px 20px",vt.style.width="calc(100% - 20px)",vt.className="my-error-line-wrp",vt.innerHTML=_e,tt.addZone({afterLineNumber:oe||11,heightInLines:3,domNode:vt})});var Ve={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}};Xe.addOverlayWidget(Ve),Xe.revealPositionInCenter({lineNumber:20,column:1})}},[oe,ye.current,te]);function ze(){var Xe=ye.current.instance;if(Xe){var Ve=Xe.getSelection(),tt=ye.current.pastePos||{},vt=new S.Range(tt.startLineNumber||Ve.endLineNumber,tt.startColumn||Ve.endColumn,tt.endLineNumber||Ve.endLineNumber,tt.endColumn||Ve.endColumn);setTimeout(function(){Xe.executeEdits("",[{range:vt,text:""}])},300)}}function Ne(Xe){(window.navigator.platform.match("Mac")?Xe.metaKey:Xe.ctrlKey)&&Xe.keyCode==83&&(Xe.preventDefault(),Ee())}var Je=function(){if(Ie&&ye.current.instance){var Ve=ye.current.instance.getContentHeight();Ue(Ve<ee?ee:Ve)}else Ue(ee)};function Qe(Xe){var Ve=document.createEvent("MouseEvents");Ve.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Xe.dispatchEvent(Ve)}function Ge(Xe,Ve){var tt=window.URL||window.webkitURL||window,vt=new Blob([Ve]),Et=document.createElementNS("http://www.w3.org/1999/xhtml","a");Et.href=tt.createObjectURL(vt),Et.download=Xe,Qe(Et)}Object(N.useEffect)(function(){Je()},[Je]),Object(N.useEffect)(function(){fe.current&&!te&&Promise.all([B.e(16),B.e(28)]).then(B.t.bind(null,"M/lh",7)).then(function(Xe){try{S=Xe,ye.current.instance=S.editor.create(fe.current,{value:he,language:D(de),theme:We,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Ye);var Ve=ye.current.instance,tt=u.d._menuItems,vt=Object(H.a)(tt).find(function(ct){return ct[0]._debugName=="EditorContext"}),Et=vt[1],bt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ot=function(Tt,At){var _t=Tt._first;do{var Pt,It,Bt=At.includes((Pt=_t.element)===null||Pt===void 0||((It=Pt.command)===null||It===void 0)?void 0:It.id);Bt&&Tt._remove(_t)}while(_t=_t.next)};if(Pe(Ve,S),setTimeout(function(){Je(),ye.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ge(Ke||"educoder.txt",Ve.getValue())}}),Ve.getDomNode().addEventListener("input",function(){re.current.autoFormat&&Ve.getAction("editor.action.formatDocument").run()})},500),ye.current.subscription=Ve.onDidChangeModelContent(function(ct){J.current?clearTimeout(V.current):(Je(),pe(Ve.getValue(),ct)),V.current=setTimeout(function(){J.current=!1},500)}),window.Monaco||y(S,D(de)),se&&(Ot(Et,bt),fe.current.classList.add("noCopyPaste"),Ve.onKeyDown(function(ct){var Tt=ct.keyCode,At=ct.ctrlKey,_t=ct.metaKey;(Tt===33||Tt===52)&&(_t||At)&&(Oe(),ct.preventDefault())})),window.Monaco=S,be&&Ve.onDidBlurEditorWidget(function(){be(Ve.getValue())}),ke&&Ve.onDidFocusEditorText(function(){ke(Ve.getValue())}),se){Ve.addCommand(S.KeyMod.CtrlCmd|S.KeyCode.KEY_V,function(){return Oe(),null}),Ve.onDidPaste(function(ct){ye.current.pastePos=ct});try{window.addEventListener("paste",ze)}catch(ct){}}var Rt=ve();return le(!0),function(){var ct=ye.current.instance;ct.dispose();var Tt=ct.getModel();Tt&&Tt.dispose(),ye.current.subscription&&ye.current.subscription.dispose(),se&&window.removeEventListener("paste",ze),Rt.unobserve(fe.current)}}catch(ct){}})},[]),Object(N.useEffect)(function(){var Xe=ye.current.instance;if(Xe&&te)return document.addEventListener("keydown",Ne,!1),function(){document.removeEventListener("keydown",Ne)}},[Ee,te]),Object(N.useEffect)(function(){var Xe=ye.current.instance;if(Xe&&te){var Ve=D(de);S.editor.setModelLanguage(Xe.getModel(),Ve),console.log("language:",de,Xe.getModel(),Ve)}},[de,te]),Object(N.useEffect)(function(){var Xe=ye.current.instance;Xe&&te&&S.editor.setTheme(We)},[We,te]),Object(N.useEffect)(function(){var Xe=ye.current.instance;re.current=ae,Xe&&te&&(Xe.updateOptions(Object(Q.a)({},ae)),setTimeout(function(){Xe.getModel().updateOptions(Object(Q.a)({},ae))},200))},[JSON.stringify(ae),te]),Object(N.useEffect)(function(){var Xe=ye.current.instance;Xe&&te&&Xe.layout()},[G,ee,te]);var at=Object(N.useState)(_(G)),nt=Object(R.a)(at,2),rt=nt[0],dt=nt[1],et=Object(N.useState)(_(ee)),st=Object(R.a)(et,2),ut=st[0],Ue=st[1],pt=Object(Q.a)(Object(Q.a)({},xe),{},{width:rt,height:ut});return e.a.createElement("div",{className:"my-monaco-editor",ref:fe,style:pt})};function M(O){var j=O.width,G=j===void 0?"100%":j,X=O.height,ee=X===void 0?"100%":X,he=O.original,ge=O.modified,de=O.language,Te=O.options,xe=Te===void 0?{}:Te,ce=Object(N.useRef)(),ae=Object(N.useState)(null),Le=Object(R.a)(ae,2),Ye=Le[0],Fe=Le[1];function We(Ie){var $;return ce.current&&($=new C.default(function(se){var ue=Object(P.a)(se),pe;try{for(ue.s();!(pe=ue.n()).done;){var Se=pe.value;(Se.target.offsetHeight>0||Se.target.offsetWidth>0)&&Ie.layout()}}catch(Pe){ue.e(Pe)}finally{ue.f()}}),$.observe(ce.current)),$}Object(N.useEffect)(function(){ce.current&&Promise.all([B.e(16),B.e(28)]).then(B.t.bind(null,"M/lh",7)).then(function(Ie){S=Ie;var $=S.editor.createDiffEditor(ce.current,Object(Q.a)(Object(Q.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},xe),{},{wordWrap:!0}));Fe($);var se=We($);return function(){$.dispose();var ue=$.getModel();ue&&ue.dispose(),se.unobserve(ce.current)}})},[]),Object(N.useEffect)(function(){Ye&&Ye.setModel({original:S.editor.createModel(he,de),modified:S.editor.createModel(ge,de)})},[he,ge,de,Ye]);var be=_(G),Ee=_(ee),Ae={width:be,height:Ee};return e.a.createElement("div",{className:"my-diff-editor",ref:ce,style:Ae})}},bTeP:function(Me,ne,B){Me.exports={flex_box_center:"flex_box_center___14Ki3",flex_space_between:"flex_space_between___3TSad",flex_box_vertical_center:"flex_box_vertical_center___3pQXk",flex_box_center_end:"flex_box_center_end___29_cn",flex_box_column:"flex_box_column___16am0",title:"title___2mVJs",workListTabWrap:"workListTabWrap___1JlOB",workListTabButton:"workListTabButton___3umfp",tables:"tables___hLy6a",checkboxgroup:"checkboxgroup___2xMgu"}},biw7:function(Me,ne,B){"use strict";var Q=B("q1tI"),H=B.n(Q),I=Q.createContext(null);ne.a=I},deN7:function(Me,ne,B){"use strict";var Q=B("/zsF"),H=B("PArb"),I=B("14J3"),W=B("BMrR"),P=B("jCWc"),R=B("kPKH"),K=B("+L6B"),N=B("2/Rp"),e=B("miYZ"),C=B("tsqr"),E=B("9og8"),g=B("giR+"),h=B("fyUT"),a=B("2qtc"),i=B("kLXV"),l=B("7Kak"),s=B("9yH6"),n=B("tJVT"),r=B("k1fw"),t=B("OaEy"),b=B("2fM7"),v=B("WmNS"),m=B.n(v),T=B("q1tI"),y=B.n(T),f=B("ZW9T"),u=B("F0VM"),o=B.n(u),c=B("xKgJ"),_=B("J66h"),p=B.n(_),d=B("ErOA"),A=B("Ty5D"),D=B("9Bee"),S=B("XYT7"),L=B("RCxd"),M=B("/MfK"),O=b.a.Option,j={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},G;(function(ee){ee[ee.SET_PATH=0]="SET_PATH",ee[ee.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(G||(G={}));function X(ee,he){switch(he.type){case G.SET_PATH:return Object(r.a)(Object(r.a)({},ee),{},{selectedPath:he.payload});case G.GET_PASSED_CONTENT:return Object(r.a)(Object(r.a)({},ee),{},{passedContent:he.payload});default:throw new Error}}ne.a=function(ee){var he=ee.language,ge=ee.dispatch,de=ee.shixunWorkReport,Te=ee.v,xe=ee.languages,ce=ee.onPathChange,ae=ee.autoHeight,Le=ee.diff_code_count,Ye=ee.data,Fe=Object(T.useState)(xe==null?void 0:xe[0]),We=Object(n.a)(Fe,2),be=We[0],Ee=We[1],Ae=de!="shixunWorkReport"&&Object(A.i)();return Object(T.useEffect)(function(){Ee(xe==null?void 0:xe[0])},[]),Object(T.useEffect)(function(){var Ie;Ee(xe==null||((Ie=xe.filter(function($){return $.language===(be==null?void 0:be.language)}))===null||Ie===void 0)?void 0:Ie[0])},[xe]),y.a.createElement(y.a.Fragment,null,y.a.createElement("h2",null," ",y.a.createElement("span",null,y.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(xe==null?void 0:xe.length)>1&&y.a.createElement(s.a.Group,{defaultValue:he,style:{marginLeft:10},onChange:function($){var se;Ee(xe==null||((se=xe.filter(function(ue){return ue.language===$.target.value}))===null||se===void 0)?void 0:se[0])}},xe==null?void 0:xe.map(function(Ie){return y.a.createElement(s.a,{value:Ie==null?void 0:Ie.language},Ie==null?void 0:Ie.language)}))),Object(c.c)()&&de!="shixunWorkReport"&&y.a.createElement("span",null,y.a.createElement("span",null,"\u5F97\u5206 ",be==null?void 0:be.score,"/",be==null?void 0:be.total_score),y.a.createElement(N.a,{style:{margin:"0px 10px"},onClick:function(){var $=be==null?void 0:be.score;i.a.confirm({title:"\u8C03\u5206",content:y.a.createElement("div",null,y.a.createElement("p",null,"\u5F97\u5206\uFF1A",be==null?void 0:be.score,"/",be==null?void 0:be.total_score),y.a.createElement("p",null,"\u8C03\u5206\uFF1A",y.a.createElement(h.a,{min:0,max:be==null?void 0:be.total_score,defaultValue:be==null?void 0:be.score,onChange:function(ue){$=ue}}))),okText:"\u786E\u8BA4",onOk:function(){var se=Object(E.a)(m.a.mark(function pe(){var Se;return m.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return De.next=2,Object(d.a)("/api/courses/".concat(Ae==null?void 0:Ae.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:Ae==null?void 0:Ae.coursesId,hack_user_code_id:be==null?void 0:be.hack_user_id,score:$}});case 2:Se=De.sent,Se.status===0&&(C.b.success("\u8C03\u5206\u6210\u529F"),ge({type:"shixunHomeworks/setActionTabs",payload:{}}),ge({type:"shixunHomeworks/getShixunWorkReports",payload:Object(r.a)({},Ae)}));case 4:case"end":return De.stop()}},pe)}));function ue(){return se.apply(this,arguments)}return ue}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(c.c)()&&de!="shixunWorkReport"&&y.a.createElement(N.a,{onClick:function(){ge({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:de.user_id,type:"1",language:be==null?void 0:be.language,v:Te,data:Object(r.a)({},de)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),y.a.createElement(f.b,{height:300,language:be==null?void 0:be.language,value:_.Base64.decode(be==null?void 0:be.code),autoHeight:ae,theme:"default",options:j}),((be==null?void 0:be.comment)||(be==null?void 0:be.hidden_comment))&&y.a.createElement("div",null,y.a.createElement(W.a,{align:"middle",style:{borderTop:"1px solid #eee"}},y.a.createElement(R.a,{flex:1},y.a.createElement("h1",{className:o.a.title},"\u70B9\u8BC4\u5185\u5BB9")),y.a.createElement(R.a,{className:"pr30"},Object(c.c)()&&y.a.createElement(N.a,{onClick:Object(E.a)(m.a.mark(function Ie(){return m.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:i.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:y.a.createElement(L.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(E.a)(m.a.mark(function pe(){var Se;return m.a.wrap(function(De){for(;;)switch(De.prev=De.next){case 0:return De.next=2,Object(S.m)({comment_id:be==null?void 0:be.comment_id,homeworkId:Ae.homeworkId,type:"hack"});case 2:Se=De.sent,Se.status===0&&(C.b.success("\u5220\u9664\u6210\u529F"),ge({type:"shixunHomeworks/getShixunWorkReports",payload:Object(r.a)({},Ae)}));case 4:case"end":return De.stop()}},pe)}))()}});case 1:case"end":return se.stop()}},Ie)}))},y.a.createElement(M.a,null),"\u5220\u9664"))),y.a.createElement(H.a,{style:{margin:0}}),(be==null?void 0:be.comment)&&y.a.createElement("aside",{className:"pl30 pr30 mt20"},y.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),y.a.createElement("br",null),y.a.createElement(D.a,{value:be==null?void 0:be.comment})),(be==null?void 0:be.hidden_comment)&&y.a.createElement("aside",{className:"pl30 pr30 mt20"},y.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),y.a.createElement("br",null),y.a.createElement(D.a,{value:be==null?void 0:be.hidden_comment}))))}},dmUQ:function(Me,ne,B){"use strict";var Q=B("Ff2n"),H=B("rePB"),I=B("1OyB"),W=B("vuIU"),P=B("Ji7U"),R=B("md7G"),K=B("foSv"),N=B("q1tI"),e=B.n(N),C=B("TSYQ"),E=B.n(C),g=B("4IlW");function h(o,c){var _=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);c&&(p=p.filter(function(d){return Object.getOwnPropertyDescriptor(o,d).enumerable})),_.push.apply(_,p)}return _}function a(o){for(var c=1;c<arguments.length;c++){var _=arguments[c]!=null?arguments[c]:{};c%2?h(Object(_),!0).forEach(function(p){Object(H.a)(o,p,_[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(_)):h(Object(_)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(_,p))})}return o}function i(o){var c=l();return function(){var p=Object(K.a)(o),d;if(c){var A=Object(K.a)(this).constructor;d=Reflect.construct(p,arguments,A)}else d=p.apply(this,arguments);return Object(R.a)(this,d)}}function l(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(o){return!1}}function s(){}function n(o){o.preventDefault()}var r=function(c){return c.replace(/[^\w.-]+/g,"")},t=200,b=600,v=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,m=function(c){return c!=null},T=function(c,_){return _===c||typeof _=="number"&&typeof c=="number"&&isNaN(_)&&isNaN(c)},y=function(o){Object(P.a)(_,o);var c=i(_);function _(p){var d;Object(I.a)(this,_),d=c.call(this,p),d.onKeyDown=function(S){var L=d.props,M=L.onKeyDown,O=L.onPressEnter;if(S.keyCode===g.a.UP){var j=d.getRatio(S);d.up(S,j,null),d.stop()}else if(S.keyCode===g.a.DOWN){var G=d.getRatio(S);d.down(S,G,null),d.stop()}else S.keyCode===g.a.ENTER&&O&&O(S);if(d.recordCursorPosition(),d.lastKeyCode=S.keyCode,M){for(var X=arguments.length,ee=new Array(X>1?X-1:0),he=1;he<X;he++)ee[he-1]=arguments[he];M.apply(void 0,[S].concat(ee))}},d.onKeyUp=function(S){var L=d.props.onKeyUp;if(d.stop(),d.recordCursorPosition(),L){for(var M=arguments.length,O=new Array(M>1?M-1:0),j=1;j<M;j++)O[j-1]=arguments[j];L.apply(void 0,[S].concat(O))}},d.onChange=function(S){var L=d.props.onChange;d.state.focused&&(d.inputting=!0),d.rawInput=d.props.parser(d.getValueFromEvent(S)),d.setState({inputValue:d.rawInput}),L(d.toNumber(d.rawInput))},d.onMouseUp=function(){var S=d.props.onMouseUp;d.recordCursorPosition(),S&&S.apply(void 0,arguments)},d.onFocus=function(){var S;d.setState({focused:!0}),(S=d.props).onFocus.apply(S,arguments)},d.onBlur=function(){var S=d.props.onBlur;d.inputting=!1,d.setState({focused:!1});var L=d.getCurrentValidValue(d.state.inputValue),M=d.setValue(L,s);if(S){var O=d.input.value,j=d.getInputDisplayValue({focus:!1,value:M});d.input.value=j&&Number(j),S.apply(void 0,arguments),d.input.value=O}},d.getRatio=function(S){var L=1;return S.metaKey||S.ctrlKey?L=.1:S.shiftKey&&(L=10),L},d.getFullNum=function(S){return isNaN(S)?S:/e/i.test(String(S))?Number(S).toFixed(18).replace(/\.?0+$/,""):S},d.getPrecision=function(S){if(m(d.props.precision))return d.props.precision;var L=String(S);if(L.indexOf("e-")>=0)return parseInt(L.slice(L.indexOf("e-")+2),10);var M=0;return L.indexOf(".")>=0&&(M=L.length-L.indexOf(".")-1),M},d.getInputDisplayValue=function(S){var L=S||d.state,M=L.focused,O=L.inputValue,j=L.value,G;M?G=O:G=d.toPrecisionAsStep(j),G==null&&(G="");var X=d.formatWrapper(G);return m(d.props.decimalSeparator)&&(X=X.toString().replace(".",d.props.decimalSeparator)),X},d.recordCursorPosition=function(){try{d.cursorStart=d.input.selectionStart,d.cursorEnd=d.input.selectionEnd,d.currentValue=d.input.value,d.cursorBefore=d.input.value.substring(0,d.cursorStart),d.cursorAfter=d.input.value.substring(d.cursorEnd)}catch(S){}},d.restoreByAfter=function(S){if(S===void 0)return!1;var L=d.input.value,M=L.lastIndexOf(S);if(M===-1)return!1;var O=d.cursorBefore.length;return d.lastKeyCode===g.a.DELETE&&d.cursorBefore.charAt(O-1)===S[0]?(d.fixCaret(O,O),!0):M+S.length===L.length?(d.fixCaret(M,M),!0):!1},d.partRestoreByAfter=function(S){return S===void 0?!1:Array.prototype.some.call(S,function(L,M){var O=S.substring(M);return d.restoreByAfter(O)})},d.isNotCompleteNumber=function(S){return isNaN(S)||S===""||S===null||S&&S.toString().indexOf(".")===S.toString().length-1},d.stop=function(){d.autoStepTimer&&clearTimeout(d.autoStepTimer)},d.down=function(S,L,M){d.pressingUpOrDown=!0,d.step("down",S,L,M)},d.up=function(S,L,M){d.pressingUpOrDown=!0,d.step("up",S,L,M)},d.saveInput=function(S){d.input=S};var A=p.value;A===void 0&&(A=p.defaultValue),d.state={focused:p.autoFocus};var D=d.getValidValue(d.toNumber(A));return d.state=a(a({},d.state),{},{inputValue:d.toPrecisionAsStep(D),value:D}),d}return Object(W.a)(_,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(d){var A=this.props,D=A.value,S=A.onChange,L=A.max,M=A.min,O=this.state.focused;if(d){if(!T(d.value,D)||!T(d.max,L)||!T(d.min,M)){var j=O?D:this.getValidValue(D),G;this.pressingUpOrDown?G=j:this.inputting?G=this.rawInput:G=this.toPrecisionAsStep(j),this.setState({value:j,inputValue:G})}var X="value"in this.props?D:this.state.value;"max"in this.props&&d.max!==L&&typeof X=="number"&&X>L&&S&&S(L),"min"in this.props&&d.min!==M&&typeof X=="number"&&X<M&&S&&S(M)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ee=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?ee=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(ee=this.cursorStart):ee=this.input.value.length,this.fixCaret(ee,ee)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case g.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case g.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(he){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(d){var A=d;return A===""?A="":this.isNotCompleteNumber(parseFloat(A))?A=this.state.value:A=this.getValidValue(A),this.toNumber(A)}},{key:"getValueFromEvent",value:function(d){var A=d.target.value.trim().replace(/。/g,".");return m(this.props.decimalSeparator)&&(A=A.replace(this.props.decimalSeparator,".")),A}},{key:"getValidValue",value:function(d){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,S=parseFloat(d);return isNaN(S)?d:(S<A&&(S=A),S>D&&(S=D),S)}},{key:"setValue",value:function(d,A){var D=this.props.precision,S=this.isNotCompleteNumber(parseFloat(d))?null:parseFloat(d),L=this.state.value,M=L===void 0?null:L,O=this.state.inputValue,j=O===void 0?null:O,G=typeof S=="number"?S.toFixed(D):"".concat(S),X=S!==M||G!=="".concat(j);return"value"in this.props?(j=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:j},A)):this.setState({value:S,inputValue:this.toPrecisionAsStep(d)},A),X&&this.props.onChange(S),S}},{key:"getMaxPrecision",value:function(d){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,D=this.props,S=D.precision,L=D.step;if(m(S))return S;var M=this.getPrecision(A),O=this.getPrecision(L),j=this.getPrecision(d);return d?Math.max(j,M+O):M+O}},{key:"getPrecisionFactor",value:function(d){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,D=this.getMaxPrecision(d,A);return Math.pow(10,D)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(d){return this.props.formatter?this.props.formatter(d):d}},{key:"toPrecisionAsStep",value:function(d){if(this.isNotCompleteNumber(d)||d==="")return d;var A=Math.abs(this.getMaxPrecision(d));return isNaN(A)?d.toString():Number(d).toFixed(A)}},{key:"toNumber",value:function(d){var A=this.props.precision,D=this.state.focused,S=d&&d.length>16&&D;return this.isNotCompleteNumber(d)||S?d:m(A)?Math.round(d*Math.pow(10,A))/Math.pow(10,A):Number(d)}},{key:"upStep",value:function(d,A){var D=this.props.step,S=this.getPrecisionFactor(d,A),L=Math.abs(this.getMaxPrecision(d,A)),M=((S*d+S*D*A)/S).toFixed(L);return this.toNumber(M)}},{key:"downStep",value:function(d,A){var D=this.props.step,S=this.getPrecisionFactor(d,A),L=Math.abs(this.getMaxPrecision(d,A)),M=((S*d-S*D*A)/S).toFixed(L);return this.toNumber(M)}},{key:"step",value:function(d,A){var D=this,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,L=arguments.length>3?arguments[3]:void 0;this.stop(),A&&(A.persist(),A.preventDefault());var M=this.props;if(M.disabled)return;var O=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(O))return;var j=this["".concat(d,"Step")](O,S),G=j>M.max||j<M.min;if(j>M.max?j=M.max:j<M.min&&(j=M.min),this.setValue(j,null),this.setState({focused:!0},function(){D.pressingUpOrDown=!1}),G)return;this.autoStepTimer=setTimeout(function(){D[d](A,S,!0)},L?t:b)}},{key:"fixCaret",value:function(d,A){if(d===void 0||A===void 0||!this.input||!this.input.value)return;try{var D=this.input.selectionStart,S=this.input.selectionEnd;(d!==D||A!==S)&&this.input.setSelectionRange(d,A)}catch(L){}}},{key:"render",value:function(){var d,A=this.props,D=A.prefixCls,S=A.disabled,L=A.readOnly,M=A.useTouch,O=A.autoComplete,j=A.upHandler,G=A.downHandler,X=A.className,ee=A.max,he=A.min,ge=A.style,de=A.title,Te=A.onMouseEnter,xe=A.onMouseLeave,ce=A.onMouseOver,ae=A.onMouseOut,Le=A.required,Ye=A.onClick,Fe=A.tabIndex,We=A.type,be=A.placeholder,Ee=A.id,Ae=A.inputMode,Ie=A.pattern,$=A.step,se=A.maxLength,ue=A.autoFocus,pe=A.name,Se=A.onPaste,Pe=A.onInput,De=Object(Q.a)(A,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),ke=this.state,Be=ke.value,Ke=ke.focused,oe=E()(D,(d={},Object(H.a)(d,X,!!X),Object(H.a)(d,"".concat(D,"-disabled"),S),Object(H.a)(d,"".concat(D,"-focused"),Ke),d)),me={};Object.keys(De).forEach(function(te){(te.substr(0,5)==="data-"||te.substr(0,5)==="aria-"||te==="role")&&(me[te]=De[te])});var _e=!L&&!S,we=this.getInputDisplayValue(null),fe=(Be||Be===0)&&(isNaN(Be)||Number(Be)>=ee),ye=(Be||Be===0)&&(isNaN(Be)||Number(Be)<=he),re=fe||S||L,Z=ye||S||L,J=E()("".concat(D,"-handler"),"".concat(D,"-handler-up"),Object(H.a)({},"".concat(D,"-handler-up-disabled"),re)),V=E()("".concat(D,"-handler"),"".concat(D,"-handler-down"),Object(H.a)({},"".concat(D,"-handler-down-disabled"),Z)),Y=M?{onTouchStart:re?s:this.up,onTouchEnd:this.stop}:{onMouseDown:re?s:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},q=M?{onTouchStart:Z?s:this.down,onTouchEnd:this.stop}:{onMouseDown:Z?s:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return e.a.createElement("div",{className:oe,style:ge,title:de,onMouseEnter:Te,onMouseLeave:xe,onMouseOver:ce,onMouseOut:ae,onFocus:function(){return null},onBlur:function(){return null}},e.a.createElement("div",{className:"".concat(D,"-handler-wrap")},e.a.createElement("span",Object.assign({unselectable:"on"},Y,{role:"button","aria-label":"Increase Value","aria-disabled":re,className:J}),j||e.a.createElement("span",{unselectable:"on",className:"".concat(D,"-handler-up-inner"),onClick:n})),e.a.createElement("span",Object.assign({unselectable:"on"},q,{role:"button","aria-label":"Decrease Value","aria-disabled":Z,className:V}),G||e.a.createElement("span",{unselectable:"on",className:"".concat(D,"-handler-down-inner"),onClick:n}))),e.a.createElement("div",{className:"".concat(D,"-input-wrap")},e.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":he,"aria-valuemax":ee,"aria-valuenow":Be,required:Le,type:We,placeholder:be,onPaste:Se,onClick:Ye,onMouseUp:this.onMouseUp,className:"".concat(D,"-input"),tabIndex:Fe,autoComplete:O,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:_e?this.onKeyDown:s,onKeyUp:_e?this.onKeyUp:s,autoFocus:ue,maxLength:se,readOnly:L,disabled:S,max:ee,min:he,step:$,name:pe,title:de,id:Ee,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(we),pattern:Ie,inputMode:Ae,onInput:Pe},me))))}}]),_}(e.a.Component);y.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:s,onKeyDown:s,onPressEnter:s,onFocus:s,onBlur:s,parser:r,required:!1,autoComplete:"off"};var f=y,u=ne.a=f},fjLI:function(Me,ne,B){"use strict";B.d(ne,"f",function(){return h}),B.d(ne,"b",function(){return a}),B.d(ne,"a",function(){return i}),B.d(ne,"d",function(){return l}),B.d(ne,"e",function(){return s}),B.d(ne,"c",function(){return n});var Q=B("8HAY"),H=B("Vhoy"),I=B("MI8n"),W=B("JYp7"),P=B("pmY6"),R=B("24hK"),K=B("nnTU"),N=B("T8No"),e=B("Cg/j"),C=B("t9D7"),E=function(r,t,b,v){var m=arguments.length,T=m<3?t:v===null?v=Object.getOwnPropertyDescriptor(t,b):v,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(r,t,b,v);else for(var f=r.length-1;f>=0;f--)(y=r[f])&&(T=(m<3?y(T):m>3?y(t,b,T):y(t,b))||T);return m>3&&T&&Object.defineProperty(t,b,T),T},g=function(r,t){return function(b,v){t(b,v,r)}};function h(r){return r.command!==void 0}class a{constructor(r){this.id=a._idPool++,this._debugName=r}}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"),l=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new I.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:r=>r===a.CommandPalette}}addCommand(r){return this.addCommands(W.a.single(r))}addCommands(r){for(const t of r)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(P.i)(()=>{let t=!1;for(const b of r)t=this._commands.delete(b.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(r){return this._commands.get(r)}getCommands(){const r=new Map;return this._commands.forEach((t,b)=>r.set(b,t)),r}appendMenuItem(r,t){return this.appendMenuItems(W.a.single({id:r,item:t}))}appendMenuItems(r){const t=new Set,b=new R.a;for(const{id:v,item:m}of r){let T=this._menuItems.get(v);T||(T=new R.a,this._menuItems.set(v,T)),b.push(T.push(m)),t.add(v)}return this._onDidChangeMenu.fire(t),Object(P.i)(()=>{if(b.size>0){for(let v of b)v();this._onDidChangeMenu.fire(t),b.clear()}})}getMenuItems(r){let t;return this._menuItems.has(r)?t=[...this._menuItems.get(r)]:t=[],r===a.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(r){const t=new Set;for(const b of r)h(b)&&(t.add(b.command.id),b.alt&&t.add(b.alt.id));this._commands.forEach((b,v)=>{t.has(v)||r.push({command:b})})}};class s extends Q.e{constructor(r,t,b,v){super(`submenuitem.${r.submenu.id}`,typeof r.title=="string"?r.title:r.title.value,[],"submenu");this.item=r,this._menuService=t,this._contextKeyService=b,this._options=v}get actions(){const r=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),b=t.getActions(this._options);t.dispose();for(const[,v]of b)v.length>0&&(r.push(...v),r.push(new Q.d));return r.length&&r.pop(),r}}let n=class r{constructor(t,b,v,m,T){var y,f;if(this._commandService=T,this.id=t.id,this.label=(v==null?void 0:v.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(f=typeof t.tooltip=="string"?t.tooltip:(y=t.tooltip)===null||y===void 0?void 0:y.value)!==null&&f!==void 0?f:"",this.enabled=!t.precondition||m.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const u=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=m.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}this.item=t,this.alt=b?new r(b,void 0,v,m,T):void 0,this._options=v,C.d.isThemeIcon(t.icon)&&(this.class=H.a.asClassName(t.icon))}dispose(){}run(...t){var b,v;let m=[];return((b=this._options)===null||b===void 0?void 0:b.arg)&&(m=[...m,this._options.arg]),((v=this._options)===null||v===void 0?void 0:v.shouldForwardArgs)&&(m=[...m,...t]),this._commandService.executeCommand(this.id,...m)}};n=E([g(3,N.b),g(4,K.b)],n)},fyJ8:function(Me,ne,B){"use strict";var Q=B("rePB"),H=B("VTBJ"),I=B("Ff2n"),W=B("U8pU"),P=B("q1tI"),R=B.n(P),K=B("TSYQ"),N=B.n(K),e=B("c+Xe"),C=B("sR1s");function E(l){return l&&Object(W.a)(l)==="object"&&!Array.isArray(l)&&!P.isValidElement(l)}function g(l){return typeof l=="string"?!0:Object(e.c)(l)}function h(l,s){var n,r=l.prefixCls,t=l.className,b=l.record,v=l.index,m=l.dataIndex,T=l.render,y=l.children,f=l.component,u=f===void 0?"td":f,o=l.colSpan,c=l.rowSpan,_=l.fixLeft,p=l.fixRight,d=l.firstFixLeft,A=l.lastFixLeft,D=l.firstFixRight,S=l.lastFixRight,L=l.appendNode,M=l.additionalProps,O=M===void 0?{}:M,j=l.ellipsis,G=l.align,X=l.rowType,ee=l.isSticky,he="".concat(r,"-cell"),ge,de;if(y)de=y;else{var Te=Object(C.b)(b,m);if(de=Te,T){var xe=T(Te,b,v);E(xe)?(de=xe.children,ge=xe.props):de=xe}}Object(W.a)(de)==="object"&&!Array.isArray(de)&&!P.isValidElement(de)&&(de=null),j&&(A||D)&&(de=P.createElement("span",{className:"".concat(he,"-content")},de));var ce=ge||{},ae=ce.colSpan,Le=ce.rowSpan,Ye=ce.style,Fe=ce.className,We=Object(I.a)(ce,["colSpan","rowSpan","style","className"]),be=ae!==void 0?ae:o,Ee=Le!==void 0?Le:c;if(be===0||Ee===0)return null;var Ae={},Ie=typeof _=="number",$=typeof p=="number";Ie&&(Ae.position="sticky",Ae.left=_),$&&(Ae.position="sticky",Ae.right=p);var se={};G&&(se.textAlign=G);var ue,pe=j===!0?{showTitle:!0}:j;pe&&(pe.showTitle||X==="header")&&(typeof de=="string"||typeof de=="number"?ue=de.toString():P.isValidElement(de)&&typeof de.props.children=="string"&&(ue=de.props.children));var Se=Object(H.a)(Object(H.a)(Object(H.a)({title:ue},We),O),{},{colSpan:be&&be!==1?be:null,rowSpan:Ee&&Ee!==1?Ee:null,className:N()(he,t,(n={},Object(Q.a)(n,"".concat(he,"-fix-left"),Ie),Object(Q.a)(n,"".concat(he,"-fix-left-first"),d),Object(Q.a)(n,"".concat(he,"-fix-left-last"),A),Object(Q.a)(n,"".concat(he,"-fix-right"),$),Object(Q.a)(n,"".concat(he,"-fix-right-first"),D),Object(Q.a)(n,"".concat(he,"-fix-right-last"),S),Object(Q.a)(n,"".concat(he,"-ellipsis"),j),Object(Q.a)(n,"".concat(he,"-with-append"),L),Object(Q.a)(n,"".concat(he,"-fix-sticky"),(Ie||$)&&ee),n),O.className,Fe),style:Object(H.a)(Object(H.a)(Object(H.a)(Object(H.a)({},O.style),se),Ae),Ye),ref:g(u)?s:null});return P.createElement(u,Object.assign({},Se),L,de)}var a=P.forwardRef(h);a.displayName="Cell";var i=P.memo(a,function(l,s){return s.shouldCellUpdate?!s.shouldCellUpdate(s.record,l.record):!1});ne.a=i},hW8S:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return W}),B.d(ne,"c",function(){return P}),B.d(ne,"b",function(){return R});var Q=B("VTBJ"),H=B("Ff2n"),I=B("Kwbf"),W="RC_TABLE_INTERNAL_COL_DEFINE";function P(K){var N=K.expandable,e=Object(H.a)(K,["expandable"]);return"expandable"in K?Object(Q.a)(Object(Q.a)({},e),N):e}function R(K){return Object.keys(K).reduce(function(N,e){return(e.substr(0,5)==="data-"||e.substr(0,5)==="aria-")&&(N[e]=K[e]),N},{})}},ic2d:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return W});var Q=B("FWmy"),H=B("746U");class I{constructor(){this.data=new Map}add(P,R){Q.a(H.l(P)),Q.a(H.k(R)),Q.a(!this.data.has(P),"There is already an extension with this id"),this.data.set(P,R)}as(P){return this.data.get(P)||null}}const W=new I},mauG:function(Me,ne,B){"use strict";B.r(ne);var Q=B("DjyN"),H=B("NUBc"),I=B("g9YV"),W=B("wCAj"),P=B("2qtc"),R=B("kLXV"),K=B("miYZ"),N=B("tsqr"),e=B("7Kak"),C=B("9yH6"),E=B("sRBo"),g=B("kaz8"),h=B("oBTY"),a=B("/zsF"),i=B("PArb"),l=B("+L6B"),s=B("2/Rp"),n=B("9og8"),r=B("k1fw"),t=B("tJVT"),b=B("WmNS"),v=B.n(b),m=B("q1tI"),T=B.n(m),y=B("Ty5D"),f=B("55Ip"),u=B("9kvl"),o=B("xKgJ"),c=B("bTeP"),_=B.n(c),p=B("ErOA"),d=B("jhfD"),A=B("m3rI"),D=B("deN7"),S=B("J66h"),L=B.n(S),M=B("mgmH"),O=B("sZk2"),j=B.n(O),G=B("+92d"),X=B.n(G),ee=B("wwSX"),he=B.n(ee),ge=B("zlzj"),de=B.n(ge),Te=[X.a,he.a,de.a],xe=function(ae){var Le,Ye,Fe,We,be,Ee=ae.user,Ae=Object(m.useState)(Object(r.a)(Object(r.a)({},Object(y.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(o.s)()?[Ee.userInfo.course.course_group_id]:[]})),Ie=Object(t.a)(Ae,2),$=Ie[0],se=Ie[1],ue=Object(m.useState)([]),pe=Object(t.a)(ue,2),Se=pe[0],Pe=pe[1],De=Object(m.useState)([]),ke=Object(t.a)(De,2),Be=ke[0],Ke=ke[1],oe=Object(m.useState)([]),me=Object(t.a)(oe,2),_e=me[0],we=me[1];Object(m.useEffect)(function(){var re;Ee!=null&&(re=Ee.userInfo)!==null&&re!==void 0&&re.course&&(Object(o.s)()&&($.course_group=Object(o.s)()?[Ee.userInfo.course.course_group_id]:[],se(Object(r.a)({},$))),fe(1))},[Ee==null?void 0:Ee.userInfo]);function fe(re){return ye.apply(this,arguments)}function ye(){return ye=Object(n.a)(v.a.mark(function re(Z){var J,V,Y;return v.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(p.a)("/api/courses/question_rank_list.json",{method:"get",params:Object(r.a)(Object(r.a)({},$),{},{id:$.coursesId,identifier:$.homeworkId})});case 2:J=te.sent,Pe(J),Object(o.s)()?(Z===1&&Ke([J==null||((V=J.course_group)===null||V===void 0||((Y=V[0])===null||Y===void 0))?void 0:Y.id]),J!=null&&J.my_rank?we([J==null?void 0:J.my_rank].concat(Object(h.a)(J==null?void 0:J.rank_list))):we(Object(h.a)(J==null?void 0:J.rank_list))):we(Object(h.a)(J==null?void 0:J.rank_list));case 5:case"end":return te.stop()}},re)})),ye.apply(this,arguments)}return T.a.createElement("div",{style:{width:1200,margin:"0px auto"}},T.a.createElement("aside",{className:[_.a.title,"mt20"].join(" ")},T.a.createElement(f.a,{to:"/classrooms/".concat($.coursesId,"/program_homework/").concat($.categoryId,"/detail")},T.a.createElement(d.a,{className:"font16 c-black"})),T.a.createElement("strong",{className:"font20 ml5"},"\u6392\u884C\u699C"," ",T.a.createElement("span",{style:{fontSize:14,color:"#B1BACD"}},"\u6392\u884C\u89C4\u5219\uFF1A\u5728\u8FD0\u884C\u65F6\u95F4\u76F8\u540C\u65F6\uFF0C\u5C06\u6839\u636E\u8FD0\u884C\u5185\u5B58\u3001\u63D0\u4EA4\u65F6\u95F4\u4F9D\u6B21\u8FDB\u884C\u6392\u5E8F")),T.a.createElement("span",{style:{color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},T.a.createElement(s.a,{style:{marginRight:10},onClick:Object(n.a)(v.a.mark(function re(){var Z;return v.a.wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,Object(p.a)("/api/problems/".concat($.homeworkId,"/start.json"),{method:"get"});case 2:Z=V.sent,Z&&(window.open("/myproblems/".concat(Z==null?void 0:Z.identifier,"?type=1")),localStorage.setItem("program_homework",[$.coursesId,$.categoryId]));case 4:case"end":return V.stop()}},re)}))},"\u67E5\u770B\u9898\u76EE"),Object(o.c)()&&T.a.createElement(s.a,{onClick:function(){Object(M.u)(Object(r.a)(Object(r.a)({},$),{},{id:$.coursesId,identifier:$.homeworkId}))}},"\u5BFC\u51FA"))),T.a.createElement("div",{style:{background:"#fff",marginTop:10,padding:40}},T.a.createElement("div",null,T.a.createElement("p",{style:{color:"#165DFF",fontSize:18,fontWeight:400}},T.a.createElement("img",{width:20,src:j.a,style:{marginRight:5}})," \u9898\u76EE\u6392\u884C\u699C")),T.a.createElement(i.a,null),T.a.createElement("div",{style:{display:"inline-flex"}},T.a.createElement("label",null,"\u5206\u73ED\u60C5\u51B5\uFF1A"),Object(o.c)()&&T.a.createElement("div",{style:{flex:1}},T.a.createElement(g.a.Group,{className:_.a.checkboxgroup,value:Be,onChange:function(Z){if($.type===1)Ke([]),$.course_group=[],$.page=1,se(Object(r.a)({},$)),fe();else if($.type===2){var J;Ke(["\u5168\u90E8"].concat()),$.course_group=Se==null||((J=Se.course_group)===null||J===void 0)?void 0:J.map(function(V){return V.id}),$.page=1,se(Object(r.a)({},$)),fe()}else Ke(Object(h.a)(Z.filter(function(V){return V!="\u5168\u90E8"}))),$.course_group=Z.filter(function(V){return V!="\u5168\u90E8"}),$.page=1,se(Object(r.a)({},$)),fe()}},T.a.createElement(g.a,{value:"\u5168\u90E8",onChange:function(Z){Z.target.checked?$.type=2:$.type=1}},"\u5168\u90E8\u5206\u73ED"),Se==null||((Le=Se.course_group)===null||Le===void 0)?void 0:Le.map(function(re,Z){return T.a.createElement(g.a,{onChange:function(V){$.type=3},value:re.id},re==null?void 0:re.name)}))),Object(o.s)()&&T.a.createElement(C.a.Group,{style:{flex:1,display:"flex",alignItems:"center"},onChange:function(Z){Z.target.value==="\u5168\u90E8"?($.course_group=[],$.page=1,se(Object(r.a)({},$)),fe()):($.course_group=[Z.target.value],$.page=1,se(Object(r.a)({},$)),fe())},defaultValue:Ee.userInfo.course.course_group_id},T.a.createElement(C.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),Se==null||((Ye=Se.course_group)===null||Ye===void 0)?void 0:Ye.map(function(re,Z){return T.a.createElement(C.a,{value:re.id},re.name)}))),(Se==null||((Fe=Se.all_language)===null||Fe===void 0)?void 0:Fe.length)>1&&T.a.createElement("div",{style:{marginTop:10}},T.a.createElement("label",null,"\u7F16\u8BD1\u8BED\u8A00\uFF1A"),T.a.createElement(C.a.Group,{className:_.a.checkboxgroup,style:{width:"90%"},onChange:function(Z){$.language=encodeURIComponent(Z.target.value),$.page=1,se(Object(r.a)({},$)),fe()},defaultValue:Se==null||((We=Se.all_language)===null||We===void 0)?void 0:We[0]},Se==null||((be=Se.all_language)===null||be===void 0)?void 0:be.map(function(re,Z){return T.a.createElement(C.a,{value:re},re)}))),T.a.createElement(W.a,{style:{marginTop:10},pagination:!1,dataSource:_e,rowClassName:function(Z,J){return J===0&&Object(o.s)()&&_.a.tables},columns:[{title:"\u6392\u884C",dataIndex:"rank",render:function(Z,J,V){return Z<4?T.a.createElement("img",{src:Te[Z-1]}):Z}},{title:"\u7528\u6237",dataIndex:"user_name",key:"user_name",render:function(Z,J,V){return T.a.createElement("div",null,T.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:A.a.IMG_SERVER+"/images/"+(J==null?void 0:J.image_url)}),Z)}},{title:"\u5B66\u53F7",dataIndex:"student_id",key:"student_id",render:function(Z){return Z||"- -"}},{title:"\u5206\u73ED",dataIndex:"course_group",key:"course_group"},{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"submit_time",key:"submit_time"},{title:"\u8FD0\u7528\u65F6\u95F4\uFF08ms\uFF09",dataIndex:"run_time",key:"run_time"},{title:"\u5185\u5B58\uFF08kb\uFF09",dataIndex:"memory",key:"memory"},{title:"\u7F16\u8BD1\u8BED\u8A00",dataIndex:"language",key:"language"},(Se==null?void 0:Se.open_code)&&{title:"\u64CD\u4F5C",dataIndex:"passed_rate",key:"passed_rate",render:function(Z,J){return T.a.createElement("div",{style:{cursor:"pointer",color:"rgb(22, 93, 255)"},onClick:Object(n.a)(v.a.mark(function V(){var Y;return v.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:if(!((J==null?void 0:J.code)==="-")){te.next=3;break}return N.b.info("\u6682\u65E0\u4EE3\u7801"),te.abrupt("return");case 3:return te.next=5,Object(p.a)("/api/courses/view_code.json",{method:"get",params:Object(r.a)(Object(r.a)({},$),{},{id:$.coursesId,homework_common_id:$.homeworkId,hack_user_code_id:J==null?void 0:J.hack_user_code_id})});case 5:Y=te.sent,R.a.warning({icon:null,title:"\u67E5\u770B\u4EE3\u7801",content:T.a.createElement(D.a,{languages:[{language:J.language,code:Y.code}],v:J,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:J.language,game_id:J.id,data:S.Base64.decode(Y.code),diff_code_count:J.diff_code_count})});case 7:case"end":return te.stop()}},V)}))},"\u67E5\u770B\u4EE3\u7801")}}].filter(function(re){return!!re})}),T.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},T.a.createElement(H.a,{current:$.page,pageSize:$.per_page,total:Se==null?void 0:Se.count,hideOnSinglePage:!0,onChange:function(Z,J){$.page=Z,$.per_page=J,se(Object(r.a)({},$)),fe()}}))))};ne.default=Object(u.a)(function(ce){var ae=ce.user;return{user:ae}})(xe)},mgmH:function(Me,ne,B){"use strict";B.d(ne,"d",function(){return h}),B.d(ne,"b",function(){return a}),B.d(ne,"e",function(){return i}),B.d(ne,"c",function(){return l}),B.d(ne,"n",function(){return s}),B.d(ne,"g",function(){return n}),B.d(ne,"h",function(){return r}),B.d(ne,"j",function(){return b}),B.d(ne,"a",function(){return v}),B.d(ne,"l",function(){return m}),B.d(ne,"f",function(){return T}),B.d(ne,"k",function(){return y}),B.d(ne,"m",function(){return f}),B.d(ne,"i",function(){return u}),B.d(ne,"o",function(){return o}),B.d(ne,"t",function(){return c}),B.d(ne,"s",function(){return _}),B.d(ne,"p",function(){return p}),B.d(ne,"q",function(){return d}),B.d(ne,"r",function(){return A}),B.d(ne,"v",function(){return D}),B.d(ne,"u",function(){return S});var Q=B("miYZ"),H=B("tsqr"),I=B("k1fw"),W=B("9og8"),P=B("WmNS"),R=B.n(P),K=B("oUNq"),N=B("9kvl"),e=B("1vsH"),C=B("m3rI"),E=function(){Object(N.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},g=function(){Object(N.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},h=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return E(),X.next=3,Object(K.t)(Object(I.a)({},O));case 3:if(j=X.sent,!(j.status===0)){X.next=7;break}return X.next=7,Object(e.w)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/export_couser_info.json"),query:O}));case 7:g();case 8:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),a=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.r)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_member_act_score")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),i=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.u)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_score")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_score")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),l=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.s)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),s=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.z)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),n=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.v)(Object(I.a)({},O));case 2:if(j=X.sent,!(j.status===0)){X.next=8;break}H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_homework")),X.next=13;break;case 8:if(!(j.status===-2)){X.next=12;break}return X.abrupt("return",j);case 12:j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),r=function(){var L=Object(W.a)(R.a.mark(function M(O,j){var G;return R.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(K.x)(Object(I.a)({},O));case 2:G=ee.sent,G.status===0?(H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/").concat(j))):G.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/").concat(j)));case 4:case"end":return ee.stop()}},M)}));return function(O,j){return L.apply(this,arguments)}}(),t=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return E(),X.next=3,Object(K.w)(Object(I.a)({},O));case 3:if(j=X.sent,!(j.status===0)){X.next=7;break}return X.next=7,Object(e.w)("",Object(e.Y)({url:C.a.API_SERVER+"/api/homework_commons/".concat(O.categoryId,"/works_list.zip"),query:O}));case 7:g();case 8:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),b=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return E(),X.next=3,Object(K.A)(Object(I.a)({},O));case 3:if(j=X.sent,!(j.status===0)){X.next=7;break}return X.next=7,Object(e.w)("",Object(e.Y)({url:C.a.API_SERVER+"/api/polls/".concat(O.categoryId,"/commit_result.xlsx"),query:O}));case 7:g();case 8:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),v=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/attendances/export_xlsx_data.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),m=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/video_study_statics.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),T=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/".concat(O.coursesId,"/export_course_students_info.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),y=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/item_banks/export.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),f=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),u=function(){var L=Object(W.a)(R.a.mark(function M(O){var j;return R.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:return X.next=2,Object(K.y)(Object(I.a)({},O));case 2:j=X.sent,j.status===0?(H.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/exercise_score"))):j.status===-3&&(Object(N.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),N.d.push("/classrooms/".concat(O.coursesId,"/exportlist/exercise_score")));case 4:case"end":return X.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),o=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),G.next=3,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/export_records/".concat(O.id,".xlsx"),query:O}));case 3:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),c=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),_=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/ec_years/".concat(O==null?void 0:O.ec_year_id,"/ec_training_objectives.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),p=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)(O==null?void 0:O.name,Object(e.Y)({url:C.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),d=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/ec_years/".concat(O==null?void 0:O.ec_year_id,"/ec_courses.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),A=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/ec_years/".concat(O==null?void 0:O.ec_year_id,"/ec_graduation_requirements.xlsx"),query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),D=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/rank_list.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}(),S=function(){var L=Object(W.a)(R.a.mark(function M(O){return R.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(e.v)("",Object(e.Y)({url:C.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:O}));case 2:case"end":return G.stop()}},M)}));return function(O){return L.apply(this,arguments)}}()},n6Qo:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return N});var Q=B("q1tI"),H=B("biw7"),I=B("fyJ8");function W(e){var C=e.className,E=e.index,g=e.children,h=e.colSpan,a=e.rowSpan,i=Q.useContext(H.a),l=i.prefixCls,s=i.fixedInfoList,n=s[E];return Q.createElement(I.a,Object.assign({className:C,index:E,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:g,props:{colSpan:h,rowSpan:a}}}},n))}function P(e){return Q.createElement("tr",Object.assign({},e))}function R(e){var C=e.children,E=Q.useContext(H.a),g=E.prefixCls;return Q.createElement("tfoot",{className:"".concat(g,"-summary")},C)}var K=ne.b=R,N={Cell:W,Row:P}},nEHx:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return Q});var Q;(function(H){H.DARK="dark",H.LIGHT="light",H.HIGH_CONTRAST="hc"})(Q||(Q={}))},nnTU:function(Me,ne,B){"use strict";B.d(ne,"b",function(){return K}),B.d(ne,"a",function(){return N});var Q=B("MI8n"),H=B("JYp7"),I=B("pmY6"),W=B("24hK"),P=B("746U"),R=B("Cg/j");const K=Object(R.c)("commandService"),N=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Q.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,C){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!C)throw new Error("invalid command");return this.registerCommand({id:e,handler:C})}if(e.description){const i=[];for(let s of e.description.args)i.push(s.constraint);const l=e.handler;e.handler=function(s,...n){return Object(P.o)(n,i),l(s,...n)}}const{id:E}=e;let g=this._commands.get(E);g||(g=new W.a,this._commands.set(E,g));let h=g.unshift(e),a=Object(I.i)(()=>{h();const i=this._commands.get(E);(i==null?void 0:i.isEmpty())&&this._commands.delete(E)});return this._onDidRegisterCommand.fire(E),a}registerCommandAlias(e,C){return N.registerCommand(e,(E,...g)=>E.get(K).executeCommand(C,...g))}getCommand(e){const C=this._commands.get(e);return!C||C.isEmpty()?void 0:H.a.first(C)}getCommands(){const e=new Map;for(const C of this._commands.keys()){const E=this.getCommand(C);E&&e.set(C,E)}return e}};N.registerCommand("noop",()=>{})},p5ED:function(Me,ne,B){"use strict";var Q=B("+L6B"),H=B("2/Rp"),I=B("5Dmo"),W=B("3S7+"),P=B("k1fw"),R=B("tJVT"),K=B("q1tI"),N=B.n(K),e=B("vHTk"),C=B.n(e),E=B("yEEn"),g=B("ZW9T"),h=B("1vsH");ne.a=function(a){var i=a.name,l=a.data,s=a.theme,n=a.type,r=a.filename,t=a.monacoEditor,b=a.className,v=a.style,m=a.close,T=a.onClose,y=a.hasMask,f=Object(K.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),u=Object(R.a)(f,2),o=u[0],c=u[1],_=Object(K.useState)(""),p=Object(R.a)(_,2),d=p[0],A=p[1],D,S=1024*1024,L=10*S,M=Object(K.useRef)();n==="office"&&(D=Object(h.T)(l).filesize,D>L&&(n="other")),r&&(t.filename=r),Object(K.useEffect)(function(){var G,X,ee=(G=document.cookie)===null||G===void 0||((X=G.replace(/\s/g,""))===null||X===void 0)?void 0:X.split(";");ee==null||ee.map(function(he){var ge=he.split("=");ge[0]==="_educoder_session"&&A(ge[1])})},[]);var O=function(){if(l.startsWith("http")||l.startsWith("/")){j();return}Object(h.z)(r||"educoder",l,r)},j=function(){Object(h.x)(r||i,l)};return console.log("data:",l,"fileanme:",r," name:",i),N.a.createElement("div",{style:Object(P.a)({},v||{}),className:"".concat(y&&C.a.bgBlack," ").concat(n?C.a.wrp:"hide")},m&&N.a.createElement("div",{className:C.a.close,ref:M},N.a.createElement(W.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return M.current}},N.a.createElement("span",{onClick:j},N.a.createElement("i",{className:"icon-quxiaozhiding"}))),N.a.createElement(W.a,{title:"\u5173\u95ED",getPopupContainer:function(){return M.current}},N.a.createElement("span",{className:"",onClick:T},N.a.createElement("i",{className:"icon-guanbi1"})))),N.a.createElement("div",{className:"".concat(C.a[b]," ").concat(b," ").concat(C.a.monaco," ").concat(n==="txt"?"show":"hide")},n==="txt"&&N.a.createElement(g.b,t)),n==="audio"&&N.a.createElement("audio",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?l:"data:audio/mp3;base64,").concat(l),autoPlay:!0}),n==="video"&&N.a.createElement(N.a.Fragment,null,l!=null&&l.startsWith("/")?N.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):N.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),n==="html"&&N.a.createElement("iframe",{src:l+"&disposition=inline"}),n==="pdf"&&N.a.createElement("embed",{className:C.a.embed,src:l}),n==="image"&&N.a.createElement(N.a.Fragment,null,N.a.createElement("img",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)})),n==="other"&&N.a.createElement("div",null,N.a.createElement(H.a,{type:"primary",size:"large",onClick:O},N.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(n==="download"||n==="office")&&N.a.createElement(H.a,{type:"primary",size:"large",onClick:O},N.a.createElement(E.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Me,ne,B){"use strict";B.d(ne,"h",function(){return C}),B.d(ne,"g",function(){return g}),B.d(ne,"f",function(){return h}),B.d(ne,"e",function(){return a}),B.d(ne,"i",function(){return i}),B.d(ne,"b",function(){return l}),B.d(ne,"a",function(){return s}),B.d(ne,"d",function(){return n}),B.d(ne,"c",function(){return r});var Q=B("C/vA"),H=B("JYp7");const I=!1;let W=null;function P(t){W=t}if(I){const t="__is_disposable_tracked__";P(new class{trackDisposable(b){const v=new Error("Potentially leaked disposable").stack;setTimeout(()=>{b[t]||console.log(v)},3e3)}setParent(b,v){if(b&&b!==s.None)try{b[t]=!0}catch(m){}}markAsDisposed(b){if(b&&b!==s.None)try{b[t]=!0}catch(v){}}markAsSingleton(b){}})}function R(t){return W==null||W.trackDisposable(t),t}function K(t){W==null||W.markAsDisposed(t)}function N(t,b){W==null||W.setParent(t,b)}function e(t,b){if(!W)return;for(const v of t)W.setParent(v,b)}function C(t){return W==null||W.markAsSingleton(t),t}class E extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function g(t){return typeof t.dispose=="function"&&t.dispose.length===0}function h(t){if(H.a.is(t)){let b=[];for(const v of t)if(v)try{v.dispose()}catch(m){b.push(m)}if(b.length===1)throw b[0];if(b.length>1)throw new E(b);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function a(...t){const b=i(()=>h(t));return e(t,b),b}function i(t){const b=R({dispose:Object(Q.a)(()=>{K(b),t()})});return b}class l{constructor(){this._toDispose=new Set,this._isDisposed=!1,R(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{h(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 N(t,this),this._isDisposed?l.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}}l.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new l,R(this),N(this._store,this)}dispose(){K(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 n{constructor(){this._isDisposed=!1,R(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var b;if(this._isDisposed||t===this._value)return;(b=this._value)===null||b===void 0||b.dispose(),t&&N(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,K(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&&N(t,null),t}}class r{constructor(t){this.object=t}dispose(){}}},psGv:function(Me,ne,B){var Q,H;(function(){var I;(function(){"use strict";var K=[,,function(E){function g(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=[]}g.prototype.clone_empty=function(){var i=new g(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},g.prototype.item=function(i){return i<0?this.__items[this.__items.length+i]:this.__items[i]},g.prototype.has_match=function(i){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(i))return!0;return!1},g.prototype.set_indent=function(i,l){this.is_empty()&&(this.__indent_count=i||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},g.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)},g.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},g.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},g.prototype.is_empty=function(){return this.__items.length===0},g.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},g.prototype.push=function(i){this.__items.push(i);var l=i.lastIndexOf(`
|
|
`);l!==-1?this.__character_count=i.length-l:this.__character_count+=i.length},g.prototype.pop=function(){var i=null;return this.is_empty()||(i=this.__items.pop(),this.__character_count-=i.length),i},g.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},g.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},g.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},g.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 h(i,l){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)),l=l||"",i.indent_level>0&&(l=new Array(i.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}h.prototype.get_indent_size=function(i,l){var s=this.__base_string_length;return l=l||0,i<0&&(s=0),s+=i*this.__indent_size,s+=l,s},h.prototype.get_indent_string=function(i,l){var s=this.__base_string;return l=l||0,i<0&&(i=0,s=""),l+=i*this.__indent_size,this.__ensure_cache(l),s+=this.__cache[l],s},h.prototype.__ensure_cache=function(i){for(;i>=this.__cache.length;)this.__add_column()},h.prototype.__add_column=function(){var i=this.__cache.length,l=0,s="";this.__indent_size&&i>=this.__indent_size&&(l=Math.floor(i/this.__indent_size),i-=l*this.__indent_size,s=new Array(l+1).join(this.__indent_string)),i&&(s+=new Array(i+1).join(" ")),this.__cache.push(s)};function a(i,l){this.__indent_cache=new h(i,l),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 g(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,l){return this.__indent_cache.get_indent_string(i,l)},a.prototype.get_indent_size=function(i,l){return this.__indent_cache.get_indent_size(i,l)},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 l=this.current_line.pop();l&&(l[l.length-1]===`
|
|
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),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,l){return i=i||0,l=l||0,this.next_line.set_indent(i,l),this.__lines.length>1?(this.current_line.set_indent(i,l),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(i){for(var l=0;l<i.newlines;l++)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 l=this.__lines.length;i<l;)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,l){for(var s=this.__lines.length-2;s>=0;){var n=this.__lines[s];if(n.is_empty())break;if(n.item(0).indexOf(i)!==0&&n.item(-1)!==l){this.__lines.splice(s+1,0,new g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},E.exports.Output=a},function(E){function g(h,a,i,l){this.type=h,this.text=a,this.comments_before=null,this.newlines=i||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}E.exports.Token=g},,,function(E){function g(i,l){this.raw_options=h(i,l),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"])}g.prototype._get_array=function(i,l){var s=this.raw_options[i],n=l||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(n=s.concat()):typeof s=="string"&&(n=s.split(/[^a-zA-Z0-9_\/\-]+/)),n},g.prototype._get_boolean=function(i,l){var s=this.raw_options[i],n=s===void 0?!!l:!!s;return n},g.prototype._get_characters=function(i,l){var s=this.raw_options[i],n=l||"";return typeof s=="string"&&(n=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),n},g.prototype._get_number=function(i,l){var s=this.raw_options[i];l=parseInt(l,10),isNaN(l)&&(l=0);var n=parseInt(s,10);return isNaN(n)&&(n=l),n},g.prototype._get_selection=function(i,l,s){var n=this._get_selection_list(i,l,s);if(n.length!==1)throw new Error("Invalid Option Value: The option '"+i+`' can only be one of the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[i]+"'");return n[0]},g.prototype._get_selection_list=function(i,l,s){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[l[0]],!this._is_valid_selection(s,l))throw new Error("Invalid Default Value!");var n=this._get_array(i,s);if(!this._is_valid_selection(n,l))throw new Error("Invalid Option Value: The option '"+i+`' can contain only the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[i]+"'");return n},g.prototype._is_valid_selection=function(i,l){return i.length&&l.length&&!i.some(function(s){return l.indexOf(s)===-1})};function h(i,l){var s={};i=a(i);var n;for(n in i)n!==l&&(s[n]=i[n]);if(l&&i[l])for(n in i[l])s[n]=i[l][n];return s}function a(i){var l={},s;for(s in i){var n=s.replace(/-/g,"_");l[n]=i[s]}return l}E.exports.Options=g,E.exports.normalizeOpts=a,E.exports.mergeOpts=h},,function(E){var g=RegExp.prototype.hasOwnProperty("sticky");function h(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}h.prototype.restart=function(){this.__position=0},h.prototype.back=function(){this.__position>0&&(this.__position-=1)},h.prototype.hasNext=function(){return this.__position<this.__input_length},h.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},h.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},h.prototype.__match=function(a,i){a.lastIndex=i;var l=a.exec(this.__input);return l&&!(g&&a.sticky)&&(l.index!==i&&(l=null)),l},h.prototype.test=function(a,i){return i=i||0,i+=this.__position,i>=0&&i<this.__input_length?!!this.__match(a,i):!1},h.prototype.testChar=function(a,i){var l=this.peek(i);return a.lastIndex=0,l!==null&&a.test(l)},h.prototype.match=function(a){var i=this.__match(a,this.__position);return i?this.__position+=i[0].length:i=null,i},h.prototype.read=function(a,i,l){var s="",n;return a&&(n=this.match(a),n&&(s+=n[0])),i&&(n||!a)&&(s+=this.readUntil(i,l)),s},h.prototype.readUntil=function(a,i){var l="",s=this.__position;a.lastIndex=this.__position;var n=a.exec(this.__input);return n?(s=n.index,i&&(s+=n[0].length)):s=this.__input_length,l=this.__input.substring(this.__position,s),this.__position=s,l},h.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},h.prototype.get_regexp=function(a,i){var l=null,s="g";return i&&g&&(s="y"),typeof a=="string"&&a!==""?l=new RegExp(a,s):a&&(l=new RegExp(a.source,s)),l},h.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},h.prototype.peekUntilAfter=function(a){var i=this.__position,l=this.readUntilAfter(a);return this.__position=i,l},h.prototype.lookBack=function(a){var i=this.__position-1;return i>=a.length&&this.__input.substring(i-a.length,i).toLowerCase()===a},E.exports.InputScanner=h},function(E,g,h){var a=h(8).InputScanner,i=h(3).Token,l=h(10).TokenStream,s=h(11).WhitespacePattern,n={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(t,b){this._input=new a(t),this._options=b||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var t,b=new i(n.START,""),v=null,m=[],T=new l;b.type!==n.EOF;){for(t=this._get_next_token(b,v);this._is_comment(t);)T.add(t),t=this._get_next_token(b,v);T.isEmpty()||(t.comments_before=T,T=new l),t.parent=v,this._is_opening(t)?(m.push(v),v=t):v&&this._is_closing(t,v)&&(t.opened=v,v.closed=t,v=m.pop(),t.parent=v),t.previous=b,b.next=t,this.__tokens.add(t),b=t}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(t,b){this._readWhitespace();var v=this._input.read(/.+/g);return v?this._create_token(n.RAW,v):this._create_token(n.EOF,"")},r.prototype._is_comment=function(t){return!1},r.prototype._is_opening=function(t){return!1},r.prototype._is_closing=function(t,b){return!1},r.prototype._create_token=function(t,b){var v=new i(t,b,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return v},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},E.exports.Tokenizer=r,E.exports.TOKEN=n},function(E){function g(h){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=h}g.prototype.restart=function(){this.__position=0},g.prototype.isEmpty=function(){return this.__tokens_length===0},g.prototype.hasNext=function(){return this.__position<this.__tokens_length},g.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__tokens[this.__position],this.__position+=1),h},g.prototype.peek=function(h){var a=null;return h=h||0,h+=this.__position,h>=0&&h<this.__tokens_length&&(a=this.__tokens[h]),a},g.prototype.add=function(h){this.__parent_token&&(h.parent=this.__parent_token),this.__tokens.push(h),this.__tokens_length+=1},E.exports.TokenStream=g},function(E,g,h){var a=h(12).Pattern;function i(l,s){a.call(this,l,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(l,s){l+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+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 l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var s=this.__split(this._newline_regexp,l);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return l},i.prototype.matching=function(l,s){var n=this._create();return n.__set_whitespace_patterns(l,s),n._update(),n},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(l,s){l.lastIndex=0;for(var n=0,r=[],t=l.exec(s);t;)r.push(s.substring(n,t.index)),n=t.index+t[0].length,t=l.exec(s);return n<s.length?r.push(s.substring(n,s.length)):r.push(""),r},E.exports.WhitespacePattern=i},function(E){function g(h,a){this._input=h,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)}g.prototype.read=function(){var h=this._input.read(this._starting_pattern);return(!this._starting_pattern||h)&&(h+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),h},g.prototype.read_match=function(){return this._input.match(this._match_pattern)},g.prototype.until_after=function(h){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(h),a._update(),a},g.prototype.until=function(h){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(h),a._update(),a},g.prototype.starting_with=function(h){var a=this._create();return a._starting_pattern=this._input.get_regexp(h,!0),a._update(),a},g.prototype.matching=function(h){var a=this._create();return a._match_pattern=this._input.get_regexp(h,!0),a._update(),a},g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){},E.exports.Pattern=g},function(E){function g(h,a){h=typeof h=="string"?h:h.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(h+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(h+/\sbeautify\signore:end\s/.source+a,"g")}g.prototype.get_directives=function(h){if(!h.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(h);i;)a[i[1]]=i[2],i=this.__directive_pattern.exec(h);return a},g.prototype.readIgnored=function(h){return h.readUntilAfter(this.__directives_end_ignore_pattern)},E.exports.Directives=g},function(E,g,h){var a=h(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(s,n){a.call(this,s,n),this.__template_pattern=null,this._disabled=Object.assign({},i),this._excluded=Object.assign({},i),n&&(this.__template_pattern=this._input.get_regexp(n.__template_pattern),this._excluded=Object.assign(this._excluded,n._excluded),this._disabled=Object.assign(this._disabled,n._disabled));var r=new a(s);this.__patterns={handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:r.starting_with(/{{{/).until_after(/}}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),php:r.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new a,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(s){var n=this._create();return n._disabled[s]=!0,n._update(),n},l.prototype.read_options=function(s){var n=this._create();for(var r in i)n._disabled[r]=s.templating.indexOf(r)===-1;return n._update(),n},l.prototype.exclude=function(s){var n=this._create();return n._excluded[s]=!0,n._update(),n},l.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 n=this._read_template();n;)this._match_pattern?n+=this._input.read(this._match_pattern):n+=this._input.readUntil(this.__template_pattern),s+=n,n=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},l.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("|")+")")},l.prototype._read_template=function(){var s="",n=this._input.peek();if(n==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(s=s||this.__patterns.erb.read())}else n==="{"&&(!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},E.exports.TemplatablePattern=l},,,,function(E,g,h){var a=h(19).Beautifier,i=h(20).Options;function l(s,n,r,t){var b=new a(s,n,r,t);return b.beautify()}E.exports=l,E.exports.defaultOptions=function(){return new i}},function(E,g,h){var a=h(20).Options,i=h(2).Output,l=h(21).Tokenizer,s=h(21).TOKEN,n=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,t=function(_,p){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=_.max_preserve_newlines,this.preserve_newlines=_.preserve_newlines,this._output=new i(_,p)};t.prototype.current_line_has_match=function(_){return this._output.current_line.has_match(_)},t.prototype.set_space_before_token=function(_,p){this._output.space_before_token=_,this._output.non_breaking_space=p},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(_){this._output.add_raw_token(_)},t.prototype.print_preserved_newlines=function(_){var p=0;_.type!==s.TEXT&&_.previous.type!==s.TEXT&&(p=_.newlines?1:0),this.preserve_newlines&&(p=_.newlines<this.max_preserve_newlines+1?_.newlines:this.max_preserve_newlines+1);for(var d=0;d<p;d++)this.print_newline(d>0);return p!==0},t.prototype.traverse_whitespace=function(_){return _.whitespace_before||_.newlines?(this.print_preserved_newlines(_)||(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(_){this._output.add_new_line(_)},t.prototype.print_token=function(_){_.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(_.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(_){return _=this.indent_level+(_||0),_<1?"":this._output.get_indent_string(_)};var b=function(_){for(var p=null,d=_.next;d.type!==s.EOF&&_.closed!==d;){if(d.type===s.ATTRIBUTE&&d.text==="type"){d.next&&d.next.type===s.EQUALS&&d.next.next&&d.next.next.type===s.VALUE&&(p=d.next.next.text);break}d=d.next}return p},v=function(_,p){var d=null,A=null;return p.closed?(_==="script"?d="text/javascript":_==="style"&&(d="text/css"),d=b(p)||d,d.search("text/css")>-1?A="css":d.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?A="javascript":d.search(/(text|application|dojo)\/(x-)?(html)/)>-1?A="html":d.search(/test\/null/)>-1&&(A="null"),A):null};function m(_,p){return p.indexOf(_)!==-1}function T(_,p,d){this.parent=_||null,this.tag=p?p.tag_name:"",this.indent_level=d||0,this.parser_token=p||null}function y(_){this._printer=_,this._current_frame=null}y.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},y.prototype.record_tag=function(_){var p=new T(this._current_frame,_,this._printer.indent_level);this._current_frame=p},y.prototype._try_pop_frame=function(_){var p=null;return _&&(p=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),p},y.prototype._get_frame=function(_,p){for(var d=this._current_frame;d&&!(_.indexOf(d.tag)!==-1);){if(p&&p.indexOf(d.tag)!==-1){d=null;break}d=d.parent}return d},y.prototype.try_pop=function(_,p){var d=this._get_frame([_],p);return this._try_pop_frame(d)},y.prototype.indent_to_tag=function(_){var p=this._get_frame(_);p&&(this._printer.indent_level=p.indent_level)};function f(_,p,d,A){this._source_text=_||"",p=p||{},this._js_beautify=d,this._css_beautify=A,this._tag_stack=null;var D=new a(p,"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"}f.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,p=this._options.eol;this._options.eol==="auto"&&(p=`
|
|
`,_&&n.test(_)&&(p=_.match(n)[0])),_=_.replace(r,`
|
|
`);var d=_.match(/^[\t ]*/)[0],A={text:"",type:""},D=new u,S=new t(this._options,d),L=new l(_,this._options).tokenize();this._tag_stack=new y(S);for(var M=null,O=L.next();O.type!==s.EOF;)O.type===s.TAG_OPEN||O.type===s.COMMENT?(M=this._handle_tag_open(S,O,D,A),D=M):O.type===s.ATTRIBUTE||O.type===s.EQUALS||O.type===s.VALUE||O.type===s.TEXT&&!D.tag_complete?M=this._handle_inside_tag(S,O,D,L):O.type===s.TAG_CLOSE?M=this._handle_tag_close(S,O,D):O.type===s.TEXT?M=this._handle_text(S,O,D):S.add_raw_token(O),A=M,O=L.next();var j=S._output.get_code(p);return j},f.prototype._handle_tag_close=function(_,p,d){var A={text:p.text,type:p.type};return _.alignment_size=0,d.tag_complete=!0,_.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),d.is_unformatted?_.add_raw_token(p):(d.tag_start_char==="<"&&(_.set_space_before_token(p.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&d.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(p)),d.indent_content&&!(d.is_unformatted||d.is_content_unformatted)&&(_.indent(),d.indent_content=!1),!d.is_inline_element&&!(d.is_unformatted||d.is_content_unformatted)&&_.set_wrap_point(),A},f.prototype._handle_inside_tag=function(_,p,d,A){var D=d.has_wrapped_attrs,S={text:p.text,type:p.type};if(_.set_space_before_token(p.newlines||p.whitespace_before!=="",!0),d.is_unformatted)_.add_raw_token(p);else if(d.tag_start_char==="{"&&p.type===s.TEXT)_.print_preserved_newlines(p)?(p.newlines=0,_.add_raw_token(p)):_.print_token(p);else{if(p.type===s.ATTRIBUTE?(_.set_space_before_token(!0),d.attr_count+=1):(p.type===s.EQUALS||p.type===s.VALUE&&p.previous.type===s.EQUALS)&&_.set_space_before_token(!1),p.type===s.ATTRIBUTE&&d.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(p),D=D||p.newlines!==0),this._is_wrap_attributes_force)){var L=d.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&d.attr_count===1){var M=!0,O=0,j;do{if(j=A.peek(O),j.type===s.ATTRIBUTE){M=!1;break}O+=1}while(O<4&&j.type!==s.EOF&&j.type!==s.TAG_CLOSE);L=!M}L&&(_.print_newline(!1),D=!0)}_.print_token(p),D=D||_.previous_token_wrapped(),d.has_wrapped_attrs=D}return S},f.prototype._handle_text=function(_,p,d){var A={text:p.text,type:"TK_CONTENT"};return d.custom_beautifier_name?this._print_custom_beatifier_text(_,p,d):d.is_unformatted||d.is_content_unformatted?_.add_raw_token(p):(_.traverse_whitespace(p),_.print_token(p)),A},f.prototype._print_custom_beatifier_text=function(_,p,d){var A=this;if(p.text!==""){var D=p.text,S,L=1,M="",O="";d.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?S=this._js_beautify:d.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?S=this._css_beautify:d.custom_beautifier_name==="html"&&(S=function(ge,de){var Te=new f(ge,de,A._js_beautify,A._css_beautify);return Te.beautify()}),this._options.indent_scripts==="keep"?L=0:this._options.indent_scripts==="separate"&&(L=-_.indent_level);var j=_.get_full_indent(L);if(D=D.replace(/\n[ \t]*$/,""),d.custom_beautifier_name!=="html"&&D[0]==="<"&&D.match(/^(<!--|<!\[CDATA\[)/)){var G=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(D);if(!G){_.add_raw_token(p);return}M=j+G[1]+`
|
|
`,D=G[4],G[5]&&(O=j+G[5]),D=D.replace(/\n[ \t]*$/,""),(G[2]||G[3].indexOf(`
|
|
`)!==-1)&&(G=G[3].match(/[ \t]+$/),G&&(p.whitespace_before=G[0]))}if(D)if(S){var X=function(){this.eol=`
|
|
`};X.prototype=this._options.raw_options;var ee=new X;D=S(j+D,ee)}else{var he=p.whitespace_before;he&&(D=D.replace(new RegExp(`
|
|
(`+he+")?","g"),`
|
|
`)),D=j+D.replace(/\n/g,`
|
|
`+j)}M&&(D?D=M+D+`
|
|
`+O:D=M+O),_.print_newline(!1),D&&(p.text=D,p.whitespace_before="",p.newlines=0,_.add_raw_token(p),_.print_newline(!0))}},f.prototype._handle_tag_open=function(_,p,d,A){var D=this._get_tag_open_token(p);return(d.is_unformatted||d.is_content_unformatted)&&!d.is_empty_element&&p.type===s.TAG_OPEN&&p.text.indexOf("</")===0?(_.add_raw_token(p),D.start_tag_token=this._tag_stack.try_pop(D.tag_name)):(_.traverse_whitespace(p),this._set_tag_position(_,p,D,d,A),D.is_inline_element||_.set_wrap_point(),_.print_token(p)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(D.alignment_size=p.text.length+1),!D.tag_complete&&!D.is_unformatted&&(_.alignment_size=D.alignment_size),D};var u=function(_,p){if(this.parent=_||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="",!p)this.tag_complete=!0;else{var d;this.tag_start_char=p.text[0],this.text=p.text,this.tag_start_char==="<"?(d=p.text.match(/^<([^\s>]*)/),this.tag_check=d?d[1]:""):(d=p.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=d?d[1]:"",(p.text.startsWith("{{#>")||p.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&p.next!==null?this.tag_check=p.next.text.split(" ")[0]:this.tag_check=p.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),p.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||p.closed&&p.closed.text==="/>";var A=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(A=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(A)))}};f.prototype._get_tag_open_token=function(_){var p=new u(this._tag_stack.get_parser_token(),_);return p.alignment_size=this._options.wrap_attributes_indent_size,p.is_end_tag=p.is_end_tag||m(p.tag_check,this._options.void_elements),p.is_empty_element=p.tag_complete||p.is_start_tag&&p.is_end_tag,p.is_unformatted=!p.tag_complete&&m(p.tag_check,this._options.unformatted),p.is_content_unformatted=!p.is_empty_element&&m(p.tag_check,this._options.content_unformatted),p.is_inline_element=m(p.tag_name,this._options.inline)||p.tag_name.includes("-")||p.tag_start_char==="{",p},f.prototype._set_tag_position=function(_,p,d,A,D){if(d.is_empty_element||(d.is_end_tag?d.start_tag_token=this._tag_stack.try_pop(d.tag_name):(this._do_optional_end_element(d)&&(d.is_inline_element||_.print_newline(!1)),this._tag_stack.record_tag(d),(d.tag_name==="script"||d.tag_name==="style")&&!(d.is_unformatted||d.is_content_unformatted)&&(d.custom_beautifier_name=v(d.tag_check,p)))),m(d.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.print_newline(!0)),d.is_empty_element){if(d.tag_start_char==="{"&&d.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),d.indent_content=!0;var S=_.current_line_has_match(/{{#if/);S||_.print_newline(!1)}d.tag_name==="!--"&&D.type===s.TAG_CLOSE&&A.is_end_tag&&d.text.indexOf(`
|
|
`)===-1||(d.is_inline_element||d.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,d))}else if(d.is_end_tag){var L=!1;L=d.start_tag_token&&d.start_tag_token.multiline_content,L=L||!d.is_inline_element&&!(A.is_inline_element||A.is_unformatted)&&!(D.type===s.TAG_CLOSE&&d.start_tag_token===A)&&D.type!=="TK_CONTENT",(d.is_content_unformatted||d.is_unformatted)&&(L=!1),L&&_.print_newline(!1)}else d.indent_content=!d.custom_beautifier_name,d.tag_start_char==="<"&&(d.tag_name==="html"?d.indent_content=this._options.indent_inner_html:d.tag_name==="head"?d.indent_content=this._options.indent_head_inner_html:d.tag_name==="body"&&(d.indent_content=this._options.indent_body_inner_html)),!(d.is_inline_element||d.is_unformatted)&&(D.type!=="TK_CONTENT"||d.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,d)},f.prototype._calcluate_parent_multiline=function(_,p){p.parent&&_._output.just_added_newline()&&!((p.is_inline_element||p.is_unformatted)&&p.parent.is_inline_element)&&(p.parent.multiline_content=!0)};var o=["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"],c=["a","audio","del","ins","map","noscript","video"];f.prototype._do_optional_end_element=function(_){var p=null;if(_.is_empty_element||!_.is_start_tag||!_.parent)return;if(_.tag_name==="body")p=p||this._tag_stack.try_pop("head");else if(_.tag_name==="li")p=p||this._tag_stack.try_pop("li",["ol","ul"]);else if(_.tag_name==="dd"||_.tag_name==="dt")p=p||this._tag_stack.try_pop("dt",["dl"]),p=p||this._tag_stack.try_pop("dd",["dl"]);else if(_.parent.tag_name==="p"&&o.indexOf(_.tag_name)!==-1){var d=_.parent.parent;(!d||c.indexOf(d.tag_name)===-1)&&(p=p||this._tag_stack.try_pop("p"))}else _.tag_name==="rp"||_.tag_name==="rt"?(p=p||this._tag_stack.try_pop("rt",["ruby","rtc"]),p=p||this._tag_stack.try_pop("rp",["ruby","rtc"])):_.tag_name==="optgroup"?p=p||this._tag_stack.try_pop("optgroup",["select"]):_.tag_name==="option"?p=p||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):_.tag_name==="colgroup"?p=p||this._tag_stack.try_pop("caption",["table"]):_.tag_name==="thead"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"])):_.tag_name==="tbody"||_.tag_name==="tfoot"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("thead",["table"]),p=p||this._tag_stack.try_pop("tbody",["table"])):_.tag_name==="tr"?(p=p||this._tag_stack.try_pop("caption",["table"]),p=p||this._tag_stack.try_pop("colgroup",["table"]),p=p||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(_.tag_name==="th"||_.tag_name==="td")&&(p=p||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),p=p||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return _.parent=this._tag_stack.get_parser_token(),p},E.exports.Beautifier=f},function(E,g,h){var a=h(6).Options;function i(l){a.call(this,l,"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,E.exports.Options=i},function(E,g,h){var a=h(9).Tokenizer,i=h(9).TOKEN,l=h(13).Directives,s=h(14).TemplatablePattern,n=h(12).Pattern,r={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 l(/<\!--/,/-->/),b=function(v,m){a.call(this,v,m),this._current_tag_name="";var T=new s(this._input).read_options(this._options),y=new n(this._input);if(this.__patterns={word:T.until(/[\n\r\t <]/),single_quote:T.until_after(/'/),double_quote:T.until_after(/"/),attribute:T.until(/[\n\r\t =>]|\/>/),element_name:T.until(/[\n\r\t >\/]/),handlebars_comment:y.starting_with(/{{!--/).until_after(/--}}/),handlebars:y.starting_with(/{{/).until_after(/}}/),handlebars_open:y.until(/[\n\r\t }]/),handlebars_raw_close:y.until(/}}/),comment:y.starting_with(/<!--/).until_after(/-->/),cdata:y.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:y.starting_with(/<!\[/).until_after(/]>/),processing:y.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 f=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=y.matching(f).until_after(f)}};b.prototype=new a,b.prototype._is_comment=function(v){return!1},b.prototype._is_opening=function(v){return v.type===r.TAG_OPEN},b.prototype._is_closing=function(v,m){return v.type===r.TAG_CLOSE&&m&&((v.text===">"||v.text==="/>")&&m.text[0]==="<"||v.text==="}}"&&m.text[0]==="{"&&m.text[1]==="{")},b.prototype._reset=function(){this._current_tag_name=""},b.prototype._get_next_token=function(v,m){var T=null;this._readWhitespace();var y=this._input.peek();return y===null?this._create_token(r.EOF,""):(T=T||this._read_open_handlebars(y,m),T=T||this._read_attribute(y,v,m),T=T||this._read_close(y,m),T=T||this._read_raw_content(y,v,m),T=T||this._read_content_word(y),T=T||this._read_comment_or_cdata(y),T=T||this._read_processing(y),T=T||this._read_open(y,m),T=T||this._create_token(r.UNKNOWN,this._input.next()),T)},b.prototype._read_comment_or_cdata=function(v){var m=null,T=null,y=null;if(v==="<"){var f=this._input.peek(1);f==="!"&&(T=this.__patterns.comment.read(),T?(y=t.get_directives(T),y&&y.ignore==="start"&&(T+=t.readIgnored(this._input))):T=this.__patterns.cdata.read()),T&&(m=this._create_token(r.COMMENT,T),m.directives=y)}return m},b.prototype._read_processing=function(v){var m=null,T=null,y=null;if(v==="<"){var f=this._input.peek(1);(f==="!"||f==="?")&&(T=this.__patterns.conditional_comment.read(),T=T||this.__patterns.processing.read()),T&&(m=this._create_token(r.COMMENT,T),m.directives=y)}return m},b.prototype._read_open=function(v,m){var T=null,y=null;return m||v==="<"&&(T=this._input.next(),this._input.peek()==="/"&&(T+=this._input.next()),T+=this.__patterns.element_name.read(),y=this._create_token(r.TAG_OPEN,T)),y},b.prototype._read_open_handlebars=function(v,m){var T=null,y=null;return m||this._options.indent_handlebars&&v==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(T=this.__patterns.handlebars_comment.read(),T=T||this.__patterns.handlebars.read(),y=this._create_token(r.COMMENT,T)):(T=this.__patterns.handlebars_open.read(),y=this._create_token(r.TAG_OPEN,T))),y},b.prototype._read_close=function(v,m){var T=null,y=null;return m&&(m.text[0]==="<"&&(v===">"||v==="/"&&this._input.peek(1)===">")?(T=this._input.next(),v==="/"&&(T+=this._input.next()),y=this._create_token(r.TAG_CLOSE,T)):m.text[0]==="{"&&v==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),y=this._create_token(r.TAG_CLOSE,"}}"))),y},b.prototype._read_attribute=function(v,m,T){var y=null,f="";if(T&&T.text[0]==="<")if(v==="=")y=this._create_token(r.EQUALS,this._input.next());else if(v==='"'||v==="'"){var u=this._input.next();v==='"'?u+=this.__patterns.double_quote.read():u+=this.__patterns.single_quote.read(),y=this._create_token(r.VALUE,u)}else f=this.__patterns.attribute.read(),f&&(m.type===r.EQUALS?y=this._create_token(r.VALUE,f):y=this._create_token(r.ATTRIBUTE,f));return y},b.prototype._is_content_unformatted=function(v){return this._options.void_elements.indexOf(v)===-1&&(this._options.content_unformatted.indexOf(v)!==-1||this._options.unformatted.indexOf(v)!==-1)},b.prototype._read_raw_content=function(v,m,T){var y="";if(T&&T.text[0]==="{")y=this.__patterns.handlebars_raw_close.read();else if(m.type===r.TAG_CLOSE&&m.opened.text[0]==="<"&&m.text[0]!=="/"){var f=m.opened.text.substr(1).toLowerCase();if(f==="script"||f==="style"){var u=this._read_comment_or_cdata(v);if(u)return u.type=r.TEXT,u;y=this._input.readUntil(new RegExp("</"+f+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(f)&&(y=this._input.readUntil(new RegExp("</"+f+"[\\n\\r\\t ]*?>","ig")))}return y?this._create_token(r.TEXT,y):null},b.prototype._read_content_word=function(v){var m="";if(this._options.unformatted_content_delimiter&&(v===this._options.unformatted_content_delimiter[0]&&(m=this.__patterns.unformatted_content_delimiter.read())),m||(m=this.__patterns.word.read()),m)return this._create_token(r.TEXT,m)},E.exports.Tokenizer=b,E.exports.TOKEN=r}],N={};function e(E){var g=N[E];if(g!==void 0)return g.exports;var h=N[E]={exports:{}};return K[E](h,h.exports,e),h.exports}var C=e(18);I=C})();var W=I;if(!0)!(Q=[B,B("6UM0"),B("TXwP")],H=function(K){var N=B("6UM0"),e=B("TXwP");return{html_beautify:function(C,E){return W(C,E,N.js_beautify,e.css_beautify)}}}.apply(ne,Q),H!==void 0&&(Me.exports=H));else var P,R})()},"rAM+":function(Me,ne,B){"use strict";B.d(ne,"a",function(){return H});var Q=B("Qw5x");function H(I,W){var P;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(P=Object(Q.a)(I))||W&&I&&typeof I.length=="number"){P&&(I=P);var R=0,K=function(){};return{s:K,n:function(){return R>=I.length?{done:!0}:{done:!1,value:I[R++]}},e:function(g){throw g},f:K}}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 N=!0,e=!1,C;return{s:function(){P=I[Symbol.iterator]()},n:function(){var g=P.next();return N=g.done,g},e:function(g){e=!0,C=g},f:function(){try{!N&&P.return!=null&&P.return()}finally{if(e)throw C}}}}},rUJ1:function(Me,ne){const B=/[&<>"']/,Q=/[&<>"']/g,H=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,W={"&":"&","<":"<",">":">",'"':""","'":"'"},P=y=>W[y];function R(y,f){if(f){if(B.test(y))return y.replace(Q,P)}else if(H.test(y))return y.replace(I,P);return y}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(y){return y.replace(K,(f,u)=>(u=u.toLowerCase(),u==="colon"?":":u.charAt(0)==="#"?u.charAt(1)==="x"?String.fromCharCode(parseInt(u.substring(2),16)):String.fromCharCode(+u.substring(1)):""))}const e=/(^|[^\[])\^/g;function C(y,f){y=y.source||y,f=f||"";const u={replace:(o,c)=>(c=c.source||c,c=c.replace(e,"$1"),y=y.replace(o,c),u),getRegex:()=>new RegExp(y,f)};return u}const E=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(y,f,u){if(y){let o;try{o=decodeURIComponent(N(u)).replace(E,"").toLowerCase()}catch(c){return null}if(o.indexOf("javascript:")===0||o.indexOf("vbscript:")===0||o.indexOf("data:")===0)return null}f&&!g.test(u)&&(u=n(f,u));try{u=encodeURI(u).replace(/%25/g,"%")}catch(o){return null}return u}const a={},i=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function n(y,f){a[" "+y]||(i.test(y)?a[" "+y]=y+"/":a[" "+y]=v(y,"/",!0)),y=a[" "+y];const u=y.indexOf(":")===-1;return f.substring(0,2)==="//"?u?f:y.replace(l,"$1")+f:f.charAt(0)==="/"?u?f:y.replace(s,"$1")+f:y+f}const r={exec:function(){}};function t(y){let f=1,u,o;for(;f<arguments.length;f++){u=arguments[f];for(o in u)Object.prototype.hasOwnProperty.call(u,o)&&(y[o]=u[o])}return y}function b(y,f){const u=y.replace(/\|/g,(_,p,d)=>{let A=!1,D=p;for(;--D>=0&&d[D]==="\\";)A=!A;return A?"|":" |"}),o=u.split(/ \|/);let c=0;if(o.length>f)o.splice(f);else for(;o.length<f;)o.push("");for(;c<o.length;c++)o[c]=o[c].trim().replace(/\\\|/g,"|");return o}function v(y,f,u){const o=y.length;if(o===0)return"";let c=0;for(;c<o;){const _=y.charAt(o-c-1);if(_===f&&!u)c++;else if(_!==f&&u)c++;else break}return y.substr(0,o-c)}function m(y,f){if(y.indexOf(f[1])===-1)return-1;const u=y.length;let o=0,c=0;for(;c<u;c++)if(y[c]==="\\")c++;else if(y[c]===f[0])o++;else if(y[c]===f[1]&&(o--,o<0))return c;return-1}function T(y){y&&y.sanitize&&!y.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")}Me.exports={escape:R,unescape:N,edit:C,cleanUrl:h,resolveUrl:n,noopTest:r,merge:t,splitCells:b,rtrim:v,findClosingBracket:m,checkSanitizeDeprecation:T}},sR1s:function(Me,ne,B){"use strict";B.d(ne,"b",function(){return W}),B.d(ne,"a",function(){return P}),B.d(ne,"c",function(){return R}),B.d(ne,"d",function(){return K});var Q=B("U8pU"),H="RC_TABLE_KEY";function I(N){return N==null?[]:Array.isArray(N)?N:[N]}function W(N,e){if(!e&&typeof e!="number")return N;for(var C=I(e),E=N,g=0;g<C.length;g+=1){if(!E)return null;var h=C[g];E=E[h]}return E}function P(N){var e=[],C={};return N.forEach(function(E){for(var g=E||{},h=g.key,a=g.dataIndex,i=h||I(a).join("-")||H;C[i];)i="".concat(i,"_next");C[i]=!0,e.push(i)}),e}function R(){var N={};function e(h,a){a&&Object.keys(a).forEach(function(i){var l=a[i];l&&Object(Q.a)(l)==="object"?(h[i]=h[i]||{},e(h[i],l)):h[i]=l})}for(var C=arguments.length,E=new Array(C),g=0;g<C;g++)E[g]=arguments[g];return E.forEach(function(h){e(N,h)}),N}function K(N){return N!=null}},sZk2:function(Me,ne,B){Me.exports=B.p+"static/paix.41effcff.svg"},sboe:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return I});var Q=B("q1tI"),H=B.n(Q),I=Q.createContext(null)},t23M:function(Me,ne,B){"use strict";var Q=B("VTBJ"),H=B("1OyB"),I=B("vuIU"),W=B("Ji7U"),P=B("LK+K"),R=B("q1tI"),K=B.n(R),N=B("m+aA"),e=B("Zm9Q"),C=B("Kwbf"),E=B("c+Xe"),g=B("bdgK"),h="rc-observer-key",a=function(i){Object(W.a)(s,i);var l=Object(P.a)(s);function s(){var n;return Object(H.a)(this,s),n=l.apply(this,arguments),n.resizeObserver=null,n.childNode=null,n.currentElement=null,n.state={width:0,height:0,offsetHeight:0,offsetWidth:0},n.onResize=function(r){var t=n.props.onResize,b=r[0].target,v=b.getBoundingClientRect(),m=v.width,T=v.height,y=b.offsetWidth,f=b.offsetHeight,u=Math.floor(m),o=Math.floor(T);if(n.state.width!==u||n.state.height!==o||n.state.offsetWidth!==y||n.state.offsetHeight!==f){var c={width:u,height:o,offsetWidth:y,offsetHeight:f};n.setState(c),t&&Promise.resolve().then(function(){t(Object(Q.a)(Object(Q.a)({},c),{},{offsetWidth:y,offsetHeight:f}))})}},n.setChildNode=function(r){n.childNode=r},n}return Object(I.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 r=this.props.disabled;if(r){this.destroyObserver();return}var t=Object(N.a)(this.childNode||this),b=t!==this.currentElement;b&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new g.default(this.onResize),this.resizeObserver.observe(t))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var r=this.props.children,t=Object(e.a)(r);if(t.length>1)Object(C.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(t.length===0)return Object(C.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var b=t[0];if(R.isValidElement(b)&&Object(E.c)(b)){var v=b.ref;t[0]=R.cloneElement(b,{ref:Object(E.a)(v,this.setChildNode)})}return t.length===1?t[0]:t.map(function(m,T){return!R.isValidElement(m)||"key"in m&&m.key!==null?m:R.cloneElement(m,{key:"".concat(h,"-").concat(T)})})}}]),s}(R.Component);a.displayName="ResizeObserver",ne.a=a},t9D7:function(Me,ne,B){"use strict";B.d(ne,"b",function(){return K}),B.d(ne,"g",function(){return e}),B.d(ne,"d",function(){return C}),B.d(ne,"e",function(){return E}),B.d(ne,"a",function(){return g}),B.d(ne,"f",function(){return i}),B.d(ne,"c",function(){return l});var Q=B("Vhoy"),H=B("MI8n"),I=B("pmY6"),W=B("Cg/j"),P=B("ic2d"),R=B("nEHx");const K=Object(W.c)("themeService");var N;(function(s){function n(r){return r&&typeof r=="object"&&typeof r.id=="string"}s.isThemeColor=n})(N||(N={}));function e(s){return{id:s}}var C;(function(s){function n(T){return T&&typeof T=="object"&&typeof T.id=="string"&&(typeof T.color=="undefined"||N.isThemeColor(T.color))}s.isThemeIcon=n;const r=new RegExp(`^\\$\\((${Q.a.iconNameExpression}(?:${Q.a.iconModifierExpression})?)\\)$`);function t(T){const y=r.exec(T);if(!y)return;let[,f]=y;return{id:f}}s.fromString=t;function b(T,y){let f=T.id;const u=f.lastIndexOf("~");return u!==-1&&(f=f.substring(0,u)),y&&(f=`${f}~${y}`),{id:f}}s.modify=b;function v(T,y){var f,u;return T.id===y.id&&((f=T.color)===null||f===void 0?void 0:f.id)===((u=y.color)===null||u===void 0?void 0:u.id)}s.isEqual=v;function m(T,y){return{id:T.id,color:y?e(y):void 0}}s.asThemeIcon=m,s.asClassNameArray=Q.a.asClassNameArray,s.asClassName=Q.a.asClassName,s.asCSSSelector=Q.a.asCSSSelector})(C||(C={}));function E(s){switch(s){case R.a.DARK:return"vs-dark";case R.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const g={ThemingContribution:"base.contributions.theming"};class h{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new H.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(I.i)(()=>{const n=this.themingParticipants.indexOf(s);this.themingParticipants.splice(n,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new h;P.a.add(g.ThemingContribution,a);function i(s){return a.onColorThemeChange(s)}class l extends I.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(n=>this.onThemeChange(n)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(Me,ne,B){typeof window!="undefined"&&function(H,I){Me.exports=I()}(this,function(){return function(Q){var H={};function I(W){if(H[W])return H[W].exports;var P=H[W]={i:W,l:!1,exports:{}};return Q[W].call(P.exports,P,P.exports,I),P.l=!0,P.exports}return I.m=Q,I.c=H,I.d=function(W,P,R){I.o(W,P)||Object.defineProperty(W,P,{enumerable:!0,get:R})},I.r=function(W){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(W,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(W,"__esModule",{value:!0})},I.t=function(W,P){if(P&1&&(W=I(W)),P&8)return W;if(P&4&&typeof W=="object"&&W&&W.__esModule)return W;var R=Object.create(null);if(I.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:W}),P&2&&typeof W!="string")for(var K in W)I.d(R,K,function(N){return W[N]}.bind(null,K));return R},I.n=function(W){var P=W&&W.__esModule?function(){return W.default}:function(){return W};return I.d(P,"a",P),P},I.o=function(W,P){return Object.prototype.hasOwnProperty.call(W,P)},I.p="/dist/",I(I.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Q,H,I){"use strict";var W=Object.prototype.hasOwnProperty,P="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(P=!1));function K(E,g,h){this.fn=E,this.context=g,this.once=h||!1}function N(E,g,h,a,i){if(typeof h!="function")throw new TypeError("The listener must be a function");var l=new K(h,a||E,i),s=P?P+g:g;return E._events[s]?E._events[s].fn?E._events[s]=[E._events[s],l]:E._events[s].push(l):(E._events[s]=l,E._eventsCount++),E}function e(E,g){--E._eventsCount===0?E._events=new R:delete E._events[g]}function C(){this._events=new R,this._eventsCount=0}C.prototype.eventNames=function(){var g=[],h,a;if(this._eventsCount===0)return g;for(a in h=this._events)W.call(h,a)&&g.push(P?a.slice(1):a);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(h)):g},C.prototype.listeners=function(g){var h=P?P+g:g,a=this._events[h];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,l=a.length,s=new Array(l);i<l;i++)s[i]=a[i].fn;return s},C.prototype.listenerCount=function(g){var h=P?P+g:g,a=this._events[h];return a?a.fn?1:a.length:0},C.prototype.emit=function(g,h,a,i,l,s){var n=P?P+g:g;if(!this._events[n])return!1;var r=this._events[n],t=arguments.length,b,v;if(r.fn){r.once&&this.removeListener(g,r.fn,void 0,!0);switch(t){case 1:return r.fn.call(r.context),!0;case 2:return r.fn.call(r.context,h),!0;case 3:return r.fn.call(r.context,h,a),!0;case 4:return r.fn.call(r.context,h,a,i),!0;case 5:return r.fn.call(r.context,h,a,i,l),!0;case 6:return r.fn.call(r.context,h,a,i,l,s),!0}for(v=1,b=new Array(t-1);v<t;v++)b[v-1]=arguments[v];r.fn.apply(r.context,b)}else{var m=r.length,T;for(v=0;v<m;v++){r[v].once&&this.removeListener(g,r[v].fn,void 0,!0);switch(t){case 1:r[v].fn.call(r[v].context);break;case 2:r[v].fn.call(r[v].context,h);break;case 3:r[v].fn.call(r[v].context,h,a);break;case 4:r[v].fn.call(r[v].context,h,a,i);break;default:if(!b)for(T=1,b=new Array(t-1);T<t;T++)b[T-1]=arguments[T];r[v].fn.apply(r[v].context,b)}}}return!0},C.prototype.on=function(g,h,a){return N(this,g,h,a,!1)},C.prototype.once=function(g,h,a){return N(this,g,h,a,!0)},C.prototype.removeListener=function(g,h,a,i){var l=P?P+g:g;if(!this._events[l])return this;if(!h)return e(this,l),this;var s=this._events[l];if(s.fn)s.fn===h&&(!i||s.once)&&(!a||s.context===a)&&e(this,l);else{for(var n=0,r=[],t=s.length;n<t;n++)(s[n].fn!==h||i&&!s[n].once||a&&s[n].context!==a)&&r.push(s[n]);r.length?this._events[l]=r.length===1?r[0]:r:e(this,l)}return this},C.prototype.removeAllListeners=function(g){var h;return g?(h=P?P+g:g,this._events[h]&&e(this,h)):(this._events=new R,this._eventsCount=0),this},C.prototype.off=C.prototype.removeListener,C.prototype.addListener=C.prototype.on,C.prefixed=P,C.EventEmitter=C,Q.exports=C},"./node_modules/url-toolkit/src/url-toolkit.js":function(Q,H,I){(function(W){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,R=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,N=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(C,E,g){if(g=g||{},C=C.trim(),E=E.trim(),!E){if(!g.alwaysNormalize)return C;var h=e.parseURL(C);if(!h)throw new Error("Error trying to parse base URL.");return h.path=e.normalizePath(h.path),e.buildURLFromParts(h)}var a=e.parseURL(E);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return g.alwaysNormalize?(a.path=e.normalizePath(a.path),e.buildURLFromParts(a)):E;var i=e.parseURL(C);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&i.path[0]!=="/"){var l=R.exec(i.path);i.netLoc=l[1],i.path=l[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 n=i.path,r=n.substring(0,n.lastIndexOf("/")+1)+a.path;s.path=e.normalizePath(r)}return s.path===null&&(s.path=g.alwaysNormalize?e.normalizePath(a.path):a.path),e.buildURLFromParts(s)},parseURL:function(C){var E=P.exec(C);return E?{scheme:E[1]||"",netLoc:E[2]||"",path:E[3]||"",params:E[4]||"",query:E[5]||"",fragment:E[6]||""}:null},normalizePath:function(C){for(C=C.split("").reverse().join("").replace(K,"");C.length!==(C=C.replace(N,"")).length;);return C.split("").reverse().join("")},buildURLFromParts:function(C){return C.scheme+C.netLoc+C.path+C.params+C.query+C.fragment}};Q.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(Q,H,I){function W(g){var h={};function a(l){if(h[l])return h[l].exports;var s=h[l]={i:l,l:!1,exports:{}};return g[l].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=g,a.c=h,a.i=function(l){return l},a.d=function(l,s,n){a.o(l,s)||Object.defineProperty(l,s,{configurable:!1,enumerable:!0,get:n})},a.r=function(l){Object.defineProperty(l,"__esModule",{value:!0})},a.n=function(l){var s=l&&l.__esModule?function(){return l.default}:function(){return l};return a.d(s,"a",s),s},a.o=function(l,s){return Object.prototype.hasOwnProperty.call(l,s)},a.p="/",a.oe=function(l){throw console.error(l),l};var i=a(a.s=ENTRY_MODULE);return i.default||i}var P="[\\.|\\-|\\+|\\w|/|@]+",R="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function K(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function N(g){return!isNaN(1*g)}function e(g,h,a){var i={};i[a]=[];var l=h.toString(),s=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return i;for(var n=s[1],r=new RegExp("(\\\\n|\\W)"+K(n)+R,"g"),t;t=r.exec(l);){if(t[3]==="dll-reference")continue;i[a].push(t[3])}for(r=new RegExp("\\("+K(n)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+R,"g");t=r.exec(l);)g[t[2]]||(i[a].push(t[1]),g[t[2]]=I(t[1]).m),i[t[2]]=i[t[2]]||[],i[t[2]].push(t[4]);for(var b=Object.keys(i),v=0;v<b.length;v++)for(var m=0;m<i[b[v]].length;m++)N(i[b[v]][m])&&(i[b[v]][m]=1*i[b[v]][m]);return i}function C(g){var h=Object.keys(g);return h.reduce(function(a,i){return a||g[i].length>0},!1)}function E(g,h){for(var a={main:[h]},i={main:[]},l={main:{}};C(a);)for(var s=Object.keys(a),n=0;n<s.length;n++){var r=s[n],t=a[r],b=t.pop();if(l[r]=l[r]||{},l[r][b]||!g[r][b])continue;l[r][b]=!0,i[r]=i[r]||[],i[r].push(b);for(var v=e(g,g[r][b],r),m=Object.keys(v),T=0;T<m.length;T++)a[m[T]]=a[m[T]]||[],a[m[T]]=a[m[T]].concat(v[m[T]])}return i}Q.exports=function(g,h){h=h||{};var a={main:I.m},i=h.all?{main:Object.keys(a.main)}:E(a,g),l="";Object.keys(i).filter(function(b){return b!=="main"}).forEach(function(b){for(var v=0;i[b][v];)v++;i[b].push(v),a[b][v]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+b+" = ("+W.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+i[b].map(function(m){return""+JSON.stringify(m)+": "+a[b][m].toString()}).join(",")+`});
|
|
`}),l=l+"new (("+W.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+i.main.map(function(b){return""+JSON.stringify(b)+": "+a.main[b].toString()}).join(",")+"}))(self);";var s=new window.Blob([l],{type:"text/javascript"});if(h.bare)return s;var n=window.URL||window.webkitURL||window.mozURL||window.msURL,r=n.createObjectURL(s),t=new window.Worker(r);return t.objectURL=r,t}},"./src/config.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"hlsDefaultConfig",function(){return T}),I.d(H,"mergeConfig",function(){return f}),I.d(H,"enableStreamingMode",function(){return u});var W=I("./src/controller/abr-controller.ts"),P=I("./src/controller/audio-stream-controller.ts"),R=I("./src/controller/audio-track-controller.ts"),K=I("./src/controller/subtitle-stream-controller.ts"),N=I("./src/controller/subtitle-track-controller.ts"),e=I("./src/controller/buffer-controller.ts"),C=I("./src/controller/timeline-controller.ts"),E=I("./src/controller/cap-level-controller.ts"),g=I("./src/controller/fps-controller.ts"),h=I("./src/controller/eme-controller.ts"),a=I("./src/controller/cmcd-controller.ts"),i=I("./src/utils/xhr-loader.ts"),l=I("./src/utils/fetch-loader.ts"),s=I("./src/utils/cues.ts"),n=I("./src/utils/mediakeys-helper.ts"),r=I("./src/utils/logger.ts");function t(){return t=Object.assign||function(o){for(var c=1;c<arguments.length;c++){var _=arguments[c];for(var p in _)Object.prototype.hasOwnProperty.call(_,p)&&(o[p]=_[p])}return o},t.apply(this,arguments)}function b(o,c){var _=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);c&&(p=p.filter(function(d){return Object.getOwnPropertyDescriptor(o,d).enumerable})),_.push.apply(_,p)}return _}function v(o){for(var c=1;c<arguments.length;c++){var _=arguments[c]!=null?arguments[c]:{};c%2?b(Object(_),!0).forEach(function(p){m(o,p,_[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(_)):b(Object(_)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(_,p))})}return o}function m(o,c,_){return c in o?Object.defineProperty(o,c,{value:_,enumerable:!0,configurable:!0,writable:!0}):o[c]=_,o}var T=v(v({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:W.default,bufferController:e.default,capLevelController:E.default,fpsController:g.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:n.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},y()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:N.default,timelineController:C.TimelineController,audioStreamController:P.default,audioTrackController:R.default,emeController:h.default,cmcdController:a.default});function y(){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 f(o,c){if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(c.liveMaxLatencyDurationCount!==void 0&&(c.liveSyncDurationCount===void 0||c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(c.liveMaxLatencyDuration!==void 0&&(c.liveSyncDuration===void 0||c.liveMaxLatencyDuration<=c.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},o,c)}function u(o){var c=o.loader;if(c!==l.default&&c!==i.default)r.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),o.progressive=!1;else{var _=Object(l.fetchSupported)();_&&(o.loader=l.default,o.progressive=!0,o.enableSoftwareAES=!0,r.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/polyfills/number.ts"),P=I("./src/utils/ewma-bandwidth-estimator.ts"),R=I("./src/events.ts"),K=I("./src/utils/buffer-helper.ts"),N=I("./src/errors.ts"),e=I("./src/types/loader.ts"),C=I("./src/utils/logger.ts");function E(a,i){for(var l=0;l<i.length;l++){var s=i[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function g(a,i,l){return i&&E(a.prototype,i),l&&E(a,l),a}var h=function(){function a(l){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=l;var s=l.config;this.bwEstimator=new P.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var i=a.prototype;return i.registerListeners=function(){var s=this.hls;s.on(R.Events.FRAG_LOADING,this.onFragLoading,this),s.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(R.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var s=this.hls;s.off(R.Events.FRAG_LOADING,this.onFragLoading,this),s.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(R.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,n){var r=n.frag;if(r.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=r,this.partCurrent=(t=n.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},i.onLevelLoaded=function(s,n){var r=this.hls.config;n.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},i._abandonRulesCheck=function(){var s=this.fragCurrent,n=this.partCurrent,r=this.hls,t=r.autoLevelEnabled,b=r.config,v=r.media;if(!s||!v)return;var m=n?n.stats:s.stats,T=n?n.duration:s.duration;if(m.aborted){C.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||v.paused||!v.playbackRate||!v.readyState)return;var y=performance.now()-m.loading.start,f=Math.abs(v.playbackRate);if(y<=500*T/f)return;var u=r.levels,o=r.minAutoLevel,c=u[s.level],_=m.total||Math.max(m.loaded,Math.round(T*c.maxBitrate/8)),p=Math.max(1,m.bwEstimate?m.bwEstimate/8:m.loaded*1e3/y),d=(_-m.loaded)/p,A=v.currentTime,D=(K.BufferHelper.bufferInfo(v,A,b.maxBufferHole).end-A)/f;if(D>=2*T/f||d<=D)return;var S=Number.POSITIVE_INFINITY,L;for(L=s.level-1;L>o;L--){var M=u[L].maxBitrate;if(S=T*M/(8*.8*p),S<D)break}if(S>=d)return;var O=this.bwEstimator.getEstimate();C.logger.warn("Fragment "+s.sn+(n?" part "+n.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+L+`
|
|
Current BW estimate: `+(Object(W.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+d.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+S.toFixed(3)+` s
|
|
Time to underbuffer: `+D.toFixed(3)+" s"),r.nextLoadLevel=L,this.bwEstimator.sample(y,m.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),r.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:n,stats:m})},i.onFragLoaded=function(s,n){var r=n.frag,t=n.part;if(r.type===e.PlaylistLevelType.MAIN&&Object(W.isFiniteNumber)(r.sn)){var b=t?t.stats:r.stats,v=t?t.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var m=this.hls.levels[r.level],T=(m.loaded?m.loaded.bytes:0)+b.loaded,y=(m.loaded?m.loaded.duration:0)+v;m.loaded={bytes:T,duration:y},m.realBitrate=Math.round(8*T/y)}if(r.bitrateTest){var f={stats:b,frag:r,part:t,id:r.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,f),r.bitrateTest=!1}}},i.onFragBuffered=function(s,n){var r=n.frag,t=n.part,b=t?t.stats:r.stats;if(b.aborted)return;if(r.type!==e.PlaylistLevelType.MAIN||r.sn==="initSegment")return;var v=b.parsing.end-b.loading.start;this.bwEstimator.sample(v,b.loaded),b.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},i.onError=function(s,n){switch(n.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.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,n=this.partCurrent,r=this.hls,t=r.maxAutoLevel,b=r.config,v=r.minAutoLevel,m=r.media,T=n?n.duration:s?s.duration:0,y=m?m.currentTime:0,f=m&&m.playbackRate!==0?Math.abs(m.playbackRate):1,u=this.bwEstimator?this.bwEstimator.getEstimate():b.abrEwmaDefaultEstimate,o=(K.BufferHelper.bufferInfo(m,y,b.maxBufferHole).end-y)/f,c=this.findBestLevel(u,v,t,o,b.abrBandWidthFactor,b.abrBandWidthUpFactor);if(c>=0)return c;C.logger.trace((o?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=T?Math.min(T,b.maxStarvationDelay):b.maxStarvationDelay,p=b.abrBandWidthFactor,d=b.abrBandWidthUpFactor;if(!o){var A=this.bitrateTestDelay;if(A){var D=T?Math.min(T,b.maxLoadingDelay):b.maxLoadingDelay;_=D-A,C.logger.trace("bitrate test took "+Math.round(1e3*A)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),p=d=1}}return c=this.findBestLevel(u,v,t,o+_,p,d),Math.max(c,0)},i.findBestLevel=function(s,n,r,t,b,v){for(var m,T=this.fragCurrent,y=this.partCurrent,f=this.lastLoadedFragLevel,u=this.hls.levels,o=u[f],c=!!(o!=null&&(m=o.details)!==null&&m!==void 0&&m.live),_=o==null?void 0:o.codecSet,p=y?y.duration:T?T.duration:0,d=r;d>=n;d--){var A=u[d];if(!A||_&&A.codecSet!==_)continue;var D=A.details,S=(y?D==null?void 0:D.partTarget:D==null?void 0:D.averagetargetduration)||p,L=void 0;d<=f?L=b*s:L=v*s;var M=u[d].maxBitrate,O=M*S/L;if(C.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+d+"/"+Math.round(L)+"/"+M+"/"+S+"/"+t+"/"+O),L>M&&(!O||c&&!this.bitrateTestDelay||O<t))return d}return-1},g(a,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,n=this.bwEstimator;if(s!==-1&&(!n||!n.canEstimate()))return s;var r=this.getNextABRAutoLevel();return s!==-1&&(r=Math.min(s,r)),r},set:function(s){this._nextAutoLevel=s}}]),a}();H.default=h},"./src/controller/audio-stream-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/polyfills/number.ts"),P=I("./src/controller/base-stream-controller.ts"),R=I("./src/events.ts"),K=I("./src/utils/buffer-helper.ts"),N=I("./src/controller/fragment-tracker.ts"),e=I("./src/types/level.ts"),C=I("./src/types/loader.ts"),E=I("./src/loader/fragment.ts"),g=I("./src/demux/chunk-cache.ts"),h=I("./src/demux/transmuxer-interface.ts"),a=I("./src/types/transmuxer.ts"),i=I("./src/controller/fragment-finders.ts"),l=I("./src/utils/discontinuities.ts"),s=I("./src/errors.ts"),n=I("./src/utils/logger.ts");function r(){return r=Object.assign||function(T){for(var y=1;y<arguments.length;y++){var f=arguments[y];for(var u in f)Object.prototype.hasOwnProperty.call(f,u)&&(T[u]=f[u])}return T},r.apply(this,arguments)}function t(T,y){T.prototype=Object.create(y.prototype),T.prototype.constructor=T,b(T,y)}function b(T,y){return b=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},b(T,y)}var v=100,m=function(T){t(y,T);function y(u,o){var c;return c=T.call(this,u,o,"[audio-stream-controller]")||this,c.videoBuffer=null,c.videoTrackCC=-1,c.waitingVideoCC=-1,c.audioSwitch=!1,c.trackId=-1,c.waitingData=null,c.mainDetails=null,c.bufferFlushed=!1,c._registerListeners(),c}var f=y.prototype;return f.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},f._registerListeners=function(){var o=this.hls;o.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),o.on(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(R.Events.ERROR,this.onError,this),o.on(R.Events.BUFFER_RESET,this.onBufferReset,this),o.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this),o.on(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f._unregisterListeners=function(){var o=this.hls;o.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),o.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),o.off(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),o.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(R.Events.ERROR,this.onError,this),o.off(R.Events.BUFFER_RESET,this.onBufferReset,this),o.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),o.off(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),o.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},f.onInitPtsFound=function(o,c){var _=c.frag,p=c.id,d=c.initPTS;if(p==="main"){var A=_.cc;this.initPTS[_.cc]=d,this.log("InitPTS for cc: "+A+" found from main: "+d),this.videoTrackCC=A,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},f.startLoad=function(o){if(!this.levels){this.startPosition=o,this.state=P.State.STOPPED;return}var c=this.lastCurrentTime;this.stopLoad(),this.setInterval(v),this.fragLoadError=0,c>0&&o===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=o,this.tick()},f.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var o,c=this.levels,_=this.trackId,p=c==null||((o=c[_])===null||o===void 0)?void 0:o.details;if(p){if(this.waitForCdnTuneIn(p))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var d,A=performance.now(),D=this.retryDate;(!D||A>=D||(d=this.media)!==null&&d!==void 0&&d.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var S=this.waitingData;if(S){var L=S.frag,M=S.part,O=S.cache,j=S.complete;if(this.initPTS[L.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var G=O.flush(),X={frag:L,part:M,payload:G,networkDetails:null};this._handleFragmentLoadProgress(X),j&&T.prototype._handleFragmentLoadComplete.call(this,X)}else if(this.videoTrackCC!==this.waitingVideoCC)n.logger.log("Waiting fragment cc ("+L.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ee=this.getLoadPosition(),he=K.BufferHelper.bufferInfo(this.mediaBuffer,ee,this.config.maxBufferHole),ge=Object(i.fragmentWithinToleranceTest)(he.end,this.config.maxFragLookUpTolerance,L);ge<0&&(n.logger.log("Waiting fragment cc ("+L.cc+") @ "+L.start+" cancelled because another fragment at "+he.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},f.clearWaitingFragment=function(){var o=this.waitingData;o&&(this.fragmentTracker.removeFragment(o.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},f.onTickEnd=function(){var o=this.media;if(!o||!o.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:o,_=c.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=o.currentTime},f.doTickIdle=function(){var o,c,_=this.hls,p=this.levels,d=this.media,A=this.trackId,D=_.config;if(!p||!p[A])return;if(!d&&(this.startFragRequested||!D.startFragPrefetch))return;var S=p[A],L=S.details;if(!L||L.live&&this.levelLastLoaded!==A||this.waitForCdnTuneIn(L)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,E.ElementaryStreamTypes.AUDIO,C.PlaylistLevelType.AUDIO));var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,C.PlaylistLevelType.AUDIO);if(M===null)return;var O=M.len,j=this.getMaxBufferLength(),G=this.audioSwitch;if(O>=j&&!G)return;if(!G&&this._streamEnded(M,L)){_.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var X=L.fragments,ee=X[0].start,he=M.end;if(G){var ge=this.getLoadPosition();he=ge,L.PTSKnown&&ge<ee&&((M.end>ee||M.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),d.currentTime=ee+.05))}var de=this.getNextFragment(he,L);if(!de){this.bufferFlushed=!0;return}((o=de.decryptdata)===null||o===void 0?void 0:o.keyFormat)==="identity"&&!((c=de.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(de,L):this.loadFragment(de,L,he)},f.getMaxBufferLength=function(){var o=T.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,C.PlaylistLevelType.MAIN);return c===null?o:Math.max(o,c.len)},f.onMediaDetaching=function(){this.videoBuffer=null,T.prototype.onMediaDetaching.call(this)},f.onAudioTracksUpdated=function(o,c){var _=c.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(p){return new e.Level(p)})},f.onAudioTrackSwitching=function(o,c){var _=!!c.url;this.trackId=c.id;var p=this.fragCurrent;p!=null&&p.loader&&p.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(v):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},f.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},f.onLevelLoaded=function(o,c){this.mainDetails=c.details},f.onAudioTrackLoaded=function(o,c){var _,p=this.levels,d=c.details,A=c.id;if(!p){this.warn("Audio tracks were reset while loading level "+A);return}this.log("Track "+A+" loaded ["+d.startSN+","+d.endSN+"],duration:"+d.totalduration);var D=p[A],S=0;if(d.live||(_=D.details)!==null&&_!==void 0&&_.live){var L=this.mainDetails;if(d.fragments[0]||(d.deltaUpdateFailed=!0),d.deltaUpdateFailed||!L)return;!D.details&&d.hasProgramDateTime&&L.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(d,L),S=d.fragments[0].start):S=this.alignPlaylists(d,D.details)}D.details=d,this.levelLastLoaded=A,!this.startFragRequested&&(this.mainDetails||!d.live)&&this.setStartPosition(D.details,S),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(d)&&(this.state=P.State.IDLE),this.tick()},f._handleFragmentLoadProgress=function(o){var c,_=o.frag,p=o.part,d=o.payload,A=this.config,D=this.trackId,S=this.levels;if(!S){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var L=S[D];console.assert(L,"Audio track is defined on fragment load progress");var M=L.details;console.assert(M,"Audio track details are defined on fragment load progress");var O=A.defaultAudioCodec||L.audioCodec||"mp4a.40.2",j=this.transmuxer;j||(j=this.transmuxer=new h.default(this.hls,C.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var G=this.initPTS[_.cc],X=(c=_.initSegment)===null||c===void 0?void 0:c.data;if(G!==void 0){var ee=!1,he=p?p.index:-1,ge=he!==-1,de=new a.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,d.byteLength,he,ge);j.push(d,X,O,"",_,p,M.totalduration,ee,de,G)}else{n.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+M.startSN+" ,"+M.endSN+"],track "+D);var Te=this.waitingData=this.waitingData||{frag:_,part:p,cache:new g.default,complete:!1},xe=Te.cache;xe.push(new Uint8Array(d)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},f._handleFragmentLoadComplete=function(o){if(this.waitingData){this.waitingData.complete=!0;return}T.prototype._handleFragmentLoadComplete.call(this,o)},f.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},f.onBufferCreated=function(o,c){var _=c.tracks.audio;_&&(this.mediaBuffer=_.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},f.onFragBuffered=function(o,c){var _=c.frag,p=c.part;if(_.type!==C.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(p?" p: "+p.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,p)},f.onError=function(o,c){switch(c.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(C.PlaylistLevelType.AUDIO,c);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=c.fatal?P.State.ERROR:P.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var _=!0,p=this.getFwdBufferInfo(this.mediaBuffer,C.PlaylistLevelType.AUDIO);p&&p.len>.5&&(_=!this.reduceMaxBufferLength(p.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,T.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},f.onBufferFlushed=function(o,c){var _=c.type;_===E.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},f._handleTransmuxComplete=function(o){var c,_="audio",p=this.hls,d=o.remuxResult,A=o.chunkMeta,D=this.getCurrentContext(A);if(!D){this.warn("The loading context changed while buffering fragment "+A.sn+" of level "+A.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(A.level);return}var S=D.frag,L=D.part,M=d.audio,O=d.text,j=d.id3,G=d.initSegment;if(this.fragContextChanged(S))return;if(this.state=P.State.PARSING,this.audioSwitch&&M&&this.completeAudioSwitch(),G!=null&&G.tracks&&(this._bufferInitSegment(G.tracks,S,A),p.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:S,id:_,tracks:G.tracks})),M){var X=M.startPTS,ee=M.endPTS,he=M.startDTS,ge=M.endDTS;L&&(L.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:X,endPTS:ee,startDTS:he,endDTS:ge}),S.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,X,ee,he,ge),this.bufferFragmentData(M,S,L,A)}if(j!=null&&(c=j.samples)!==null&&c!==void 0&&c.length){var de=r({frag:S,id:_},j);p.trigger(R.Events.FRAG_PARSING_METADATA,de)}if(O){var Te=r({frag:S,id:_},O);p.trigger(R.Events.FRAG_PARSING_USERDATA,Te)}},f._bufferInitSegment=function(o,c,_){if(this.state!==P.State.PARSING)return;o.video&&delete o.video;var p=o.audio;if(!p)return;p.levelCodec=p.codec,p.id="audio",this.log("Init audio buffer, container:"+p.container+", codecs[parsed]=["+p.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,o);var d=p.initSegment;if(d!=null&&d.byteLength){var A={type:"audio",frag:c,part:null,chunkMeta:_,parent:c.type,data:d};this.hls.trigger(R.Events.BUFFER_APPENDING,A)}this.tick()},f.loadFragment=function(o,c,_){var p=this.fragmentTracker.getState(o);this.fragCurrent=o,(this.audioSwitch||p===N.FragmentState.NOT_LOADED||p===N.FragmentState.PARTIAL)&&(o.sn==="initSegment"?this._loadInitSegment(o):c.live&&!Object(W.isFiniteNumber)(this.initPTS[o.cc])?(this.log("Waiting for video PTS in continuity counter "+o.cc+" of live stream before loading audio fragment "+o.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,o,c,_)))},f.completeAudioSwitch=function(){var o=this.hls,c=this.media,_=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),T.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,o.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:_})},y}(P.default);H.default=m},"./src/controller/audio-track-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/errors.ts"),R=I("./src/controller/base-playlist-controller.ts"),K=I("./src/types/loader.ts");function N(h,a){for(var i=0;i<a.length;i++){var l=a[i];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(h,l.key,l)}}function e(h,a,i){return a&&N(h.prototype,a),i&&N(h,i),h}function C(h,a){h.prototype=Object.create(a.prototype),h.prototype.constructor=h,E(h,a)}function E(h,a){return E=Object.setPrototypeOf||function(l,s){return l.__proto__=s,l},E(h,a)}var g=function(h){C(a,h);function a(l){var s;return s=h.call(this,l,"[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(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(W.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){var s=this.hls;s.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(W.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(W.Events.ERROR,this.onError,this)},i.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,h.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,n){this.tracks=n.audioTracks||[]},i.onAudioTrackLoaded=function(s,n){var r=n.id,t=n.details,b=this.tracksInGroup[r];if(!b){this.warn("Invalid audio track id "+r);return}var v=b.details;b.details=n.details,this.log("audioTrack "+r+" loaded ["+t.startSN+"-"+t.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,n,v))},i.onLevelLoading=function(s,n){this.switchLevel(n.level)},i.onLevelSwitching=function(s,n){this.switchLevel(n.level)},i.switchLevel=function(s){var n=this.hls.levels[s];if(!(n!=null&&n.audioGroupIds))return;var r=n.audioGroupIds[n.urlId];if(this.groupId!==r){this.groupId=r;var t=this.tracks.filter(function(v){return!r||v.groupId===r});this.selectDefaultTrack&&!t.some(function(v){return v.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var b={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(W.Events.AUDIO_TRACKS_UPDATED,b),this.selectInitialTrack()}},i.onError=function(s,n){if(h.prototype.onError.call(this,s,n),n.fatal||!n.context)return;n.context.type===K.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},i.setAudioTrack=function(s){var n=this.tracksInGroup;if(s<0||s>=n.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var r=n[this.trackId];this.log("Now switching to audio-track index "+s);var t=n[s],b=t.id,v=t.groupId,m=v===void 0?"":v,T=t.name,y=t.type,f=t.url;if(this.trackId=s,this.trackName=T,this.selectDefaultTrack=!1,this.hls.trigger(W.Events.AUDIO_TRACK_SWITCHING,{id:b,groupId:m,name:T,type:y,url:f}),t.details&&!t.details.live)return;var u=this.switchParams(t.url,r==null?void 0:r.details);this.loadPlaylist(u)},i.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var n=this.trackName,r=this.findTrackId(n)||this.findTrackId();r!==-1?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},i.findTrackId=function(s){for(var n=this.tracksInGroup,r=0;r<n.length;r++){var t=n[r];if((!this.selectDefaultTrack||t.default)&&(!s||s===t.name))return t.id}return-1},i.loadPlaylist=function(s){var n=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(n)){var r=n.id,t=n.groupId,b=n.url;if(s)try{b=s.addDirectives(b)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(W.Events.AUDIO_TRACK_LOADING,{url:b,id:r,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}(R.default);H.default=g},"./src/controller/base-playlist-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return e});var W=I("./src/polyfills/number.ts"),P=I("./src/types/level.ts"),R=I("./src/controller/level-helper.ts"),K=I("./src/utils/logger.ts"),N=I("./src/errors.ts"),e=function(){function C(g,h){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,h+":"),this.warn=K.logger.warn.bind(K.logger,h+":"),this.hls=g}var E=C.prototype;return E.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},E.onError=function(h,a){a.fatal&&a.type===N.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},E.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},E.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},E.stopLoad=function(){this.canLoad=!1,this.clearTimer()},E.switchParams=function(h,a){var i=a==null?void 0:a.renditionReports;if(i)for(var l=0;l<i.length;l++){var s=i[l],n=""+s.URI;if(n===h.substr(-n.length)){var r=parseInt(s["LAST-MSN"]),t=parseInt(s["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var b=Math.min(a.age-a.partTarget,a.targetduration);t!==void 0&&b>a.partTarget&&(t+=1)}if(Object(W.isFiniteNumber)(r))return new P.HlsUrlParameters(r,Object(W.isFiniteNumber)(t)?t:void 0,P.HlsSkip.No)}}},E.loadPlaylist=function(h){},E.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},E.playlistLoaded=function(h,a,i){var l=this,s=a.details,n=a.stats,r=n.loading.end?Math.max(0,self.performance.now()-n.loading.end):0;if(s.advancedDateTime=Date.now()-r,s.live||i!=null&&i.live){if(s.reloaded(i),i&&this.log("live playlist "+h+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),i&&s.fragments.length>0&&Object(R.mergeDetails)(i,s),!this.canLoad||!s.live)return;var t,b=void 0,v=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var m=this.hls.config.lowLatencyMode,T=s.lastPartSn,y=s.endSN,f=s.lastPartIndex,u=f!==-1,o=T===y,c=m?0:f;u?(b=o?y+1:T,v=o?c:f+1):b=y+1;var _=s.age,p=_+s.ageHeader,d=Math.min(p-s.partTarget,s.targetduration*1.5);if(d>0){if(i&&d>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+i.tuneInGoal+" to: "+d+" with playlist age: "+s.age),d=0;else{var A=Math.floor(d/s.targetduration);if(b+=A,v!==void 0){var D=Math.round(d%s.targetduration/s.partTarget);v+=D}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+d+" skip sn "+A+" to part "+v)}s.tuneInGoal=d}if(t=this.getDeliveryDirectives(s,a.deliveryDirectives,b,v),m||!o){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(s,a.deliveryDirectives,b,v);var S=Object(R.computeReloadInterval)(s,n);b!==void 0&&s.canBlockReload&&(S-=s.partTarget||1),this.log("reload live playlist "+h+" in "+Math.round(S)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(t)},S)}else this.clearTimer()},E.getDeliveryDirectives=function(h,a,i,l){var s=Object(P.getSkipValue)(h,i);return a!=null&&a.skip&&h.deltaUpdateFailed&&(i=a.msn,l=a.part,s=P.HlsSkip.No),new P.HlsUrlParameters(i,l,s)},E.retryLoadingOrFail=function(h){var a=this,i=this.hls.config,l=this.retryCount<i.levelLoadingMaxRetry;if(l){var s;if(this.retryCount++,h.details.indexOf("LoadTimeOut")>-1&&(s=h.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+h.details+'"'),this.loadPlaylist();else{var n=Math.min(Math.pow(2,this.retryCount)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},n),this.warn("retry playlist loading #"+this.retryCount+" in "+n+' ms after "'+h.details+'"')}}else this.warn('cannot recover from error "'+h.details+'"'),this.clearTimer(),h.fatal=!0;return l},C}()},"./src/controller/base-stream-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"State",function(){return y}),I.d(H,"default",function(){return f});var W=I("./src/polyfills/number.ts"),P=I("./src/task-loop.ts"),R=I("./src/controller/fragment-tracker.ts"),K=I("./src/utils/buffer-helper.ts"),N=I("./src/utils/logger.ts"),e=I("./src/events.ts"),C=I("./src/errors.ts"),E=I("./src/types/transmuxer.ts"),g=I("./src/utils/mp4-tools.ts"),h=I("./src/utils/discontinuities.ts"),a=I("./src/controller/fragment-finders.ts"),i=I("./src/controller/level-helper.ts"),l=I("./src/loader/fragment-loader.ts"),s=I("./src/crypt/decrypter.ts"),n=I("./src/utils/time-ranges.ts"),r=I("./src/types/loader.ts");function t(u,o){for(var c=0;c<o.length;c++){var _=o[c];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(u,_.key,_)}}function b(u,o,c){return o&&t(u.prototype,o),c&&t(u,c),u}function v(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function m(u,o){u.prototype=Object.create(o.prototype),u.prototype.constructor=u,T(u,o)}function T(u,o){return T=Object.setPrototypeOf||function(_,p){return _.__proto__=p,_},T(u,o)}var y={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"},f=function(u){m(o,u);function o(_,p,d){var A;return A=u.call(this)||this,A.hls=void 0,A.fragPrevious=null,A.fragCurrent=null,A.fragmentTracker=void 0,A.transmuxer=null,A._state=y.STOPPED,A.media=void 0,A.mediaBuffer=void 0,A.config=void 0,A.bitrateTest=!1,A.lastCurrentTime=0,A.nextLoadPosition=0,A.startPosition=0,A.loadedmetadata=!1,A.fragLoadError=0,A.retryDate=0,A.levels=null,A.fragmentLoader=void 0,A.levelLastLoaded=null,A.startFragRequested=!1,A.decrypter=void 0,A.initPTS=[],A.onvseeking=null,A.onvended=null,A.logPrefix="",A.log=void 0,A.warn=void 0,A.logPrefix=d,A.log=N.logger.log.bind(N.logger,d+":"),A.warn=N.logger.warn.bind(N.logger,d+":"),A.hls=_,A.fragmentLoader=new l.default(_.config),A.fragmentTracker=p,A.config=_.config,A.decrypter=new s.default(_,_.config),_.on(e.Events.KEY_LOADED,A.onKeyLoaded,v(A)),A}var c=o.prototype;return c.doTick=function(){this.onTickEnd()},c.onTickEnd=function(){},c.startLoad=function(p){},c.stopLoad=function(){this.fragmentLoader.abort();var p=this.fragCurrent;p&&this.fragmentTracker.removeFragment(p),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=y.STOPPED},c._streamEnded=function(p,d){var A=this.fragCurrent,D=this.fragmentTracker;if(!d.live&&A&&A.sn===d.endSN&&!p.nextStart){var S=D.getState(A);return S===R.FragmentState.PARTIAL||S===R.FragmentState.OK}return!1},c.onMediaAttached=function(p,d){var A=this.media=this.mediaBuffer=d.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),A.addEventListener("seeking",this.onvseeking),A.addEventListener("ended",this.onvended);var D=this.config;this.levels&&D.autoStartLoad&&this.state===y.STOPPED&&this.startLoad(D.startPosition)},c.onMediaDetaching=function(){var p=this.media;p!=null&&p.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),p&&(p.removeEventListener("seeking",this.onvseeking),p.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},c.onMediaSeeking=function(){var p=this.config,d=this.fragCurrent,A=this.media,D=this.mediaBuffer,S=this.state,L=A?A.currentTime:0,M=K.BufferHelper.bufferInfo(D||A,L,p.maxBufferHole);if(this.log("media seeking to "+(Object(W.isFiniteNumber)(L)?L.toFixed(3):L)+", state: "+S),S===y.ENDED)this.resetLoadingState();else if(d&&!M.len){var O=p.maxFragLookUpTolerance,j=d.start-O,G=d.start+d.duration+O,X=L>G;(L<j||X)&&(X&&d.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),d.loader.abort()),this.resetLoadingState())}A&&(this.lastCurrentTime=L),!this.loadedmetadata&&!M.len&&(this.nextLoadPosition=this.startPosition=L),this.tickImmediate()},c.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},c.onKeyLoaded=function(p,d){if(this.state!==y.KEY_LOADING||d.frag!==this.fragCurrent||!this.levels)return;this.state=y.IDLE;var A=this.levels[d.frag.level].details;A&&this.loadFragment(d.frag,A,d.frag.start)},c.onHandlerDestroying=function(){this.stopLoad(),u.prototype.onHandlerDestroying.call(this)},c.onHandlerDestroyed=function(){this.state=y.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,u.prototype.onHandlerDestroyed.call(this)},c.loadKey=function(p,d){this.log("Loading key for "+p.sn+" of ["+d.startSN+"-"+d.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level),this.state=y.KEY_LOADING,this.fragCurrent=p,this.hls.trigger(e.Events.KEY_LOADING,{frag:p})},c.loadFragment=function(p,d,A){this._loadFragForPlayback(p,d,A)},c._loadFragForPlayback=function(p,d,A){var D=this,S=function(M){if(D.fragContextChanged(p)){D.warn("Fragment "+p.sn+(M.part?" p: "+M.part.index:"")+" of level "+p.level+" was dropped during download."),D.fragmentTracker.removeFragment(p);return}p.stats.chunkCount++,D._handleFragmentLoadProgress(M)};this._doFragLoad(p,d,A,S).then(function(L){if(!L)return;D.fragLoadError=0;var M=D.state;if(D.fragContextChanged(p)){(M===y.FRAG_LOADING||M===y.BACKTRACKING||!D.fragCurrent&&M===y.PARSING)&&(D.fragmentTracker.removeFragment(p),D.state=y.IDLE);return}if("payload"in L&&(D.log("Loaded fragment "+p.sn+" of level "+p.level),D.hls.trigger(e.Events.FRAG_LOADED,L),D.state===y.BACKTRACKING)){D.fragmentTracker.backtrack(p,L),D.resetFragmentLoading(p);return}D._handleFragmentLoadComplete(L)}).catch(function(L){D.warn(L),D.resetFragmentLoading(p)})},c.flushMainBuffer=function(p,d,A){if(A===void 0&&(A=null),!(p-d))return;var D={startOffset:p,endOffset:d,type:A};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,D)},c._loadInitSegment=function(p){var d=this;this._doFragLoad(p).then(function(A){if(!A||d.fragContextChanged(p)||!d.levels)throw new Error("init load aborted");return A}).then(function(A){var D=d.hls,S=A.payload,L=p.decryptdata;if(S&&S.byteLength>0&&L&&L.key&&L.iv&&L.method==="AES-128"){var M=self.performance.now();return d.decrypter.webCryptoDecrypt(new Uint8Array(S),L.key.buffer,L.iv.buffer).then(function(O){var j=self.performance.now();return D.trigger(e.Events.FRAG_DECRYPTED,{frag:p,payload:O,stats:{tstart:M,tdecrypt:j}}),A.payload=O,A})}return A}).then(function(A){var D=d.fragCurrent,S=d.hls,L=d.levels;if(!L)throw new Error("init load aborted, missing levels");var M=L[p.level].details;console.assert(M,"Level details are defined when init segment is loaded");var O=p.stats;d.state=y.IDLE,d.fragLoadError=0,p.data=new Uint8Array(A.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),A.frag===D&&S.trigger(e.Events.FRAG_BUFFERED,{stats:O,frag:D,part:null,id:p.type}),d.tick()}).catch(function(A){d.warn(A),d.resetFragmentLoading(p)})},c.fragContextChanged=function(p){var d=this.fragCurrent;return!p||!d||p.level!==d.level||p.sn!==d.sn||p.urlId!==d.urlId},c.fragBufferedComplete=function(p,d){var A=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+p.type+" sn: "+p.sn+(d?" part: "+d.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+p.level+" "+n.default.toString(K.BufferHelper.getBuffered(A))),this.state=y.IDLE,this.tick()},c._handleFragmentLoadComplete=function(p){var d=this.transmuxer;if(!d)return;var A=p.frag,D=p.part,S=p.partsLoaded,L=!S||S.length===0||S.some(function(O){return!O}),M=new E.ChunkMetadata(A.level,A.sn,A.stats.chunkCount+1,0,D?D.index:-1,!L);d.flush(M)},c._handleFragmentLoadProgress=function(p){},c._doFragLoad=function(p,d,A,D){var S=this;if(A===void 0&&(A=null),!this.levels)throw new Error("frag load aborted, missing levels");if(A=Math.max(p.start,A||0),this.config.lowLatencyMode&&d){var L=d.partList;if(L&&D){A>p.end&&d.fragmentHint&&(p=d.fragmentHint);var M=this.getNextPart(L,p,A);if(M>-1){var O=L[M];return this.log("Loading part sn: "+p.sn+" p: "+O.index+" cc: "+p.cc+" of playlist ["+d.startSN+"-"+d.endSN+"] parts [0-"+M+"-"+(L.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(A.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=y.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:p,part:L[M],targetBufferTime:A}),this.doFragPartsLoad(p,L,M,D).catch(function(j){return S.handleFragLoadError(j)})}else if(!p.url||this.loadedEndOfParts(L,A))return Promise.resolve(null)}}return this.log("Loading fragment "+p.sn+" cc: "+p.cc+" "+(d?"of ["+d.startSN+"-"+d.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+p.level+", target: "+parseFloat(A.toFixed(3))),Object(W.isFiniteNumber)(p.sn)&&!this.bitrateTest&&(this.nextLoadPosition=p.start+p.duration),this.state=y.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:p,targetBufferTime:A}),this.fragmentLoader.load(p,D).catch(function(j){return S.handleFragLoadError(j)})},c.doFragPartsLoad=function(p,d,A,D){var S=this;return new Promise(function(L,M){var O=[],j=function G(X){var ee=d[X];S.fragmentLoader.loadPart(p,ee,D).then(function(he){O[ee.index]=he;var ge=he.part;S.hls.trigger(e.Events.FRAG_LOADED,he);var de=d[X+1];if(de&&de.fragment===p)G(X+1);else return L({frag:p,part:ge,partsLoaded:O})}).catch(M)};j(A)})},c.handleFragLoadError=function(p){var d=p.data;return d&&d.details===C.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(d.frag,d.part):this.hls.trigger(e.Events.ERROR,d),null},c._handleTransmuxerFlush=function(p){var d=this.getCurrentContext(p);if(!d||this.state!==y.PARSING){this.fragCurrent||(this.state=y.IDLE);return}var A=d.frag,D=d.part,S=d.level,L=self.performance.now();A.stats.parsing.end=L,D&&(D.stats.parsing.end=L),this.updateLevelTiming(A,D,S,p.partial)},c.getCurrentContext=function(p){var d=this.levels,A=p.level,D=p.sn,S=p.part;if(!d||!d[A])return this.warn("Levels object was unset while buffering fragment "+D+" of level "+A+". The current chunk will not be buffered."),null;var L=d[A],M=S>-1?Object(i.getPartWith)(L,D,S):null,O=M?M.fragment:Object(i.getFragmentWithSN)(L,D,this.fragCurrent);return O?{frag:O,part:M,level:L}:null},c.bufferFragmentData=function(p,d,A,D){if(!p||this.state!==y.PARSING)return;var S=p.data1,L=p.data2,M=S;if(S&&L&&(M=Object(g.appendUint8Array)(S,L)),!M||!M.length)return;var O={type:p.type,frag:d,part:A,chunkMeta:D,parent:d.type,data:M};this.hls.trigger(e.Events.BUFFER_APPENDING,O),p.dropped&&p.independent&&!A&&this.flushBufferGap(d)},c.flushBufferGap=function(p){var d=this.media;if(!d)return;if(!K.BufferHelper.isBuffered(d,d.currentTime)){this.flushMainBuffer(0,p.start);return}var A=d.currentTime,D=K.BufferHelper.bufferInfo(d,A,0),S=p.duration,L=Math.min(this.config.maxFragLookUpTolerance*2,S*.25),M=Math.max(Math.min(p.start-L,D.end-L),A+L);p.start-M>L&&this.flushMainBuffer(M,p.start)},c.getFwdBufferInfo=function(p,d){var A=this.config,D=this.getLoadPosition();if(!Object(W.isFiniteNumber)(D))return null;var S=K.BufferHelper.bufferInfo(p,D,A.maxBufferHole);if(S.len===0&&S.nextStart!==void 0){var L=this.fragmentTracker.getBufferedFrag(D,d);if(L&&S.nextStart<L.end)return K.BufferHelper.bufferInfo(p,D,Math.max(S.nextStart,A.maxBufferHole))}return S},c.getMaxBufferLength=function(p){var d=this.config,A;return p?A=Math.max(8*d.maxBufferSize/p,d.maxBufferLength):A=d.maxBufferLength,Math.min(A,d.maxMaxBufferLength)},c.reduceMaxBufferLength=function(p){var d=this.config,A=p||d.maxBufferLength;return d.maxMaxBufferLength>=A?(d.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+d.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(p,d){var A,D,S=d.fragments,L=S.length;if(!L)return null;var M=this.config,O=S[0].start,j;if(d.live){var G=M.initialLiveManifestSize;if(L<G)return this.warn("Not enough fragments to start playback (have: "+L+", need: "+G+")"),null;!d.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(j=this.getInitialLiveFragment(d,S),this.startPosition=j?this.hls.liveSyncPosition||j.start:p)}else p<=O&&(j=S[0]);if(!j){var X=M.lowLatencyMode?d.partEnd:d.fragmentEnd;j=this.getFragmentAtPosition(p,X,d)}return(A=j)!==null&&A!==void 0&&A.initSegment&&!((D=j)!==null&&D!==void 0&&D.initSegment.data)&&!this.bitrateTest&&(j=j.initSegment),j},c.getNextPart=function(p,d,A){for(var D=-1,S=!1,L=!0,M=0,O=p.length;M<O;M++){var j=p[M];if(L=L&&!j.independent,D>-1&&A<j.start)break;var G=j.loaded;!G&&(S||j.independent||L)&&j.fragment===d&&(D=M),S=G}return D},c.loadedEndOfParts=function(p,d){var A=p[p.length-1];return A&&d>A.start&&A.loaded},c.getInitialLiveFragment=function(p,d){var A=this.fragPrevious,D=null;if(A){if(p.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+A.programDateTime),D=Object(a.findFragmentByPDT)(d,A.endProgramDateTime,this.config.maxFragLookUpTolerance)),!D){var S=A.sn+1;if(S>=p.startSN&&S<=p.endSN){var L=d[S-p.startSN];A.cc===L.cc&&(D=L,this.log("Live playlist, switching playlist, load frag with next SN: "+D.sn))}D||(D=Object(a.findFragWithCC)(d,A.cc),D&&this.log("Live playlist, switching playlist, load frag with same CC: "+D.sn))}}else{var M=this.hls.liveSyncPosition;M!==null&&(D=this.getFragmentAtPosition(M,this.bitrateTest?p.fragmentEnd:p.edge,p))}return D},c.getFragmentAtPosition=function(p,d,A){var D=this.config,S=this.fragPrevious,L=A.fragments,M=A.endSN,O=A.fragmentHint,j=D.maxFragLookUpTolerance,G=!!(D.lowLatencyMode&&A.partList&&O);G&&O&&!this.bitrateTest&&(L=L.concat(O),M=O.sn);var X;if(p<d){var ee=p>d-j?0:j;X=Object(a.findFragmentByPTS)(S,L,p,ee)}else X=L[L.length-1];if(X){var he=X.sn-A.startSN,ge=S&&X.level===S.level,de=L[he+1],Te=this.fragmentTracker.getState(X);if(Te===R.FragmentState.BACKTRACKED){X=null;for(var xe=he;L[xe]&&this.fragmentTracker.getState(L[xe])===R.FragmentState.BACKTRACKED;)S?X=L[xe--]:X=L[--xe];X||(X=de)}else S&&X.sn===S.sn&&!G&&(ge&&(X.sn<M&&this.fragmentTracker.getState(de)!==R.FragmentState.OK?(this.log("SN "+X.sn+" just loaded, load next one: "+de.sn),X=de):X=null))}return X},c.synchronizeToLiveEdge=function(p){var d=this.config,A=this.media;if(!A)return;var D=this.hls.liveSyncPosition,S=A.currentTime,L=p.fragments[0].start,M=p.edge,O=S>=L-d.maxFragLookUpTolerance&&S<=M;if(D!==null&&A.duration>D&&(S<D||!O)){var j=d.liveMaxLatencyDuration!==void 0?d.liveMaxLatencyDuration:d.liveMaxLatencyDurationCount*p.targetduration;(!O&&A.readyState<4||S<M-j)&&(this.loadedmetadata||(this.nextLoadPosition=D),A.readyState&&(this.warn("Playback: "+S.toFixed(3)+" is located too far from the end of live sliding playlist: "+M+", reset currentTime to : "+D.toFixed(3)),A.currentTime=D))}},c.alignPlaylists=function(p,d){var A=this.levels,D=this.levelLastLoaded,S=this.fragPrevious,L=D!==null?A[D]:null,M=p.fragments.length;if(!M)return this.warn("No fragments in live playlist"),0;var O=p.fragments[0].start,j=!d,G=p.alignedSliding&&Object(W.isFiniteNumber)(O);if(j||!G&&!O){Object(h.alignStream)(S,L,p);var X=p.fragments[0].start;return this.log("Live playlist sliding: "+X.toFixed(2)+" start-sn: "+(d?d.startSN:"na")+"->"+p.startSN+" prev-sn: "+(S?S.sn:"na")+" fragments: "+M),X}return O},c.waitForCdnTuneIn=function(p){var d=3;return p.live&&p.canBlockReload&&p.tuneInGoal>Math.max(p.partHoldBack,p.partTarget*d)},c.setStartPosition=function(p,d){var A=this.startPosition;if(A<d&&(A=-1),A===-1||this.lastCurrentTime===-1){var D=p.startTimeOffset;Object(W.isFiniteNumber)(D)?(A=d+D,D<0&&(A+=p.totalduration),A=Math.min(Math.max(d,A),d+p.totalduration),this.log("Start time offset "+D+" found in playlist, adjust startPosition to "+A),this.startPosition=A):p.live?A=this.hls.liveSyncPosition||d:this.startPosition=A=0,this.lastCurrentTime=A}this.nextLoadPosition=A},c.getLoadPosition=function(){var p=this.media,d=0;return this.loadedmetadata&&p?d=p.currentTime:this.nextLoadPosition&&(d=this.nextLoadPosition),d},c.handleFragLoadAborted=function(p,d){this.transmuxer&&p.sn!=="initSegment"&&p.stats.aborted&&(this.warn("Fragment "+p.sn+(d?" part"+d.index:"")+" of level "+p.level+" was aborted"),this.resetFragmentLoading(p))},c.resetFragmentLoading=function(p){(!this.fragCurrent||!this.fragContextChanged(p))&&(this.state=y.IDLE)},c.onFragmentOrKeyLoadError=function(p,d){if(d.fatal)return;var A=d.frag;if(!A||A.type!==p)return;var D=this.fragCurrent;console.assert(D&&A.sn===D.sn&&A.level===D.level&&A.urlId===D.urlId,"Frag load error must match current frag to retry");var S=this.config;if(this.fragLoadError+1<=S.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(A.level))return;var L=Math.min(Math.pow(2,this.fragLoadError)*S.fragLoadingRetryDelay,S.fragLoadingMaxRetryTimeout);this.warn("Fragment "+A.sn+" of "+p+" "+A.level+" failed to load, retrying in "+L+"ms"),this.retryDate=self.performance.now()+L,this.fragLoadError++,this.state=y.FRAG_LOADING_WAITING_RETRY}else d.levelRetry?(p===r.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=y.IDLE):(N.logger.error(d.details+" reaches max retry, redispatch as fatal ..."),d.fatal=!0,this.hls.stopLoad(),this.state=y.ERROR)},c.afterBufferFlushed=function(p,d,A){if(!p)return;var D=K.BufferHelper.getBuffered(p);this.fragmentTracker.detectEvictedFragments(d,D,A),this.state===y.ENDED&&this.resetLoadingState()},c.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=y.IDLE},c.resetLiveStartWhenNotLoaded=function(p){if(!this.loadedmetadata){this.startFragRequested=!1;var d=this.levels?this.levels[p].details:null;if(d!=null&&d.live)return this.startPosition=-1,this.setStartPosition(d,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},c.updateLevelTiming=function(p,d,A,D){var S=this,L=A.details;console.assert(!!L,"level.details must be defined");var M=Object.keys(p.elementaryStreams).reduce(function(O,j){var G=p.elementaryStreams[j];if(G){var X=G.endPTS-G.startPTS;if(X<=0)return S.warn("Could not parse fragment "+p.sn+" "+j+" duration reliably ("+X+") resetting transmuxer to fallback to playlist timing"),S.resetTransmuxer(),O||!1;var ee=D?0:Object(i.updateFragPTSDTS)(L,p,G.startPTS,G.endPTS,G.startDTS,G.endDTS);return S.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:L,level:A,drift:ee,type:j,frag:p,start:G.startPTS,end:G.endPTS}),!0}return O},!1);M?(this.state=y.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:p,part:d})):this.resetLoadingState()},c.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},b(o,[{key:"state",get:function(){return this._state},set:function(p){var d=this._state;d!==p&&(this._state=p,this.log(d+"->"+p))}}]),o}(P.default)},"./src/controller/buffer-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return a});var W=I("./src/polyfills/number.ts"),P=I("./src/events.ts"),R=I("./src/utils/logger.ts"),K=I("./src/errors.ts"),N=I("./src/utils/buffer-helper.ts"),e=I("./src/utils/mediasource-helper.ts"),C=I("./src/loader/fragment.ts"),E=I("./src/controller/buffer-operation-queue.ts"),g=Object(e.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function i(s){var n=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 r=n.hls,t=n.media,b=n.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),t&&(n.updateMediaElementDuration(),r.trigger(P.Events.MEDIA_ATTACHED,{media:t})),b&&b.removeEventListener("sourceopen",n._onMediaSourceOpen),n.checkPendingTracks()},this._onMediaSourceClose=function(){R.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){R.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var l=i.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var n=this.hls;n.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(P.Events.BUFFER_RESET,this.onBufferReset,this),n.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.on(P.Events.BUFFER_EOS,this.onBufferEos,this),n.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.on(P.Events.FRAG_PARSED,this.onFragParsed,this),n.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var n=this.hls;n.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(P.Events.BUFFER_RESET,this.onBufferReset,this),n.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),n.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),n.off(P.Events.BUFFER_EOS,this.onBufferEos,this),n.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),n.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),n.off(P.Events.FRAG_PARSED,this.onFragParsed,this),n.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new E.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(n,r){var t=2;(r.audio&&!r.video||!r.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(n,r){var t=this.media=r.media;if(t&&g){var b=this.mediaSource=new g;b.addEventListener("sourceopen",this._onMediaSourceOpen),b.addEventListener("sourceended",this._onMediaSourceEnded),b.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(b),this._objectUrl=t.src}},l.onMediaDetaching=function(){var n=this.media,r=this.mediaSource,t=this._objectUrl;if(r){if(R.logger.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(b){R.logger.warn("[buffer-controller]: onMediaDetaching: "+b.message+" while calling endOfStream")}this.onBufferReset(),r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),n&&(t&&self.URL.revokeObjectURL(t),n.src===t?(n.removeAttribute("src"),n.load()):R.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(P.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var n=this;this.getSourceBufferTypes().forEach(function(r){var t=n.sourceBuffer[r];try{t&&(n.removeBufferListeners(r),n.mediaSource&&n.mediaSource.removeSourceBuffer(t),n.sourceBuffer[r]=void 0)}catch(b){R.logger.warn("[buffer-controller]: Failed to reset the "+r+" buffer",b)}}),this._initSourceBuffer()},l.onBufferCodecs=function(n,r){var t=this,b=this.getSourceBufferTypes().length;if(Object.keys(r).forEach(function(v){if(b){var m=t.tracks[v];if(m&&typeof m.buffer.changeType=="function"){var T=r[v],y=T.codec,f=T.levelCodec,u=T.container,o=(m.levelCodec||m.codec).replace(h,"$1"),c=(f||y).replace(h,"$1");if(o!==c){var _=u+";codecs="+(f||y);t.appendChangeType(v,_)}}}else t.pendingTracks[v]=r[v]}),b)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(n,r){var t=this,b=this.operationQueue,v={execute:function(){var T=t.sourceBuffer[n];T&&(R.logger.log("[buffer-controller]: changing "+n+" sourceBuffer type to "+r),T.changeType(r)),b.shiftAndExecuteNext(n)},onStart:function(){},onComplete:function(){},onError:function(T){R.logger.warn("[buffer-controller]: Failed to change "+n+" SourceBuffer type",T)}};b.append(v,n)},l.onBufferAppending=function(n,r){var t=this,b=this.hls,v=this.operationQueue,m=this.tracks,T=r.data,y=r.type,f=r.frag,u=r.part,o=r.chunkMeta,c=o.buffering[y],_=self.performance.now();c.start=_;var p=f.stats.buffering,d=u?u.stats.buffering:null;p.start===0&&(p.start=_),d&&d.start===0&&(d.start=_);var A=m.audio,D=y==="audio"&&o.id===1&&(A==null?void 0:A.container)==="audio/mpeg",S={execute:function(){if(c.executeStart=self.performance.now(),D){var M=t.sourceBuffer[y];if(M){var O=f.start-M.timestampOffset;Math.abs(O)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+f.start+" (delta: "+O+") sn: "+f.sn+")"),M.timestampOffset=f.start)}}t.appendExecutor(T,y)},onStart:function(){},onComplete:function(){var M=self.performance.now();c.executeEnd=c.end=M,p.first===0&&(p.first=M),d&&d.first===0&&(d.first=M);var O=t.sourceBuffer,j={};for(var G in O)j[G]=N.BufferHelper.getBuffered(O[G]);t.appendError=0,t.hls.trigger(P.Events.BUFFER_APPENDED,{type:y,frag:f,part:u,chunkMeta:o,parent:f.type,timeRanges:j})},onError:function(M){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+y+" SourceBuffer",M);var O={type:K.ErrorTypes.MEDIA_ERROR,parent:f.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:M,fatal:!1};M.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=K.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,O.details=K.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>b.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+b.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),b.trigger(P.Events.ERROR,O)}};v.append(S,y)},l.onBufferFlushing=function(n,r){var t=this,b=this.operationQueue,v=function(T){return{execute:t.removeExecutor.bind(t,T,r.startOffset,r.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(P.Events.BUFFER_FLUSHED,{type:T})},onError:function(f){R.logger.warn("[buffer-controller]: Failed to remove from "+T+" SourceBuffer",f)}}};r.type?b.append(v(r.type),r.type):this.getSourceBufferTypes().forEach(function(m){b.append(v(m),m)})},l.onFragParsed=function(n,r){var t=this,b=r.frag,v=r.part,m=[],T=v?v.elementaryStreams:b.elementaryStreams;T[C.ElementaryStreamTypes.AUDIOVIDEO]?m.push("audiovideo"):(T[C.ElementaryStreamTypes.AUDIO]&&m.push("audio"),T[C.ElementaryStreamTypes.VIDEO]&&m.push("video"));var y=function(){var u=self.performance.now();b.stats.buffering.end=u,v&&(v.stats.buffering.end=u);var o=v?v.stats:b.stats;t.hls.trigger(P.Events.FRAG_BUFFERED,{frag:b,part:v,stats:o,id:b.type})};m.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+b.type+" level: "+b.level+" sn: "+b.sn),this.blockBuffers(y,m)},l.onFragChanged=function(n,r){this.flushBackBuffer()},l.onBufferEos=function(n,r){var t=this,b=this.getSourceBufferTypes().reduce(function(v,m){var T=t.sourceBuffer[m];return(!r.type||r.type===m)&&(T&&!T.ended&&(T.ended=!0,R.logger.log("[buffer-controller]: "+m+" sourceBuffer now EOS"))),v&&!!(!T||T.ended)},!0);b&&this.blockBuffers(function(){var v=t.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},l.onLevelUpdated=function(n,r){var t=r.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var n=this.hls,r=this.details,t=this.media,b=this.sourceBuffer;if(!t||r===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var m=r.live&&n.config.liveBackBufferLength!==null?n.config.liveBackBufferLength:n.config.backBufferLength;if(!Object(W.isFiniteNumber)(m)||m<0)return;var T=t.currentTime,y=r.levelTargetDuration,f=Math.max(m,y),u=Math.floor(T/y)*y-f;v.forEach(function(o){var c=b[o];if(c){var _=N.BufferHelper.getBuffered(c);_.length>0&&u>_.start(0)&&(n.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:u}),r.live&&n.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:u}),n.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:u,type:o}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var n=this.details,r=this.hls,t=this.media,b=this.mediaSource,v=n.fragments[0].start+n.totalduration,m=t.duration,T=Object(W.isFiniteNumber)(b.duration)?b.duration:0;n.live&&r.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),b.duration=Infinity,this.updateSeekableRange(n)):(v>T&&v>m||!Object(W.isFiniteNumber)(m))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),b.duration=v)},l.updateSeekableRange=function(n){var r=this.mediaSource,t=n.fragments,b=t.length;if(b&&n.live&&r!==null&&r!==void 0&&r.setLiveSeekableRange){var v=Math.max(0,t[0].start),m=Math.max(v,v+n.totalduration);r.setLiveSeekableRange(v,m)}},l.checkPendingTracks=function(){var n=this.bufferCodecEventsExpected,r=this.operationQueue,t=this.pendingTracks,b=Object.keys(t).length;if(b&&!n||b===2){this.createSourceBuffers(t),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(m){r.executeNext(m)})}},l.createSourceBuffers=function(n){var r=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var b=0;for(var v in n)if(!r[v]){var m=n[v];if(!m)throw Error("source buffer exists for track "+v+", however track does not");var T=m.levelCodec||m.codec,y=m.container+";codecs="+T;R.logger.log("[buffer-controller]: creating sourceBuffer("+y+")");try{var f=r[v]=t.addSourceBuffer(y),u=v;this.addBufferListener(u,"updatestart",this._onSBUpdateStart),this.addBufferListener(u,"updateend",this._onSBUpdateEnd),this.addBufferListener(u,"error",this._onSBUpdateError),this.tracks[v]={buffer:f,codec:T,container:m.container,levelCodec:m.levelCodec,id:m.id},b++}catch(o){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+o.message),this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:o,mimeType:y})}}b&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(n){var r=this.operationQueue,t=r.current(n);t.onStart()},l._onSBUpdateEnd=function(n){var r=this.operationQueue,t=r.current(n);t.onComplete(),r.shiftAndExecuteNext(n)},l._onSBUpdateError=function(n,r){R.logger.error("[buffer-controller]: "+n+" SourceBuffer error",r),this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(n);t&&t.onError(r)},l.removeExecutor=function(n,r,t){var b=this.media,v=this.mediaSource,m=this.operationQueue,T=this.sourceBuffer,y=T[n];if(!b||!v||!y){R.logger.warn("[buffer-controller]: Attempting to remove from the "+n+" SourceBuffer, but it does not exist"),m.shiftAndExecuteNext(n);return}var f=Object(W.isFiniteNumber)(b.duration)?b.duration:Infinity,u=Object(W.isFiniteNumber)(v.duration)?v.duration:Infinity,o=Math.max(0,r),c=Math.min(t,f,u);c>o?(R.logger.log("[buffer-controller]: Removing ["+o+","+c+"] from the "+n+" SourceBuffer"),console.assert(!y.updating,n+" sourceBuffer must not be updating"),y.remove(o,c)):m.shiftAndExecuteNext(n)},l.appendExecutor=function(n,r){var t=this.operationQueue,b=this.sourceBuffer,v=b[r];if(!v){R.logger.warn("[buffer-controller]: Attempting to append to the "+r+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(r);return}v.ended=!1,console.assert(!v.updating,r+" sourceBuffer must not be updating"),v.appendBuffer(n)},l.blockBuffers=function(n,r){var t=this;if(r===void 0&&(r=this.getSourceBufferTypes()),!r.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(n);return}var b=this.operationQueue,v=r.map(function(m){return b.appendBlocker(m)});Promise.all(v).then(function(){n(),r.forEach(function(m){var T=t.sourceBuffer[m];(!T||!T.updating)&&b.shiftAndExecuteNext(m)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(n,r,t){var b=this.sourceBuffer[n];if(!b)return;var v=t.bind(this,n);this.listeners[n].push({event:r,listener:v}),b.addEventListener(r,v)},l.removeBufferListeners=function(n){var r=this.sourceBuffer[n];if(!r)return;this.listeners[n].forEach(function(t){r.removeEventListener(t.event,t.listener)})},i}()},"./src/controller/buffer-operation-queue.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return P});var W=I("./src/utils/logger.ts"),P=function(){function R(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var K=R.prototype;return K.append=function(e,C){var E=this.queues[C];E.push(e),E.length===1&&this.buffers[C]&&this.executeNext(C)},K.insertAbort=function(e,C){var E=this.queues[C];E.unshift(e),this.executeNext(C)},K.appendBlocker=function(e){var C,E=new Promise(function(h){C=h}),g={execute:C,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,e),E},K.executeNext=function(e){var C=this.buffers,E=this.queues,g=C[e],h=E[e];if(h.length){var a=h[0];try{a.execute()}catch(i){W.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(i),(!g||!g.updating)&&(h.shift(),this.executeNext(e))}}},K.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},K.current=function(e){return this.queues[e][0]},R}()},"./src/controller/cap-level-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts");function P(N,e){for(var C=0;C<e.length;C++){var E=e[C];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(N,E.key,E)}}function R(N,e,C){return e&&P(N.prototype,e),C&&P(N,C),N}var K=function(){function N(C){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=C,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=N.prototype;return e.setStreamController=function(E){this.streamController=E},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 E=this.hls;E.on(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var E=this.hls;E.off(W.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(E,g){N.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},e.onMediaAttaching=function(E,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},e.onManifestParsed=function(E,g){var h=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,h.config.capLevelToPlayerSize&&g.video&&this.startCapping()},e.onBufferCodecs=function(E,g){var h=this.hls;h.config.capLevelToPlayerSize&&g.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var E=this.hls.levels;if(E.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(E.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},e.getMaxLevel=function(E){var g=this,h=this.hls.levels;if(!h.length)return-1;var a=h.filter(function(i,l){return N.isLevelAllowed(l,g.restrictedLevels)&&l<=E});return this.clientRect=null,N.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 E=this.media,g={width:0,height:0};if(E){var h=E.getBoundingClientRect();g.width=h.width,g.height=h.height,!g.width&&!g.height&&(g.width=h.right-h.left||E.width||0,g.height=h.bottom-h.top||E.height||0)}return this.clientRect=g,g},N.isLevelAllowed=function(E,g){return g===void 0&&(g=[]),g.indexOf(E)===-1},N.getMaxLevelByMediaSize=function(E,g,h){if(!E||!E.length)return-1;for(var a=function(r,t){return t?r.width!==t.width||r.height!==t.height:!0},i=E.length-1,l=0;l<E.length;l+=1){var s=E[l];if((s.width>=g||s.height>=h)&&a(s,E[l+1])){i=l;break}}return i},R(N,[{key:"mediaWidth",get:function(){return this.getDimensions().width*N.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*N.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var E=1;try{E=self.devicePixelRatio}catch(g){}return E}}]),N}();H.default=K},"./src/controller/cmcd-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return a});var W=I("./src/events.ts"),P=I("./src/types/cmcd.ts"),R=I("./src/utils/buffer-helper.ts"),K=I("./src/utils/logger.ts");function N(i,l){for(var s=0;s<l.length;s++){var n=l[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,n.key,n)}}function e(i,l,s){return l&&N(i.prototype,l),s&&N(i,s),i}function C(i,l){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=E(i))||l&&i&&typeof i.length=="number"){s&&(i=s);var n=0;return function(){return n>=i.length?{done:!0}:{done:!1,value:i[n++]}}}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 E(i,l){if(!i)return;if(typeof i=="string")return g(i,l);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 g(i,l)}function g(i,l){(l==null||l>i.length)&&(l=i.length);for(var s=0,n=new Array(l);s<l;s++)n[s]=i[s];return n}function h(){return h=Object.assign||function(i){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(i[n]=s[n])}return i},h.apply(this,arguments)}var a=function(){function i(s){var n=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(){n.initialized&&(n.starved=!0),n.buffering=!0},this.onPlaying=function(){n.initialized||(n.initialized=!0),n.buffering=!1},this.applyPlaylistData=function(b){try{n.apply(b,{ot:P.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(v){K.logger.warn("Could not generate manifest CMCD data.",v)}},this.applyFragmentData=function(b){try{var v=b.frag,m=n.hls.levels[v.level],T=n.getObjectType(v),y={d:v.duration*1e3,ot:T};(T===P.CMCDObjectType.VIDEO||T===P.CMCDObjectType.AUDIO||T==P.CMCDObjectType.MUXED)&&(y.br=m.bitrate/1e3,y.tb=n.getTopBandwidth(T),y.bl=n.getBufferLength(T)),n.apply(b,y)}catch(f){K.logger.warn("Could not generate segment CMCD data.",f)}},this.hls=s;var r=this.config=s.config,t=r.cmcd;t!=null&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||i.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var l=i.prototype;return l.registerListeners=function(){var n=this.hls;n.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var n=this.hls;n.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),n.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},l.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},l.onMediaAttached=function(n,r){this.media=r.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},l.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},l.onBufferCreated=function(n,r){var t,b;this.audioBuffer=(t=r.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(b=r.tracks.video)===null||b===void 0?void 0:b.buffer},l.createData=function(){var n;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(n=this.media)===null||n===void 0?void 0:n.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},l.apply=function(n,r){r===void 0&&(r={}),h(r,this.createData());var t=r.ot===P.CMCDObjectType.INIT||r.ot===P.CMCDObjectType.VIDEO||r.ot===P.CMCDObjectType.MUXED;if(this.starved&&t&&(r.bs=!0,r.su=!0,this.starved=!1),r.su==null&&(r.su=this.buffering),this.useHeaders){var b=i.toHeaders(r);if(!Object.keys(b).length)return;n.headers||(n.headers={}),h(n.headers,b)}else{var v=i.toQuery(r);if(!v)return;n.url=i.appendQueryToUri(n.url,v)}},l.getObjectType=function(n){var r=n.type;return r==="subtitle"?P.CMCDObjectType.TIMED_TEXT:n.sn==="initSegment"?P.CMCDObjectType.INIT:r==="audio"?P.CMCDObjectType.AUDIO:r==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},l.getTopBandwidth=function(n){for(var r=0,t=n===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,b=C(t),v;!(v=b()).done;){var m=v.value;m.bitrate>r&&(r=m.bitrate)}return r>0?r:NaN},l.getBufferLength=function(n){var r=this.hls.media,t=n===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!r)return NaN;var b=R.BufferHelper.bufferInfo(t,r.currentTime,this.config.maxBufferHole);return b.len*1e3},l.createPlaylistLoader=function(){var n=this.config.pLoader,r=this.applyPlaylistData,t=n||this.config.loader;return function(){function b(m){this.loader=void 0,this.loader=new t(m)}var v=b.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(T,y,f){r(T),this.loader.load(T,y,f)},e(b,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),b}()},l.createFragmentLoader=function(){var n=this.config.fLoader,r=this.applyFragmentData,t=n||this.config.loader;return function(){function b(m){this.loader=void 0,this.loader=new t(m)}var v=b.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(T,y,f){r(T),this.loader.load(T,y,f)},e(b,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),b}()},i.uuid=function(){var n=URL.createObjectURL(new Blob),r=n.toString();return URL.revokeObjectURL(n),r.substr(r.lastIndexOf("/")+1)},i.serialize=function(n){for(var r=[],t=function(D){return!Number.isNaN(D)&&D!=null&&D!==""&&D!==!1},b=function(D){return Math.round(D)},v=function(D){return b(D/100)*100},m=function(D){return encodeURIComponent(D)},T={br:b,d:b,bl:v,dl:v,mtp:v,nor:m,rtp:v,tb:b},y=Object.keys(n||{}).sort(),f=C(y),u;!(u=f()).done;){var o=u.value,c=n[o];if(!t(c))continue;if(o==="v"&&c===1)continue;if(o=="pr"&&c===1)continue;var _=T[o];_&&(c=_(c));var p=typeof c,d=void 0;o==="ot"||o==="sf"||o==="st"?d=o+"="+c:p==="boolean"?d=o:p==="number"?d=o+"="+c:d=o+"="+JSON.stringify(c),r.push(d)}return r.join(",")},i.toHeaders=function(n){for(var r=Object.keys(n),t={},b=["Object","Request","Session","Status"],v=[{},{},{},{}],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},T=0,y=r;T<y.length;T++){var f=y[T],u=m[f]!=null?m[f]:1;v[u][f]=n[f]}for(var o=0;o<v.length;o++){var c=i.serialize(v[o]);c&&(t["CMCD-"+b[o]]=c)}return t},i.toQuery=function(n){return"CMCD="+encodeURIComponent(i.serialize(n))},i.appendQueryToUri=function(n,r){if(!r)return n;var t=n.includes("?")?"&":"?";return""+n+t+r},i}()},"./src/controller/eme-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/errors.ts"),R=I("./src/utils/logger.ts"),K=I("./src/utils/mediakeys-helper.ts");function N(a,i){for(var l=0;l<i.length;l++){var s=i[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,i,l){return i&&N(a.prototype,i),l&&N(a,l),a}var C=3,E=function(i,l,s){var n={audioCapabilities:[],videoCapabilities:[]};return i.forEach(function(r){n.audioCapabilities.push({contentType:'audio/mp4; codecs="'+r+'"',robustness:s.audioRobustness||""})}),l.forEach(function(r){n.videoCapabilities.push({contentType:'video/mp4; codecs="'+r+'"',robustness:s.videoRobustness||""})}),[n]},g=function(i,l,s,n){switch(i){case K.KeySystems.WIDEVINE:return E(l,s,n);default:throw new Error("Unknown key-system: "+i)}},h=function(){function a(l){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=l,this._config=l.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(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i._unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(W.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this)},i.getLicenseServerUrl=function(s){switch(s){case K.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,n,r){var t=this,b=g(s,n,r,this._drmSystemOptions);R.logger.log("Requesting encrypted media key-system access");var v=this.requestMediaKeySystemAccess(s,b);this.mediaKeysPromise=v.then(function(m){return t._onMediaKeySystemAccessObtained(s,m)}),v.catch(function(m){R.logger.error('Failed to obtain key-system "'+s+'" access:',m)})},i._onMediaKeySystemAccessObtained=function(s,n){var r=this;R.logger.log('Access for key-system "'+s+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:n,mediaKeySystemDomain:s};this._mediaKeysList.push(t);var b=Promise.resolve().then(function(){return n.createMediaKeys()}).then(function(v){return t.mediaKeys=v,R.logger.log('Media-keys created for key-system "'+s+'"'),r._onMediaKeysCreated(),v});return b.catch(function(v){R.logger.error("Failed to create media-keys:",v)}),b},i._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(n){n.mediaKeysSession||(n.mediaKeysSession=n.mediaKeys.createSession(),s._onNewMediaKeySession(n.mediaKeysSession))})},i._onNewMediaKeySession=function(s){var n=this;R.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(r){n._onKeySessionMessage(s,r.message)},!1)},i._onKeySessionMessage=function(s,n){R.logger.log("Got EME message event, creating license request"),this._requestLicense(n,function(r){R.logger.log("Received license data (length: "+(r&&r.byteLength)+"), updating key-session"),s.update(r)})},i.onMediaEncrypted=function(s){var n=this;if(R.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var r=function(b){if(!n._media)return;n._attemptSetMediaKeys(b),n._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(r).catch(r)},i._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var n=this._mediaKeysList[0];if(!n||!n.mediaKeys){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}R.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(n.mediaKeys),this._hasSetMediaKeys=!0}},i._generateRequestWithPreferredKeySession=function(s,n){var r=this,t=this._mediaKeysList[0];if(!t){R.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){R.logger.warn("Key-Session already initialized but requested again");return}var b=t.mediaKeysSession;if(!b){R.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!n){R.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}R.logger.log('Generating key-session request for "'+s+'" init data type'),t.mediaKeysSessionInitialized=!0,b.generateRequest(s,n).then(function(){R.logger.debug("Key-session generation succeeded")}).catch(function(v){R.logger.error("Error generating key-session request:",v),r.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},i._createLicenseXhr=function(s,n,r){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,s,n,r);var b=this._licenseXhrSetup;if(b)try{b.call(this.hls,t,s),b=void 0}catch(v){R.logger.error(v)}try{t.readyState||t.open("POST",s,!0),b&&b.call(this.hls,t,s)}catch(v){throw new Error("issue setting up KeySystem license XHR "+v)}return t},i._onLicenseRequestReadyStageChange=function(s,n,r,t){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,R.logger.log("License request succeeded");var b=s.response,v=this._licenseResponseCallback;if(v)try{b=v.call(this.hls,s,n)}catch(T){R.logger.error(T)}t(b)}else{if(R.logger.error("License Request XHR failed ("+n+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>C){this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var m=C-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+m+" attempts left"),this._requestLicense(r,t)}break}},i._generateLicenseRequestChallenge=function(s,n){switch(s.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return n}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},i._requestLicense=function(s,n){R.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(r.mediaKeySystemDomain),b=this._createLicenseXhr(t,s,n);R.logger.log("Sending license request to URL: "+t);var v=this._generateLicenseRequestChallenge(r,s);b.send(v)}catch(m){R.logger.error("Failure requesting DRM license: "+m),this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},i.onMediaAttached=function(s,n){if(!this._emeEnabled)return;var r=n.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)},i.onMediaDetached=function(){var s=this._media,n=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(n.map(function(r){if(r.mediaKeysSession)return r.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},i.onManifestParsed=function(s,n){if(!this._emeEnabled)return;var r=n.levels.map(function(b){return b.audioCodec}).filter(function(b){return!!b}),t=n.levels.map(function(b){return b.videoCodec}).filter(function(b){return!!b});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,r,t)},e(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();H.default=h},"./src/controller/fps-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/utils/logger.ts"),R=function(){function K(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 N=K.prototype;return N.setStreamController=function(C){this.streamController=C},N.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},N.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching)},N.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},N.onMediaAttaching=function(C,E){var g=this.hls.config;if(g.capLevelOnFPSDrop){var h=E.media instanceof self.HTMLVideoElement?E.media:null;this.media=h,h&&typeof h.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),g.fpsDroppedMonitoringPeriod)}},N.checkFPS=function(C,E,g){var h=performance.now();if(E){if(this.lastTime){var a=h-this.lastTime,i=g-this.lastDroppedFrames,l=E-this.lastDecodedFrames,s=1e3*i/a,n=this.hls;if(n.trigger(W.Events.FPS_DROP,{currentDropped:i,currentDecoded:l,totalDroppedFrames:g}),s>0&&i>n.config.fpsDroppedMonitoringThreshold*l){var r=n.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+r),r>0&&(n.autoLevelCapping===-1||n.autoLevelCapping>=r)&&(r=r-1,n.trigger(W.Events.FPS_DROP_LEVEL_CAPPING,{level:r,droppedLevel:n.currentLevel}),n.autoLevelCapping=r,this.streamController.nextLevelSwitch())}}this.lastTime=h,this.lastDroppedFrames=g,this.lastDecodedFrames=E}},N.checkFPSInterval=function(){var C=this.media;if(C)if(this.isVideoPlaybackQualityAvailable){var E=C.getVideoPlaybackQuality();this.checkFPS(C,E.totalVideoFrames,E.droppedVideoFrames)}else this.checkFPS(C,C.webkitDecodedFrameCount,C.webkitDroppedFrameCount)},K}();H.default=R},"./src/controller/fragment-finders.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"findFragmentByPDT",function(){return R}),I.d(H,"findFragmentByPTS",function(){return K}),I.d(H,"fragmentWithinToleranceTest",function(){return N}),I.d(H,"pdtWithinToleranceTest",function(){return e}),I.d(H,"findFragWithCC",function(){return C});var W=I("./src/polyfills/number.ts"),P=I("./src/utils/binary-search.ts");function R(E,g,h){if(g===null||!Array.isArray(E)||!E.length||!Object(W.isFiniteNumber)(g))return null;var a=E[0].programDateTime;if(g<(a||0))return null;var i=E[E.length-1].endProgramDateTime;if(g>=(i||0))return null;h=h||0;for(var l=0;l<E.length;++l){var s=E[l];if(e(g,h,s))return s}return null}function K(E,g,h,a){h===void 0&&(h=0),a===void 0&&(a=0);var i=null;if(E?i=g[E.sn-g[0].sn+1]||null:h===0&&g[0].start===0&&(i=g[0]),i&&N(h,a,i)===0)return i;var l=P.default.search(g,N.bind(null,h,a));return l||i}function N(E,g,h){E===void 0&&(E=0),g===void 0&&(g=0);var a=Math.min(g,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-a<=E?1:h.start-a>E&&h.start?-1:0}function e(E,g,h){var a=Math.min(g,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,i=h.endProgramDateTime||0;return i-a>E}function C(E,g){return P.default.search(E,function(h){return h.cc<g?1:h.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"FragmentState",function(){return R}),I.d(H,"FragmentTracker",function(){return K});var W=I("./src/events.ts"),P=I("./src/types/loader.ts"),R;(function(C){C.NOT_LOADED="NOT_LOADED",C.BACKTRACKED="BACKTRACKED",C.APPENDING="APPENDING",C.PARTIAL="PARTIAL",C.OK="OK"})(R||(R={}));var K=function(){function C(g){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=g,this._registerListeners()}var E=C.prototype;return E._registerListeners=function(){var h=this.hls;h.on(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(W.Events.FRAG_LOADED,this.onFragLoaded,this)},E._unregisterListeners=function(){var h=this.hls;h.off(W.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(W.Events.FRAG_LOADED,this.onFragLoaded,this)},E.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},E.getAppendedFrag=function(h,a){if(a===P.PlaylistLevelType.MAIN){var i=this.activeFragment,l=this.activeParts;if(!i)return null;if(l)for(var s=l.length;s--;){var n=l[s],r=n?n.end:i.appendedPTS;if(n.start<=h&&r!==void 0&&h<=r)return s>9&&(this.activeParts=l.slice(s-9)),n}else if(i.start<=h&&i.appendedPTS!==void 0&&h<=i.appendedPTS)return i}return this.getBufferedFrag(h,a)},E.getBufferedFrag=function(h,a){for(var i=this.fragments,l=Object.keys(i),s=l.length;s--;){var n=i[l[s]];if((n==null?void 0:n.body.type)===a&&n.buffered){var r=n.body;if(r.start<=h&&h<=r.end)return r}}return null},E.detectEvictedFragments=function(h,a,i){var l=this;Object.keys(this.fragments).forEach(function(s){var n=l.fragments[s];if(!n)return;if(!n.buffered){n.body.type===i&&l.removeFragment(n.body);return}var r=n.range[h];if(!r)return;r.time.some(function(t){var b=!l.isTimeBuffered(t.startPTS,t.endPTS,a);return b&&l.removeFragment(n.body),b})})},E.detectPartialFragments=function(h){var a=this,i=this.timeRanges,l=h.frag,s=h.part;if(!i||l.sn==="initSegment")return;var n=e(l),r=this.fragments[n];if(!r)return;Object.keys(i).forEach(function(t){var b=l.elementaryStreams[t];if(!b)return;var v=i[t],m=s!==null||b.partial===!0;r.range[t]=a.getBufferedTimes(l,s,m,v)}),r.backtrack=r.loaded=null,Object.keys(r.range).length?r.buffered=!0:this.removeFragment(r.body)},E.fragBuffered=function(h){var a=e(h),i=this.fragments[a];i&&(i.backtrack=i.loaded=null,i.buffered=!0)},E.getBufferedTimes=function(h,a,i,l){for(var s={time:[],partial:i},n=a?a.start:h.start,r=a?a.end:h.end,t=h.minEndPTS||r,b=h.maxStartPTS||n,v=0;v<l.length;v++){var m=l.start(v)-this.bufferPadding,T=l.end(v)+this.bufferPadding;if(b>=m&&t<=T){s.time.push({startPTS:Math.max(n,l.start(v)),endPTS:Math.min(r,l.end(v))});break}else if(n<T&&r>m)s.partial=!0,s.time.push({startPTS:Math.max(n,l.start(v)),endPTS:Math.min(r,l.end(v))});else if(r<=m)break}return s},E.getPartialFragment=function(h){var a=null,i,l,s,n=0,r=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(b){var v=t[b];if(!v)return;N(v)&&(l=v.body.start-r,s=v.body.end+r,h>=l&&h<=s&&(i=Math.min(h-l,s-h),n<=i&&(a=v.body,n=i)))}),a},E.getState=function(h){var a=e(h),i=this.fragments[a];return i?i.buffered?N(i)?R.PARTIAL:R.OK:i.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},E.backtrack=function(h,a){var i=e(h),l=this.fragments[i];if(!l||l.backtrack)return null;var s=l.backtrack=a||l.loaded;return l.loaded=null,s},E.getBacktrackData=function(h){var a=e(h),i=this.fragments[a];if(i){var l,s=i.backtrack;if(s!=null&&(l=s.payload)!==null&&l!==void 0&&l.byteLength)return s;this.removeFragment(h)}return null},E.isTimeBuffered=function(h,a,i){for(var l,s,n=0;n<i.length;n++){if(l=i.start(n)-this.bufferPadding,s=i.end(n)+this.bufferPadding,h>=l&&a<=s)return!0;if(a<=l)return!1}return!1},E.onFragLoaded=function(h,a){var i=a.frag,l=a.part;if(i.sn==="initSegment"||i.bitrateTest||l)return;var s=e(i);this.fragments[s]={body:i,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},E.onBufferAppended=function(h,a){var i=this,l=a.frag,s=a.part,n=a.timeRanges;if(l.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=l,s){var r=this.activeParts;r||(this.activeParts=r=[]),r.push(s)}else this.activeParts=null;this.timeRanges=n,Object.keys(n).forEach(function(t){var b=n[t];if(i.detectEvictedFragments(t,b),!s)for(var v=0;v<b.length;v++)l.appendedPTS=Math.max(b.end(v),l.appendedPTS||0)})},E.onFragBuffered=function(h,a){this.detectPartialFragments(a)},E.hasFragment=function(h){var a=e(h);return!!this.fragments[a]},E.removeFragmentsInRange=function(h,a,i){var l=this;Object.keys(this.fragments).forEach(function(s){var n=l.fragments[s];if(!n)return;if(n.buffered){var r=n.body;r.type===i&&r.start<a&&r.end>h&&l.removeFragment(r)}})},E.removeFragment=function(h){var a=e(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),delete this.fragments[a]},E.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},C}();function N(C){var E,g;return C.buffered&&(((E=C.range.video)===null||E===void 0?void 0:E.partial)||((g=C.range.audio)===null||g===void 0?void 0:g.partial))}function e(C){return C.type+"_"+C.level+"_"+C.urlId+"_"+C.sn}},"./src/controller/gap-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"STALL_MINIMUM_DURATION_MS",function(){return N}),I.d(H,"MAX_START_GAP_JUMP",function(){return e}),I.d(H,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return C}),I.d(H,"SKIP_BUFFER_RANGE_START",function(){return E}),I.d(H,"default",function(){return g});var W=I("./src/utils/buffer-helper.ts"),P=I("./src/errors.ts"),R=I("./src/events.ts"),K=I("./src/utils/logger.ts"),N=250,e=2,C=.1,E=.05,g=function(){function h(i,l,s,n){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=l,this.fragmentTracker=s,this.hls=n}var a=h.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(l){var s=this.config,n=this.media,r=this.stalled,t=n.currentTime,b=n.seeking,v=this.seeking&&!b,m=!this.seeking&&b;if(this.seeking=b,t!==l){if(this.moved=!0,r!==null){if(this.stallReported){var T=self.performance.now()-r;K.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(T)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((m||v)&&(this.stalled=null),n.paused||n.ended||n.playbackRate===0||!W.BufferHelper.getBuffered(n).length)return;var y=W.BufferHelper.bufferInfo(n,t,0),f=y.len>0,u=y.nextStart||0;if(!f&&!u)return;if(b){var o=y.len>e,c=!u||u-t>e&&!this.fragmentTracker.getPartialFragment(t);if(o||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,p=Math.max(u,y.start||0)-t,d=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,A=d==null||((_=d.details)===null||_===void 0)?void 0:_.live,D=A?d.details.targetduration*2:e;if(p>0&&p<=D){this._trySkipBufferHole(null);return}}var S=self.performance.now();if(r===null){this.stalled=S;return}var L=S-r;!b&&L>=N&&this._reportStall(y.len);var M=W.BufferHelper.bufferInfo(n,t,s.maxBufferHole);this._tryFixBufferStall(M,L)},a._tryFixBufferStall=function(l,s){var n=this.config,r=this.fragmentTracker,t=this.media,b=t.currentTime,v=r.getPartialFragment(b);if(v){var m=this._trySkipBufferHole(v);if(m)return}l.len>n.maxBufferHole&&s>n.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(l){var s=this.hls,n=this.media,r=this.stallReported;r||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+l+")"),s.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},a._trySkipBufferHole=function(l){for(var s=this.config,n=this.hls,r=this.media,t=r.currentTime,b=0,v=W.BufferHelper.getBuffered(r),m=0;m<v.length;m++){var T=v.start(m);if(t+s.maxBufferHole>=b&&t<T){var y=Math.max(T+E,r.currentTime+C);return K.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+y),this.moved=!0,this.stalled=null,r.currentTime=y,l&&n.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+y,frag:l}),y}b=v.end(m)}return 0},a._tryNudgeBuffer=function(){var l=this.config,s=this.hls,n=this.media,r=n.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<l.nudgeMaxRetry){var b=r+t*l.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+r+" to "+b),n.currentTime=b,s.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+l.nudgeMaxRetry+" nudges"),s.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/utils/texttrack-utils.ts"),R=I("./src/demux/id3.ts"),K=.25,N=function(){function e(E){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=E,this._registerListeners()}var C=e.prototype;return C.destroy=function(){this._unregisterListeners()},C._registerListeners=function(){var g=this.hls;g.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var g=this.hls;g.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(W.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.onMediaAttached=function(g,h){this.media=h.media},C.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},C.getID3Track=function(g){if(!this.media)return;for(var h=0;h<g.length;h++){var a=g[h];if(a.kind==="metadata"&&a.label==="id3")return Object(P.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},C.onFragParsingMetadata=function(g,h){if(!this.media)return;var a=h.frag,i=h.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var l=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<i.length;s++){var n=R.getID3Frames(i[s].data);if(n){var r=i[s].pts,t=s<i.length-1?i[s+1].pts:a.end,b=t-r;b<=0&&(t=r+K);for(var v=0;v<n.length;v++){var m=n[v];if(!R.isTimeStampFrame(m)){var T=new l(r,t,"");T.value=m,this.id3Track.addCue(T)}}}}},C.onBufferFlushing=function(g,h){var a=h.startOffset,i=h.endOffset,l=h.type;if(!l||l==="audio"){var s=this.id3Track;s&&Object(P.removeCuesInRange)(s,a,i)}},e}();H.default=N},"./src/controller/latency-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return e});var W=I("./src/errors.ts"),P=I("./src/events.ts"),R=I("./src/utils/logger.ts");function K(C,E){for(var g=0;g<E.length;g++){var h=E[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(C,h.key,h)}}function N(C,E,g){return E&&K(C.prototype,E),g&&K(C,g),C}var e=function(){function C(g){var h=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 h.timeupdate()},this.hls=g,this.config=g.config,this.registerListeners()}var E=C.prototype;return E.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},E.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(P.Events.ERROR,this.onError,this)},E.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(P.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(P.Events.ERROR,this.onError)},E.onMediaAttached=function(h,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},E.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},E.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},E.onLevelUpdated=function(h,a){var i=a.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},E.onError=function(h,a){if(a.details!==W.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,R.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},E.timeupdate=function(){var h=this.media,a=this.levelDetails;if(!h||!a)return;this.currentTime=h.currentTime;var i=this.computeLatency();if(i===null)return;this._latency=i;var l=this.config,s=l.lowLatencyMode,n=l.maxLiveSyncPlaybackRate;if(!s||n===1)return;var r=this.targetLatency;if(r===null)return;var t=i-r,b=Math.min(this.maxLatency,r+a.targetduration),v=t<b;if(a.live&&v&&t>.05&&this.forwardBufferLength>1){var m=Math.min(2,Math.max(1,n)),T=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;h.playbackRate=Math.min(m,Math.max(1,T))}else h.playbackRate!==1&&h.playbackRate!==0&&(h.playbackRate=1)},E.estimateLiveEdge=function(){var h=this.levelDetails;return h===null?null:h.edge+h.age},E.computeLatency=function(){var h=this.estimateLiveEdge();return h===null?null:h-this.currentTime},N(C,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var h=this.config,a=this.levelDetails;return h.liveMaxLatencyDuration!==void 0?h.liveMaxLatencyDuration:a?h.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var h=this.levelDetails;if(h===null)return null;var a=h.holdBack,i=h.partHoldBack,l=h.targetduration,s=this.config,n=s.liveSyncDuration,r=s.liveSyncDurationCount,t=s.lowLatencyMode,b=this.hls.userConfig,v=t&&i||a;(b.liveSyncDuration||b.liveSyncDurationCount||v===0)&&(v=n!==void 0?n:r*l);var m=l,T=1;return v+Math.min(this.stallCount*T,m)}},{key:"liveSyncPosition",get:function(){var h=this.estimateLiveEdge(),a=this.targetLatency,i=this.levelDetails;if(h===null||a===null||i===null)return null;var l=i.edge,s=h-a-this.edgeStalled,n=l-i.totalduration,r=l-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(n,s),r)}},{key:"drift",get:function(){var h=this.levelDetails;return h===null?1:h.drift}},{key:"edgeStalled",get:function(){var h=this.levelDetails;if(h===null)return 0;var a=(this.config.lowLatencyMode&&h.partTarget||h.targetduration)*3;return Math.max(h.age-a,0)}},{key:"forwardBufferLength",get:function(){var h=this.media,a=this.levelDetails;if(!h||!a)return 0;var i=h.buffered.length;return i?h.buffered.end(i-1):a.edge-this.currentTime}}]),C}()},"./src/controller/level-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return s});var W=I("./src/types/level.ts"),P=I("./src/events.ts"),R=I("./src/errors.ts"),K=I("./src/utils/codecs.ts"),N=I("./src/controller/level-helper.ts"),e=I("./src/controller/base-playlist-controller.ts"),C=I("./src/types/loader.ts");function E(){return E=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var b in t)Object.prototype.hasOwnProperty.call(t,b)&&(n[b]=t[b])}return n},E.apply(this,arguments)}function g(n,r){for(var t=0;t<r.length;t++){var b=r[t];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(n,b.key,b)}}function h(n,r,t){return r&&g(n.prototype,r),t&&g(n,t),n}function a(n,r){n.prototype=Object.create(r.prototype),n.prototype.constructor=n,i(n,r)}function i(n,r){return i=Object.setPrototypeOf||function(b,v){return b.__proto__=v,b},i(n,r)}var l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(n){a(r,n);function r(b){var v;return v=n.call(this,b,"[level-controller]")||this,v._levels=[],v._firstLevel=-1,v._startLevel=void 0,v.currentLevelIndex=-1,v.manualLevelIndex=-1,v.onParsedComplete=void 0,v._registerListeners(),v}var t=r.prototype;return t._registerListeners=function(){var v=this.hls;v.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),v.on(P.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var v=this.hls;v.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),v.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),v.off(P.Events.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,n.prototype.destroy.call(this)},t.startLoad=function(){var v=this._levels;v.forEach(function(m){m.loadError=0}),n.prototype.startLoad.call(this)},t.onManifestLoaded=function(v,m){var T=[],y=[],f=[],u,o={},c,_=!1,p=!1,d=!1;if(m.levels.forEach(function(L){var M=L.attrs;_=_||!!(L.width&&L.height),p=p||!!L.videoCodec,d=d||!!L.audioCodec,l&&L.audioCodec&&L.audioCodec.indexOf("mp4a.40.34")!==-1&&(L.audioCodec=void 0);var O=L.bitrate+"-"+L.attrs.RESOLUTION+"-"+L.attrs.CODECS;c=o[O],c?c.url.push(L.url):(c=new W.Level(L),o[O]=c,T.push(c)),M&&(M.AUDIO&&Object(N.addGroupId)(c,"audio",M.AUDIO),M.SUBTITLES&&Object(N.addGroupId)(c,"text",M.SUBTITLES))}),(_||p)&&d&&(T=T.filter(function(L){var M=L.videoCodec,O=L.width,j=L.height;return!!M||!!(O&&j)})),T=T.filter(function(L){var M=L.audioCodec,O=L.videoCodec;return(!M||Object(K.isCodecSupportedInMp4)(M,"audio"))&&(!O||Object(K.isCodecSupportedInMp4)(O,"video"))}),m.audioTracks&&(y=m.audioTracks.filter(function(L){return!L.audioCodec||Object(K.isCodecSupportedInMp4)(L.audioCodec,"audio")}),Object(N.assignTrackIdsByGroup)(y)),m.subtitles&&(f=m.subtitles,Object(N.assignTrackIdsByGroup)(f)),T.length>0){u=T[0].bitrate,T.sort(function(L,M){return L.bitrate-M.bitrate}),this._levels=T;for(var A=0;A<T.length;A++)if(T[A].bitrate===u){this._firstLevel=A,this.log("manifest loaded, "+T.length+" level(s) found, first bitrate: "+u);break}var D=d&&!p,S={levels:T,audioTracks:y,subtitleTracks:f,firstLevel:this._firstLevel,stats:m.stats,audio:d,video:p,altAudio:!D&&y.some(function(L){return!!L.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,S),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:m.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(v,m){if(n.prototype.onError.call(this,v,m),m.fatal)return;var T=m.context,y=this._levels[this.currentLevelIndex];if(T&&(T.type===C.PlaylistContextType.AUDIO_TRACK&&y.audioGroupIds&&T.groupId===y.audioGroupIds[y.urlId]||T.type===C.PlaylistContextType.SUBTITLE_TRACK&&y.textGroupIds&&T.groupId===y.textGroupIds[y.urlId])){this.redundantFailover(this.currentLevelIndex);return}var f=!1,u=!0,o;switch(m.details){case R.ErrorDetails.FRAG_LOAD_ERROR:case R.ErrorDetails.FRAG_LOAD_TIMEOUT:case R.ErrorDetails.KEY_LOAD_ERROR:case R.ErrorDetails.KEY_LOAD_TIMEOUT:if(m.frag){var c=this._levels[m.frag.level];c?(c.fragmentError++,c.fragmentError>this.hls.config.fragLoadingMaxRetry&&(o=m.frag.level)):o=m.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:T&&(T.deliveryDirectives&&(u=!1),o=T.level),f=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:o=m.level,f=!0;break}o!==void 0&&this.recoverLevel(m,o,f,u)},t.recoverLevel=function(v,m,T,y){var f=v.details,u=this._levels[m];if(u.loadError++,T){var o=this.retryLoadingOrFail(v);if(o)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(y){var c=u.url.length;if(c>1&&u.loadError<c)v.levelRetry=!0,this.redundantFailover(m);else if(this.manualLevelIndex===-1){var _=m===0?this._levels.length-1:m-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(f+": switch to "+_),v.levelRetry=!0,this.hls.nextAutoLevel=_)}}},t.redundantFailover=function(v){var m=this._levels[v],T=m.url.length;if(T>1){var y=(m.urlId+1)%T;this.warn("Switching to redundant URL-id "+y),this._levels.forEach(function(f){f.urlId=y}),this.level=v}},t.onFragLoaded=function(v,m){var T=m.frag;if(T!==void 0&&T.type===C.PlaylistLevelType.MAIN){var y=this._levels[T.level];y!==void 0&&(y.fragmentError=0,y.loadError=0)}},t.onLevelLoaded=function(v,m){var T,y=m.level,f=m.details,u=this._levels[y];if(!u){var o;this.warn("Invalid level index "+y),(o=m.deliveryDirectives)!==null&&o!==void 0&&o.skip&&(f.deltaUpdateFailed=!0);return}y===this.currentLevelIndex?(u.fragmentError===0&&(u.loadError=0,this.retryCount=0),this.playlistLoaded(y,m,u.details)):(T=m.deliveryDirectives)!==null&&T!==void 0&&T.skip&&(f.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(v,m){var T=this.hls.levels[this.currentLevelIndex];if(!T)return;if(T.audioGroupIds){for(var y=-1,f=this.hls.audioTracks[m.id].groupId,u=0;u<T.audioGroupIds.length;u++)if(T.audioGroupIds[u]===f){y=u;break}y!==T.urlId&&(T.urlId=y,this.startLoad())}},t.loadPlaylist=function(v){var m=this.currentLevelIndex,T=this._levels[m];if(this.canLoad&&T&&T.url.length>0){var y=T.urlId,f=T.url[y];if(v)try{f=v.addDirectives(f)}catch(u){this.warn("Could not construct new URL with HLS Delivery Directives: "+u)}this.log("Attempt loading level index "+m+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+y+" "+f),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:f,level:m,id:y,deliveryDirectives:v||null})}},t.removeLevel=function(v,m){var T=function(u,o){return o!==m},y=this._levels.filter(function(f,u){return u!==v?!0:f.url.length>1&&m!==void 0?(f.url=f.url.filter(T),f.audioGroupIds&&(f.audioGroupIds=f.audioGroupIds.filter(T)),f.textGroupIds&&(f.textGroupIds=f.textGroupIds.filter(T)),f.urlId=0,!0):!1}).map(function(f,u){var o=f.details;return o!=null&&o.fragments&&o.fragments.forEach(function(c){c.level=u}),f});this._levels=y,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:y})},h(r,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var m,T=this._levels;if(T.length===0)return;if(this.currentLevelIndex===v&&(m=T[v])!==null&&m!==void 0&&m.details)return;if(v<0||v>=T.length){var y=v<0;if(this.hls.trigger(P.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:y,reason:"invalid level idx"}),y)return;v=Math.min(v,T.length-1)}this.clearTimer();var f=this.currentLevelIndex,u=T[f],o=T[v];this.log("switching to level "+v+" from "+f),this.currentLevelIndex=v;var c=E({},o,{level:v,maxBitrate:o.maxBitrate,uri:o.uri,urlId:o.urlId});delete c._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,c);var _=o.details;if(!_||_.live){var p=this.switchParams(o.uri,u==null?void 0:u.details);this.loadPlaylist(p)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),r}(e.default)},"./src/controller/level-helper.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"addGroupId",function(){return R}),I.d(H,"assignTrackIdsByGroup",function(){return K}),I.d(H,"updatePTS",function(){return N}),I.d(H,"updateFragPTSDTS",function(){return C}),I.d(H,"mergeDetails",function(){return E}),I.d(H,"mapPartIntersection",function(){return g}),I.d(H,"mapFragmentIntersection",function(){return h}),I.d(H,"adjustSliding",function(){return a}),I.d(H,"addSliding",function(){return i}),I.d(H,"computeReloadInterval",function(){return l}),I.d(H,"getFragmentWithSN",function(){return s}),I.d(H,"getPartWith",function(){return n});var W=I("./src/polyfills/number.ts"),P=I("./src/utils/logger.ts");function R(r,t,b){switch(t){case"audio":r.audioGroupIds||(r.audioGroupIds=[]),r.audioGroupIds.push(b);break;case"text":r.textGroupIds||(r.textGroupIds=[]),r.textGroupIds.push(b);break}}function K(r){var t={};r.forEach(function(b){var v=b.groupId||"";b.id=t[v]=t[v]||0,t[v]++})}function N(r,t,b){var v=r[t],m=r[b];e(v,m)}function e(r,t){var b=t.startPTS;if(Object(W.isFiniteNumber)(b)){var v=0,m;t.sn>r.sn?(v=b-r.start,m=r):(v=r.start-b,m=t),m.duration!==v&&(m.duration=v)}else if(t.sn>r.sn){var T=r.cc===t.cc;T&&r.minEndPTS?t.start=r.start+(r.minEndPTS-r.start):t.start=r.start+r.duration}else t.start=Math.max(r.start-t.duration,0)}function C(r,t,b,v,m,T){var y=v-b;y<=0&&(P.logger.warn("Fragment should have a positive duration",t),v=b+t.duration,T=m+t.duration);var f=b,u=v,o=t.startPTS,c=t.endPTS;if(Object(W.isFiniteNumber)(o)){var _=Math.abs(o-b);Object(W.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(_,t.deltaPTS):t.deltaPTS=_,f=Math.max(b,o),b=Math.min(b,o),m=Math.min(m,t.startDTS),u=Math.min(v,c),v=Math.max(v,c),T=Math.max(T,t.endDTS)}t.duration=v-b;var p=b-t.start;t.appendedPTS=v,t.start=t.startPTS=b,t.maxStartPTS=f,t.startDTS=m,t.endPTS=v,t.minEndPTS=u,t.endDTS=T;var d=t.sn;if(!r||d<r.startSN||d>r.endSN)return 0;var A,D=d-r.startSN,S=r.fragments;for(S[D]=t,A=D;A>0;A--)e(S[A],S[A-1]);for(A=D;A<S.length-1;A++)e(S[A],S[A+1]);return r.fragmentHint&&e(S[S.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,p}function E(r,t){for(var b=null,v=r.fragments,m=v.length-1;m>=0;m--){var T=v[m].initSegment;if(T){b=T;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;var y=0,f;if(h(r,t,function(A,D){A.relurl&&(y=A.cc-D.cc),Object(W.isFiniteNumber)(A.startPTS)&&Object(W.isFiniteNumber)(A.endPTS)&&(D.start=D.startPTS=A.startPTS,D.startDTS=A.startDTS,D.appendedPTS=A.appendedPTS,D.maxStartPTS=A.maxStartPTS,D.endPTS=A.endPTS,D.endDTS=A.endDTS,D.minEndPTS=A.minEndPTS,D.duration=A.endPTS-A.startPTS,D.duration&&(f=D),t.PTSKnown=t.alignedSliding=!0),D.elementaryStreams=A.elementaryStreams,D.loader=A.loader,D.stats=A.stats,D.urlId=A.urlId,A.initSegment&&(D.initSegment=A.initSegment,b=A.initSegment)}),b){var u=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;u.forEach(function(A){var D;(!A.initSegment||A.initSegment.relurl===((D=b)===null||D===void 0?void 0:D.relurl))&&(A.initSegment=b)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(A){return!A}),t.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var o=t.skippedSegments;o--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var c=t.fragments;if(y){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<c.length;_++)c[_].cc+=y}t.skippedSegments&&(t.startCC=t.fragments[0].cc),g(r.partList,t.partList,function(A,D){D.elementaryStreams=A.elementaryStreams,D.stats=A.stats}),f?C(t,f,f.startPTS,f.endPTS,f.startDTS,f.endDTS):a(r,t),c.length&&(t.totalduration=t.edge-c[0].start),t.driftStartTime=r.driftStartTime,t.driftStart=r.driftStart;var p=t.advancedDateTime;if(t.advanced&&p){var d=t.edge;t.driftStart||(t.driftStartTime=p,t.driftStart=d),t.driftEndTime=p,t.driftEnd=d}else t.driftEndTime=r.driftEndTime,t.driftEnd=r.driftEnd,t.advancedDateTime=r.advancedDateTime}function g(r,t,b){if(r&&t)for(var v=0,m=0,T=r.length;m<=T;m++){var y=r[m],f=t[m+v];y&&f&&y.index===f.index&&y.fragment.sn===f.fragment.sn?b(y,f):v--}}function h(r,t,b){for(var v=t.skippedSegments,m=Math.max(r.startSN,t.startSN)-t.startSN,T=(r.fragmentHint?1:0)+(v?t.endSN:Math.min(r.endSN,t.endSN))-t.startSN,y=t.startSN-r.startSN,f=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,u=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,o=m;o<=T;o++){var c=u[y+o],_=f[o];v&&!_&&o<v&&(_=t.fragments[o]=c),c&&_&&b(c,_)}}function a(r,t){var b=t.startSN+t.skippedSegments-r.startSN,v=r.fragments;if(b<0||b>=v.length)return;i(t,v[b].start)}function i(r,t){if(t){for(var b=r.fragments,v=r.skippedSegments;v<b.length;v++)b[v].start+=t;r.fragmentHint&&(r.fragmentHint.start+=t)}}function l(r,t){var b=1e3*r.levelTargetDuration,v=b/2,m=r.age,T=m>0&&m<b*3,y=t.loading.end-t.loading.start,f,u=r.availabilityDelay;if(r.updated===!1)if(T){var o=333*r.misses;f=Math.max(Math.min(v,y*2),o),r.availabilityDelay=(r.availabilityDelay||0)+f}else f=v;else T?(u=Math.min(u||b/2,m),r.availabilityDelay=u,f=u+b-m):f=b-y;return Math.round(f)}function s(r,t,b){if(!r||!r.details)return null;var v=r.details,m=v.fragments[t-v.startSN];return m||(m=v.fragmentHint,m&&m.sn===t?m:t<v.startSN&&b&&b.sn===t?b:null)}function n(r,t,b){if(!r||!r.details)return null;var v=r.details.partList;if(v)for(var m=v.length;m--;){var T=v[m];if(T.index===b&&T.fragment.sn===t)return T}return null}},"./src/controller/stream-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return v});var W=I("./src/polyfills/number.ts"),P=I("./src/controller/base-stream-controller.ts"),R=I("./src/is-supported.ts"),K=I("./src/events.ts"),N=I("./src/utils/buffer-helper.ts"),e=I("./src/controller/fragment-tracker.ts"),C=I("./src/types/loader.ts"),E=I("./src/loader/fragment.ts"),g=I("./src/demux/transmuxer-interface.ts"),h=I("./src/types/transmuxer.ts"),a=I("./src/controller/gap-controller.ts"),i=I("./src/errors.ts"),l=I("./src/utils/logger.ts");function s(m,T){for(var y=0;y<T.length;y++){var f=T[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function n(m,T,y){return T&&s(m.prototype,T),y&&s(m,y),m}function r(m,T){m.prototype=Object.create(T.prototype),m.prototype.constructor=m,t(m,T)}function t(m,T){return t=Object.setPrototypeOf||function(f,u){return f.__proto__=u,f},t(m,T)}var b=100,v=function(m){r(T,m);function T(f,u){var o;return o=m.call(this,f,u,"[stream-controller]")||this,o.audioCodecSwap=!1,o.gapController=null,o.level=-1,o._forceStartLoad=!1,o.altAudio=!1,o.audioOnly=!1,o.fragPlaying=null,o.onvplaying=null,o.onvseeked=null,o.fragLastKbps=0,o.stalled=!1,o.couldBacktrack=!1,o.audioCodecSwitch=!1,o.videoBuffer=null,o._registerListeners(),o}var y=T.prototype;return y._registerListeners=function(){var u=this.hls;u.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),u.on(K.Events.ERROR,this.onError,this),u.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),u.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),u.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y._unregisterListeners=function(){var u=this.hls;u.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),u.off(K.Events.ERROR,this.onError,this),u.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),u.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),u.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},y.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},y.startLoad=function(u){if(this.levels){var o=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(b),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=c.startLevel;_===-1&&(c.config.testBandwidth?(_=0,this.bitrateTest=!0):_=c.nextAutoLevel),this.level=c.nextLoadLevel=_,this.loadedmetadata=!1}o>0&&u===-1&&(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),u=o),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},y.stopLoad=function(){this._forceStartLoad=!1,m.prototype.stopLoad.call(this)},y.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var u,o=this.levels,c=this.level,_=o==null||((u=o[c])===null||u===void 0)?void 0:u.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var p,d=self.performance.now(),A=this.retryDate;(!A||d>=A||(p=this.media)!==null&&p!==void 0&&p.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},y.onTickEnd=function(){m.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},y.doTickIdle=function(){var u,o,c=this.hls,_=this.levelLastLoaded,p=this.levels,d=this.media,A=c.config,D=c.nextLoadLevel;if(_===null||!d&&(this.startFragRequested||!A.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!p||!p[D])return;var S=p[D];this.level=c.nextLoadLevel=D;var L=S.details;if(!L||this.state===P.State.WAITING_LEVEL||L.live&&this.levelLastLoaded!==D){this.state=P.State.WAITING_LEVEL;return}var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:d,C.PlaylistLevelType.MAIN);if(M===null)return;var O=M.len,j=this.getMaxBufferLength(S.maxBitrate);if(O>=j)return;if(this._streamEnded(M,L)){var G={};this.altAudio&&(G.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,G),this.state=P.State.ENDED;return}var X=M.end,ee=this.getNextFragment(X,L);if(this.couldBacktrack&&!this.fragPrevious&&ee&&ee.sn!=="initSegment"){var he=ee.sn-L.startSN;he>1&&(ee=L.fragments[he-1],this.fragmentTracker.removeFragment(ee))}if(ee&&this.fragmentTracker.getState(ee)===e.FragmentState.OK&&this.nextLoadPosition>X){var ge=this.audioOnly&&!this.altAudio?E.ElementaryStreamTypes.AUDIO:E.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(d,ge,C.PlaylistLevelType.MAIN),ee=this.getNextFragment(this.nextLoadPosition,L)}if(!ee)return;ee.initSegment&&!ee.initSegment.data&&!this.bitrateTest&&(ee=ee.initSegment),((u=ee.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((o=ee.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(ee,L):this.loadFragment(ee,L,X)},y.loadFragment=function(u,o,c){var _,p=this.fragmentTracker.getState(u);if(this.fragCurrent=u,p===e.FragmentState.BACKTRACKED){var d=this.fragmentTracker.getBacktrackData(u);if(d){this._handleFragmentLoadProgress(d),this._handleFragmentLoadComplete(d);return}else p=e.FragmentState.NOT_LOADED}p===e.FragmentState.NOT_LOADED||p===e.FragmentState.PARTIAL?u.sn==="initSegment"?this._loadInitSegment(u):this.bitrateTest?(u.bitrateTest=!0,this.log("Fragment "+u.sn+" of level "+u.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(u)):(this.startFragRequested=!0,m.prototype.loadFragment.call(this,u,o,c)):p===e.FragmentState.APPENDING?this.reduceMaxBufferLength(u.duration)&&this.fragmentTracker.removeFragment(u):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},y.getAppendedFrag=function(u){var o=this.fragmentTracker.getAppendedFrag(u,C.PlaylistLevelType.MAIN);return o&&"fragment"in o?o.fragment:o},y.getBufferedFrag=function(u){return this.fragmentTracker.getBufferedFrag(u,C.PlaylistLevelType.MAIN)},y.followingBufferedFrag=function(u){return u?this.getBufferedFrag(u.end+.5):null},y.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},y.nextLevelSwitch=function(){var u=this.levels,o=this.media;if(o!=null&&o.readyState){var c,_=this.getAppendedFrag(o.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!o.paused&&u){var p=this.hls.nextLoadLevel,d=u[p],A=this.fragLastKbps;A&&this.fragCurrent?c=this.fragCurrent.duration*d.maxBitrate/(1e3*A)+1:c=0}else c=0;var D=this.getBufferedFrag(o.currentTime+c);if(D){var S=this.followingBufferedFrag(D);if(S){this.abortCurrentFrag();var L=S.maxStartPTS?S.maxStartPTS:S.start,M=S.duration,O=Math.max(D.end,L+Math.min(Math.max(M-this.config.maxFragLookUpTolerance,M*.5),M*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},y.abortCurrentFrag=function(){var u=this.fragCurrent;this.fragCurrent=null,u!=null&&u.loader&&u.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},y.flushMainBuffer=function(u,o){m.prototype.flushMainBuffer.call(this,u,o,this.altAudio?"video":null)},y.onMediaAttached=function(u,o){m.prototype.onMediaAttached.call(this,u,o);var c=o.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,c,this.fragmentTracker,this.hls)},y.onMediaDetaching=function(){var u=this.media;u&&(u.removeEventListener("playing",this.onvplaying),u.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)},y.onMediaPlaying=function(){this.tick()},y.onMediaSeeked=function(){var u=this.media,o=u?u.currentTime:null;Object(W.isFiniteNumber)(o)&&this.log("Media seeked to "+o.toFixed(3)),this.tick()},y.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},y.onManifestParsed=function(u,o){var c=!1,_=!1,p;o.levels.forEach(function(d){p=d.audioCodec,p&&(p.indexOf("mp4a.40.2")!==-1&&(c=!0),p.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=c&&_&&!Object(R.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=o.levels,this.startFragRequested=!1},y.onLevelLoading=function(u,o){var c=this.levels;if(!c||this.state!==P.State.IDLE)return;var _=c[o.level];(!_.details||_.details.live&&this.levelLastLoaded!==o.level||this.waitForCdnTuneIn(_.details))&&(this.state=P.State.WAITING_LEVEL)},y.onLevelLoaded=function(u,o){var c,_=this.levels,p=o.level,d=o.details,A=d.totalduration;if(!_){this.warn("Levels were reset while loading level "+p);return}this.log("Level "+p+" loaded ["+d.startSN+","+d.endSN+"], cc ["+d.startCC+", "+d.endCC+"] duration:"+A);var D=this.fragCurrent;D&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(D.level!==o.level&&D.loader&&(this.state=P.State.IDLE,D.loader.abort()));var S=_[p],L=0;if(d.live||(c=S.details)!==null&&c!==void 0&&c.live){if(d.fragments[0]||(d.deltaUpdateFailed=!0),d.deltaUpdateFailed)return;L=this.alignPlaylists(d,S.details)}if(S.details=d,this.levelLastLoaded=p,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:d,level:p}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(d))return;this.state=P.State.IDLE}this.startFragRequested?d.live&&this.synchronizeToLiveEdge(d):this.setStartPosition(d,L),this.tick()},y._handleFragmentLoadProgress=function(u){var o,c=u.frag,_=u.part,p=u.payload,d=this.levels;if(!d){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var A=d[c.level],D=A.details;if(!D){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var S=A.videoCodec,L=D.PTSKnown||!D.live,M=(o=c.initSegment)===null||o===void 0?void 0:o.data,O=this._getAudioCodec(A),j=this.transmuxer=this.transmuxer||new g.default(this.hls,C.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),G=_?_.index:-1,X=G!==-1,ee=new h.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,p.byteLength,G,X),he=this.initPTS[c.cc];j.push(p,M,O,S,c,_,D.totalduration,L,ee,he)},y.onAudioTrackSwitching=function(u,o){var c=this.altAudio,_=!!o.url,p=o.id;if(!_){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var d=this.fragCurrent;d!=null&&d.loader&&(this.log("Switching to main audio track, cancel main fragment load"),d.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var A=this.hls;c&&A.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),A.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:p})}},y.onAudioTrackSwitched=function(u,o){var c=o.id,_=!!this.hls.audioTracks[c].url;if(_){var p=this.videoBuffer;p&&this.mediaBuffer!==p&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=p)}this.altAudio=_,this.tick()},y.onBufferCreated=function(u,o){var c=o.tracks,_,p,d=!1;for(var A in c){var D=c[A];if(D.id==="main"){if(p=A,_=D,A==="video"){var S=c[A];S&&(this.videoBuffer=S.buffer)}}else d=!0}d&&_?(this.log("Alternate track found, use "+p+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},y.onFragBuffered=function(u,o){var c=o.frag,_=o.part;if(c&&c.type!==C.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(_?" p: "+_.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var p=_?_.stats:c.stats;this.fragLastKbps=Math.round(8*p.total/(p.buffering.end-p.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,_)},y.onError=function(u,o){switch(o.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(C.PlaylistLevelType.MAIN,o);break;case i.ErrorDetails.LEVEL_LOAD_ERROR:case i.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(o.fatal?(this.warn(""+o.details),this.state=P.State.ERROR):!o.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var c=!0,_=this.getFwdBufferInfo(this.media,C.PlaylistLevelType.MAIN);_&&_.len>.5&&(c=!this.reduceMaxBufferLength(_.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},y.checkBuffer=function(){var u=this.media,o=this.gapController;if(!u||!o||!u.readyState)return;var c=N.BufferHelper.getBuffered(u);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):o.poll(this.lastCurrentTime),this.lastCurrentTime=u.currentTime},y.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},y.onBufferFlushed=function(u,o){var c=o.type;if(c!==E.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(c===E.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,c,C.PlaylistLevelType.MAIN)}},y.onLevelsUpdated=function(u,o){this.levels=o.levels},y.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},y.seekToStartPos=function(){var u=this.media,o=u.currentTime,c=this.startPosition;if(c>=0&&o<c){if(u.seeking){l.logger.log("could not seek to "+c+", already seeking at "+o);return}var _=N.BufferHelper.getBuffered(u),p=_.length?_.start(0):0,d=p-c;d>0&&(d<this.config.maxBufferHole||d<this.config.maxFragLookUpTolerance)&&(l.logger.log("adjusting start position by "+d+" to match buffer start"),c+=d,this.startPosition=c),this.log("seek to target start position "+c+" from current time "+o),u.currentTime=c}},y._getAudioCodec=function(u){var o=this.config.defaultAudioCodec||u.audioCodec;return this.audioCodecSwap&&o&&(this.log("Swapping audio codec"),o.indexOf("mp4a.40.5")!==-1?o="mp4a.40.2":o="mp4a.40.5"),o},y._loadBitrateTestFrag=function(u){var o=this;this._doFragLoad(u).then(function(c){var _=o.hls;if(!c||_.nextLoadLevel||o.fragContextChanged(u))return;o.fragLoadError=0,o.state=P.State.IDLE,o.startFragRequested=!1,o.bitrateTest=!1;var p=u.stats;p.parsing.start=p.parsing.end=p.buffering.start=p.buffering.end=self.performance.now(),_.trigger(K.Events.FRAG_LOADED,c)})},y._handleTransmuxComplete=function(u){var o,c="main",_=this.hls,p=u.remuxResult,d=u.chunkMeta,A=this.getCurrentContext(d);if(!A){this.warn("The loading context changed while buffering fragment "+d.sn+" of level "+d.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(d.level);return}var D=A.frag,S=A.part,L=A.level,M=p.video,O=p.text,j=p.id3,G=p.initSegment,X=this.altAudio?void 0:p.audio;if(this.fragContextChanged(D))return;if(this.state=P.State.PARSING,G){G.tracks&&(this._bufferInitSegment(L,G.tracks,D,d),_.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:c,tracks:G.tracks}));var ee=G.initPTS,he=G.timescale;Object(W.isFiniteNumber)(ee)&&(this.initPTS[D.cc]=ee,_.trigger(K.Events.INIT_PTS_FOUND,{frag:D,id:c,initPTS:ee,timescale:he}))}if(M&&p.independent!==!1){if(L.details){var ge=M.startPTS,de=M.endPTS,Te=M.startDTS,xe=M.endDTS;if(S)S.elementaryStreams[M.type]={startPTS:ge,endPTS:de,startDTS:Te,endDTS:xe};else if(M.firstKeyFrame&&M.independent&&(this.couldBacktrack=!0),M.dropped&&M.independent){var ce=this.getLoadPosition()+this.config.maxBufferHole;if(ce<ge){this.backtrack(D);return}D.setElementaryStreamInfo(M.type,D.start,de,D.start,xe,!0)}D.setElementaryStreamInfo(M.type,ge,de,Te,xe),this.bufferFragmentData(M,D,S,d)}}else if(p.independent===!1){this.backtrack(D);return}if(X){var ae=X.startPTS,Le=X.endPTS,Ye=X.startDTS,Fe=X.endDTS;S&&(S.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:Le,startDTS:Ye,endDTS:Fe}),D.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,ae,Le,Ye,Fe),this.bufferFragmentData(X,D,S,d)}if(j!=null&&(o=j.samples)!==null&&o!==void 0&&o.length){var We={frag:D,id:c,samples:j.samples};_.trigger(K.Events.FRAG_PARSING_METADATA,We)}if(O){var be={frag:D,id:c,samples:O.samples};_.trigger(K.Events.FRAG_PARSING_USERDATA,be)}},y._bufferInitSegment=function(u,o,c,_){var p=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!o.audio&&!o.video,this.altAudio&&!this.audioOnly&&delete o.audio;var d=o.audio,A=o.video,D=o.audiovideo;if(d){var S=u.audioCodec,L=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(S&&(S.indexOf("mp4a.40.5")!==-1?S="mp4a.40.2":S="mp4a.40.5"),d.metadata.channelCount!==1&&L.indexOf("firefox")===-1&&(S="mp4a.40.5")),L.indexOf("android")!==-1&&d.container!=="audio/mpeg"&&(S="mp4a.40.2",this.log("Android: force audio codec to "+S)),u.audioCodec&&u.audioCodec!==S&&this.log('Swapping manifest audio codec "'+u.audioCodec+'" for "'+S+'"'),d.levelCodec=S,d.id="main",this.log("Init audio buffer, container:"+d.container+", codecs[selected/level/parsed]=["+(S||"")+"/"+(u.audioCodec||"")+"/"+d.codec+"]")}A&&(A.levelCodec=u.videoCodec,A.id="main",this.log("Init video buffer, container:"+A.container+", codecs[level/parsed]=["+(u.videoCodec||"")+"/"+A.codec+"]")),D&&this.log("Init audiovideo buffer, container:"+D.container+", codecs[level/parsed]=["+(u.attrs.CODECS||"")+"/"+D.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,o),Object.keys(o).forEach(function(M){var O=o[M],j=O.initSegment;j!=null&&j.byteLength&&p.hls.trigger(K.Events.BUFFER_APPENDING,{type:M,data:j,frag:c,part:null,chunkMeta:_,parent:c.type})}),this.tick()},y.backtrack=function(u){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(u);var o=this.fragmentTracker.backtrack(u);this.fragPrevious=null,this.nextLoadPosition=u.start,o?this.resetFragmentLoading(u):this.state=P.State.BACKTRACKING},y.checkFragmentChanged=function(){var u=this.media,o=null;if(u&&u.readyState>1&&u.seeking===!1){var c=u.currentTime;if(N.BufferHelper.isBuffered(u,c)?o=this.getAppendedFrag(c):N.BufferHelper.isBuffered(u,c+.1)&&(o=this.getAppendedFrag(c+.1)),o){var _=this.fragPlaying,p=o.level;(!_||o.sn!==_.sn||_.level!==p||o.urlId!==_.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:o}),(!_||_.level!==p)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:p}),this.fragPlaying=o)}}},n(T,[{key:"nextLevel",get:function(){var u=this.nextBufferedFrag;return u?u.level:-1}},{key:"currentLevel",get:function(){var u=this.media;if(u){var o=this.getAppendedFrag(u.currentTime);if(o)return o.level}return-1}},{key:"nextBufferedFrag",get:function(){var u=this.media;if(u){var o=this.getAppendedFrag(u.currentTime);return this.followingBufferedFrag(o)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),T}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"SubtitleStreamController",function(){return r});var W=I("./src/events.ts"),P=I("./src/utils/logger.ts"),R=I("./src/utils/buffer-helper.ts"),K=I("./src/controller/fragment-finders.ts"),N=I("./src/utils/discontinuities.ts"),e=I("./src/controller/level-helper.ts"),C=I("./src/controller/fragment-tracker.ts"),E=I("./src/controller/base-stream-controller.ts"),g=I("./src/types/loader.ts"),h=I("./src/types/level.ts");function a(t,b){for(var v=0;v<b.length;v++){var m=b[v];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(t,m.key,m)}}function i(t,b,v){return b&&a(t.prototype,b),v&&a(t,v),t}function l(t,b){t.prototype=Object.create(b.prototype),t.prototype.constructor=t,s(t,b)}function s(t,b){return s=Object.setPrototypeOf||function(m,T){return m.__proto__=T,m},s(t,b)}var n=500,r=function(t){l(b,t);function b(m,T){var y;return y=t.call(this,m,T,"[subtitle-stream-controller]")||this,y.levels=[],y.currentTrackId=-1,y.tracksBuffered=[],y.mainDetails=null,y._registerListeners(),y}var v=b.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var T=this.hls;T.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(W.Events.ERROR,this.onError,this),T.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),T.on(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),T.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),T.on(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),T.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v._unregisterListeners=function(){var T=this.hls;T.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),T.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),T.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),T.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(W.Events.ERROR,this.onError,this),T.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),T.off(W.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),T.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),T.off(W.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),T.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},v.startLoad=function(){this.stopLoad(),this.state=E.State.IDLE,this.setInterval(n),this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},v.onLevelLoaded=function(T,y){this.mainDetails=y.details},v.onSubtitleFragProcessed=function(T,y){var f=y.frag,u=y.success;if(this.fragPrevious=f,this.state=E.State.IDLE,!u)return;var o=this.tracksBuffered[this.currentTrackId];if(!o)return;for(var c,_=f.start,p=0;p<o.length;p++)if(_>=o[p].start&&_<=o[p].end){c=o[p];break}var d=f.start+f.duration;c?c.end=d:(c={start:_,end:d},o.push(c)),this.fragmentTracker.fragBuffered(f)},v.onBufferFlushing=function(T,y){var f=y.startOffset,u=y.endOffset;if(f===0&&u!==Number.POSITIVE_INFINITY){var o=this.currentTrackId,c=this.levels;if(!c.length||!c[o]||!c[o].details)return;var _=c[o].details,p=_.targetduration,d=u-p;if(d<=0)return;y.endOffsetSubtitles=Math.max(0,d),this.tracksBuffered.forEach(function(A){for(var D=0;D<A.length;){if(A[D].end<=d){A.shift();continue}else if(A[D].start<d)A[D].start=d;else break;D++}}),this.fragmentTracker.removeFragmentsInRange(f,d,g.PlaylistLevelType.SUBTITLE)}},v.onError=function(T,y){var f,u=y.frag;if(!u||u.type!==g.PlaylistLevelType.SUBTITLE)return;(f=this.fragCurrent)!==null&&f!==void 0&&f.loader&&this.fragCurrent.loader.abort(),this.state=E.State.IDLE},v.onSubtitleTracksUpdated=function(T,y){var f=this,u=y.subtitleTracks;this.tracksBuffered=[],this.levels=u.map(function(o){return new h.Level(o)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(o){f.tracksBuffered[o.id]=[]}),this.mediaBuffer=null},v.onSubtitleTrackSwitch=function(T,y){if(this.currentTrackId=y.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var f=this.levels[this.currentTrackId];f!=null&&f.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,f&&this.setInterval(n)},v.onSubtitleTrackLoaded=function(T,y){var f,u=y.details,o=y.id,c=this.currentTrackId,_=this.levels;if(!_.length)return;var p=_[c];if(o>=_.length||o!==c||!p)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,u.live||(f=p.details)!==null&&f!==void 0&&f.live){var d=this.mainDetails;if(u.deltaUpdateFailed||!d)return;var A=d.fragments[0];if(!p.details)u.hasProgramDateTime&&d.hasProgramDateTime?Object(N.alignMediaPlaylistByPDT)(u,d):A&&Object(e.addSliding)(u,A.start);else{var D=this.alignPlaylists(u,p.details);D===0&&A&&Object(e.addSliding)(u,A.start)}}if(p.details=u,this.levelLastLoaded=o,this.tick(),u.live&&!this.fragCurrent&&this.media&&this.state===E.State.IDLE){var S=Object(K.findFragmentByPTS)(null,u.fragments,this.media.currentTime,0);S||(this.warn("Subtitle playlist not aligned with playback"),p.details=void 0)}},v._handleFragmentLoadComplete=function(T){var y=T.frag,f=T.payload,u=y.decryptdata,o=this.hls;if(this.fragContextChanged(y))return;if(f&&f.byteLength>0&&u&&u.key&&u.iv&&u.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(f),u.key.buffer,u.iv.buffer).then(function(_){var p=performance.now();o.trigger(W.Events.FRAG_DECRYPTED,{frag:y,payload:_,stats:{tstart:c,tdecrypt:p}})})}},v.doTick=function(){if(!this.media){this.state=E.State.IDLE;return}if(this.state===E.State.IDLE){var T,y=this.currentTrackId,f=this.levels;if(!f.length||!f[y]||!f[y].details)return;var u=f[y].details,o=u.targetduration,c=this.config,_=this.media,p=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-o,c.maxBufferHole),d=p.end,A=p.len,D=this.getMaxBufferLength()+o;if(A>D)return;console.assert(u,"Subtitle track details are defined on idle subtitle stream controller tick");var S=u.fragments,L=S.length,M=u.edge,O,j=this.fragPrevious;if(d<M){var G=c.maxFragLookUpTolerance;j&&u.hasProgramDateTime&&(O=Object(K.findFragmentByPDT)(S,j.endProgramDateTime,G)),O||(O=Object(K.findFragmentByPTS)(j,S,d,G),!O&&j&&j.start<S[0].start&&(O=S[0]))}else O=S[L-1];(T=O)!==null&&T!==void 0&&T.encrypted?(P.logger.log("Loading key for "+O.sn),this.state=E.State.KEY_LOADING,this.hls.trigger(W.Events.KEY_LOADING,{frag:O})):O&&this.fragmentTracker.getState(O)===C.FragmentState.NOT_LOADED&&this.loadFragment(O,u,d)}},v.loadFragment=function(T,y,f){this.fragCurrent=T,t.prototype.loadFragment.call(this,T,y,f)},i(b,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),b}(E.default)},"./src/controller/subtitle-track-controller.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/events.ts"),P=I("./src/utils/texttrack-utils.ts"),R=I("./src/controller/base-playlist-controller.ts"),K=I("./src/types/loader.ts");function N(a,i){for(var l=0;l<i.length;l++){var s=i[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,i,l){return i&&N(a.prototype,i),l&&N(a,l),a}function C(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,E(a,i)}function E(a,i){return E=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},E(a,i)}var g=function(a){C(i,a);function i(s){var n;return n=a.call(this,s,"[subtitle-track-controller]")||this,n.media=null,n.tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.selectDefaultTrack=!0,n.queuedDefaultTrack=-1,n.trackChangeListener=function(){return n.onTextTracksChanged()},n.asyncPollTrackChange=function(){return n.pollTrackChange(0)},n.useTextTrackPolling=!1,n.subtitlePollingInterval=-1,n.subtitleDisplay=!0,n.registerListeners(),n}var l=i.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},l.registerListeners=function(){var n=this.hls;n.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.on(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.on(W.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var n=this.hls;n.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),n.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),n.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(W.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),n.off(W.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),n.off(W.Events.ERROR,this.onError,this)},l.onMediaAttached=function(n,r){if(this.media=r.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)},l.pollTrackChange=function(n){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,n)},l.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 n=h(this.media.textTracks);n.forEach(function(r){Object(P.clearCurrentCues)(r)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(n,r){this.tracks=r.subtitleTracks},l.onSubtitleTrackLoaded=function(n,r){var t=r.id,b=r.details,v=this.trackId,m=this.tracksInGroup[v];if(!m){this.warn("Invalid subtitle track id "+t);return}var T=m.details;m.details=r.details,this.log("subtitle track "+t+" loaded ["+b.startSN+"-"+b.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,r,T))},l.onLevelLoading=function(n,r){this.switchLevel(r.level)},l.onLevelSwitching=function(n,r){this.switchLevel(r.level)},l.switchLevel=function(n){var r=this.hls.levels[n];if(!(r!=null&&r.textGroupIds))return;var t=r.textGroupIds[r.urlId];if(this.groupId!==t){var b=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(y){return!t||y.groupId===t});this.tracksInGroup=v;var m=this.findTrackId(b==null?void 0:b.name)||this.findTrackId();this.groupId=t;var T={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(W.Events.SUBTITLE_TRACKS_UPDATED,T),m!==-1&&this.setSubtitleTrack(m,b)}},l.findTrackId=function(n){for(var r=this.tracksInGroup,t=0;t<r.length;t++){var b=r[t];if((!this.selectDefaultTrack||b.default)&&(!n||n===b.name))return b.id}return-1},l.onError=function(n,r){if(a.prototype.onError.call(this,n,r),r.fatal||!r.context)return;r.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},l.loadPlaylist=function(n){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var t=r.id,b=r.groupId,v=r.url;if(n)try{v=n.addDirectives(v)}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(W.Events.SUBTITLE_TRACK_LOADING,{url:v,id:t,groupId:b,deliveryDirectives:n||null})}},l.toggleTrackModes=function(n){var r=this,t=this.media,b=this.subtitleDisplay,v=this.trackId;if(!t)return;var m=h(t.textTracks),T=m.filter(function(u){return u.groupId===r.groupId});if(n===-1)[].slice.call(m).forEach(function(u){u.mode="disabled"});else{var y=T[v];y&&(y.mode="disabled")}var f=T[n];f&&(f.mode=b?"showing":"hidden")},l.setSubtitleTrack=function(n,r){var t,b=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=n;return}if(this.trackId!==n&&this.toggleTrackModes(n),this.trackId===n&&(n===-1||(t=b[n])!==null&&t!==void 0&&t.details)||n<-1||n>=b.length)return;this.clearTimer();var v=b[n];if(this.log("Switching to subtitle track "+n),this.trackId=n,v){var m=v.id,T=v.groupId,y=T===void 0?"":T,f=v.name,u=v.type,o=v.url;this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:m,groupId:y,name:f,type:u,url:o});var c=this.switchParams(v.url,r==null?void 0:r.details);this.loadPlaylist(c)}else this.hls.trigger(W.Events.SUBTITLE_TRACK_SWITCH,{id:n})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var n=-1,r=h(this.media.textTracks),t=0;t<r.length;t++)if(r[t].mode==="hidden")n=t;else if(r[t].mode==="showing"){n=t;break}this.subtitleTrack!==n&&(this.subtitleTrack=n)},e(i,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(n){this.selectDefaultTrack=!1;var r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(n,r)}}]),i}(R.default);function h(a){for(var i=[],l=0;l<a.length;l++){var s=a[l];s.kind==="subtitles"&&s.label&&i.push(a[l])}return i}H.default=g},"./src/controller/timeline-controller.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"TimelineController",function(){return h});var W=I("./src/polyfills/number.ts"),P=I("./src/events.ts"),R=I("./src/utils/cea-608-parser.ts"),K=I("./src/utils/output-filter.ts"),N=I("./src/utils/webvtt-parser.ts"),e=I("./src/utils/texttrack-utils.ts"),C=I("./src/utils/imsc1-ttml-parser.ts"),E=I("./src/types/loader.ts"),g=I("./src/utils/logger.ts"),h=function(){function s(r){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=l(),this.captionsProperties=void 0,this.hls=r,this.config=r.config,this.Cues=r.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 K.default(this,"textTrack1"),b=new K.default(this,"textTrack2"),v=new K.default(this,"textTrack3"),m=new K.default(this,"textTrack4");this.cea608Parser1=new R.default(1,t,b),this.cea608Parser2=new R.default(3,v,m)}r.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(P.Events.FRAG_LOADING,this.onFragLoading,this),r.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var n=s.prototype;return n.destroy=function(){var t=this.hls;t.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(P.Events.FRAG_LOADING,this.onFragLoading,this),t.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},n.addCues=function(t,b,v,m,T){for(var y=!1,f=T.length;f--;){var u=T[f],o=i(u[0],u[1],b,v);if(o>=0&&(u[0]=Math.min(u[0],b),u[1]=Math.max(u[1],v),y=!0,o/(v-b)>.5))return}if(y||T.push([b,v]),this.config.renderTextTracksNatively){var c=this.captionsTracks[t];this.Cues.newCue(c,b,v,m)}else{var _=this.Cues.newCue(null,b,v,m);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:_,track:t})}},n.onInitPtsFound=function(t,b){var v=this,m=b.frag,T=b.id,y=b.initPTS,f=b.timescale,u=this.unparsedVttFrags;T==="main"&&(this.initPTS[m.cc]=y,this.timescale[m.cc]=f),u.length&&(this.unparsedVttFrags=[],u.forEach(function(o){v.onFragLoaded(P.Events.FRAG_LOADED,o)}))},n.getExistingTrack=function(t){var b=this.media;if(b)for(var v=0;v<b.textTracks.length;v++){var m=b.textTracks[v];if(m[t])return m}return null},n.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},n.createNativeTrack=function(t){if(this.captionsTracks[t])return;var b=this.captionsProperties,v=this.captionsTracks,m=this.media,T=b[t],y=T.label,f=T.languageCode,u=this.getExistingTrack(t);if(u)v[t]=u,Object(e.clearCurrentCues)(v[t]),Object(e.sendAddTrackEvent)(v[t],m);else{var o=this.createTextTrack("captions",y,f);o&&(o[t]=!0,v[t]=o)}},n.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var b=this.captionsProperties[t];if(!b)return;var v=b.label,m={_id:t,label:v,kind:"captions",default:b.media?!!b.media.default:!1,closedCaptions:b.media};this.nonNativeCaptionsTracks[t]=m,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[m]})},n.createTextTrack=function(t,b,v){var m=this.media;return m?m.addTextTrack(t,b,v):void 0},n.onMediaAttaching=function(t,b){this.media=b.media,this._cleanTracks()},n.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(b){Object(e.clearCurrentCues)(t[b]),delete t[b]}),this.nonNativeCaptionsTracks={}},n.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),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())},n._cleanTracks=function(){var t=this.media;if(!t)return;var b=t.textTracks;if(b)for(var v=0;v<b.length;v++)Object(e.clearCurrentCues)(b[v])},n.onSubtitleTracksUpdated=function(t,b){var v=this;this.textTracks=[];var m=b.subtitleTracks||[],T=m.some(function(o){return o.textCodec===C.IMSC1_CODEC});if(this.config.enableWebVTT||T&&this.config.enableIMSC1){var y=this.tracks&&m&&this.tracks.length===m.length;if(this.tracks=m||[],this.config.renderTextTracksNatively){var f=this.media?this.media.textTracks:[];this.tracks.forEach(function(o,c){var _;if(c<f.length){for(var p=null,d=0;d<f.length;d++)if(a(f[d],o)){p=f[d];break}p&&(_=p)}_?Object(e.clearCurrentCues)(_):(_=v.createTextTrack("subtitles",o.name,o.lang),_&&(_.mode="disabled")),_&&(_.groupId=o.groupId,v.textTracks.push(_))})}else if(!y&&this.tracks&&this.tracks.length){var u=this.tracks.map(function(o){return{label:o.name,kind:o.type.toLowerCase(),default:o.default,subtitleTrack:o}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:u})}}},n.onManifestLoaded=function(t,b){var v=this;this.config.enableCEA708Captions&&b.captions&&b.captions.forEach(function(m){var T=/(?:CC|SERVICE)([1-4])/.exec(m.instreamId);if(!T)return;var y="textTrack"+T[1],f=v.captionsProperties[y];if(!f)return;f.label=m.name,m.lang&&(f.languageCode=m.lang),f.media=m})},n.onFragLoading=function(t,b){var v=this.cea608Parser1,m=this.cea608Parser2,T=this.lastSn,y=this.lastPartIndex;if(!this.enabled||!(v&&m))return;if(b.frag.type===E.PlaylistLevelType.MAIN){var f,u,o=b.frag.sn,c=(f=b==null||((u=b.part)===null||u===void 0)?void 0:u.index)!=null?f:-1;o===T+1||o===T&&c===y+1||(v.reset(),m.reset()),this.lastSn=o,this.lastPartIndex=c}},n.onFragLoaded=function(t,b){var v=b.frag,m=b.payload,T=this.initPTS,y=this.unparsedVttFrags;if(v.type===E.PlaylistLevelType.SUBTITLE)if(m.byteLength){if(!Object(W.isFiniteNumber)(T[v.cc])){y.push(b),T.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Missing initial subtitle PTS")});return}var f=v.decryptdata;if(f==null||f.key==null||f.method!=="AES-128"){var u=this.tracks[v.level],o=this.vttCCs;o[v.cc]||(o[v.cc]={start:v.start,prevCC:this.prevCC,new:!0},this.prevCC=v.cc),u&&u.textCodec===C.IMSC1_CODEC?this._parseIMSC1(v,m):this._parseVTTs(v,m,o)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:v,error:new Error("Empty subtitle payload")})},n._parseIMSC1=function(t,b){var v=this,m=this.hls;Object(C.parseIMSC1)(b,this.initPTS[t.cc],this.timescale[t.cc],function(T){v._appendCues(T,t.level),m.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(T){g.logger.log("Failed to parse IMSC1: "+T),m.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:T})})},n._parseVTTs=function(t,b,v){var m=this,T=this.hls;Object(N.parseWebVTT)(b,this.initPTS[t.cc],this.timescale[t.cc],v,t.cc,t.start,function(y){m._appendCues(y,t.level),T.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(y){m._fallbackToIMSC1(t,b),g.logger.log("Failed to parse VTT cue: "+y),T.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:y})})},n._fallbackToIMSC1=function(t,b){var v=this,m=this.tracks[t.level];m.textCodec||Object(C.parseIMSC1)(b,this.initPTS[t.cc],this.timescale[t.cc],function(){m.textCodec=C.IMSC1_CODEC,v._parseIMSC1(t,b)},function(){m.textCodec="wvtt"})},n._appendCues=function(t,b){var v=this.hls;if(this.config.renderTextTracksNatively){var m=this.textTracks[b];if(m.mode==="disabled")return;t.forEach(function(f){return Object(e.addCueToTrack)(m,f)})}else{var T=this.tracks[b],y=T.default?"default":"subtitles"+b;v.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:t,track:y})}},n.onFragDecrypted=function(t,b){var v=b.frag;if(v.type===E.PlaylistLevelType.SUBTITLE){if(!Object(W.isFiniteNumber)(this.initPTS[v.cc])){this.unparsedVttFrags.push(b);return}this.onFragLoaded(P.Events.FRAG_LOADED,b)}},n.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},n.onFragParsingUserdata=function(t,b){var v=this.cea608Parser1,m=this.cea608Parser2;if(!this.enabled||!(v&&m))return;for(var T=0;T<b.samples.length;T++){var y=b.samples[T].bytes;if(y){var f=this.extractCea608Data(y);v.addData(b.samples[T].pts,f[0]),m.addData(b.samples[T].pts,f[1])}}},n.onBufferFlushing=function(t,b){var v=b.startOffset,m=b.endOffset,T=b.endOffsetSubtitles,y=b.type,f=this.media;if(!f||f.currentTime<m)return;if(!y||y==="video"){var u=this.captionsTracks;Object.keys(u).forEach(function(c){return Object(e.removeCuesInRange)(u[c],v,m)})}if(this.config.renderTextTracksNatively&&(v===0&&T!==void 0)){var o=this.textTracks;Object.keys(o).forEach(function(c){return Object(e.removeCuesInRange)(o[c],v,T)})}},n.extractCea608Data=function(t){for(var b=t[0]&31,v=2,m=[[],[]],T=0;T<b;T++){var y=t[v++],f=127&t[v++],u=127&t[v++],o=(4&y)!==0,c=3&y;if(f===0&&u===0)continue;o&&((c===0||c===1)&&(m[c].push(f),m[c].push(u)))}return m},s}();function a(s,n){return s&&s.label===n.name&&!(s.textTrack1||s.textTrack2)}function i(s,n,r,t){return Math.min(n,t)-Math.max(s,r)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function P(K,N){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=N}var R=P.prototype;return R.decrypt=function(N,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,N)},P}()},"./src/crypt/aes-decryptor.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"removePadding",function(){return P}),I.d(H,"default",function(){return R});var W=I("./src/utils/typed-array.ts");function P(K){var N=K.byteLength,e=N&&new DataView(K.buffer).getUint8(N-1);return e?Object(W.sliceUint8)(K,0,N-e):K}var R=function(){function K(){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 N=K.prototype;return N.uint8ArrayToUint32Array_=function(C){for(var E=new DataView(C),g=new Uint32Array(4),h=0;h<4;h++)g[h]=E.getUint32(h*4);return g},N.initTable=function(){var C=this.sBox,E=this.invSBox,g=this.subMix,h=g[0],a=g[1],i=g[2],l=g[3],s=this.invSubMix,n=s[0],r=s[1],t=s[2],b=s[3],v=new Uint32Array(256),m=0,T=0,y=0;for(y=0;y<256;y++)y<128?v[y]=y<<1:v[y]=y<<1^283;for(y=0;y<256;y++){var f=T^T<<1^T<<2^T<<3^T<<4;f=f>>>8^f&255^99,C[m]=f,E[f]=m;var u=v[m],o=v[u],c=v[o],_=v[f]*257^f*16843008;h[m]=_<<24|_>>>8,a[m]=_<<16|_>>>16,i[m]=_<<8|_>>>24,l[m]=_,_=c*16843009^o*65537^u*257^m*16843008,n[f]=_<<24|_>>>8,r[f]=_<<16|_>>>16,t[f]=_<<8|_>>>24,b[f]=_,m?(m=u^v[v[v[c^u]]],T^=v[v[T]]):m=T=1}},N.expandKey=function(C){for(var E=this.uint8ArrayToUint32Array_(C),g=!0,h=0;h<E.length&&g;)g=E[h]===this.key[h],h++;if(g)return;this.key=E;var a=this.keySize=E.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var i=this.ksRows=(a+6+1)*4,l,s,n=this.keySchedule=new Uint32Array(i),r=this.invKeySchedule=new Uint32Array(i),t=this.sBox,b=this.rcon,v=this.invSubMix,m=v[0],T=v[1],y=v[2],f=v[3],u,o;for(l=0;l<i;l++){if(l<a){u=n[l]=E[l];continue}o=u,l%a===0?(o=o<<8|o>>>24,o=t[o>>>24]<<24|t[o>>>16&255]<<16|t[o>>>8&255]<<8|t[o&255],o^=b[l/a|0]<<24):a>6&&l%a===4&&(o=t[o>>>24]<<24|t[o>>>16&255]<<16|t[o>>>8&255]<<8|t[o&255]),n[l]=u=(n[l-a]^o)>>>0}for(s=0;s<i;s++)l=i-s,s&3?o=n[l]:o=n[l-4],s<4||l<=4?r[s]=o:r[s]=m[t[o>>>24]]^T[t[o>>>16&255]]^y[t[o>>>8&255]]^f[t[o&255]],r[s]=r[s]>>>0},N.networkToHostOrderSwap=function(C){return C<<24|(C&65280)<<8|(C&16711680)>>8|C>>>24},N.decrypt=function(C,E,g){for(var h=this.keySize+6,a=this.invKeySchedule,i=this.invSBox,l=this.invSubMix,s=l[0],n=l[1],r=l[2],t=l[3],b=this.uint8ArrayToUint32Array_(g),v=b[0],m=b[1],T=b[2],y=b[3],f=new Int32Array(C),u=new Int32Array(f.length),o,c,_,p,d,A,D,S,L,M,O,j,G,X,ee=this.networkToHostOrderSwap;E<f.length;){for(L=ee(f[E]),M=ee(f[E+1]),O=ee(f[E+2]),j=ee(f[E+3]),d=L^a[0],A=j^a[1],D=O^a[2],S=M^a[3],G=4,X=1;X<h;X++)o=s[d>>>24]^n[A>>16&255]^r[D>>8&255]^t[S&255]^a[G],c=s[A>>>24]^n[D>>16&255]^r[S>>8&255]^t[d&255]^a[G+1],_=s[D>>>24]^n[S>>16&255]^r[d>>8&255]^t[A&255]^a[G+2],p=s[S>>>24]^n[d>>16&255]^r[A>>8&255]^t[D&255]^a[G+3],d=o,A=c,D=_,S=p,G=G+4;o=i[d>>>24]<<24^i[A>>16&255]<<16^i[D>>8&255]<<8^i[S&255]^a[G],c=i[A>>>24]<<24^i[D>>16&255]<<16^i[S>>8&255]<<8^i[d&255]^a[G+1],_=i[D>>>24]<<24^i[S>>16&255]<<16^i[d>>8&255]<<8^i[A&255]^a[G+2],p=i[S>>>24]<<24^i[d>>16&255]<<16^i[A>>8&255]<<8^i[D&255]^a[G+3],u[E]=ee(o^v),u[E+1]=ee(p^m),u[E+2]=ee(_^T),u[E+3]=ee(c^y),v=L,m=M,T=O,y=j,E=E+4}return u.buffer},K}()},"./src/crypt/decrypter.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return E});var W=I("./src/crypt/aes-crypto.ts"),P=I("./src/crypt/fast-aes-key.ts"),R=I("./src/crypt/aes-decryptor.ts"),K=I("./src/utils/logger.ts"),N=I("./src/utils/mp4-tools.ts"),e=I("./src/utils/typed-array.ts"),C=16,E=function(){function g(a,i,l){var s=l===void 0?{}:l,n=s.removePKCS7Padding,r=n===void 0?!0:n;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=r,r)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(b){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var h=g.prototype;return h.destroy=function(){this.observer=null},h.isSync=function(){return this.config.enableSoftwareAES},h.flush=function(){var i=this.currentResult;if(!i){this.reset();return}var l=new Uint8Array(i);return this.reset(),this.removePKCS7Padding?Object(R.removePadding)(l):l},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(i,l,s,n){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(i),l,s);var r=this.flush();r&&n(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(i),l,s).then(n)},h.softwareDecrypt=function(i,l,s){var n=this.currentIV,r=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(i=Object(N.appendUint8Array)(t,i),this.remainderData=null);var b=this.getValidChunk(i);if(!b.length)return null;n&&(s=n);var v=this.softwareDecrypter;v||(v=this.softwareDecrypter=new R.default),v.expandKey(l);var m=r;return this.currentResult=v.decrypt(b.buffer,0,s),this.currentIV=Object(e.sliceUint8)(b,-16).buffer,m||null},h.webCryptoDecrypt=function(i,l,s){var n=this,r=this.subtle;return(this.key!==l||!this.fastAesKey)&&(this.key=l,this.fastAesKey=new P.default(r,l)),this.fastAesKey.expandKey().then(function(t){if(!r)return Promise.reject(new Error("web crypto not initialized"));var b=new W.default(r,s);return b.decrypt(i.buffer,t)}).catch(function(t){return n.onWebCryptoError(t,i,l,s)})},h.onWebCryptoError=function(i,l,s,n){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",i),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(l,s,n)},h.getValidChunk=function(i){var l=i,s=i.length-i.length%C;return s!==i.length&&(l=Object(e.sliceUint8)(i,0,s),this.remainderData=Object(e.sliceUint8)(i,s)),l},h.logOnce=function(i){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+i),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function P(K,N){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=N}var R=P.prototype;return R.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/demux/base-audio-demuxer.ts"),P=I("./src/demux/adts.ts"),R=I("./src/utils/logger.ts"),K=I("./src/demux/id3.ts");function N(E,g){E.prototype=Object.create(g.prototype),E.prototype.constructor=E,e(E,g)}function e(E,g){return e=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},e(E,g)}var C=function(E){N(g,E);function g(a,i){var l;return l=E.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=a,l.config=i,l}var h=g.prototype;return h.resetInitSegment=function(i,l,s){E.prototype.resetInitSegment.call(this,i,l,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}},g.probe=function(i){if(!i)return!1;for(var l=K.getID3Data(i,0)||[],s=l.length,n=i.length;s<n;s++)if(P.probe(i,s))return R.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(i,l){return P.canParse(i,l)},h.appendFrame=function(i,l,s){P.initTrackConfig(i,this.observer,l,s,i.manifestCodec);var n=P.appendFrame(i,l,s,this.initPTS,this.frameIndex);if(n&&n.missing===0)return n},g}(W.default);C.minProbeByteLength=9,H.default=C},"./src/demux/adts.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"getAudioConfig",function(){return K}),I.d(H,"isHeaderPattern",function(){return N}),I.d(H,"getHeaderLength",function(){return e}),I.d(H,"getFullFrameLength",function(){return C}),I.d(H,"canGetFrameLength",function(){return E}),I.d(H,"isHeader",function(){return g}),I.d(H,"canParse",function(){return h}),I.d(H,"probe",function(){return a}),I.d(H,"initTrackConfig",function(){return i}),I.d(H,"getFrameDuration",function(){return l}),I.d(H,"parseFrameHeader",function(){return s}),I.d(H,"appendFrame",function(){return n});var W=I("./src/utils/logger.ts"),P=I("./src/errors.ts"),R=I("./src/events.ts");function K(r,t,b,v){var m,T,y,f,u=navigator.userAgent.toLowerCase(),o=v,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];m=((t[b+2]&192)>>>6)+1;var _=(t[b+2]&60)>>>2;if(_>c.length-1){r.trigger(R.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return y=(t[b+2]&1)<<2,y|=(t[b+3]&192)>>>6,W.logger.log("manifest codec:"+v+", ADTS type:"+m+", samplingIndex:"+_),/firefox/i.test(u)?_>=6?(m=5,f=new Array(4),T=_-3):(m=2,f=new Array(2),T=_):u.indexOf("android")!==-1?(m=2,f=new Array(2),T=_):(m=5,f=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&_>=6?T=_-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(_>=6&&y===1||/vivaldi/i.test(u))||!v&&y===1)&&(m=2,f=new Array(2)),T=_)),f[0]=m<<3,f[0]|=(_&14)>>1,f[1]|=(_&1)<<7,f[1]|=y<<3,m===5&&(f[1]|=(T&14)>>1,f[2]=(T&1)<<7,f[2]|=2<<2,f[3]=0),{config:f,samplerate:c[_],channelCount:y,codec:"mp4a.40."+m,manifestCodec:o}}function N(r,t){return r[t]===255&&(r[t+1]&246)===240}function e(r,t){return r[t+1]&1?7:9}function C(r,t){return(r[t+3]&3)<<11|r[t+4]<<3|(r[t+5]&224)>>>5}function E(r,t){return t+5<r.length}function g(r,t){return t+1<r.length&&N(r,t)}function h(r,t){return E(r,t)&&N(r,t)&&C(r,t)<=r.length-t}function a(r,t){if(g(r,t)){var b=e(r,t);if(t+b>=r.length)return!1;var v=C(r,t);if(v<=b)return!1;var m=t+v;return m===r.length||g(r,m)}return!1}function i(r,t,b,v,m){if(!r.samplerate){var T=K(t,b,v,m);if(!T)return;r.config=T.config,r.samplerate=T.samplerate,r.channelCount=T.channelCount,r.codec=T.codec,r.manifestCodec=T.manifestCodec,W.logger.log("parsed codec:"+r.codec+", rate:"+T.samplerate+", channels:"+T.channelCount)}}function l(r){return 1024*9e4/r}function s(r,t,b,v,m){var T=e(r,t),y=C(r,t);if(y-=T,y>0){var f=b+v*m;return{headerLength:T,frameLength:y,stamp:f}}}function n(r,t,b,v,m){var T=l(r.samplerate),y=s(t,b,v,m,T);if(y){var f=y.frameLength,u=y.headerLength,o=y.stamp,c=u+f,_=Math.max(0,b+c-t.length),p;_?(p=new Uint8Array(c-u),p.set(t.subarray(b+u,t.length),0)):p=t.subarray(b+u,b+c);var d={unit:p,pts:o};return _||r.samples.push(d),{sample:d,length:c,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"initPTSFn",function(){return C});var W=I("./src/polyfills/number.ts"),P=I("./src/demux/id3.ts"),R=I("./src/demux/dummy-demuxed-track.ts"),K=I("./src/utils/mp4-tools.ts"),N=I("./src/utils/typed-array.ts"),e=function(){function E(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var g=E.prototype;return g.resetInitSegment=function(a,i,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(a,i){return!1},g.appendFrame=function(a,i,l){},g.demux=function(a,i){this.cachedData&&(a=Object(K.appendUint8Array)(this.cachedData,a),this.cachedData=null);var l=P.getID3Data(a,0),s=l?l.length:0,n,r,t=this._audioTrack,b=this._id3Track,v=l?P.getTimeStamp(l):void 0,m=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=C(v,i)),l&&l.length>0&&b.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),r=this.initPTS;s<m;){if(this.canParse(a,s)){var T=this.appendFrame(t,a,s);T?(this.frameIndex++,r=T.sample.pts,s+=T.length,n=s):s=m}else P.canParse(a,s)?(l=P.getID3Data(a,s),b.samples.push({pts:r,dts:r,data:l}),s+=l.length,n=s):s++;if(s===m&&n!==m){var y=Object(N.sliceUint8)(a,n);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,y):this.cachedData=y}}return{audioTrack:t,avcTrack:Object(R.dummyTrack)(),id3Track:b,textTrack:Object(R.dummyTrack)()}},g.demuxSampleAes=function(a,i,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(a){var i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(R.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(R.dummyTrack)()}},g.destroy=function(){},E}(),C=function(g,h){return Object(W.isFiniteNumber)(g)?g*90:h*9e4};H.default=e},"./src/demux/chunk-cache.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function R(){this.chunks=[],this.dataLength=0}var K=R.prototype;return K.push=function(e){this.chunks.push(e),this.dataLength+=e.length},K.flush=function(){var e=this.chunks,C=this.dataLength,E;if(e.length)e.length===1?E=e[0]:E=P(e,C);else return new Uint8Array(0);return this.reset(),E},K.reset=function(){this.chunks.length=0,this.dataLength=0},R}();function P(R,K){for(var N=new Uint8Array(K),e=0,C=0;C<R.length;C++){var E=R[C];N.set(E,e),e+=E.length}return N}},"./src/demux/dummy-demuxed-track.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"dummyTrack",function(){return W});function W(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/logger.ts"),P=function(){function R(N){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=N,this.bytesAvailable=N.byteLength,this.word=0,this.bitsAvailable=0}var K=R.prototype;return K.loadWord=function(){var e=this.data,C=this.bytesAvailable,E=e.byteLength-C,g=new Uint8Array(4),h=Math.min(4,C);if(h===0)throw new Error("no bytes available");g.set(e.subarray(E,E+h)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=h*8,this.bytesAvailable-=h},K.skipBits=function(e){var C;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,C=e>>3,e-=C>>3,this.bytesAvailable-=C,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},K.readBits=function(e){var C=Math.min(this.bitsAvailable,e),E=this.word>>>32-C;return e>32&&W.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=C,this.bitsAvailable>0?this.word<<=C:this.bytesAvailable>0&&this.loadWord(),C=e-C,C>0&&this.bitsAvailable?E<<C|this.readBits(C):E},K.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()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},K.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(e){for(var C=8,E=8,g,h=0;h<e;h++)E!==0&&(g=this.readEG(),E=(C+g+256)%256),C=E===0?C:E},K.readSPS=function(){var e=0,C=0,E=0,g=0,h,a,i,l=this.readUByte.bind(this),s=this.readBits.bind(this),n=this.readUEG.bind(this),r=this.readBoolean.bind(this),t=this.skipBits.bind(this),b=this.skipEG.bind(this),v=this.skipUEG.bind(this),m=this.skipScalingList.bind(this);l();var T=l();if(s(5),t(3),l(),v(),T===100||T===110||T===122||T===244||T===44||T===83||T===86||T===118||T===128){var y=n();if(y===3&&t(1),v(),v(),t(1),r())for(a=y!==3?8:12,i=0;i<a;i++)r()&&(i<6?m(16):m(64))}v();var f=n();if(f===0)n();else if(f===1)for(t(1),b(),b(),h=n(),i=0;i<h;i++)b();v(),t(1);var u=n(),o=n(),c=s(1);c===0&&t(1),t(1),r()&&(e=n(),C=n(),E=n(),g=n());var _=[1,1];if(r()&&r()){var p=l();switch(p){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((u+1)*16-e*2-C*2),height:(2-c)*(o+1)*16-(c?2:4)*(E+g),pixelRatio:_}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},R}();H.default=P},"./src/demux/id3.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"isHeader",function(){return W}),I.d(H,"isFooter",function(){return P}),I.d(H,"getID3Data",function(){return R}),I.d(H,"canParse",function(){return N}),I.d(H,"getTimeStamp",function(){return e}),I.d(H,"isTimeStampFrame",function(){return C}),I.d(H,"getID3Frames",function(){return g}),I.d(H,"decodeFrame",function(){return h}),I.d(H,"utf8ArrayToStr",function(){return n}),I.d(H,"testables",function(){return r});var W=function(m,T){return T+10<=m.length&&(m[T]===73&&m[T+1]===68&&m[T+2]===51&&(m[T+3]<255&&m[T+4]<255&&(m[T+6]<128&&m[T+7]<128&&m[T+8]<128&&m[T+9]<128)))},P=function(m,T){return T+10<=m.length&&(m[T]===51&&m[T+1]===68&&m[T+2]===73&&(m[T+3]<255&&m[T+4]<255&&(m[T+6]<128&&m[T+7]<128&&m[T+8]<128&&m[T+9]<128)))},R=function(m,T){for(var y=T,f=0;W(m,T);){f+=10;var u=K(m,T+6);f+=u,P(m,T+10)&&(f+=10),T+=f}return f>0?m.subarray(y,y+f):void 0},K=function(m,T){var y=0;return y=(m[T]&127)<<21,y|=(m[T+1]&127)<<14,y|=(m[T+2]&127)<<7,y|=m[T+3]&127,y},N=function(m,T){return W(m,T)&&K(m,T+6)+10<=m.length-T},e=function(m){for(var T=g(m),y=0;y<T.length;y++){var f=T[y];if(C(f))return s(f)}return},C=function(m){return m&&m.key==="PRIV"&&m.info==="com.apple.streaming.transportStreamTimestamp"},E=function(m){var T=String.fromCharCode(m[0],m[1],m[2],m[3]),y=K(m,4),f=10;return{type:T,size:y,data:m.subarray(f,f+y)}},g=function(m){for(var T=0,y=[];W(m,T);){var f=K(m,T+6);T+=10;for(var u=T+f;T+8<u;){var o=E(m.subarray(T)),c=h(o);c&&y.push(c),T+=o.size+10}P(m,T)&&(T+=10)}return y},h=function(m){return m.type==="PRIV"?a(m):m.type[0]==="W"?l(m):i(m)},a=function(m){if(m.size<2)return;var T=n(m.data,!0),y=new Uint8Array(m.data.subarray(T.length+1));return{key:m.type,info:T,data:y.buffer}},i=function(m){if(m.size<2)return;if(m.type==="TXXX"){var T=1,y=n(m.data.subarray(T),!0);T+=y.length+1;var f=n(m.data.subarray(T));return{key:m.type,info:y,data:f}}var u=n(m.data.subarray(1));return{key:m.type,data:u}},l=function(m){if(m.type==="WXXX"){if(m.size<2)return;var T=1,y=n(m.data.subarray(T),!0);T+=y.length+1;var f=n(m.data.subarray(T));return{key:m.type,info:y,data:f}}var u=n(m.data);return{key:m.type,data:u}},s=function(m){if(m.data.byteLength===8){var T=new Uint8Array(m.data),y=T[3]&1,f=(T[4]<<23)+(T[5]<<15)+(T[6]<<7)+T[7];return f/=45,y&&(f+=4772185884e-2),Math.round(f)}return},n=function(m,T){T===void 0&&(T=!1);var y=b();if(y){var f=y.decode(m);if(T){var u=f.indexOf("\0");return u!==-1?f.substring(0,u):f}return f.replace(/\0/g,"")}for(var o=m.length,c,_,p,d="",A=0;A<o;){if(c=m[A++],c===0&&T)return d;if(c===0||c===3)continue;switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:d+=String.fromCharCode(c);break;case 12:case 13:_=m[A++],d+=String.fromCharCode((c&31)<<6|_&63);break;case 14:_=m[A++],p=m[A++],d+=String.fromCharCode((c&15)<<12|(_&63)<<6|(p&63)<<0);break;default:}}return d},r={decodeTextFrame:i},t;function b(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/demux/base-audio-demuxer.ts"),P=I("./src/demux/id3.ts"),R=I("./src/utils/logger.ts"),K=I("./src/demux/mpegaudio.ts");function N(E,g){E.prototype=Object.create(g.prototype),E.prototype.constructor=E,e(E,g)}function e(E,g){return e=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},e(E,g)}var C=function(E){N(g,E);function g(){return E.apply(this,arguments)||this}var h=g.prototype;return h.resetInitSegment=function(i,l,s){E.prototype.resetInitSegment.call(this,i,l,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}},g.probe=function(i){if(!i)return!1;for(var l=P.getID3Data(i,0)||[],s=l.length,n=i.length;s<n;s++)if(K.probe(i,s))return R.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(i,l){return K.canParse(i,l)},h.appendFrame=function(i,l,s){return this.initPTS===null?void 0:K.appendFrame(i,l,s,this.initPTS,this.frameIndex)},g}(W.default);C.minProbeByteLength=4,H.default=C},"./src/demux/mp4demuxer.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/mp4-tools.ts"),P=I("./src/demux/dummy-demuxed-track.ts"),R=function(){function K(e,C){this.remainderData=null,this.config=void 0,this.config=C}var N=K.prototype;return N.resetTimeStamp=function(){},N.resetInitSegment=function(){},N.resetContiguity=function(){},K.probe=function(C){return Object(W.findBox)({data:C,start:0,end:Math.min(C.length,16384)},["moof"]).length>0},N.demux=function(C){var E=C,g=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(E=Object(W.appendUint8Array)(this.remainderData,C));var h=Object(W.segmentValidRange)(E);this.remainderData=h.remainder,g.samples=h.valid||new Uint8Array}else g.samples=E;return{audioTrack:Object(P.dummyTrack)(),avcTrack:g,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},N.flush=function(){var C=Object(P.dummyTrack)();return C.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:C,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},N.demuxSampleAes=function(C,E,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},N.destroy=function(){},K}();R.minProbeByteLength=1024,H.default=R},"./src/demux/mpegaudio.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"appendFrame",function(){return e}),I.d(H,"parseHeader",function(){return C}),I.d(H,"isHeaderPattern",function(){return E}),I.d(H,"isHeader",function(){return g}),I.d(H,"canParse",function(){return h}),I.d(H,"probe",function(){return a});var W=null,P=[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],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],N=[0,1,1,4];function e(i,l,s,n,r){if(s+24>l.length)return;var t=C(l,s);if(t&&s+t.frameLength<=l.length){var b=t.samplesPerFrame*9e4/t.sampleRate,v=n+r*b,m={unit:l.subarray(s,s+t.frameLength),pts:v,dts:v};return i.config=[],i.channelCount=t.channelCount,i.samplerate=t.sampleRate,i.samples.push(m),{sample:m,length:t.frameLength,missing:0}}}function C(i,l){var s=i[l+1]>>3&3,n=i[l+1]>>1&3,r=i[l+2]>>4&15,t=i[l+2]>>2&3;if(s!==1&&r!==0&&r!==15&&t!==3){var b=i[l+2]>>1&1,v=i[l+3]>>6,m=s===3?3-n:n===3?3:4,T=P[m*14+r-1]*1e3,y=s===3?0:s===2?1:2,f=R[y*3+t],u=v===3?1:2,o=K[s][n],c=N[n],_=o*8*c,p=Math.floor(o*T/f+b)*c;if(W===null){var d=navigator.userAgent||"",A=d.match(/Chrome\/(\d+)/i);W=A?parseInt(A[1]):0}var D=!!W&&W<=87;return D&&n===2&&T>=224e3&&v===0&&(i[l+3]=i[l+3]|128),{sampleRate:f,channelCount:u,frameLength:p,samplesPerFrame:_}}}function E(i,l){return i[l]===255&&(i[l+1]&224)===224&&(i[l+1]&6)!==0}function g(i,l){return l+1<i.length&&E(i,l)}function h(i,l){var s=4;return E(i,l)&&s<=i.length-l}function a(i,l){if(l+1<i.length&&E(i,l)){var s=4,n=C(i,l),r=s;n!=null&&n.frameLength&&(r=n.frameLength);var t=l+r;return t===i.length||g(i,t)}return!1}},"./src/demux/sample-aes.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/crypt/decrypter.ts"),P=I("./src/demux/tsdemuxer.ts"),R=function(){function K(e,C,E){this.keyData=void 0,this.decrypter=void 0,this.keyData=E,this.decrypter=new W.default(e,C,{removePKCS7Padding:!1})}var N=K.prototype;return N.decryptBuffer=function(C,E){this.decrypter.decrypt(C,this.keyData.key.buffer,this.keyData.iv.buffer,E)},N.decryptAacSample=function(C,E,g,h){var a=C[E].unit,i=a.subarray(16,a.length-a.length%16),l=i.buffer.slice(i.byteOffset,i.byteOffset+i.length),s=this;this.decryptBuffer(l,function(n){var r=new Uint8Array(n);a.set(r,16),h||s.decryptAacSamples(C,E+1,g)})},N.decryptAacSamples=function(C,E,g){for(;;E++){if(E>=C.length){g();return}if(C[E].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(C,E,g,h),!h)return}},N.getAvcEncryptedData=function(C){for(var E=Math.floor((C.length-48)/160)*16+16,g=new Int8Array(E),h=0,a=32;a<=C.length-16;a+=160,h+=16)g.set(C.subarray(a,a+16),h);return g},N.getAvcDecryptedUnit=function(C,E){for(var g=new Uint8Array(E),h=0,a=32;a<=C.length-16;a+=160,h+=16)C.set(g.subarray(h,h+16),a);return C},N.decryptAvcSample=function(C,E,g,h,a,i){var l=Object(P.discardEPB)(a.data),s=this.getAvcEncryptedData(l),n=this;this.decryptBuffer(s.buffer,function(r){a.data=n.getAvcDecryptedUnit(l,r),i||n.decryptAvcSamples(C,E,g+1,h)})},N.decryptAvcSamples=function(C,E,g,h){if(C instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;E++,g=0){if(E>=C.length){h();return}for(var a=C[E].units;!(g>=a.length);g++){var i=a[g];if(i.data.length<=48||i.type!==1&&i.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(C,E,g,h,i,l),!l)return}}},K}();H.default=R},"./src/demux/transmuxer-interface.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return a});var W=I("./node_modules/webworkify-webpack/index.js"),P=I.n(W),R=I("./src/events.ts"),K=I("./src/demux/transmuxer.ts"),N=I("./src/utils/logger.ts"),e=I("./src/errors.ts"),C=I("./src/utils/mediasource-helper.ts"),E=I("./node_modules/eventemitter3/index.js"),g=I.n(E),h=Object(C.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function i(s,n,r,t){var b=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=n,this.onTransmuxComplete=r,this.onFlush=t;var v=s.config,m=function(o,c){c=c||{},c.frag=b.frag,c.id=b.id,s.trigger(o,c)};this.observer=new E.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,m),this.observer.on(R.Events.ERROR,m);var T={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},y=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){N.logger.log("demuxing in webworker");var f;try{f=this.worker=W("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),f.addEventListener("message",this.onwmsg),f.onerror=function(u){s.trigger(R.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(u.message+" ("+u.filename+":"+u.lineno+")")})},f.postMessage({cmd:"init",typeSupported:T,vendor:y,id:n,config:JSON.stringify(v)})}catch(u){N.logger.warn("Error in worker:",u),N.logger.error("Error while initializing DemuxerWorker, fallback to inline"),f&&self.URL.revokeObjectURL(f.objectURL),this.transmuxer=new K.default(this.observer,T,v,y,n),this.worker=null}}else this.transmuxer=new K.default(this.observer,T,v,y,n)}var l=i.prototype;return l.destroy=function(){var n=this.worker;if(n)n.removeEventListener("message",this.onwmsg),n.terminate(),this.worker=null;else{var r=this.transmuxer;r&&(r.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},l.push=function(n,r,t,b,v,m,T,y,f,u){var o=this;f.transmuxing.start=self.performance.now();var c=this.transmuxer,_=this.worker,p=m?m.start:v.start,d=v.decryptdata,A=this.frag,D=!(A&&v.cc===A.cc),S=!(A&&f.level===A.level),L=A?f.sn-A.sn:-1,M=this.part?f.part-this.part.index:1,O=!S&&(L===1||L===0&&M===1),j=self.performance.now();(S||L||v.stats.parsing.start===0)&&(v.stats.parsing.start=j),m&&(M||!O)&&(m.stats.parsing.start=j);var G=new K.TransmuxState(D,O,y,S,p);if(!O||D){N.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+f.sn+" p: "+f.part+" level: "+f.level+" id: "+f.id+`
|
|
discontinuity: `+D+`
|
|
trackSwitch: `+S+`
|
|
contiguous: `+O+`
|
|
accurateTimeOffset: `+y+`
|
|
timeOffset: `+p);var X=new K.TransmuxConfig(t,b,r,T,u);this.configureTransmuxer(X)}if(this.frag=v,this.part=m,_)_.postMessage({cmd:"demux",data:n,decryptdata:d,chunkMeta:f,state:G},n instanceof ArrayBuffer?[n]:[]);else if(c){var ee=c.push(n,d,f,G);Object(K.isPromise)(ee)?ee.then(function(he){o.handleTransmuxComplete(he)}):this.handleTransmuxComplete(ee)}},l.flush=function(n){var r=this;n.transmuxing.start=self.performance.now();var t=this.transmuxer,b=this.worker;if(b)b.postMessage({cmd:"flush",chunkMeta:n});else if(t){var v=t.flush(n);Object(K.isPromise)(v)?v.then(function(m){r.handleFlushResult(m,n)}):this.handleFlushResult(v,n)}},l.handleFlushResult=function(n,r){var t=this;n.forEach(function(b){t.handleTransmuxComplete(b)}),this.onFlush(r)},l.onWorkerMessage=function(n){var r=n.data,t=this.hls;switch(r.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(r.data);break}case"flush":{this.onFlush(r.data);break}default:{r.data=r.data||{},r.data.frag=this.frag,r.data.id=this.id,t.trigger(r.event,r.data);break}}},l.configureTransmuxer=function(n){var r=this.worker,t=this.transmuxer;r?r.postMessage({cmd:"configure",config:n}):t&&t.configure(n)},l.handleTransmuxComplete=function(n){n.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(n)},i}()},"./src/demux/transmuxer-worker.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return e});var W=I("./src/demux/transmuxer.ts"),P=I("./src/events.ts"),R=I("./src/utils/logger.ts"),K=I("./node_modules/eventemitter3/index.js"),N=I.n(K);function e(a){var i=new K.EventEmitter,l=function(n,r){a.postMessage({event:n,data:r})};i.on(P.Events.FRAG_DECRYPTED,l),i.on(P.Events.ERROR,l),a.addEventListener("message",function(s){var n=s.data;switch(n.cmd){case"init":{var r=JSON.parse(n.config);a.transmuxer=new W.default(i,n.typeSupported,r,n.vendor,n.id),Object(R.enableLogs)(r.debug),l("init",null);break}case"configure":{a.transmuxer.configure(n.config);break}case"demux":{var t=a.transmuxer.push(n.data,n.decryptdata,n.chunkMeta,n.state);Object(W.isPromise)(t)?t.then(function(m){C(a,m)}):C(a,t);break}case"flush":{var b=n.chunkMeta,v=a.transmuxer.flush(b);Object(W.isPromise)(v)?v.then(function(m){g(a,m,b)}):g(a,v,b);break}default:break}})}function C(a,i){if(h(i.remuxResult))return;var l=[],s=i.remuxResult,n=s.audio,r=s.video;n&&E(l,n),r&&E(l,r),a.postMessage({event:"transmuxComplete",data:i},l)}function E(a,i){i.data1&&a.push(i.data1.buffer),i.data2&&a.push(i.data2.buffer)}function g(a,i,l){i.forEach(function(s){C(a,s)}),a.postMessage({event:"flush",data:l})}function h(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return r}),I.d(H,"isPromise",function(){return v}),I.d(H,"TransmuxConfig",function(){return m}),I.d(H,"TransmuxState",function(){return T});var W=I("./src/events.ts"),P=I("./src/errors.ts"),R=I("./src/crypt/decrypter.ts"),K=I("./src/demux/aacdemuxer.ts"),N=I("./src/demux/mp4demuxer.ts"),e=I("./src/demux/tsdemuxer.ts"),C=I("./src/demux/mp3demuxer.ts"),E=I("./src/remux/mp4-remuxer.ts"),g=I("./src/remux/passthrough-remuxer.ts"),h=I("./src/demux/chunk-cache.ts"),a=I("./src/utils/mp4-tools.ts"),i=I("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(y){i.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var s=[{demux:e.default,remux:E.default},{demux:N.default,remux:g.default},{demux:K.default,remux:E.default},{demux:C.default,remux:E.default}],n=1024;s.forEach(function(y){var f=y.demux;n=Math.max(n,f.minProbeByteLength)});var r=function(){function y(u,o,c,_,p){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 h.default,this.observer=u,this.typeSupported=o,this.config=c,this.vendor=_,this.id=p}var f=y.prototype;return f.configure=function(o){this.transmuxConfig=o,this.decrypter&&this.decrypter.reset()},f.push=function(o,c,_,p){var d=this,A=_.transmuxing;A.executeStart=l();var D=new Uint8Array(o),S=this.cache,L=this.config,M=this.currentTransmuxState,O=this.transmuxConfig;p&&(this.currentTransmuxState=p);var j=t(D,c);if(j&&j.method==="AES-128"){var G=this.getDecrypter();if(L.enableSoftwareAES){var X=G.softwareDecrypt(D,j.key.buffer,j.iv.buffer);if(!X)return A.executeEnd=l(),b(_);D=new Uint8Array(X)}else return this.decryptionPromise=G.webCryptoDecrypt(D,j.key.buffer,j.iv.buffer).then(function(Ae){var Ie=d.push(Ae,null,_);return d.decryptionPromise=null,Ie}),this.decryptionPromise}var ee=p||M,he=ee.contiguous,ge=ee.discontinuity,de=ee.trackSwitch,Te=ee.accurateTimeOffset,xe=ee.timeOffset,ce=O.audioCodec,ae=O.videoCodec,Le=O.defaultInitPts,Ye=O.duration,Fe=O.initSegmentData;if((ge||de)&&this.resetInitSegment(Fe,ce,ae,Ye),ge&&this.resetInitialTimestamp(Le),he||this.resetContiguity(),this.needsProbing(D,ge,de)){if(S.dataLength){var We=S.flush();D=Object(a.appendUint8Array)(We,D)}this.configureTransmuxer(D,O)}var be=this.transmux(D,j,xe,Te,_),Ee=this.currentTransmuxState;return Ee.contiguous=!0,Ee.discontinuity=!1,Ee.trackSwitch=!1,A.executeEnd=l(),be},f.flush=function(o){var c=this,_=o.transmuxing;_.executeStart=l();var p=this.decrypter,d=this.cache,A=this.currentTransmuxState,D=this.decryptionPromise;if(D)return D.then(function(){return c.flush(o)});var S=[],L=A.timeOffset;if(p){var M=p.flush();M&&S.push(this.push(M,null,o))}var O=d.dataLength;d.reset();var j=this.demuxer,G=this.remuxer;if(!j||!G)return O>=n&&this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=l(),[b(o)];var X=j.flush(L);return v(X)?X.then(function(ee){return c.flushRemux(S,ee,o),S}):(this.flushRemux(S,X,o),S)},f.flushRemux=function(o,c,_){var p=c.audioTrack,d=c.avcTrack,A=c.id3Track,D=c.textTrack,S=this.currentTransmuxState,L=S.accurateTimeOffset,M=S.timeOffset;i.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var O=this.remuxer.remux(p,d,A,D,M,L,!0,this.id);o.push({remuxResult:O,chunkMeta:_}),_.transmuxing.executeEnd=l()},f.resetInitialTimestamp=function(o){var c=this.demuxer,_=this.remuxer;if(!c||!_)return;c.resetTimeStamp(o),_.resetTimeStamp(o)},f.resetContiguity=function(){var o=this.demuxer,c=this.remuxer;if(!o||!c)return;o.resetContiguity(),c.resetNextTimestamp()},f.resetInitSegment=function(o,c,_,p){var d=this.demuxer,A=this.remuxer;if(!d||!A)return;d.resetInitSegment(c,_,p),A.resetInitSegment(o,c,_)},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(o,c,_,p,d){var A;return c&&c.method==="SAMPLE-AES"?A=this.transmuxSampleAes(o,c,_,p,d):A=this.transmuxUnencrypted(o,_,p,d),A},f.transmuxUnencrypted=function(o,c,_,p){var d=this.demuxer.demux(o,c,!1,!this.config.progressive),A=d.audioTrack,D=d.avcTrack,S=d.id3Track,L=d.textTrack,M=this.remuxer.remux(A,D,S,L,c,_,!1,this.id);return{remuxResult:M,chunkMeta:p}},f.transmuxSampleAes=function(o,c,_,p,d){var A=this;return this.demuxer.demuxSampleAes(o,c,_).then(function(D){var S=A.remuxer.remux(D.audioTrack,D.avcTrack,D.id3Track,D.textTrack,_,p,!1,A.id);return{remuxResult:S,chunkMeta:d}})},f.configureTransmuxer=function(o,c){for(var _=this.config,p=this.observer,d=this.typeSupported,A=this.vendor,D=c.audioCodec,S=c.defaultInitPts,L=c.duration,M=c.initSegmentData,O=c.videoCodec,j,G=0,X=s.length;G<X;G++)if(s[G].demux.probe(o)){j=s[G];break}j||(i.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),j={demux:N.default,remux:g.default});var ee=this.demuxer,he=this.remuxer,ge=j.remux,de=j.demux;(!he||!(he instanceof ge))&&(this.remuxer=new ge(p,_,d,A)),(!ee||!(ee instanceof de))&&(this.demuxer=new de(p,_,d),this.probe=de.probe),this.resetInitSegment(M,D,O,L),this.resetInitialTimestamp(S)},f.needsProbing=function(o,c,_){return!this.demuxer||!this.remuxer||c||_},f.getDecrypter=function(){var o=this.decrypter;return o||(o=this.decrypter=new R.default(this.observer,this.config)),o},y}();function t(y,f){var u=null;return y.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(u=f),u}var b=function(f){return{remuxResult:{},chunkMeta:f}};function v(y){return"then"in y&&y.then instanceof Function}var m=function(f,u,o,c,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=u,this.initSegmentData=o,this.duration=c,this.defaultInitPts=_},T=function(f,u,o,c,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=f,this.contiguous=u,this.accurateTimeOffset=o,this.trackSwitch=c,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"discardEPB",function(){return b});var W=I("./src/demux/adts.ts"),P=I("./src/demux/mpegaudio.ts"),R=I("./src/demux/exp-golomb.ts"),K=I("./src/demux/id3.ts"),N=I("./src/demux/sample-aes.ts"),e=I("./src/events.ts"),C=I("./src/utils/mp4-tools.ts"),E=I("./src/utils/logger.ts"),g=I("./src/errors.ts"),h={video:1,audio:2,id3:3,text:4},a=function(){function v(T,y,f){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=T,this.config=y,this.typeSupported=f}v.probe=function(y){var f=v.syncOffset(y);return f<0?!1:(f&&E.logger.warn("MPEG2-TS detected but first sync word found @ offset "+f+", junk ahead ?"),!0)},v.syncOffset=function(y){for(var f=Math.min(1e3,y.length-3*188),u=0;u<f;){if(y[u]===71&&y[u+188]===71&&y[u+2*188]===71)return u;u++}return-1},v.createTrack=function(y,f){return{container:y==="video"||y==="audio"?"video/mp2t":void 0,type:y,id:h[y],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:y==="audio"?f:void 0}};var m=v.prototype;return m.resetInitSegment=function(y,f,u){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=v.createTrack("video",u),this._audioTrack=v.createTrack("audio",u),this._id3Track=v.createTrack("id3",u),this._txtTrack=v.createTrack("text",u),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=y,this.videoCodec=f,this._duration=u},m.resetTimeStamp=function(){},m.resetContiguity=function(){var y=this._audioTrack,f=this._avcTrack,u=this._id3Track;y&&(y.pesData=null),f&&(f.pesData=null),u&&(u.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},m.demux=function(y,f,u,o){u===void 0&&(u=!1),o===void 0&&(o=!1),u||(this.sampleAes=null);var c,_=this._avcTrack,p=this._audioTrack,d=this._id3Track,A=_.pid,D=_.pesData,S=p.pid,L=d.pid,M=p.pesData,O=d.pesData,j=!1,G=this.pmtParsed,X=this._pmtId,ee=y.length;if(this.remainderData&&(y=Object(C.appendUint8Array)(this.remainderData,y),ee=y.length,this.remainderData=null),ee<188&&!o)return this.remainderData=y,{audioTrack:p,avcTrack:_,id3Track:d,textTrack:this._txtTrack};var he=Math.max(0,v.syncOffset(y));ee-=(ee+he)%188,ee<y.byteLength&&!o&&(this.remainderData=new Uint8Array(y.buffer,ee,y.buffer.byteLength-ee));for(var ge=he;ge<ee;ge+=188)if(y[ge]===71){var de=!!(y[ge+1]&64),Te=((y[ge+1]&31)<<8)+y[ge+2],xe=(y[ge+3]&48)>>4,ce=void 0;if(xe>1){if(ce=ge+5+y[ge+4],ce===ge+188)continue}else ce=ge+4;switch(Te){case A:de&&(D&&(c=n(D))&&this.parseAVCPES(c,!1),D={data:[],size:0}),D&&(D.data.push(y.subarray(ce,ge+188)),D.size+=ge+188-ce);break;case S:de&&(M&&(c=n(M))&&(p.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),M={data:[],size:0}),M&&(M.data.push(y.subarray(ce,ge+188)),M.size+=ge+188-ce);break;case L:de&&(O&&(c=n(O))&&this.parseID3PES(c),O={data:[],size:0}),O&&(O.data.push(y.subarray(ce,ge+188)),O.size+=ge+188-ce);break;case 0:de&&(ce+=y[ce]+1),X=this._pmtId=l(y,ce);break;case X:{de&&(ce+=y[ce]+1);var ae=s(y,ce,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,u);A=ae.avc,A>0&&(_.pid=A),S=ae.audio,S>0&&(p.pid=S,p.isAAC=ae.isAAC),L=ae.id3,L>0&&(d.pid=L),j&&!G&&(E.logger.log("reparse from beginning"),j=!1,ge=he-188),G=this.pmtParsed=!0;break}case 17:case 8191:break;default:j=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=D,p.pesData=M,d.pesData=O;var Le={audioTrack:p,avcTrack:_,id3Track:d,textTrack:this._txtTrack};return o&&this.extractRemainingSamples(Le),Le},m.flush=function(){var y=this.remainderData;this.remainderData=null;var f;return y?f=this.demux(y,-1,!1,!0):f={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(f),this.sampleAes?this.decrypt(f,this.sampleAes):f},m.extractRemainingSamples=function(y){var f=y.audioTrack,u=y.avcTrack,o=y.id3Track,c=u.pesData,_=f.pesData,p=o.pesData,d;c&&(d=n(c))?(this.parseAVCPES(d,!0),u.pesData=null):u.pesData=c,_&&(d=n(_))?(f.isAAC?this.parseAACPES(d):this.parseMPEGPES(d),f.pesData=null):(_!=null&&_.size&&E.logger.log("last AAC PES packet truncated,might overlap between fragments"),f.pesData=_),p&&(d=n(p))?(this.parseID3PES(d),o.pesData=null):o.pesData=p},m.demuxSampleAes=function(y,f,u){var o=this.demux(y,u,!0,!this.config.progressive),c=this.sampleAes=new N.default(this.observer,this.config,f);return this.decrypt(o,c)},m.decrypt=function(y,f){return new Promise(function(u){var o=y.audioTrack,c=y.avcTrack;o.samples&&o.isAAC?f.decryptAacSamples(o.samples,0,function(){c.samples?f.decryptAvcSamples(c.samples,0,0,function(){u(y)}):u(y)}):c.samples&&f.decryptAvcSamples(c.samples,0,0,function(){u(y)})})},m.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},m.parseAVCPES=function(y,f){var u=this,o=this._avcTrack,c=this.parseAVCNALu(y.data),_=!1,p=this.avcSample,d,A=!1;y.data=null,p&&c.length&&!o.audFound&&(r(p,o),p=this.avcSample=i(!1,y.pts,y.dts,"")),c.forEach(function(D){switch(D.type){case 1:{d=!0,p||(p=u.avcSample=i(!0,y.pts,y.dts,"")),_&&(p.debug+="NDR "),p.frame=!0;var S=D.data;if(A&&S.length>4){var L=new R.default(S).readSliceType();(L===2||L===4||L===7||L===9)&&(p.key=!0)}break}case 5:d=!0,p||(p=u.avcSample=i(!0,y.pts,y.dts,"")),_&&(p.debug+="IDR "),p.key=!0,p.frame=!0;break;case 6:{d=!0,_&&p&&(p.debug+="SEI ");var M=new R.default(b(D.data));M.readUByte();for(var O=0,j=0,G=!1,X=0;!G&&M.bytesAvailable>1;){O=0;do X=M.readUByte(),O+=X;while(X===255);j=0;do X=M.readUByte(),j+=X;while(X===255);if(O===4&&M.bytesAvailable!==0){G=!0;var ee=M.readUByte();if(ee===181){var he=M.readUShort();if(he===49){var ge=M.readUInt();if(ge===1195456820){var de=M.readUByte();if(de===3){for(var Te=M.readUByte(),xe=M.readUByte(),ce=31&Te,ae=[Te,xe],Le=0;Le<ce;Le++)ae.push(M.readUByte()),ae.push(M.readUByte()),ae.push(M.readUByte());t(u._txtTrack.samples,{type:3,pts:y.pts,bytes:ae})}}}}}else if(O===5&&M.bytesAvailable!==0){if(G=!0,j>16){for(var Ye=[],Fe=0;Fe<16;Fe++)Ye.push(M.readUByte().toString(16)),(Fe===3||Fe===5||Fe===7||Fe===9)&&Ye.push("-");for(var We=j-16,be=new Uint8Array(We),Ee=0;Ee<We;Ee++)be[Ee]=M.readUByte();t(u._txtTrack.samples,{pts:y.pts,payloadType:O,uuid:Ye.join(""),userData:Object(K.utf8ArrayToStr)(be),userDataBytes:be})}}else if(j<M.bytesAvailable)for(var Ae=0;Ae<j;Ae++)M.readUByte()}break}case 7:if(d=!0,A=!0,_&&p&&(p.debug+="SPS "),!o.sps){var Ie=new R.default(D.data),$=Ie.readSPS();o.width=$.width,o.height=$.height,o.pixelRatio=$.pixelRatio,o.sps=[D.data],o.duration=u._duration;for(var se=D.data.subarray(1,4),ue="avc1.",pe=0;pe<3;pe++){var Se=se[pe].toString(16);Se.length<2&&(Se="0"+Se),ue+=Se}o.codec=ue}break;case 8:d=!0,_&&p&&(p.debug+="PPS "),o.pps||(o.pps=[D.data]);break;case 9:d=!1,o.audFound=!0,p&&r(p,o),p=u.avcSample=i(!1,y.pts,y.dts,_?"AUD ":"");break;case 12:d=!1;break;default:d=!1,p&&(p.debug+="unknown NAL "+D.type+" ");break}if(p&&d){var Pe=p.units;Pe.push(D)}}),f&&p&&(r(p,o),this.avcSample=null)},m.getLastNalUnit=function(){var y,f=this.avcSample,u;if(!f||f.units.length===0){var o=this._avcTrack.samples;f=o[o.length-1]}if((y=f)!==null&&y!==void 0&&y.units){var c=f.units;u=c[c.length-1]}return u},m.parseAVCNALu=function(y){var f=y.byteLength,u=this._avcTrack,o=u.naluState||0,c=o,_=[],p=0,d,A,D,S=-1,L=0;for(o===-1&&(S=0,L=y[0]&31,o=0,p=1);p<f;){if(d=y[p++],!o){o=d?0:1;continue}if(o===1){o=d?0:2;continue}if(!d)o=3;else if(d===1){if(S>=0){var M={data:y.subarray(S,p-o-1),type:L};_.push(M)}else{var O=this.getLastNalUnit();if(O&&(c&&p<=4-c&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-c))),A=p-o-1,A>0)){var j=new Uint8Array(O.data.byteLength+A);j.set(O.data,0),j.set(y.subarray(0,A),O.data.byteLength),O.data=j,O.state=0}}p<f?(D=y[p]&31,S=p,L=D,o=0):o=-1}else o=0}if(S>=0&&o>=0){var G={data:y.subarray(S,f),type:L,state:o};_.push(G)}if(_.length===0){var X=this.getLastNalUnit();if(X){var ee=new Uint8Array(X.data.byteLength+y.byteLength);ee.set(X.data,0),ee.set(y,X.data.byteLength),X.data=ee}}return u.naluState=o,_},m.parseAACPES=function(y){var f=0,u=this._audioTrack,o=this.aacOverFlow,c=y.data;if(o){this.aacOverFlow=null;var _=o.sample.unit.byteLength,p=Math.min(o.missing,_),d=_-p;o.sample.unit.set(c.subarray(0,p),d),u.samples.push(o.sample),f=o.missing}var A,D;for(A=f,D=c.length;A<D-1&&!W.isHeader(c,A);A++);if(A!==f){var S,L;if(A<D-1?(S="AAC PES did not start with ADTS header,offset:"+A,L=!1):(S="no ADTS header found in AAC PES",L=!0),E.logger.warn("parsing error:"+S),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:L,reason:S}),L)return}W.initTrackConfig(u,this.observer,c,A,this.audioCodec);var M;if(y.pts!==void 0)M=y.pts;else if(o){var O=W.getFrameDuration(u.samplerate);M=o.sample.pts+O}else{E.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var j=0;A<D;)if(W.isHeader(c,A)){if(A+5<D){var G=W.appendFrame(u,c,A,M,j);if(G)if(G.missing)this.aacOverFlow=G;else{A+=G.length,j++;continue}}break}else A++},m.parseMPEGPES=function(y){var f=y.data,u=f.length,o=0,c=0,_=y.pts;if(_===void 0){E.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;c<u;)if(P.isHeader(f,c)){var p=P.appendFrame(this._audioTrack,f,c,_,o);if(p)c+=p.length,o++;else break}else c++},m.parseID3PES=function(y){if(y.pts===void 0){E.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(y)},v}();a.minProbeByteLength=188;function i(v,m,T,y){return{key:v,frame:!1,pts:m,dts:T,units:[],debug:y,length:0}}function l(v,m){return(v[m+10]&31)<<8|v[m+11]}function s(v,m,T,y){var f={audio:-1,avc:-1,id3:-1,isAAC:!0},u=(v[m+1]&15)<<8|v[m+2],o=m+3+u-4,c=(v[m+10]&15)<<8|v[m+11];for(m+=12+c;m<o;){var _=(v[m+1]&31)<<8|v[m+2];switch(v[m]){case 207:if(!y){E.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:f.audio===-1&&(f.audio=_);break;case 21:f.id3===-1&&(f.id3=_);break;case 219:if(!y){E.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:f.avc===-1&&(f.avc=_);break;case 3:case 4:T?f.audio===-1&&(f.audio=_,f.isAAC=!1):E.logger.log("MPEG audio found, not supported in this browser");break;case 36:E.logger.warn("Unsupported HEVC stream type found");break;default:break}m+=((v[m+3]&15)<<8|v[m+4])+5}return f}function n(v){var m=0,T,y,f,u,o,c=v.data;if(!v||v.size===0)return null;for(;c[0].length<19&&c.length>1;){var _=new Uint8Array(c[0].length+c[1].length);_.set(c[0]),_.set(c[1],c[0].length),c[0]=_,c.splice(1,1)}T=c[0];var p=(T[0]<<16)+(T[1]<<8)+T[2];if(p===1){if(y=(T[4]<<8)+T[5],y&&y>v.size-6)return null;var d=T[7];d&192&&(u=(T[9]&14)*536870912+(T[10]&255)*4194304+(T[11]&254)*16384+(T[12]&255)*128+(T[13]&254)/2,d&64?(o=(T[14]&14)*536870912+(T[15]&255)*4194304+(T[16]&254)*16384+(T[17]&255)*128+(T[18]&254)/2,u-o>60*9e4&&(E.logger.warn(Math.round((u-o)/9e4)+"s delta between PTS and DTS, align them"),u=o)):o=u),f=T[8];var A=f+9;if(v.size<=A)return null;v.size-=A;for(var D=new Uint8Array(v.size),S=0,L=c.length;S<L;S++){T=c[S];var M=T.byteLength;if(A)if(A>M){A-=M;continue}else T=T.subarray(A),M-=A,A=0;D.set(T,m),m+=M}return y&&(y-=f+3),{data:D,pts:u,dts:o,len:y}}return null}function r(v,m){if(v.units.length&&v.frame){if(v.pts===void 0){var T=m.samples,y=T.length;if(y){var f=T[y-1];v.pts=f.pts,v.dts=f.dts}else{m.dropped++;return}}m.samples.push(v)}v.debug.length&&E.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function t(v,m){var T=v.length;if(T>0){if(m.pts>=v[T-1].pts)v.push(m);else for(var y=T-1;y>=0;y--)if(m.pts<v[y].pts){v.splice(y,0,m);break}}else v.push(m)}function b(v){for(var m=v.byteLength,T=[],y=1;y<m-2;)v[y]===0&&v[y+1]===0&&v[y+2]===3?(T.push(y+2),y+=2):y++;if(T.length===0)return v;var f=m-T.length,u=new Uint8Array(f),o=0;for(y=0;y<f;o++,y++)o===T[0]&&(o++,T.shift()),u[y]=v[o];return u}H.default=a},"./src/errors.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"ErrorTypes",function(){return W}),I.d(H,"ErrorDetails",function(){return P});var W;(function(R){R.NETWORK_ERROR="networkError",R.MEDIA_ERROR="mediaError",R.KEY_SYSTEM_ERROR="keySystemError",R.MUX_ERROR="muxError",R.OTHER_ERROR="otherError"})(W||(W={}));var P;(function(R){R.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",R.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",R.KEY_SYSTEM_NO_SESSION="keySystemNoSession",R.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",R.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",R.MANIFEST_LOAD_ERROR="manifestLoadError",R.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",R.MANIFEST_PARSING_ERROR="manifestParsingError",R.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",R.LEVEL_EMPTY_ERROR="levelEmptyError",R.LEVEL_LOAD_ERROR="levelLoadError",R.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",R.LEVEL_SWITCH_ERROR="levelSwitchError",R.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",R.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",R.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",R.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",R.FRAG_LOAD_ERROR="fragLoadError",R.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",R.FRAG_DECRYPT_ERROR="fragDecryptError",R.FRAG_PARSING_ERROR="fragParsingError",R.REMUX_ALLOC_ERROR="remuxAllocError",R.KEY_LOAD_ERROR="keyLoadError",R.KEY_LOAD_TIMEOUT="keyLoadTimeOut",R.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",R.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",R.BUFFER_APPEND_ERROR="bufferAppendError",R.BUFFER_APPENDING_ERROR="bufferAppendingError",R.BUFFER_STALLED_ERROR="bufferStalledError",R.BUFFER_FULL_ERROR="bufferFullError",R.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",R.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",R.INTERNAL_EXCEPTION="internalException",R.INTERNAL_ABORTED="aborted",R.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"Events",function(){return W});var W;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(W||(W={}))},"./src/hls.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return v});var W=I("./node_modules/url-toolkit/src/url-toolkit.js"),P=I.n(W),R=I("./src/loader/playlist-loader.ts"),K=I("./src/loader/key-loader.ts"),N=I("./src/controller/id3-track-controller.ts"),e=I("./src/controller/latency-controller.ts"),C=I("./src/controller/level-controller.ts"),E=I("./src/controller/fragment-tracker.ts"),g=I("./src/controller/stream-controller.ts"),h=I("./src/is-supported.ts"),a=I("./src/utils/logger.ts"),i=I("./src/config.ts"),l=I("./node_modules/eventemitter3/index.js"),s=I.n(l),n=I("./src/events.ts"),r=I("./src/errors.ts");function t(m,T){for(var y=0;y<T.length;y++){var f=T[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(m,f.key,f)}}function b(m,T,y){return T&&t(m.prototype,T),y&&t(m,y),m}var v=function(){m.isSupported=function(){return Object(h.isSupported)()};function m(y){y===void 0&&(y={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new l.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 f=this.config=Object(i.mergeConfig)(m.DefaultConfig,y);this.userConfig=y,Object(a.enableLogs)(f.debug),this._autoLevelCapping=-1,f.progressive&&Object(i.enableStreamingMode)(f);var u=f.abrController,o=f.bufferController,c=f.capLevelController,_=f.fpsController,p=this.abrController=new u(this),d=this.bufferController=new o(this),A=this.capLevelController=new c(this),D=new _(this),S=new R.default(this),L=new K.default(this),M=new N.default(this),O=this.levelController=new C.default(this),j=new E.FragmentTracker(this),G=this.streamController=new g.default(this,j);A.setStreamController(G),D.setStreamController(G);var X=[O,G];this.networkControllers=X;var ee=[S,L,p,d,A,D,M,j];this.audioTrackController=this.createController(f.audioTrackController,null,X),this.createController(f.audioStreamController,j,X),this.subtitleTrackController=this.createController(f.subtitleTrackController,null,X),this.createController(f.subtitleStreamController,j,X),this.createController(f.timelineController,null,ee),this.emeController=this.createController(f.emeController,null,ee),this.cmcdController=this.createController(f.cmcdController,null,ee),this.latencyController=this.createController(e.default,null,ee),this.coreComponents=ee}var T=m.prototype;return T.createController=function(f,u,o){if(f){var c=u?new f(this,u):new f(this);return o&&o.push(c),c}return null},T.on=function(f,u,o){o===void 0&&(o=this),this._emitter.on(f,u,o)},T.once=function(f,u,o){o===void 0&&(o=this),this._emitter.once(f,u,o)},T.removeAllListeners=function(f){this._emitter.removeAllListeners(f)},T.off=function(f,u,o,c){o===void 0&&(o=this),this._emitter.off(f,u,o,c)},T.listeners=function(f){return this._emitter.listeners(f)},T.emit=function(f,u,o){return this._emitter.emit(f,u,o)},T.trigger=function(f,u){if(this.config.debug)return this.emit(f,f,u);try{return this.emit(f,f,u)}catch(o){a.logger.error("An internal error happened while handling event "+f+'. Error message: "'+o.message+'". Here is a stacktrace:',o),this.trigger(n.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:f,error:o})}return!1},T.listenerCount=function(f){return this._emitter.listenerCount(f)},T.destroy=function(){a.logger.log("destroy"),this.trigger(n.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(f){return f.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(f){return f.destroy()}),this.coreComponents.length=0},T.attachMedia=function(f){a.logger.log("attachMedia"),this._media=f,this.trigger(n.Events.MEDIA_ATTACHING,{media:f})},T.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(n.Events.MEDIA_DETACHING,void 0),this._media=null},T.loadSource=function(f){this.stopLoad();var u=this.media,o=this.url,c=this.url=W.buildAbsoluteURL(self.location.href,f,{alwaysNormalize:!0});a.logger.log("loadSource:"+c),u&&o&&o!==c&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(u)),this.trigger(n.Events.MANIFEST_LOADING,{url:f})},T.startLoad=function(f){f===void 0&&(f=-1),a.logger.log("startLoad("+f+")"),this.networkControllers.forEach(function(u){u.startLoad(f)})},T.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(f){f.stopLoad()})},T.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},T.recoverMediaError=function(){a.logger.log("recoverMediaError");var f=this._media;this.detachMedia(),f&&this.attachMedia(f)},T.removeLevel=function(f,u){u===void 0&&(u=0),this.levelController.removeLevel(f,u)},b(m,[{key:"levels",get:function(){var f=this.levelController.levels;return f||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(f){a.logger.log("set currentLevel:"+f),this.loadLevel=f,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(f){a.logger.log("set nextLevel:"+f),this.levelController.manualLevel=f,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(f){a.logger.log("set loadLevel:"+f),this.levelController.manualLevel=f}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(f){this.levelController.nextLoadLevel=f}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(f){a.logger.log("set firstLevel:"+f),this.levelController.firstLevel=f}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(f){a.logger.log("set startLevel:"+f),f!==-1&&(f=Math.max(f,this.minAutoLevel)),this.levelController.startLevel=f}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(f){var u=!!f;u!==this.config.capLevelToPlayerSize&&(u?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=u)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(f){this._autoLevelCapping!==f&&(a.logger.log("set autoLevelCapping:"+f),this._autoLevelCapping=f)}},{key:"bandwidthEstimate",get:function(){var f=this.abrController.bwEstimator;return f?f.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var f=this.levels,u=this.config.minAutoBitrate;if(!f)return 0;for(var o=f.length,c=0;c<o;c++)if(f[c].maxBitrate>u)return c;return 0}},{key:"maxAutoLevel",get:function(){var f=this.levels,u=this.autoLevelCapping,o;return u===-1&&f&&f.length?o=f.length-1:o=u,o}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(f){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,f)}},{key:"audioTracks",get:function(){var f=this.audioTrackController;return f?f.audioTracks:[]}},{key:"audioTrack",get:function(){var f=this.audioTrackController;return f?f.audioTrack:-1},set:function(f){var u=this.audioTrackController;u&&(u.audioTrack=f)}},{key:"subtitleTracks",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var f=this.subtitleTrackController;return f?f.subtitleTrack:-1},set:function(f){var u=this.subtitleTrackController;u&&(u.subtitleTrack=f)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var f=this.subtitleTrackController;return f?f.subtitleDisplay:!1},set:function(f){var u=this.subtitleTrackController;u&&(u.subtitleDisplay=f)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(f){this.config.lowLatencyMode=f}},{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 n.Events}},{key:"ErrorTypes",get:function(){return r.ErrorTypes}},{key:"ErrorDetails",get:function(){return r.ErrorDetails}},{key:"DefaultConfig",get:function(){return m.defaultConfig?m.defaultConfig:i.hlsDefaultConfig},set:function(f){m.defaultConfig=f}}]),m}();v.defaultConfig=void 0},"./src/is-supported.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"isSupported",function(){return R}),I.d(H,"changeTypeSupported",function(){return K});var W=I("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var N=Object(W.getMediaSource)();if(!N)return!1;var e=P(),C=N&&typeof N.isTypeSupported=="function"&&N.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),E=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!C&&!!E}function K(){var N,e=P();return typeof(e==null||((N=e.prototype)===null||N===void 0)?void 0:N.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return a}),I.d(H,"LoadError",function(){return l});var W=I("./src/polyfills/number.ts"),P=I("./src/errors.ts");function R(s,n){s.prototype=Object.create(n.prototype),s.prototype.constructor=s,E(s,n)}function K(s){var n=typeof Map=="function"?new Map:void 0;return K=function(t){if(t===null||!C(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n!="undefined"){if(n.has(t))return n.get(t);n.set(t,b)}function b(){return N(t,arguments,g(this).constructor)}return b.prototype=Object.create(t.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E(b,t)},K(s)}function N(s,n,r){return e()?N=Reflect.construct:N=function(b,v,m){var T=[null];T.push.apply(T,v);var y=Function.bind.apply(b,T),f=new y;return m&&E(f,m.prototype),f},N.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 C(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function E(s,n){return E=Object.setPrototypeOf||function(t,b){return t.__proto__=b,t},E(s,n)}function g(s){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},g(s)}var h=Math.pow(2,17),a=function(){function s(r){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=r}var n=s.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(t,b){var v=this,m=t.url;if(!m)return Promise.reject(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(m?"part list":"url")));this.abort();var T=this.config,y=T.fLoader,f=T.loader;return new Promise(function(u,o){v.loader&&v.loader.destroy();var c=v.loader=t.loader=y?new y(T):new f(T),_=i(t),p={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:h};t.stats=c.stats,c.load(_,p,{onSuccess:function(A,D,S,L){v.resetLoader(t,c),u({frag:t,part:null,payload:A.data,networkDetails:L})},onError:function(A,D,S){v.resetLoader(t,c),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:A,networkDetails:S}))},onAbort:function(A,D,S){v.resetLoader(t,c),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:S}))},onTimeout:function(A,D,S){v.resetLoader(t,c),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:S}))},onProgress:function(A,D,S,L){b&&b({frag:t,part:null,payload:S,networkDetails:L})}})})},n.loadPart=function(t,b,v){var m=this;this.abort();var T=this.config,y=T.fLoader,f=T.loader;return new Promise(function(u,o){m.loader&&m.loader.destroy();var c=m.loader=t.loader=y?new y(T):new f(T),_=i(t,b),p={timeout:T.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:T.fragLoadingMaxRetryTimeout,highWaterMark:h};b.stats=c.stats,c.load(_,p,{onSuccess:function(A,D,S,L){m.resetLoader(t,c),m.updateStatsFromPart(t,b);var M={frag:t,part:b,payload:A.data,networkDetails:L};v(M),u(M)},onError:function(A,D,S){m.resetLoader(t,c),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:b,response:A,networkDetails:S}))},onAbort:function(A,D,S){t.stats.aborted=b.stats.aborted,m.resetLoader(t,c),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:b,networkDetails:S}))},onTimeout:function(A,D,S){m.resetLoader(t,c),o(new l({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:b,networkDetails:S}))}})})},n.updateStatsFromPart=function(t,b){var v=t.stats,m=b.stats,T=m.total;if(v.loaded+=m.loaded,T){var y=Math.round(t.duration/b.duration),f=Math.min(Math.round(v.loaded/T),y),u=y-f,o=u*Math.round(v.loaded/f);v.total=v.loaded+o}else v.total=Math.max(v.loaded,v.total);var c=v.loading,_=m.loading;c.start?c.first+=_.first-_.start:(c.start=_.start,c.first=_.first),c.end=_.end},n.resetLoader=function(t,b){t.loader=null,this.loader===b&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),b.destroy()},s}();function i(s,n){n===void 0&&(n=null);var r=n||s,t={frag:s,part:n,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},b=r.byteRangeStartOffset,v=r.byteRangeEndOffset;return Object(W.isFiniteNumber)(b)&&Object(W.isFiniteNumber)(v)&&(t.rangeStart=b,t.rangeEnd=v),t}var l=function(s){R(n,s);function n(r){for(var t,b=arguments.length,v=new Array(b>1?b-1:0),m=1;m<b;m++)v[m-1]=arguments[m];return t=s.call.apply(s,[this].concat(v))||this,t.data=void 0,t.data=r,t}return n}(K(Error))},"./src/loader/fragment.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"ElementaryStreamTypes",function(){return a}),I.d(H,"BaseSegment",function(){return i}),I.d(H,"Fragment",function(){return l}),I.d(H,"Part",function(){return s});var W=I("./src/polyfills/number.ts"),P=I("./node_modules/url-toolkit/src/url-toolkit.js"),R=I.n(P),K=I("./src/utils/logger.ts"),N=I("./src/loader/level-key.ts"),e=I("./src/loader/load-stats.ts");function C(n,r){n.prototype=Object.create(r.prototype),n.prototype.constructor=n,E(n,r)}function E(n,r){return E=Object.setPrototypeOf||function(b,v){return b.__proto__=v,b},E(n,r)}function g(n,r){for(var t=0;t<r.length;t++){var b=r[t];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(n,b.key,b)}}function h(n,r,t){return r&&g(n.prototype,r),t&&g(n,t),n}var a;(function(n){n.AUDIO="audio",n.VIDEO="video",n.AUDIOVIDEO="audiovideo"})(a||(a={}));var i=function(){function n(t){var b;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(b={},b[a.AUDIO]=null,b[a.VIDEO]=null,b[a.AUDIOVIDEO]=null,b),this.baseurl=t}var r=n.prototype;return r.setByteRange=function(b,v){var m=b.split("@",2),T=[];m.length===1?T[0]=v?v.byteRangeEndOffset:0:T[0]=parseInt(m[1]),T[1]=parseInt(m[0])+T[0],this._byteRange=T},h(n,[{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(P.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(b){this._url=b}}]),n}(),l=function(n){C(r,n);function r(b,v){var m;return m=n.call(this,v)||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=b,m}var t=r.prototype;return t.createInitializationVector=function(v){for(var m=new Uint8Array(16),T=12;T<16;T++)m[T]=v>>8*(15-T)&255;return m},t.setDecryptDataFromLevelKey=function(v,m){var T=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(T=N.LevelKey.fromURI(v.uri),T.method=v.method,T.iv=this.createInitializationVector(m),T.keyFormat="identity"),T},t.setElementaryStreamInfo=function(v,m,T,y,f,u){u===void 0&&(u=!1);var o=this.elementaryStreams,c=o[v];if(!c){o[v]={startPTS:m,endPTS:T,startDTS:y,endDTS:f,partial:u};return}c.startPTS=Math.min(c.startPTS,m),c.endPTS=Math.max(c.endPTS,T),c.startDTS=Math.min(c.startDTS,y),c.endDTS=Math.max(c.endDTS,f)},t.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[a.AUDIO]=null,v[a.VIDEO]=null,v[a.AUDIOVIDEO]=null},h(r,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(W.isFiniteNumber)(this.programDateTime))return null;var v=Object(W.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),r}(i),s=function(n){C(r,n);function r(t,b,v,m,T){var y;y=n.call(this,v)||this,y.fragOffset=0,y.duration=0,y.gap=!1,y.independent=!1,y.relurl=void 0,y.fragment=void 0,y.index=void 0,y.stats=new e.LoadStats,y.duration=t.decimalFloatingPoint("DURATION"),y.gap=t.bool("GAP"),y.independent=t.bool("INDEPENDENT"),y.relurl=t.enumeratedString("URI"),y.fragment=b,y.index=m;var f=t.enumeratedString("BYTERANGE");return f&&y.setByteRange(f,T),T&&(y.fragOffset=T.fragOffset+T.duration),y}return h(r,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var b=this.elementaryStreams;return!!(b.audio||b.video||b.audiovideo)}}]),r}(i)},"./src/loader/key-loader.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return K});var W=I("./src/events.ts"),P=I("./src/errors.ts"),R=I("./src/utils/logger.ts"),K=function(){function N(C){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=C,this._registerListeners()}var e=N.prototype;return e._registerListeners=function(){this.hls.on(W.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(W.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var E in this.loaders){var g=this.loaders[E];g&&g.destroy()}this.loaders={}},e.onKeyLoading=function(E,g){var h=g.frag,a=h.type,i=this.loaders[a];if(!h.decryptdata){R.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=h.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(i&&(R.logger.warn("abort previous key loader for type:"+a),i.abort()),!l){R.logger.warn("key uri is falsy");return}var n=s.loader,r=h.loader=this.loaders[a]=new n(s);this.decrypturl=l,this.decryptkey=null;var t={url:l,frag:h,responseType:"arraybuffer"},b={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};r.load(t,b,v)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(W.Events.KEY_LOADED,{frag:h}))},e.loadsuccess=function(E,g,h){var a=h.frag;if(!a.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(E.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(W.Events.KEY_LOADED,{frag:a})},e.loaderror=function(E,g){var h=g.frag,a=h.loader;a&&a.abort(),delete this.loaders[h.type],this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:h,response:E})},e.loadtimeout=function(E,g){var h=g.frag,a=h.loader;a&&a.abort(),delete this.loaders[h.type],this.hls.trigger(W.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},N}()},"./src/loader/level-details.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"LevelDetails",function(){return N});var W=I("./src/polyfills/number.ts");function P(e,C){for(var E=0;E<C.length;E++){var g=C[E];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(e,g.key,g)}}function R(e,C,E){return C&&P(e.prototype,C),E&&P(e,E),e}var K=10,N=function(){function e(E){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=E}var C=e.prototype;return C.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var h=this.lastPartSn-g.lastPartSn,a=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!a||!!h,this.advanced=this.endSN>g.endSN||h>0||h===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},R(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(W.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var h=this.driftEnd-this.driftStart;return h*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.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 g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"LevelKey",function(){return N});var W=I("./node_modules/url-toolkit/src/url-toolkit.js"),P=I.n(W);function R(e,C){for(var E=0;E<C.length;E++){var g=C[E];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(e,g.key,g)}}function K(e,C,E){return C&&R(e.prototype,C),E&&R(e,E),e}var N=function(){e.fromURL=function(E,g){return new e(E,g)},e.fromURI=function(E){return new e(E)};function e(C,E){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,E?this._uri=Object(W.buildAbsoluteURL)(C,E,{alwaysNormalize:!0}):this._uri=C}return K(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"LoadStats",function(){return W});var W=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(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return r});var W=I("./src/polyfills/number.ts"),P=I("./node_modules/url-toolkit/src/url-toolkit.js"),R=I.n(P),K=I("./src/loader/fragment.ts"),N=I("./src/loader/level-details.ts"),e=I("./src/loader/level-key.ts"),C=I("./src/utils/attr-list.ts"),E=I("./src/utils/logger.ts"),g=I("./src/utils/codecs.ts"),h=/#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"),l=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 n(T){var y,f;return s.test((y=(f=P.parseURL(T))===null||f===void 0?void 0:f.path)!=null?y:"")}var r=function(){function T(){}return T.findGroup=function(f,u){for(var o=0;o<f.length;o++){var c=f[o];if(c.id===u)return c}},T.convertAVC1ToAVCOTI=function(f){var u=f.split(".");if(u.length>2){var o=u.shift()+".";return o+=parseInt(u.shift()).toString(16),o+=("000"+parseInt(u.shift()).toString(16)).substr(-4),o}return f},T.resolve=function(f,u){return P.buildAbsoluteURL(u,f,{alwaysNormalize:!0})},T.parseMasterPlaylist=function(f,u){var o=[],c={},_=!1;h.lastIndex=0;for(var p;(p=h.exec(f))!=null;)if(p[1]){var d=new C.AttrList(p[1]),A={attrs:d,bitrate:d.decimalInteger("AVERAGE-BANDWIDTH")||d.decimalInteger("BANDWIDTH"),name:d.NAME,url:T.resolve(p[2],u)},D=d.decimalResolution("RESOLUTION");D&&(A.width=D.width,A.height=D.height),t((d.CODECS||"").split(/[ ,]+/).filter(function(L){return L}),A),A.videoCodec&&A.videoCodec.indexOf("avc1")!==-1&&(A.videoCodec=T.convertAVC1ToAVCOTI(A.videoCodec)),o.push(A)}else if(p[3]){var S=new C.AttrList(p[3]);S["DATA-ID"]&&(_=!0,c[S["DATA-ID"]]=S)}return{levels:o,sessionData:_?c:null}},T.parseMasterPlaylistMedia=function(f,u,o,c){c===void 0&&(c=[]);var _,p=[],d=0;for(a.lastIndex=0;(_=a.exec(f))!==null;){var A=new C.AttrList(_[1]);if(A.TYPE===o){var D={attrs:A,bitrate:0,id:d++,groupId:A["GROUP-ID"],instreamId:A["INSTREAM-ID"],name:A.NAME||A.LANGUAGE||"",type:o,default:A.bool("DEFAULT"),autoselect:A.bool("AUTOSELECT"),forced:A.bool("FORCED"),lang:A.LANGUAGE,url:A.URI?T.resolve(A.URI,u):""};if(c.length){var S=T.findGroup(c,D.groupId)||c[0];b(D,S,"audioCodec"),b(D,S,"textCodec")}p.push(D)}}return p},T.parseLevelPlaylist=function(f,u,o,c,_){var p=new N.LevelDetails(u),d=p.fragments,A=null,D=0,S=0,L=0,M=0,O=null,j=new K.Fragment(c,u),G,X,ee,he=-1,ge=!1;for(i.lastIndex=0,p.m3u8=f;(G=i.exec(f))!==null;){ge&&(ge=!1,j=new K.Fragment(c,u),j.start=L,j.sn=D,j.cc=M,j.level=o,A&&(j.initSegment=A,j.rawProgramDateTime=A.rawProgramDateTime));var de=G[1];if(de){j.duration=parseFloat(de);var Te=(" "+G[2]).slice(1);j.title=Te||null,j.tagList.push(Te?["INF",de,Te]:["INF",de])}else if(G[3])Object(W.isFiniteNumber)(j.duration)&&(j.start=L,ee&&(j.levelkey=ee),j.sn=D,j.level=o,j.cc=M,j.urlId=_,d.push(j),j.relurl=(" "+G[3]).slice(1),m(j,O),O=j,L+=j.duration,D++,S=0,ge=!0);else if(G[4]){var xe=(" "+G[4]).slice(1);O?j.setByteRange(xe,O):j.setByteRange(xe)}else if(G[5])j.rawProgramDateTime=(" "+G[5]).slice(1),j.tagList.push(["PROGRAM-DATE-TIME",j.rawProgramDateTime]),he===-1&&(he=d.length);else{if(G=G[0].match(l),!G){E.logger.warn("No matches on slow regex match for level playlist!");continue}for(X=1;X<G.length&&!(typeof G[X]!="undefined");X++);var ce=(" "+G[X]).slice(1),ae=(" "+G[X+1]).slice(1),Le=G[X+2]?(" "+G[X+2]).slice(1):"";switch(ce){case"PLAYLIST-TYPE":p.type=ae.toUpperCase();break;case"MEDIA-SEQUENCE":D=p.startSN=parseInt(ae);break;case"SKIP":{var Ye=new C.AttrList(ae),Fe=Ye.decimalInteger("SKIPPED-SEGMENTS");if(Object(W.isFiniteNumber)(Fe)){p.skippedSegments=Fe;for(var We=Fe;We--;)d.unshift(null);D+=Fe}var be=Ye.enumeratedString("RECENTLY-REMOVED-DATERANGES");be&&(p.recentlyRemovedDateranges=be.split(" "));break}case"TARGETDURATION":p.targetduration=parseFloat(ae);break;case"VERSION":p.version=parseInt(ae);break;case"EXTM3U":break;case"ENDLIST":p.live=!1;break;case"#":(ae||Le)&&j.tagList.push(Le?[ae,Le]:[ae]);break;case"DIS":M++;case"GAP":j.tagList.push([ce]);break;case"BITRATE":j.tagList.push([ce,ae]);break;case"DISCONTINUITY-SEQ":M=parseInt(ae);break;case"KEY":{var Ee,Ae=new C.AttrList(ae),Ie=Ae.enumeratedString("METHOD"),$=Ae.URI,se=Ae.hexadecimalInteger("IV"),ue=Ae.enumeratedString("KEYFORMATVERSIONS"),pe=Ae.enumeratedString("KEYID"),Se=(Ee=Ae.enumeratedString("KEYFORMAT"))!=null?Ee:"identity",Pe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Pe.indexOf(Se)>-1){E.logger.warn("Keyformat "+Se+" is not supported from the manifest");continue}else if(Se!=="identity")continue;Ie&&(ee=e.LevelKey.fromURL(u,$),$&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ie)>=0&&(ee.method=Ie,ee.keyFormat=Se,pe&&(ee.keyID=pe),ue&&(ee.keyFormatVersions=ue),ee.iv=se));break}case"START":{var De=new C.AttrList(ae),ke=De.decimalFloatingPoint("TIME-OFFSET");Object(W.isFiniteNumber)(ke)&&(p.startTimeOffset=ke);break}case"MAP":{var Be=new C.AttrList(ae);j.relurl=Be.URI,Be.BYTERANGE&&j.setByteRange(Be.BYTERANGE),j.level=o,j.sn="initSegment",ee&&(j.levelkey=ee),j.initSegment=null,A=j,ge=!0;break}case"SERVER-CONTROL":{var Ke=new C.AttrList(ae);p.canBlockReload=Ke.bool("CAN-BLOCK-RELOAD"),p.canSkipUntil=Ke.optionalFloat("CAN-SKIP-UNTIL",0),p.canSkipDateRanges=p.canSkipUntil>0&&Ke.bool("CAN-SKIP-DATERANGES"),p.partHoldBack=Ke.optionalFloat("PART-HOLD-BACK",0),p.holdBack=Ke.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var oe=new C.AttrList(ae);p.partTarget=oe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var me=p.partList;me||(me=p.partList=[]);var _e=S>0?me[me.length-1]:void 0,we=S++,fe=new K.Part(new C.AttrList(ae),j,u,we,_e);me.push(fe),j.duration+=fe.duration;break}case"PRELOAD-HINT":{var ye=new C.AttrList(ae);p.preloadHint=ye;break}case"RENDITION-REPORT":{var re=new C.AttrList(ae);p.renditionReports=p.renditionReports||[],p.renditionReports.push(re);break}default:E.logger.warn("line parsed but not handled: "+G);break}}}O&&!O.relurl?(d.pop(),L-=O.duration,p.partList&&(p.fragmentHint=O)):p.partList&&(m(j,O),j.cc=M,p.fragmentHint=j);var Z=d.length,J=d[0],V=d[Z-1];if(L+=p.skippedSegments*p.targetduration,L>0&&Z&&V){p.averagetargetduration=L/Z;var Y=V.sn;p.endSN=Y!=="initSegment"?Y:0,J&&(p.startCC=J.cc,J.initSegment||p.fragments.every(function(q){return q.relurl&&n(q.relurl)})&&(E.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),j=new K.Fragment(c,u),j.relurl=V.relurl,j.level=o,j.sn="initSegment",J.initSegment=j,p.needSidxRanges=!0))}else p.endSN=0,p.startCC=0;return p.fragmentHint&&(L+=p.fragmentHint.duration),p.totalduration=L,p.endCC=M,he>0&&v(d,he),p},T}();function t(T,y){["video","audio","text"].forEach(function(f){var u=T.filter(function(c){return Object(g.isCodecType)(c,f)});if(u.length){var o=u.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});y[f+"Codec"]=o.length>0?o[0]:u[0],T=T.filter(function(c){return u.indexOf(c)===-1})}}),y.unknownCodecs=T}function b(T,y,f){var u=y[f];u&&(T[f]=u)}function v(T,y){for(var f=T[y],u=y;u--;){var o=T[u];if(!o)return;o.programDateTime=f.programDateTime-o.duration*1e3,f=o}}function m(T,y){T.rawProgramDateTime?T.programDateTime=Date.parse(T.rawProgramDateTime):y!=null&&y.programDateTime&&(T.programDateTime=y.endProgramDateTime),Object(W.isFiniteNumber)(T.programDateTime)||(T.programDateTime=null,T.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/polyfills/number.ts"),P=I("./src/events.ts"),R=I("./src/errors.ts"),K=I("./src/utils/logger.ts"),N=I("./src/utils/mp4-tools.ts"),e=I("./src/loader/m3u8-parser.ts"),C=I("./src/types/loader.ts"),E=I("./src/utils/attr-list.ts");function g(i){var l=i.type;switch(l){case C.PlaylistContextType.AUDIO_TRACK:return C.PlaylistLevelType.AUDIO;case C.PlaylistContextType.SUBTITLE_TRACK:return C.PlaylistLevelType.SUBTITLE;default:return C.PlaylistLevelType.MAIN}}function h(i,l){var s=i.url;return(s===void 0||s.indexOf("data:")===0)&&(s=l.url),s}var a=function(){function i(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var l=i.prototype;return l.registerListeners=function(){var n=this.hls;n.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),n.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var n=this.hls;n.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),n.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),n.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(n){var r=this.hls.config,t=r.pLoader,b=r.loader,v=t||b,m=new v(r);return n.loader=m,this.loaders[n.type]=m,m},l.getInternalLoader=function(n){return this.loaders[n.type]},l.resetInternalLoader=function(n){this.loaders[n]&&delete this.loaders[n]},l.destroyInternalLoaders=function(){for(var n in this.loaders){var r=this.loaders[n];r&&r.destroy(),this.resetInternalLoader(n)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(n,r){var t=r.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:C.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},l.onLevelLoading=function(n,r){var t=r.id,b=r.level,v=r.url,m=r.deliveryDirectives;this.load({id:t,groupId:null,level:b,responseType:"text",type:C.PlaylistContextType.LEVEL,url:v,deliveryDirectives:m})},l.onAudioTrackLoading=function(n,r){var t=r.id,b=r.groupId,v=r.url,m=r.deliveryDirectives;this.load({id:t,groupId:b,level:null,responseType:"text",type:C.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:m})},l.onSubtitleTrackLoading=function(n,r){var t=r.id,b=r.groupId,v=r.url,m=r.deliveryDirectives;this.load({id:t,groupId:b,level:null,responseType:"text",type:C.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:m})},l.load=function(n){var r,t=this.hls.config,b=this.getInternalLoader(n);if(b){var v=b.context;if(v&&v.url===n.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+n.type),b.abort()}var m,T,y,f;switch(n.type){case C.PlaylistContextType.MANIFEST:m=t.manifestLoadingMaxRetry,T=t.manifestLoadingTimeOut,y=t.manifestLoadingRetryDelay,f=t.manifestLoadingMaxRetryTimeout;break;case C.PlaylistContextType.LEVEL:case C.PlaylistContextType.AUDIO_TRACK:case C.PlaylistContextType.SUBTITLE_TRACK:m=0,T=t.levelLoadingTimeOut;break;default:m=t.levelLoadingMaxRetry,T=t.levelLoadingTimeOut,y=t.levelLoadingRetryDelay,f=t.levelLoadingMaxRetryTimeout;break}if(b=this.createInternalLoader(n),(r=n.deliveryDirectives)!==null&&r!==void 0&&r.part){var u;if(n.type===C.PlaylistContextType.LEVEL&&n.level!==null?u=this.hls.levels[n.level].details:n.type===C.PlaylistContextType.AUDIO_TRACK&&n.id!==null?u=this.hls.audioTracks[n.id].details:n.type===C.PlaylistContextType.SUBTITLE_TRACK&&n.id!==null&&(u=this.hls.subtitleTracks[n.id].details),u){var o=u.partTarget,c=u.targetduration;o&&c&&(T=Math.min(Math.max(o*3,c*.8)*1e3,T))}}var _={timeout:T,maxRetry:m,retryDelay:y,maxRetryDelay:f,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};b.load(n,_,p)},l.loadsuccess=function(n,r,t,b){if(b===void 0&&(b=null),t.isSidxRequest){this.handleSidxRequest(n,t),this.handlePlaylistLoaded(n,r,t,b);return}this.resetInternalLoader(t.type);var v=n.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(n,t,"no EXTM3U delimiter",b);return}r.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(n,r,t,b):this.handleMasterPlaylist(n,r,t,b)},l.loaderror=function(n,r,t){t===void 0&&(t=null),this.handleNetworkError(r,t,!1,n)},l.loadtimeout=function(n,r,t){t===void 0&&(t=null),this.handleNetworkError(r,t,!0)},l.handleMasterPlaylist=function(n,r,t,b){var v=this.hls,m=n.data,T=h(n,t),y=e.default.parseMasterPlaylist(m,T),f=y.levels,u=y.sessionData;if(!f.length){this.handleManifestParsingError(n,t,"no level found in manifest",b);return}var o=f.map(function(D){return{id:D.attrs.AUDIO,audioCodec:D.audioCodec}}),c=f.map(function(D){return{id:D.attrs.SUBTITLES,textCodec:D.textCodec}}),_=e.default.parseMasterPlaylistMedia(m,T,"AUDIO",o),p=e.default.parseMasterPlaylistMedia(m,T,"SUBTITLES",c),d=e.default.parseMasterPlaylistMedia(m,T,"CLOSED-CAPTIONS");if(_.length){var A=_.some(function(D){return!D.url});!A&&f[0].audioCodec&&!f[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new E.AttrList({}),bitrate:0,url:""}))}v.trigger(P.Events.MANIFEST_LOADED,{levels:f,audioTracks:_,subtitles:p,captions:d,url:T,stats:r,networkDetails:b,sessionData:u})},l.handleTrackOrLevelPlaylist=function(n,r,t,b){var v=this.hls,m=t.id,T=t.level,y=t.type,f=h(n,t),u=Object(W.isFiniteNumber)(m)?m:0,o=Object(W.isFiniteNumber)(T)?T:u,c=g(t),_=e.default.parseLevelPlaylist(n.data,f,o,c,u);if(!_.fragments.length){v.trigger(P.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:f,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(y===C.PlaylistContextType.MANIFEST){var p={attrs:new E.AttrList({}),bitrate:0,details:_,name:"",url:f};v.trigger(P.Events.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:f,stats:r,networkDetails:b,sessionData:null})}if(r.parsing.end=performance.now(),_.needSidxRanges){var d,A=(d=_.fragments[0].initSegment)===null||d===void 0?void 0:d.url;this.load({url:A,isSidxRequest:!0,type:y,level:T,levelDetails:_,id:m,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=_,this.handlePlaylistLoaded(n,r,t,b)},l.handleSidxRequest=function(n,r){var t=Object(N.parseSegmentIndex)(new Uint8Array(n.data));if(!t)return;var b=t.references,v=r.levelDetails;b.forEach(function(m,T){var y=m.info,f=v.fragments[T];f.byteRange.length===0&&f.setByteRange(String(1+y.end-y.start)+"@"+String(y.start)),f.initSegment&&f.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(n,r,t,b){this.hls.trigger(P.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:r.type===C.PlaylistContextType.MANIFEST,url:n.url,reason:t,response:n,context:r,networkDetails:b})},l.handleNetworkError=function(n,r,t,b){t===void 0&&(t=!1),K.logger.warn("[playlist-loader]: A network "+(t?"timeout":"error")+" occurred while loading "+n.type+" level: "+n.level+" id: "+n.id+' group-id: "'+n.groupId+'"');var v=R.ErrorDetails.UNKNOWN,m=!1,T=this.getInternalLoader(n);switch(n.type){case C.PlaylistContextType.MANIFEST:v=t?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,m=!0;break;case C.PlaylistContextType.LEVEL:v=t?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,m=!1;break;case C.PlaylistContextType.AUDIO_TRACK:v=t?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,m=!1;break;case C.PlaylistContextType.SUBTITLE_TRACK:v=t?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,m=!1;break}T&&this.resetInternalLoader(n.type);var y={type:R.ErrorTypes.NETWORK_ERROR,details:v,fatal:m,url:n.url,loader:T,context:n,networkDetails:r};b&&(y.response=b),this.hls.trigger(P.Events.ERROR,y)},l.handlePlaylistLoaded=function(n,r,t,b){var v=t.type,m=t.level,T=t.id,y=t.groupId,f=t.loader,u=t.levelDetails,o=t.deliveryDirectives;if(!(u!=null&&u.targetduration)){this.handleManifestParsingError(n,t,"invalid target duration",b);return}if(!f)return;u.live&&(f.getCacheAge&&(u.ageHeader=f.getCacheAge()||0),(!f.getCacheAge||isNaN(u.ageHeader))&&(u.ageHeader=0));switch(v){case C.PlaylistContextType.MANIFEST:case C.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:u,level:m||0,id:T||0,stats:r,networkDetails:b,deliveryDirectives:o});break;case C.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:u,id:T||0,groupId:y||"",stats:r,networkDetails:b,deliveryDirectives:o});break;case C.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:u,id:T||0,groupId:y||"",stats:r,networkDetails:b,deliveryDirectives:o});break}},i}();H.default=a},"./src/polyfills/number.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"isFiniteNumber",function(){return W}),I.d(H,"MAX_SAFE_INTEGER",function(){return P});var W=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Q,H,I){"use strict";I.r(H);var W=function(){function P(){}return P.getSilentFrame=function(K,N){switch(K){case"mp4a.40.2":if(N===1)return new Uint8Array([0,200,0,128,35,128]);if(N===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(N===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(N===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(N===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(N===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(N===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(N===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(N===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},P}();H.default=W},"./src/remux/mp4-generator.ts":function(Q,H,I){"use strict";I.r(H);var W=Math.pow(2,32)-1,P=function(){function R(){}return R.init=function(){R.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 N;for(N in R.types)R.types.hasOwnProperty(N)&&(R.types[N]=[N.charCodeAt(0),N.charCodeAt(1),N.charCodeAt(2),N.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]),C=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]);R.HDLR_TYPES={video:e,audio:C};var E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),g=new Uint8Array([0,0,0,0,0,0,0,0]);R.STTS=R.STSC=R.STCO=g,R.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),R.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),R.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var h=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,h,i,h,a),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,E))},R.box=function(N){for(var e=8,C=arguments.length,E=new Array(C>1?C-1:0),g=1;g<C;g++)E[g-1]=arguments[g];for(var h=E.length,a=h;h--;)e+=E[h].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(N,4),h=0,e=8;h<a;h++)i.set(E[h],e),e+=E[h].byteLength;return i},R.hdlr=function(N){return R.box(R.types.hdlr,R.HDLR_TYPES[N])},R.mdat=function(N){return R.box(R.types.mdat,N)},R.mdhd=function(N,e){e*=N;var C=Math.floor(e/(W+1)),E=Math.floor(e%(W+1));return R.box(R.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,C>>24,C>>16&255,C>>8&255,C&255,E>>24,E>>16&255,E>>8&255,E&255,85,196,0,0]))},R.mdia=function(N){return R.box(R.types.mdia,R.mdhd(N.timescale,N.duration),R.hdlr(N.type),R.minf(N))},R.mfhd=function(N){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,N>>24,N>>16&255,N>>8&255,N&255]))},R.minf=function(N){return N.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(N)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(N))},R.moof=function(N,e,C){return R.box(R.types.moof,R.mfhd(N),R.traf(C,e))},R.moov=function(N){for(var e=N.length,C=[];e--;)C[e]=R.trak(N[e]);return R.box.apply(null,[R.types.moov,R.mvhd(N[0].timescale,N[0].duration)].concat(C).concat(R.mvex(N)))},R.mvex=function(N){for(var e=N.length,C=[];e--;)C[e]=R.trex(N[e]);return R.box.apply(null,[R.types.mvex].concat(C))},R.mvhd=function(N,e){e*=N;var C=Math.floor(e/(W+1)),E=Math.floor(e%(W+1)),g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,C>>24,C>>16&255,C>>8&255,C&255,E>>24,E>>16&255,E>>8&255,E&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 R.box(R.types.mvhd,g)},R.sdtp=function(N){var e=N.samples||[],C=new Uint8Array(4+e.length),E,g;for(E=0;E<e.length;E++)g=e[E].flags,C[E+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return R.box(R.types.sdtp,C)},R.stbl=function(N){return R.box(R.types.stbl,R.stsd(N),R.box(R.types.stts,R.STTS),R.box(R.types.stsc,R.STSC),R.box(R.types.stsz,R.STSZ),R.box(R.types.stco,R.STCO))},R.avc1=function(N){var e=[],C=[],E,g,h;for(E=0;E<N.sps.length;E++)g=N.sps[E],h=g.byteLength,e.push(h>>>8&255),e.push(h&255),e=e.concat(Array.prototype.slice.call(g));for(E=0;E<N.pps.length;E++)g=N.pps[E],h=g.byteLength,C.push(h>>>8&255),C.push(h&255),C=C.concat(Array.prototype.slice.call(g));var a=R.box(R.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|N.sps.length].concat(e).concat([N.pps.length]).concat(C))),i=N.width,l=N.height,s=N.pixelRatio[0],n=N.pixelRatio[1];return R.box(R.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,l>>8&255,l&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,R.box(R.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),R.box(R.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,n>>24,n>>16&255,n>>8&255,n&255])))},R.esds=function(N){var e=N.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(N.config).concat([6,1,2]))},R.mp4a=function(N){var e=N.samplerate;return R.box(R.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),R.box(R.types.esds,R.esds(N)))},R.mp3=function(N){var e=N.samplerate;return R.box(R.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},R.stsd=function(N){return N.type==="audio"?!N.isAAC&&N.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(N)):R.box(R.types.stsd,R.STSD,R.mp4a(N)):R.box(R.types.stsd,R.STSD,R.avc1(N))},R.tkhd=function(N){var e=N.id,C=N.duration*N.timescale,E=N.width,g=N.height,h=Math.floor(C/(W+1)),a=Math.floor(C%(W+1));return R.box(R.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,h>>24,h>>16&255,h>>8&255,h&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,E>>8&255,E&255,0,0,g>>8&255,g&255,0,0]))},R.traf=function(N,e){var C=R.sdtp(N),E=N.id,g=Math.floor(e/(W+1)),h=Math.floor(e%(W+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,E>>24,E>>16&255,E>>8&255,E&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,h>>24,h>>16&255,h>>8&255,h&255])),R.trun(N,C.length+16+20+8+16+8+8),C)},R.trak=function(N){return N.duration=N.duration||4294967295,R.box(R.types.trak,R.tkhd(N),R.mdia(N))},R.trex=function(N){var e=N.id;return R.box(R.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]))},R.trun=function(N,e){var C=N.samples||[],E=C.length,g=12+16*E,h=new Uint8Array(g),a,i,l,s,n,r;for(e+=8+g,h.set([0,0,15,1,E>>>24&255,E>>>16&255,E>>>8&255,E&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),a=0;a<E;a++)i=C[a],l=i.duration,s=i.size,n=i.flags,r=i.cts,h.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,n.isLeading<<2|n.dependsOn,n.isDependedOn<<6|n.hasRedundancy<<4|n.paddingValue<<1|n.isNonSync,n.degradPrio&240<<8,n.degradPrio&15,r>>>24&255,r>>>16&255,r>>>8&255,r&255],12+16*a);return R.box(R.types.trun,h)},R.initSegment=function(N){R.types||R.init();var e=R.moov(N),C=new Uint8Array(R.FTYP.byteLength+e.byteLength);return C.set(R.FTYP),C.set(e,R.FTYP.byteLength),C},R}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,H.default=P},"./src/remux/mp4-remuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return r}),I.d(H,"normalizePts",function(){return t});var W=I("./src/polyfills/number.ts"),P=I("./src/remux/aac-helper.ts"),R=I("./src/remux/mp4-generator.ts"),K=I("./src/events.ts"),N=I("./src/errors.ts"),e=I("./src/utils/logger.ts"),C=I("./src/types/loader.ts"),E=I("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(T){for(var y=1;y<arguments.length;y++){var f=arguments[y];for(var u in f)Object.prototype.hasOwnProperty.call(f,u)&&(T[u]=f[u])}return T},g.apply(this,arguments)}var h=10*1e3,a=1024,i=1152,l=null,s=null,n=!1,r=function(){function T(f,u,o,c){if(c===void 0&&(c=""),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=f,this.config=u,this.typeSupported=o,this.ISGenerated=!1,l===null){var _=navigator.userAgent||"",p=_.match(/Chrome\/(\d+)/i);l=p?parseInt(p[1]):0}if(s===null){var d=navigator.userAgent.match(/Safari\/(\d+)/i);s=d?parseInt(d[1]):0}n=!!l&&l<75||!!s&&s<600}var y=T.prototype;return y.destroy=function(){},y.resetTimeStamp=function(u){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=u},y.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},y.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},y.getVideoStartPts=function(u){var o=!1,c=u.reduce(function(_,p){var d=p.pts-_;return d<-4294967296?(o=!0,t(_,p.pts)):d>0?_:p.pts},u[0].pts);return o&&e.logger.debug("PTS rollover detected"),c},y.remux=function(u,o,c,_,p,d,A,D){var S,L,M,O,j,G,X=p,ee=p,he=u.pid>-1,ge=o.pid>-1,de=o.samples.length,Te=u.samples.length>0,xe=de>1,ce=(!he||Te)&&(!ge||xe)||this.ISGenerated||A;if(ce){this.ISGenerated||(M=this.generateIS(u,o,p));var ae=this.isVideoContiguous,Le=-1;if(xe&&(Le=b(o.samples),!ae&&this.config.forceKeyFrameOnDiscontinuity))if(G=!0,Le>0){e.logger.warn("[mp4-remuxer]: Dropped "+Le+" out of "+de+" video samples due to a missing keyframe");var Ye=this.getVideoStartPts(o.samples);o.samples=o.samples.slice(Le),o.dropped+=Le,ee+=(o.samples[0].pts-Ye)/(o.timescale||9e4)}else Le===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+de+" video samples"),G=!1);if(this.ISGenerated){if(Te&&xe){var Fe=this.getVideoStartPts(o.samples),We=t(u.samples[0].pts,Fe)-Fe,be=We/o.inputTimeScale;X+=Math.max(0,be),ee+=Math.max(0,-be)}if(Te){if(u.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),M=this.generateIS(u,o,p)),L=this.remuxAudio(u,X,this.isAudioContiguous,d,ge||xe||D===C.PlaylistLevelType.AUDIO?ee:void 0),xe){var Ee=L?L.endPTS-L.startPTS:0;o.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),M=this.generateIS(u,o,p)),S=this.remuxVideo(o,ee,ae,Ee)}}else xe&&(S=this.remuxVideo(o,ee,ae,0));S&&(S.firstKeyFrame=Le,S.independent=Le!==-1)}}return this.ISGenerated&&(c.samples.length&&(j=this.remuxID3(c,p)),_.samples.length&&(O=this.remuxText(_,p))),{audio:L,video:S,initSegment:M,independent:G,text:O,id3:j}},y.generateIS=function(u,o,c){var _=u.samples,p=o.samples,d=this.typeSupported,A={},D=!Object(W.isFiniteNumber)(this._initPTS),S="audio/mp4",L,M,O;if(D&&(L=M=Infinity),u.config&&_.length&&(u.timescale=u.samplerate,u.isAAC||(d.mpeg?(S="audio/mpeg",u.codec=""):d.mp3&&(u.codec="mp3")),A.audio={id:"audio",container:S,codec:u.codec,initSegment:!u.isAAC&&d.mpeg?new Uint8Array(0):R.default.initSegment([u]),metadata:{channelCount:u.channelCount}},D&&(O=u.inputTimeScale,L=M=_[0].pts-Math.round(O*c))),o.sps&&o.pps&&p.length&&(o.timescale=o.inputTimeScale,A.video={id:"main",container:"video/mp4",codec:o.codec,initSegment:R.default.initSegment([o]),metadata:{width:o.width,height:o.height}},D)){O=o.inputTimeScale;var j=this.getVideoStartPts(p),G=Math.round(O*c);M=Math.min(M,t(p[0].dts,j)-G),L=Math.min(L,j-G)}if(Object.keys(A).length)return this.ISGenerated=!0,D&&(this._initPTS=L,this._initDTS=M),{tracks:A,initPTS:L,timescale:O}},y.remuxVideo=function(u,o,c,_){var p=u.inputTimeScale,d=u.samples,A=[],D=d.length,S=this._initPTS,L=this.nextAvcDts,M=8,O,j,G,X=Number.POSITIVE_INFINITY,ee=Number.NEGATIVE_INFINITY,he=0,ge=!1;if(!c||L===null){var de=o*p,Te=d[0].pts-t(d[0].dts,d[0].pts);L=de-Te}for(var xe=0;xe<D;xe++){var ce=d[xe];if(ce.pts=t(ce.pts-S,L),ce.dts=t(ce.dts-S,L),ce.dts>ce.pts){var ae=9e4*.2;he=Math.max(Math.min(he,ce.pts-ce.dts),-1*ae)}ce.dts<d[xe>0?xe-1:xe].dts&&(ge=!0)}ge&&d.sort(function(Je,Qe){var Ge=Je.dts-Qe.dts,at=Je.pts-Qe.pts;return Ge||at}),j=d[0].dts,G=d[d.length-1].dts;var Le=Math.round((G-j)/(D-1));if(he<0){if(he<Le*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(E.toMsFromMpegTsClock)(-Le,!0)+" ms");for(var Ye=he,Fe=0;Fe<D;Fe++)d[Fe].dts=Ye=Math.max(Ye,d[Fe].pts-Le),d[Fe].pts=Math.max(Ye,d[Fe].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(E.toMsFromMpegTsClock)(he,!0)+" ms to overcome this issue");for(var We=0;We<D;We++)d[We].dts=d[We].dts+he}j=d[0].dts}if(c){var be=j-L,Ee=be>Le,Ae=be<-1;if(Ee||Ae){Ee?e.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(be,!0)+" ms ("+be+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(-be,!0)+" ms ("+be+"dts) overlapping between fragments detected"),j=L;var Ie=d[0].pts-be;d[0].dts=j,d[0].pts=Ie,e.logger.log("Video: First PTS/DTS adjusted: "+Object(E.toMsFromMpegTsClock)(Ie,!0)+"/"+Object(E.toMsFromMpegTsClock)(j,!0)+", delta: "+Object(E.toMsFromMpegTsClock)(be,!0)+" ms")}}n&&(j=Math.max(0,j));for(var $=0,se=0,ue=0;ue<D;ue++){for(var pe=d[ue],Se=pe.units,Pe=Se.length,De=0,ke=0;ke<Pe;ke++)De+=Se[ke].data.length;se+=De,$+=Pe,pe.length=De,pe.dts=Math.max(pe.dts,j),pe.pts=Math.max(pe.pts,pe.dts,0),X=Math.min(pe.pts,X),ee=Math.max(pe.pts,ee)}G=d[D-1].dts;var Be=se+4*$+8,Ke;try{Ke=new Uint8Array(Be)}catch(Je){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Be,reason:"fail allocating video mdat "+Be});return}var oe=new DataView(Ke.buffer);oe.setUint32(0,Be),Ke.set(R.default.types.mdat,4);for(var me=0;me<D;me++){for(var _e=d[me],we=_e.units,fe=0,ye=0,re=we.length;ye<re;ye++){var Z=we[ye],J=Z.data,V=Z.data.byteLength;oe.setUint32(M,V),M+=4,Ke.set(J,M),M+=V,fe+=4+V}if(me<D-1)O=d[me+1].dts-_e.dts;else{var Y=this.config,q=_e.dts-d[me>0?me-1:me].dts;if(Y.stretchShortVideoTrack&&this.nextAudioPts!==null){var te=Math.floor(Y.maxBufferHole*p),le=(_?X+_*p:this.nextAudioPts)-_e.pts;le>te?(O=le-q,O<0&&(O=q),e.logger.log("[mp4-remuxer]: It is approximately "+le/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=q}else O=q}var ve=Math.round(_e.pts-_e.dts);A.push(new v(_e.key,O,fe,ve))}if(A.length&&l&&l<70){var Oe=A[0].flags;Oe.dependsOn=2,Oe.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=L=G+O,this.isVideoContiguous=!0;var He=R.default.moof(u.sequenceNumber++,j,g({},u,{samples:A})),ze="video",Ne={data1:He,data2:Ke,startPTS:X/p,endPTS:(ee+O)/p,startDTS:j/p,endDTS:L/p,type:ze,hasAudio:!1,hasVideo:!0,nb:A.length,dropped:u.dropped};return u.samples=[],u.dropped=0,console.assert(Ke.length,"MDAT length must not be zero"),Ne},y.remuxAudio=function(u,o,c,_,p){var d=u.inputTimeScale,A=u.samplerate?u.samplerate:d,D=d/A,S=u.isAAC?a:i,L=S*D,M=this._initPTS,O=!u.isAAC&&this.typeSupported.mpeg,j=[],G=u.samples,X=O?0:8,ee=this.nextAudioPts||-1,he=o*d;if(this.isAudioContiguous=c=c||G.length&&ee>0&&(_&&Math.abs(he-ee)<9e3||Math.abs(t(G[0].pts-M,he)-ee)<20*L),G.forEach(function(J){J.pts=t(J.pts-M,he)}),!c||ee<0){if(G=G.filter(function(J){return J.pts>=0}),!G.length)return;p===0?ee=0:_?ee=Math.max(0,he):ee=G[0].pts}if(u.isAAC)for(var ge=p!==void 0,de=this.config.maxAudioFramesDrift,Te=0,xe=ee;Te<G.length;Te++){var ce=G[Te],ae=ce.pts,Le=ae-xe,Ye=Math.abs(1e3*Le/d);if(Le<=-de*L&&ge)Te===0&&(e.logger.warn("Audio frame @ "+(ae/d).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Le/d)+" ms."),this.nextAudioPts=ee=xe=ae);else if(Le>=de*L&&Ye<h&&ge){var Fe=Math.round(Le/L);xe=ae-Fe*L,xe<0&&(Fe--,xe+=L),Te===0&&(this.nextAudioPts=ee=xe),e.logger.warn("[mp4-remuxer]: Injecting "+Fe+" audio frame @ "+(xe/d).toFixed(3)+"s due to "+Math.round(1e3*Le/d)+" ms gap.");for(var We=0;We<Fe;We++){var be=Math.max(xe,0),Ee=P.default.getSilentFrame(u.manifestCodec||u.codec,u.channelCount);Ee||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ee=ce.unit.subarray()),G.splice(Te,0,{unit:Ee,pts:be}),xe+=L,Te++}}ce.pts=xe,xe+=L}for(var Ae=null,Ie=null,$,se=0,ue=G.length;ue--;)se+=G[ue].unit.byteLength;for(var pe=0,Se=G.length;pe<Se;pe++){var Pe=G[pe],De=Pe.unit,ke=Pe.pts;if(Ie!==null){var Be=j[pe-1];Be.duration=Math.round((ke-Ie)/D)}else if(c&&u.isAAC&&(ke=ee),Ae=ke,se>0){se+=X;try{$=new Uint8Array(se)}catch(J){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:se,reason:"fail allocating audio mdat "+se});return}if(!O){var Ke=new DataView($.buffer);Ke.setUint32(0,se),$.set(R.default.types.mdat,4)}}else return;$.set(De,X);var oe=De.byteLength;X+=oe,j.push(new v(!0,S,oe,0)),Ie=ke}var me=j.length;if(!me)return;var _e=j[j.length-1];this.nextAudioPts=ee=Ie+D*_e.duration;var we=O?new Uint8Array(0):R.default.moof(u.sequenceNumber++,Ae/D,g({},u,{samples:j}));u.samples=[];var fe=Ae/d,ye=ee/d,re="audio",Z={data1:we,data2:$,startPTS:fe,endPTS:ye,startDTS:fe,endDTS:ye,type:re,hasAudio:!0,hasVideo:!1,nb:me};return this.isAudioContiguous=!0,console.assert($.length,"MDAT length must not be zero"),Z},y.remuxEmptyAudio=function(u,o,c,_){var p=u.inputTimeScale,d=u.samplerate?u.samplerate:p,A=p/d,D=this.nextAudioPts,S=(D!==null?D:_.startDTS*p)+this._initDTS,L=_.endDTS*p+this._initDTS,M=A*a,O=Math.ceil((L-S)/M),j=P.default.getSilentFrame(u.manifestCodec||u.codec,u.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!j){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var G=[],X=0;X<O;X++){var ee=S+X*M;G.push({unit:j,pts:ee,dts:ee})}return u.samples=G,this.remuxAudio(u,o,c,!1)},y.remuxID3=function(u,o){var c=u.samples.length;if(!c)return;for(var _=u.inputTimeScale,p=this._initPTS,d=this._initDTS,A=0;A<c;A++){var D=u.samples[A];D.pts=t(D.pts-p,o*_)/_,D.dts=t(D.dts-d,o*_)/_}var S=u.samples;return u.samples=[],{samples:S}},y.remuxText=function(u,o){var c=u.samples.length;if(!c)return;for(var _=u.inputTimeScale,p=this._initPTS,d=0;d<c;d++){var A=u.samples[d];A.pts=t(A.pts-p,o*_)/_}u.samples.sort(function(S,L){return S.pts-L.pts});var D=u.samples;return u.samples=[],{samples:D}},T}();function t(T,y){var f;if(y===null)return T;for(y<T?f=-8589934592:f=8589934592;Math.abs(T-y)>4294967296;)T+=f;return T}function b(T){for(var y=0;y<T.length;y++)if(T[y].key)return y;return-1}var v=function(y,f,u,o){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=f,this.size=u,this.cts=o,this.flags=new m(y)},m=function(y){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=y?2:1,this.isNonSync=y?0:1}},"./src/remux/passthrough-remuxer.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/polyfills/number.ts"),P=I("./src/utils/mp4-tools.ts"),R=I("./src/loader/fragment.ts"),K=I("./src/utils/logger.ts"),N=function(){function E(){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 g=E.prototype;return g.destroy=function(){},g.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(a,i,l){this.audioCodec=i,this.videoCodec=l,this.generateInitSegment(a),this.emitInitSegment=!0},g.generateInitSegment=function(a){var i=this.audioCodec,l=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(P.parseInitSegment)(a);i||(i=C(s.audio,R.ElementaryStreamTypes.AUDIO)),l||(l=C(s.video,R.ElementaryStreamTypes.VIDEO));var n={};s.audio&&s.video?n.audiovideo={container:"video/mp4",codec:i+","+l,initSegment:a,id:"main"}:s.audio?n.audio={container:"audio/mp4",codec:i,initSegment:a,id:"audio"}:s.video?n.video={container:"video/mp4",codec:l,initSegment:a,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n},g.remux=function(a,i,l,s,n){var r=this.initPTS,t=this.lastEndDTS,b={audio:void 0,video:void 0,text:s,id3:l,initSegment:void 0};Object(W.isFiniteNumber)(t)||(t=this.lastEndDTS=n||0);var v=i.samples;if(!v||!v.length)return b;var m={initPTS:void 0,timescale:1},T=this.initData;if((!T||!T.length)&&(this.generateInitSegment(v),T=this.initData),!T||!T.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),b;this.emitInitSegment&&(m.tracks=this.initTracks,this.emitInitSegment=!1),Object(W.isFiniteNumber)(r)||(this.initPTS=m.initPTS=r=e(T,v,t));var y=Object(P.getDuration)(v,T),f=t,u=y+f;Object(P.offsetStartDTS)(T,v,r),y>0?this.lastEndDTS=u:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var o=!!T.audio,c=!!T.video,_="";o&&(_+="audio"),c&&(_+="video");var p={data1:v,startPTS:f,startDTS:f,endPTS:u,endDTS:u,type:_,hasAudio:o,hasVideo:c,nb:1,dropped:0};return b.audio=p.type==="audio"?p:void 0,b.video=p.type!=="audio"?p:void 0,b.text=s,b.id3=l,b.initSegment=m,b},E}(),e=function(g,h,a){return Object(P.getStartDTS)(g,h)-a};function C(E,g){var h=E==null?void 0:E.codec;return h&&h.length>4?h:h==="hvc1"?"hvc1.1.c.L120.90":h==="av01"?"av01.0.04M.08":h==="avc1"||g===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}H.default=N},"./src/task-loop.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=P.prototype;return R.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},R.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},R.onHandlerDestroyed=function(){},R.hasInterval=function(){return!!this._tickInterval},R.hasNextTick=function(){return!!this._tickTimer},R.setInterval=function(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!0)},R.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},R.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},R.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},R.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},R.doTick=function(){},P}()},"./src/types/cmcd.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"CMCDVersion",function(){return W}),I.d(H,"CMCDObjectType",function(){return P}),I.d(H,"CMCDStreamingFormat",function(){return R}),I.d(H,"CMCDStreamType",function(){return K});var W=1,P;(function(N){N.MANIFEST="m",N.AUDIO="a",N.VIDEO="v",N.MUXED="av",N.INIT="i",N.CAPTION="c",N.TIMED_TEXT="tt",N.KEY="k",N.OTHER="o"})(P||(P={}));var R;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(R||(R={}));var K;(function(N){N.VOD="v",N.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"HlsSkip",function(){return R}),I.d(H,"getSkipValue",function(){return K}),I.d(H,"HlsUrlParameters",function(){return N}),I.d(H,"Level",function(){return e});function W(C,E){for(var g=0;g<E.length;g++){var h=E[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(C,h.key,h)}}function P(C,E,g){return E&&W(C.prototype,E),g&&W(C,g),C}var R;(function(C){C.No="",C.Yes="YES",C.v2="v2"})(R||(R={}));function K(C,E){var g=C.canSkipUntil,h=C.canSkipDateRanges,a=C.endSN,i=E!==void 0?E-a:0;return g&&i<g?h?R.v2:R.Yes:R.No}var N=function(){function C(g,h,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=h,this.skip=a}var E=C.prototype;return E.addDirectives=function(h){var a=new self.URL(h);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()},C}(),e=function(){function C(E){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=[E.url],this.attrs=E.attrs,this.bitrate=E.bitrate,E.details&&(this.details=E.details),this.id=E.id||0,this.name=E.name,this.width=E.width||0,this.height=E.height||0,this.audioCodec=E.audioCodec,this.videoCodec=E.videoCodec,this.unknownCodecs=E.unknownCodecs,this.codecSet=[E.videoCodec,E.audioCodec].filter(function(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return P(C,[{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(g){var h=g%this.url.length;this._urlId!==h&&(this.details=void 0,this._urlId=h)}}]),C}()},"./src/types/loader.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"PlaylistContextType",function(){return W}),I.d(H,"PlaylistLevelType",function(){return P});var W;(function(R){R.MANIFEST="manifest",R.LEVEL="level",R.AUDIO_TRACK="audioTrack",R.SUBTITLE_TRACK="subtitleTrack"})(W||(W={}));var P;(function(R){R.MAIN="main",R.AUDIO="audio",R.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"ChunkMetadata",function(){return W});var W=function(K,N,e,C,E,g){C===void 0&&(C=0),E===void 0&&(E=-1),g===void 0&&(g=!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=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=K,this.sn=N,this.id=e,this.size=C,this.part=E,this.partial=g};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"AttrList",function(){return R});var W=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,R=function(){function K(e){typeof e=="string"&&(e=K.parseAttrList(e));for(var C in e)e.hasOwnProperty(C)&&(this[C]=e[C])}var N=K.prototype;return N.decimalInteger=function(C){var E=parseInt(this[C],10);return E>Number.MAX_SAFE_INTEGER?Infinity:E},N.hexadecimalInteger=function(C){if(this[C]){var E=(this[C]||"0x").slice(2);E=(E.length&1?"0":"")+E;for(var g=new Uint8Array(E.length/2),h=0;h<E.length/2;h++)g[h]=parseInt(E.slice(h*2,h*2+2),16);return g}else return null},N.hexadecimalIntegerAsNumber=function(C){var E=parseInt(this[C],16);return E>Number.MAX_SAFE_INTEGER?Infinity:E},N.decimalFloatingPoint=function(C){return parseFloat(this[C])},N.optionalFloat=function(C,E){var g=this[C];return g?parseFloat(g):E},N.enumeratedString=function(C){return this[C]},N.bool=function(C){return this[C]==="YES"},N.decimalResolution=function(C){var E=W.exec(this[C]);return E===null?void 0:{width:parseInt(E[1],10),height:parseInt(E[2],10)}},K.parseAttrList=function(C){var E,g={},h='"';for(P.lastIndex=0;(E=P.exec(C))!==null;){var a=E[2];a.indexOf(h)===0&&a.lastIndexOf(h)===a.length-1&&(a=a.slice(1,-1)),g[E[1]]=a}return g},K}()},"./src/utils/binary-search.ts":function(Q,H,I){"use strict";I.r(H);var W={search:function(R,K){for(var N=0,e=R.length-1,C=null,E=null;N<=e;){C=(N+e)/2|0,E=R[C];var g=K(E);if(g>0)N=C+1;else if(g<0)e=C-1;else return E}return null}};H.default=W},"./src/utils/buffer-helper.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"BufferHelper",function(){return R});var W=I("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function K(){}return K.isBuffered=function(e,C){try{if(e){for(var E=K.getBuffered(e),g=0;g<E.length;g++)if(C>=E.start(g)&&C<=E.end(g))return!0}}catch(h){}return!1},K.bufferInfo=function(e,C,E){try{if(e){var g=K.getBuffered(e),h=[],a;for(a=0;a<g.length;a++)h.push({start:g.start(a),end:g.end(a)});return this.bufferedInfo(h,C,E)}}catch(i){}return{len:0,start:C,end:C,nextStart:void 0}},K.bufferedInfo=function(e,C,E){C=Math.max(0,C),e.sort(function(m,T){var y=m.start-T.start;return y||T.end-m.end});var g=[];if(E)for(var h=0;h<e.length;h++){var a=g.length;if(a){var i=g[a-1].end;e[h].start-i<E?e[h].end>i&&(g[a-1].end=e[h].end):g.push(e[h])}else g.push(e[h])}else g=e;for(var l=0,s,n=C,r=C,t=0;t<g.length;t++){var b=g[t].start,v=g[t].end;if(C+E>=b&&C<v)n=b,r=v,l=r-C;else if(C+E<b){s=b;break}}return{len:l,start:n||0,end:r||0,nextStart:s}},K.getBuffered=function(e){try{return e.buffered}catch(C){return W.logger.log("failed to get media.buffered",C),P}},K}()},"./src/utils/cea-608-parser.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"Row",function(){return r}),I.d(H,"CaptionScreen",function(){return t});var W=I("./src/utils/logger.ts"),P={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},R=function(u){var o=u;return P.hasOwnProperty(u)&&(o=P[u]),String.fromCharCode(o)},K=15,N=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},C={17:2,18:4,21:6,22:8,23:10,19:13,20:15},E={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(f){f[f.ERROR=0]="ERROR",f[f.TEXT=1]="TEXT",f[f.WARNING=2]="WARNING",f[f.INFO=2]="INFO",f[f.DEBUG=3]="DEBUG",f[f.DATA=3]="DATA"})(a||(a={}));var i=function(){function f(){this.time=null,this.verboseLevel=a.ERROR}var u=f.prototype;return u.log=function(c,_){this.verboseLevel>=c&&W.logger.log(this.time+" ["+c+"] "+_)},f}(),l=function(u){for(var o=[],c=0;c<u.length;c++)o.push(u[c].toString(16));return o},s=function(){function f(o,c,_,p,d){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=o||"white",this.underline=c||!1,this.italics=_||!1,this.background=p||"black",this.flash=d||!1}var u=f.prototype;return u.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},u.setStyles=function(c){for(var _=["foreground","underline","italics","background","flash"],p=0;p<_.length;p++){var d=_[p];c.hasOwnProperty(d)&&(this[d]=c[d])}},u.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},u.equals=function(c){return this.foreground===c.foreground&&this.underline===c.underline&&this.italics===c.italics&&this.background===c.background&&this.flash===c.flash},u.copy=function(c){this.foreground=c.foreground,this.underline=c.underline,this.italics=c.italics,this.background=c.background,this.flash=c.flash},u.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},f}(),n=function(){function f(o,c,_,p,d,A){this.uchar=void 0,this.penState=void 0,this.uchar=o||" ",this.penState=new s(c,_,p,d,A)}var u=f.prototype;return u.reset=function(){this.uchar=" ",this.penState.reset()},u.setChar=function(c,_){this.uchar=c,this.penState.copy(_)},u.setPenState=function(c){this.penState.copy(c)},u.equals=function(c){return this.uchar===c.uchar&&this.penState.equals(c.penState)},u.copy=function(c){this.uchar=c.uchar,this.penState.copy(c.penState)},u.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},f}(),r=function(){function f(o){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var c=0;c<N;c++)this.chars.push(new n);this.logger=o,this.pos=0,this.currPenState=new s}var u=f.prototype;return u.equals=function(c){for(var _=!0,p=0;p<N;p++)if(!this.chars[p].equals(c.chars[p])){_=!1;break}return _},u.copy=function(c){for(var _=0;_<N;_++)this.chars[_].copy(c.chars[_])},u.isEmpty=function(){for(var c=!0,_=0;_<N;_++)if(!this.chars[_].isEmpty()){c=!1;break}return c},u.setCursor=function(c){this.pos!==c&&(this.pos=c),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>N&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=N)},u.moveCursor=function(c){var _=this.pos+c;if(c>1)for(var p=this.pos+1;p<_+1;p++)this.chars[p].setPenState(this.currPenState);this.setCursor(_)},u.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},u.insertChar=function(c){c>=144&&this.backSpace();var _=R(c);if(this.pos>=N){this.logger.log(a.ERROR,"Cannot insert "+c.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},u.clearFromPos=function(c){var _;for(_=c;_<N;_++)this.chars[_].reset()},u.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},u.clearToEndOfRow=function(){this.clearFromPos(this.pos)},u.getTextString=function(){for(var c=[],_=!0,p=0;p<N;p++){var d=this.chars[p].uchar;d!==" "&&(_=!1),c.push(d)}return _?"":c.join("")},u.setPenStyles=function(c){this.currPenState.setStyles(c);var _=this.chars[this.pos];_.setPenState(this.currPenState)},f}(),t=function(){function f(o){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var c=0;c<K;c++)this.rows.push(new r(o));this.logger=o,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var u=f.prototype;return u.reset=function(){for(var c=0;c<K;c++)this.rows[c].clear();this.currRow=K-1},u.equals=function(c){for(var _=!0,p=0;p<K;p++)if(!this.rows[p].equals(c.rows[p])){_=!1;break}return _},u.copy=function(c){for(var _=0;_<K;_++)this.rows[_].copy(c.rows[_])},u.isEmpty=function(){for(var c=!0,_=0;_<K;_++)if(!this.rows[_].isEmpty()){c=!1;break}return c},u.backSpace=function(){var c=this.rows[this.currRow];c.backSpace()},u.clearToEndOfRow=function(){var c=this.rows[this.currRow];c.clearToEndOfRow()},u.insertChar=function(c){var _=this.rows[this.currRow];_.insertChar(c)},u.setPen=function(c){var _=this.rows[this.currRow];_.setPenStyles(c)},u.moveCursor=function(c){var _=this.rows[this.currRow];_.moveCursor(c)},u.setCursor=function(c){this.logger.log(a.INFO,"setCursor: "+c);var _=this.rows[this.currRow];_.setCursor(c)},u.setPAC=function(c){this.logger.log(a.INFO,"pacData = "+JSON.stringify(c));var _=c.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var p=0;p<K;p++)this.rows[p].clear();var d=this.currRow+1-this.nrRollUpRows,A=this.lastOutputScreen;if(A){var D=A.rows[d].cueStartTime,S=this.logger.time;if(D&&S!==null&&D<S)for(var L=0;L<this.nrRollUpRows;L++)this.rows[_-this.nrRollUpRows+L+1].copy(A.rows[d+L])}}this.currRow=_;var M=this.rows[this.currRow];if(c.indent!==null){var O=c.indent,j=Math.max(O-1,0);M.setCursor(c.indent),c.color=M.chars[j].penState.foreground}var G={foreground:c.color,underline:c.underline,italics:c.italics,background:"black",flash:!1};this.setPen(G)},u.setBkgData=function(c){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(c)),this.backSpace(),this.setPen(c),this.insertChar(32)},u.setRollUpRows=function(c){this.nrRollUpRows=c},u.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 c=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(c,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(a.INFO,"Rolling up")},u.getDisplayText=function(c){c=c||!1;for(var _=[],p="",d=-1,A=0;A<K;A++){var D=this.rows[A].getTextString();D&&(d=A+1,c?_.push("Row "+d+": '"+D+"'"):_.push(D.trim()))}return _.length>0&&(c?p="["+_.join(" | ")+"]":p=_.join(`
|
|
`)),p},u.getTextAndFormat=function(){return this.rows},f}(),b=function(){function f(o,c,_){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=o,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new t(_),this.nonDisplayedMemory=new t(_),this.lastOutputScreen=new t(_),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var u=f.prototype;return u.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},u.getHandler=function(){return this.outputFilter},u.setHandler=function(c){this.outputFilter=c},u.setPAC=function(c){this.writeScreen.setPAC(c)},u.setBkgData=function(c){this.writeScreen.setBkgData(c)},u.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(a.INFO,"MODE="+c),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=c},u.insertChars=function(c){for(var _=0;_<c.length;_++)this.writeScreen.insertChar(c[_]);var p=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,p+": "+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())},u.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},u.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},u.ccAOF=function(){},u.ccAON=function(){},u.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},u.ccRU=function(c){this.logger.log(a.INFO,"RU("+c+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(c)},u.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},u.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},u.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},u.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},u.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},u.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},u.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},u.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var c=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=c,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},u.ccTO=function(c){this.logger.log(a.INFO,"TO("+c+") - Tab Offset"),this.writeScreen.moveCursor(c)},u.ccMIDROW=function(c){var _={flash:!1};if(_.underline=c%2===1,_.italics=c>=46,_.italics)_.foreground="white";else{var p=Math.floor(c/2)-16,d=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=d[p]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},u.outputDataUpdate=function(c){c===void 0&&(c=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},u.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},f}(),v=function(){function f(o,c,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var p=new i;this.channels=[null,new b(o,c,p),new b(o+1,_,p)],this.cmdHistory=y(),this.logger=p}var u=f.prototype;return u.getHandler=function(c){return this.channels[c].getHandler()},u.setHandler=function(c,_){this.channels[c].setHandler(_)},u.addData=function(c,_){var p,d,A,D=!1;this.logger.time=c;for(var S=0;S<_.length;S+=2){if(d=_[S]&127,A=_[S+1]&127,d===0&&A===0)continue;if(this.logger.log(a.DATA,"["+l([_[S],_[S+1]])+"] -> ("+l([d,A])+")"),p=this.parseCmd(d,A),p||(p=this.parseMidrow(d,A)),p||(p=this.parsePAC(d,A)),p||(p=this.parseBackgroundAttributes(d,A)),!p&&(D=this.parseChars(d,A),D)){var L=this.currentChannel;if(L&&L>0){var M=this.channels[L];M.insertChars(D)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!p&&!D&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+l([d,A])+" orig: "+l([_[S],_[S+1]]))}},u.parseCmd=function(c,_){var p=this.cmdHistory,d=(c===20||c===28||c===21||c===29)&&_>=32&&_<=47,A=(c===23||c===31)&&_>=33&&_<=35;if(!(d||A))return!1;if(T(c,_,p))return m(null,null,p),this.logger.log(a.DEBUG,"Repeated command ("+l([c,_])+") is dropped"),!0;var D=c===20||c===21||c===23?1:2,S=this.channels[D];return c===20||c===21||c===28||c===29?_===32?S.ccRCL():_===33?S.ccBS():_===34?S.ccAOF():_===35?S.ccAON():_===36?S.ccDER():_===37?S.ccRU(2):_===38?S.ccRU(3):_===39?S.ccRU(4):_===40?S.ccFON():_===41?S.ccRDC():_===42?S.ccTR():_===43?S.ccRTD():_===44?S.ccEDM():_===45?S.ccCR():_===46?S.ccENM():_===47&&S.ccEOC():S.ccTO(_-32),m(c,_,p),this.currentChannel=D,!0},u.parseMidrow=function(c,_){var p=0;if((c===17||c===25)&&_>=32&&_<=47){if(c===17?p=1:p=2,p!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var d=this.channels[p];return d?(d.ccMIDROW(_),this.logger.log(a.DEBUG,"MIDROW ("+l([c,_])+")"),!0):!1}return!1},u.parsePAC=function(c,_){var p,d=this.cmdHistory,A=(c>=17&&c<=23||c>=25&&c<=31)&&_>=64&&_<=127,D=(c===16||c===24)&&_>=64&&_<=95;if(!(A||D))return!1;if(T(c,_,d))return m(null,null,d),!0;var S=c<=23?1:2;_>=64&&_<=95?p=S===1?e[c]:E[c]:p=S===1?C[c]:g[c];var L=this.channels[S];return L?(L.setPAC(this.interpretPAC(p,_)),m(c,_,d),this.currentChannel=S,!0):!1},u.interpretPAC=function(c,_){var p,d={color:null,italics:!1,indent:null,underline:!1,row:c};return _>95?p=_-96:p=_-64,d.underline=(p&1)===1,p<=13?d.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(p/2)]:p<=15?(d.italics=!0,d.color="white"):d.indent=Math.floor((p-16)/2)*4,d},u.parseChars=function(c,_){var p,d=null,A=null;if(c>=25?(p=2,A=c-8):(p=1,A=c),A>=17&&A<=19){var D;A===17?D=_+80:A===18?D=_+112:D=_+144,this.logger.log(a.INFO,"Special char '"+R(D)+"' in channel "+p),d=[D]}else c>=32&&c<=127&&(d=_===0?[c]:[c,_]);if(d){var S=l(d);this.logger.log(a.DEBUG,"Char codes = "+S.join(",")),m(c,_,this.cmdHistory)}return d},u.parseBackgroundAttributes=function(c,_){var p=(c===16||c===24)&&_>=32&&_<=47,d=(c===23||c===31)&&_>=45&&_<=47;if(!(p||d))return!1;var A,D={};c===16||c===24?(A=Math.floor((_-32)/2),D.background=h[A],_%2===1&&(D.background=D.background+"_semi")):_===45?D.background="transparent":(D.foreground="black",_===47&&(D.underline=!0));var S=c<=23?1:2,L=this.channels[S];return L.setBkgData(D),m(c,_,this.cmdHistory),!0},u.reset=function(){for(var c=0;c<Object.keys(this.channels).length;c++){var _=this.channels[c];_&&_.reset()}this.cmdHistory=y()},u.cueSplitAtTime=function(c){for(var _=0;_<this.channels.length;_++){var p=this.channels[_];p&&p.cueSplitAtTime(c)}},f}();function m(f,u,o){o.a=f,o.b=u}function T(f,u,o){return o.a===f&&o.b===u}function y(){return{a:null,b:null}}H.default=v},"./src/utils/codecs.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"isCodecType",function(){return P}),I.d(H,"isCodecSupportedInMp4",function(){return R});var W={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 P(K,N){var e=W[N];return!!e&&e[K.slice(0,4)]===!0}function R(K,N){return MediaSource.isTypeSupported((N||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/vttparser.ts"),P=I("./src/utils/webvtt-parser.ts"),R=I("./src/utils/texttrack-utils.ts"),K=/\s/,N={newCue:function(C,E,g,h){for(var a=[],i,l,s,n,r,t=self.VTTCue||self.TextTrackCue,b=0;b<h.rows.length;b++)if(i=h.rows[b],s=!0,n=0,r="",!i.isEmpty()){for(var v=0;v<i.chars.length;v++)K.test(i.chars[v].uchar)&&s?n++:(r+=i.chars[v].uchar,s=!1);i.cueStartTime=E,E===g&&(g+=1e-4),n>=16?n--:n++;var m=Object(W.fixLineBreaks)(r.trim()),T=Object(P.generateCueId)(E,g,m);(!C||!C.cues||!C.cues.getCueById(T))&&(l=new t(E,g,m),l.id=T,l.line=b+1,l.align="left",l.position=10+Math.min(80,Math.floor(n*8/32)*10),a.push(l))}return C&&a.length&&(a.sort(function(y,f){return y.line==="auto"||f.line==="auto"?0:y.line>8&&f.line>8?f.line-y.line:y.line-f.line}),a.forEach(function(y){return Object(R.addCueToTrack)(C,y)})),a}};H.default=N},"./src/utils/discontinuities.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"findFirstFragWithCC",function(){return K}),I.d(H,"shouldAlignOnDiscontinuities",function(){return N}),I.d(H,"findDiscontinuousReferenceFrag",function(){return e}),I.d(H,"adjustSlidingStart",function(){return E}),I.d(H,"alignStream",function(){return g}),I.d(H,"alignPDT",function(){return a}),I.d(H,"alignFragmentByPDTDelta",function(){return i}),I.d(H,"alignMediaPlaylistByPDT",function(){return l});var W=I("./src/polyfills/number.ts"),P=I("./src/utils/logger.ts"),R=I("./src/controller/level-helper.ts");function K(s,n){for(var r=null,t=0,b=s.length;t<b;t++){var v=s[t];if(v&&v.cc===n){r=v;break}}return r}function N(s,n,r){return!!(n.details&&(r.endCC>r.startCC||s&&s.cc<r.startCC))}function e(s,n){var r=s.fragments,t=n.fragments;if(!t.length||!r.length){P.logger.log("No fragments to align");return}var b=K(r,t[0].cc);if(!b||b&&!b.startPTS){P.logger.log("No frag in previous level to align on");return}return b}function C(s,n){if(s){var r=s.start+n;s.start=s.startPTS=r,s.endPTS=r+s.duration}}function E(s,n){for(var r=n.fragments,t=0,b=r.length;t<b;t++)C(r[t],s);n.fragmentHint&&C(n.fragmentHint,s),n.alignedSliding=!0}function g(s,n,r){if(!n)return;h(s,r,n),!r.alignedSliding&&n.details&&a(r,n.details),!r.alignedSliding&&n.details&&!r.skippedSegments&&Object(R.adjustSliding)(n.details,r)}function h(s,n,r){if(N(s,r,n)){var t=e(r.details,n);t&&Object(W.isFiniteNumber)(t.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+n.url),E(t.start,n))}}function a(s,n){if(!n.fragments.length||!s.hasProgramDateTime||!n.hasProgramDateTime)return;var r=n.fragments[0].programDateTime,t=s.fragments[0].programDateTime,b=(t-r)/1e3+n.fragments[0].start;b&&Object(W.isFiniteNumber)(b)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(t-r)+"ms, sliding:"+b.toFixed(3)+" "+s.url+" "),E(b,s))}function i(s,n){var r=s.programDateTime;if(!r)return;var t=(r-n)/1e3;s.start=s.startPTS=t,s.endPTS=t+s.duration}function l(s,n){if(!n.fragments.length||!s.hasProgramDateTime||!n.hasProgramDateTime)return;var r=n.fragments[0].programDateTime,t=n.fragments[0].start,b=r-t*1e3;s.fragments.forEach(function(v){i(v,b)}),s.fragmentHint&&i(s.fragmentHint,b),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/ewma.ts"),P=function(){function R(N,e,C){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=C,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new W.default(N),this.fast_=new W.default(e)}var K=R.prototype;return K.update=function(e,C){var E=this.slow_,g=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new W.default(e,E.getEstimate(),E.getTotalWeight())),this.fast_.halfLife!==C&&(this.fast_=new W.default(C,g.getEstimate(),g.getTotalWeight()))},K.sample=function(e,C){e=Math.max(e,this.minDelayMs_);var E=8*C,g=e/1e3,h=E/g;this.fast_.sample(g,h),this.slow_.sample(g,h)},K.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},R}();H.default=P},"./src/utils/ewma.ts":function(Q,H,I){"use strict";I.r(H);var W=function(){function P(K,N,e){N===void 0&&(N=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=N,this.totalWeight_=e}var R=P.prototype;return R.sample=function(N,e){var C=Math.pow(this.alpha_,N);this.estimate_=e*(1-C)+C*this.estimate_,this.totalWeight_+=N},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var N=1-Math.pow(this.alpha_,this.totalWeight_);if(N)return this.estimate_/N}return this.estimate_},P}();H.default=W},"./src/utils/fetch-loader.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"fetchSupported",function(){return i});var W=I("./src/polyfills/number.ts"),P=I("./src/loader/load-stats.ts"),R=I("./src/demux/chunk-cache.ts");function K(t,b){t.prototype=Object.create(b.prototype),t.prototype.constructor=t,g(t,b)}function N(t){var b=typeof Map=="function"?new Map:void 0;return N=function(m){if(m===null||!E(m))return m;if(typeof m!="function")throw new TypeError("Super expression must either be null or a function");if(typeof b!="undefined"){if(b.has(m))return b.get(m);b.set(m,T)}function T(){return e(m,arguments,h(this).constructor)}return T.prototype=Object.create(m.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),g(T,m)},N(t)}function e(t,b,v){return C()?e=Reflect.construct:e=function(T,y,f){var u=[null];u.push.apply(u,y);var o=Function.bind.apply(T,u),c=new o;return f&&g(c,f.prototype),c},e.apply(null,arguments)}function C(){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 E(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function g(t,b){return g=Object.setPrototypeOf||function(m,T){return m.__proto__=T,m},g(t,b)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},h(t)}function a(){return a=Object.assign||function(t){for(var b=1;b<arguments.length;b++){var v=arguments[b];for(var m in v)Object.prototype.hasOwnProperty.call(v,m)&&(t[m]=v[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 l=function(){function t(v){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=v.fetchSetup||n,this.controller=new self.AbortController,this.stats=new P.LoadStats}var b=t.prototype;return b.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},b.abortInternal=function(){var m=this.response;(!m||!m.ok)&&(this.stats.aborted=!0,this.controller.abort())},b.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},b.load=function(m,T,y){var f=this,u=this.stats;if(u.loading.start)throw new Error("Loader can only be used once.");u.loading.start=self.performance.now();var o=s(m,this.controller.signal),c=y.onProgress,_=m.responseType==="arraybuffer",p=_?"byteLength":"length";this.context=m,this.config=T,this.callbacks=y,this.request=this.fetchSetup(m,o),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){f.abortInternal(),y.onTimeout(u,m,f.response)},T.timeout),self.fetch(this.request).then(function(d){if(f.response=f.loader=d,!d.ok){var A=d.status,D=d.statusText;throw new r(D||"fetch, bad network response",A,d)}return u.loading.first=Math.max(self.performance.now(),u.loading.start),u.total=parseInt(d.headers.get("Content-Length")||"0"),c&&Object(W.isFiniteNumber)(T.highWaterMark)?f.loadProgressively(d,u,m,T.highWaterMark,c):_?d.arrayBuffer():d.text()}).then(function(d){var A=f.response;self.clearTimeout(f.requestTimeout),u.loading.end=Math.max(self.performance.now(),u.loading.first),u.loaded=u.total=d[p];var D={url:A.url,data:d};c&&!Object(W.isFiniteNumber)(T.highWaterMark)&&c(u,m,d,A),y.onSuccess(D,u,m,A)}).catch(function(d){if(self.clearTimeout(f.requestTimeout),u.aborted)return;var A=d.code||0;y.onError({code:A,text:d.message},m,d.details)})},b.getCacheAge=function(){var m=null;if(this.response){var T=this.response.headers.get("age");m=T?parseFloat(T):null}return m},b.loadProgressively=function(m,T,y,f,u){f===void 0&&(f=0);var o=new R.default,c=m.body.getReader(),_=function p(){return c.read().then(function(d){if(d.done)return o.dataLength&&u(T,y,o.flush(),m),Promise.resolve(new ArrayBuffer(0));var A=d.value,D=A.length;return T.loaded+=D,D<f||o.dataLength?(o.push(A),o.dataLength>=f&&u(T,y,o.flush(),m)):u(T,y,A,m),p()}).catch(function(){return Promise.reject()})};return _()},t}();function s(t,b){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:b,headers:new self.Headers(a({},t.headers))};return t.rangeEnd&&v.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),v}function n(t,b){return new self.Request(t.url,b)}var r=function(t){K(b,t);function b(v,m,T){var y;return y=t.call(this,v)||this,y.code=void 0,y.details=void 0,y.code=m,y.details=T,y}return b}(N(Error));H.default=l},"./src/utils/imsc1-ttml-parser.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"IMSC1_CODEC",function(){return E}),I.d(H,"parseIMSC1",function(){return i});var W=I("./src/utils/mp4-tools.ts"),P=I("./src/utils/vttparser.ts"),R=I("./src/utils/vttcue.ts"),K=I("./src/demux/id3.ts"),N=I("./src/utils/timescale-conversion.ts"),e=I("./src/utils/webvtt-parser.ts");function C(){return C=Object.assign||function(f){for(var u=1;u<arguments.length;u++){var o=arguments[u];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(f[c]=o[c])}return f},C.apply(this,arguments)}var E="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function i(f,u,o,c,_){var p=Object(W.findBox)(new Uint8Array(f),["mdat"]);if(p.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var d=p[0],A=Object(K.utf8ArrayToStr)(new Uint8Array(f,d.start,d.end-d.start)),D=Object(N.toTimescaleFromScale)(u,1,o);try{c(l(A,D))}catch(S){_(S)}}function l(f,u){var o=new DOMParser,c=o.parseFromString(f,"text/xml"),_=c.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var p={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},d=Object.keys(p).reduce(function(M,O){return M[O]=_.getAttribute("ttp:"+O)||p[O],M},{}),A=_.getAttribute("xml:space")!=="preserve",D=n(s(_,"styling","style")),S=n(s(_,"layout","region")),L=s(_,"body","[begin]");return[].map.call(L,function(M){var O=r(M,A);if(!O||!M.hasAttribute("begin"))return null;var j=m(M.getAttribute("begin"),d),G=m(M.getAttribute("dur"),d),X=m(M.getAttribute("end"),d);if(j===null)throw v(M);if(X===null){if(G===null)throw v(M);X=j+G}var ee=new R.default(j-u,X-u,O);ee.id=Object(e.generateCueId)(ee.startTime,ee.endTime,ee.text);var he=S[M.getAttribute("region")],ge=D[M.getAttribute("style")];ee.position=10,ee.size=80;var de=t(he,ge),Te=de.textAlign;if(Te){var xe=a[Te];xe&&(ee.lineAlign=xe),ee.align=Te}return C(ee,de),ee}).filter(function(M){return M!==null})}function s(f,u,o){var c=f.getElementsByTagName(u)[0];return c?[].slice.call(c.querySelectorAll(o)):[]}function n(f){return f.reduce(function(u,o){var c=o.getAttribute("xml:id");return c&&(u[c]=o),u},{})}function r(f,u){return[].slice.call(f.childNodes).reduce(function(o,c,_){var p;return c.nodeName==="br"&&_?o+`
|
|
`:(p=c.childNodes)!==null&&p!==void 0&&p.length?r(c,u):u?o+c.textContent.trim().replace(/\s+/g," "):o+c.textContent},"")}function t(f,u){var o="http://www.w3.org/ns/ttml#styling",c=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return c.reduce(function(_,p){var d=b(u,o,p)||b(f,o,p);return d&&(_[p]=d),_},{})}function b(f,u,o){return f.hasAttributeNS(u,o)?f.getAttributeNS(u,o):null}function v(f){return new Error("Could not parse ttml timestamp "+f)}function m(f,u){if(!f)return null;var o=Object(P.parseTimeStamp)(f);return o===null&&(g.test(f)?o=T(f,u):h.test(f)&&(o=y(f,u))),o}function T(f,u){var o=g.exec(f),c=(o[4]|0)+(o[5]|0)/u.subFrameRate;return(o[1]|0)*3600+(o[2]|0)*60+(o[3]|0)+c/u.frameRate}function y(f,u){var o=h.exec(f),c=Number(o[1]),_=o[2];switch(_){case"h":return c*3600;case"m":return c*60;case"ms":return c*1e3;case"f":return c/u.frameRate;case"t":return c/u.tickRate}return c}},"./src/utils/logger.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"enableLogs",function(){return e}),I.d(H,"logger",function(){return C});var W=function(){},P={trace:W,debug:W,log:W,warn:W,info:W,error:W},R=P;function K(E){var g=self.console[E];return g?g.bind(self.console,"["+E+"] >"):W}function N(E){for(var g=arguments.length,h=new Array(g>1?g-1:0),a=1;a<g;a++)h[a-1]=arguments[a];h.forEach(function(i){R[i]=E[i]?E[i].bind(E):K(i)})}function e(E){if(self.console&&E===!0||typeof E=="object"){N(E,"debug","log","info","warn","error");try{R.log()}catch(g){R=P}}else R=P}var C=R},"./src/utils/mediakeys-helper.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"KeySystems",function(){return W}),I.d(H,"requestMediaKeySystemAccess",function(){return P});var W;(function(R){R.WIDEVINE="com.widevine.alpha",R.PLAYREADY="com.microsoft.playready"})(W||(W={}));var P=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"getMediaSource",function(){return W});function W(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"bin2str",function(){return N}),I.d(H,"readUint16",function(){return e}),I.d(H,"readUint32",function(){return C}),I.d(H,"writeUint32",function(){return E}),I.d(H,"findBox",function(){return g}),I.d(H,"parseSegmentIndex",function(){return h}),I.d(H,"parseInitSegment",function(){return a}),I.d(H,"getStartDTS",function(){return i}),I.d(H,"getDuration",function(){return l}),I.d(H,"computeRawDurationFromSamples",function(){return s}),I.d(H,"offsetStartDTS",function(){return n}),I.d(H,"segmentValidRange",function(){return r}),I.d(H,"appendUint8Array",function(){return t});var W=I("./src/utils/typed-array.ts"),P=I("./src/loader/fragment.ts"),R=Math.pow(2,32)-1,K=[].push;function N(b){return String.fromCharCode.apply(null,b)}function e(b,v){"data"in b&&(v+=b.start,b=b.data);var m=b[v]<<8|b[v+1];return m<0?65536+m:m}function C(b,v){"data"in b&&(v+=b.start,b=b.data);var m=b[v]<<24|b[v+1]<<16|b[v+2]<<8|b[v+3];return m<0?4294967296+m:m}function E(b,v,m){"data"in b&&(v+=b.start,b=b.data),b[v]=m>>24,b[v+1]=m>>16&255,b[v+2]=m>>8&255,b[v+3]=m&255}function g(b,v){var m=[];if(!v.length)return m;var T,y,f;"data"in b?(T=b.data,y=b.start,f=b.end):(T=b,y=0,f=T.byteLength);for(var u=y;u<f;){var o=C(T,u),c=N(T.subarray(u+4,u+8)),_=o>1?u+o:f;if(c===v[0])if(v.length===1)m.push({data:T,start:u+8,end:_});else{var p=g({data:T,start:u+8,end:_},v.slice(1));p.length&&K.apply(m,p)}u=_}return m}function h(b){var v=g(b,["moov"]),m=v[0],T=m?m.end:null,y=g(b,["sidx"]);if(!y||!y[0])return null;var f=[],u=y[0],o=u.data[0],c=o===0?8:16,_=C(u,c);c+=4;var p=0,d=0;o===0?c+=8:c+=16,c+=2;var A=u.end+d,D=e(u,c);c+=2;for(var S=0;S<D;S++){var L=c,M=C(u,L);L+=4;var O=M&2147483647,j=(M&2147483648)>>>31;if(j===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var G=C(u,L);L+=4,f.push({referenceSize:O,subsegmentDuration:G,info:{duration:G/_,start:A,end:A+O-1}}),A+=O,L+=4,c=L}return{earliestPresentationTime:p,timescale:_,version:o,referencesCount:D,references:f,moovEndOffset:T}}function a(b){for(var v=[],m=g(b,["moov","trak"]),T=0;T<m.length;T++){var y=m[T],f=g(y,["tkhd"])[0];if(f){var u=f.data[f.start],o=u===0?12:20,c=C(f,o),_=g(y,["mdia","mdhd"])[0];if(_){u=_.data[_.start],o=u===0?12:20;var p=C(_,o),d=g(y,["mdia","hdlr"])[0];if(d){var A=N(d.data.subarray(d.start+8,d.start+12)),D={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[A];if(D){var S=g(y,["mdia","minf","stbl","stsd"])[0],L=void 0;S&&(L=N(S.data.subarray(S.start+12,S.start+16))),v[c]={timescale:p,type:D},v[D]={timescale:p,id:c,codec:L}}}}}}var M=g(b,["moov","mvex","trex"]);return M.forEach(function(O){var j=C(O,4),G=v[j];G&&(G.default={duration:C(O,12),flags:C(O,20)})}),v}function i(b,v){return g(v,["moof","traf"]).reduce(function(m,T){var y=g(T,["tfdt"])[0],f=y.data[y.start],u=g(T,["tfhd"]).reduce(function(o,c){var _=C(c,4),p=b[_];if(p){var d=C(y,4);f===1&&(d*=Math.pow(2,32),d+=C(y,8));var A=p.timescale||9e4,D=d/A;if(isFinite(D)&&(o===null||D<o))return D}return o},null);return u!==null&&isFinite(u)&&(m===null||u<m)?u:m},null)||0}function l(b,v){for(var m=0,T=0,y=0,f=g(b,["moof","traf"]),u=0;u<f.length;u++){var o=f[u],c=g(o,["tfhd"])[0],_=C(c,4),p=v[_];if(!p)continue;var d=p.default,A=C(c,0)|(d==null?void 0:d.flags),D=d==null?void 0:d.duration;A&8&&(A&2?D=C(c,12):D=C(c,8));for(var S=p.timescale||9e4,L=g(o,["trun"]),M=0;M<L.length;M++){if(D){var O=C(L[M],4);m=D*O}else m=s(L[M]);p.type===P.ElementaryStreamTypes.VIDEO?T+=m/S:p.type===P.ElementaryStreamTypes.AUDIO&&(y+=m/S)}}if(T===0&&y===0){var j=h(b);if(j!=null&&j.references)return j.references.reduce(function(G,X){return G+X.info.duration||0},0)}return T||y}function s(b){var v=C(b,0),m=8;v&1&&(m+=4),v&4&&(m+=4);for(var T=0,y=C(b,4),f=0;f<y;f++){if(v&256){var u=C(b,m);T+=u,m+=4}v&512&&(m+=4),v&1024&&(m+=4),v&2048&&(m+=4)}return T}function n(b,v,m){g(v,["moof","traf"]).forEach(function(T){g(T,["tfhd"]).forEach(function(y){var f=C(y,4),u=b[f];if(!u)return;var o=u.timescale||9e4;g(T,["tfdt"]).forEach(function(c){var _=c.data[c.start],p=C(c,4);if(_===0)E(c,4,p-m*o);else{p*=Math.pow(2,32),p+=C(c,8),p-=m*o,p=Math.max(p,0);var d=Math.floor(p/(R+1)),A=Math.floor(p%(R+1));E(c,4,d),E(c,8,A)}})})})}function r(b){var v={valid:null,remainder:null},m=g(b,["moof"]);if(m){if(m.length<2)return v.remainder=b,v}else return v;var T=m[m.length-1];return v.valid=Object(W.sliceUint8)(b,0,T.start-8),v.remainder=Object(W.sliceUint8)(b,T.start-8),v}function t(b,v){var m=new Uint8Array(b.length+v.length);return m.set(b),m.set(v,b.length),m}},"./src/utils/output-filter.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"default",function(){return W});var W=function(){function P(K,N){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=N}var R=P.prototype;return R.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},R.newCue=function(N,e,C){(this.startTime===null||this.startTime>N)&&(this.startTime=N),this.endTime=e,this.screen=C,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"sendAddTrackEvent",function(){return P}),I.d(H,"addCueToTrack",function(){return R}),I.d(H,"clearCurrentCues",function(){return K}),I.d(H,"removeCuesInRange",function(){return N}),I.d(H,"getCuesInRange",function(){return C});var W=I("./src/utils/logger.ts");function P(E,g){var h;try{h=new Event("addtrack")}catch(a){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=E,g.dispatchEvent(h)}function R(E,g){var h=E.mode;if(h==="disabled"&&(E.mode="hidden"),E.cues&&!E.cues.getCueById(g.id))try{if(E.addCue(g),!E.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(i){W.logger.debug("[texttrack-utils]: "+i);var a=new self.TextTrackCue(g.startTime,g.endTime,g.text);a.id=g.id,E.addCue(a)}h==="disabled"&&(E.mode=h)}function K(E){var g=E.mode;if(g==="disabled"&&(E.mode="hidden"),E.cues)for(var h=E.cues.length;h--;)E.removeCue(E.cues[h]);g==="disabled"&&(E.mode=g)}function N(E,g,h){var a=E.mode;if(a==="disabled"&&(E.mode="hidden"),E.cues&&E.cues.length>0)for(var i=C(E.cues,g,h),l=0;l<i.length;l++)E.removeCue(i[l]);a==="disabled"&&(E.mode=a)}function e(E,g){if(g<E[0].startTime)return 0;var h=E.length-1;if(g>E[h].endTime)return-1;for(var a=0,i=h;a<=i;){var l=Math.floor((i+a)/2);if(g<E[l].startTime)i=l-1;else if(g>E[l].startTime&&a<h)a=l+1;else return l}return E[a].startTime-g<g-E[i].startTime?a:i}function C(E,g,h){var a=[],i=e(E,g);if(i>-1)for(var l=i,s=E.length;l<s;l++){var n=E[l];if(n.startTime>=g&&n.endTime<=h)a.push(n);else if(n.startTime>h)return a}return a}},"./src/utils/time-ranges.ts":function(Q,H,I){"use strict";I.r(H);var W={toString:function(R){for(var K="",N=R.length,e=0;e<N;e++)K+="["+R.start(e).toFixed(3)+","+R.end(e).toFixed(3)+"]";return K}};H.default=W},"./src/utils/timescale-conversion.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"toTimescaleFromBase",function(){return P}),I.d(H,"toTimescaleFromScale",function(){return R}),I.d(H,"toMsFromMpegTsClock",function(){return K}),I.d(H,"toMpegTsClockFromTimescale",function(){return N});var W=9e4;function P(e,C,E,g){E===void 0&&(E=1),g===void 0&&(g=!1);var h=e*C*E;return g?Math.round(h):h}function R(e,C,E,g){return E===void 0&&(E=1),g===void 0&&(g=!1),P(e,C,1/E,g)}function K(e,C){return C===void 0&&(C=!1),P(e,1e3,1/W,C)}function N(e,C){return C===void 0&&(C=1),P(e,W,1/C)}},"./src/utils/typed-array.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"sliceUint8",function(){return W});function W(P,R,K){return Uint8Array.prototype.slice?P.slice(R,K):new Uint8Array(Array.prototype.slice.call(P,R,K))}},"./src/utils/vttcue.ts":function(Q,H,I){"use strict";I.r(H),H.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var W=["","lr","rl"],P=["start","middle","end","left","right"];function R(E,g){if(typeof g!="string")return!1;if(!Array.isArray(E))return!1;var h=g.toLowerCase();return~E.indexOf(h)?h:!1}function K(E){return R(W,E)}function N(E){return R(P,E)}function e(E){for(var g=arguments.length,h=new Array(g>1?g-1:0),a=1;a<g;a++)h[a-1]=arguments[a];for(var i=1;i<arguments.length;i++){var l=arguments[i];for(var s in l)E[s]=l[s]}return E}function C(E,g,h){var a=this,i={enumerable:!0};a.hasBeenReset=!1;var l="",s=!1,n=E,r=g,t=h,b=null,v="",m=!0,T="auto",y="start",f=50,u="middle",o=50,c="middle";Object.defineProperty(a,"id",e({},i,{get:function(){return l},set:function(p){l=""+p}})),Object.defineProperty(a,"pauseOnExit",e({},i,{get:function(){return s},set:function(p){s=!!p}})),Object.defineProperty(a,"startTime",e({},i,{get:function(){return n},set:function(p){if(typeof p!="number")throw new TypeError("Start time must be set to a number.");n=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",e({},i,{get:function(){return r},set:function(p){if(typeof p!="number")throw new TypeError("End time must be set to a number.");r=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",e({},i,{get:function(){return t},set:function(p){t=""+p,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",e({},i,{get:function(){return b},set:function(p){b=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",e({},i,{get:function(){return v},set:function(p){var d=K(p);if(d===!1)throw new SyntaxError("An invalid or illegal string was specified.");v=d,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",e({},i,{get:function(){return m},set:function(p){m=!!p,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",e({},i,{get:function(){return T},set:function(p){if(typeof p!="number"&&p!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");T=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",e({},i,{get:function(){return y},set:function(p){var d=N(p);if(!d)throw new SyntaxError("An invalid or illegal string was specified.");y=d,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",e({},i,{get:function(){return f},set:function(p){if(p<0||p>100)throw new Error("Position must be between 0 and 100.");f=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",e({},i,{get:function(){return u},set:function(p){var d=N(p);if(!d)throw new SyntaxError("An invalid or illegal string was specified.");u=d,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",e({},i,{get:function(){return o},set:function(p){if(p<0||p>100)throw new Error("Size must be between 0 and 100.");o=p,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",e({},i,{get:function(){return c},set:function(p){var d=N(p);if(!d)throw new SyntaxError("An invalid or illegal string was specified.");c=d,this.hasBeenReset=!0}})),a.displayState=void 0}return C.prototype.getCueAsHTML=function(){var E=self.WebVTT;return E.convertCueToDOMTree(self,this.text)},C}()},"./src/utils/vttparser.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"parseTimeStamp",function(){return R}),I.d(H,"fixLineBreaks",function(){return g}),I.d(H,"VTTParser",function(){return h});var W=I("./src/utils/vttcue.ts"),P=function(){function a(){}var i=a.prototype;return i.decode=function(s,n){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},a}();function R(a){function i(s,n,r,t){return(s|0)*3600+(n|0)*60+(r|0)+parseFloat(t||0)}var l=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?i(l[2],l[3],0,l[4]):i(l[1],l[2],l[3],l[4]):null}var K=function(){function a(){this.values=Object.create(null)}var i=a.prototype;return i.set=function(s,n){!this.get(s)&&n!==""&&(this.values[s]=n)},i.get=function(s,n,r){return r?this.has(s)?this.values[s]:n[r]:this.has(s)?this.values[s]:n},i.has=function(s){return s in this.values},i.alt=function(s,n,r){for(var t=0;t<r.length;++t)if(n===r[t]){this.set(s,n);break}},i.integer=function(s,n){/^-?\d+$/.test(n)&&this.set(s,parseInt(n,10))},i.percent=function(s,n){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(n)){var r=parseFloat(n);if(r>=0&&r<=100)return this.set(s,r),!0}return!1},a}();function N(a,i,l,s){var n=s?a.split(s):[a];for(var r in n){if(typeof n[r]!="string")continue;var t=n[r].split(l);if(t.length!==2)continue;var b=t[0],v=t[1];i(b,v)}}var e=new W.default(0,0,""),C=e.align==="middle"?"middle":"center";function E(a,i,l){var s=a;function n(){var b=R(a);if(b===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),b}function r(b,v){var m=new K;N(b,function(f,u){var o;switch(f){case"region":for(var c=l.length-1;c>=0;c--)if(l[c].id===u){m.set(f,l[c].region);break}break;case"vertical":m.alt(f,u,["rl","lr"]);break;case"line":o=u.split(","),m.integer(f,o[0]),m.percent(f,o[0])&&m.set("snapToLines",!1),m.alt(f,o[0],["auto"]),o.length===2&&m.alt("lineAlign",o[1],["start",C,"end"]);break;case"position":o=u.split(","),m.percent(f,o[0]),o.length===2&&m.alt("positionAlign",o[1],["start",C,"end","line-left","line-right","auto"]);break;case"size":m.percent(f,u);break;case"align":m.alt(f,u,["start",C,"end","left","right"]);break}},/:/,/\s/),v.region=m.get("region",null),v.vertical=m.get("vertical","");var T=m.get("line","auto");T==="auto"&&e.line===-1&&(T=-1),v.line=T,v.lineAlign=m.get("lineAlign","start"),v.snapToLines=m.get("snapToLines",!0),v.size=m.get("size",100),v.align=m.get("align",C);var y=m.get("position","auto");y==="auto"&&e.position===50&&(y=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=y}function t(){a=a.replace(/^\s+/,"")}if(t(),i.startTime=n(),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=n(),t(),r(a,i)}function g(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}var h=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new P,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 n=this;s&&(n.buffer+=n.decoder.decode(s,{stream:!0}));function r(){var y=n.buffer,f=0;for(y=g(y);f<y.length&&y[f]!=="\r"&&y[f]!==`
|
|
`;)++f;var u=y.substr(0,f);return y[f]==="\r"&&++f,y[f]===`
|
|
`&&++f,n.buffer=y.substr(f),u}function t(y){N(y,function(f,u){},/:/)}try{var b="";if(n.state==="INITIAL"){if(!/\r\n|\n/.test(n.buffer))return this;b=r();var v=b.match(/^()?WEBVTT([ \t].*)?$/);if(!v||!v[0])throw new Error("Malformed WebVTT signature.");n.state="HEADER"}for(var m=!1;n.buffer;){if(!/\r\n|\n/.test(n.buffer))return this;m?m=!1:b=r();switch(n.state){case"HEADER":/:/.test(b)?t(b):b||(n.state="ID");continue;case"NOTE":b||(n.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(b)){n.state="NOTE";break}if(!b)continue;if(n.cue=new W.default(0,0,""),n.state="CUE",b.indexOf("-->")===-1){n.cue.id=b;continue}case"CUE":if(!n.cue){n.state="BADCUE";continue}try{E(b,n.cue,n.regionList)}catch(y){n.cue=null,n.state="BADCUE";continue}n.state="CUETEXT";continue;case"CUETEXT":{var T=b.indexOf("-->")!==-1;if(!b||T&&(m=!0)){n.oncue&&n.cue&&n.oncue(n.cue),n.cue=null,n.state="ID";continue}if(n.cue===null)continue;n.cue.text&&(n.cue.text+=`
|
|
`),n.cue.text+=b}continue;case"BADCUE":b||(n.state="ID")}}}catch(y){n.state==="CUETEXT"&&n.cue&&n.oncue&&n.oncue(n.cue),n.cue=null,n.state=n.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(n){s.onparsingerror&&s.onparsingerror(n)}return s.onflush&&s.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(Q,H,I){"use strict";I.r(H),I.d(H,"generateCueId",function(){return h}),I.d(H,"parseWebVTT",function(){return i});var W=I("./src/polyfills/number.ts"),P=I("./src/utils/vttparser.ts"),R=I("./src/demux/id3.ts"),K=I("./src/utils/timescale-conversion.ts"),N=I("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,C=function(s,n,r){return r===void 0&&(r=0),s.substr(r,n.length)===n},E=function(s){var n=parseInt(s.substr(-3)),r=parseInt(s.substr(-6,2)),t=parseInt(s.substr(-9,2)),b=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(W.isFiniteNumber)(n)||!Object(W.isFiniteNumber)(r)||!Object(W.isFiniteNumber)(t)||!Object(W.isFiniteNumber)(b))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return n+=1e3*r,n+=60*1e3*t,n+=60*60*1e3*b,n},g=function(s){for(var n=5381,r=s.length;r;)n=n*33^s.charCodeAt(--r);return(n>>>0).toString()};function h(l,s,n){return g(l.toString())+g(s.toString())+g(n)}var a=function(s,n,r){var t=s[n],b=s[t.prevCC];if(!b||!b.new&&t.new){s.ccOffset=s.presentationOffset=t.start,t.new=!1;return}for(;(v=b)!==null&&v!==void 0&&v.new;){var v;s.ccOffset+=t.start-b.start,t.new=!1,t=b,b=s[t.prevCC]}s.presentationOffset=r};function i(l,s,n,r,t,b,v,m){var T=new P.VTTParser,y=Object(R.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(e,`
|
|
`).split(`
|
|
`),f=[],u=Object(K.toMpegTsClockFromTimescale)(s,n),o="00:00.000",c=0,_=0,p,d=!0,A=!1;T.oncue=function(D){var S=r[t],L=r.ccOffset,M=(c-u)/9e4;if(S!=null&&S.new&&(_!==void 0?L=r.ccOffset=S.start:a(r,t,M)),M&&(L=M-r.presentationOffset),A){var O=D.endTime-D.startTime,j=Object(N.normalizePts)((D.startTime+L-_)*9e4,b*9e4)/9e4;D.startTime=j,D.endTime=j+O}var G=D.text.trim();D.text=decodeURIComponent(encodeURIComponent(G)),D.id||(D.id=h(D.startTime,D.endTime,G)),D.endTime>0&&f.push(D)},T.onparsingerror=function(D){p=D},T.onflush=function(){if(p){m(p);return}v(f)},y.forEach(function(D){if(d)if(C(D,"X-TIMESTAMP-MAP=")){d=!1,A=!0,D.substr(16).split(",").forEach(function(S){C(S,"LOCAL:")?o=S.substr(6):C(S,"MPEGTS:")&&(c=parseInt(S.substr(7)))});try{_=E(o)/1e3}catch(S){A=!1,p=S}return}else D===""&&(d=!1);T.parse(D+`
|
|
`)}),T.flush()}},"./src/utils/xhr-loader.ts":function(Q,H,I){"use strict";I.r(H);var W=I("./src/utils/logger.ts"),P=I("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,K=function(){function N(C){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=C?C.xhrSetup:null,this.stats=new P.LoadStats,this.retryDelay=0}var e=N.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var E=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),E&&(E.onreadystatechange=null,E.onprogress=null,E.readyState!==4&&(this.stats.aborted=!0,E.abort()))},e.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(E,g,h){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=E,this.config=g,this.callbacks=h,this.retryDelay=g.retryDelay,this.loadInternal()},e.loadInternal=function(){var E=this.config,g=this.context;if(!E)return;var h=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var i=this.xhrSetup;try{if(i)try{i(h,g.url)}catch(n){h.open("GET",g.url,!0),i(h,g.url)}h.readyState||h.open("GET",g.url,!0);var l=this.context.headers;if(l)for(var s in l)h.setRequestHeader(s,l[s])}catch(n){this.callbacks.onError({code:h.status,text:n.message},g,h);return}g.rangeEnd&&h.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout),h.send()},e.readystatechange=function(){var E=this.context,g=this.loader,h=this.stats;if(!E||!g)return;var a=g.readyState,i=this.config;if(h.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),h.loading.first===0&&(h.loading.first=Math.max(self.performance.now(),h.loading.start)),a===4){g.onreadystatechange=null,g.onprogress=null;var l=g.status;if(l>=200&&l<300){h.loading.end=Math.max(self.performance.now(),h.loading.first);var s,n;if(E.responseType==="arraybuffer"?(s=g.response,n=s.byteLength):(s=g.responseText,n=s.length),h.loaded=h.total=n,!this.callbacks)return;var r=this.callbacks.onProgress;if(r&&r(h,E,s,g),!this.callbacks)return;var t={url:g.responseURL,data:s};this.callbacks.onSuccess(t,h,E,g)}else h.retry>=i.maxRetry||l>=400&&l<499?(W.logger.error(l+" while loading "+E.url),this.callbacks.onError({code:l,text:g.statusText},E,g)):(W.logger.warn(l+" while loading "+E.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),h.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout)},e.loadtimeout=function(){W.logger.warn("timeout while loading "+this.context.url);var E=this.callbacks;E&&(this.abortInternal(),E.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(E){var g=this.stats;g.loaded=E.loaded,E.lengthComputable&&(g.total=E.total)},e.getCacheAge=function(){var E=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");E=g?parseFloat(g):null}return E},N}();H.default=K}}).default})},vHTk:function(Me,ne,B){Me.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return De});var Q=B("rePB"),H=B("VTBJ"),I=B("KQm4"),W=B("U8pU"),P=B("ODXe"),R=B("q1tI"),K=B("TSYQ"),N=B.n(K),e=B("Gytx"),C=B.n(e),E=B("Kwbf"),g=B("t23M"),h=B("qx4F"),a=B("6eGT"),i=B("IBYe"),l=B("Ff2n"),s=B("c+Xe"),n=B("fyJ8"),r=B("biw7");function t(oe,me,_e,we,fe){var ye=_e[oe]||{},re=_e[me]||{},Z,J;ye.fixed==="left"?Z=we.left[oe]:re.fixed==="right"&&(J=we.right[me]);var V=!1,Y=!1,q=!1,te=!1,le=_e[me+1],ve=_e[oe-1];if(fe==="rtl"){if(Z!==void 0){var Oe=ve&&ve.fixed==="left";te=!Oe}else if(J!==void 0){var He=le&&le.fixed==="right";q=!He}}else if(Z!==void 0){var ze=le&&le.fixed==="left";V=!ze}else if(J!==void 0){var Ne=ve&&ve.fixed==="right";Y=!Ne}return{fixLeft:Z,fixRight:J,lastFixLeft:V,firstFixRight:Y,lastFixRight:q,firstFixLeft:te,isSticky:we.isSticky}}var b=B("sR1s");function v(oe){var me=oe.cells,_e=oe.stickyOffsets,we=oe.flattenColumns,fe=oe.rowComponent,ye=oe.cellComponent,re=oe.onHeaderRow,Z=oe.index,J=R.useContext(r.a),V=J.prefixCls,Y=J.direction,q;re&&(q=re(me.map(function(le){return le.column}),Z));var te=Object(b.a)(me.map(function(le){return le.column}));return R.createElement(fe,Object.assign({},q),me.map(function(le,ve){var Oe=le.column,He=t(le.colStart,le.colEnd,we,_e,Y),ze;return Oe&&Oe.onHeaderCell&&(ze=le.column.onHeaderCell(Oe)),R.createElement(n.a,Object.assign({},le,{ellipsis:Oe.ellipsis,align:Oe.align,component:ye,prefixCls:V,key:te[ve]},He,{additionalProps:ze,rowType:"header"}))}))}v.displayName="HeaderRow";var m=v;function T(oe){var me=[];function _e(re,Z){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;me[J]=me[J]||[];var V=Z,Y=re.filter(Boolean).map(function(q){var te={key:q.key,className:q.className||"",children:q.title,column:q,colStart:V},le=1,ve=q.children;return ve&&ve.length>0&&(le=_e(ve,V,J+1).reduce(function(Oe,He){return Oe+He},0),te.hasSubColumns=!0),"colSpan"in q&&(le=q.colSpan),"rowSpan"in q&&(te.rowSpan=q.rowSpan),te.colSpan=le,te.colEnd=te.colStart+le-1,me[J].push(te),V+=le,le});return Y}_e(oe,0);for(var we=me.length,fe=function(Z){me[Z].forEach(function(J){!("rowSpan"in J)&&!J.hasSubColumns&&(J.rowSpan=we-Z)})},ye=0;ye<we;ye+=1)fe(ye);return me}function y(oe){var me=oe.stickyOffsets,_e=oe.columns,we=oe.flattenColumns,fe=oe.onHeaderRow,ye=R.useContext(r.a),re=ye.prefixCls,Z=ye.getComponent,J=R.useMemo(function(){return T(_e)},[_e]),V=Z(["header","wrapper"],"thead"),Y=Z(["header","row"],"tr"),q=Z(["header","cell"],"th");return R.createElement(V,{className:"".concat(re,"-thead")},J.map(function(te,le){var ve=R.createElement(m,{key:le,flattenColumns:we,cells:te,stickyOffsets:me,rowComponent:Y,cellComponent:q,onHeaderRow:fe,index:le});return ve}))}var f=y,u=B("hW8S");function o(oe){for(var me=oe.colWidths,_e=oe.columns,we=oe.columCount,fe=[],ye=we||_e.length,re=!1,Z=ye-1;Z>=0;Z-=1){var J=me[Z],V=_e&&_e[Z],Y=V&&V[u.a];(J||Y||re)&&(fe.unshift(R.createElement("col",Object.assign({key:Z,style:{width:J,minWidth:J}},Y))),re=!0)}return R.createElement("colgroup",null,fe)}var c=o;function _(oe,me){return Object(R.useMemo)(function(){for(var _e=[],we=0;we<me;we+=1){var fe=oe[we];if(fe!==void 0)_e[we]=fe;else return null}return _e},[oe.join("_"),me])}var p=R.forwardRef(function(oe,me){var _e=oe.noData,we=oe.columns,fe=oe.flattenColumns,ye=oe.colWidths,re=oe.columCount,Z=oe.stickyOffsets,J=oe.direction,V=oe.fixHeader,Y=oe.offsetHeader,q=oe.stickyClassName,te=oe.onScroll,le=Object(l.a)(oe,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),ve=R.useContext(r.a),Oe=ve.prefixCls,He=ve.scrollbarSize,ze=ve.isSticky,Ne=ze&&!V?0:He,Je=R.useRef(null),Qe=R.useCallback(function(st){Object(s.b)(me,st),Object(s.b)(Je,st)},[]);R.useEffect(function(){var st;function ut(Ue){var pt=Ue.currentTarget,Xe=Ue.deltaX;Xe&&(te({currentTarget:pt,scrollLeft:pt.scrollLeft+Xe}),Ue.preventDefault())}return(st=Je.current)===null||st===void 0||st.addEventListener("wheel",ut),function(){var Ue;(Ue=Je.current)===null||Ue===void 0||Ue.removeEventListener("wheel",ut)}},[]);var Ge=fe[fe.length-1],at={fixed:Ge?Ge.fixed:null,onHeaderCell:function(){return{className:"".concat(Oe,"-cell-scrollbar")}}},nt=Object(R.useMemo)(function(){return Ne?[].concat(Object(I.a)(we),[at]):we},[Ne,we]),rt=Object(R.useMemo)(function(){return Ne?[].concat(Object(I.a)(fe),[at]):fe},[Ne,fe]),dt=Object(R.useMemo)(function(){var st=Z.right,ut=Z.left;return Object(H.a)(Object(H.a)({},Z),{},{left:J==="rtl"?[].concat(Object(I.a)(ut.map(function(Ue){return Ue+Ne})),[0]):ut,right:J==="rtl"?st:[].concat(Object(I.a)(st.map(function(Ue){return Ue+Ne})),[0]),isSticky:ze})},[Ne,Z,ze]),et=_(ye,re);return R.createElement("div",{style:Object(H.a)({overflow:"hidden"},ze?{top:Y}:{}),ref:Qe,className:N()("".concat(Oe,"-header"),Object(Q.a)({},q,!!q))},R.createElement("table",{style:{tableLayout:"fixed",visibility:_e||et?null:"hidden"}},R.createElement(c,{colWidths:et?[].concat(Object(I.a)(et),[Ne]):[],columCount:re+1,columns:rt}),R.createElement(f,Object.assign({},le,{stickyOffsets:dt,columns:nt,flattenColumns:rt}))))});p.displayName="FixedHeader";var d=p,A=R.createContext(null),D=A;function S(oe){var me=oe.prefixCls,_e=oe.children,we=oe.component,fe=oe.cellComponent,ye=oe.fixHeader,re=oe.fixColumn,Z=oe.horizonScroll,J=oe.className,V=oe.expanded,Y=oe.componentWidth,q=oe.colSpan,te=R.useContext(r.a),le=te.scrollbarSize;return R.useMemo(function(){var ve=_e;return re&&(ve=R.createElement("div",{style:{width:Y-(ye?le:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(me,"-expanded-row-fixed")},ve)),R.createElement(we,{className:J,style:{display:V?null:"none"}},R.createElement(n.a,{component:fe,prefixCls:me,colSpan:q},ve))},[_e,we,ye,Z,J,V,Y,q,le])}var L=S;function M(oe){var me=oe.className,_e=oe.style,we=oe.record,fe=oe.index,ye=oe.rowKey,re=oe.getRowKey,Z=oe.rowExpandable,J=oe.expandedKeys,V=oe.onRow,Y=oe.indent,q=Y===void 0?0:Y,te=oe.rowComponent,le=oe.cellComponent,ve=oe.childrenColumnName,Oe=R.useContext(r.a),He=Oe.prefixCls,ze=Oe.fixedInfoList,Ne=R.useContext(D),Je=Ne.fixHeader,Qe=Ne.fixColumn,Ge=Ne.horizonScroll,at=Ne.componentWidth,nt=Ne.flattenColumns,rt=Ne.expandableType,dt=Ne.expandRowByClick,et=Ne.onTriggerExpand,st=Ne.rowClassName,ut=Ne.expandedRowClassName,Ue=Ne.indentSize,pt=Ne.expandIcon,Xe=Ne.expandedRowRender,Ve=Ne.expandIconColumnIndex,tt=R.useState(!1),vt=Object(P.a)(tt,2),Et=vt[0],bt=vt[1],Ot=J&&J.has(oe.recordKey);R.useEffect(function(){Ot&&bt(!0)},[Ot]);var Rt=rt==="row"&&(!Z||Z(we)),ct=rt==="nest",Tt=ve&&we&&we[ve],At=Rt||ct,_t;V&&(_t=V(we,fe));var Pt=function(x){if(dt&&At&&et(we,x),_t&&_t.onClick){for(var w,k=arguments.length,z=new Array(k>1?k-1:0),F=1;F<k;F++)z[F-1]=arguments[F];(w=_t).onClick.apply(w,[x].concat(z))}},It;typeof st=="string"?It=st:typeof st=="function"&&(It=st(we,fe,q));var Bt=Object(b.a)(nt),Wt=R.createElement(te,Object.assign({},_t,{"data-row-key":ye,className:N()(me,"".concat(He,"-row"),"".concat(He,"-row-level-").concat(q),It,_t&&_t.className),style:Object(H.a)(Object(H.a)({},_e),_t?_t.style:null),onClick:Pt}),nt.map(function(U,x){var w=U.render,k=U.dataIndex,z=U.className,F=Bt[x],ie=ze[x],Ce;x===(Ve||0)&&ct&&(Ce=R.createElement(R.Fragment,null,R.createElement("span",{style:{paddingLeft:"".concat(Ue*q,"px")},className:"".concat(He,"-row-indent indent-level-").concat(q)}),pt({prefixCls:He,expanded:Ot,expandable:Tt,record:we,onExpand:et})));var je;return U.onCell&&(je=U.onCell(we,fe)),R.createElement(n.a,Object.assign({className:z,ellipsis:U.ellipsis,align:U.align,component:le,prefixCls:He,key:F,record:we,index:fe,dataIndex:k,render:w,shouldCellUpdate:U.shouldCellUpdate},ie,{appendNode:Ce,additionalProps:je}))})),Mt;if(Rt&&(Et||Ot)){var Ft=Xe(we,fe,q+1,Ot),Ht=ut&&ut(we,fe,q);Mt=R.createElement(L,{expanded:Ot,className:N()("".concat(He,"-expanded-row"),"".concat(He,"-expanded-row-level-").concat(q+1),Ht),prefixCls:He,fixHeader:Je,fixColumn:Qe,horizonScroll:Ge,component:te,componentWidth:at,cellComponent:le,colSpan:nt.length},Ft)}var Jt;return Tt&&Ot&&(Jt=(we[ve]||[]).map(function(U,x){var w=re(U,x);return R.createElement(M,Object.assign({},oe,{key:w,rowKey:w,record:U,recordKey:w,index:x,indent:q+1}))})),R.createElement(R.Fragment,null,Wt,Mt,Jt)}M.displayName="BodyRow";var O=M,j=R.createContext(null),G=j;function X(oe){var me=oe.columnKey,_e=oe.onColumnResize,we=R.useRef();return R.useEffect(function(){we.current&&_e(me,we.current.offsetWidth)},[]),R.createElement(g.a,{onResize:function(ye){var re=ye.offsetWidth;_e(me,re)}},R.createElement("td",{ref:we,style:{padding:0,border:0,height:0}},R.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ee(oe){var me=oe.data,_e=oe.getRowKey,we=oe.measureColumnWidth,fe=oe.expandedKeys,ye=oe.onRow,re=oe.rowExpandable,Z=oe.emptyNode,J=oe.childrenColumnName,V=R.useContext(G),Y=V.onColumnResize,q=R.useContext(r.a),te=q.prefixCls,le=q.getComponent,ve=R.useContext(D),Oe=ve.fixHeader,He=ve.horizonScroll,ze=ve.flattenColumns,Ne=ve.componentWidth;return R.useMemo(function(){var Je=le(["body","wrapper"],"tbody"),Qe=le(["body","row"],"tr"),Ge=le(["body","cell"],"td"),at;me.length?at=me.map(function(rt,dt){var et=_e(rt,dt);return R.createElement(O,{key:et,rowKey:et,record:rt,recordKey:et,index:dt,rowComponent:Qe,cellComponent:Ge,expandedKeys:fe,onRow:ye,getRowKey:_e,rowExpandable:re,childrenColumnName:J})}):at=R.createElement(L,{expanded:!0,className:"".concat(te,"-placeholder"),prefixCls:te,fixHeader:Oe,fixColumn:He,horizonScroll:He,component:Qe,componentWidth:Ne,cellComponent:Ge,colSpan:ze.length},Z);var nt=Object(b.a)(ze);return R.createElement(Je,{className:"".concat(te,"-tbody")},we&&R.createElement("tr",{"aria-hidden":"true",className:"".concat(te,"-measure-row"),style:{height:0}},nt.map(function(rt){return R.createElement(X,{key:rt,columnKey:rt,onColumnResize:Y})})),at)},[me,te,ye,we,fe,_e,le,Ne,Z,ze])}var he=R.memo(ee);he.displayName="Body";var ge=he,de=B("wRmb"),Te=B("xEkU"),xe=B.n(Te);function ce(oe){var me=Object(R.useRef)(oe),_e=Object(R.useState)({}),we=Object(P.a)(_e,2),fe=we[1],ye=Object(R.useRef)(null),re=Object(R.useRef)([]);function Z(J){ye.current===null&&(re.current=[],ye.current=xe()(function(){re.current.forEach(function(V){me.current=V(me.current)}),ye.current=null,fe({})})),re.current.push(J)}return Object(R.useEffect)(function(){return function(){xe.a.cancel(ye.current)}},[]),[me.current,Z]}function ae(oe){var me=Object(R.useRef)(oe),_e=Object(R.useRef)(null);function we(){window.clearTimeout(_e.current)}function fe(re){me.current=re,we(),_e.current=window.setTimeout(function(){me.current=null,_e.current=null},100)}function ye(){return me.current}return Object(R.useEffect)(function(){return we},[]),[fe,ye]}function Le(oe,me,_e){var we=Object(R.useMemo)(function(){for(var fe=[],ye=[],re=0,Z=0,J=0;J<me;J+=1)if(_e==="rtl"){ye[J]=Z,Z+=oe[J]||0;var V=me-J-1;fe[V]=re,re+=oe[V]||0}else{fe[J]=re,re+=oe[J]||0;var Y=me-J-1;ye[Y]=Z,Z+=oe[Y]||0}return{left:fe,right:ye}},[oe,me,_e]);return we}var Ye=Le;function Fe(oe){var me=oe.className,_e=oe.children;return R.createElement("div",{className:me},_e)}var We=Fe,be=B("n6Qo");function Ee(oe){var me,_e=oe.prefixCls,we=oe.record,fe=oe.onExpand,ye=oe.expanded,re=oe.expandable,Z="".concat(_e,"-row-expand-icon");if(!re)return R.createElement("span",{className:N()(Z,"".concat(_e,"-row-spaced"))});var J=function(Y){fe(we,Y),Y.stopPropagation()};return R.createElement("span",{className:N()(Z,(me={},Object(Q.a)(me,"".concat(_e,"-row-expanded"),ye),Object(Q.a)(me,"".concat(_e,"-row-collapsed"),!ye),me)),onClick:J})}function Ae(oe,me,_e){var we=[];function fe(ye){(ye||[]).forEach(function(re,Z){we.push(me(re,Z)),fe(re[_e])})}return fe(oe),we}var Ie=B("zT1h"),$=B("y0+3"),se=function(me,_e){var we,fe,ye=me.scrollBodyRef,re=me.onScroll,Z=me.offsetScroll,J=R.useContext(r.a),V=J.prefixCls,Y=((we=ye.current)===null||we===void 0?void 0:we.scrollWidth)||0,q=((fe=ye.current)===null||fe===void 0?void 0:fe.clientWidth)||0,te=Y&&q*(q/Y),le=R.useRef(),ve=ce({scrollLeft:0,isHiddenScrollBar:!1}),Oe=Object(P.a)(ve,2),He=Oe[0],ze=Oe[1],Ne=R.useRef({delta:0,x:0}),Je=R.useState(!1),Qe=Object(P.a)(Je,2),Ge=Qe[0],at=Qe[1],nt=function(){at(!1)},rt=function(Ue){Ue.persist(),Ne.current.delta=Ue.pageX-He.scrollLeft,Ne.current.x=0,at(!0),Ue.preventDefault()},dt=function(Ue){var pt,Xe=Ue||((pt=window)===null||pt===void 0?void 0:pt.event),Ve=Xe.buttons;if(!Ge||Ve===0){Ge&&at(!1);return}var tt=Ne.current.x+Ue.pageX-Ne.current.x-Ne.current.delta;tt<=0&&(tt=0),tt+te>=q&&(tt=q-te),re({scrollLeft:tt/q*(Y+2)}),Ne.current.x=Ue.pageX},et=function(){var Ue=Object($.b)(ye.current).top,pt=Ue+ye.current.offsetHeight,Xe=document.documentElement.scrollTop+window.innerHeight;pt-Object(h.a)()<=Xe||Ue>=Xe-Z?ze(function(Ve){return Object(H.a)(Object(H.a)({},Ve),{},{isHiddenScrollBar:!0})}):ze(function(Ve){return Object(H.a)(Object(H.a)({},Ve),{},{isHiddenScrollBar:!1})})},st=function(Ue){ze(function(pt){return Object(H.a)(Object(H.a)({},pt),{},{scrollLeft:Ue/Y*q||0})})};return R.useImperativeHandle(_e,function(){return{setScrollLeft:st}}),R.useEffect(function(){var ut=Object(Ie.a)(document.body,"mouseup",nt,!1),Ue=Object(Ie.a)(document.body,"mousemove",dt,!1);return et(),function(){ut.remove(),Ue.remove()}},[te,Ge]),R.useEffect(function(){var ut=Object(Ie.a)(window,"scroll",et,!1),Ue=Object(Ie.a)(window,"resize",et,!1);return function(){ut.remove(),Ue.remove()}},[]),R.useEffect(function(){He.isHiddenScrollBar||ze(function(ut){var Ue,pt;return Object(H.a)(Object(H.a)({},ut),{},{scrollLeft:ye.current.scrollLeft/((Ue=ye.current)===null||Ue===void 0?void 0:Ue.scrollWidth)*((pt=ye.current)===null||pt===void 0?void 0:pt.clientWidth)})})},[He.isHiddenScrollBar]),Y<=q||!te||He.isHiddenScrollBar?null:R.createElement("div",{style:{height:Object(h.a)(),width:q,bottom:Z},className:"".concat(V,"-sticky-scroll")},R.createElement("div",{onMouseDown:rt,ref:le,className:N()("".concat(V,"-sticky-scroll-bar"),Object(Q.a)({},"".concat(V,"-sticky-scroll-bar-active"),Ge)),style:{width:"".concat(te,"px"),transform:"translate3d(".concat(He.scrollLeft,"px, 0, 0)")}}))},ue=R.forwardRef(se);function pe(oe,me){return R.useMemo(function(){var _e=!!oe;return{isSticky:_e,stickyClassName:_e?"".concat(me,"-sticky-header"):"",offsetHeader:Object(W.a)(oe)==="object"&&oe.offsetHeader||0,offsetScroll:Object(W.a)(oe)==="object"&&oe.offsetScroll||0}},[oe,me])}var Se=[],Pe={},De="rc-table-internal-hook",ke=R.memo(function(oe){var me=oe.children;return me},function(oe,me){return C()(oe.props,me.props)?oe.pingLeft!==me.pingLeft||oe.pingRight!==me.pingRight:!1});function Be(oe){var me,_e=oe.prefixCls,we=oe.className,fe=oe.rowClassName,ye=oe.style,re=oe.data,Z=oe.rowKey,J=oe.scroll,V=oe.tableLayout,Y=oe.direction,q=oe.title,te=oe.footer,le=oe.summary,ve=oe.id,Oe=oe.showHeader,He=oe.components,ze=oe.emptyText,Ne=oe.onRow,Je=oe.onHeaderRow,Qe=oe.internalHooks,Ge=oe.transformColumns,at=oe.internalRefs,nt=oe.sticky,rt=re||Se,dt=!!rt.length,et=R.useState(0),st=Object(P.a)(et,2),ut=st[0],Ue=st[1];R.useEffect(function(){Ue(Object(h.a)())});var pt=R.useMemo(function(){return Object(b.c)(He,{})},[He]),Xe=R.useCallback(function(lt,ht){return Object(b.b)(pt,lt)||ht},[pt]),Ve=R.useMemo(function(){return typeof Z=="function"?Z:function(lt){var ht=lt&<[Z];return ht}},[Z]),tt=Object(u.c)(oe),vt=tt.expandIcon,Et=tt.expandedRowKeys,bt=tt.defaultExpandedRowKeys,Ot=tt.defaultExpandAllRows,Rt=tt.expandedRowRender,ct=tt.onExpand,Tt=tt.onExpandedRowsChange,At=tt.expandRowByClick,_t=tt.rowExpandable,Pt=tt.expandIconColumnIndex,It=tt.expandedRowClassName,Bt=tt.childrenColumnName,Wt=tt.indentSize,Mt=vt||Ee,Ft=Bt||"children",Ht=R.useMemo(function(){return Rt?"row":oe.expandable&&Qe===De&&oe.expandable.__PARENT_RENDER_ICON__||rt.some(function(lt){return lt&&Object(W.a)(lt)==="object"&<[Ft]})?"nest":!1},[!!Rt,rt]),Jt=R.useState(function(){return bt||(Ot?Ae(rt,Ve,Ft):[])}),U=Object(P.a)(Jt,2),x=U[0],w=U[1],k=R.useMemo(function(){return new Set(Et||x||[])},[Et,x]),z=R.useCallback(function(lt){var ht=Ve(lt,rt.indexOf(lt)),St,Dt=k.has(ht);Dt?(k.delete(ht),St=Object(I.a)(k)):St=[].concat(Object(I.a)(k),[ht]),w(St),ct&&ct(!Dt,lt),Tt&&Tt(St)},[Ve,k,rt,ct,Tt]),F=R.useState(0),ie=Object(P.a)(F,2),Ce=ie[0],je=ie[1],$e=Object(de.b)(Object(H.a)(Object(H.a)(Object(H.a)({},oe),tt),{},{expandable:!!Rt,expandedKeys:k,getRowKey:Ve,onTriggerExpand:z,expandIcon:Mt,expandIconColumnIndex:Pt,direction:Y}),Qe===De?Ge:null),Re=Object(P.a)($e,2),Ze=Re[0],qe=Re[1],ft=R.useMemo(function(){return{columns:Ze,flattenColumns:qe}},[Ze,qe]),Lt=R.useRef(),Ut=R.useRef(),yt=R.useRef(),Nt=R.useState(!1),rr=Object(P.a)(Nt,2),Qt=rr[0],Kt=rr[1],jt=R.useState(!1),nr=Object(P.a)(jt,2),Zt=nr[0],lr=nr[1],Gt=ce(new Map),ir=Object(P.a)(Gt,2),ur=ir[0],zt=ir[1],kt=Object(b.a)(qe),Vt=kt.map(function(lt){return ur.get(lt)}),ar=R.useMemo(function(){return Vt},[Vt.join("_")]),Yt=Ye(ar,qe.length,Y),gt=J&&Object(b.d)(J.y),it=J&&Object(b.d)(J.x),xt=it&&qe.some(function(lt){var ht=lt.fixed;return ht}),ot=R.useRef(),wt=pe(nt,_e),mt=wt.isSticky,qt=wt.offsetHeader,Ct=wt.offsetScroll,sr=wt.stickyClassName,er,Xt,hr;gt&&(Xt={overflowY:"scroll",maxHeight:J.y}),it&&(er={overflowX:"auto"},gt||(Xt={overflowY:"hidden"}),hr={width:J.x===!0?"auto":J.x,minWidth:"100%"});var yr=R.useCallback(function(lt,ht){zt(function(St){var Dt=new Map(St);return Dt.set(lt,ht),Dt})},[]),Or=ae(null),_r=Object(P.a)(Or,2),Rr=_r[0],br=_r[1];function dr(lt,ht){if(!ht)return;typeof ht=="function"?ht(lt):ht.scrollLeft!==lt&&(ht.scrollLeft=lt)}var $t=function(ht){var St=ht.currentTarget,Dt=ht.scrollLeft,tr=typeof Dt=="number"?Dt:St.scrollLeft,Cr=St||Pe;if(!br()||br()===Cr){var vr;Rr(Cr),dr(tr,Ut.current),dr(tr,yt.current),dr(tr,(vr=ot.current)===null||vr===void 0?void 0:vr.setScrollLeft)}if(St){var Nr=St.scrollWidth,kr=St.clientWidth;Kt(tr>0),lr(tr<Nr-kr)}},cr=function(){yt.current&&$t({currentTarget:yt.current})},Ar=function(ht){var St=ht.width;cr(),je(Lt.current?Lt.current.offsetWidth:St)};R.useEffect(function(){return cr},[]),R.useEffect(function(){it&&cr()},[it]),R.useEffect(function(){Qe===De&&at&&(at.body.current=yt.current)});var Er=Xe(["table"],"table"),or=R.useMemo(function(){return V||(xt?J.x==="max-content"?"auto":"fixed":gt||qe.some(function(lt){var ht=lt.ellipsis;return ht})?"fixed":"auto")},[gt,xt,qe,V]),fr,pr={colWidths:ar,columCount:qe.length,stickyOffsets:Yt,onHeaderRow:Je,fixHeader:gt},Ir=R.useMemo(function(){return dt?null:typeof ze=="function"?ze():ze},[dt,ze]),Tr=R.createElement(ge,{data:rt,measureColumnWidth:gt||it||mt,expandedKeys:k,rowExpandable:_t,getRowKey:Ve,onRow:Ne,emptyNode:Ir,childrenColumnName:Ft}),xr=R.createElement(c,{colWidths:qe.map(function(lt){var ht=lt.width;return ht}),columns:qe}),Sr=le&&R.createElement(be.b,null,le(rt)),wr=Xe(["body"]);if(gt||mt){var mr;typeof wr=="function"?(mr=wr(rt,{scrollbarSize:ut,ref:yt,onScroll:$t}),pr.colWidths=qe.map(function(lt,ht){var St=lt.width,Dt=ht===Ze.length-1?St-ut:St;return typeof Dt=="number"&&!Number.isNaN(Dt)?Dt:(Object(E.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):mr=R.createElement("div",{style:Object(H.a)(Object(H.a)({},er),Xt),onScroll:$t,ref:yt,className:N()("".concat(_e,"-body"))},R.createElement(Er,{style:Object(H.a)(Object(H.a)({},hr),{},{tableLayout:or})},xr,Tr,Sr),mt&&R.createElement(ue,{ref:ot,offsetScroll:Ct,scrollBodyRef:yt,onScroll:$t})),fr=R.createElement(R.Fragment,null,Oe!==!1&&R.createElement(d,Object.assign({noData:!rt.length},pr,ft,{direction:Y,offsetHeader:qt,stickyClassName:sr,ref:Ut,onScroll:$t})),mr)}else fr=R.createElement("div",{style:Object(H.a)(Object(H.a)({},er),Xt),className:N()("".concat(_e,"-content")),onScroll:$t,ref:yt},R.createElement(Er,{style:Object(H.a)(Object(H.a)({},hr),{},{tableLayout:or})},xr,Oe!==!1&&R.createElement(f,Object.assign({},pr,ft)),Tr,Sr));var Lr=Object(u.b)(oe),gr=R.createElement("div",Object.assign({className:N()(_e,we,(me={},Object(Q.a)(me,"".concat(_e,"-rtl"),Y==="rtl"),Object(Q.a)(me,"".concat(_e,"-ping-left"),Qt),Object(Q.a)(me,"".concat(_e,"-ping-right"),Zt),Object(Q.a)(me,"".concat(_e,"-layout-fixed"),V==="fixed"),Object(Q.a)(me,"".concat(_e,"-fixed-header"),gt),Object(Q.a)(me,"".concat(_e,"-fixed-column"),xt),Object(Q.a)(me,"".concat(_e,"-scroll-horizontal"),it),Object(Q.a)(me,"".concat(_e,"-has-fix-left"),qe[0]&&qe[0].fixed),Object(Q.a)(me,"".concat(_e,"-has-fix-right"),qe[qe.length-1]&&qe[qe.length-1].fixed==="right"),me)),style:ye,id:ve,ref:Lt},Lr),R.createElement(ke,{pingLeft:Qt,pingRight:Zt,props:Object(H.a)(Object(H.a)({},oe),{},{stickyOffsets:Yt,mergedExpandedKeys:k})},q&&R.createElement(We,{className:"".concat(_e,"-title")},q(rt)),R.createElement("div",{className:"".concat(_e,"-container")},fr),te&&R.createElement(We,{className:"".concat(_e,"-footer")},te(rt))));it&&(gr=R.createElement(g.a,{onResize:Ar},gr));var Dr=R.useMemo(function(){return{prefixCls:_e,getComponent:Xe,scrollbarSize:ut,direction:Y,fixedInfoList:qe.map(function(lt,ht){return t(ht,ht,qe,Yt,Y)}),isSticky:mt}},[_e,Xe,ut,Y,qe,Yt,Y,mt]),Pr=R.useMemo(function(){return Object(H.a)(Object(H.a)({},ft),{},{tableLayout:or,rowClassName:fe,expandedRowClassName:It,componentWidth:Ce,fixHeader:gt,fixColumn:xt,horizonScroll:it,expandIcon:Mt,expandableType:Ht,expandRowByClick:At,expandedRowRender:Rt,onTriggerExpand:z,expandIconColumnIndex:Pt,indentSize:Wt})},[ft,or,fe,It,Ce,gt,xt,it,Mt,Ht,At,Rt,z,Pt,Wt]),Mr=R.useMemo(function(){return{onColumnResize:yr}},[yr]);return R.createElement(r.a.Provider,{value:Dr},R.createElement(D.Provider,{value:Pr},R.createElement(G.Provider,{value:Mr},gr)))}Be.Column=i.a,Be.ColumnGroup=a.a,Be.Summary=be.a,Be.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Ke=ne.b=Be},wRmb:function(Me,ne,B){"use strict";B.d(ne,"a",function(){return C});var Q=B("rePB"),H=B("KQm4"),I=B("VTBJ"),W=B("Ff2n"),P=B("q1tI"),R=B.n(P),K=B("Kwbf"),N=B("Zm9Q"),e=B("hW8S");function C(i){return Object(N.a)(i).filter(function(l){return P.isValidElement(l)}).map(function(l){var s=l.key,n=l.props,r=n.children,t=Object(W.a)(n,["children"]),b=Object(I.a)({key:s},t);return r&&(b.children=C(r)),b})}function E(i){return i.reduce(function(l,s){var n=s.fixed,r=n===!0?"left":n,t=s.children;return t&&t.length>0?[].concat(Object(H.a)(l),Object(H.a)(E(t).map(function(b){return Object(I.a)({fixed:r},b)}))):[].concat(Object(H.a)(l),[Object(I.a)(Object(I.a)({},s),{},{fixed:r})])},[])}function g(i){for(var l=!0,s=0;s<i.length;s+=1){var n=i[s];if(l&&n.fixed!=="left")l=!1;else if(!l&&n.fixed==="left"){Object(K.a)(!1,"Index ".concat(s-1," of `columns` missing `fixed='left'` prop."));break}}for(var r=!0,t=i.length-1;t>=0;t-=1){var b=i[t];if(r&&b.fixed!=="right")r=!1;else if(!r&&b.fixed==="right"){Object(K.a)(!1,"Index ".concat(t+1," of `columns` missing `fixed='right'` prop."));break}}}function h(i){return i.map(function(l){var s=l.fixed,n=Object(W.a)(l,["fixed"]),r=s;return s==="left"?r="right":s==="right"&&(r="left"),Object(I.a)({fixed:r},n)})}function a(i,l){var s=i.prefixCls,n=i.columns,r=i.children,t=i.expandable,b=i.expandedKeys,v=i.getRowKey,m=i.onTriggerExpand,T=i.expandIcon,y=i.rowExpandable,f=i.expandIconColumnIndex,u=i.direction,o=i.expandRowByClick,c=P.useMemo(function(){return n||C(r)},[n,r]),_=P.useMemo(function(){if(t){var A,D=f||0,S=c[D],L=(A={},Object(Q.a)(A,e.a,{className:"".concat(s,"-expand-icon-col")}),Object(Q.a)(A,"title",""),Object(Q.a)(A,"fixed",S?S.fixed:null),Object(Q.a)(A,"className","".concat(s,"-row-expand-icon-cell")),Object(Q.a)(A,"render",function(j,G,X){var ee=v(G,X),he=b.has(ee),ge=y?y(G):!0,de=T({prefixCls:s,expanded:he,expandable:ge,record:G,onExpand:m});return o?P.createElement("span",{onClick:function(xe){return xe.stopPropagation()}},de):de}),A),M=c.slice();return D>=0&&M.splice(D,0,L),M}return c},[t,c,v,b,T,u]),p=P.useMemo(function(){var A=_;return l&&(A=l(A)),A.length||(A=[{render:function(){return null}}]),A},[l,_,u]),d=P.useMemo(function(){return u==="rtl"?h(E(p)):E(p)},[p,u]);return[p,d]}ne.b=a},wwSX:function(Me,ne,B){Me.exports=B.p+"static/b2.2c844a2a.svg"},"y0+3":function(Me,ne,B){"use strict";B.d(ne,"a",function(){return E}),B.d(ne,"b",function(){return h});var Q=/margin|padding|width|height|max|min|offset/,H={left:!0,top:!0},I={cssFloat:1,styleFloat:1,float:1};function W(a){return a.nodeType===1?a.ownerDocument.defaultView.getComputedStyle(a,null):{}}function P(a,i,l){if(i=i.toLowerCase(),l==="auto"){if(i==="height")return a.offsetHeight;if(i==="width")return a.offsetWidth}return i in H||(H[i]=Q.test(i)),H[i]?parseFloat(l)||0:l}function R(a,i){var l=arguments.length,s=W(a);return i=I[i]?"cssFloat"in a.style?"cssFloat":"styleFloat":i,l===1?s:P(a,i,s[i]||a.style[i])}function K(a,i,l){var s=arguments.length;if(i=I[i]?"cssFloat"in a.style?"cssFloat":"styleFloat":i,s===3)return typeof l=="number"&&Q.test(i)&&(l="".concat(l,"px")),a.style[i]=l,l;for(var n in i)i.hasOwnProperty(n)&&K(a,n,i[n]);return W(a)}function N(a){return a===document.body?document.documentElement.clientWidth:a.offsetWidth}function e(a){return a===document.body?window.innerHeight||document.documentElement.clientHeight:a.offsetHeight}function C(){var a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),i=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:a,height:i}}function E(){var a=document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return{width:a,height:i}}function g(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function h(a){var i=a.getBoundingClientRect(),l=document.documentElement;return{left:i.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:i.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}},zlzj:function(Me,ne,B){Me.exports=B.p+"static/b3.30079151.svg"}}]);
|