|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[193,5,7,8,10],{"+92d":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/assets/images/question/b1.svg ***!
|
|
|
\*******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/b1.2ca4a493.svg"},"+RDj":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/assets/images/question/dau.svg ***!
|
|
|
\********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/dau.2111230e.svg"},"+ua5":
|
|
|
/*!************************************************!*\
|
|
|
!*** ./src/components/monaco-editor/index.css ***!
|
|
|
\************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){},"/cxE":
|
|
|
/*!*****************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***!
|
|
|
\*****************************************************************/
|
|
|
/*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */
|
|
|
/*! exports used: canceled, illegalArgument, illegalState, isPromiseCanceledError, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization */function(t,e,n){"use strict";n.d(e,"e",(function(){return r})),n.d(e,"f",(function(){return o})),n.d(e,"g",(function(){return s})),n.d(e,"d",(function(){return a})),n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return u}));var i=new(function(){function t(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout((function(){if(t.stack)throw new Error(t.message+"\n\n"+t.stack);throw t}),0)}}return t.prototype.emit=function(t){this.listeners.forEach((function(e){e(t)}))},t.prototype.onUnexpectedError=function(t){this.unexpectedErrorHandler(t),this.emit(t)},t.prototype.onUnexpectedExternalError=function(t){this.unexpectedErrorHandler(t)},t}());function r(t){a(t)||i.onUnexpectedError(t)}function o(t){a(t)||i.onUnexpectedExternalError(t)}function s(t){return t instanceof Error?{$isError:!0,name:t.name,message:t.message,stack:t.stacktrace||t.stack}:t}function a(t){return t instanceof Error&&"Canceled"===t.name&&"Canceled"===t.message}function l(){var t=new Error("Canceled");return t.name=t.message,t}function c(t){return t?new Error("Illegal argument: "+t):new Error("Illegal argument")}function u(t){return t?new Error("Illegal state: "+t):new Error("Illegal state")}},"24hK":
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***!
|
|
|
\*********************************************************************/
|
|
|
/*! exports provided: LinkedList */
|
|
|
/*! exports used: LinkedList */function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(/*! ./iterator.js */"JYp7"),r=function(){function t(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}return t.Undefined=new t(void 0),t}(),o=function(){function t(){this._first=r.Undefined,this._last=r.Undefined,this._size=0}return Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),t.prototype.isEmpty=function(){return this._first===r.Undefined},t.prototype.clear=function(){this._first=r.Undefined,this._last=r.Undefined,this._size=0},t.prototype.unshift=function(t){return this._insert(t,!1)},t.prototype.push=function(t){return this._insert(t,!0)},t.prototype._insert=function(t,e){var n=this,i=new r(t);if(this._first===r.Undefined)this._first=i,this._last=i;else if(e){var o=this._last;this._last=i,i.prev=o,o.next=i}else{var s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;var a=!1;return function(){a||(a=!0,n._remove(i))}},t.prototype.shift=function(){if(this._first!==r.Undefined){var t=this._first.element;return this._remove(this._first),t}},t.prototype.pop=function(){if(this._last!==r.Undefined){var t=this._last.element;return this._remove(this._last),t}},t.prototype._remove=function(t){if(t.prev!==r.Undefined&&t.next!==r.Undefined){var e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===r.Undefined&&t.next===r.Undefined?(this._first=r.Undefined,this._last=r.Undefined):t.next===r.Undefined?(this._last=this._last.prev,this._last.next=r.Undefined):t.prev===r.Undefined&&(this._first=this._first.next,this._first.prev=r.Undefined);this._size-=1},t.prototype.iterator=function(){var t,e=this._first;return{next:function(){return e===r.Undefined?i.c:(t?t.value=e.element:t={done:!1,value:e.element},e=e.next,t)}}},t.prototype.toArray=function(){for(var t=[],e=this._first;e!==r.Undefined;e=e.next)t.push(e.element);return t},t}()},"3SPk":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/assets/images/question/c.svg ***!
|
|
|
\******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/c.d5c4074c.svg"},"5A5F":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./src/pages/Question/Index/index.less?modules ***!
|
|
|
\*****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={flex_box_center:"flex_box_center___3fvo9",flex_space_between:"flex_space_between___2dIWe",flex_box_vertical_center:"flex_box_vertical_center___213Et",flex_box_center_end:"flex_box_center_end___1GXlY",flex_box_column:"flex_box_column___2XTWO",wrap:"wrap___1JbzU",bg:"bg___Dxa5l",btnWrap:"btnWrap___1CEeA",text:"text___ufYpy",btn:"btn___33IXa",content:"content___2Crhb",left:"left___12ObT",filterPoint:"filterPoint___1wSyY",btnWarp:"btnWarp___XLUgV",btnActive:"btnActive___2vIUq",action:"action___m_eZE",btnMask:"btnMask___epWeB",filterOrigin:"filterOrigin___OKol4",line:"line___psQHn",control:"control___1SAJX",table:"table___1Q9AI",tabWarp:"tabWarp___3884f",tabWarp2:"tabWarp2___1f1Zo",customTable:"customTable___6Ubut","btn-style-1":"btn-style-1___m4kGi","btn-style-2":"btn-style-2___2uJ8s","btn-style-3":"btn-style-3___3kuYl",right:"right___Ie2u1",title:"title___1uK2v",sort:"sort___1hyjY",titles:"titles___1i-V6",li:"li___3lR-W",titleWarp:"titleWarp___t0Zdh",hov:"hov___30B5q",hovBtn:"hovBtn___3ciGX",tag:"tag___hllWE",problemsclose:"problemsclose___1X9HB",imgsrc:"imgsrc___3koep"}},"6+eU":
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/rc-pagination/es/index.js + 4 modules ***!
|
|
|
\************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-pagination/es/locale/zh_CN.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var i=n("wx14"),r=n("rePB"),o=n("VTBJ"),s=n("1OyB"),a=n("vuIU"),l=n("Ji7U"),c=n("LK+K"),u=n("q1tI"),h=n.n(u),d=n("TSYQ"),f=n.n(d),p=function(t){var e,n="".concat(t.rootPrefixCls,"-item"),i=f()(n,"".concat(n,"-").concat(t.page),(e={},Object(r.a)(e,"".concat(n,"-active"),t.active),Object(r.a)(e,t.className,!!t.className),Object(r.a)(e,"".concat(n,"-disabled"),!t.page),e));return h.a.createElement("li",{title:t.showTitle?t.page:null,className:i,onClick:function(){t.onClick(t.page)},onKeyPress:function(e){t.onKeyPress(e,t.onClick,t.page)},tabIndex:"0"},t.itemRender(t.page,"page",h.a.createElement("a",{rel:"nofollow"},t.page)))},v=13,g=38,m=40,y=function(t){Object(l.a)(n,t);var e=Object(c.a)(n);function n(){var t;Object(s.a)(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))).state={goInputText:""},t.buildOptionText=function(e){return"".concat(e," ").concat(t.props.locale.items_per_page)},t.changeSize=function(e){t.props.changeSize(Number(e))},t.handleChange=function(e){t.setState({goInputText:e.target.value})},t.handleBlur=function(e){var n=t.props,i=n.goButton,r=n.quickGo,o=n.rootPrefixCls,s=t.state.goInputText;i||""===s||e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(o,"-prev"))>=0||e.relatedTarget.className.indexOf("".concat(o,"-next"))>=0)||(t.setState({goInputText:""}),r(t.getValidValue()))},t.go=function(e){""!==t.state.goInputText&&(e.keyCode!==v&&"click"!==e.type||(t.setState({goInputText:""}),t.props.quickGo(t.getValidValue())))},t}return Object(a.a)(n,[{key:"getValidValue",value:function(){var t=this.state,e=t.goInputText,n=t.current;return!e||isNaN(e)?n:Number(e)}},{key:"getPageSizeOptions",value:function(){var t=this.props,e=t.pageSize,n=t.pageSizeOptions;return n.some((function(t){return t.toString()===e.toString()}))?n:n.concat([e.toString()]).sort((function(t,e){return(isNaN(Number(t))?0:Number(t))-(isNaN(Number(e))?0:Number(e))}))}},{key:"render",value:function(){var t=this,e=this.props,n=e.pageSize,i=e.locale,r=e.rootPrefixCls,o=e.changeSize,s=e.quickGo,a=e.goButton,l=e.selectComponentClass,c=e.buildOptionText,u=e.selectPrefixCls,d=e.disabled,f=this.state.goInputText,p="".concat(r,"-options"),v=l,g=null,m=null,y=null;if(!o&&!s)return null;var b=this.getPageSizeOptions();if(o&&v){var E=b.map((function(e,n){return h.a.createElement(v.Option,{key:n,value:e.toString()},(c||t.buildOptionText)(e))}));g=h.a.createElement(v,{disabled:d,prefixCls:u,showSearch:!1,className:"".concat(p,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(n||b[0]).toString(),onChange:this.changeSize,getPopupContainer:function(t){return t.parentNode}},E)}return s&&(a&&(y="boolean"==typeof a?h.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:d,className:"".concat(p,"-quick-jumper-button")},i.jump_to_confirm):h.a.createElement("span",{onClick:this.go,onKeyUp:this.go},a)),m=h.a.createElement("div",{className:"".concat(p,"-quick-jumper")},i.jump_to,h.a.createElement("input",{disabled:d,type:"text",value:f,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),i.page,y)),h.a.createElement("li",{className:"".concat(p)},g,m)}}]),n}(h.a.Component);y.defaultProps={pageSizeOptions:["10","20","50","100"]};var b=y,E=n("N2Kk");function C(){}function S(t,e,n){var i=void 0===t?e.pageSize:t;return Math.floor((n.total-1)/i)+1}var k=function(t){Object(l.a)(n,t);var e=Object(c.a)(n);function n(t){var i;Object(s.a)(this,n),(i=e.call(this,t)).getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(S(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(t,e){var n=i.props.prefixCls,r=t||h.a.createElement("button",{type:"button","aria-label":e,className:"".concat(n,"-item-link")});return"function"==typeof t&&(r=h.a.createElement(t,Object(o.a)({},i.props))),r},i.savePaginationNode=function(t){i.paginationNode=t},i.isValid=function(t){return"number"==typeof(e=t)&&isFinite(e)&&Math.floor(e)===e&&t!==i.state.current;var e},i.shouldDisplayQuickJumper=function(){var t=i.props,e=t.showQuickJumper,n=t.pageSize;return!(t.total<=n)&&e},i.handleKeyDown=function(t){t.keyCode!==g&&t.keyCode!==m||t.preventDefault()},i.handleKeyUp=function(t){var e=i.getValidValue(t);e!==i.state.currentInputValue&&i.setState({currentInputValue:e}),t.keyCode===v?i.handleChange(e):t.keyCode===g?i.handleChange(e-1):t.keyCode===m&&i.handleChange(e+1)},i.changePageSize=function(t){var e=i.state.current,n=S(t,i.state,i.props);e=e>n?n:e,0===n&&(e=i.state.current),"number"==typeof t&&("pageSize"in i.props||i.setState({pageSize:t}),"current"in i.props||i.setState({current:e,currentInputValue:e})),i.props.onShowSizeChange(e,t),"onChange"in i.props&&i.props.onChange&&i.props.onChange(e,t)},i.handleChange=function(t){var e=i.props.disabled,n=t;if(i.isValid(n)&&!e){var r=S(void 0,i.state,i.props);n>r?n=r:n<1&&(n=1),"current"in i.props||i.setState({current:n,currentInputValue:n});var o=i.state.pageSize;return i.props.onChange(n,o),n}return i.state.current},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current<S(void 0,i.state,i.props)},i.runIfEnter=function(t,e){if("Enter"===t.key||13===t.charCode){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];e.apply(void 0,i)}},i.runIfEnterPrev=function(t){i.runIfEnter(t,i.prev)},i.runIfEnterNext=function(t){i.runIfEnter(t,i.next)},i.runIfEnterJumpPrev=function(t){i.runIfEnter(t,i.jumpPrev)},i.runIfEnterJumpNext=function(t){i.runIfEnter(t,i.jumpNext)},i.handleGoTO=function(t){t.keyCode!==v&&"click"!==t.type||i.handleChange(i.state.currentInputValue)};var r=t.onChange!==C;"current"in t&&!r&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var a=t.defaultCurrent;"current"in t&&(a=t.current);var l=t.defaultPageSize;return"pageSize"in t&&(l=t.pageSize),a=Math.min(a,S(l,void 0,t)),i.state={current:a,currentInputValue:a,pageSize:l},i}return Object(a.a)(n,[{key:"componentDidUpdate",value:function(t,e){var n=this.props.prefixCls;if(e.current!==this.state.current&&this.paginationNode){var i=this.paginationNode.querySelector(".".concat(n,"-item-").concat(e.current));i&&document.activeElement===i&&i.blur()}}},{key:"getValidValue",value:function(t){var e=t.target.value,n=S(void 0,this.state,this.props),i=this.state.currentInputValue;return""===e?e:isNaN(Number(e))?i:e>=n?n:Number(e)}},{key:"getShowSizeChanger",value:function(){var t=this.props,e=t.showSizeChanger,n=t.total,i=t.totalBoundaryShowSizeChanger;return void 0!==e?e:n>i}},{key:"renderPrev",value:function(t){var e=this.props,n=e.prevIcon,i=(0,e.itemRender)(t,"prev",this.getItemIcon(n,"prev page")),r=!this.hasPrev();return Object(u.isValidElement)(i)?Object(u.cloneElement)(i,{disabled:r}):i}},{key:"renderNext",value:function(t){var e=this.props,n=e.nextIcon,i=(0,e.itemRender)(t,"next",this.getItemIcon(n,"next page")),r=!this.hasNext();return Object(u.isValidElement)(i)?Object(u.cloneElement)(i,{disabled:r}):i}},{key:"render",value:function(){var t=this,e=this.props,n=e.prefixCls,o=e.className,s=e.style,a=e.disabled,l=e.hideOnSinglePage,c=e.total,d=e.locale,v=e.showQuickJumper,g=e.showLessItems,m=e.showTitle,y=e.showTotal,E=e.simple,C=e.itemRender,k=e.showPrevNextJumpers,w=e.jumpPrevIcon,x=e.jumpNextIcon,T=e.selectComponentClass,O=e.selectPrefixCls,_=e.pageSizeOptions,A=this.state,L=A.current,R=A.pageSize,D=A.currentInputValue;if(!0===l&&c<=R)return null;var I=S(void 0,this.state,this.props),M=[],P=null,N=null,j=null,B=null,F=null,U=v&&v.goButton,G=g?1:2,H=L-1>0?L-1:0,z=L+1<I?L+1:I,V=Object.keys(this.props).reduce((function(e,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)&&"role"!==n||(e[n]=t.props[n]),e}),{});if(E)return U&&(F="boolean"==typeof U?h.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},d.jump_to_confirm):h.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},U),F=h.a.createElement("li",{title:m?"".concat(d.jump_to).concat(L,"/").concat(I):null,className:"".concat(n,"-simple-pager")},F)),h.a.createElement("ul",Object(i.a)({className:f()(n,"".concat(n,"-simple"),Object(r.a)({},"".concat(n,"-disabled"),a),o),style:s,ref:this.savePaginationNode},V),h.a.createElement("li",{title:m?d.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:f()("".concat(n,"-prev"),Object(r.a)({},"".concat(n,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(H)),h.a.createElement("li",{title:m?"".concat(L,"/").concat(I):null,className:"".concat(n,"-simple-pager")},h.a.createElement("input",{type:"text",value:D,disabled:a,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),h.a.createElement("span",{className:"".concat(n,"-slash")},"/"),I),h.a.createElement("li",{title:m?d.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:f()("".concat(n,"-next"),Object(r.a)({},"".concat(n,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(z)),F);if(I<=3+2*G){var K={locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:m,itemRender:C};I||M.push(h.a.createElement(p,Object(i.a)({},K,{key:"noPager",page:I,className:"".concat(n,"-disabled")})));for(var W=1;W<=I;W+=1){var Y=L===W;M.push(h.a.createElement(p,Object(i.a)({},K,{key:W,page:W,active:Y})))}}else{var q=g?d.prev_3:d.prev_5,X=g?d.next_3:d.next_5;k&&(P=h.a.createElement("li",{title:m?q:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:f()("".concat(n,"-jump-prev"),Object(r.a)({},"".concat(n,"-jump-prev-custom-icon"),!!w))},C(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(w,"prev page"))),N=h.a.createElement("li",{title:m?X:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:f()("".concat(n,"-jump-next"),Object(r.a)({},"".concat(n,"-jump-next-custom-icon"),!!x))},C(this.getJumpNextPage(),"jump-next",this.getItemIcon(x,"next page")))),B=h.a.createElement(p,{locale:d,last:!0,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:I,page:I,active:!1,showTitle:m,itemRender:C}),j=h.a.createElement(p,{locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:m,itemRender:C});var $=Math.max(1,L-G),Q=Math.min(L+G,I);L-1<=G&&(Q=1+2*G),I-L<=G&&($=I-2*G);for(var J=$;J<=Q;J+=1){var Z=L===J;M.push(h.a.createElement(p,{locale:d,rootPrefixCls:n,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:J,page:J,active:Z,showTitle:m,itemRender:C}))}L-1>=2*G&&3!==L&&(M[0]=Object(u.cloneElement)(M[0],{className:"".concat(n,"-item-after-jump-prev")}),M.unshift(P)),I-L>=2*G&&L!==I-2&&(M[M.length-1]=Object(u.cloneElement)(M[M.length-1],{className:"".concat(n,"-item-before-jump-next")}),M.push(N)),1!==$&&M.unshift(j),Q!==I&&M.push(B)}var tt=null;y&&(tt=h.a.createElement("li",{className:"".concat(n,"-total-text")},y(c,[0===c?0:(L-1)*R+1,L*R>c?c:L*R])));var et=!this.hasPrev()||!I,nt=!this.hasNext()||!I;return h.a.createElement("ul",Object(i.a)({className:f()(n,o,Object(r.a)({},"".concat(n,"-disabled"),a)),style:s,unselectable:"unselectable",ref:this.savePaginationNode},V),tt,h.a.createElement("li",{title:m?d.prev_page:null,onClick:this.prev,tabIndex:et?null:0,onKeyPress:this.runIfEnterPrev,className:f()("".concat(n,"-prev"),Object(r.a)({},"".concat(n,"-disabled"),et)),"aria-disabled":et},this.renderPrev(H)),M,h.a.createElement("li",{title:m?d.next_page:null,onClick:this.next,tabIndex:nt?null:0,onKeyPress:this.runIfEnterNext,className:f()("".concat(n,"-next"),Object(r.a)({},"".concat(n,"-disabled"),nt)),"aria-disabled":nt},this.renderNext(z)),h.a.createElement(b,{disabled:a,locale:d,rootPrefixCls:n,selectComponentClass:T,selectPrefixCls:O,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:L,pageSize:R,pageSizeOptions:_,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:U}))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n={};if("current"in t&&(n.current=t.current,t.current!==e.current&&(n.currentInputValue=n.current)),"pageSize"in t&&t.pageSize!==e.pageSize){var i=e.current,r=S(t.pageSize,e,t);i=i>r?r:i,"current"in t||(n.current=i,n.currentInputValue=i),n.pageSize=t.pageSize}return n}}]),n}(h.a.Component);k.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:C,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:C,locale:E.a,style:{},itemRender:function(t,e,n){return n},totalBoundaryShowSizeChanger:50};var w=k},"6RRn":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/index.js ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: Summary, Column, ColumnGroup, INTERNAL_COL_DEFINE, default */
|
|
|
/*! exports used: INTERNAL_COL_DEFINE, Summary, default */function(t,e,n){"use strict";var i=n(/*! ./Table */"wCXF"),r=n(/*! ./Footer */"n6Qo");n.d(e,"b",(function(){return r.a}));n(/*! ./sugar/Column */"IBYe"),n(/*! ./sugar/ColumnGroup */"6eGT");var o=n(/*! ./utils/legacyUtil */"hW8S");n.d(e,"a",(function(){return o.a})),e.c=i.b},"6eGT":
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/sugar/ColumnGroup.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(t,e,n){"use strict";e.a=function(t){return null}},"746U":
|
|
|
/*!****************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***!
|
|
|
\****************************************************************/
|
|
|
/*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, assertType, isEmptyObject, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, getAllMethodNames, createProxyObject, withNullAsUndefined, withUndefinedAsNull */
|
|
|
/*! exports used: assertType, createProxyObject, getAllMethodNames, isArray, isBoolean, isEmptyObject, isFunction, isNumber, isObject, isString, isUndefined, isUndefinedOrNull, validateConstraints, withNullAsUndefined, withUndefinedAsNull */function(t,e,n){"use strict";n.d(e,"d",(function(){return l})),n.d(e,"j",(function(){return c})),n.d(e,"i",(function(){return u})),n.d(e,"h",(function(){return h})),n.d(e,"e",(function(){return d})),n.d(e,"k",(function(){return f})),n.d(e,"l",(function(){return p})),n.d(e,"a",(function(){return v})),n.d(e,"f",(function(){return m})),n.d(e,"g",(function(){return y})),n.d(e,"m",(function(){return b})),n.d(e,"c",(function(){return C})),n.d(e,"b",(function(){return S})),n.d(e,"n",(function(){return k})),n.d(e,"o",(function(){return w}));var i="number",r="string",o="undefined",s="object",a="function";function l(t){return Array.isArray?Array.isArray(t):!(!t||typeof t.length!==i||t.constructor!==Array)}function c(t){return typeof t===r||t instanceof String}function u(t){return!(typeof t!==s||null===t||Array.isArray(t)||t instanceof RegExp||t instanceof Date)}function h(t){return(typeof t===i||t instanceof Number)&&!isNaN(t)}function d(t){return!0===t||!1===t}function f(t){return typeof t===o}function p(t){return f(t)||null===t}function v(t,e){if(!t)throw new Error(e?"Unexpected type, expected '"+e+"'":"Unexpected type")}var g=Object.prototype.hasOwnProperty;function m(t){if(!u(t))return!1;for(var e in t)if(g.call(t,e))return!1;return!0}function y(t){return typeof t===a}function b(t,e){for(var n=Math.min(t.length,e.length),i=0;i<n;i++)E(t[i],e[i])}function E(t,e){if(c(e)){if(typeof t!==e)throw new Error("argument does not match constraint: typeof "+e)}else if(y(e)){try{if(t instanceof e)return}catch(t){}if(!p(t)&&t.constructor===e)return;if(1===e.length&&!0===e.call(void 0,t))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function C(t){for(var e=[],n=0,i=function(t){for(var e=[],n=Object.getPrototypeOf(t);Object.prototype!==n;)e=e.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return e}(t);n<i.length;n++){var r=i[n];"function"==typeof t[r]&&e.push(r)}return e}function S(t,e){for(var n=function(t){return function(){var n=Array.prototype.slice.call(arguments,0);return e(t,n)}},i={},r=0,o=t;r<o.length;r++){var s=o[r];i[s]=n(s)}return i}function k(t){return null===t?void 0:t}function w(t){return void 0===t?null:t}},"815F":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/rc-tree/es/utils/treeUtil.js ***!
|
|
|
\***************************************************/
|
|
|
/*! exports provided: getKey, warningWithoutKey, convertTreeToData, flattenTreeData, traverseDataNodes, convertDataToEntities, getTreeNodeProps, convertNodePropsToEventData */
|
|
|
/*! exports used: convertDataToEntities, convertNodePropsToEventData, convertTreeToData, flattenTreeData, getKey, getTreeNodeProps */function(t,e,n){"use strict";n.d(e,"e",(function(){return c})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return h})),n.d(e,"a",(function(){return f})),n.d(e,"f",(function(){return p})),n.d(e,"b",(function(){return v}));var i=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),o=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),s=n(/*! rc-util/es/Children/toArray */"Zm9Q"),a=n(/*! rc-util/es/warning */"Kwbf"),l=n(/*! ../util */"OZM5");function c(t,e){return null!=t?t:e}function u(t){return function t(e){return Object(s.a)(e).map((function(e){if(!Object(l.i)(e))return Object(a.a)(!e,"Tree/TreeNode can only accept TreeNode as children."),null;var n=e.key,i=e.props,s=i.children,c=Object(o.a)(i,["children"]),u=Object(r.a)({key:n},c),h=t(s);return h.length&&(u.children=h),u})).filter((function(t){return t}))}(t)}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Set(!0===e?[]:e),o=[];function s(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.map((function(u,h){var d=Object(l.h)(a?a.pos:"0",h),f=c(u.key,d),p=Object(r.a)(Object(r.a)({},u),{},{parent:a,pos:d,children:null,data:u,isStart:[].concat(Object(i.a)(a?a.isStart:[]),[0===h]),isEnd:[].concat(Object(i.a)(a?a.isEnd:[]),[h===t.length-1])});return o.push(p),!0===e||n.has(f)?p.children=s(u.children||[],p):p.children=[],p}))}return s(t),o}function d(t,e,n){var i;n?"string"==typeof n?i=function(t){return t[n]}:"function"==typeof n&&(i=function(t){return n(t)}):i=function(t,e){return c(t.key,e)},function n(r,o,s){var a=r?r.children:t,c=r?Object(l.h)(s.pos,o):"0";if(r){var u=i(r,c),h={node:r,index:o,pos:c,key:u,parentPos:s.node?s.pos:null,level:s.level+1};e(h)}a&&a.forEach((function(t,e){n(t,e,{node:r,pos:c,level:s?s.level+1:-1})}))}(null)}function f(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.initWrapper,i=e.processEntity,r=e.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,s={},a={},l={posEntities:s,keyEntities:a};return n&&(l=n(l)||l),d(t,(function(t){var e=t.node,n=t.index,r=t.pos,o=t.key,u=t.parentPos,h={node:e,index:n,key:o,pos:r,level:t.level},d=c(o,r);s[r]=h,a[d]=h,h.parent=s[u],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h)),i&&i(h,l)}),o),r&&r(l),l}function p(t,e){var n=e.expandedKeys,i=e.selectedKeys,r=e.loadedKeys,o=e.loadingKeys,s=e.checkedKeys,a=e.halfCheckedKeys,l=e.dragOverNodeKey,c=e.dropPosition,u=e.keyEntities[t];return{eventKey:t,expanded:-1!==n.indexOf(t),selected:-1!==i.indexOf(t),loaded:-1!==r.indexOf(t),loading:-1!==o.indexOf(t),checked:-1!==s.indexOf(t),halfChecked:-1!==a.indexOf(t),pos:String(u?u.pos:""),dragOver:l===t&&0===c,dragOverGapTop:l===t&&-1===c,dragOverGapBottom:l===t&&1===c}}function v(t){var e=t.data,n=t.expanded,i=t.selected,o=t.checked,s=t.loaded,l=t.loading,c=t.halfChecked,u=t.dragOver,h=t.dragOverGapTop,d=t.dragOverGapBottom,f=t.pos,p=t.active,v=Object(r.a)(Object(r.a)({},e),{},{expanded:n,selected:i,checked:o,loaded:s,loading:l,halfChecked:c,dragOver:u,dragOverGapTop:h,dragOverGapBottom:d,pos:f,active:p});return"props"in v||Object.defineProperty(v,"props",{get:function(){return Object(a.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),t}}),v}},"8HAY":
|
|
|
/*!******************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/actions.js ***!
|
|
|
\******************************************************************/
|
|
|
/*! exports provided: Action, ActionRunner */
|
|
|
/*! exports used: Action, ActionRunner */function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u}));var i,r=n(/*! ./lifecycle.js */"pmY6"),o=n(/*! ./event.js */"MI8n"),s=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))},l=function(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},c=function(t){function e(e,n,i,r,s){void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r=!0);var a=t.call(this)||this;return a._onDidChange=a._register(new o.a),a.onDidChange=a._onDidChange.event,a._enabled=!0,a._checked=!1,a._id=e,a._label=n,a._cssClass=i,a._enabled=r,a._actionCallback=s,a}return s(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"label",{get:function(){return this._label},set:function(t){this._setLabel(t)},enumerable:!0,configurable:!0}),e.prototype._setLabel=function(t){this._label!==t&&(this._label=t,this._onDidChange.fire({label:t}))},Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(t){this._setTooltip(t)},enumerable:!0,configurable:!0}),e.prototype._setTooltip=function(t){this._tooltip!==t&&(this._tooltip=t,this._onDidChange.fire({tooltip:t}))},Object.defineProperty(e.prototype,"class",{get:function(){return this._cssClass},set:function(t){this._setClass(t)},enumerable:!0,configurable:!0}),e.prototype._setClass=function(t){this._cssClass!==t&&(this._cssClass=t,this._onDidChange.fire({class:t}))},Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this._setEnabled(t)},enumerable:!0,configurable:!0}),e.prototype._setEnabled=function(t){this._enabled!==t&&(this._enabled=t,this._onDidChange.fire({enabled:t}))},Object.defineProperty(e.prototype,"checked",{get:function(){return this._checked},set:function(t){this._setChecked(t)},enumerable:!0,configurable:!0}),e.prototype._setChecked=function(t){this._checked!==t&&(this._checked=t,this._onDidChange.fire({checked:t}))},e.prototype.run=function(t,e){return this._actionCallback?this._actionCallback(t):Promise.resolve(!0)},e}(r.a),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._onDidBeforeRun=e._register(new o.a),e.onDidBeforeRun=e._onDidBeforeRun.event,e._onDidRun=e._register(new o.a),e.onDidRun=e._onDidRun.event,e}return s(e,t),e.prototype.run=function(t,e){return a(this,void 0,void 0,(function(){var n,i;return l(this,(function(r){switch(r.label){case 0:if(!t.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:t}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.runAction(t,e)];case 2:return n=r.sent(),this._onDidRun.fire({action:t,result:n}),[3,4];case 3:return i=r.sent(),this._onDidRun.fire({action:t,error:i}),[3,4];case 4:return[2]}}))}))},e.prototype.runAction=function(t,e){var n=e?t.run(e):t.run();return Promise.resolve(n)},e}(r.a)},"8hTe":
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/components/RenderHtml/index.less?modules ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={button:"button___1wy9m"}},"9Bee":
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./src/components/RenderHtml/index.tsx + 3 modules ***!
|
|
|
\*********************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.less?modules (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/PreviewAll/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/hls.js/dist/hls.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/katex/dist/katex.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/lib/marked.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/src/helpers.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n("DYRE");var i=n("zeV3"),r=(n("+L6B"),n("2/Rp")),o=n("k1fw"),s=n("9og8"),a=n("tJVT"),l=n("WmNS"),c=n.n(l),u=n("q1tI"),h=n.n(u),d=(n("vg9a"),n("DlQD")),f=n.n(d),p=n("rUJ1");var v=[],g=["<ul>"],m=new f.a.Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){v.length=0,g=["<ul>"]}var E={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(){return function t(e,n,i,r){if(n>=e.length||e[n].level<=i)return n;var o=e[n];r.push("<li><a href='#"+o.anchor+"'>"+o.text+"</a>");var s=[];return n=t(e,++n,o.level,s),s.length>0&&(r.push("<ul>"),s.forEach((function(t){r.push(t)})),r.push("</ul>")),r.push("</li>"),n=t(e,n,i,r)}(v,0,0,g),g.push("</ul>"),g.join("")}var S={heading:function(t){var e=y.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},fences:function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:Object(a.a)(e,1)[0].length>=i.length?t.slice(i.length):t})).join("\n")}(n,e[3]||""),r=e[2]?e[2].trim():e[2];if(["latex","katex","math"].indexOf(r)>=0){var o=x(),s=i;i=o,T[o]={type:"block",expression:s}}return{type:"code",raw:n,lang:r,text:i}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,w=0,x=function(){return"__special_katext_id_".concat(w++,"__")},T={};function O(){w=0,T={}}function _(t){return t=t.replace(k,(function(t,e){var n=x();return T[n]={type:"inline",expression:e},n}))}var A=m.listitem;m.listitem=function(t){return A(_(t))};var L=m.paragraph;m.paragraph=function(t){return L(_(t))};var R=m.tablecell;m.tablecell=function(t,e){return R(_(t),e)},m.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"<p class='editormd-tex'>".concat(t,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(e,'">').concat(n?t:Object(p.escape)(t,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?t:Object(p.escape)(t,!0))+"</code></pre>"},m.heading=function(t,e,n){var i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return v.push({anchor:i,level:e,text:t}),"<h"+e+' id="'+i+'">'+t+"</h"+e+">"},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:S,renderer:m});var D=f.a,I=(n("SJMd"),n("ulZh")),M=n.n(I),P=n("m3rI"),N=n("Oy/b"),j=n("p5ED"),B=n("ErOA"),F=function(t,e){return(F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function U(t,e){function n(){this.constructor=t}F(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function G(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))}function H(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function z(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}var V=function(){function t(){}return t.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},t.setAttributes=function(t,e){for(var n=0,i=e;n<i.length;n++){var r=i[n],o=r[0],s=r[1];t.setAttribute(o,s)}},t.createRect=function(e,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("width",e.toString()),r.setAttribute("height",n.toString()),i&&t.setAttributes(r,i),r},t.createLine=function(e,n,i,r,o){var s=document.createElementNS("http://www.w3.org/2000/svg","line");return s.setAttribute("x1",e.toString()),s.setAttribute("y1",n.toString()),s.setAttribute("x2",i.toString()),s.setAttribute("y2",r.toString()),o&&t.setAttributes(s,o),s},t.createPolygon=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","polygon");return i.setAttribute("points",e),n&&t.setAttributes(i,n),i},t.createCircle=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","circle");return i.setAttribute("cx",(e/2).toString()),i.setAttribute("cy",(e/2).toString()),i.setAttribute("r",e.toString()),n&&t.setAttributes(i,n),i},t.createEllipse=function(e,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return r.setAttribute("cx",(e/2).toString()),r.setAttribute("cy",(n/2).toString()),r.setAttribute("rx",(e/2).toString()),r.setAttribute("ry",(n/2).toString()),i&&t.setAttributes(r,i),r},t.createGroup=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return e&&t.setAttributes(n,e),n},t.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},t.createMarker=function(e,n,i,r,o,s,a){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return t.setAttributes(l,[["id",e],["orient",n],["markerWidth",i.toString()],["markerHeight",r.toString()],["refX",o.toString()],["refY",s.toString()]]),l.appendChild(a),l},t.createText=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),e&&t.setAttributes(n,e),n},t.createTSpan=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","tspan");return i.textContent=e,n&&t.setAttributes(i,n),i},t.createImage=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return e&&t.setAttributes(n,e),n},t.createPoint=function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=t,n.y=e,n},t.createPath=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),n&&t.setAttributes(i,n),i},t}(),K=function(){function t(){}return t.addKey=function(e){t.key=e},Object.defineProperty(t,"isLicensed",{get:function(){return!!t.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(t.key)},enumerable:!1,configurable:!0}),t}(),W=function(){function t(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return t.prototype.rasterize=function(t,e,n){var i=this;return new Promise((function(r){var o=void 0!==n?n:document.createElement("canvas");null===t&&(i.markersOnly=!0,i.naturalSize=!1);var s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("width",e.width.baseVal.valueAsString),s.setAttribute("height",e.height.baseVal.valueAsString),s.setAttribute("viewBox","0 0 "+e.viewBox.baseVal.width.toString()+" "+e.viewBox.baseVal.height.toString()),s.innerHTML=e.innerHTML,!0===i.naturalSize?(s.width.baseVal.value=t.naturalWidth,s.height.baseVal.value=t.naturalHeight):void 0!==i.width&&void 0!==i.height&&(s.width.baseVal.value=i.width,s.height.baseVal.value=i.height),o.width=s.width.baseVal.value,o.height=s.height.baseVal.value;var a=s.outerHTML,l=o.getContext("2d");!0!==i.markersOnly&&l.drawImage(t,0,0,o.width,o.height);var c=window.URL,u=new Image(o.width,o.height);u.setAttribute("crossOrigin","anonymous");var h=new Blob([a],{type:"image/svg+xml"}),d=c.createObjectURL(h);u.onload=function(){l.drawImage(u,0,0),c.revokeObjectURL(d);var t=o.toDataURL(i.imageType,i.imageQuality);r(t)},u.src=d}))},t}(),Y=function(){},q=function(){function t(t){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+t+"_"}return Object.defineProperty(t.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(t.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(t.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),t.prototype.addClass=function(t){return void 0===this.styleSheet&&this.addStyleSheet(),t.name=""+this.classNamePrefix+t.localName,this.classes.push(t),this.styleSheet.sheet.insertRule("."+t.name+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length),t},t.prototype.addRule=function(t){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(t),this.styleSheet.sheet.insertRule(t.selector+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length)},t.prototype.addStyleSheet=function(){var t;this.styleSheet=document.createElement("style"),(null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).appendChild(this.styleSheet),this.addRule(new X("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new X("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new X("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new $("fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new $("fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},t.prototype.removeStyleSheet=function(){var t;this.styleSheet&&((null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},t}(),X=function(t,e){this.selector=t,this.style=e},$=function(t,e){this.localName=t,this.style=e},Q=function(){function t(t,e,n,i,r){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=t,this.displayMode=e,this.markerItems=n,this.uiStyleSettings=i,this.styles=r,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return t.prototype.show=function(t){var e=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var n=document.createElement("div");n.className=this.toolbarBlockStyleClass.name,n.style.whiteSpace="nowrap",this.uiContainer.appendChild(n),this.addActionButton(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(t){var n=document.createElement("div");n.className=""+e.toolbarButtonStyleClass.name,n.setAttribute("data-type-name",t.typeName),n.innerHTML=t.icon,n.addEventListener("click",(function(){e.markerToolbarButtonClicked(n,t)})),e.buttons.push(n),e.markerButtons.push(n)})),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 i=document.createElement("div");i.className=this.toolbarBlockStyleClass.name,i.style.whiteSpace="nowrap",i.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(i),this.addActionButton(i,'<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(i,'<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()},t.prototype.addButtonClickListener=function(t){this.buttonClickListeners.push(t)},t.prototype.removeButtonClickListener=function(t){this.buttonClickListeners.indexOf(t)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(t),1)},t.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},t.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var t=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var e=0;e<this.markerButtons.length;e++)e<t||e===t&&this.markerButtons.length-1===t?this.markerButtonBlock.appendChild(this.markerButtons[e]):(e===t&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[e]))}},t.prototype.overflowButtonClicked=function(){"none"!==this.markerButtonOverflowBlock.style.display?(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")},t.prototype.resetButtonStyles=function(){var t=this;this.buttons.forEach((function(e){e.className=e.className.replace(t.uiStyleSettings.toolbarButtonStyleColorsClassName?t.uiStyleSettings.toolbarButtonStyleColorsClassName:t.toolbarButtonStyleColorsClass.name,"").trim(),e.className=e.className.replace(t.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?t.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:t.toolbarActiveButtonStyleColorsClass.name,"").trim(),e.className+=" "+(t.uiStyleSettings.toolbarButtonStyleColorsClassName?t.uiStyleSettings.toolbarButtonStyleColorsClassName:t.toolbarButtonStyleColorsClass.name)}))},t.prototype.addActionButton=function(t,e,n){var i=this,r=document.createElement("div");switch(r.className=""+this.toolbarButtonStyleClass.name,r.innerHTML=e,r.setAttribute("data-action",n),r.addEventListener("click",(function(){i.actionToolbarButtonClicked(r,n)})),n){case"select":r.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":r.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":r.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":r.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":r.style.fill=this.uiStyleSettings.closeButtonColor}t.appendChild(r),this.buttons.push(r)},t.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new $("toolbar","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.uiStyleSettings.toolbarHeight+"px;\n box-sizing: content-box;\n "+("inline"===this.displayMode?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new $("toolbar_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n box-shadow: 0px 3px rgba(33, 33, 33, 0.1);\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new $("toolbar-block","\n display: inline-block;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new $("toolbar-overflow-block","\n position: absolute;\n top: "+this.uiStyleSettings.toolbarHeight+"px;\n max-width: "+2*this.uiStyleSettings.toolbarHeight+"px;\n z-index: 10;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new $("toolbar-overflow-block_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new $("toolbar_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new $("toolbar_button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new $("toolbar_active_button","\n fill: "+this.uiStyleSettings.toolbarColor+";\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new X("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n ")),this.styles.addRule(new X("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n "))},t.prototype.markerToolbarButtonClicked=function(t,e){this.setActiveButton(t),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(t){return t("marker",e)})),this.markerButtonOverflowBlock.style.display="none"},t.prototype.actionToolbarButtonClicked=function(t,e){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(t){return t("action",e)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},t.prototype.setActiveButton=function(t){this.resetButtonStyles(),t.className=t.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),t.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},t.prototype.setActiveMarkerButton=function(t){var e=this.markerButtons.find((function(e){return e.getAttribute("data-type-name")===t}));e&&this.setActiveButton(e)},t.prototype.setCurrentMarker=function(t){var e=this;this.currentMarker=t,this.buttons.filter((function(t){return/delete|notes/.test(t.getAttribute("data-action"))})).forEach((function(t){void 0===e.currentMarker?(t.style.fillOpacity="0.4",t.style.pointerEvents="none"):(t.style.fillOpacity="1",t.style.pointerEvents="all")}))},t}(),J=function(){function t(t,e,n,i){this.panels=[],this.panelButtons=[],this.markerjsContainer=t,this.displayMode=e,this.uiStyleSettings=n,this.styles=i,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return t.prototype.addStyles=function(){var t;this.toolboxStyleClass=this.styles.addClass(new $("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new $("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new $("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new $("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new $("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new $("toolbox-panel-row_colors","\n background-color: "+(null!==(t=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==t?t:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new $("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new $("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new $("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new X("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new X("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},t.prototype.show=function(t){var e;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==e?e:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},t.prototype.setPanelButtons=function(t){var e,n,i=this;this.panels=t,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==e?e:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(n=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==n?n:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(t){var e;t.uiStyleSettings=i.uiStyleSettings;var n=document.createElement("div");n.className=i.toolboxButtonStyleClass.name+" "+(null!==(e=i.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==e?e:i.toolboxButtonStyleColorsClass.name),n.innerHTML=t.icon,n.title=t.title,n.addEventListener("click",(function(){i.panelButtonClick(t)})),i.panelButtons.push(n),i.buttonRow.appendChild(n)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},t.prototype.panelButtonClick=function(t){var e=this,n=-1;if(t!==this.activePanel){n=this.panels.indexOf(t),this.panelRow.innerHTML="";var i=t.getUi();i.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(i),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=t}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===e.displayMode?e.panelRow.style.display="none":e.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(t,i){var r,o;t.className=e.toolboxButtonStyleClass.name+" "+(i===n?""+(null!==(r=e.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==r?r:e.toolboxActiveButtonStyleColorsClass.name):""+(null!==(o=e.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==o?o:e.toolboxButtonStyleColorsClass.name))}))},t}(),Z=function(t,e){this.title=t,this.icon=e},tt=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<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 o.colors=[],o.addTransparent=!1,o.colorBoxes=[],o.colors=n,o.currentColor=i,o.setCurrentColor=o.setCurrentColor.bind(o),o.getColorBox=o.getColorBox.bind(o),o}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.whiteSpace="nowrap",this.colors.forEach((function(n){var i=t.getColorBox(n);e.appendChild(i),t.colorBoxes.push(i)})),e},e.prototype.getColorBox=function(t){var e=this,n=this.uiStyleSettings.toolbarHeight/4,i=this.uiStyleSettings.toolbarHeight-n,r=document.createElement("div");r.style.display="inline-block",r.style.boxSizing="content-box",r.style.width=i-2+"px",r.style.height=i-2+"px",r.style.padding="1px",r.style.marginRight="2px",r.style.marginBottom="2px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderRadius=(i+2)/2+"px",r.style.borderColor=t===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentColor(t,r)}));var o=document.createElement("div");return o.style.display="inline-block",o.style.width=i-2+"px",o.style.height=i-2+"px",o.style.backgroundColor=t,o.style.borderRadius=i/2+"px","transparent"===t&&(o.style.fill=this.uiStyleSettings.toolboxAccentColor,o.innerHTML='<svg viewBox="0 0 24 24">\n <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" />\n </svg>'),r.appendChild(o),r},e.prototype.setCurrentColor=function(t,e){var n=this;this.currentColor=t,this.colorBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(t)},e}(Z),et=function(){function t(t,e,n){this._state="new",this._isSelected=!1,this._container=t,this._overlayContainer=e,this.globalSettings=n,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(t.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!1},Object.defineProperty(t.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},t.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},t.prototype.pointerDown=function(t,e){},t.prototype.dblClick=function(t,e){},t.prototype.manipulate=function(t){},t.prototype.pointerUp=function(t){this.stateChanged()},t.prototype.dispose=function(){},t.prototype.addMarkerVisualToContainer=function(t){this.container.childNodes.length>0?this.container.insertBefore(t,this.container.childNodes[0]):this.container.appendChild(t)},t.prototype.getState=function(){return{typeName:t.typeName,state:this.state,notes:this.notes}},t.prototype.restoreState=function(t){this._state=t.state,this.notes=t.notes},t.prototype.scale=function(t,e){},t.prototype.colorChanged=function(t){this.onColorChanged&&this.onColorChanged(t),this.stateChanged()},t.prototype.fillColorChanged=function(t){this.onFillColorChanged&&this.onFillColorChanged(t),this.stateChanged()},t.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var t=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),t.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(t)&&this.onStateChanged(this)}},t.typeName="MarkerBase",t}(),nt=function(){function t(){this.findGripByVisual=this.findGripByVisual.bind(this)}return t.prototype.findGripByVisual=function(t){return this.topLeft.ownsTarget(t)?this.topLeft:this.topCenter.ownsTarget(t)?this.topCenter:this.topRight.ownsTarget(t)?this.topRight:this.centerLeft.ownsTarget(t)?this.centerLeft:this.centerRight.ownsTarget(t)?this.centerRight:this.bottomLeft.ownsTarget(t)?this.bottomLeft:this.bottomCenter.ownsTarget(t)?this.bottomCenter:this.bottomRight.ownsTarget(t)?this.bottomRight:void 0},t}(),it=function(){function t(){this.GRIP_SIZE=10,this.visual=V.createGroup(),this.visual.appendChild(V.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(V.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t}(),rt=function(){function t(){}return t.toITransformMatrix=function(t){return{a:t.a,b:t.b,c:t.c,d:t.d,e:t.e,f:t.f}},t.toSVGMatrix=function(t,e){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f,t},t}(),ot=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.left=0,r.top=0,r.width=0,r.height=0,r.defaultSize={x:50,y:20},r.offsetX=0,r.offsetY=0,r.rotationAngle=0,r.CB_DISTANCE=10,r._suppressMarkerCreateEvent=!1,r.container.transform.baseVal.appendItem(V.createTransform()),r.setupControlBox(),r}return U(e,t),Object.defineProperty(e.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"visual",{get:function(){return this._visual},set:function(t){this._visual=t;var e=V.createTransform();this._visual.transform.baseVal.appendItem(e)},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!!(void 0!==this.controlGrips.findGripByVisual(e)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(e))},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.left=e.x,this.top=e.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var i=this.unrotatePoint(e);if(this.manipulationStartX=i.x,this.manipulationStartY=i.y,this.offsetX=i.x-this.left,this.offsetY=i.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(n),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(n)){this.activeGrip=this.rotatorGrip;var r=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=r.x-this.width/2,this.top=r.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},e.prototype.pointerUp=function(e){var n=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(e),this._state="select","creating"===n&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},e.prototype.moveVisual=function(t){this.visual.style.transform="translate("+t.x+"px, "+t.y+"px)"},e.prototype.manipulate=function(t){var e=this.unrotatePoint(t);"creating"===this.state?this.resize(t):"move"===this.state?(this.left=this.manipulationStartLeft+(e.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(e.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(e):"rotate"===this.state&&this.rotate(t)},e.prototype.resize=function(t){var e=this.manipulationStartLeft,n=this.manipulationStartWidth,i=this.manipulationStartTop,r=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:e=this.manipulationStartLeft+t.x-this.manipulationStartX,n=this.manipulationStartWidth+this.manipulationStartLeft-e;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:n=this.manipulationStartWidth+t.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:i=this.manipulationStartTop+t.y-this.manipulationStartY,r=this.manipulationStartHeight+this.manipulationStartTop-i;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:r=this.manipulationStartHeight+t.y-this.manipulationStartY}n>=0?(this.left=e,this.width=n):(this.left=e+n,this.width=-n),r>=0?(this.top=i,this.height=r):(this.top=i+r,this.height=-r),this.setSize()},e.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},e.prototype.rotate=function(t){if(Math.abs(t.x-this.centerX)>.1){var e=Math.sign(t.x-this.centerX);this.rotationAngle=180*Math.atan((t.y-this.centerY)/(t.x-this.centerX))/Math.PI+90*e,this.applyRotation()}},e.prototype.applyRotation=function(){var t=this.container.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(t,0)},e.prototype.rotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM(),n=V.createPoint(t.x,t.y);return{x:(n=n.matrixTransform(e)).x,y:n.y}},e.prototype.unrotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM();e=e.inverse();var n=V.createPoint(t.x,t.y);return{x:(n=n.matrixTransform(e)).x,y:n.y}},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=V.createGroup();var t=V.createTransform();t.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(t),this.container.appendChild(this.controlBox),this.controlRect=V.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),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=V.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 nt,this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){var t=this.controlBox.transform.baseVal.getItem(0);t.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(t,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(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()},e.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(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},e.prototype.createGrip=function(){var t=new it;return t.visual.transform.baseVal.appendItem(V.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.controlGrips.topLeft.GRIP_SIZE,e=-t/2,n=e,i=(this.width+this.CB_DISTANCE)/2-t/2,r=(this.height+this.CB_DISTANCE)/2-t/2,o=this.height+this.CB_DISTANCE-t/2,s=this.width+this.CB_DISTANCE-t/2;this.positionGrip(this.controlGrips.topLeft.visual,e,n),this.positionGrip(this.controlGrips.topCenter.visual,i,n),this.positionGrip(this.controlGrips.topRight.visual,s,n),this.positionGrip(this.controlGrips.centerLeft.visual,e,r),this.positionGrip(this.controlGrips.centerRight.visual,s,r),this.positionGrip(this.controlGrips.bottomLeft.visual,e,o),this.positionGrip(this.controlGrips.bottomCenter.visual,i,o),this.positionGrip(this.controlGrips.bottomRight.visual,s,o),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,i,n-3*this.CB_DISTANCE)},e.prototype.positionGrip=function(t,e,n){var i=t.transform.baseVal.getItem(0);i.setTranslate(e,n),t.transform.baseVal.replaceItem(i,0)},e.prototype.hideControlBox=function(){this.controlBox.style.display="none"},e.prototype.showControlBox=function(){this.controlBox.style.display=""},e.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:rt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:rt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.left=n.left,this.top=n.top,this.width=n.width,this.height=n.height,this.rotationAngle=n.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,n.containerTransformMatrix))},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n);var i=this.rotatePoint({x:this.left,y:this.top}),r=this.unrotatePoint({x:i.x*e,y:i.y*n});this.left=r.x,this.top=r.y,this.width=this.width*e,this.height=this.height*n,this.adjustControlBox()},e}(et),st=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=V.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&V.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&V.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&V.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&V.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){var n=e;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize()},e.title="Rectangle marker",e}(ot),at=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return o.widths=[],o.widthBoxes=[],o.widths=n,o.currentWidth=i,o.setCurrentWidth=o.setCurrentWidth.bind(o),o}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.widths.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.flexGrow="2",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===t.currentWidth?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentWidth(n,i)})),e.appendChild(i);var r=document.createElement("div");r.innerText=n.toString(),r.style.marginRight="5px",i.appendChild(r);var o=document.createElement("div");o.style.minHeight="20px",o.style.flexGrow="2",o.style.display="flex",o.style.alignItems="center";var s=document.createElement("hr");s.style.minWidth="20px",s.style.border="0px",s.style.borderTop=n+"px solid "+t.uiStyleSettings.toolboxColor,s.style.flexGrow="2",o.appendChild(s),i.appendChild(o),t.widthBoxes.push(i)})),e},e.prototype.setCurrentWidth=function(t,e){var n=this;this.currentWidth=t,this.widthBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},e}(Z),lt=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<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 o.styles=[],o.styleBoxes=[],o.styles=n,o.currentStyle=i,o.setCurrentStyle=o.setCurrentStyle.bind(o),o}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.styles.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/t.styles.length-5+"%",i.style.borderColor=n===t.currentStyle?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentStyle(n,i)})),e.appendChild(i);var r=document.createElement("div");r.style.minHeight="20px",r.style.flexGrow="2",r.style.overflow="hidden";var o='<svg width="100" height="20">\n <line x1="0" y1="10" x2="100" y2="10" stroke="'+t.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(""!==n?'stroke-dasharray="'+n+'"':"")+" />\n </svg>";r.innerHTML=o,i.appendChild(r),t.styleBoxes.push(i)})),e},e.prototype.setCurrentStyle=function(t,e){var n=this;this.currentStyle=t,this.styleBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},e}(Z),ct=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new tt("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new at("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return U(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="FrameMarker",e.title="Frame marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',e}(st),ut=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},ht=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.x1=0,r.y1=0,r.x2=0,r.y2=0,r.defaultLength=50,r.manipulationStartX=0,r.manipulationStartY=0,r.manipulationStartX1=0,r.manipulationStartY1=0,r.manipulationStartX2=0,r.manipulationStartY2=0,r.setupControlBox(),r}return U(e,t),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!(!this.grip1.ownsTarget(e)&&!this.grip2.ownsTarget(e))},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.manipulationStartX=e.x,this.manipulationStartY=e.y,"new"===this.state&&(this.x1=e.x,this.y1=e.y,this.x2=e.x,this.y2=e.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(n)?this.activeGrip=this.grip1:this.grip2.ownsTarget(n)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},e.prototype.pointerUp=function(e){var n=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&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(e),this._state="select","creating"===n&&this.onMarkerCreated&&this.onMarkerCreated(this)},e.prototype.adjustVisual=function(){},e.prototype.manipulate=function(t){"creating"===this.state?this.resize(t):"move"===this.state?(this.x1=this.manipulationStartX1+t.x-this.manipulationStartX,this.y1=this.manipulationStartY1+t.y-this.manipulationStartY,this.x2=this.manipulationStartX2+t.x-this.manipulationStartX,this.y2=this.manipulationStartY2+t.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(t)},e.prototype.resize=function(t){switch(this.activeGrip){case this.grip1:this.x1=t.x,this.y1=t.y;break;case this.grip2:case void 0:this.x2=t.x,this.y2=t.y}this.adjustVisual(),this.adjustControlBox()},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=V.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){this.positionGrips()},e.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},e.prototype.createGrip=function(){var t=new it;return t.visual.transform.baseVal.appendItem(V.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-t/2,this.y1-t/2),this.positionGrip(this.grip2.visual,this.x2-t/2,this.y2-t/2)},e.prototype.positionGrip=function(t,e,n){var i=t.transform.baseVal.getItem(0);i.setTranslate(e,n),t.transform.baseVal.replaceItem(i,0)},e.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.x1=n.x1,this.y1=n.y1,this.x2=n.x2,this.y2=n.y2},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.x1=this.x1*e,this.y1=this.y1*n,this.x2=this.x2*e,this.y2=this.y2*n,this.adjustVisual(),this.adjustControlBox()},e}(et),dt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new tt("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new at("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorLine&&e!==this.visibleLine)},e.prototype.createVisual=function(){this.visual=V.createGroup(),this.selectorLine=V.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=V.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},e.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()),V.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),V.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),V.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.createVisual(),this.adjustVisual()},e.typeName="LineMarker",e.title="Line marker",e.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',e}(ht),ft=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<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 o.fonts=[],o.fontBoxes=[],o.fonts=n,o.currentFont=i,o.setCurrentFont=o.setCurrentFont.bind(o),o}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.flexGrow="2",this.fonts.forEach((function(n){var i=document.createElement("div");i.style.display="inline-block",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/t.fonts.length-5+"%",i.style.borderColor=n===t.currentFont?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentFont(n,i)})),e.appendChild(i);var r=document.createElement("div");r.style.display="flex",r.style.minHeight="20px",r.style.flexGrow="2",r.style.fontFamily=n,r.style.overflow="hidden";var o=document.createElement("div");o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.innerHTML="The quick brown fox jumps over the lazy dog",r.appendChild(o),i.appendChild(r),t.fontBoxes.push(i)})),e},e.prototype.setCurrentFont=function(t,e){var n=this;this.currentFont=t,this.fontBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},e}(Z),pt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.color="transparent",r.padding=5,r.DEFAULT_TEXT="your text here",r.text=r.DEFAULT_TEXT,r.isMoved=!1,r.color=i.defaultColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setColor=r.setColor.bind(r),r.setFont=r.setFont.bind(r),r.renderText=r.renderText.bind(r),r.sizeText=r.sizeText.bind(r),r.textEditDivClicked=r.textEditDivClicked.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.setSize=r.setSize.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.colorPanel=new tt("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.fontFamilyPanel=new ft("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r}return U(e,t),e.prototype.ownsTarget=function(e){if(t.prototype.ownsTarget.call(this,e)||e===this.visual||e===this.textElement||e===this.bgRectangle)return!0;var n=!1;return this.textElement.childNodes.forEach((function(t){t===e&&(n=!0)})),n},e.prototype.createVisual=function(){this.visual=V.createGroup(),this.bgRectangle=V.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=V.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(V.createTransform()),this.textElement.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.isMoved=!1,this.pointerDownPoint=e,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.renderText=function(){var t=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(e){t.textElement.appendChild(V.createTSpan(""===e.trim()?" ":e.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},e.prototype.getTextScale=function(){var t=this.textElement.getBBox(),e=1;if(t.width>0&&t.height>0){var n=(1*this.width-this.width*this.padding*2/100)/t.width,i=(1*this.height-this.height*this.padding*2/100)/t.height;e=Math.min(n,i)}return e},e.prototype.getTextPosition=function(t){var e=this.textElement.getBBox(),n=0,i=0;return e.width>0&&e.height>0&&(n=(this.width-e.width*t)/2,i=this.height/2-e.height*t/2),{x:n,y:i}},e.prototype.sizeText=function(){var t=this.textElement.getBBox(),e=this.getTextScale(),n=this.getTextPosition(e);n.y-=t.y*e,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+n.x+"px, "+n.y+"px) scale("+e+", "+e+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(n.x,n.y),this.textElement.transform.baseVal.getItem(1).setScale(e,e))},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(e.x-this.pointerDownPoint.x)>5||Math.abs(e.y-this.pointerDownPoint.y)>5)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.isMoved=!0,this.setSize(),this.sizeText()},e.prototype.setSize=function(){t.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},e.prototype.pointerUp=function(e){var n=this.state;"creating"===n&&(this._suppressMarkerCreateEvent=!0),t.prototype.pointerUp.call(this,e),this.setSize(),("creating"===n||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},e.prototype.showTextEditor=function(){var t=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(t){t.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var e=Number.parseFloat(t.textEditor.style.fontSize);t.textEditor.clientWidth>=Number.parseInt(t.textEditor.style.maxWidth)&&e>.9;)e-=.1,t.textEditor.style.fontSize=Math.max(e,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(t){t.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(t){if(t.clipboardData){var e=t.clipboardData.getData("text"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(e)),t.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){t.textEditDivClicked(t.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},e.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var t=this.getTextScale(),e=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),n=this.textElement.getBBox(),i={x:n.width*t,y:n.height*t};e.x-=i.x/2,e.y-=i.y/2,this.textEditor.style.top=e.y+"px",this.textEditor.style.left=e.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-e.x+"px",this.textEditor.style.fontSize=Math.max(16*t,12)+"px",this.textElement.style.display="none"}},e.prototype.textEditDivClicked=function(t){this.text=t.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},e.prototype.select=function(){t.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},e.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),t.prototype.deselect.call(this)},e.prototype.dblClick=function(e,n){t.prototype.dblClick.call(this,e,n),this.showTextEditor()},e.prototype.setColor=function(t){this.textElement&&V.setAttributes(this.textElement,[["fill",t]]),this.color=t,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(t)},e.prototype.setFont=function(t){this.textElement&&V.setAttributes(this.textElement,[["font-family",t]]),this.fontFamily=t,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},e.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},e.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.color=n.color,this.fontFamily=n.fontFamily,this.padding=n.padding,this.text=n.text,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize(),this.sizeText(),this.positionTextEditor()},e.typeName="TextMarker",e.title="Text marker",e.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>',e}(ot),vt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.color="transparent",r.lineWidth=3,r.drawing=!1,r.pixelRatio=1,r.color=i.defaultColor,r.lineWidth=i.defaultStrokeWidth,r.pixelRatio=i.freehandPixelRatio,r.setColor=r.setColor.bind(r),r.addCanvas=r.addCanvas.bind(r),r.finishCreation=r.finishCreation.bind(r),r.setLineWidth=r.setLineWidth.bind(r),r.colorPanel=new tt("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.lineWidthPanel=new at("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.lineWidthPanel.onWidthChanged=r.setLineWidth,r}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.drawingImage)},e.prototype.createVisual=function(){this.visual=V.createGroup(),this.drawingImage=V.createImage(),this.visual.appendChild(this.drawingImage);var t=V.createTransform();this.visual.transform.baseVal.appendItem(t),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,n){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(e.x,e.y),this.drawing=!0):t.prototype.pointerDown.call(this,e,n)},e.prototype.manipulate=function(e){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(e.x,e.y),this.canvasContext.stroke()):t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),V.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):t.prototype.pointerUp.call(this,e)},e.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)},e.prototype.select=function(){"creating"===this.state&&this.finishCreation(),t.prototype.select.call(this)},e.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),t.prototype.deselect.call(this)},e.prototype.finishCreation=function(){for(var t=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),e=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],n=e[0],i=e[1],r=e[2],o=e[3],s=!1,a=0;a<this.canvasElement.height;a++)for(var l=0;l<this.canvasElement.width;l++)t.data[a*this.canvasElement.width*4+4*l+3]>0&&(s=!0,a<i&&(i=a),l<n&&(n=l),a>o&&(o=a),l>r&&(r=l));if(s){this.left=n/this.pixelRatio,this.top=i/this.pixelRatio,this.width=(r-n)/this.pixelRatio,this.height=(o-i)/this.pixelRatio;var c=document.createElement("canvas");c.width=r-n,c.height=o-i,c.getContext("2d").putImageData(this.canvasContext.getImageData(n,i,r-n,o-i),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},e.prototype.setDrawingImage=function(){V.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),V.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},e.prototype.setColor=function(t){this.color=t,this.colorChanged(t)},e.prototype.setLineWidth=function(t){this.lineWidth=t},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({drawingImgUrl:this.drawingImgUrl},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){this.createVisual(),t.prototype.restoreState.call(this,e),this.drawingImgUrl=e.drawingImgUrl,this.setDrawingImage()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setDrawingImage()},e.typeName="FreehandMarker",e.title="Freehand marker",e.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>',e}(ot),gt=function(t){function e(e,n,i){var r=t.call(this,e,i||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return r.typeBoxes=[],r.currentType=n,r.setCurrentType=r.setCurrentType.bind(r),r}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2";for(var n=function(n){var r="both";switch(n){case 0:r="both";break;case 1:r="start";break;case 2:r="end";break;case 3:r="none"}var o=document.createElement("div");if(o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=r===i.currentType?i.uiStyleSettings.toolboxAccentColor:"transparent",o.addEventListener("click",(function(){t.setCurrentType(r,o)})),e.appendChild(o),"both"===r||"start"===r){var s=document.createElement("div");s.style.display="flex",s.style.alignItems="center",s.style.minHeight="20px",s.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,5 10,0 10,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',s.style.marginLeft="5px",o.appendChild(s)}var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",a.appendChild(l),o.appendChild(a),"both"===r||"end"===r){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,0 10,5 0,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',c.style.marginRight="5px",o.appendChild(c)}i.typeBoxes.push(o)},i=this,r=0;r<4;r++)n(r);return e},e.prototype.setCurrentType=function(t,e){var n=this;this.currentType=t,this.typeBoxes.forEach((function(t){t.style.borderColor=t===e?void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},e}(Z),mt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.arrowType="end",r.arrowBaseHeight=10,r.arrowBaseWidth=10,r.getArrowPoints=r.getArrowPoints.bind(r),r.setArrowType=r.setArrowType.bind(r),r.arrowTypePanel=new gt("Arrow type","end"),r.arrowTypePanel.onArrowTypeChanged=r.setArrowType,r}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.arrow1&&e!==this.arrow2)},e.prototype.getArrowPoints=function(t,e){var n=this.arrowBaseWidth+2*this.strokeWidth,i=this.arrowBaseHeight+2*this.strokeWidth;return t-n/2+","+(e+i/2)+" "+t+","+(e-i/2)+" "+(t+n/2)+","+(e+i/2)},e.prototype.createTips=function(){this.arrow1=V.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=V.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(V.createTransform()),this.visual.appendChild(this.arrow2)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",V.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),V.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.arrow1.transform.baseVal.getItem(0);n.setRotate(e,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(n,0);var i=this.arrow2.transform.baseVal.getItem(0);i.setRotate(e+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(i,0)}},e.prototype.setArrowType=function(t){this.arrowType=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({arrowType:this.arrowType},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.arrowType=n.arrowType,this.createTips(),this.adjustVisual()},e.typeName="ArrowMarker",e.title="Arrow marker",e.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',e}(dt),yt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.fillColor=i.defaultFillColor,r.strokeWidth=0,r.fillPanel=new tt("Color",i.defaultColorSet,i.defaultFillColor),r.fillPanel.onColorChanged=r.setFillColor,r}return U(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="CoverMarker",e.title="Cover marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',e}(st),bt=function(t){function e(e,n,i,r){var o=t.call(this,e,r||'<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 o.opacities=[],o.opacityBoxes=[],o.opacities=n,o.currentOpacity=i,o.setCurrentOpacity=o.setCurrentOpacity.bind(o),o}return U(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",e.style.justifyContent="space-between",this.opacities.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===t.currentOpacity?t.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){t.setCurrentOpacity(n,i)})),e.appendChild(i);var r=document.createElement("div");r.innerText=100*n+"%",i.appendChild(r),t.opacityBoxes.push(i)})),e},e.prototype.setCurrentOpacity=function(t,e){var n=this;this.currentOpacity=t,this.opacityBoxes.forEach((function(t){t.style.borderColor=t===e?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},e}(Z),Et=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.setOpacity=r.setOpacity.bind(r),r.fillColor=i.defaultHighlightColor,r.strokeWidth=0,r.opacity=i.defaultHighlightOpacity,r.fillPanel=new tt("Color",i.defaultColorSet,r.fillColor),r.fillPanel.onColorChanged=r.setFillColor,r.opacityPanel=new bt("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return U(e,t),e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&V.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="HighlightMarker",e.title="Highlight marker",e.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>',e}(yt),Ct='<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>',St=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.bgColor="transparent",r.tipPosition={x:0,y:0},r.tipBase1Position={x:0,y:0},r.tipBase2Position={x:0,y:0},r.tipMoving=!1,r.color=i.defaultStrokeColor,r.bgColor=i.defaultFillColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setBgColor=r.setBgColor.bind(r),r.getTipPoints=r.getTipPoints.bind(r),r.positionTip=r.positionTip.bind(r),r.setTipPoints=r.setTipPoints.bind(r),r.colorPanel=new tt("Text color",i.defaultColorSet,r.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>'),r.colorPanel.onColorChanged=r.setColor,r.bgColorPanel=new tt("Fill color",i.defaultColorSet,r.bgColor,Ct),r.bgColorPanel.onColorChanged=r.setBgColor,r.fontFamilyPanel=new ft("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.tipGrip=new it,r.tipGrip.visual.transform.baseVal.appendItem(V.createTransform()),r.controlBox.appendChild(r.tipGrip.visual),r}return U(e,t),e.prototype.ownsTarget=function(e){return t.prototype.ownsTarget.call(this,e)||this.tipGrip.ownsTarget(e)||this.tip===e},e.prototype.createTip=function(){V.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=V.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},e.prototype.pointerDown=function(e,n){"new"===this.state&&t.prototype.pointerDown.call(this,e,n),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(n)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):t.prototype.pointerDown.call(this,e,n)},e.prototype.pointerUp=function(e){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,t.prototype.pointerUp.call(this,e);else{var n="creating"===this.state;t.prototype.pointerUp.call(this,e),this.setTipPoints(n),this.positionTip()}},e.prototype.manipulate=function(e){if(this.tipMoving){var n=this.unrotatePoint(e);this.tipPosition={x:n.x-this.manipulationStartLeft,y:n.y-this.manipulationStartTop},this.positionTip()}else t.prototype.manipulate.call(this,e)},e.prototype.setBgColor=function(t){this.bgRectangle&&this.tip&&(V.setAttributes(this.bgRectangle,[["fill",t]]),V.setAttributes(this.tip,[["fill",t]])),this.bgColor=t,this.fillColorChanged(t)},e.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},e.prototype.setTipPoints=function(t){void 0===t&&(t=!1);var e=Math.min(this.height/2,15),n=this.height/5;t&&(this.tipPosition={x:e+n/2,y:this.height+20});var i=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:e,y:0},this.tipBase2Position={x:e+n,y:0}):(this.tipBase1Position={x:0,y:e},this.tipBase2Position={x:0,y:e+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-e-n,y:0},this.tipBase2Position={x:this.width-e,y:0}):(this.tipBase1Position={x:this.width,y:e},this.tipBase2Position={x:this.width,y:e+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?i<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-e-n,y:this.height},this.tipBase2Position={x:this.width-e,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-e-n},this.tipBase2Position={x:this.width,y:this.height-e}):i<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(n=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:e,y:this.height},this.tipBase2Position={x:e+n,y:this.height}):(this.tipBase1Position={x:0,y:this.height-e},this.tipBase2Position={x:0,y:this.height-e-n})},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.positionTip()},e.prototype.positionTip=function(){V.setAttributes(this.tip,[["points",this.getTipPoints()]]);var t=this.tipGrip.visual.transform.baseVal.getItem(0);t.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(t,0)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.positionTip(),t.prototype.select.call(this)},e.prototype.getState=function(){var n=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.bgColor=n.bgColor,this.tipPosition=n.tipPosition,t.prototype.restoreState.call(this,e),this.createTip(),this.setTipPoints()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.tipPosition={x:this.tipPosition.x*e,y:this.tipPosition.y*n},this.positionTip()},e.typeName="CalloutMarker",e.title="Callout marker",e.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>',e}(pt),kt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.fillColor=i.defaultFillColor,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.setOpacity=r.setOpacity.bind(r),r.createVisual=r.createVisual.bind(r),r.strokePanel=new tt("Line color",z(i.defaultColorSet,["transparent"]),i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.fillPanel=new tt("Fill color",z(i.defaultColorSet,["transparent"]),r.fillColor,Ct),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new at("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.opacityPanel=new bt("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=V.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),V.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&V.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&V.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(t),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&V.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&V.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&V.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){var n=e;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,n){t.prototype.scale.call(this,e,n),this.setSize()},e.typeName="EllipseMarker",e.title="Ellipse marker",e.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>',e}(ot),wt=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return U(e,t),Object.defineProperty(e.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.tip1&&e!==this.tip2)},e.prototype.createTips=function(){this.tip1=V.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(V.createTransform()),this.visual.appendChild(this.tip1),this.tip2=V.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(V.createTransform()),this.visual.appendChild(this.tip2)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(V.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()]]),V.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 e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.tip1.transform.baseVal.getItem(0);n.setRotate(e,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(n,0);var i=this.tip2.transform.baseVal.getItem(0);i.setRotate(e+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(i,0)}},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e),this.createTips(),this.adjustVisual()},e.typeName="MeasurementMarker",e.title="Measurement marker",e.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>',e}(dt),xt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokePanel.colors=i.defaultColorSet,r.fillColor="transparent",r}return U(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=t.prototype.getState.call(this);return n.typeName=e.typeName,n},e.typeName="EllipseFrameMarker",e.title="Ellipse frame marker",e.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>',e}(kt),Tt=function(){function t(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),t.prototype.addUndoStep=function(t){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(t)||(this.undoStack.push(t),JSON.stringify(this.lastRedoStep)!==JSON.stringify(t)&&this.redoStack.splice(0,this.redoStack.length))},t.prototype.replaceLastUndoStep=function(t){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=t)},t.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},t.prototype.undo=function(){if(this.undoStack.length>1){var t=this.undoStack.pop();return void 0!==t&&this.redoStack.push(t),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},t.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},t}(),Ot=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.curveX=0,r.curveY=0,r.manipulationStartCurveX=0,r.manipulationStartCurveY=0,r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.positionGrips=r.positionGrips.bind(r),r.addControlGrips=r.addControlGrips.bind(r),r.adjustVisual=r.adjustVisual.bind(r),r.setupControlBox=r.setupControlBox.bind(r),r.resize=r.resize.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new tt("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new at("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return U(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorCurve&&e!==this.visibleCurve&&!this.curveGrip.ownsTarget(e))},e.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},e.prototype.createVisual=function(){this.visual=V.createGroup(),this.selectorCurve=V.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=V.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)},e.prototype.pointerDown=function(e,n){t.prototype.pointerDown.call(this,e,n),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=e.x,this.curveY=e.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(n)&&(this.activeGrip=this.curveGrip,this._state="resize")},e.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),V.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),V.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),V.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setupControlBox=function(){t.prototype.setupControlBox.call(this),this.curveControlLine1=V.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=V.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)},e.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,t.prototype.addControlGrips.call(this)},e.prototype.positionGrips=function(){t.prototype.positionGrips.call(this);var e=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-e/2,this.curveY-e/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()))},e.prototype.manipulate=function(e){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+e.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+e.y-this.manipulationStartY),t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){this.activeGrip===this.curveGrip&&(this.curveX=e.x,this.curveY=e.y),t.prototype.resize.call(this,e),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual()},e.prototype.scale=function(e,n){this.curveX=this.curveX*e,this.curveY=this.curveY*n,t.prototype.scale.call(this,e,n)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},t.prototype.getState.call(this));return n.typeName=e.typeName,n},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var n=e;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.curveX=n.curveX,this.curveY=n.curveY,this.createVisual(),this.adjustVisual()},e.typeName="CurveMarker",e.title="Curve marker",e.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>',e}(ht),_t=function(){function t(t,e){void 0===e&&(e=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=t,this.cancelable=e}return Object.defineProperty(t.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this._defaultPrevented=!0},t}(),At=function(t){function e(e,n,i){var r=t.call(this,e,!1)||this;return r.dataUrl=n,r.state=i,r}return U(e,t),e}(_t),Lt=function(t){function e(e,n,i){void 0===i&&(i=!1);var r=t.call(this,e,i)||this;return r.marker=n,r}return U(e,t),e}(_t),Rt=function(){function t(){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 t.prototype.addEventListener=function(t,e){this[t].push(e)},t.prototype.removeEventListener=function(t,e){var n=this[t].indexOf(e);n>-1&&this[t].splice(n,1)},t}(),Dt=function(){function t(e){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ut,this._isOpen=!1,this.undoRedoManager=new Tt,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 Rt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=t.instanceCounter++,this.styles=new q(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=e,this.targetRoot=document.body,this.width=e.clientWidth,this.height=e.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(t.prototype,"ALL_MARKER_TYPES",{get:function(){return[ct,vt,mt,pt,xt,kt,Et,St,wt,yt,dt,Ot]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ct,vt,mt,pt,kt,Et,St]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ct,vt,mt,pt,Et]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(t){var e=this;this._availableMarkerTypes.splice(0),t.forEach((function(t){if("string"==typeof t){var n=e.ALL_MARKER_TYPES.find((function(e){return e.typeName===t}));void 0!==n&&e._availableMarkerTypes.push(n)}else e._availableMarkerTypes.push(t)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(t){this._zoomLevel=t,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(t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),K.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},t.prototype.show=function(){var t=this;void 0===this.styles.styleSheetRoot&&void 0!==Y.styleSheetRoot&&(this.styles.styleSheetRoot=Y.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(e){return e(new _t(t))}))},t.prototype.render=function(){return G(this,void 0,void 0,(function(){var t;return H(this,(function(e){switch(e.label){case 0:return this.setCurrentMarker(),(t=new W).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.markersOnly=this.renderMarkersOnly,t.width=this.renderWidth,t.height=this.renderHeight,[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return e.sent(),[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,e.sent()]}}))}))},t.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isOpen){var n=!1;t||this.eventListeners.beforeclose.forEach((function(t){var i=new _t(e,!0);t(i),i.defaultPrevented&&(n=!0)})),n||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(t){return t(new _t(e))})),this.detachEvents(),this._isOpen=!1)}},t.prototype.addMarkersToToolbar=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(t=this._availableMarkerTypes).push.apply(t,e)},t.prototype.addRenderEventListener=function(t){this.addEventListener("render",(function(e){t(e.dataUrl,e.state)}))},t.prototype.removeRenderEventListener=function(t){},t.prototype.addCloseEventListener=function(t){this.addEventListener("close",(function(){t()}))},t.prototype.removeCloseEventListener=function(t){},t.prototype.setupResizeObserver=function(){var t=this;"inline"===this.settings.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){t.resize(t.target.clientWidth,t.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.settings.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){return t.onPopupTargetResize()})),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},t.prototype.onPopupTargetResize=function(){var t=1*this.target.clientWidth/this.target.clientHeight,e=this.editorCanvas.clientWidth/t>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*t:this.editorCanvas.clientWidth,n=e<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/t;this.resize(e,n)},t.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},t.prototype.resize=function(t,e){this._isResizing=!0;var n=t/this.imageWidth,i=e/this.imageHeight;this.imageWidth=Math.round(t),this.imageHeight=Math.round(e),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","popup"!==this.settings.displayMode?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),void 0!==this.toolbar&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(n,i),this._isResizing=!1},t.prototype.scaleMarkers=function(t,e){var n,i=this;this._currentMarker&&this._currentMarker instanceof pt?this._currentMarker.scale(t,e):(n=this._currentMarker,this.setCurrentMarker()),this.markers.forEach((function(n){n!==i._currentMarker&&n.scale(t,e)})),void 0!==n&&this.setCurrentMarker(n)},t.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"},t.prototype.setTopLeft=function(){var t=this.editingTarget.getBoundingClientRect(),e=this.editorCanvas.getBoundingClientRect();this.left=t.left-e.left,this.top=t.top-e.top},t.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)},t.prototype.addDefs=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.defs=V.createDefs(),this.addDefsToImage(),(t=this.defs).append.apply(t,e)},t.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},t.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)},t.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},t.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},t.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)},t.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},t.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)},t.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 t=document.createElement("a");t.href="https://markerjs.com/",t.target="_blank",t.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>',t.title="Powered by marker.js",t.style.display="grid",t.style.alignItems="center",t.style.justifyItems="center",t.style.padding="3px",t.style.width="20px",t.style.height="20px",this.logoUI.appendChild(t),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},t.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?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")},t.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"},t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},t.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&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 t=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?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=void 0!==this.uiStyleSettings.zIndex?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="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Q(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","popup"===this.settings.displayMode&&(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","popup"===this.settings.displayMode&&(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 J(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},t.prototype.closeUI=function(){"popup"===this.settings.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},t.prototype.removeMarker=function(t){this.markerImage.removeChild(t.container),this.markers.indexOf(t)>-1&&this.markers.splice(this.markers.indexOf(t),1),t.dispose()},t.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},t.prototype.toolbarButtonClicked=function(t,e){if("marker"===t&&void 0!==e)this.createNewMarker(e);else if("action"===t)switch(e){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":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},t.prototype.deleteSelectedMarker=function(){var t=this;if(void 0!==this._currentMarker){var e=!1;if(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new Lt(t,t._currentMarker,!0);n(i),i.defaultPrevented&&(e=!0)})),!e){var n=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(e){return e(new Lt(t,n))}))}}},t.prototype.clear=function(){var t=this,e=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new Lt(t,void 0,!0);n(i),i.defaultPrevented&&(e=!0)})),!e)){this.setCurrentMarker();for(var n=function(e){var n=i.markers[e];i.setCurrentMarker(i.markers[e]),i._currentMarker.dispose(),i.markerImage.removeChild(i._currentMarker.container),i.markers.splice(i.markers.indexOf(i._currentMarker),1),i.eventListeners.markerdelete.forEach((function(e){return e(new Lt(t,n))}))},i=this,r=this.markers.length-1;r>=0;r--)n(r);this.addUndoStep()}},Object.defineProperty(t.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),t.prototype.showNotesEditor=function(){var t;void 0!==this._currentMarker&&(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=null!==(t=this._currentMarker.notes)&&void 0!==t?t:"",this.overlayContainer.appendChild(this.notesArea))},t.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},t.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},t.prototype.addUndoStep=function(){var t=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var e=this.getState(),n=this.undoRedoManager.getLastUndoStep();if(!n||n.width===e.width&&n.height===e.height){var i=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(e),i<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach((function(e){return e(new _t(t))}))}else this.undoRedoManager.replaceLastUndoStep(e),this.eventListeners.statechange.forEach((function(e){return e(new _t(t))}))}},t.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},t.prototype.undoStep=function(){var t=this,e=this.undoRedoManager.undo();void 0!==e&&(this.restoreState(e),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(e){return e(new _t(t))})))},t.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},t.prototype.redoStep=function(){var t=this,e=this.undoRedoManager.redo();void 0!==e&&(this.restoreState(e),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(e){return e(new _t(t))})))},t.prototype.stepZoom=function(){var t=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=t<this.zoomSteps.length-1?this.zoomSteps[t+1]:this.zoomSteps[0]},t.prototype.panTo=function(t){this.contentDiv.scrollBy({left:this.prevPanPoint.x-t.x,top:this.prevPanPoint.y-t.y}),this.prevPanPoint=t},t.prototype.startRenderAndClose=function(){return G(this,void 0,void 0,(function(){var t,e,n=this;return H(this,(function(i){switch(i.label){case 0:return[4,this.render()];case 1:return t=i.sent(),e=this.getState(),this.eventListeners.render.forEach((function(i){return i(new At(n,t,e))})),this.close(!0),[2]}}))}))},t.prototype.getState=function(t){!0===t&&this.setCurrentMarker();var e={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach((function(t){return e.markers.push(t.getState())})),e},t.prototype.restoreState=function(t){var e=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);t.markers.forEach((function(t){var n=e._availableMarkerTypes.find((function(e){return e.typeName===t.typeName}));if(void 0!==n){var i=e.addNewMarker(n);i.restoreState(t),e.markers.push(i)}})),t.width&&t.height&&(t.width!==this.imageWidth||t.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/t.width,this.imageHeight/t.height),this.eventListeners.restorestate.forEach((function(t){return t(new _t(e))}))},t.prototype.addNewMarker=function(t){var e=V.createGroup();return this.markerImage.appendChild(e),new t(e,this.overlayContainer,this.settings)},t.prototype.createNewMarker=function(t){var e,n=this;(e="string"==typeof t?this._availableMarkerTypes.find((function(e){return e.typeName===t})):t)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(e),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(e.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach((function(t){return t(new Lt(n,n._currentMarker))})))},t.prototype.markerCreated=function(t){var e=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(t),this.setCurrentMarker(t),t instanceof vt&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(vt):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach((function(t){return t(new Lt(e,e._currentMarker))}))},t.prototype.colorChanged=function(t){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=t,this.settings.defaultStrokeColor=t)},t.prototype.fillColorChanged=function(t){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=t)},t.prototype.markerStateChanged=function(t){var e=this;this.eventListeners.markerchange.forEach((function(n){return n(new Lt(e,t))}))},t.prototype.setCurrentMarker=function(t){var e=this;this._currentMarker!==t&&void 0!==this._currentMarker&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach((function(t){return t(new Lt(e,e._currentMarker))}))),this._currentMarker=t,void 0===this._currentMarker||this._currentMarker.isSelected||("new"!==this._currentMarker.state&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach((function(t){return t(new Lt(e,e._currentMarker))})))},t.prototype.onPointerDown=function(t){if(this._isFocused||this.focus(),this.touchPoints++,1===this.touchPoints||"touch"!==t.pointerType)if(void 0===this._currentMarker||"new"!==this._currentMarker.state&&"creating"!==this._currentMarker.state){if("select"===this.mode){var e=this.markers.find((function(e){return e.ownsTarget(t.target)}));void 0!==e?(this.setCurrentMarker(e),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(t.clientX,t.clientY),t.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:t.clientX,y:t.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(t.clientX,t.clientY))},t.prototype.onDblClick=function(t){if(this._isFocused||this.focus(),"select"===this.mode){var e=this.markers.find((function(e){return e.ownsTarget(t.target)}));void 0!==e&&e!==this._currentMarker&&this.setCurrentMarker(e),void 0!==this._currentMarker?this._currentMarker.dblClick(this.clientToLocalCoordinates(t.clientX,t.clientY),t.target):this.setCurrentMarker()}},t.prototype.onPointerMove=function(t){1!==this.touchPoints&&"touch"===t.pointerType||(void 0!==this._currentMarker||this.isDragging)&&(void 0!==this._currentMarker&&"edit"===this._currentMarker.state||t.preventDefault(),void 0!==this._currentMarker?this._currentMarker.manipulate(this.clientToLocalCoordinates(t.clientX,t.clientY)):this.zoomLevel>1&&this.panTo({x:t.clientX,y:t.clientY}))},t.prototype.onPointerUp=function(t){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(t.clientX,t.clientY)),this.isDragging=!1,this.addUndoStep()},t.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},t.prototype.onKeyUp=function(t){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==t.key&&"Backspace"!==t.key||this.deleteSelectedMarker()},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.markerImage.getBoundingClientRect();return{x:(t-n.left)/this.zoomLevel,y:(e-n.top)/this.zoomLevel}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var t=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=t+"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()},t.prototype.addLicenseKey=function(t){K.addKey(t)},t.prototype.addEventListener=function(t,e){this.eventListeners.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.eventListeners.removeEventListener(t,e)},t.prototype.renderState=function(t){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(t),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),t.prototype.focus=function(){var t=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(e){return e(new _t(t))})))},t.prototype.blur=function(){var t=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(e){return e(new _t(t))})))},t.instanceCounter=0,t}(),It=function(t,e){return(It=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};
|
|
|
/* **********************************
|
|
|
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.
|
|
|
***************************************************************************** */function Mt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}It(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Pt(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))}function Nt(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var jt=function(){function t(){}return t.addKey=function(e){t.key=e},Object.defineProperty(t,"isLicensed",{get:function(){return!!t.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(t.key)},enumerable:!1,configurable:!0}),t}(),Bt=function(){function t(){}return t.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},t.setAttributes=function(t,e){for(var n=0,i=e;n<i.length;n++){var r=i[n],o=r[0],s=r[1];t.setAttribute(o,s)}},t.createRect=function(e,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("width",e.toString()),r.setAttribute("height",n.toString()),i&&t.setAttributes(r,i),r},t.createLine=function(e,n,i,r,o){var s=document.createElementNS("http://www.w3.org/2000/svg","line");return s.setAttribute("x1",e.toString()),s.setAttribute("y1",n.toString()),s.setAttribute("x2",i.toString()),s.setAttribute("y2",r.toString()),o&&t.setAttributes(s,o),s},t.createPolygon=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","polygon");return i.setAttribute("points",e),n&&t.setAttributes(i,n),i},t.createCircle=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","circle");return i.setAttribute("cx",(e/2).toString()),i.setAttribute("cy",(e/2).toString()),i.setAttribute("r",e.toString()),n&&t.setAttributes(i,n),i},t.createEllipse=function(e,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return r.setAttribute("cx",(e/2).toString()),r.setAttribute("cy",(n/2).toString()),r.setAttribute("rx",(e/2).toString()),r.setAttribute("ry",(n/2).toString()),i&&t.setAttributes(r,i),r},t.createGroup=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return e&&t.setAttributes(n,e),n},t.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},t.createMarker=function(e,n,i,r,o,s,a){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return t.setAttributes(l,[["id",e],["orient",n],["markerWidth",i.toString()],["markerHeight",r.toString()],["refX",o.toString()],["refY",s.toString()]]),l.appendChild(a),l},t.createText=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),e&&t.setAttributes(n,e),n},t.createTSpan=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","tspan");return i.textContent=e,n&&t.setAttributes(i,n),i},t.createImage=function(e){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return e&&t.setAttributes(n,e),n},t.createPoint=function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=t,n.y=e,n},t.createPath=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),n&&t.setAttributes(i,n),i},t.createElement=function(e,n){var i=document.createElementNS("http://www.w3.org/2000/svg",e);return n&&t.setAttributes(i,n),i},t.getHollowRectanglePath=function(t,e,n,i,r,o,s,a){return"M"+t+","+e+"V"+(e+i)+"H"+(t+n)+"V"+e+"H"+r+"V"+o+"H"+(r+s)+"V"+(o+a)+"H"+r+"V"+e+"Z"},t}(),Ft=function(){function t(t){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+t+"_"}return Object.defineProperty(t.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(t.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(t.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),t.prototype.addClass=function(t){return void 0===this.styleSheet&&this.addStyleSheet(),t.name=""+this.classNamePrefix+t.localName,this.classes.push(t),this.styleSheet.sheet.insertRule("."+t.name+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length),t},t.prototype.addRule=function(t){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(t),this.styleSheet.sheet.insertRule(t.selector+" {"+t.style+"}",this.styleSheet.sheet.cssRules.length)},t.prototype.addStyleSheet=function(){var t;this.styleSheet=document.createElement("style"),(null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).appendChild(this.styleSheet),this.addRule(new Ut("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new Ut("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new Gt("_fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new Gt("_fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},t.prototype.removeStyleSheet=function(){var t;this.styleSheet&&((null!==(t=this.styleSheetRoot)&&void 0!==t?t:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},t}(),Ut=function(t,e){this.selector=t,this.style=e},Gt=function(t,e){this.localName=t,this.style=e},Ht=function(){function t(){this.blocks=[],this.display=""}return t.prototype.addButtonBlock=function(t){t.className=this.blockClassName,t.buttonClassName=this.buttonClassName,t.buttonColorsClassName=this.buttonColorsClassName,t.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(t)},t.prototype.addElementBlock=function(t){void 0===t.className&&(t.className=this.blockClassName),this.blocks.push(t)},t.prototype.getUI=function(){var t=document.createElement("div");return t.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,t.style.display=this.display,this.blocks.forEach((function(e){return t.appendChild(e.getUI())})),t},t}(),zt=function(){function t(){}return t.prototype.getUI=function(){var t=document.createElement("div");if(t.className=this.className,void 0!==this.minWidth&&(t.style.minWidth=this.minWidth),void 0!==this.contentAlign)switch(this.contentAlign){case"start":t.style.justifyContent="flex-start";break;case"center":t.style.justifyContent="center";break;case"end":t.style.justifyContent="flex-end"}return t.style.whiteSpace="nowrap",t},t}(),Vt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.buttons=[],e}return Mt(e,t),e.prototype.addButton=function(t){t.className=this.buttonClassName,t.colorsClassName=this.buttonColorsClassName,t.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(t)},e.prototype.getUI=function(){var e=t.prototype.getUI.call(this);return this.buttons.forEach((function(t){return e.appendChild(t.getUI())})),e},e}(zt),Kt=function(){function t(t,e){this._isActive=!1,this._isHidden=!1,this._icon=t,this.title=e,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon},set:function(t){this._icon=t,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},set:function(t){this._isActive=t,this.adjustClassName()},enumerable:!1,configurable:!0}),t.prototype.getUI=function(){var t=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 t.onClick()})),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},t.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,"")))},t.prototype.hide=function(){this._isHidden=!0},t}(),Wt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.elements=[],e}return Mt(e,t),e.prototype.addElement=function(t){this.elements.push(t)},e.prototype.getUI=function(){var e=t.prototype.getUI.call(this);return this.elements.forEach((function(t){return e.appendChild(t)})),e},e}(zt),Yt=function(){function t(t,e){this.horizontal=t,this.vertical=e}return Object.defineProperty(t.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),t.prototype.getVerticalLength=function(t){return t/this.ratio},t.prototype.getHorizontalLength=function(t){return t*this.ratio},t}(),qt=function(){function t(){}return t.getIcon=function(t,e){if(t>0&&e>0){var n=new Yt(t,e),i=n.ratio>=1?20:n.getHorizontalLength(20),r=n.ratio<1?20:n.getVerticalLength(20),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(o);var s=Bt.createDefs();o.appendChild(s);var a=Bt.createElement("clipPath",[["id","text-bg-clip"]]);s.appendChild(a);var l=Bt.createPath(Bt.getHollowRectanglePath((24-i)/2,(24-r)/2,i,r,(24-i)/2+2,(24-r)/2+2,i-4,r-4));o.appendChild(l);var c=Bt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);c.appendChild(Bt.createTSpan(t+":"+e)),o.appendChild(c);var u=c.getBBox();Bt.setAttributes(c,[["x",((24-u.width)/2).toString()],["y",((24-u.height)/2-u.y).toString()]]);var h=Bt.createPath(Bt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(u.width))/2,(24-Math.ceil(u.height))/2,Math.ceil(u.width),Math.ceil(u.height)));return a.appendChild(h),Bt.setAttributes(l,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(o),o.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>'},t}(),Xt=function(t){function e(e,n,i){var r=t.call(this,e,n)||this;return r.isDropdownOpen=!1,r.onClick=r.dropdownButtonClicked,r.dropdownButtons=i,r}return Mt(e,t),e.prototype.setupDropdown=function(){var t=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach((function(e){e.className=t.className,e.colorsClassName=t.colorsClassName,t.dropdownBlock.appendChild(e.getUI())})),this.uiContainer.appendChild(this.dropdownBlock)},e.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},e.prototype.dropdownButtonClicked=function(){void 0===this.dropdownBlock&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},e.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},e.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},e.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},e}(Kt),$t=function(){function t(t,e){this.GRIP_SIZE=10,this.color=t,this.fillColor=e,this.visual=Bt.createGroup(),this.visual.appendChild(Bt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Bt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t.prototype.setCenter=function(t,e){this.visual.childNodes.forEach((function(n){return Bt.setAttributes(n,[["cx",t.toString()],["cy",e.toString()]])}))},t}(),Qt=function(){function t(t,e,n,i){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=t,this.canvasHeight=e,this.margin=n,this.container=i,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(t.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(t){this._aspectRatio=t,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(t){this._isGridVisible=t,this.gridContainer&&Bt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(t){this._zoomFactor=t,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),t.prototype.open=function(){var t=this;this.cropShadeElement=Bt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Bt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var e=0;e<this.numberOfGridLines;e++)this.horizontalGridLines.push(Bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Bt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach((function(e){return t.gridContainer.appendChild(e)})),this.verticalGridLines.forEach((function(e){return t.gridContainer.appendChild(e)})),this.cropRectElement=Bt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new $t(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},t.prototype.setCropRectangle=function(t){this.cropRect=t;var e=Object.assign({},this.cropRect);1!==this.zoomFactor&&(e.width=this.cropRect.width*this.zoomFactor,e.height=this.cropRect.height*this.zoomFactor,e.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-e.width/2,e.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-e.height/2),Bt.setAttributes(this.cropRectElement,[["x",e.x.toString()],["y",e.y.toString()],["width",e.width.toString()],["height",e.height.toString()]]);var n=e.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach((function(t,i){var r=e.y+n*(i+1);Bt.setAttributes(t,[["x1",""+e.x],["y1",""+r],["x2",""+(e.x+e.width)],["y2",""+r]])}));var i=e.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach((function(t,n){var r=e.x+i*(n+1);Bt.setAttributes(t,[["x1",""+r],["y1",""+e.y],["x2",""+r],["y2",""+(e.y+e.height)]])})),Bt.setAttributes(this.cropShadeElement,[["d",Bt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,e.x,e.y,e.width,e.height)]]),this.topLeftGrip.setCenter(e.x,e.y),this.topRightGrip.setCenter(e.x+e.width,e.y),this.bottomLeftGrip.setCenter(e.x,e.y+e.height),this.bottomRightGrip.setCenter(e.x+e.width,e.y+e.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},t.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)},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.container.getBoundingClientRect();return{x:t-n.left+this.margin,y:e-n.top+this.margin}},t.prototype.onPointerDown=function(t){this.container.setPointerCapture(t.pointerId),this.previousPoint=this.clientToLocalCoordinates(t.clientX,t.clientY),this.cropRectElement===t.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(t.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(t.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(t.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(t.target)&&(this.activeGrip=this.bottomRightGrip)},t.prototype.onPointerMove=function(t){if(this.isMoving)this.move(this.clientToLocalCoordinates(t.clientX,t.clientY));else if(this.activeGrip){var e=this.clientToLocalCoordinates(t.clientX,t.clientY);this.resize(e)}t.preventDefault()},t.prototype.onPointerUp=function(t){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(t.pointerId)},t.prototype.move=function(t){var e=t.x-this.previousPoint.x,n=t.y-this.previousPoint.y;1!==this.zoomFactor&&(e=-e/this.zoomFactor,n=-n/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+e),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+n),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=t},t.prototype.resize=function(t){var e=Object.assign({},this.cropRect),n=t.x-this.previousPoint.x,i=t.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:e.x+n<this.margin&&(n=this.margin-e.x),e.x+=n,e.width=this.cropRect.x+this.cropRect.width-e.x;break;case this.bottomRightGrip:case this.topRightGrip:e.width+n>this.canvasWidth*this.zoomFactor&&(n=this.canvasWidth*this.zoomFactor-e.width),e.width+=n}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(e.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(n),e.height=this.aspectRatio.getVerticalLength(e.width)):(e.y+=i,e.height=this.cropRect.y+this.cropRect.height-e.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?e.height=this.aspectRatio.getVerticalLength(e.width):e.height+=i}e.width<10&&(e.x=this.cropRect.x,e.width=10),e.height<10&&(e.y=this.cropRect.y,e.height=10),this.previousPoint=t,e.x>=this.margin&&e.y>=this.margin&&e.x-this.margin+e.width<=this.canvasWidth&&e.y-this.margin+e.height<=this.canvasHeight&&(this.cropRect=e,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},t.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var t=this.cropRect.x+this.cropRect.width/2,e=this.cropRect.y+this.cropRect.height/2,n=this.aspectRatio.getHorizontalLength(this.cropRect.height),i=this.aspectRatio.getVerticalLength(this.cropRect.width);n/this.canvasWidth<i/this.canvasHeight?this.cropRect.width=n:this.cropRect.height=i,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=t-this.cropRect.width/2,this.cropRect.y=e-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)}},t.prototype.getRescaledRect=function(t,e,n,i,r,o){var s=n/t,a=i/e;return{x:(r.x-o)*s+o,y:(r.y-o)*a+o,width:r.width*s,height:r.height*a}},t.prototype.scaleCanvas=function(t,e){var n=this.getRescaledRect(this.canvasWidth,this.canvasHeight,t,e,this.cropRect,this.margin);this.canvasWidth=t,this.canvasHeight=e,this.onCropChange&&this.onCropChange(n),this.setCropRectangle(n)},t}(),Jt=function(){function t(t){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=t,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(t.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),t.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},t.prototype.onPointerDown=function(t){this.controlContainer.setPointerCapture(t.pointerId),this.isDragging=!0,this.previousPoint={x:t.clientX,y:t.clientY}},t.prototype.onPointerMove=function(t){this.isDragging&&(this.onAngleChange&&this.onAngleChange((t.clientX-this.previousPoint.x)/5),this.previousPoint.x=t.clientX)},t.prototype.onPointerUp=function(t){this.isDragging&&this.onAngleChange&&this.onAngleChange((t.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(t.pointerId)},t.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var t=this.angleLabelText.getBBox();Bt.setAttributes(this.angleLabelElement,[["x",((this.width-t.width)/2).toString()],["y",(this.height/2).toString()]])}},t.prototype.positionScaleShape=function(){if(this.scaleShape){var t=this.scaleShape.transform.baseVal.getItem(0);t.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(t,0)}},t.prototype.getVisual=function(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("width",this.width+"px"),t.setAttribute("height",this.height+"px"),t.setAttribute("viewBox","0 0 "+this.width+" "+this.height),t.style.flexShrink="0",document.body.appendChild(t);for(var e="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,n=1;n<=this.width/5+10;n++){var i=n%5==0?this.height/3:this.height/6;e+="h4v"+-i+"h1v"+i}e+="v1H0Z",this.scaleShape=Bt.createPath(e);var r=Bt.createTransform();this.scaleShape.transform.baseVal.appendItem(r),t.appendChild(this.scaleShape),this.angleLabelElement=Bt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Bt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var o=Bt.createTSpan("");return o.innerHTML="°",this.angleLabelElement.appendChild(o),t.appendChild(this.angleLabelElement),document.body.removeChild(t),t},t}(),Zt=function(){function t(){this.naturalSize=!1,this.imageType="image/png"}return t.prototype.rasterize=function(t,e,n,i,r,o,s){var a=this;return new Promise((function(l){var c=document.createElement("canvas");c.width=t.width.baseVal.value-2*i,c.height=t.height.baseVal.value-2*i;var u=1,h=1;!0===a.naturalSize?(u=e.naturalWidth/(t.width.baseVal.value-2*i)/o,h=e.naturalHeight/(t.height.baseVal.value-2*i)/s,c.width=e.naturalWidth/o,c.height=e.naturalHeight/s):void 0!==a.width&&void 0!==a.height&&(u=a.width/n.width,h=a.height/n.height,c.width*=u,c.height*=h);var d=c.getContext("2d");d.translate(c.width/2,c.height/2),d.rotate(r*Math.PI/180),d.scale(o,s),d.translate(-c.width/2,-c.height/2),d.drawImage(e,0,0,c.width,c.height);var f=document.createElement("canvas");f.width=n.width*u,f.height=n.height*h,f.getContext("2d").putImageData(d.getImageData((n.x-i)*u,(n.y-i)*h,n.width*u,n.height*h),0,0),l(f.toDataURL(a.imageType,a.imageQuality))}))},t}(),te=function(){function t(e){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=t.instanceCounter++,this.styles=new Ft(this.instanceNo),this.target=e,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(t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(t){this._zoomToCropEnabled=t,t?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(t){this._isGridVisible=t,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gridLines",{get:function(){return this._gridLines},set:function(t){this._gridLines=t,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(t){this._rotationAngle=t,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aspectRatio",{get:function(){var t;return null!==(t=this._aspectRatio)&&void 0!==t?t:this.aspectRatios[0]},set:function(t){this._aspectRatio=t},enumerable:!1,configurable:!0}),t.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(),"popup"===this.displayMode&&this.onPopupResize(),this._isOpen=!0},t.prototype.show=function(){this.showUI(),this.open()},t.prototype.close=function(t){void 0===t&&(t=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.displayMode&&window.removeEventListener("resize",this.setWindowHeight),t||this.closeEventListeners.forEach((function(t){return t()})),this._isOpen=!1)},t.prototype.addRenderEventListener=function(t){this.renderEventListeners.push(t)},t.prototype.removeRenderEventListener=function(t){this.renderEventListeners.indexOf(t)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(t),1)},t.prototype.addCloseEventListener=function(t){this.closeEventListeners.push(t)},t.prototype.removeCloseEventListener=function(t){this.closeEventListeners.indexOf(t)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(t),1)},t.prototype.setupResizeObserver=function(){var t=this;"inline"===this.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){t.resize(t.target.clientWidth,t.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},t.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var t=1*this.target.clientWidth/this.target.clientHeight,e=this.contentDiv.clientWidth/t>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*t:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,n=e+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/t;this.resize(e,n)}},t.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},t.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",Bt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},t.prototype.resize=function(t,e){this.imageWidth=Math.round(t),this.imageHeight=Math.round(e),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","popup"!==this.displayMode?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},t.prototype.setEditingTarget=function(){var t=document.createElement("canvas");t.width=this.target.naturalWidth,t.height=this.target.naturalHeight,t.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var e=t.toDataURL();Bt.setAttributes(this.editingTarget,[["href",e]]),this.setEditingTargetSize()},t.prototype.setTopLeft=function(){var t=this.target.getBoundingClientRect(),e=this.editorCanvas.getBoundingClientRect();this.left=t.left-e.left-this.CANVAS_MARGIN,this.top=t.top-e.top-this.CANVAS_MARGIN},t.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=Bt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Bt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Bt.createGroup(),this.editingTargetRotationScaleContainer=Bt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var t=Bt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(t);var e=Bt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(e),this.editingTargetContainer=Bt.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)},t.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},t.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Bt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Qt(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()},t.prototype.zoomToCrop=function(){if(this.cropRect){var t=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,e=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=t+"px "+e+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-t+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-e+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},t.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)},t.prototype.cropRectChanged=function(t){this.cropRect=t,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},t.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},t.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"},t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},t.prototype.showUI=function(){switch(this.addStyles(),"popup"===this.displayMode&&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 t=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,e=this.target.offsetTop>t+this.CANVAS_MARGIN?this.target.offsetTop-(t+this.CANVAS_MARGIN):0;this.coverDiv.style.top=e+"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=void 0!==this.styles.settings.zIndex?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=void 0!==this.styles.settings.zIndex?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="popup"===this.displayMode?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,"popup"===this.displayMode&&(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","popup"===this.displayMode&&(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},t.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},t.prototype.addTopToolbar=function(){var t=this;this.topToolbar=new Ht,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 e=new Vt;e.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(e);var n=[];this.aspectRatios.forEach((function(e){var i=new Kt(qt.getIcon(e.horizontal,e.vertical),0===e.horizontal&&0===e.vertical?"FREE":e.horizontal+":"+e.vertical);i.onClick=function(){return t.ratioButtonClicked(e)},n.push(i)})),this.aspectRatioButton=new Xt(qt.getIcon(0,0),"Aspect ratio",n),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,e.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var i=new Kt('<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");i.isActive=this.isGridVisible,i.onClick=function(){t.isGridVisible=!t.isGridVisible,i.isActive=t.isGridVisible},e.addButton(i);var r=new Kt('<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(r.isActive=this.zoomToCropEnabled,r.onClick=function(){t.zoomToCropEnabled=!t.zoomToCropEnabled,r.isActive=t.zoomToCropEnabled},e.addButton(r),!jt.isLicensed){var o=new Wt;this.topToolbar.addElementBlock(o);var s=document.createElement("div");s.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var a=document.createElement("a");a.style.color="currentColor",a.href="https://markerjs.com/products/cropro",a.target="_blank",a.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>',s.appendChild(a),o.addElement(s)}var l=new Vt;l.minWidth=3*this.toolbarHeight+"px",l.contentAlign="end",this.topToolbar.addButtonBlock(l);var c=new Kt('<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");c.onClick=this.startRenderAndClose,l.addButton(c),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(c.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var u=new Kt('<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");u.onClick=this.close,l.addButton(u),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(u.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},t.prototype.addBottomToolbar=function(){var t=this;this.bottomToolbar=new Ht,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 e=new Vt;e.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(e);var n=new Kt('<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");n.onClick=this.rotateLeftButtonClicked,e.addButton(n);var i=new Kt('<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");i.onClick=this.rotateRightButtonClicked,e.addButton(i);var r=new Wt;r.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(r),this.straightener=new Jt("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){t.rotateBy(e),t.straightener.angle=t.rotationAngle},r.addElement(this.straightener.getUI());var o=new Vt;o.minWidth=2*this.toolbarHeight+"px",o.contentAlign="end",this.bottomToolbar.addButtonBlock(o);var s=new Kt('<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");s.onClick=this.flipHorizontallyButtonClicked,o.addButton(s);var a=new Kt('<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");a.onClick=this.flipVerticallyButtonClicked,o.addButton(a)},t.prototype.ratioButtonClicked=function(t){this.aspectRatio=t,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},t.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=qt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},t.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&0!==this.aspectRatio.horizontal&&0!==this.aspectRatio.vertical?this.cropLayer.aspectRatio=new Yt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},t.prototype.closeUI=function(){"popup"===this.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},t.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},t.prototype.restoreState=function(t){if(t){var e=this.cropLayer.getRescaledRect(t.width,t.height,this.imageWidth,this.imageHeight,t.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(e),this.cropRectChanged(e),this.flippedHorizontally=t.flippedHorizontally,this.flippedVertically=t.flippedVertically,this.applyFlip(),this.rotationAngle=t.rotationAngle,this.applyRotation()}},t.prototype.clientToLocalCoordinates=function(t,e){var n=this.cropImage.getBoundingClientRect();return{x:t-n.left,y:e-n.top}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var t=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=t+"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()},t.prototype.rotateLeftButtonClicked=function(){var t=this.rotationAngle-90;this.rotationAngle%90!=0&&(t+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(t)},t.prototype.rotateRightButtonClicked=function(){var t=this.rotationAngle+90;this.rotationAngle%90!=0&&(t-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(t)},t.prototype.rotateTo=function(t){t=(t=t>180?t-360:t)<=-180?t+360:t,this.rotationAngle=t,this.applyRotation()},t.prototype.rotateBy=function(t){this.rotateTo((this.rotationAngle+t)%360)},t.prototype.applyRotation=function(){var t=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var e=this.editingTargetRotationContainer.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(e,0);var n=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/n.width,this.imageHeight/n.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=t},t.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},t.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},t.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},t.prototype.startRenderAndClose=function(){return Pt(this,void 0,void 0,(function(){var t,e;return Nt(this,(function(n){switch(n.label){case 0:return[4,this.render()];case 1:return t=n.sent(),e=this.getState(),this.renderEventListeners.forEach((function(n){return n(t,e)})),this.close(!0),[2]}}))}))},t.prototype.render=function(){return Pt(this,void 0,void 0,(function(){var t;return Nt(this,(function(e){switch(e.label){case 0:return(t=new Zt).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.width=this.renderWidth,t.height=this.renderHeight,this.unzoomFromCrop(),Bt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,t.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 e.sent(),[4,t.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,e.sent()]}}))}))},t.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Gt("toolbar","\n width: "+("inline"===this.displayMode?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+";\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.toolbarHeight+"px;\n box-sizing: content-box;\n overflow: hidden;\n line-height: 0px;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new Gt("toolbar_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new Gt("toolbar-block","\n display: flex;\n align-items: center;\n box-sizing: content-box;\n "));var t=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Gt("toolbar_button","\n display: inline-block;\n width: "+(this.toolbarHeight-2*t)+"px;\n height: "+(this.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_button_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_active_button","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n background-color: "+this.styles.settings.toolbarBackgroundActiveColor+"\n ")),this.styles.addRule(new Ut("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Ut("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.styles.settings.toolbarBackgroundHoverColor+"\n ")),this.toolbarDropdownStyleClass=this.styles.addClass(new Gt("toolbar_dropdown","\n position: absolute;\n max-width: "+4*this.toolbarHeight+"px;\n z-index: 20;\n white-space: normal;\n box-sizing: content-box;\n box-shadow: 3px 3px rgba(33, 33, 33, 0.1);\n margin: "+("inline"===this.displayMode?"0":this.popupMargin)+"px;\n line-height: 0px;\n ")),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Gt("toolbar_dropdown_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Gt("toolbar_straightener_block","\n display: flex;\n overflow: hidden;\n justify-content: center;\n -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%);\n ")),this.toolbarStraightenerStyleClass=this.styles.addClass(new Gt("toolbar_straightener","\n display: flex;\n overflow: hidden;\n justify-content: center;\n height: "+(this.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Gt("toolbar_straightener_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n "))},t.instanceCounter=0,t}(),ee=n("8hTe"),ne=n.n(ee),ie=/<pre[^>]*>/g;e.a=function(t){var e=t.value,n=void 0===e?"":e,l=t.edit,d=void 0!==l&&l,f=t.className,p=t.showTextOnly,v=t.showLines,g=t.replaces,m=t.zoomImg,y=t.hasMask,S=t.style,k=void 0===S?{}:S,w=t.stylesPrev,x=void 0===w?{}:w,_=String(n),A=Object(u.useRef)(),L=Object(u.useRef)(),R=Object(u.useState)(""),I=Object(a.a)(R,2),F=I[0],U=I[1],G=Object(u.useState)("office"),H=Object(a.a)(G,2),z=H[0],V=H[1],K=Object(u.useMemo)((function(){try{_=(_=_.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+P.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+P.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+P.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,"\n")).replace(new RegExp("(?<!\\n)\\n(?!\\n)","g")," \n")}catch(t){}var t=D(_),e=T;if(_.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",C()),b()),t=(t=t.replace(/(__special_katext_id_\d+__)/g,(function(t,n){var i=e[n],r=i.type,o=i.expression;return Object(N.renderToString)(function(t){var e=document.createElement("div");return e.innerHTML=t,0===e.childNodes.length?"":e.childNodes[0].nodeValue}(o)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),O(),p){var n=document.createElement("div");return n.innerHTML=t,n.innerText}return setTimeout((function(){return q()}),500),t}),[_]),W=Object(u.useRef)();function Y(t){var e=t.target;if("IMG"===e.tagName.toUpperCase()){if(m){var n=e.getAttribute("src");U(n),V("image")}}else if("A"===e.tagName.toUpperCase()){var i=e.getAttribute("href");if(i.indexOf("office")>-1)t.preventDefault(),U(i),V("office");else if(i.indexOf("application/pdf")>-1)t.preventDefault(),U(i),V("pdf");else if(i.indexOf("type=text")>-1)t.preventDefault(),U(i),V("html");else if(i.startsWith("#")){t.preventDefault();var r=document.getElementById(i.replace("#",""));r&&r.scrollIntoView(!0)}}}E.WebkitLineClamp=v,v&&(k=Object(o.a)(Object(o.a)({},k),E));var q=function(){var t,e=null===(t=W.current)||void 0===t?void 0:t.querySelectorAll("video");null==e||e.forEach((function(t){if(t.oncontextmenu=function(){return!1},t.src.indexOf(".m3u8")>-1)if(t.canPlayType("application/vnd.apple.mpegurl"));else if(M.a.isSupported()){var e=new M.a;e.loadSource(t.src),e.attachMedia(t)}}))};Object(u.useEffect)((function(){if(W.current&&K&&K.match(ie)&&window.PR.prettyPrint(),W.current)return W.current.addEventListener("click",Y),function(){W.current.removeEventListener("click",Y),O(),b()}}),[K,W.current,Y]);return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:W,style:Object(o.a)({},k),className:"".concat(f||""," markdown-body ").concat(ne.a.mdBody),onMouseOver:function(t){d&&("IMG"===t.target.nodeName?(A.current.style.display="flex",A.current.style.width=t.target.clientWidth+"px",A.current.style.height=t.target.clientHeight+"px",A.current.style.top=t.target.offsetTop+"px",A.current.style.left=t.target.offsetLeft+"px",L.current.src=t.target.getAttribute("src")):A.current.style.display="none")},dangerouslySetInnerHTML:{__html:K}}),h.a.createElement("div",{ref:A,className:ne.a.button},h.a.createElement(i.a,null,h.a.createElement(r.a,{onClick:function(){return(t=new te(L.current)).displayMode="popup",t.addRenderEventListener(function(){var t=Object(s.a)(c.a.mark((function t(e){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return A.current.style.display="none",t.next=3,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e}});case 3:null!=(n=t.sent)&&n.id&&g(L.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),void t.show();var t}},"裁剪"),h.a.createElement(r.a,{onClick:function(){return(t=new Dt(L.current)).settings.displayMode="popup",t.addEventListener("render",function(){var t=Object(s.a)(c.a.mark((function t(e){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(A.current.style.display="none",!L.current){t.next=6;break}return t.next=4,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e.dataUrl}});case 4:null!=(n=t.sent)&&n.id&&g(L.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.show(),void(window.markerArea=t);var t}},"编辑"))),h.a.createElement("img",{ref:L,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),h.a.createElement(j.a,{close:!0,data:F,hasMask:y,type:null!=F&&F.length?z:"",style:Object(o.a)({},x),onClose:function(){return U("")}}))}},BJfS:
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/string-convert/camel2hyphen.js ***!
|
|
|
\*****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()})).toLowerCase()}},BU3w:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***!
|
|
|
\***************************************************/
|
|
|
/*! exports provided: injectCSS, updateCSS */
|
|
|
/*! exports used: updateCSS */function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(/*! ./canUseDom */"MNnm");function r(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function o(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(i.a)())return null;var o,s=document.createElement("style");(null===(e=n.csp)||void 0===e?void 0:e.nonce)&&(s.nonce=null===(o=n.csp)||void 0===o?void 0:o.nonce);s.innerHTML=t;var a=r(n),l=a.firstChild;return n.prepend&&a.prepend?a.prepend(s):n.prepend&&l?a.insertBefore(s,l):a.appendChild(s),s}var s=new Map;function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r(n);if(!s.has(i)){var a=o("",n),l=a.parentNode;s.set(i,l),l.removeChild(a)}var c=Array.from(s.get(i).children).find((function(t){return"STYLE"===t.tagName&&t["rc-util-key"]===e}));if(c){var u,h,d;if((null===(u=n.csp)||void 0===u?void 0:u.nonce)&&c.nonce!==(null===(h=n.csp)||void 0===h?void 0:h.nonce))c.nonce=null===(d=n.csp)||void 0===d?void 0:d.nonce;return c.innerHTML!==t&&(c.innerHTML=t),c}var f=o(t,n);return f["rc-util-key"]=e,f}},"C/vA":
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/functional.js ***!
|
|
|
\*********************************************************************/
|
|
|
/*! exports provided: once */
|
|
|
/*! exports used: once */function(t,e,n){"use strict";function i(t){var e,n=this,i=!1;return function(){return i?e:(i=!0,e=t.apply(n,arguments))}}n.d(e,"a",(function(){return i}))},"Cg/j":
|
|
|
/*!******************************************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/platform/instantiation/common/instantiation.js ***!
|
|
|
\******************************************************************************************/
|
|
|
/*! exports provided: _util, IInstantiationService, createDecorator, optional */
|
|
|
/*! exports used: IInstantiationService, _util, createDecorator, optional */function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return a})),function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies",t.getServiceDependencies=function(e){return e[t.DI_DEPENDENCIES]||[]}}(i||(i={}));var r=s("instantiationService");function o(t,e,n,r){e[i.DI_TARGET]===e?e[i.DI_DEPENDENCIES].push({id:t,index:n,optional:r}):(e[i.DI_DEPENDENCIES]=[{id:t,index:n,optional:r}],e[i.DI_TARGET]=e)}function s(t){if(i.serviceIds.has(t))return i.serviceIds.get(t);var e=function(t,n,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");o(e,t,i,!1)};return e.toString=function(){return t},i.serviceIds.set(t,e),e}function a(t){return function(e,n,i){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");o(t,e,i,!0)}}},DlQD:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/marked/lib/marked.js ***!
|
|
|
\*******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=function(){"use strict";function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function n(t,n){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,n){if(t){if("string"==typeof t)return e(t,n);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(i=t[Symbol.iterator]()).next.bind(i)}var i=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){function e(){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}}t.exports={defaults:{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},getDefaults:e,changeDefaults:function(e){t.exports.defaults=e}}})),r=(i.defaults,i.getDefaults,i.changeDefaults,/[&<>"']/),o=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(t){return l[t]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(t){return t.replace(u,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var d=/(^|[^\[])\^/g,f=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,v={},g=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(t,e){v[" "+t]||(g.test(t)?v[" "+t]=t+"/":v[" "+t]=E(t,"/",!0));var n=-1===(t=v[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(m,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(y,"$1")+e:t+e}function E(t,e,n){var i=t.length;if(0===i)return"";for(var r=0;r<i;){var o=t.charAt(i-r-1);if(o!==e||n){if(o===e||!n)break;r++}else r++}return t.substr(0,i-r)}var C=function(t,e){if(e){if(r.test(t))return t.replace(o,c)}else if(s.test(t))return t.replace(a,c);return t},S=h,k=function(t,e){t=t.source||t,e=e||"";var n={replace:function(e,i){return i=(i=i.source||i).replace(d,"$1"),t=t.replace(e,i),n},getRegex:function(){return new RegExp(t,e)}};return n},w=function(t,e,n){if(t){var i;try{i=decodeURIComponent(h(n)).replace(f,"").toLowerCase()}catch(t){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}e&&!p.test(n)&&(n=b(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n},x={exec:function(){}},T=function(t){for(var e,n,i=1;i<arguments.length;i++)for(n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},O=function(t,e){var n=t.replace(/\|/g,(function(t,e,n){for(var i=!1,r=e;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n},_=E,A=function(t,e){if(-1===t.indexOf(e[1]))return-1;for(var n=t.length,i=0,r=0;r<n;r++)if("\\"===t[r])r++;else if(t[r]===e[0])i++;else if(t[r]===e[1]&&--i<0)return r;return-1},L=function(t){t&&t.sanitize&&!t.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")},R=i.defaults,D=_,I=O,M=C,P=A;function N(t,e,n){var i=e.href,r=e.title?M(e.title):null,o=t[1].replace(/\\([\[\]])/g,"$1");return"!"!==t[0].charAt(0)?{type:"link",raw:n,href:i,title:r,text:o}:{type:"image",raw:n,href:i,title:r,text:M(o)}}var j=function(){function t(t){this.options=t||R}var e=t.prototype;return e.space=function(t){var e=this.rules.block.newline.exec(t);if(e)return e[0].length>1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t,e){var n=this.rules.block.code.exec(t);if(n){var i=e[e.length-1];if(i&&"paragraph"===i.type)return{raw:n[0],text:n[0].trimRight()};var r=n[0].replace(/^ {4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:D(r,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=i.length?t.slice(i.length):t})).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var n={type:"table",header:I(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=I(n.cells[i],n.header.length);return n}}},e.hr=function(t){var e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}},e.blockquote=function(t){var e=this.rules.block.blockquote.exec(t);if(e){var n=e[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:e[0],text:n}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){for(var n,i,r,o,s,a,l,c=e[0],u=e[2],h=u.length>1,d=")"===u[u.length-1],f={type:"list",raw:c,ordered:h,start:h?+u.slice(0,-1):"",loose:!1,items:[]},p=e[0].match(this.rules.block.item),v=!1,g=p.length,m=0;m<g;m++)c=n=p[m],i=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) */,"")).indexOf("\n ")&&(i-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+i+"}","gm"),"")),m!==g-1&&(r=this.rules.block.bullet.exec(p[m+1])[0],(h?1===r.length||!d&&")"===r[r.length-1]:r.length>1||this.options.smartLists&&r!==u)&&(o=p.slice(m+1).join("\n"),f.raw=f.raw.substring(0,f.raw.length-o.length),m=g-1)),s=v||/\n\n(?!\s*$)/.test(n),m!==g-1&&(v="\n"===n.charAt(n.length-1),s||(s=v)),s&&(f.loose=!0),l=void 0,(a=/^\[[ xX]\] /.test(n))&&(l=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:c,task:a,checked:l,loose:s,text:n});return f}},e.html=function(t){var e=this.rules.block.html.exec(t);if(e)return{type:this.options.sanitize?"paragraph":"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):M(e[0]):e[0]}},e.def=function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}},e.table=function(t){var e=this.rules.block.table.exec(t);if(e){var n={type:"table",header:I(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=e[0];var i,r=n.align.length;for(i=0;i<r;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(r=n.cells.length,i=0;i<r;i++)n.cells[i]=I(n.cells[i].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}},e.lheading=function(t){var e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1]}},e.paragraph=function(t){var e=this.rules.block.paragraph.exec(t);if(e)return{type:"paragraph",raw:e[0],text:"\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1]}},e.text=function(t,e){var n=this.rules.block.text.exec(t);if(n){var i=e[e.length-1];return i&&"text"===i.type?{raw:n[0],text:n[0]}:{type:"text",raw:n[0],text:n[0]}}},e.escape=function(t){var e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:M(e[1])}},e.tag=function(t,e,n){var i=this.rules.inline.tag.exec(t);if(i)return!e&&/^<a /i.test(i[0])?e=!0:e&&/^<\/a>/i.test(i[0])&&(e=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:e,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):M(i[0]):i[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=P(e[2],"()");if(n>-1){var i=(0===e[0].indexOf("!")?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,i).trim(),e[3]=""}var r=e[2],o="";if(this.options.pedantic){var s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);s?(r=s[1],o=s[3]):o=""}else o=e[3]?e[3].slice(1,-1):"";return N(e,{href:(r=r.trim().replace(/^<([\s\S]*)>$/,"$1"))?r.replace(this.rules.inline._escapes,"$1"):r,title:o?o.replace(this.rules.inline._escapes,"$1"):o},e[0])}},e.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=e[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return N(n,i,n[0])}},e.strong=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.strong.start.exec(t);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){e=e.slice(-1*t.length);var r,o="**"===i[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(i=o.exec(e));)if(r=this.rules.inline.strong.middle.exec(e.slice(0,i.index+3)))return{type:"strong",raw:t.slice(0,r[0].length),text:t.slice(2,r[0].length-2)}}},e.em=function(t,e,n){void 0===n&&(n="");var i=this.rules.inline.em.start.exec(t);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){e=e.slice(-1*t.length);var r,o="*"===i[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(i=o.exec(e));)if(r=this.rules.inline.em.middle.exec(e.slice(0,i.index+2)))return{type:"em",raw:t.slice(0,r[0].length),text:t.slice(1,r[0].length-1)}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=n.startsWith(" ")&&n.endsWith(" ");return i&&r&&(n=n.substring(1,n.length-1)),n=M(n,!0),{type:"codespan",raw:e[0],text:n}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[1]}},e.autolink=function(t,e){var n,i,r=this.rules.inline.autolink.exec(t);if(r)return i="@"===r[2]?"mailto:"+(n=M(this.options.mangle?e(r[1]):r[1])):n=M(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},e.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var i,r;if("@"===n[2])r="mailto:"+(i=M(this.options.mangle?e(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=M(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},e.inlineText=function(t,e,n){var i,r=this.rules.inline.text.exec(t);if(r)return i=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):M(r[0]):r[0]:M(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},t}(),B=x,F=k,U=T,G={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:B,table:B,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};G.def=F(G.def).replace("label",G._label).replace("title",G._title).getRegex(),G.bullet=/(?:[*+-]|\d{1,9}[.)])/,G.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,G.item=F(G.item,"gm").replace(/bull/g,G.bullet).getRegex(),G.list=F(G.list).replace(/bull/g,G.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+G.def.source+")").getRegex(),G._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",G._comment=/<!--(?!-?>)[\s\S]*?-->/,G.html=F(G.html,"i").replace("comment",G._comment).replace("tag",G._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),G.paragraph=F(G._paragraph).replace("hr",G.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",G._tag).getRegex(),G.blockquote=F(G.blockquote).replace("paragraph",G.paragraph).getRegex(),G.normal=U({},G),G.gfm=U({},G.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*|$)"}),G.gfm.nptable=F(G.gfm.nptable).replace("hr",G.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",G._tag).getRegex(),G.gfm.table=F(G.gfm.table).replace("hr",G.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",G._tag).getRegex(),G.pedantic=U({},G.normal,{html:F("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",G._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:B,paragraph:F(G.normal._paragraph).replace("hr",G.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",G.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var H={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,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:B,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};H.punctuation=F(H.punctuation).replace(/punctuation/g,H._punctuation).getRegex(),H._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",H._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",H.em.start=F(H.em.start).replace(/punctuation/g,H._punctuation).getRegex(),H.em.middle=F(H.em.middle).replace(/punctuation/g,H._punctuation).replace(/overlapSkip/g,H._overlapSkip).getRegex(),H.em.endAst=F(H.em.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.em.endUnd=F(H.em.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.start=F(H.strong.start).replace(/punctuation/g,H._punctuation).getRegex(),H.strong.middle=F(H.strong.middle).replace(/punctuation/g,H._punctuation).replace(/blockSkip/g,H._blockSkip).getRegex(),H.strong.endAst=F(H.strong.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.strong.endUnd=F(H.strong.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex(),H.blockSkip=F(H._blockSkip,"g").getRegex(),H.overlapSkip=F(H._overlapSkip,"g").getRegex(),H._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,H._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,H._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])?)+(?![-_])/,H.autolink=F(H.autolink).replace("scheme",H._scheme).replace("email",H._email).getRegex(),H._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,H.tag=F(H.tag).replace("comment",G._comment).replace("attribute",H._attribute).getRegex(),H._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,H._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,H._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,H.link=F(H.link).replace("label",H._label).replace("href",H._href).replace("title",H._title).getRegex(),H.reflink=F(H.reflink).replace("label",H._label).getRegex(),H.reflinkSearch=F(H.reflinkSearch,"g").replace("reflink",H.reflink).replace("nolink",H.nolink).getRegex(),H.normal=U({},H),H.pedantic=U({},H.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:F(/^!?\[(label)\]\((.*?)\)/).replace("label",H._label).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H._label).getRegex()}),H.gfm=U({},H.normal,{escape:F(H.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),H.gfm.url=F(H.gfm.url,"i").replace("email",H.gfm._extended_email).getRegex(),H.breaks=U({},H.gfm,{br:F(H.br).replace("{2,}","*").getRegex(),text:F(H.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var z={block:G,inline:H},V=i.defaults,K=z.block,W=z.inline;function Y(t){return t.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function q(t){var e,n,i="",r=t.length;for(e=0;e<r;e++)n=t.charCodeAt(e),Math.random()>.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var X=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||V,this.options.tokenizer=this.options.tokenizer||new j,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:K.normal,inline:W.normal};this.options.pedantic?(e.block=K.pedantic,e.inline=W.pedantic):this.options.gfm&&(e.block=K.gfm,this.options.breaks?e.inline=W.breaks:e.inline=W.gfm),this.tokenizer.rules=e}e.lex=function(t,n){return new e(n).lex(t)};var n,i,r,o=e.prototype;return o.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(t,e,n){var i,r,o,s;for(void 0===e&&(e=[]),void 0===n&&(n=!0),t=t.replace(/^ +$/gm,"");t;)if(i=this.tokenizer.space(t))t=t.substring(i.raw.length),i.type&&e.push(i);else if(i=this.tokenizer.code(t,e))t=t.substring(i.raw.length),i.type?e.push(i):((s=e[e.length-1]).raw+="\n"+i.raw,s.text+="\n"+i.text);else if(i=this.tokenizer.fences(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.heading(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.nptable(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.hr(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.blockquote(t))t=t.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),e.push(i);else if(i=this.tokenizer.list(t)){for(t=t.substring(i.raw.length),o=i.items.length,r=0;r<o;r++)i.items[r].tokens=this.blockTokens(i.items[r].text,[],!1);e.push(i)}else if(i=this.tokenizer.html(t))t=t.substring(i.raw.length),e.push(i);else if(n&&(i=this.tokenizer.def(t)))t=t.substring(i.raw.length),this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});else if(i=this.tokenizer.table(t))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.lheading(t))t=t.substring(i.raw.length),e.push(i);else if(n&&(i=this.tokenizer.paragraph(t)))t=t.substring(i.raw.length),e.push(i);else if(i=this.tokenizer.text(t,e))t=t.substring(i.raw.length),i.type?e.push(i):((s=e[e.length-1]).raw+="\n"+i.raw,s.text+="\n"+i.text);else if(t){var a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return e},o.inline=function(t){var e,n,i,r,o,s,a=t.length;for(e=0;e<a;e++)switch((s=t[e]).type){case"paragraph":case"text":case"heading":s.tokens=[],this.inlineTokens(s.text,s.tokens);break;case"table":for(s.tokens={header:[],cells:[]},r=s.header.length,n=0;n<r;n++)s.tokens.header[n]=[],this.inlineTokens(s.header[n],s.tokens.header[n]);for(r=s.cells.length,n=0;n<r;n++)for(o=s.cells[n],s.tokens.cells[n]=[],i=0;i<o.length;i++)s.tokens.cells[n][i]=[],this.inlineTokens(o[i],s.tokens.cells[n][i]);break;case"blockquote":this.inline(s.tokens);break;case"list":for(r=s.items.length,n=0;n<r;n++)this.inline(s.items[n].tokens)}return t},o.inlineTokens=function(t,e,n,i,r){var o;void 0===e&&(e=[]),void 0===n&&(n=!1),void 0===i&&(i=!1),void 0===r&&(r="");var s,a=t;if(this.tokens.links){var l=Object.keys(this.tokens.links);if(l.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(a));)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(o=this.tokenizer.escape(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.tag(t,n,i))t=t.substring(o.raw.length),n=o.inLink,i=o.inRawBlock,e.push(o);else if(o=this.tokenizer.link(t))t=t.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),e.push(o);else if(o=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),e.push(o);else if(o=this.tokenizer.strong(t,a,r))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),e.push(o);else if(o=this.tokenizer.em(t,a,r))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),e.push(o);else if(o=this.tokenizer.codespan(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.br(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.del(t))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),e.push(o);else if(o=this.tokenizer.autolink(t,q))t=t.substring(o.raw.length),e.push(o);else if(n||!(o=this.tokenizer.url(t,q))){if(o=this.tokenizer.inlineText(t,i,Y))t=t.substring(o.raw.length),r=o.raw.slice(-1),e.push(o);else if(t){var c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else t=t.substring(o.raw.length),e.push(o);return e},n=e,r=[{key:"rules",get:function(){return{block:K,inline:W}}}],(i=null)&&t(n.prototype,i),r&&t(n,r),e}(),$=i.defaults,Q=w,J=C,Z=function(){function t(t){this.options=t||$}var e=t.prototype;return e.code=function(t,e,n){var i=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,i);null!=r&&r!==t&&(n=!0,t=r)}return i?'<pre><code class="'+this.options.langPrefix+J(i,!0)+'">'+(n?t:J(t,!0))+"</code></pre>\n":"<pre><code>"+(n?t:J(t,!0))+"</code></pre>\n"},e.blockquote=function(t){return"<blockquote>\n"+t+"</blockquote>\n"},e.html=function(t){return t},e.heading=function(t,e,n,i){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+i.slug(n)+'">'+t+"</h"+e+">\n":"<h"+e+">"+t+"</h"+e+">\n"},e.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},e.list=function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"</"+i+">\n"},e.listitem=function(t){return"<li>"+t+"</li>\n"},e.checkbox=function(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},e.paragraph=function(t){return"<p>"+t+"</p>\n"},e.table=function(t,e){return e&&(e="<tbody>"+e+"</tbody>"),"<table>\n<thead>\n"+t+"</thead>\n"+e+"</table>\n"},e.tablerow=function(t){return"<tr>\n"+t+"</tr>\n"},e.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"</"+n+">\n"},e.strong=function(t){return"<strong>"+t+"</strong>"},e.em=function(t){return"<em>"+t+"</em>"},e.codespan=function(t){return"<code>"+t+"</code>"},e.br=function(){return this.options.xhtml?"<br/>":"<br>"},e.del=function(t){return"<del>"+t+"</del>"},e.link=function(t,e,n){if(null===(t=Q(this.options.sanitize,this.options.baseUrl,t)))return n;var i='<a href="'+J(t)+'"';return e&&(i+=' title="'+e+'"'),i+=">"+n+"</a>"},e.image=function(t,e,n){if(null===(t=Q(this.options.sanitize,this.options.baseUrl,t)))return n;var i='<img src="'+t+'" alt="'+n+'"';return e&&(i+=' title="'+e+'"'),i+=this.options.xhtml?"/>":">"},e.text=function(t){return t},t}(),tt=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),et=function(){function t(){this.seen={}}return t.prototype.slug=function(t){var e=t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(e)){var n=e;do{this.seen[n]++,e=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(e))}return this.seen[e]=0,e},t}(),nt=i.defaults,it=S,rt=function(){function t(t){this.options=t||nt,this.options.renderer=this.options.renderer||new Z,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tt,this.slugger=new et}t.parse=function(e,n){return new t(n).parse(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var n,i,r,o,s,a,l,c,u,h,d,f,p,v,g,m,y,b,E="",C=t.length;for(n=0;n<C;n++)switch((h=t[n]).type){case"space":continue;case"hr":E+=this.renderer.hr();continue;case"heading":E+=this.renderer.heading(this.parseInline(h.tokens),h.depth,it(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue;case"code":E+=this.renderer.code(h.text,h.lang,h.escaped);continue;case"table":for(c="",l="",o=h.header.length,i=0;i<o;i++)l+=this.renderer.tablecell(this.parseInline(h.tokens.header[i]),{header:!0,align:h.align[i]});for(c+=this.renderer.tablerow(l),u="",o=h.cells.length,i=0;i<o;i++){for(l="",s=(a=h.tokens.cells[i]).length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(a[r]),{header:!1,align:h.align[r]});u+=this.renderer.tablerow(l)}E+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(h.tokens),E+=this.renderer.blockquote(u);continue;case"list":for(d=h.ordered,f=h.start,p=h.loose,o=h.items.length,u="",i=0;i<o;i++)m=(g=h.items[i]).checked,y=g.task,v="",g.task&&(b=this.renderer.checkbox(m),p?g.tokens.length>0&&"text"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):v+=b),v+=this.parse(g.tokens,p),u+=this.renderer.listitem(v,y,m);E+=this.renderer.list(u,d,f);continue;case"html":E+=this.renderer.html(h.text);continue;case"paragraph":E+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1<C&&"text"===t[n+1].type;)u+="\n"+((h=t[++n]).tokens?this.parseInline(h.tokens):h.text);E+=e?this.renderer.paragraph(u):u;continue;default:var S='Token with "'+h.type+'" type was not found.';if(this.options.silent)return void console.error(S);throw new Error(S)}return E},e.parseInline=function(t,e){e=e||this.renderer;var n,i,r="",o=t.length;for(n=0;n<o;n++)switch((i=t[n]).type){case"escape":r+=e.text(i.text);break;case"html":r+=e.html(i.text);break;case"link":r+=e.link(i.href,i.title,this.parseInline(i.tokens,e));break;case"image":r+=e.image(i.href,i.title,i.text);break;case"strong":r+=e.strong(this.parseInline(i.tokens,e));break;case"em":r+=e.em(this.parseInline(i.tokens,e));break;case"codespan":r+=e.codespan(i.text);break;case"br":r+=e.br();break;case"del":r+=e.del(this.parseInline(i.tokens,e));break;case"text":r+=e.text(i.text);break;default:var s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(s);throw new Error(s)}return r},t}(),ot=T,st=L,at=C,lt=i.getDefaults,ct=i.changeDefaults,ut=i.defaults;function ht(t,e,n){if(null==t)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if("function"==typeof e&&(n=e,e=null),e=ot({},ht.defaults,e||{}),st(e),n){var i,r=e.highlight;try{i=X.lex(t,e)}catch(t){return n(t)}var o=function(t){var o;if(!t)try{o=rt.parse(i,e)}catch(e){t=e}return e.highlight=r,t?n(t):n(null,o)};if(!r||r.length<3)return o();if(delete e.highlight,!i.length)return o();var s=0;return ht.walkTokens(i,(function(t){"code"===t.type&&(s++,setTimeout((function(){r(t.text,t.lang,(function(e,n){if(e)return o(e);null!=n&&n!==t.text&&(t.text=n,t.escaped=!0),0==--s&&o()}))}),0))})),void(0===s&&o())}try{var a=X.lex(t,e);return e.walkTokens&&ht.walkTokens(a,e.walkTokens),rt.parse(a,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+at(t.message+"",!0)+"</pre>";throw t}}return ht.options=ht.setOptions=function(t){return ot(ht.defaults,t),ct(ht.defaults),ht},ht.getDefaults=lt,ht.defaults=ut,ht.use=function(t){var e=ot({},t);if(t.renderer&&function(){var n=ht.defaults.renderer||new Z,i=function(e){var i=n[e];n[e]=function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=t.renderer[e].apply(n,o);return!1===a&&(a=i.apply(n,o)),a}};for(var r in t.renderer)i(r);e.renderer=n}(),t.tokenizer&&function(){var n=ht.defaults.tokenizer||new j,i=function(e){var i=n[e];n[e]=function(){for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];var a=t.tokenizer[e].apply(n,o);return!1===a&&(a=i.apply(n,o)),a}};for(var r in t.tokenizer)i(r);e.tokenizer=n}(),t.walkTokens){var n=ht.defaults.walkTokens;e.walkTokens=function(e){t.walkTokens(e),n&&n(e)}}ht.setOptions(e)},ht.walkTokens=function(t,e){for(var i,r=n(t);!(i=r()).done;){var o=i.value;switch(e(o),o.type){case"table":for(var s,a=n(o.tokens.header);!(s=a()).done;){var l=s.value;ht.walkTokens(l,e)}for(var c,u=n(o.tokens.cells);!(c=u()).done;)for(var h,d=n(c.value);!(h=d()).done;){var f=h.value;ht.walkTokens(f,e)}break;case"list":ht.walkTokens(o.items,e);break;default:o.tokens&&ht.walkTokens(o.tokens,e)}}},ht.Parser=rt,ht.parser=rt.parse,ht.Renderer=Z,ht.TextRenderer=tt,ht.Lexer=X,ht.lexer=X.lex,ht.Tokenizer=j,ht.Slugger=et,ht.parse=ht,ht}()},IBYe:
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/sugar/Column.js ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(t,e,n){"use strict";e.a=function(t){return null}},JYp7:
|
|
|
/*!*******************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***!
|
|
|
\*******************************************************************/
|
|
|
/*! exports provided: FIN, Iterator, ChainableIterator, getSequenceIterator, ArrayIterator, ArrayNavigator, MappedIterator */
|
|
|
/*! exports used: ArrayIterator, ArrayNavigator, FIN, Iterator, MappedIterator, getSequenceIterator */function(t,e,n){"use strict";n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return r})),n.d(e,"f",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u})),n.d(e,"e",(function(){return h}));var i,r,o=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s={done:!0,value:void 0};!function(t){var e={next:function(){return s}};t.empty=function(){return e},t.single=function(t){var e=!1;return{next:function(){return e?s:(e=!0,{done:!1,value:t})}}},t.fromArray=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=t.length),{next:function(){return e>=n?s:{done:!1,value:t[e++]}}}},t.fromNativeIterator=function(t){return{next:function(){var e=t.next();return e.done?s:{done:!1,value:e.value}}}},t.from=function(e){return e?Array.isArray(e)?t.fromArray(e):e:t.empty()},t.map=function(t,e){return{next:function(){var n=t.next();return n.done?s:{done:!1,value:e(n.value)}}}},t.filter=function(t,e){return{next:function(){for(;;){var n=t.next();if(n.done)return s;if(e(n.value))return{done:!1,value:n.value}}}}},t.forEach=function(t,e){for(var n=t.next();!n.done;n=t.next())e(n.value)},t.collect=function(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY);var n=[];if(0===e)return n;for(var i=0,r=t.next();!r.done&&(n.push(r.value),!(++i>=e));r=t.next());return n},t.concat=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=0;return{next:function(){if(n>=t.length)return s;var e=t[n].next();return e.done?(n++,this.next()):e}}},t.chain=function(t){return new a(t)}}(r||(r={}));var a=function(){function t(t){this.it=t}return t.prototype.next=function(){return this.it.next()},t}();function l(t){return Array.isArray(t)?r.fromArray(t):t||r.empty()}var c=function(){function t(t,e,n,i){void 0===e&&(e=0),void 0===n&&(n=t.length),void 0===i&&(i=e-1),this.items=t,this.start=e,this.end=n,this.index=i}return t.prototype.first=function(){return this.index=this.start,this.current()},t.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},t.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},t}(),u=function(t){function e(e,n,i,r){return void 0===n&&(n=0),void 0===i&&(i=e.length),void 0===r&&(r=n-1),t.call(this,e,n,i,r)||this}return o(e,t),e.prototype.current=function(){return t.prototype.current.call(this)},e.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},e.prototype.first=function(){return this.index=this.start,this.current()},e.prototype.last=function(){return this.index=this.end-1,this.current()},e.prototype.parent=function(){return null},e}(c),h=function(){function t(t,e){this.iterator=t,this.fn=e}return t.prototype.next=function(){return this.fn(this.iterator.next())},t}()},LdHM:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/rc-select/es/index.js + 6 modules ***!
|
|
|
\********************************************************/
|
|
|
/*! exports provided: Option, OptGroup, default */
|
|
|
/*! exports used: OptGroup, Option, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/TransBtn.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/generate.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/commonUtil.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/valueUtil.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/hooks/useMemo.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/pickAttrs.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-virtual-list/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"b",(function(){return C})),n.d(e,"a",(function(){return k}));var i=n("1OyB"),r=n("vuIU"),o=n("Ji7U"),s=n("LK+K"),a=n("q1tI"),l=n("rePB"),c=n("Ff2n"),u=n("ODXe"),h=n("4IlW"),d=n("bX4T"),f=n("YrtM"),p=n("TSYQ"),v=n.n(p),g=n("+nKL"),m=n("8OUc"),y=a.forwardRef((function(t,e){var n=t.prefixCls,i=t.id,r=t.flattenOptions,o=t.childrenAsData,s=t.values,p=t.searchValue,y=t.multiple,b=t.defaultActiveFirstOption,E=t.height,C=t.itemHeight,S=t.notFoundContent,k=t.open,w=t.menuItemSelectedIcon,x=t.virtual,T=t.onSelect,O=t.onToggleOpen,_=t.onActiveValue,A=t.onScroll,L=t.onMouseEnter,R="".concat(n,"-item"),D=Object(f.a)((function(){return r}),[k,r],(function(t,e){return e[0]&&t[1]!==e[1]})),I=a.useRef(null),M=function(t){t.preventDefault()},P=function(t){I.current&&I.current.scrollTo({index:t})},N=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=D.length,i=0;i<n;i+=1){var r=(t+i*e+n)%n,o=D[r],s=o.group,a=o.data;if(!s&&!a.disabled)return r}return-1},j=a.useState((function(){return N(0)})),B=Object(u.a)(j,2),F=B[0],U=B[1],G=function(t){U(t);var e=D[t];e?_(e.data.value,t):_(null,-1)};a.useEffect((function(){G(!1!==b?N(0):-1)}),[D.length,p]),a.useEffect((function(){var t=setTimeout((function(){if(!y&&k&&1===s.size){var t=Array.from(s)[0],e=D.findIndex((function(e){return e.data.value===t}));G(e),P(e)}}));return function(){return clearTimeout(t)}}),[k]);var H=function(t){void 0!==t&&T(t,{selected:!s.has(t)}),y||O(!1)};if(a.useImperativeHandle(e,(function(){return{onKeyDown:function(t){var e=t.which;switch(e){case h.a.UP:case h.a.DOWN:var n=0;if(e===h.a.UP?n=-1:e===h.a.DOWN&&(n=1),0!==n){var i=N(F+n,n);P(i),G(i)}break;case h.a.ENTER:var r=D[F];r&&!r.data.disabled?H(r.data.value):H(void 0),k&&t.preventDefault();break;case h.a.ESC:O(!1)}},onKeyUp:function(){},scrollTo:function(t){P(t)}}})),0===D.length)return a.createElement("div",{role:"listbox",id:"".concat(i,"_list"),className:"".concat(R,"-empty"),onMouseDown:M},S);function z(t){var e=D[t];if(!e)return null;var n=e.data||{},r=n.value,l=n.label,c=n.children,u=Object(d.a)(n,!0),h=o?c:l;return e?a.createElement("div",Object.assign({"aria-label":"string"==typeof h?h:null},u,{key:t,role:"option",id:"".concat(i,"_list_").concat(t),"aria-selected":s.has(r)}),r):null}return a.createElement(a.Fragment,null,a.createElement("div",{role:"listbox",id:"".concat(i,"_list"),style:{height:0,width:0,overflow:"hidden"}},z(F-1),z(F),z(F+1)),a.createElement(g.a,{itemKey:"key",ref:I,data:D,height:E,itemHeight:C,fullHeight:!1,onMouseDown:M,onScroll:A,virtual:x,onMouseEnter:L},(function(t,e){var n,i=t.group,r=t.groupOption,u=t.data,h=u.label,d=u.key;if(i)return a.createElement("div",{className:v()(R,"".concat(R,"-group"))},void 0!==h?h:d);var f=u.disabled,p=u.value,g=u.title,y=u.children,b=u.style,E=u.className,C=Object(c.a)(u,["disabled","value","title","children","style","className"]),S=s.has(p),k="".concat(R,"-option"),x=v()(R,k,E,(n={},Object(l.a)(n,"".concat(k,"-grouped"),r),Object(l.a)(n,"".concat(k,"-active"),F===e&&!f),Object(l.a)(n,"".concat(k,"-disabled"),f),Object(l.a)(n,"".concat(k,"-selected"),S),n)),T=o?y:h,O=!w||"function"==typeof w||S;return a.createElement("div",Object.assign({},C,{"aria-selected":S,className:x,title:g,onMouseMove:function(){F===e||f||G(e)},onClick:function(){f||H(p)},style:b}),a.createElement("div",{className:"".concat(k,"-content")},T||p),a.isValidElement(w)||S,O&&a.createElement(m.a,{className:"".concat(R,"-option-state"),customizeIcon:w,customizeIconProps:{isSelected:S}},S?"✓":null))})))}));y.displayName="OptionList";var b=y,E=function(){return null};E.isSelectOption=!0;var C=E,S=function(){return null};S.isSelectOptGroup=!0;var k=S,w=n("VTBJ"),x=n("Zm9Q");function T(t){var e=t.key,n=t.props,i=n.children,r=n.value,o=Object(c.a)(n,["children","value"]);return Object(w.a)({key:e,value:void 0!==r?r:e,children:i},o)}function O(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(x.a)(t).map((function(t,n){if(!a.isValidElement(t)||!t.type)return null;var i=t.type.isSelectOptGroup,r=t.key,o=t.props,s=o.children,l=Object(c.a)(o,["children"]);return e||!i?T(t):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(null===r?n:r,"__"),label:r},l),{},{options:O(s)})})).filter((function(t){return t}))}var _=n("2Qr1"),A=n("qNPg"),L=n("U8pU"),R=n("Kwbf"),D=n("WKfj");var I=function(t){var e=t.mode,n=t.options,i=t.children,r=t.backfill,o=t.allowClear,s=t.placeholder,l=t.getInputElement,c=t.showSearch,u=t.onSearch,h=t.defaultOpen,d=t.autoFocus,f=t.labelInValue,p=t.value,v=t.inputValue,g=t.optionLabelProp,m="multiple"===e||"tags"===e,y=void 0!==c?c:m||"combobox"===e,b=n||O(i);if(Object(R.a)("tags"!==e||b.every((function(t){return!t.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===e||"combobox"===e){var E=b.some((function(t){return t.options?t.options.some((function(t){return"number"==typeof("value"in t?t.value:t.key)})):"number"==typeof("value"in t?t.value:t.key)}));Object(R.a)(!E,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(R.a)("combobox"!==e||!g,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(R.a)("combobox"===e||!r,"`backfill` only works with `combobox` mode."),Object(R.a)("combobox"===e||!l,"`getInputElement` only work with `combobox` mode."),Object(R.b)("combobox"!==e||!l||!o||!s,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),u&&!y&&"combobox"!==e&&"tags"!==e&&Object(R.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(R.b)(!h||d,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=p){var C=Object(D.d)(p);Object(R.a)(!f||C.every((function(t){return"object"===Object(L.a)(t)&&("key"in t||"value"in t)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(R.a)(!m||Array.isArray(p),"`value` should be array when `mode` is `multiple` or `tags`")}if(i){var S=null;Object(x.a)(i).some((function(t){if(!a.isValidElement(t)||!t.type)return!1;var e=t.type;return!e.isSelectOption&&(e.isSelectOptGroup?!Object(x.a)(t.props.children).every((function(e){return!(a.isValidElement(e)&&t.type&&!e.type.isSelectOption)||(S=e.type,!1)})):(S=e,!0))})),S&&Object(R.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(S.displayName||S.name||S,"`.")),Object(R.a)(void 0===v,"`inputValue` is deprecated, please use `searchValue` instead.")}},M=Object(A.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:O,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:I,fillOptionsWithMissingValue:_.a}),P=function(t){Object(o.a)(n,t);var e=Object(s.a)(n);function n(){var t;return Object(i.a)(this,n),(t=e.apply(this,arguments)).selectRef=a.createRef(),t.focus=function(){t.selectRef.current.focus()},t.blur=function(){t.selectRef.current.blur()},t}return Object(r.a)(n,[{key:"render",value:function(){return a.createElement(M,Object.assign({ref:this.selectRef},this.props))}}]),n}(a.Component);P.Option=C,P.OptGroup=k;var N=P;e.c=N},MI8n:
|
|
|
/*!****************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***!
|
|
|
\****************************************************************/
|
|
|
/*! exports provided: Event, Emitter, PauseableEmitter, EventMultiplexer, EventBufferer, Relay */
|
|
|
/*! exports used: Emitter, Event, EventBufferer, EventMultiplexer, PauseableEmitter, Relay */function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return u})),n.d(e,"e",(function(){return h})),n.d(e,"d",(function(){return d})),n.d(e,"c",(function(){return f})),n.d(e,"f",(function(){return p}));var i,r,o=n(/*! ./errors.js */"/cxE"),s=n(/*! ./functional.js */"C/vA"),a=n(/*! ./lifecycle.js */"pmY6"),l=n(/*! ./linkedList.js */"24hK"),c=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){function e(t){return function(e,n,i){void 0===n&&(n=null);var r,o=!1;return r=t((function(t){if(!o)return r?r.dispose():o=!0,e.call(n,t)}),null,i),o&&r.dispose(),r}}function n(t,e){return s((function(n,i,r){return void 0===i&&(i=null),t((function(t){return n.call(i,e(t))}),null,r)}))}function i(t,e){return s((function(n,i,r){return void 0===i&&(i=null),t((function(t){e(t),n.call(i,t)}),null,r)}))}function r(t,e){return s((function(n,i,r){return void 0===i&&(i=null),t((function(t){return e(t)&&n.call(i,t)}),null,r)}))}function o(t,e,i){var r=i;return n(t,(function(t){return r=e(r,t)}))}function s(t){var e,n=new u({onFirstListenerAdd:function(){e=t(n.fire,n)},onLastListenerRemove:function(){e.dispose()}});return n.event}function l(t,e,n,i,r){var o;void 0===n&&(n=100),void 0===i&&(i=!1);var s=void 0,a=void 0,l=0,c=new u({leakWarningThreshold:r,onFirstListenerAdd:function(){o=t((function(t){l++,s=e(s,t),i&&!a&&(c.fire(s),s=void 0),clearTimeout(a),a=setTimeout((function(){var t=s;s=void 0,a=void 0,(!i||l>1)&&c.fire(t),l=0}),n)}))},onLastListenerRemove:function(){o.dispose()}});return c.event}function c(t){var e,n=!0;return r(t,(function(t){var i=n||t!==e;return n=!1,e=t,i}))}t.None=function(){return a.a.None},t.once=e,t.map=n,t.forEach=i,t.filter=r,t.signal=function(t){return t},t.any=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e,n,i){return void 0===n&&(n=null),a.e.apply(void 0,t.map((function(t){return t((function(t){return e.call(n,t)}),null,i)})))}},t.reduce=o,t.snapshot=s,t.debounce=l,t.stopwatch=function(t){var i=(new Date).getTime();return n(e(t),(function(t){return(new Date).getTime()-i}))},t.latch=c,t.buffer=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[]);var i=n.slice(),r=t((function(t){i?i.push(t):s.fire(t)})),o=function(){i&&i.forEach((function(t){return s.fire(t)})),i=null},s=new u({onFirstListenerAdd:function(){r||(r=t((function(t){return s.fire(t)})))},onFirstListenerDidAdd:function(){i&&(e?setTimeout(o):o())},onLastListenerRemove:function(){r&&r.dispose(),r=null}});return s.event};var h=function(){function t(t){this.event=t}return t.prototype.map=function(e){return new t(n(this.event,e))},t.prototype.forEach=function(e){return new t(i(this.event,e))},t.prototype.filter=function(e){return new t(r(this.event,e))},t.prototype.reduce=function(e,n){return new t(o(this.event,e,n))},t.prototype.latch=function(){return new t(c(this.event))},t.prototype.debounce=function(e,n,i,r){return void 0===n&&(n=100),void 0===i&&(i=!1),new t(l(this.event,e,n,i,r))},t.prototype.on=function(t,e,n){return this.event(t,e,n)},t.prototype.once=function(t,n,i){return e(this.event)(t,n,i)},t}();t.chain=function(t){return new h(t)},t.fromNodeEventEmitter=function(t,e,n){void 0===n&&(n=function(t){return t});var i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.fire(n.apply(void 0,t))},r=new u({onFirstListenerAdd:function(){return t.on(e,i)},onLastListenerRemove:function(){return t.removeListener(e,i)}});return r.event},t.fromDOMEventEmitter=function(t,e,n){void 0===n&&(n=function(t){return t});var i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.fire(n.apply(void 0,t))},r=new u({onFirstListenerAdd:function(){return t.addEventListener(e,i)},onLastListenerRemove:function(){return t.removeEventListener(e,i)}});return r.event},t.fromPromise=function(t){var e=new u,n=!1;return t.then(void 0,(function(){return null})).then((function(){n?e.fire(void 0):setTimeout((function(){return e.fire(void 0)}),0)})),n=!0,e.event},t.toPromise=function(t){return new Promise((function(n){return e(t)(n)}))}}(r||(r={}));!function(){function t(t,e){void 0===e&&(e=Math.random().toString(18).slice(2,5)),this.customThreshold=t,this.name=e,this._warnCountdown=0}t.prototype.dispose=function(){this._stacks&&this._stacks.clear()},t.prototype.check=function(t){var e=this,n=-1;if("number"==typeof this.customThreshold&&(n=this.customThreshold),!(n<=0||t<n)){this._stacks||(this._stacks=new Map);var i=(new Error).stack.split("\n").slice(3).join("\n"),r=this._stacks.get(i)||0;if(this._stacks.set(i,r+1),this._warnCountdown-=1,this._warnCountdown<=0){var o;this._warnCountdown=.5*n;var s=0;this._stacks.forEach((function(t,e){(!o||s<t)&&(o=e,s=t)})),console.warn("["+this.name+"] potential listener LEAK detected, having "+t+" listeners already. MOST frequent listener ("+s+"):"),console.warn(o)}return function(){var t=e._stacks.get(i)||0;e._stacks.set(i,t-1)}}}}();var u=function(){function t(t){this._disposed=!1,this._options=t,this._leakageMon=void 0}return Object.defineProperty(t.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(n,i,r){e._listeners||(e._listeners=new l.a);var o=e._listeners.isEmpty();o&&e._options&&e._options.onFirstListenerAdd&&e._options.onFirstListenerAdd(e);var s,c,u=e._listeners.push(i?[n,i]:n);return o&&e._options&&e._options.onFirstListenerDidAdd&&e._options.onFirstListenerDidAdd(e),e._options&&e._options.onListenerDidAdd&&e._options.onListenerDidAdd(e,n,i),e._leakageMon&&(s=e._leakageMon.check(e._listeners.size)),c={dispose:function(){(s&&s(),c.dispose=t._noop,e._disposed)||(u(),e._options&&e._options.onLastListenerRemove&&(e._listeners&&!e._listeners.isEmpty()||e._options.onLastListenerRemove(e)))}},r instanceof a.b?r.add(c):Array.isArray(r)&&r.push(c),c}),this._event},enumerable:!0,configurable:!0}),t.prototype.fire=function(t){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new l.a);for(var e=this._listeners.iterator(),n=e.next();!n.done;n=e.next())this._deliveryQueue.push([n.value,t]);for(;this._deliveryQueue.size>0;){var i=this._deliveryQueue.shift(),r=i[0],s=i[1];try{"function"==typeof r?r.call(void 0,s):r[0].call(r[1],s)}catch(n){Object(o.e)(n)}}}},t.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},t._noop=function(){},t}(),h=function(t){function e(e){var n=t.call(this,e)||this;return n._isPaused=0,n._eventQueue=new l.a,n._mergeFn=e&&e.merge,n}return c(e,t),e.prototype.pause=function(){this._isPaused++},e.prototype.resume=function(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){var e=this._eventQueue.toArray();this._eventQueue.clear(),t.prototype.fire.call(this,this._mergeFn(e))}else for(;!this._isPaused&&0!==this._eventQueue.size;)t.prototype.fire.call(this,this._eventQueue.shift())},e.prototype.fire=function(e){this._listeners&&(0!==this._isPaused?this._eventQueue.push(e):t.prototype.fire.call(this,e))},e}(u),d=function(){function t(){var t=this;this.hasListeners=!1,this.events=[],this.emitter=new u({onFirstListenerAdd:function(){return t.onFirstListenerAdd()},onLastListenerRemove:function(){return t.onLastListenerRemove()}})}return Object.defineProperty(t.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this,n={event:t,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);return Object(a.h)(Object(s.a)((function(){e.hasListeners&&e.unhook(n);var t=e.events.indexOf(n);e.events.splice(t,1)})))},t.prototype.onFirstListenerAdd=function(){var t=this;this.hasListeners=!0,this.events.forEach((function(e){return t.hook(e)}))},t.prototype.onLastListenerRemove=function(){var t=this;this.hasListeners=!1,this.events.forEach((function(e){return t.unhook(e)}))},t.prototype.hook=function(t){var e=this;t.listener=t.event((function(t){return e.emitter.fire(t)}))},t.prototype.unhook=function(t){t.listener&&t.listener.dispose(),t.listener=null},t.prototype.dispose=function(){this.emitter.dispose()},t}(),f=function(){function t(){this.buffers=[]}return t.prototype.wrapEvent=function(t){var e=this;return function(n,i,r){return t((function(t){var r=e.buffers[e.buffers.length-1];r?r.push((function(){return n.call(i,t)})):n.call(i,t)}),void 0,r)}},t.prototype.bufferEvents=function(t){var e=[];this.buffers.push(e);var n=t();return this.buffers.pop(),e.forEach((function(t){return t()})),n},t}(),p=function(){function t(){var t=this;this.listening=!1,this.inputEvent=r.None,this.inputEventListener=a.a.None,this.emitter=new u({onFirstListenerDidAdd:function(){t.listening=!0,t.inputEventListener=t.inputEvent(t.emitter.fire,t.emitter)},onLastListenerRemove:function(){t.listening=!1,t.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(t.prototype,"input",{set:function(t){this.inputEvent=t,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=t(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},t}()},N0LK:
|
|
|
/*!******************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***!
|
|
|
\******************************************************************/
|
|
|
/*! exports provided: isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, compareIgnoreCase, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, getNextCodePoint, nextCharLength, prevCharLength, containsRTL, containsEmoji, isBasicASCII, containsFullWidthCharacter, isFullWidthCharacter, isEmojiImprecise, UTF8_BOM_CHARACTER, startsWithUTF8BOM, safeBtoa, repeat, containsUppercaseCharacter, singleLetterHash, getGraphemeBreakType, breakBetweenGraphemeBreakType */
|
|
|
/*! exports used: UTF8_BOM_CHARACTER, breakBetweenGraphemeBreakType, commonPrefixLength, commonSuffixLength, compare, compareIgnoreCase, containsEmoji, containsFullWidthCharacter, containsRTL, containsUppercaseCharacter, convertSimple2RegExpPattern, createRegExp, endsWith, equalsIgnoreCase, escape, escapeRegExpCharacters, firstNonWhitespaceIndex, format, getGraphemeBreakType, getLeadingWhitespace, getNextCodePoint, isBasicASCII, isEmojiImprecise, isFalsyOrWhitespace, isFullWidthCharacter, isHighSurrogate, isLowSurrogate, isLowerAsciiLetter, isUpperAsciiLetter, lastNonWhitespaceIndex, nextCharLength, pad, prevCharLength, regExpFlags, regExpLeadsToEndlessLoop, repeat, rtrim, safeBtoa, singleLetterHash, startsWith, startsWithIgnoreCase, startsWithUTF8BOM, trim */function(t,e,n){"use strict";function i(t){return!t||"string"!=typeof t||0===t.trim().length}function r(t,e,n){void 0===n&&(n="0");for(var i=""+t,r=[i],o=i.length;o<e;o++)r.push(n);return r.reverse().join("")}n.d(e,"x",(function(){return i})),n.d(e,"F",(function(){return r})),n.d(e,"r",(function(){return s})),n.d(e,"o",(function(){return a})),n.d(e,"p",(function(){return l})),n.d(e,"Q",(function(){return c})),n.d(e,"K",(function(){return u})),n.d(e,"k",(function(){return h})),n.d(e,"N",(function(){return d})),n.d(e,"m",(function(){return f})),n.d(e,"l",(function(){return p})),n.d(e,"I",(function(){return v})),n.d(e,"H",(function(){return g})),n.d(e,"q",(function(){return m})),n.d(e,"t",(function(){return y})),n.d(e,"D",(function(){return b})),n.d(e,"e",(function(){return E})),n.d(e,"f",(function(){return C})),n.d(e,"B",(function(){return S})),n.d(e,"C",(function(){return k})),n.d(e,"n",(function(){return x})),n.d(e,"O",(function(){return O})),n.d(e,"c",(function(){return _})),n.d(e,"d",(function(){return A})),n.d(e,"z",(function(){return L})),n.d(e,"A",(function(){return R})),n.d(e,"u",(function(){return D})),n.d(e,"E",(function(){return M})),n.d(e,"G",(function(){return P})),n.d(e,"i",(function(){return j})),n.d(e,"g",(function(){return F})),n.d(e,"v",(function(){return G})),n.d(e,"h",(function(){return H})),n.d(e,"y",(function(){return z})),n.d(e,"w",(function(){return V})),n.d(e,"a",(function(){return K})),n.d(e,"P",(function(){return W})),n.d(e,"L",(function(){return Y})),n.d(e,"J",(function(){return q})),n.d(e,"j",(function(){return X})),n.d(e,"M",(function(){return $})),n.d(e,"s",(function(){return Q})),n.d(e,"b",(function(){return J}));var o=/{(\d+)}/g;function s(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return 0===e.length?t:t.replace(o,(function(t,n){var i=parseInt(n,10);return isNaN(i)||i<0||i>=e.length?t:e[i]}))}function a(t){return t.replace(/[<>&]/g,(function(t){switch(t){case"<":return"<";case">":return">";case"&":return"&";default:return t}}))}function l(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function c(t,e){return void 0===e&&(e=" "),u(function(t,e){if(!t||!e)return t;var n=e.length;if(0===n||0===t.length)return t;var i=0;for(;t.indexOf(e,i)===i;)i+=n;return t.substring(i)}(t,e),e)}function u(t,e){if(!t||!e)return t;var n=e.length,i=t.length;if(0===n||0===i)return t;for(var r=i,o=-1;-1!==(o=t.lastIndexOf(e,r-1))&&o+n===r;){if(0===o)return"";r=o}return t.substring(0,r)}function h(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function d(t,e){if(t.length<e.length)return!1;if(t===e)return!0;for(var n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function f(t,e){var n=t.length-e.length;return n>0?t.indexOf(e,n)===n:0===n&&t===e}function p(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("Cannot create regex from empty string");e||(t=l(t)),n.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t+="\\b"));var i="";return n.global&&(i+="g"),n.matchCase||(i+="i"),n.multiline&&(i+="m"),n.unicode&&(i+="u"),new RegExp(t,i)}function v(t){return"^"!==t.source&&"^$"!==t.source&&"$"!==t.source&&"^\\s*$"!==t.source&&!(!t.exec("")||0!==t.lastIndex)}function g(t){return(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")}function m(t){for(var e=0,n=t.length;e<n;e++){var i=t.charCodeAt(e);if(32!==i&&9!==i)return e}return-1}function y(t,e,n){void 0===e&&(e=0),void 0===n&&(n=t.length);for(var i=e;i<n;i++){var r=t.charCodeAt(i);if(32!==r&&9!==r)return t.substring(e,i)}return t.substring(e,n)}function b(t,e){void 0===e&&(e=t.length-1);for(var n=e;n>=0;n--){var i=t.charCodeAt(n);if(32!==i&&9!==i)return n}return-1}function E(t,e){return t<e?-1:t>e?1:0}function C(t,e){for(var n=Math.min(t.length,e.length),i=0;i<n;i++){var r=t.charCodeAt(i),o=e.charCodeAt(i);if(r!==o){k(r)&&(r+=32),k(o)&&(o+=32);var s=r-o;if(0!==s)return S(r)&&S(o)?s:E(t.toLowerCase(),e.toLowerCase())}}return t.length<e.length?-1:t.length>e.length?1:0}function S(t){return t>=97&&t<=122}function k(t){return t>=65&&t<=90}function w(t){return S(t)||k(t)}function x(t,e){return t.length===e.length&&T(t,e)}function T(t,e,n){void 0===n&&(n=t.length);for(var i=0;i<n;i++){var r=t.charCodeAt(i),o=e.charCodeAt(i);if(r!==o)if(w(r)&&w(o)){var s=Math.abs(r-o);if(0!==s&&32!==s)return!1}else if(String.fromCharCode(r).toLowerCase()!==String.fromCharCode(o).toLowerCase())return!1}return!0}function O(t,e){var n=e.length;return!(e.length>t.length)&&T(t,e,n)}function _(t,e){var n,i=Math.min(t.length,e.length);for(n=0;n<i;n++)if(t.charCodeAt(n)!==e.charCodeAt(n))return n;return i}function A(t,e){var n,i=Math.min(t.length,e.length),r=t.length-1,o=e.length-1;for(n=0;n<i;n++)if(t.charCodeAt(r-n)!==e.charCodeAt(o-n))return n;return i}function L(t){return 55296<=t&&t<=56319}function R(t){return 56320<=t&&t<=57343}function D(t,e,n){var i=t.charCodeAt(n);if(L(i)&&n+1<e){var r=t.charCodeAt(n+1);if(R(r))return r-56320+(i-55296<<10)+65536}return i}function I(t,e){var n=t.charCodeAt(e-1);if(R(n)&&e>1){var i=t.charCodeAt(e-2);if(L(i))return n-56320+(i-55296<<10)+65536}return n}function M(t,e){var n=Z.getInstance(),i=e,r=t.length,o=D(t,r,e);e+=o>=65536?2:1;for(var s=n.getGraphemeBreakType(o);e<r;){var a=D(t,r,e),l=n.getGraphemeBreakType(a);if(J(s,l))break;e+=a>=65536?2:1,s=l}return e-i}function P(t,e){var n=Z.getInstance(),i=e,r=I(t,e);e-=r>=65536?2:1;for(var o=n.getGraphemeBreakType(r);e>0;){var s=I(t,e),a=n.getGraphemeBreakType(s);if(J(a,o))break;e-=s>=65536?2:1,o=a}return i-e}var N=/(?:[\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 j(t){return N.test(t)}var B=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function F(t){return B.test(t)}var U=/^[\t\n\r\x20-\x7E]*$/;function G(t){return U.test(t)}function H(t){for(var e=0,n=t.length;e<n;e++)if(z(t.charCodeAt(e)))return!0;return!1}function z(t){return(t=+t)>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374}function V(t){return t>=127462&&t<=127487||t>=9728&&t<=10175||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129003||t>=129280&&t<=129535||t>=129648&&t<=129651||t>=129656&&t<=129666||t>=129680&&t<=129685}var K=String.fromCharCode(65279);function W(t){return!!(t&&t.length>0&&65279===t.charCodeAt(0))}function Y(t){return btoa(encodeURIComponent(t))}function q(t,e){for(var n="",i=0;i<e;i++)n+=t;return n}function X(t,e){return void 0===e&&(e=!1),!!t&&(e&&(t=t.replace(/\\./g,"")),t.toLowerCase()!==t)}function $(t){return(t%=52)<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}function Q(t){return Z.getInstance().getGraphemeBreakType(t)}function J(t,e){return 0===t?5!==e&&7!==e:(2!==t||3!==e)&&(4===t||2===t||3===t||(4===e||2===e||3===e||(8!==t||8!==e&&9!==e&&11!==e&&12!==e)&&((11!==t&&9!==t||9!==e&&10!==e)&&((12!==t&&10!==t||10!==e)&&(5!==e&&13!==e&&(7!==e&&(1!==t&&((13!==t||14!==e)&&(6!==t||6!==e)))))))))}var Z=function(){function t(){this._data=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]")}return t.getInstance=function(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE},t.prototype.getGraphemeBreakType=function(t){if(t<32)return 10===t?3:13===t?2:4;if(t<127)return 0;for(var e=this._data,n=e.length/3,i=1;i<=n;)if(t<e[3*i])i*=2;else{if(!(t>e[3*i+1]))return e[3*i+2];i=2*i+1}return 0},t._INSTANCE=null,t}()},NvD2:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/rc-tree/es/utils/conductUtil.js ***!
|
|
|
\******************************************************/
|
|
|
/*! exports provided: isCheckDisabled, conductCheck */
|
|
|
/*! exports used: conductCheck */function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(/*! rc-util/es/warning */"Kwbf");function r(t,e){var n=new Set;return t.forEach((function(t){e.has(t)||n.add(t)})),n}function o(t){var e=t||{},n=e.disabled,i=e.disableCheckbox,r=e.checkable;return!(!n&&!i)||!1===r}function s(t,e,n,s){var a,l=[];a=s||o;var c=new Set(t.filter((function(t){var e=!!n[t];return e||l.push(t),e}))),u=new Map,h=0;return Object.keys(n).forEach((function(t){var e=n[t],i=e.level,r=u.get(i);r||(r=new Set,u.set(i,r)),r.add(e),h=Math.max(h,i)})),Object(i.a)(!l.length,"Tree missing follow keys: ".concat(l.slice(0,100).map((function(t){return"'".concat(t,"'")})).join(", "))),!0===e?function(t,e,n,i){for(var o=new Set(t),s=new Set,a=0;a<=n;a+=1){(e.get(a)||new Set).forEach((function(t){var e=t.key,n=t.node,r=t.children,s=void 0===r?[]:r;o.has(e)&&!i(n)&&s.filter((function(t){return!i(t.node)})).forEach((function(t){o.add(t.key)}))}))}for(var l=new Set,c=n;c>=0;c-=1){(e.get(c)||new Set).forEach((function(t){var e=t.parent,n=t.node;if(!i(n)&&t.parent&&!l.has(t.parent.key))if(i(t.parent.node))l.add(e.key);else{var r=!0,a=!1;(e.children||[]).filter((function(t){return!i(t.node)})).forEach((function(t){var e=t.key,n=o.has(e);r&&!n&&(r=!1),a||!n&&!s.has(e)||(a=!0)})),r&&o.add(e.key),a&&s.add(e.key),l.add(e.key)}}))}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(r(s,o))}}(c,u,h,a):function(t,e,n,i,o){for(var s=new Set(t),a=new Set(e),l=0;l<=i;l+=1){(n.get(l)||new Set).forEach((function(t){var e=t.key,n=t.node,i=t.children,r=void 0===i?[]:i;s.has(e)||a.has(e)||o(n)||r.filter((function(t){return!o(t.node)})).forEach((function(t){s.delete(t.key)}))}))}a=new Set;for(var c=new Set,u=i;u>=0;u-=1){(n.get(u)||new Set).forEach((function(t){var e=t.parent,n=t.node;if(!o(n)&&t.parent&&!c.has(t.parent.key))if(o(t.parent.node))c.add(e.key);else{var i=!0,r=!1;(e.children||[]).filter((function(t){return!o(t.node)})).forEach((function(t){var e=t.key,n=s.has(e);i&&!n&&(i=!1),r||!n&&!a.has(e)||(r=!0)})),i||s.delete(e.key),r&&a.add(e.key),c.add(e.key)}}))}return{checkedKeys:Array.from(s),halfCheckedKeys:Array.from(r(a,s))}}(c,e.halfCheckedKeys,u,h,a)}},OZM5:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/rc-tree/es/util.js ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: arrDel, arrAdd, posToArr, getPosition, isTreeNode, getDragNodesKeys, calcDropPosition, calcSelectedKeys, convertDataToTree, parseCheckedKeys, conductExpandParent, getDataAndAria */
|
|
|
/*! exports used: arrAdd, arrDel, calcDropPosition, calcSelectedKeys, conductExpandParent, getDataAndAria, getDragNodesKeys, getPosition, isTreeNode, parseCheckedKeys, posToArr */function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return a})),n.d(e,"k",(function(){return l})),n.d(e,"h",(function(){return c})),n.d(e,"i",(function(){return u})),n.d(e,"g",(function(){return h})),n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return f})),n.d(e,"j",(function(){return p})),n.d(e,"e",(function(){return v})),n.d(e,"f",(function(){return g}));var i=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),r=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU"),o=(n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),n(/*! react */"q1tI"),n(/*! rc-util/es/warning */"Kwbf"));n(/*! ./TreeNode */"WaYH");function s(t,e){var n=t.slice(),i=n.indexOf(e);return i>=0&&n.splice(i,1),n}function a(t,e){var n=t.slice();return-1===n.indexOf(e)&&n.push(e),n}function l(t){return t.split("-")}function c(t,e){return"".concat(t,"-").concat(e)}function u(t){return t&&t.type&&t.type.isTreeNode}function h(t,e){var n=[t];return function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){var i=e.key,r=e.children;n.push(i),t(r)}))}(e[t].children),n}function d(t,e){var n=t.clientY,i=e.selectHandle.getBoundingClientRect(),r=i.top,o=i.bottom,s=i.height,a=Math.max(.25*s,2);return n<=r+a?-1:n>=o-a?1:0}function f(t,e){if(t)return e.multiple?t.slice():t.length?[t[0]]:t}function p(t){if(!t)return null;var e;if(Array.isArray(t))e={checkedKeys:t,halfCheckedKeys:void 0};else{if("object"!==Object(r.a)(t))return Object(o.a)(!1,"`checkedKeys` is not an array or an object"),null;e={checkedKeys:t.checked||void 0,halfCheckedKeys:t.halfChecked||void 0}}return e}function v(t,e){var n=new Set;return(t||[]).forEach((function(t){!function t(i){if(!n.has(i)){var r=e[i];if(r){n.add(i);var o=r.parent;r.node.disabled||o&&t(o.key)}}}(t)})),Object(i.a)(n)}function g(t){var e={};return Object.keys(t).forEach((function(n){(n.startsWith("data-")||n.startsWith("aria-"))&&(e[n]=t[n])})),e}},QDVR:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/map.js ***!
|
|
|
\**************************************************************/
|
|
|
/*! exports provided: values, keys, StringIterator, PathIterator, TernarySearchTree, ResourceMap, LinkedMap, LRUCache */
|
|
|
/*! exports used: LRUCache, ResourceMap, TernarySearchTree, keys, values */function(t,e,n){"use strict";n.d(e,"e",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"b",(function(){return h})),n.d(e,"a",(function(){return d}));var i,r=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function o(t){var e=[];return t.forEach((function(t){return e.push(t)})),e}function s(t){var e=[];return t.forEach((function(t,n){return e.push(n)})),e}var a=function(){function t(){this._value="",this._pos=0}return t.prototype.reset=function(t){return this._value=t,this._pos=0,this},t.prototype.next=function(){return this._pos+=1,this},t.prototype.hasNext=function(){return this._pos<this._value.length-1},t.prototype.cmp=function(t){return t.charCodeAt(0)-this._value.charCodeAt(this._pos)},t.prototype.value=function(){return this._value[this._pos]},t}(),l=function(){function t(t){void 0===t&&(t=!0),this._splitOnBackslash=t}return t.prototype.reset=function(t){return this._value=t.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},t.prototype.hasNext=function(){return this._to<this._value.length},t.prototype.next=function(){this._from=this._to;for(var t=!0;this._to<this._value.length;this._to++){var e=this._value.charCodeAt(this._to);if(47===e||this._splitOnBackslash&&92===e){if(!t)break;this._from++}else t=!1}return this},t.prototype.cmp=function(t){for(var e=0,n=t.length,i=this._from;e<n&&i<this._to;){var r=t.charCodeAt(e)-this._value.charCodeAt(i);if(0!==r)return r;e+=1,i+=1}return n===this._to-this._from?0:e<n?-1:1},t.prototype.value=function(){return this._value.substring(this._from,this._to)},t}(),c=function(){},u=function(){function t(t){this._iter=t}return t.forPaths=function(){return new t(new l)},t.forStrings=function(){return new t(new a)},t.prototype.clear=function(){this._root=void 0},t.prototype.set=function(t,e){var n,i=this._iter.reset(t);for(this._root||(this._root=new c,this._root.segment=i.value()),n=this._root;;){var r=i.cmp(n.segment);if(r>0)n.left||(n.left=new c,n.left.segment=i.value()),n=n.left;else if(r<0)n.right||(n.right=new c,n.right.segment=i.value()),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new c,n.mid.segment=i.value()),n=n.mid}}var o=n.value;return n.value=e,n.key=t,o},t.prototype.get=function(t){for(var e=this._iter.reset(t),n=this._root;n;){var i=e.cmp(n.segment);if(i>0)n=n.left;else if(i<0)n=n.right;else{if(!e.hasNext())break;e.next(),n=n.mid}}return n?n.value:void 0},t.prototype.findSubstr=function(t){for(var e=this._iter.reset(t),n=this._root,i=void 0;n;){var r=e.cmp(n.segment);if(r>0)n=n.left;else if(r<0)n=n.right;else{if(!e.hasNext())break;e.next(),i=n.value||i,n=n.mid}}return n&&n.value||i},t.prototype.forEach=function(t){this._forEach(this._root,t)},t.prototype._forEach=function(t,e){t&&(this._forEach(t.left,e),t.value&&e(t.value,t.key),this._forEach(t.mid,e),this._forEach(t.right,e))},t}(),h=function(){function t(){this.map=new Map,this.ignoreCase=!1}return t.prototype.set=function(t,e){this.map.set(this.toKey(t),e)},t.prototype.get=function(t){return this.map.get(this.toKey(t))},t.prototype.toKey=function(t){var e=t.toString();return this.ignoreCase&&(e=e.toLowerCase()),e},t}(),d=function(t){function e(e,n){void 0===n&&(n=1);var i=t.call(this)||this;return i._limit=e,i._ratio=Math.min(Math.max(0,n),1),i}return r(e,t),e.prototype.get=function(e){return t.prototype.get.call(this,e,2)},e.prototype.peek=function(e){return t.prototype.get.call(this,e,0)},e.prototype.set=function(e,n){t.prototype.set.call(this,e,n,2),this.checkTrim()},e.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},e}(function(){function t(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return t.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),t.prototype.get=function(t,e){void 0===e&&(e=0);var n=this._map.get(t);if(n)return 0!==e&&this.touch(n,e),n.value},t.prototype.set=function(t,e,n){void 0===n&&(n=0);var i=this._map.get(t);if(i)i.value=e,0!==n&&this.touch(i,n);else{switch(i={key:t,value:e,next:void 0,previous:void 0},n){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:default:this.addItemLast(i)}this._map.set(t,i),this._size++}},t.prototype.delete=function(t){return!!this.remove(t)},t.prototype.remove=function(t){var e=this._map.get(t);if(e)return this._map.delete(t),this.removeItem(e),this._size--,e.value},t.prototype.forEach=function(t,e){for(var n=this._head;n;)e?t.bind(e)(n.value,n.key,this):t(n.value,n.key,this),n=n.next},t.prototype.trimOld=function(t){if(!(t>=this.size))if(0!==t){for(var e=this._head,n=this.size;e&&n>t;)this._map.delete(e.key),e=e.next,n--;this._head=e,this._size=n,e&&(e.previous=void 0)}else this.clear()},t.prototype.addItemFirst=function(t){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");t.next=this._head,this._head.previous=t}else this._tail=t;this._head=t},t.prototype.addItemLast=function(t){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");t.previous=this._tail,this._tail.next=t}else this._head=t;this._tail=t},t.prototype.removeItem=function(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{var e=t.next,n=t.previous;if(!e||!n)throw new Error("Invalid list");e.previous=n,n.next=e}t.next=void 0,t.previous=void 0},t.prototype.touch=function(t,e){if(!this._head||!this._tail)throw new Error("Invalid list");if(1===e||2===e)if(1===e){if(t===this._head)return;var n=t.next,i=t.previous;t===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t}else if(2===e){if(t===this._tail)return;n=t.next,i=t.previous;t===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t}},t.prototype.toJSON=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),t},t}())},"SA+Z":
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/@babel/runtime/helpers/toArray.js ***!
|
|
|
\********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var i=n(/*! ./arrayWithHoles.js */"wTVA"),r=n(/*! ./iterableToArray.js */"EbDI"),o=n(/*! ./unsupportedIterableToArray.js */"ZhPi"),s=n(/*! ./nonIterableRest.js */"wkBT");t.exports=function(t){return i(t)||r(t)||o(t)||s()},t.exports.__esModule=!0,t.exports.default=t.exports},SJMd:
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./node_modules/code-prettify/src/prettify.js ***!
|
|
|
\****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var t=window,e=["break,continue,do,else,for,if,return,while"],n=[[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"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],i=[n,"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"],r=[n,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[n,"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"],s=[n,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="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",l=[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"],c=[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"],u=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],h=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function d(t,e,n,i,r){if(n){var o={sourceNode:t,pre:1,langExtension:null,numberLines:null,sourceCode:n,spans:null,basePos:e,decorations:null};i(o),r.push.apply(r,o.decorations)}}var f=/\S/;function p(t){for(var e=void 0,n=t.firstChild;n;n=n.nextSibling){var i=n.nodeType;e=1===i?e?t:n:3===i&&f.test(n.nodeValue)?t:e}return e===t?void 0:e}function v(t,e){var n,i={};!function(){for(var r=t.concat(e),o=[],s={},a=0,l=r.length;a<l;++a){var c=r[a],u=c[3];if(u)for(var h=u.length;--h>=0;)i[u.charAt(h)]=c;var d=c[1],f=""+d;s.hasOwnProperty(f)||(o.push(d),s[f]=null)}o.push(/[\0-\uffff]/),n=function(t){for(var e=0,n=!1,i=!1,r=0,o=t.length;r<o;++r){if((d=t[r]).ignoreCase)i=!0;else if(/[a-z]/i.test(d.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){n=!0,i=!1;break}}var s={b:8,t:9,n:10,v:11,f:12,r:13};function a(t){var e=t.charCodeAt(0);if(92!==e)return e;var n=t.charAt(1);return(e=s[n])||("0"<=n&&n<="7"?parseInt(t.substring(1),8):"u"===n||"x"===n?parseInt(t.substring(2),16):t.charCodeAt(1))}function l(t){if(t<32)return(t<16?"\\x0":"\\x")+t.toString(16);var e=String.fromCharCode(t);return"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e}function c(t){var e=t.substring(1,t.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")),n=[],i="^"===e[0],r=["["];i&&r.push("^");for(var o=i?1:0,s=e.length;o<s;++o){var c=e[o];if(/\\[bdsw]/i.test(c))r.push(c);else{var u,h=a(c);o+2<s&&"-"===e[o+1]?(u=a(e[o+2]),o+=2):u=h,n.push([h,u]),u<65||h>122||(u<65||h>90||n.push([32|Math.max(65,h),32|Math.min(u,90)]),u<97||h>122||n.push([-33&Math.max(97,h),-33&Math.min(u,122)]))}}n.sort((function(t,e){return t[0]-e[0]||e[1]-t[1]}));var d=[],f=[];for(o=0;o<n.length;++o){(p=n[o])[0]<=f[1]+1?f[1]=Math.max(f[1],p[1]):d.push(f=p)}for(o=0;o<d.length;++o){var p=d[o];r.push(l(p[0])),p[1]>p[0]&&(p[1]+1>p[0]&&r.push("-"),r.push(l(p[1])))}return r.push("]"),r.join("")}function u(t){for(var i=t.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")),r=i.length,o=[],s=0,a=0;s<r;++s){if("("===(h=i[s]))++a;else if("\\"===h.charAt(0)){(u=+h.substring(1))&&(u<=a?o[u]=-1:i[s]=l(u))}}for(s=1;s<o.length;++s)-1===o[s]&&(o[s]=++e);for(s=0,a=0;s<r;++s){if("("===(h=i[s]))o[++a]||(i[s]="(?:");else if("\\"===h.charAt(0)){var u;(u=+h.substring(1))&&u<=a&&(i[s]="\\"+o[u])}}for(s=0;s<r;++s)"^"===i[s]&&"^"!==i[s+1]&&(i[s]="");if(t.ignoreCase&&n)for(s=0;s<r;++s){var h,d=(h=i[s]).charAt(0);h.length>=2&&"["===d?i[s]=c(h):"\\"!==d&&(i[s]=h.replace(/[a-zA-Z]/g,(function(t){var e=t.charCodeAt(0);return"["+String.fromCharCode(-33&e,32|e)+"]"})))}return i.join("")}var h=[];for(r=0,o=t.length;r<o;++r){var d;if((d=t[r]).global||d.multiline)throw new Error(""+d);h.push("(?:"+u(d)+")")}return new RegExp(h.join("|"),i?"gi":"g")}(o)}();var r=e.length,o=function(t){for(var s=t.sourceCode,a=t.basePos,l=t.sourceNode,c=[a,"pln"],u=0,h=s.match(n)||[],f={},p=0,v=h.length;p<v;++p){var g,m=h[p],y=f[m],b=void 0;if("string"==typeof y)g=!1;else{var E=i[m.charAt(0)];if(E)b=m.match(E[1]),y=E[0];else{for(var S=0;S<r;++S)if(E=e[S],b=m.match(E[1])){y=E[0];break}b||(y="pln")}!(g=y.length>=5&&"lang-"===y.substring(0,5))||b&&"string"==typeof b[1]||(g=!1,y="src"),g||(f[m]=y)}var k=u;if(u+=m.length,g){var w=b[1],x=m.indexOf(w),T=x+w.length;b[2]&&(x=(T=m.length-b[2].length)-w.length);var O=y.substring(5);d(l,a+k,m.substring(0,x),o,c),d(l,a+k+x,w,C(O,w),c),d(l,a+k+T,m.substring(T),o,c)}else c.push(a+k,y)}t.decorations=c};return o}function g(t){var e=[],n=[];t.tripleQuotedStrings?e.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):t.multiLineStrings?e.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):e.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),t.verbatimStrings&&n.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var i=t.hashComments;i&&(t.cStyleComments?(i>1?e.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):e.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):e.push(["com",/^#[^\r\n]*/,null,"#"])),t.cStyleComments&&(n.push(["com",/^\/\/[^\r\n]*/,null]),n.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var r=t.regexLiterals;if(r){var o=r>1?"":"\n\r",s=o?".":"[\\S\\s]",a="/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+s+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+a+")")])}var l=t.types;l&&n.push(["typ",l]);var c=(""+t.keywords).replace(/^ | $/g,"");c.length&&n.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),e.push(["pln",/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return t.regexLiterals&&(u+="(?!s*/)"),n.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(u),null]),v(e,n)}var m=g({keywords:[i,o,r,s,a,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(t,e,n){for(var i=/(?:^|\s)nocode(?:\s|$)/,r=/\r\n?|\n/,o=t.ownerDocument,s=o.createElement("li");t.firstChild;)s.appendChild(t.firstChild);var a=[s];function l(t){var e=t.nodeType;if(1!=e||i.test(t.className)){if((3==e||4==e)&&n){var s=t.nodeValue,a=s.match(r);if(a){var u=s.substring(0,a.index);t.nodeValue=u;var h=s.substring(a.index+a[0].length);if(h)t.parentNode.insertBefore(o.createTextNode(h),t.nextSibling);c(t),u||t.parentNode.removeChild(t)}}}else if("br"===t.nodeName)c(t),t.parentNode&&t.parentNode.removeChild(t);else for(var d=t.firstChild;d;d=d.nextSibling)l(d)}function c(t){for(;!t.nextSibling;)if(!(t=t.parentNode))return;for(var e,n=function t(e,n){var i=n?e.cloneNode(!1):e,r=e.parentNode;if(r){var o=t(r,1),s=e.nextSibling;o.appendChild(i);for(var a=s;a;a=s)s=a.nextSibling,o.appendChild(a)}return i}(t.nextSibling,0);(e=n.parentNode)&&1===e.nodeType;)n=e;a.push(n)}for(var u=0;u<a.length;++u)l(a[u]);e===(0|e)&&a[0].setAttribute("value",e);var h=o.createElement("ol");h.className="linenums";for(var d=Math.max(0,e-1|0)||0,f=(u=0,a.length);u<f;++u)(s=a[u]).className="L"+(u+d)%10,s.firstChild||s.appendChild(o.createTextNode(" ")),h.appendChild(s);t.appendChild(h)}var b={};function E(e,n){for(var i=n.length;--i>=0;){var r=n[i];b.hasOwnProperty(r)?t.console&&console.warn("cannot override language handler %s",r):b[r]=e}}function C(t,e){return t&&b.hasOwnProperty(t)||(t=/^\s*</.test(e)?"default-markup":"default-code"),b[t]}function S(e){var n,i,r,o,s,a,l,c=e.langExtension;try{var u=(n=e.sourceNode,i=e.pre,r=/(?:^|\s)nocode(?:\s|$)/,o=[],s=0,a=[],l=0,function t(e){var n=e.nodeType;if(1==n){if(r.test(e.className))return;for(var c=e.firstChild;c;c=c.nextSibling)t(c);var u=e.nodeName.toLowerCase();"br"!==u&&"li"!==u||(o[l]="\n",a[l<<1]=s++,a[l++<<1|1]=e)}else if(3==n||4==n){var h=e.nodeValue;h.length&&(h=i?h.replace(/\r\n?/g,"\n"):h.replace(/[ \t\r\n]+/g," "),o[l]=h,a[l<<1]=s,s+=h.length,a[l++<<1|1]=e)}}(n),{sourceCode:o.join("").replace(/\n$/,""),spans:a}),h=u.sourceCode;e.sourceCode=h,e.spans=u.spans,e.basePos=0,C(c,h)(e),function(t){var e=/\bMSIE\s(\d+)/.exec(navigator.userAgent);e=e&&+e[1]<=8;var n,i,r=/\n/g,o=t.sourceCode,s=o.length,a=0,l=t.spans,c=l.length,u=0,h=t.decorations,d=h.length,f=0;for(h[d]=s,i=n=0;i<d;)h[i]!==h[i+2]?(h[n++]=h[i++],h[n++]=h[i++]):i+=2;for(d=n,i=n=0;i<d;){for(var p=h[i],v=h[i+1],g=i+2;g+2<=d&&h[g+1]===v;)g+=2;h[n++]=p,h[n++]=v,i=g}d=h.length=n;var m=t.sourceNode,y="";m&&(y=m.style.display,m.style.display="none");try{for(;u<c;){l[u];var b,E=l[u+2]||s,C=h[f+2]||s,S=(g=Math.min(E,C),l[u+1]);if(1!==S.nodeType&&(b=o.substring(a,g))){e&&(b=b.replace(r,"\r")),S.nodeValue=b;var k=S.ownerDocument,w=k.createElement("span");w.className=h[f+1];var x=S.parentNode;x.replaceChild(w,S),w.appendChild(S),a<E&&(l[u+1]=S=k.createTextNode(o.substring(g,E)),x.insertBefore(S,w.nextSibling))}(a=g)>=E&&(u+=2),a>=C&&(f+=2)}}finally{m&&(m.style.display=y)}}(e)}catch(e){t.console&&console.log(e&&e.stack||e)}}function k(t,e,n){var i=n||!1,r=e||null,o=document.createElement("div");return o.innerHTML="<pre>"+t+"</pre>",o=o.firstChild,i&&y(o,i,!0),S({langExtension:r,numberLines:i,sourceNode:o,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),o.innerHTML}function w(e,n){var i=n||document.body,r=i.ownerDocument||document;function o(t){return i.getElementsByTagName(t)}for(var s=[o("pre"),o("code"),o("xmp")],a=[],l=0;l<s.length;++l)for(var c=0,u=s[l].length;c<u;++c)a.push(s[l][c]);s=null;var h=Date;h.now||(h={now:function(){return+new Date}});var d=0,f=/\blang(?:uage)?-([\w.]+)(?!\S)/,v=/\bprettyprint\b/,g=/\bprettyprinted\b/,m=/pre|xmp/i,b=/^code$/i,E=/^(?:pre|code|xmp)$/i,C={};!function n(){for(var i=t.PR_SHOULD_USE_CONTINUATION?h.now()+250:1/0;d<a.length&&h.now()<i;d++){for(var o=a[d],s=C,l=o;l=l.previousSibling;){var c=l.nodeType,u=(7===c||8===c)&&l.nodeValue;if(u?!/^\??prettify\b/.test(u):3!==c||/\S/.test(l.nodeValue))break;if(u){s={},u.replace(/\b(\w+)=([\w:.%+-]+)/g,(function(t,e,n){s[e]=n}));break}}var k=o.className;if((s!==C||v.test(k))&&!g.test(k)){for(var w=!1,x=o.parentNode;x;x=x.parentNode){var T=x.tagName;if(E.test(T)&&x.className&&v.test(x.className)){w=!0;break}}if(!w){o.className+=" prettyprinted";var O,_,A=s.lang;if(!A)!(A=k.match(f))&&(O=p(o))&&b.test(O.tagName)&&(A=O.className.match(f)),A&&(A=A[1]);if(m.test(o.tagName))_=1;else{var L=o.currentStyle,R=r.defaultView,D=L?L.whiteSpace:R&&R.getComputedStyle?R.getComputedStyle(o,null).getPropertyValue("white-space"):0;_=D&&"pre"===D.substring(0,3)}var I=s.linenums;(I="true"===I||+I)||(I=!!(I=k.match(/\blinenums\b(?::(\d+))?/))&&(!I[1]||!I[1].length||+I[1])),I&&y(o,I,_),S({langExtension:A,sourceNode:o,numberLines:I,pre:_,sourceCode:null,basePos:null,spans:null,decorations:null})}}}d<a.length?t.setTimeout(n,250):"function"==typeof e&&e()}()}E(m,["default-code"]),E(v([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["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"]),E(v([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["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"]),E(v([],[["atv",/^[\s\S]+/]]),["uq.val"]),E(g({keywords:i,hashComments:!0,cStyleComments:!0,types:h}),["c","cc","cpp","cxx","cyc","m"]),E(g({keywords:"null,true,false"}),["json"]),E(g({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:h}),["cs"]),E(g({keywords:r,cStyleComments:!0}),["java"]),E(g({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),E(g({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),E(g({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),E(g({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),E(g({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),E(g({keywords:"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",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),E(v([],[["str",/^[\s\S]+/]]),["regex"]);var x=t.PR={createSimpleLexer:v,registerLangHandler:E,sourceDecorator:g,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:k,prettyPrint:w},T=t.define;"function"==typeof T&&T.amd&&T("google-code-prettify",[],(function(){return x}))}()},T8No:
|
|
|
/*!************************************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/platform/contextkey/common/contextkey.js ***!
|
|
|
\************************************************************************************/
|
|
|
/*! exports provided: ContextKeyExpr, ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyRegexExpr, ContextKeyNotRegexExpr, ContextKeyAndExpr, ContextKeyOrExpr, RawContextKey, IContextKeyService, SET_CONTEXT_COMMAND_ID */
|
|
|
/*! exports used: ContextKeyExpr, ContextKeyOrExpr, IContextKeyService, RawContextKey, SET_CONTEXT_COMMAND_ID */function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return g})),n.d(e,"d",(function(){return m})),n.d(e,"c",(function(){return y})),n.d(e,"e",(function(){return b}));var i,r=n(/*! ../../../base/common/strings.js */"N0LK"),o=n(/*! ../../instantiation/common/instantiation.js */"Cg/j"),s=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=function(){function t(){}return t.has=function(t){return c.create(t)},t.equals=function(t,e){return u.create(t,e)},t.regex=function(t,e){return f.create(t,e)},t.not=function(t){return d.create(t)},t.and=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return v.create(t)},t.or=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return g.create(t)},t.deserialize=function(t,e){if(void 0===e&&(e=!1),t)return this._deserializeOrExpression(t,e)},t._deserializeOrExpression=function(t,e){var n=this,i=t.split("||");return g.create(i.map((function(t){return n._deserializeAndExpression(t,e)})))},t._deserializeAndExpression=function(t,e){var n=this,i=t.split("&&");return v.create(i.map((function(t){return n._deserializeOne(t,e)})))},t._deserializeOne=function(t,e){if((t=t.trim()).indexOf("!=")>=0){var n=t.split("!=");return h.create(n[0].trim(),this._deserializeValue(n[1],e))}if(t.indexOf("==")>=0){n=t.split("==");return u.create(n[0].trim(),this._deserializeValue(n[1],e))}if(t.indexOf("=~")>=0){n=t.split("=~");return f.create(n[0].trim(),this._deserializeRegexValue(n[1],e))}return/^\!\s*/.test(t)?d.create(t.substr(1).trim()):c.create(t)},t._deserializeValue=function(t,e){if("true"===(t=t.trim()))return!0;if("false"===t)return!1;var n=/^'([^']*)'$/.exec(t);return n?n[1].trim():t},t._deserializeRegexValue=function(t,e){if(Object(r.x)(t)){if(e)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var n=t.indexOf("/"),i=t.lastIndexOf("/");if(n===i||n<0){if(e)throw new Error("bad regexp-value '"+t+"', missing /-enclosure");return console.warn("bad regexp-value '"+t+"', missing /-enclosure"),null}var o=t.slice(n+1,i),s="i"===t[i+1]?"i":"";try{return new RegExp(o,s)}catch(n){if(e)throw new Error("bad regexp-value '"+t+"', parse error: "+n);return console.warn("bad regexp-value '"+t+"', parse error: "+n),null}},t}();function l(t,e){var n=t.getType(),i=e.getType();if(n!==i)return n-i;switch(n){case 1:case 2:case 3:case 4:case 6:case 7:case 5:return t.cmp(e);default:throw new Error("Unknown ContextKeyExpr!")}}var c=function(){function t(t){this.key=t}return t.create=function(e){return new t(e)},t.prototype.getType=function(){return 1},t.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:0},t.prototype.equals=function(e){return e instanceof t&&this.key===e.key},t.prototype.evaluate=function(t){return!!t.getValue(this.key)},t.prototype.keys=function(){return[this.key]},t.prototype.negate=function(){return d.create(this.key)},t}(),u=function(){function t(t,e){this.key=t,this.value=e}return t.create=function(e,n){return"boolean"==typeof n?n?c.create(e):d.create(e):new t(e,n)},t.prototype.getType=function(){return 3},t.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:this.value<t.value?-1:this.value>t.value?1:0},t.prototype.equals=function(e){return e instanceof t&&(this.key===e.key&&this.value===e.value)},t.prototype.evaluate=function(t){return t.getValue(this.key)==this.value},t.prototype.keys=function(){return[this.key]},t.prototype.negate=function(){return h.create(this.key,this.value)},t}(),h=function(){function t(t,e){this.key=t,this.value=e}return t.create=function(e,n){return"boolean"==typeof n?n?d.create(e):c.create(e):new t(e,n)},t.prototype.getType=function(){return 4},t.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:this.value<t.value?-1:this.value>t.value?1:0},t.prototype.equals=function(e){return e instanceof t&&(this.key===e.key&&this.value===e.value)},t.prototype.evaluate=function(t){return t.getValue(this.key)!=this.value},t.prototype.keys=function(){return[this.key]},t.prototype.negate=function(){return u.create(this.key,this.value)},t}(),d=function(){function t(t){this.key=t}return t.create=function(e){return new t(e)},t.prototype.getType=function(){return 2},t.prototype.cmp=function(t){return this.key<t.key?-1:this.key>t.key?1:0},t.prototype.equals=function(e){return e instanceof t&&this.key===e.key},t.prototype.evaluate=function(t){return!t.getValue(this.key)},t.prototype.keys=function(){return[this.key]},t.prototype.negate=function(){return c.create(this.key)},t}(),f=function(){function t(t,e){this.key=t,this.regexp=e}return t.create=function(e,n){return new t(e,n)},t.prototype.getType=function(){return 6},t.prototype.cmp=function(t){if(this.key<t.key)return-1;if(this.key>t.key)return 1;var e=this.regexp?this.regexp.source:"",n=t.regexp?t.regexp.source:"";return e<n?-1:e>n?1:0},t.prototype.equals=function(e){if(e instanceof t){var n=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&n===i}return!1},t.prototype.evaluate=function(t){var e=t.getValue(this.key);return!!this.regexp&&this.regexp.test(e)},t.prototype.keys=function(){return[this.key]},t.prototype.negate=function(){return p.create(this)},t}(),p=function(){function t(t){this._actual=t}return t.create=function(e){return new t(e)},t.prototype.getType=function(){return 7},t.prototype.cmp=function(t){return this._actual.cmp(t._actual)},t.prototype.equals=function(e){return e instanceof t&&this._actual.equals(e._actual)},t.prototype.evaluate=function(t){return!this._actual.evaluate(t)},t.prototype.keys=function(){return this._actual.keys()},t.prototype.negate=function(){return this._actual},t}(),v=function(){function t(t){this.expr=t}return t.create=function(e){var n=t._normalizeArr(e);if(0!==n.length)return 1===n.length?n[0]:new t(n)},t.prototype.getType=function(){return 5},t.prototype.cmp=function(t){if(this.expr.length<t.expr.length)return-1;if(this.expr.length>t.expr.length)return 1;for(var e=0,n=this.expr.length;e<n;e++){var i=l(this.expr[e],t.expr[e]);if(0!==i)return i}return 0},t.prototype.equals=function(e){if(e instanceof t){if(this.expr.length!==e.expr.length)return!1;for(var n=0,i=this.expr.length;n<i;n++)if(!this.expr[n].equals(e.expr[n]))return!1;return!0}return!1},t.prototype.evaluate=function(t){for(var e=0,n=this.expr.length;e<n;e++)if(!this.expr[e].evaluate(t))return!1;return!0},t._normalizeArr=function(e){var n=[];if(e){for(var i=0,r=e.length;i<r;i++){var o=e[i];if(o)if(o instanceof t)n=n.concat(o.expr);else{if(o instanceof g)throw new Error('It is not allowed to have an or expression here due to lack of parens! For example "a && (b||c)" is not supported, use "(a&&b) || (a&&c)" instead.');n.push(o)}}n.sort(l)}return n},t.prototype.keys=function(){for(var t=[],e=0,n=this.expr;e<n.length;e++){var i=n[e];t.push.apply(t,i.keys())}return t},t.prototype.negate=function(){for(var t=[],e=0,n=this.expr;e<n.length;e++){var i=n[e];t.push(i.negate())}return g.create(t)},t}(),g=function(){function t(t){this.expr=t}return t.create=function(e){var n=t._normalizeArr(e);if(0!==n.length)return 1===n.length?n[0]:new t(n)},t.prototype.getType=function(){return 8},t.prototype.equals=function(e){if(e instanceof t){if(this.expr.length!==e.expr.length)return!1;for(var n=0,i=this.expr.length;n<i;n++)if(!this.expr[n].equals(e.expr[n]))return!1;return!0}return!1},t.prototype.evaluate=function(t){for(var e=0,n=this.expr.length;e<n;e++)if(this.expr[e].evaluate(t))return!0;return!1},t._normalizeArr=function(e){var n=[];if(e){for(var i=0,r=e.length;i<r;i++){var o=e[i];o&&(o instanceof t?n=n.concat(o.expr):n.push(o))}n.sort(l)}return n},t.prototype.keys=function(){for(var t=[],e=0,n=this.expr;e<n.length;e++){var i=n[e];t.push.apply(t,i.keys())}return t},t.prototype.negate=function(){for(var e=[],n=0,i=this.expr;n<i.length;n++){var r=i[n];e.push(r.negate())}for(var o=function(e){return e instanceof t?e.expr:[e]};e.length>1;){for(var s=e.shift(),l=e.shift(),c=[],u=0,h=o(s);u<h.length;u++)for(var d=h[u],f=0,p=o(l);f<p.length;f++){var v=p[f];c.push(a.and(d,v))}e.unshift(a.or.apply(a,c))}return e[0]},t}(),m=function(t){function e(e,n){var i=t.call(this,e)||this;return i._defaultValue=n,i}return s(e,t),e.prototype.bindTo=function(t){return t.createKey(this.key,this._defaultValue)},e.prototype.getValue=function(t){return t.getContextKeyValue(this.key)},e.prototype.toNegated=function(){return a.not(this.key)},e}(c),y=Object(o.c)("contextKeyService"),b="setContext"},WaYH:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/rc-tree/es/TreeNode.js + 1 modules ***!
|
|
|
\*********************************************************/
|
|
|
/*! exports provided: InternalTreeNode, default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/contextTypes.js because of ./node_modules/rc-tree/es/Tree.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/util.js because of ./node_modules/antd/es/table/hooks/useSelection.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/utils/treeUtil.js because of ./node_modules/antd/es/table/hooks/useSelection.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";var i=n("rePB"),r=n("Ff2n"),o=n("VTBJ"),s=n("1OyB"),a=n("vuIU"),l=n("JX7q"),c=n("Ji7U"),u=n("LK+K"),h=n("q1tI"),d=n("TSYQ"),f=n.n(d),p=n("sboe"),v=n("OZM5"),g=function(t){var e=t.prefixCls,n=t.level,r=t.isStart,o=t.isEnd;if(!n)return null;for(var s="".concat(e,"-indent-unit"),a=[],l=0;l<n;l+=1){var c;a.push(h.createElement("span",{key:l,className:f()(s,(c={},Object(i.a)(c,"".concat(s,"-start"),r[l+1]),Object(i.a)(c,"".concat(s,"-end"),o[l+1]),Object(i.a)(c,"".concat(s,"-end-first-level"),!l&&o[0]),c))}))}return h.createElement("span",{"aria-hidden":"true",className:"".concat(e,"-indent")},a)},m=n("815F"),y=function(t){Object(c.a)(n,t);var e=Object(u.a)(n);function n(){var t;return Object(s.a)(this,n),(t=e.apply(this,arguments)).state={dragNodeHighlight:!1},t.onSelectorClick=function(e){(0,t.props.context.onNodeClick)(e,Object(m.b)(t.props)),t.isSelectable()?t.onSelect(e):t.onCheck(e)},t.onSelectorDoubleClick=function(e){(0,t.props.context.onNodeDoubleClick)(e,Object(m.b)(t.props))},t.onSelect=function(e){if(!t.isDisabled()){var n=t.props.context.onNodeSelect;e.preventDefault(),n(e,Object(m.b)(t.props))}},t.onCheck=function(e){if(!t.isDisabled()){var n=t.props,i=n.disableCheckbox,r=n.checked,o=t.props.context.onNodeCheck;if(t.isCheckable()&&!i){e.preventDefault();var s=!r;o(e,Object(m.b)(t.props),s)}}},t.onMouseEnter=function(e){(0,t.props.context.onNodeMouseEnter)(e,Object(m.b)(t.props))},t.onMouseLeave=function(e){(0,t.props.context.onNodeMouseLeave)(e,Object(m.b)(t.props))},t.onContextMenu=function(e){(0,t.props.context.onNodeContextMenu)(e,Object(m.b)(t.props))},t.onDragStart=function(e){var n=t.props.context.onNodeDragStart;e.stopPropagation(),t.setState({dragNodeHighlight:!0}),n(e,Object(l.a)(t));try{e.dataTransfer.setData("text/plain","")}catch(t){}},t.onDragEnter=function(e){var n=t.props.context.onNodeDragEnter;e.preventDefault(),e.stopPropagation(),n(e,Object(l.a)(t))},t.onDragOver=function(e){var n=t.props.context.onNodeDragOver;e.preventDefault(),e.stopPropagation(),n(e,Object(l.a)(t))},t.onDragLeave=function(e){var n=t.props.context.onNodeDragLeave;e.stopPropagation(),n(e,Object(l.a)(t))},t.onDragEnd=function(e){var n=t.props.context.onNodeDragEnd;e.stopPropagation(),t.setState({dragNodeHighlight:!1}),n(e,Object(l.a)(t))},t.onDrop=function(e){var n=t.props.context.onNodeDrop;e.preventDefault(),e.stopPropagation(),t.setState({dragNodeHighlight:!1}),n(e,Object(l.a)(t))},t.onExpand=function(e){(0,t.props.context.onNodeExpand)(e,Object(m.b)(t.props))},t.setSelectHandle=function(e){t.selectHandle=e},t.getNodeState=function(){var e=t.props.expanded;return t.isLeaf()?null:e?"open":"close"},t.hasChildren=function(){var e=t.props.eventKey;return!!((t.props.context.keyEntities[e]||{}).children||[]).length},t.isLeaf=function(){var e=t.props,n=e.isLeaf,i=e.loaded,r=t.props.context.loadData,o=t.hasChildren();return!1!==n&&(n||!r&&!o||r&&i&&!o)},t.isDisabled=function(){var e=t.props.disabled;return!(!t.props.context.disabled&&!e)},t.isCheckable=function(){var e=t.props.checkable,n=t.props.context.checkable;return!(!n||!1===e)&&n},t.syncLoadData=function(e){var n=e.expanded,i=e.loading,r=e.loaded,o=t.props.context,s=o.loadData,a=o.onNodeLoad;i||s&&n&&!t.isLeaf()&&(t.hasChildren()||r||a(Object(m.b)(t.props)))},t.renderSwitcher=function(){var e=t.props,n=e.expanded,i=e.switcherIcon,r=t.props.context,s=r.prefixCls,a=r.switcherIcon,l=i||a;if(t.isLeaf())return h.createElement("span",{className:f()("".concat(s,"-switcher"),"".concat(s,"-switcher-noop"))},"function"==typeof l?l(Object(o.a)(Object(o.a)({},t.props),{},{isLeaf:!0})):l);var c=f()("".concat(s,"-switcher"),"".concat(s,"-switcher_").concat(n?"open":"close"));return h.createElement("span",{onClick:t.onExpand,className:c},"function"==typeof l?l(Object(o.a)(Object(o.a)({},t.props),{},{isLeaf:!1})):l)},t.renderCheckbox=function(){var e=t.props,n=e.checked,i=e.halfChecked,r=e.disableCheckbox,o=t.props.context.prefixCls,s=t.isDisabled(),a=t.isCheckable();if(!a)return null;var l="boolean"!=typeof a?a:null;return h.createElement("span",{className:f()("".concat(o,"-checkbox"),n&&"".concat(o,"-checkbox-checked"),!n&&i&&"".concat(o,"-checkbox-indeterminate"),(s||r)&&"".concat(o,"-checkbox-disabled")),onClick:t.onCheck},l)},t.renderIcon=function(){var e=t.props.loading,n=t.props.context.prefixCls;return h.createElement("span",{className:f()("".concat(n,"-iconEle"),"".concat(n,"-icon__").concat(t.getNodeState()||"docu"),e&&"".concat(n,"-icon_loading"))})},t.renderSelector=function(){var e,n,i=t.state.dragNodeHighlight,r=t.props,o=r.title,s=r.selected,a=r.icon,l=r.loading,c=r.data,u=t.props.context,d=u.prefixCls,p=u.showIcon,v=u.icon,g=u.draggable,m=u.loadData,y=u.titleRender,b=t.isDisabled(),E="".concat(d,"-node-content-wrapper");if(p){var C=a||v;e=C?h.createElement("span",{className:f()("".concat(d,"-iconEle"),"".concat(d,"-icon__customize"))},"function"==typeof C?C(t.props):C):t.renderIcon()}else m&&l&&(e=t.renderIcon());n="function"==typeof o?o(c):y?y(c):o;var S=h.createElement("span",{className:"".concat(d,"-title")},n);return h.createElement("span",{ref:t.setSelectHandle,title:"string"==typeof o?o:"",className:f()("".concat(E),"".concat(E,"-").concat(t.getNodeState()||"normal"),!b&&(s||i)&&"".concat(d,"-node-selected"),!b&&g&&"draggable"),draggable:!b&&g||void 0,"aria-grabbed":!b&&g||void 0,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onContextMenu:t.onContextMenu,onClick:t.onSelectorClick,onDoubleClick:t.onSelectorDoubleClick,onDragStart:g?t.onDragStart:void 0},e,S)},t}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var t=this.props.selectable,e=this.props.context.selectable;return"boolean"==typeof t?t:e}},{key:"render",value:function(){var t,e=this.props,n=e.eventKey,o=e.className,s=e.style,a=e.dragOver,l=e.dragOverGapTop,c=e.dragOverGapBottom,u=e.isLeaf,d=e.isStart,p=e.isEnd,y=e.expanded,b=e.selected,E=e.checked,C=e.halfChecked,S=e.loading,k=e.domRef,w=e.active,x=e.onMouseMove,T=Object(r.a)(e,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),O=this.props.context,_=O.prefixCls,A=O.filterTreeNode,L=O.draggable,R=O.keyEntities,D=this.isDisabled(),I=Object(v.f)(T),M=(R[n]||{}).level,P=p[p.length-1];return h.createElement("div",Object.assign({ref:k,className:f()(o,"".concat(_,"-treenode"),(t={},Object(i.a)(t,"".concat(_,"-treenode-disabled"),D),Object(i.a)(t,"".concat(_,"-treenode-switcher-").concat(y?"open":"close"),!u),Object(i.a)(t,"".concat(_,"-treenode-checkbox-checked"),E),Object(i.a)(t,"".concat(_,"-treenode-checkbox-indeterminate"),C),Object(i.a)(t,"".concat(_,"-treenode-selected"),b),Object(i.a)(t,"".concat(_,"-treenode-loading"),S),Object(i.a)(t,"".concat(_,"-treenode-active"),w),Object(i.a)(t,"".concat(_,"-treenode-leaf-last"),P),Object(i.a)(t,"drag-over",!D&&a),Object(i.a)(t,"drag-over-gap-top",!D&&l),Object(i.a)(t,"drag-over-gap-bottom",!D&&c),Object(i.a)(t,"filter-node",A&&A(Object(m.b)(this.props))),t)),style:s,onDragEnter:L?this.onDragEnter:void 0,onDragOver:L?this.onDragOver:void 0,onDragLeave:L?this.onDragLeave:void 0,onDrop:L?this.onDrop:void 0,onDragEnd:L?this.onDragEnd:void 0,onMouseMove:x},I),h.createElement(g,{prefixCls:_,level:M,isStart:d,isEnd:p}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(h.Component),b=function(t){return h.createElement(p.a.Consumer,null,(function(e){return h.createElement(y,Object.assign({},t,{context:e}))}))};b.displayName="TreeNode",b.defaultProps={title:"---"},b.isTreeNode=1;e.a=b},Y1PL:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/rc-textarea/es/index.js + 7 modules ***!
|
|
|
\**********************************************************/
|
|
|
/*! exports provided: ResizableTextArea, default */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.r(e),n.d(e,"ResizableTextArea",(function(){return I}));var i=n("wx14"),r=n("1OyB"),o=n("vuIU"),s=n("Ji7U"),a=n("LK+K"),l=n("q1tI"),c=n("VTBJ"),u=n("rePB"),h=n("Zm9Q"),d=(n("Kwbf"),n("c+Xe")),f=n("m+aA"),p=n("bdgK"),v=new Map;var g=new p.default((function(t){t.forEach((function(t){var e,n=t.target;null===(e=v.get(n))||void 0===e||e.forEach((function(t){return t(n)}))}))}));var m=function(t){Object(s.a)(n,t);var e=Object(a.a)(n);function n(){return Object(r.a)(this,n),e.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(l.Component),y=l.createContext(null);function b(t){var e=t.children,n=t.disabled,i=l.useRef(null),r=l.useRef(null),o=l.useContext(y),s=l.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),a=l.isValidElement(e)&&Object(d.c)(e),u=a?e.ref:null,h=l.useMemo((function(){return Object(d.a)(u,i)}),[u,i]),p=l.useRef(t);p.current=t;var b=l.useCallback((function(t){var e=p.current,n=e.onResize,i=e.data,r=t.getBoundingClientRect(),a=r.width,l=r.height,u=t.offsetWidth,h=t.offsetHeight,d=Math.floor(a),f=Math.floor(l);if(s.current.width!==d||s.current.height!==f||s.current.offsetWidth!==u||s.current.offsetHeight!==h){var v={width:d,height:f,offsetWidth:u,offsetHeight:h};s.current=v;var g=u===Math.round(a)?a:u,m=h===Math.round(l)?l:h,y=Object(c.a)(Object(c.a)({},v),{},{offsetWidth:g,offsetHeight:m});null==o||o(y,t,i),n&&Promise.resolve().then((function(){n(y,t)}))}}),[]);return l.useEffect((function(){var t,e,o=Object(f.a)(i.current)||Object(f.a)(r.current);return o&&!n&&(t=o,e=b,v.has(t)||(v.set(t,new Set),g.observe(t)),v.get(t).add(e)),function(){return function(t,e){v.has(t)&&(v.get(t).delete(e),v.get(t).size||(g.unobserve(t),v.delete(t)))}(o,b)}}),[i.current,n]),l.createElement(m,{ref:r},a?l.cloneElement(e,{ref:h}):e)}function E(t){var e=t.children;return Object(h.a)(e).map((function(e,n){var r=(null==e?void 0:e.key)||"".concat("rc-observer-key","-").concat(n);return l.createElement(b,Object(i.a)({},t,{key:r}),e)}))}E.Collection=function(t){var e=t.children,n=t.onBatchResize,i=l.useRef(0),r=l.useRef([]),o=l.useContext(y),s=l.useCallback((function(t,e,s){i.current+=1;var a=i.current;r.current.push({size:t,element:e,data:s}),Promise.resolve().then((function(){a===i.current&&(null==n||n(r.current),r.current=[])})),null==o||o(t,e,s)}),[n,o]);return l.createElement(y.Provider,{value:s},e)};var C,S=E,k=n("bT9E"),w=n("TSYQ"),x=n.n(w),T="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",O=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],_={};function A(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(e&&_[n])return _[n];var i=window.getComputedStyle(t),r=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),o=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),s=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),a=O.map((function(t){return"".concat(t,":").concat(i.getPropertyValue(t))})).join(";"),l={sizingStyle:a,paddingSize:o,borderSize:s,boxSizing:r};return e&&n&&(_[n]=l),l}var L,R=n("Gytx"),D=n.n(R);!function(t){t[t.NONE=0]="NONE",t[t.RESIZING=1]="RESIZING",t[t.RESIZED=2]="RESIZED"}(L||(L={}));var I=function(t){Object(s.a)(n,t);var e=Object(a.a)(n);function n(t){var o;return Object(r.a)(this,n),(o=e.call(this,t)).nextFrameActionId=void 0,o.resizeFrameId=void 0,o.textArea=void 0,o.saveTextArea=function(t){o.textArea=t},o.handleResize=function(t){var e=o.state.resizeStatus,n=o.props,i=n.autoSize,r=n.onResize;e===L.NONE&&("function"==typeof r&&r(t),i&&o.resizeOnNextFrame())},o.resizeOnNextFrame=function(){cancelAnimationFrame(o.nextFrameActionId),o.nextFrameActionId=requestAnimationFrame(o.resizeTextarea)},o.resizeTextarea=function(){var t=o.props.autoSize;if(t&&o.textArea){var e=t.minRows,n=t.maxRows,i=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;C||((C=document.createElement("textarea")).setAttribute("tab-index","-1"),C.setAttribute("aria-hidden","true"),document.body.appendChild(C)),t.getAttribute("wrap")?C.setAttribute("wrap",t.getAttribute("wrap")):C.removeAttribute("wrap");var r=A(t,e),o=r.paddingSize,s=r.borderSize,a=r.boxSizing,l=r.sizingStyle;C.setAttribute("style","".concat(l,";").concat(T)),C.value=t.value||t.placeholder||"";var c,u=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,d=C.scrollHeight;if("border-box"===a?d+=s:"content-box"===a&&(d-=o),null!==n||null!==i){C.value=" ";var f=C.scrollHeight-o;null!==n&&(u=f*n,"border-box"===a&&(u=u+o+s),d=Math.max(u,d)),null!==i&&(h=f*i,"border-box"===a&&(h=h+o+s),c=d>h?"":"hidden",d=Math.min(h,d))}return{height:d,minHeight:u,maxHeight:h,overflowY:c,resize:"none"}}(o.textArea,!1,e,n);o.setState({textareaStyles:i,resizeStatus:L.RESIZING},(function(){cancelAnimationFrame(o.resizeFrameId),o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:L.RESIZED},(function(){o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:L.NONE}),o.fixFirefoxAutoScroll()}))}))}))}))}},o.renderTextArea=function(){var t=o.props,e=t.prefixCls,n=void 0===e?"rc-textarea":e,r=t.autoSize,s=t.onResize,a=t.className,h=t.disabled,d=o.state,f=d.textareaStyles,p=d.resizeStatus,v=Object(k.a)(o.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),g=x()(n,a,Object(u.a)({},"".concat(n,"-disabled"),h));"value"in v&&(v.value=v.value||"");var m=Object(c.a)(Object(c.a)(Object(c.a)({},o.props.style),f),p===L.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(S,{onResize:o.handleResize,disabled:!(r||s)},l.createElement("textarea",Object(i.a)({},v,{className:g,style:m,ref:o.saveTextArea})))},o.state={textareaStyles:{},resizeStatus:L.NONE},o}return Object(o.a)(n,[{key:"componentDidUpdate",value:function(t){t.value===this.props.value&&D()(t.autoSize,this.props.autoSize)||this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var t=this.textArea.selectionStart,e=this.textArea.selectionEnd;this.textArea.setSelectionRange(t,e)}}catch(t){}}},{key:"render",value:function(){return this.renderTextArea()}}]),n}(l.Component),M=function(t){Object(s.a)(n,t);var e=Object(a.a)(n);function n(t){var i;Object(r.a)(this,n),(i=e.call(this,t)).resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(t){i.resizableTextArea=t},i.handleChange=function(t){var e=i.props.onChange;i.setValue(t.target.value,(function(){i.resizableTextArea.resizeTextarea()})),e&&e(t)},i.handleKeyDown=function(t){var e=i.props,n=e.onPressEnter,r=e.onKeyDown;13===t.keyCode&&n&&n(t),r&&r(t)};var o=void 0===t.value||null===t.value?t.defaultValue:t.value;return i.state={value:o},i}return Object(o.a)(n,[{key:"setValue",value:function(t,e){"value"in this.props||this.setState({value:t},e)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(I,Object(i.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(t){return"value"in t?{value:t.value}:null}}]),n}(l.Component);e.default=M},ZW9T:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./src/components/monaco-editor/index.jsx + 1 modules ***!
|
|
|
\************************************************************/
|
|
|
/*! exports provided: getLanguageByMirrorName, default, DiffEditor */
|
|
|
/*! exports used: DiffEditor, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/lodash/lodash.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js because of ./node_modules/monaco-editor/esm/vs/editor/browser/editorExtensions.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(t,e,n){"use strict";n.d(e,"a",(function(){return k}));var i=n("k1fw"),r=n("oBTY"),o=n("9og8"),s=(n("miYZ"),n("tsqr")),a=n("rAM+"),l=n("tJVT"),c=n("PpiC"),u=n("WmNS"),h=n.n(u),d=n("q1tI"),f=n.n(d),p=n("bdgK");function v(t,e,n,r,o){var s=e.getWordUntilPosition(n),a={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:s.startColumn,endColumn:s.endColumn},l=r.map((function(e){return{label:e,kind:t.languages.CompletionItemKind.Keyword,insertText:e,insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:a}}));return o.map((function(t){l.push(Object(i.a)(Object(i.a)({},t),{},{range:a}))})),l}var g=n("fjLI"),m=n("LvDl");n("+ua5");function y(t){return/^\d+$/.test(t)?"".concat(t,"px"):t}function b(){}var E={"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",Scala:"scale"};function C(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t;if(Array.isArray(t)){for(var n=0;n<t.length;n++){var i=E[t[n]];if(i)return i}return e[0]}return E[e]||e}var S=null;e.b=function(t){var e=t.width,u=void 0===e?"100%":e,E=t.height,k=void 0===E?"100%":E,w=t.value,x=t.language,T=void 0===x?"javascript":x,O=t.style,_=void 0===O?{}:O,A=t.options,L=void 0===A?{}:A,R=t.overrideServices,D=void 0===R?{}:R,I=t.theme,M=void 0===I?"vs-dark":I,P=t.onEditBlur,N=t.onSave,j=t.autoHeight,B=void 0!==j&&j,F=t.forbidCopy,U=void 0!==F&&F,G=t.onChange,H=void 0===G?b:G,z=t.editorDidMount,V=void 0===z?b:z,K=t.onFocus,W=void 0===K?b:K,Y=t.onBreakPoint,q=void 0===Y?b:Y,X=t.breakPointValue,$=void 0===X?[]:X,Q=t.filename,J=void 0===Q?"educoder.txt":Q,Z=t.errorLine,tt=t.errorContent,et=void 0===tt?"":tt,nt=t.highlightLine,it=t.openBreakPoint,rt=void 0!==it&&it,ot=(Object(c.a)(t,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint"]),Object(d.useRef)()),st=Object(d.useRef)({}),at=Object(d.useRef)(),lt=Object(d.useRef)(),ct=Object(d.useRef)([]),ut=Object(d.useRef)(!1),ht=Object(d.useRef)(),dt=Object(d.useState)(!1),ft=Object(l.a)(dt,2),pt=ft[0],vt=ft[1];function gt(){var t=st.current.instance;if(t){var e=t.getSelection(),n=st.current.pastePos||{},i=new S.Range(n.startLineNumber||e.endLineNumber,n.startColumn||e.endColumn,n.endLineNumber||e.endLineNumber,n.endColumn||e.endColumn);setTimeout((function(){t.executeEdits("",[{range:i,text:""}])}),300)}}function mt(t){(window.navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)&&83==t.keyCode&&(t.preventDefault(),N())}Object(d.useEffect)((function(){var t,e=st.current.instance;lt.current&&clearTimeout(lt.current),lt.current=setTimeout((function(){!function(){var t=st.current.instance;if(null!=w&&t&&pt){var e=t.getModel();e&&w!==e.getValue()&&(!0,e.setValue(w),t.layout(),!1)}}()}),500),null==e||null===(t=e.updateOptions)||void 0===t||t.call(e,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(w.split(/\r\n|\r|\n/g).length))+3,5)})}),[w,pt,st.current]),Object(d.useEffect)((function(){if(Z&&st.current&&st.current.instance){var t=st.current.instance;t.changeViewZones((function(t){var e=document.createElement("div");e.style.padding="10px 20px",e.style.width="calc(100% - 20px)",e.className="my-error-line-wrp",e.innerHTML=et,t.addZone({afterLineNumber:Z||11,heightInLines:3,domNode:e})}));var e={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}};t.addOverlayWidget(e),t.revealPositionInCenter({lineNumber:20,column:1})}}),[Z,st.current,pt]),Object(d.useEffect)((function(){var t;if(null!==(t=st.current)&&void 0!==t&&t.instance&&pt&&rt){var e=st.current.instance,n=e.getModel();if(!n)return;!function(){var t,i=[],r=[],o=n.getAllDecorations(),s=Object(a.a)(o);try{for(s.s();!(t=s.n()).done;){var l,c=t.value;if("highlighted-line"===c.options.className)i.push(null==c||null===(l=c.range)||void 0===l?void 0:l.startLineNumber),r.push(null==c?void 0:c.id)}}catch(t){s.e(t)}finally{s.f()}n.deltaDecorations(r,[]);var u=n.getLineCount();nt&&nt<=u&&(e.deltaDecorations([],[{range:new S.Range(nt,1,nt,n.getLineMaxColumn(nt)),options:{isWholeLine:!0,className:"highlighted-line"}}]),e.revealLineInCenter(nt))}();var i=function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=[],r=[],o=n.getAllDecorations(),s=Object(a.a)(o);try{for(s.s();!(t=s.n()).done;){var l,c=t.value;if("breakpoints"===c.options.linesDecorationsClassName)i.push(null==c||null===(l=c.range)||void 0===l?void 0:l.startLineNumber),r.push(null==c?void 0:c.id)}}catch(t){s.e(t)}finally{s.f()}if(e)return{lines:i,ids:r};q(i)},r=function(){var t=Object(o.a)(h.a.mark((function t(e){var r;return h.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={range:new S.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},t.next=3,n.deltaDecorations([],[r]);case 3:i();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),s=function(){var t=Object(o.a)(h.a.mark((function t(r){var o,s,l,c,u;return h.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=[],s=e.getLineDecorations(r),l=Object(a.a)(s);try{for(l.s();!(c=l.n()).done;)"breakpoints"===(u=c.value).options.linesDecorationsClassName&&o.push(u.id)}catch(t){l.e(t)}finally{l.f()}return t.next=6,n.deltaDecorations(o,[]);case 6:i();case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),l=function(t){var n,i=e.getLineDecorations(t),r=Object(a.a)(i);try{for(r.s();!(n=r.n()).done;){if("breakpoints"===n.value.options.linesDecorationsClassName)return!0}}catch(t){r.e(t)}finally{r.f()}return!1};if(!Object(m.isEqual)($,i(!0).lines)){n.deltaDecorations(i(!0).ids,[]);var c=$.map((function(t){return{range:new S.Range(t,1,t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}}));n.deltaDecorations([],c)}var u=e.onDidChangeModelContent((function(t){var i=e.getPosition();if(i){var o=i.lineNumber;""===n.getLineContent(o).trim()?s(o):l(o)&&(s(o),r(o))}})),d=e.onMouseDown((function(t){var e,i,o;if(t.target.detail&&null!==(e=t.target)&&void 0!==e&&null!==(i=e.element)&&void 0!==i&&null!==(o=i.className)&&void 0!==o&&o.includes("line-numbers")){var a=t.target.position.lineNumber;if(""===n.getLineContent(a).trim())return;l(a)?s(a):r(a)}})),f=function(){ct.current=e.deltaDecorations(ct.current,[])},p=e.onMouseMove((function(t){var i,r,o;if(f(),t.target.detail&&null!==(i=t.target)&&void 0!==i&&null!==(r=i.element)&&void 0!==r&&null!==(o=r.className)&&void 0!==o&&o.includes("line-numbers")){var s=t.target.position.lineNumber;if(""===n.getLineContent(s).trim())return;!function(t){var n={range:new S.Range(t,1,t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};ct.current=e.deltaDecorations(ct.current,[n])}(s)}})),v=e.onMouseLeave((function(){f()}));return function(){u.dispose(),d.dispose(),p.dispose(),v.dispose()}}}),[st.current,pt,$,nt,rt]);var yt=function(){if(B&&st.current.instance){var t=st.current.instance.getContentHeight();Ot(t<k?k:t)}else Ot(k)};var bt=function(t){var e=t.keyCode,n=t.ctrlKey,i=t.metaKey,r=t.target;return"paste"!==t.type&&(67!==e&&86!==e||!i&&!n)||"TEXTAREA"!==r.nodeName||(s.b.warn({content:decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"),key:"monaco-editor-tip"}),t.preventDefault()),!1};function Et(t,e){var n,i,r=window.URL||window.webkitURL||window,o=new Blob([e]),s=document.createElementNS("http://www.w3.org/1999/xhtml","a");s.href=r.createObjectURL(o),s.download=t,n=s,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}Object(d.useEffect)((function(){yt()}),[yt]),Object(d.useEffect)((function(){ot.current&&!pt&&n.e(/*! import() | monaco-editor */27).then(n.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(t){try{S=t,st.current.instance=S.editor.create(ot.current,{value:w,language:C(T),theme:M,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},D);var e=st.current.instance,n=g.c._menuItems,i=Object(r.a)(n).find((function(t){return"EditorContext"==t[0]._debugName}))[1];if(V(e,S),setTimeout((function(){yt(),st.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Et(J||"educoder.txt",e.getValue())}}),e.getDomNode().addEventListener("input",(function(){at.current.autoFormat&&e.getAction("editor.action.formatDocument").run()}))}),500),st.current.subscription=e.onDidChangeModelContent((function(t){ut.current?clearTimeout(ht.current):(yt(),H(e.getValue(),t)),ht.current=setTimeout((function(){ut.current=!1}),500)})),window.Monaco||function(t){var e={label:"ifelse",kind:t.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet},n=["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","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];t.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(i,r){return{suggestions:v(t,i,r,n,[e])}}});var i=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];t.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(e,n){var r=[{label:"print",kind:t.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join("\n"),insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:v(t,e,n,i,r)}}});var r=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];t.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(n,i){var o=[e,{label:"main",kind:t.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {","\t$0","}"].join("\n"),insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:t.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join("\n"),insertTextRules:t.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:v(t,n,i,r,o)}}})}(S,C(T)),U&&(!function(t,e){var n=t._first;do{var i,r;e.includes(null===(i=n.element)||void 0===i||null===(r=i.command)||void 0===r?void 0:r.id)&&t._remove(n)}while(n=n.next)}(i,["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"]),ot.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",bt),window.removeEventListener("paste",bt),window.addEventListener("keydown",bt),window.addEventListener("paste",bt)),window.Monaco=S,P&&e.onDidBlurEditorWidget((function(){P(e.getValue())})),W&&e.onDidFocusEditorText((function(){W(e.getValue())})),U)try{window.addEventListener("paste",gt)}catch(t){}var o=function(){var t;return ot.current&&(t=new p.default((function(t){var e,n=Object(a.a)(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&st.current.instance.layout()}}catch(t){n.e(t)}finally{n.f()}}))).observe(ot.current),t}();return vt(!0),function(){var t=st.current.instance;t.dispose();var e=t.getModel();e&&e.dispose(),st.current.subscription&&st.current.subscription.dispose(),U&&window.removeEventListener("paste",gt),o.unobserve(ot.current)}}catch(t){}}))}),[]),Object(d.useEffect)((function(){if(st.current.instance&&pt)return document.addEventListener("keydown",mt,!1),function(){document.removeEventListener("keydown",mt)}}),[N,pt]),Object(d.useEffect)((function(){var t=st.current.instance;if(t&&pt){var e=C(T);S.editor.setModelLanguage(t.getModel(),e)}}),[T,pt]),Object(d.useEffect)((function(){st.current.instance&&pt&&S.editor.setTheme(M)}),[M,pt]),Object(d.useEffect)((function(){var t=st.current.instance;at.current=L,t&&pt&&(t.updateOptions(Object(i.a)({},L)),setTimeout((function(){t.getModel().updateOptions(Object(i.a)({},L))}),200))}),[JSON.stringify(L),pt]),Object(d.useEffect)((function(){var t=st.current.instance;t&&pt&&t.layout()}),[u,k,pt]);var Ct=Object(d.useState)(y(u)),St=Object(l.a)(Ct,2),kt=St[0],wt=(St[1],Object(d.useState)(y(k))),xt=Object(l.a)(wt,2),Tt=xt[0],Ot=xt[1],_t=Object(i.a)(Object(i.a)({},_),{},{width:kt,height:Tt});return f.a.createElement("div",{className:"my-monaco-editor",ref:ot,style:_t})};function k(t){var e=t.width,r=void 0===e?"100%":e,o=t.height,s=void 0===o?"100%":o,c=t.original,u=t.modified,h=t.language,v=t.options,g=void 0===v?{}:v,m=Object(d.useRef)(),b=Object(d.useState)(null),E=Object(l.a)(b,2),C=E[0],k=E[1];Object(d.useEffect)((function(){return m.current&&n.e(/*! import() | monaco-editor */27).then(n.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(t){var e=(S=t).editor.createDiffEditor(m.current,Object(i.a)(Object(i.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},g),{},{wordWrap:!0}));k(e);var n=function(t){var e;return m.current&&(e=new p.default((function(e){var n,i=Object(a.a)(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&t.layout()}}catch(t){i.e(t)}finally{i.f()}}))).observe(m.current),e}(e);return function(){e.dispose();var t=e.getModel();t&&t.dispose(),n.unobserve(m.current)}})),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}}),[]),Object(d.useEffect)((function(){C&&C.setModel({original:S.editor.createModel(c,h),modified:S.editor.createModel(u,h)})}),[c,u,h,C]);var w={width:y(r),height:y(s)};return f.a.createElement("div",{className:"my-diff-editor",ref:m,style:w})}},bT9E:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/omit.js ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function r(t,e){var n=Object(i.a)({},t);return Array.isArray(e)&&e.forEach((function(t){delete n[t]})),n}},biw7:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/context/TableContext.js ***!
|
|
|
\**********************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(t,e,n){"use strict";var i=n(/*! react */"q1tI"),r=i.createContext(null);e.a=r},eZjB:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/assets/images/question/a1.svg ***!
|
|
|
\*******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/a1.aff02da0.svg"},fjLI:
|
|
|
/*!******************************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/platform/actions/common/actions.js ***!
|
|
|
\******************************************************************************/
|
|
|
/*! exports provided: isIMenuItem, IMenuService, MenuRegistry, ExecuteCommandAction, SubmenuItemAction, MenuItemAction */
|
|
|
/*! exports used: IMenuService, MenuItemAction, MenuRegistry, SubmenuItemAction, isIMenuItem */function(t,e,n){"use strict";n.d(e,"e",(function(){return f})),n.d(e,"a",(function(){return p})),n.d(e,"c",(function(){return v})),n.d(e,"d",(function(){return m})),n.d(e,"b",(function(){return y}));var i,r=n(/*! ../../../base/common/actions.js */"8HAY"),o=n(/*! ../../instantiation/common/instantiation.js */"Cg/j"),s=n(/*! ../../contextkey/common/contextkey.js */"T8No"),a=n(/*! ../../commands/common/commands.js */"nnTU"),l=n(/*! ../../../base/common/event.js */"MI8n"),c=(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},h=function(t,e){return function(n,i){e(n,i,t)}},d=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i};function f(t){return void 0!==t.command}var p=Object(o.c)("menuService"),v=new(function(){function t(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new l.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return t.prototype.addCommand=function(t){var e=this;return this._commands.set(t.id,t),this._onDidChangeMenu.fire(0),{dispose:function(){e._commands.delete(t.id)&&e._onDidChangeMenu.fire(0)}}},t.prototype.getCommand=function(t){return this._commands.get(t)},t.prototype.getCommands=function(){var t=new Map;return this._commands.forEach((function(e,n){return t.set(n,e)})),t},t.prototype.appendMenuItem=function(t,e){var n=this,i=this._menuItems.get(t);return i?i.push(e):(i=[e],this._menuItems.set(t,i)),this._onDidChangeMenu.fire(t),{dispose:function(){var r=i.indexOf(e);r>=0&&(i.splice(r,1),n._onDidChangeMenu.fire(t))}}},t.prototype.getMenuItems=function(t){var e=(this._menuItems.get(t)||[]).slice(0);return 0===t&&this._appendImplicitItems(e),e},t.prototype._appendImplicitItems=function(t){for(var e=new Set,n=0,i=t.filter((function(t){return f(t)}));n<i.length;n++){var r=i[n],o=r.command,s=r.alt;e.add(o.id),s&&e.add(s.id)}this._commands.forEach((function(n,i){e.has(i)||t.push({command:n})}))},t}()),g=function(t){function e(e,n,i){var r=t.call(this,e,n)||this;return r._commandService=i,r}return c(e,t),e.prototype.run=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._commandService).executeCommand.apply(t,d([this.id],e))},e=u([h(2,a.b)],e)}(r.a),m=function(t){function e(e){var n=this;return(n="string"==typeof e.title?t.call(this,"",e.title,"submenu")||this:t.call(this,"",e.title.value,"submenu")||this).item=e,n}return c(e,t),e}(r.a),y=function(t){function e(n,i,r,o,s){var a=this;return(a="string"==typeof n.title?t.call(this,n.id,n.title,s)||this:t.call(this,n.id,n.title.value,s)||this)._cssClass=void 0,a._enabled=!n.precondition||o.contextMatchesRules(n.precondition),a._checked=Boolean(n.toggled&&o.contextMatchesRules(n.toggled)),a._options=r||{},a.item=n,a.alt=i?new e(i,void 0,a._options,o,s):void 0,a}return c(e,t),e.prototype.dispose=function(){this.alt&&this.alt.dispose(),t.prototype.dispose.call(this)},e.prototype.run=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=[];return this._options.arg&&(i=d(i,[this._options.arg])),this._options.shouldForwardArgs&&(i=d(i,e)),t.prototype.run.apply(this,i)},e=u([h(3,s.c),h(4,a.b)],e)}(g)},fyJ8:
|
|
|
/*!************************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/Cell/index.js ***!
|
|
|
\************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(t,e,n){"use strict";var i=n(/*! @babel/runtime/helpers/esm/defineProperty */"rePB"),r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),o=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),s=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU"),a=n(/*! react */"q1tI"),l=n(/*! classnames */"TSYQ"),c=n.n(l),u=n(/*! rc-util/es/ref */"c+Xe"),h=n(/*! ../utils/valueUtil */"sR1s");var d=a.forwardRef((function(t,e){var n,l,d,f,p=t.prefixCls,v=t.className,g=t.record,m=t.index,y=t.dataIndex,b=t.render,E=t.children,C=t.component,S=void 0===C?"td":C,k=t.colSpan,w=t.rowSpan,x=t.fixLeft,T=t.fixRight,O=t.firstFixLeft,_=t.lastFixLeft,A=t.firstFixRight,L=t.lastFixRight,R=t.appendNode,D=t.additionalProps,I=void 0===D?{}:D,M=t.ellipsis,P=t.align,N=t.rowType,j=t.isSticky,B="".concat(p,"-cell");if(E)d=E;else{var F=Object(h.b)(g,y);if(d=F,b){var U=b(F,g,m);!(f=U)||"object"!==Object(s.a)(f)||Array.isArray(f)||a.isValidElement(f)?d=U:(d=U.children,l=U.props)}}"object"!==Object(s.a)(d)||Array.isArray(d)||a.isValidElement(d)||(d=null),M&&(_||A)&&(d=a.createElement("span",{className:"".concat(B,"-content")},d));var G=l||{},H=G.colSpan,z=G.rowSpan,V=G.style,K=G.className,W=Object(o.a)(G,["colSpan","rowSpan","style","className"]),Y=void 0!==H?H:k,q=void 0!==z?z:w;if(0===Y||0===q)return null;var X={},$="number"==typeof x,Q="number"==typeof T;$&&(X.position="sticky",X.left=x),Q&&(X.position="sticky",X.right=T);var J,Z={};P&&(Z.textAlign=P);var tt=!0===M?{showTitle:!0}:M;tt&&(tt.showTitle||"header"===N)&&("string"==typeof d||"number"==typeof d?J=d.toString():a.isValidElement(d)&&"string"==typeof d.props.children&&(J=d.props.children));var et,nt=Object(r.a)(Object(r.a)(Object(r.a)({title:J},W),I),{},{colSpan:Y&&1!==Y?Y:null,rowSpan:q&&1!==q?q:null,className:c()(B,v,(n={},Object(i.a)(n,"".concat(B,"-fix-left"),$),Object(i.a)(n,"".concat(B,"-fix-left-first"),O),Object(i.a)(n,"".concat(B,"-fix-left-last"),_),Object(i.a)(n,"".concat(B,"-fix-right"),Q),Object(i.a)(n,"".concat(B,"-fix-right-first"),A),Object(i.a)(n,"".concat(B,"-fix-right-last"),L),Object(i.a)(n,"".concat(B,"-ellipsis"),M),Object(i.a)(n,"".concat(B,"-with-append"),R),Object(i.a)(n,"".concat(B,"-fix-sticky"),($||Q)&&j),n),I.className,K),style:Object(r.a)(Object(r.a)(Object(r.a)(Object(r.a)({},I.style),Z),X),V),ref:(et=S,"string"==typeof et||Object(u.c)(et)?e:null)});return a.createElement(S,Object.assign({},nt),R,d)}));d.displayName="Cell";var f=a.memo(d,(function(t,e){return!!e.shouldCellUpdate&&!e.shouldCellUpdate(e.record,t.record)}));e.a=f},hW8S:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/utils/legacyUtil.js ***!
|
|
|
\******************************************************/
|
|
|
/*! exports provided: INTERNAL_COL_DEFINE, getExpandableProps, getDataAndAriaProps */
|
|
|
/*! exports used: INTERNAL_COL_DEFINE, getDataAndAriaProps, getExpandableProps */function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return a}));var i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),r=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),o=(n(/*! rc-util/es/warning */"Kwbf"),"RC_TABLE_INTERNAL_COL_DEFINE");function s(t){var e=t.expandable,n=Object(r.a)(t,["expandable"]);return"expandable"in t?Object(i.a)(Object(i.a)({},n),e):n}function a(t){return Object.keys(t).reduce((function(e,n){return"data-"!==n.substr(0,5)&&"aria-"!==n.substr(0,5)||(e[n]=t[n]),e}),{})}},k3GJ:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/rc-tabs/es/index.js + 50 modules ***!
|
|
|
\*******************************************************/
|
|
|
/*! exports provided: TabPane, default */
|
|
|
/*! exports used: TabPane, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/mini-store/esm/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/raf/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-align/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-dropdown/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-resize-observer/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/addEventListener.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/canUseDom.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/contains.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Portal.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/createChainedFunction.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/hooks/useMergedState.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/raf.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-dom/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"a",(function(){return Ke}));var i=n("rePB"),r=n("ODXe"),o=n("Ff2n"),s=n("VTBJ"),a=n("q1tI"),l=n("TSYQ"),c=n.n(l),u=n("Zm9Q"),h=n("6cGi"),d=n("KQm4"),f=n("xEkU"),p=n.n(f),v=n("t23M");function g(t){var e=Object(a.useRef)(),n=Object(a.useRef)(!1);return Object(a.useEffect)((function(){return function(){n.current=!0,p.a.cancel(e.current)}}),[]),function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];n.current||(p.a.cancel(e.current),e.current=p()((function(){t.apply(void 0,r)})))}}var m=n("4IlW");var y=a.forwardRef((function(t,e){var n,r=t.prefixCls,o=t.id,s=t.active,l=t.rtl,u=t.tab,h=u.key,d=u.tab,f=u.disabled,p=u.closeIcon,v=t.tabBarGutter,g=t.tabPosition,y=t.closable,b=t.renderWrapper,E=t.removeAriaLabel,C=t.editable,S=t.onClick,k=t.onRemove,w=t.onFocus,x="".concat(r,"-tab");a.useEffect((function(){return k}),[]);var T={};"top"===g||"bottom"===g?T[l?"marginLeft":"marginRight"]=v:T.marginBottom=v;var O=C&&!1!==y&&!f;function _(t){f||S(t)}var A=a.createElement("div",{key:h,ref:e,className:c()(x,(n={},Object(i.a)(n,"".concat(x,"-with-remove"),O),Object(i.a)(n,"".concat(x,"-active"),s),Object(i.a)(n,"".concat(x,"-disabled"),f),n)),style:T,onClick:_},a.createElement("div",{role:"tab","aria-selected":s,id:o&&"".concat(o,"-tab-").concat(h),className:"".concat(x,"-btn"),"aria-controls":o&&"".concat(o,"-panel-").concat(h),"aria-disabled":f,tabIndex:f?null:0,onClick:function(t){t.stopPropagation(),_(t)},onKeyDown:function(t){[m.a.SPACE,m.a.ENTER].includes(t.which)&&(t.preventDefault(),_(t))},onFocus:w},d),O&&a.createElement("button",{type:"button","aria-label":E||"remove",tabIndex:0,className:"".concat(x,"-remove"),onClick:function(t){var e;t.stopPropagation(),(e=t).preventDefault(),e.stopPropagation(),C.onEdit("remove",{key:h,event:e})}},p||C.removeIcon||"×"));return b&&(A=b(A)),A})),b={width:0,height:0,left:0,top:0};var E={width:0,height:0,left:0,top:0,right:0};var C=n("wx14"),S=n("1OyB"),k=n("vuIU"),w=n("JX7q"),x=n("Ji7U"),T=n("LK+K"),O=n("I8Z2"),_=n("bT9E"),A=n("2GS6"),L=n("Gytx"),R=n.n(L),D=n("U8pU"),I=/iPhone/i,M=/iPod/i,P=/iPad/i,N=/\bAndroid(?:.+)Mobile\b/i,j=/Android/i,B=/\bAndroid(?:.+)SD4930UR\b/i,F=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,U=/Windows Phone/i,G=/\bWindows(?:.+)ARM\b/i,H=/BlackBerry/i,z=/BB10/i,V=/Opera Mini/i,K=/\b(CriOS|Chrome)(?:.+)Mobile/i,W=/Mobile(?:.+)Firefox\b/i;function Y(t,e){return t.test(e)}function q(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),n=(e||"").split("[FBAN");if(void 0!==n[1]){var i=n;e=Object(r.a)(i,1)[0]}if(void 0!==(n=e.split("Twitter"))[1]){var o=n;e=Object(r.a)(o,1)[0]}var s={apple:{phone:Y(I,e)&&!Y(U,e),ipod:Y(M,e),tablet:!Y(I,e)&&Y(P,e)&&!Y(U,e),device:(Y(I,e)||Y(M,e)||Y(P,e))&&!Y(U,e)},amazon:{phone:Y(B,e),tablet:!Y(B,e)&&Y(F,e),device:Y(B,e)||Y(F,e)},android:{phone:!Y(U,e)&&Y(B,e)||!Y(U,e)&&Y(N,e),tablet:!Y(U,e)&&!Y(B,e)&&!Y(N,e)&&(Y(F,e)||Y(j,e)),device:!Y(U,e)&&(Y(B,e)||Y(F,e)||Y(N,e)||Y(j,e))||Y(/\bokhttp\b/i,e)},windows:{phone:Y(U,e),tablet:Y(G,e),device:Y(U,e)||Y(G,e)},other:{blackberry:Y(H,e),blackberry10:Y(z,e),opera:Y(V,e),firefox:Y(W,e),chrome:Y(K,e),device:Y(H,e)||Y(z,e)||Y(V,e)||Y(W,e)||Y(K,e)},any:null,phone:null,tablet:null};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}var X=Object(s.a)(Object(s.a)({},q()),{},{isMobile:q});function $(){}function Q(t,e,n){var i=e||"";return t.key||"".concat(i,"item_").concat(n)}function J(t){return"".concat(t,"-menu-")}function Z(t,e){var n=-1;a.Children.forEach(t,(function(t){n+=1,t&&t.type&&t.type.isMenuItemGroup?a.Children.forEach(t.props.children,(function(t){e(t,n+=1)})):e(t,n)}))}var tt=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],et=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t&&"function"==typeof t.getBoundingClientRect&&t.getBoundingClientRect().width;if(n){if(e){var i=getComputedStyle(t),r=i.marginLeft,o=i.marginRight;n+=+r.replace("px","")+ +o.replace("px","")}n=+n.toFixed(6)}return n||0},nt=function(t,e,n){t&&"object"===Object(D.a)(t.style)&&(t.style[e]=n)},it=n("bdgK"),rt=n("i8i4"),ot=n.n(rt),st=n("wgJM"),at=n("l4aY"),lt=n("m+aA"),ct=n("c+Xe"),ut=n("zT1h"),ht=n("QC+M");function dt(t,e,n){return n?t[0]===e[0]:t[0]===e[0]&&t[1]===e[1]}var ft=n("MNnm");function pt(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit".concat(t)]="webkit".concat(e),n["Moz".concat(t)]="moz".concat(e),n["ms".concat(t)]="MS".concat(e),n["O".concat(t)]="o".concat(e.toLowerCase()),n}var vt,gt,mt,yt=(vt=Object(ft.a)(),gt="undefined"!=typeof window?window:{},mt={animationend:pt("Animation","AnimationEnd"),transitionend:pt("Transition","TransitionEnd")},vt&&("AnimationEvent"in gt||delete mt.animationend.animation,"TransitionEvent"in gt||delete mt.transitionend.transition),mt),bt={};if(Object(ft.a)()){var Et=document.createElement("div");bt=Et.style}var Ct={};function St(t){if(Ct[t])return Ct[t];var e=yt[t];if(e)for(var n=Object.keys(e),i=n.length,r=0;r<i;r+=1){var o=n[r];if(Object.prototype.hasOwnProperty.call(e,o)&&o in bt)return Ct[t]=e[o],Ct[t]}return""}var kt=St("animationend"),wt=St("transitionend"),xt=!(!kt||!wt),Tt=kt||"animationend",Ot=wt||"transitionend";function _t(t,e){return t?"object"===Object(D.a)(t)?t[e.replace(/-\w/g,(function(t){return t[1].toUpperCase()}))]:"".concat(t,"-").concat(e):null}function At(t){var e=Object(a.useRef)(!1),n=Object(a.useState)(t),i=Object(r.a)(n,2),o=i[0],s=i[1];return Object(a.useEffect)((function(){return function(){e.current=!0}}),[]),[o,function(t){e.current||s(t)}]}var Lt=Object(ft.a)()?a.useLayoutEffect:a.useEffect,Rt=["prepare","start","active","end"];function Dt(t){return"active"===t||"end"===t}var It=function(t,e){var n=a.useState("none"),i=Object(r.a)(n,2),o=i[0],s=i[1],l=function(){var t=a.useRef(null);function e(){st.a.cancel(t.current)}return a.useEffect((function(){return function(){e()}}),[]),[function n(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;e();var o=Object(st.a)((function(){r<=1?i({isCanceled:function(){return o!==t.current}}):n(i,r-1)}));t.current=o},e]}(),c=Object(r.a)(l,2),u=c[0],h=c[1];return Lt((function(){if("none"!==o&&"end"!==o){var t=Rt.indexOf(o),n=Rt[t+1],i=e(o);!1===i?s(n):u((function(t){function e(){t.isCanceled()||s(n)}!0===i?e():Promise.resolve(i).then(e)}))}}),[t,o]),a.useEffect((function(){return function(){h()}}),[]),[function(){s("prepare")},o]};function Mt(t,e,n,o){var l=o.motionEnter,c=void 0===l||l,u=o.motionAppear,h=void 0===u||u,d=o.motionLeave,f=void 0===d||d,p=o.motionDeadline,v=o.motionLeaveImmediately,g=o.onAppearPrepare,m=o.onEnterPrepare,y=o.onLeavePrepare,b=o.onAppearStart,E=o.onEnterStart,C=o.onLeaveStart,S=o.onAppearActive,k=o.onEnterActive,w=o.onLeaveActive,x=o.onAppearEnd,T=o.onEnterEnd,O=o.onLeaveEnd,_=o.onVisibleChanged,A=At(),L=Object(r.a)(A,2),R=L[0],D=L[1],I=At("none"),M=Object(r.a)(I,2),P=M[0],N=M[1],j=At(null),B=Object(r.a)(j,2),F=B[0],U=B[1],G=Object(a.useRef)(!1),H=Object(a.useRef)(null),z=Object(a.useRef)(!1),V=Object(a.useRef)(null);function K(){return n()||V.current}var W=Object(a.useRef)(!1);function Y(t){var e,n=K();t&&!t.deadline&&t.target!==n||("appear"===P&&W.current?e=null==x?void 0:x(n,t):"enter"===P&&W.current?e=null==T?void 0:T(n,t):"leave"===P&&W.current&&(e=null==O?void 0:O(n,t)),!1===e||z.current||(N("none"),U(null)))}var q=function(t){var e=Object(a.useRef)(),n=Object(a.useRef)(t);n.current=t;var i=a.useCallback((function(t){n.current(t)}),[]);function r(t){t&&(t.removeEventListener(Ot,i),t.removeEventListener(Tt,i))}return a.useEffect((function(){return function(){r(e.current)}}),[]),[function(t){e.current&&e.current!==t&&r(e.current),t&&t!==e.current&&(t.addEventListener(Ot,i),t.addEventListener(Tt,i),e.current=t)},r]}(Y),X=Object(r.a)(q,1)[0],$=a.useMemo((function(){var t,e,n;switch(P){case"appear":return t={},Object(i.a)(t,"prepare",g),Object(i.a)(t,"start",b),Object(i.a)(t,"active",S),t;case"enter":return e={},Object(i.a)(e,"prepare",m),Object(i.a)(e,"start",E),Object(i.a)(e,"active",k),e;case"leave":return n={},Object(i.a)(n,"prepare",y),Object(i.a)(n,"start",C),Object(i.a)(n,"active",w),n;default:return{}}}),[P]),Q=It(P,(function(t){if("prepare"===t){var e=$.prepare;return!!e&&e(K())}var n;tt in $&&U((null===(n=$[tt])||void 0===n?void 0:n.call($,K(),null))||null);return"active"===tt&&(X(K()),p>0&&(clearTimeout(H.current),H.current=setTimeout((function(){Y({deadline:!0})}),p))),!0})),J=Object(r.a)(Q,2),Z=J[0],tt=J[1],et=Dt(tt);W.current=et,Lt((function(){D(e);var n,i=G.current;(G.current=!0,t)&&(!i&&e&&h&&(n="appear"),i&&e&&c&&(n="enter"),(i&&!e&&f||!i&&v&&!e&&f)&&(n="leave"),n&&(N(n),Z()))}),[e]),Object(a.useEffect)((function(){("appear"===P&&!h||"enter"===P&&!c||"leave"===P&&!f)&&N("none")}),[h,c,f]),Object(a.useEffect)((function(){return function(){clearTimeout(H.current),z.current=!0}}),[]),Object(a.useEffect)((function(){void 0!==R&&"none"===P&&(null==_||_(R))}),[R,P]);var nt=F;return $.prepare&&"start"===tt&&(nt=Object(s.a)({transition:"none"},nt)),[P,tt,nt,null!=R?R:e]}var Pt=function(t){Object(x.a)(n,t);var e=Object(T.a)(n);function n(){return Object(S.a)(this,n),e.apply(this,arguments)}return Object(k.a)(n,[{key:"render",value:function(){return this.props.children}}]),n}(a.Component);var Nt=function(t){var e=t;function n(t){return!(!t.motionName||!e)}"object"===Object(D.a)(t)&&(e=t.transitionSupport);var o=a.forwardRef((function(t,e){var o=t.visible,l=void 0===o||o,u=t.removeOnLeave,h=void 0===u||u,d=t.forceRender,f=t.children,p=t.motionName,v=t.leavedClassName,g=t.eventProps,m=n(t),y=Object(a.useRef)(),b=Object(a.useRef)();var E=Mt(m,l,(function(){try{return Object(lt.a)(y.current||b.current)}catch(t){return null}}),t),C=Object(r.a)(E,4),S=C[0],k=C[1],w=C[2],x=C[3],T=a.useRef(x);x&&(T.current=!0);var O=Object(a.useRef)(e);O.current=e;var _,A=a.useCallback((function(t){y.current=t,Object(ct.b)(O.current,t)}),[]),L=Object(s.a)(Object(s.a)({},g),{},{visible:l});if(f)if("none"!==S&&n(t)){var R,D;"prepare"===k?D="prepare":Dt(k)?D="active":"start"===k&&(D="start"),_=f(Object(s.a)(Object(s.a)({},L),{},{className:c()(_t(p,S),(R={},Object(i.a)(R,_t(p,"".concat(S,"-").concat(D)),D),Object(i.a)(R,p,"string"==typeof p),R)),style:w}),A)}else _=x?f(Object(s.a)({},L),A):!h&&T.current?f(Object(s.a)(Object(s.a)({},L),{},{className:v}),A):d?f(Object(s.a)(Object(s.a)({},L),{},{style:{display:"none"}}),A):null;else _=null;return a.createElement(Pt,{ref:b},_)}));return o.displayName="CSSMotion",o}(xt);function jt(t){var e;return e=t&&"object"===Object(D.a)(t)&&"key"in t?t:{key:t},Object(s.a)(Object(s.a)({},e),{},{key:String(e.key)})}function Bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.map(jt)}function Ft(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],i=0,r=e.length,o=Bt(t),a=Bt(e);o.forEach((function(t){for(var e=!1,o=i;o<r;o+=1){var l=a[o];if(l.key===t.key){i<o&&(n=n.concat(a.slice(i,o).map((function(t){return Object(s.a)(Object(s.a)({},t),{},{status:"add"})}))),i=o),n.push(Object(s.a)(Object(s.a)({},l),{},{status:"keep"})),i+=1,e=!0;break}}e||n.push(Object(s.a)(Object(s.a)({},t),{},{status:"remove"}))})),i<r&&(n=n.concat(a.slice(i).map((function(t){return Object(s.a)(Object(s.a)({},t),{},{status:"add"})}))));var l={};n.forEach((function(t){var e=t.key;l[e]=(l[e]||0)+1}));var c=Object.keys(l).filter((function(t){return l[t]>1}));return c.forEach((function(t){(n=n.filter((function(e){var n=e.key,i=e.status;return n!==t||"remove"!==i}))).forEach((function(e){e.key===t&&(e.status="keep")}))})),n}var Ut=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nt,n=function(t){Object(x.a)(i,t);var n=Object(T.a)(i);function i(){var t;return Object(S.a)(this,i),(t=n.apply(this,arguments)).state={keyEntities:[]},t.removeKey=function(e){t.setState((function(t){return{keyEntities:t.keyEntities.map((function(t){return t.key!==e?t:Object(s.a)(Object(s.a)({},t),{},{status:"removed"})}))}}))},t}return Object(k.a)(i,[{key:"render",value:function(){var t=this,n=this.state.keyEntities,i=this.props,r=i.component,s=i.children,l=i.onVisibleChanged,c=Object(o.a)(i,["component","children","onVisibleChanged"]),u=r||a.Fragment,h={};return Ut.forEach((function(t){h[t]=c[t],delete c[t]})),delete c.keys,a.createElement(u,c,n.map((function(n){var i=n.status,r=Object(o.a)(n,["status"]),c="add"===i||"keep"===i;return a.createElement(e,Object(C.a)({},h,{key:r.key,visible:c,eventProps:r,onVisibleChanged:function(e){null==l||l(e,{key:r.key}),e||t.removeKey(r.key)}}),s)})))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.keys,i=e.keyEntities,r=Bt(n);return{keyEntities:Ft(i,r).filter((function(t){var e=i.find((function(e){var n=e.key;return t.key===n}));return!e||"removed"!==e.status||"remove"!==t.status}))}}}]),i}(a.Component);n.defaultProps={component:"div"}}(xt);var Gt=Nt;function Ht(t){var e=t.prefixCls,n=t.motion,i=t.animation,r=t.transitionName;return n||(i?{motionName:"".concat(e,"-").concat(i)}:r?{motionName:r}:null)}function zt(t){var e=t.prefixCls,n=t.visible,i=t.zIndex,r=t.mask,o=t.maskMotion,l=t.maskAnimation,u=t.maskTransitionName;if(!r)return null;var h={};return(o||u||l)&&(h=Object(s.a)({motionAppear:!0},Ht({motion:o,prefixCls:e,transitionName:u,animation:l}))),a.createElement(Gt,Object(C.a)({},h,{visible:n,removeOnLeave:!0}),(function(t){var n=t.className;return a.createElement("div",{style:{zIndex:i},className:c()("".concat(e,"-mask"),n)})}))}var Vt=n("9mu1"),Kt=n("o0o1"),Wt=n.n(Kt),Yt=n("HaE+"),qt=["measure","align",null,"motion"],Xt=a.forwardRef((function(t,e){var n=t.visible,i=t.prefixCls,o=t.className,l=t.style,u=t.children,h=t.zIndex,d=t.stretch,f=t.destroyPopupOnHide,p=t.forceRender,v=t.align,g=t.point,m=t.getRootDomNode,y=t.getClassNameFromAlign,b=t.onAlign,E=t.onMouseEnter,S=t.onMouseLeave,k=t.onMouseDown,w=t.onTouchStart,x=Object(a.useRef)(),T=Object(a.useRef)(),O=Object(a.useState)(),_=Object(r.a)(O,2),A=_[0],L=_[1],R=function(t){var e=a.useState({width:0,height:0}),n=Object(r.a)(e,2),i=n[0],o=n[1];return[a.useMemo((function(){var e={};if(t){var n=i.width,r=i.height;-1!==t.indexOf("height")&&r?e.height=r:-1!==t.indexOf("minHeight")&&r&&(e.minHeight=r),-1!==t.indexOf("width")&&n?e.width=n:-1!==t.indexOf("minWidth")&&n&&(e.minWidth=n)}return e}),[t,i]),function(t){o({width:t.offsetWidth,height:t.offsetHeight})}]}(d),D=Object(r.a)(R,2),I=D[0],M=D[1];var P=function(t,e){var n=Object(a.useState)(null),i=Object(r.a)(n,2),o=i[0],s=i[1],l=Object(a.useRef)(),c=Object(a.useRef)(!1);function u(t){c.current||s(t)}function h(){st.a.cancel(l.current)}return Object(a.useEffect)((function(){u("measure")}),[t]),Object(a.useEffect)((function(){switch(o){case"measure":e()}o&&(l.current=Object(st.a)(Object(Yt.a)(Wt.a.mark((function t(){var e,n;return Wt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=qt.indexOf(o),(n=qt[e+1])&&-1!==e&&u(n);case 3:case"end":return t.stop()}}),t)})))))}),[o]),Object(a.useEffect)((function(){return function(){c.current=!0,h()}}),[]),[o,function(t){h(),l.current=Object(st.a)((function(){u((function(t){switch(o){case"align":return"motion";case"motion":return"stable"}return t})),null==t||t()}))}]}(n,(function(){d&&M(m())})),N=Object(r.a)(P,2),j=N[0],B=N[1],F=Object(a.useRef)();function U(){var t;null===(t=x.current)||void 0===t||t.forceAlign()}function G(t,e){var n=y(e);A!==n&&L(n),"align"===j&&(A!==n?Promise.resolve().then((function(){U()})):B((function(){var t;null===(t=F.current)||void 0===t||t.call(F)})),null==b||b(t,e))}var H=Object(s.a)({},Ht(t));function z(){return new Promise((function(t){F.current=t}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(t){var e=H[t];H[t]=function(t,n){return B(),null==e?void 0:e(t,n)}})),a.useEffect((function(){H.motionName||"motion"!==j||B()}),[H.motionName,j]),a.useImperativeHandle(e,(function(){return{forceAlign:U,getElement:function(){return T.current}}}));var V=Object(s.a)(Object(s.a)({},I),{},{zIndex:h,opacity:"motion"!==j&&"stable"!==j&&n?0:void 0,pointerEvents:"stable"===j?void 0:"none"},l),K=!0;!(null==v?void 0:v.points)||"align"!==j&&"stable"!==j||(K=!1);var W=u;return a.Children.count(u)>1&&(W=a.createElement("div",{className:"".concat(i,"-content")},u)),a.createElement(Gt,Object(C.a)({visible:n,ref:T,leavedClassName:"".concat(i,"-hidden")},H,{onAppearPrepare:z,onEnterPrepare:z,removeOnLeave:f,forceRender:p}),(function(t,e){var n=t.className,r=t.style,l=c()(i,o,A,n);return a.createElement(Vt.a,{target:g||m,key:"popup",ref:x,monitorWindowResize:!0,disabled:K,align:v,onAlign:G},a.createElement("div",{ref:e,className:l,onMouseEnter:E,onMouseLeave:S,onMouseDownCapture:k,onTouchStartCapture:w,style:Object(s.a)(Object(s.a)({},r),V)},W))}))}));Xt.displayName="PopupInner";var $t=Xt,Qt=a.forwardRef((function(t,e){var n=t.prefixCls,i=t.visible,r=t.zIndex,o=t.children,l=t.mobile,u=(l=void 0===l?{}:l).popupClassName,h=l.popupStyle,d=l.popupMotion,f=void 0===d?{}:d,p=l.popupRender,v=a.useRef();a.useImperativeHandle(e,(function(){return{forceAlign:function(){},getElement:function(){return v.current}}}));var g=Object(s.a)({zIndex:r},h),m=o;return a.Children.count(o)>1&&(m=a.createElement("div",{className:"".concat(n,"-content")},o)),p&&(m=p(m)),a.createElement(Gt,Object(C.a)({visible:i,ref:v,removeOnLeave:!0},f),(function(t,e){var i=t.className,r=t.style,o=c()(n,u,i);return a.createElement("div",{ref:e,className:o,style:Object(s.a)(Object(s.a)({},r),g)},m)}))}));Qt.displayName="MobilePopupInner";var Jt=Qt,Zt=["visible","mobile"],te=a.forwardRef((function(t,e){var n=t.visible,i=t.mobile,l=Object(o.a)(t,Zt),c=Object(a.useState)(n),u=Object(r.a)(c,2),h=u[0],d=u[1],f=Object(a.useState)(!1),p=Object(r.a)(f,2),v=p[0],g=p[1],m=Object(s.a)(Object(s.a)({},l),{},{visible:h});Object(a.useEffect)((function(){d(n),n&&i&&g(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var t=navigator.userAgent||navigator.vendor||window.opera;return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==t?void 0:t.substr(0,4)))}())}),[n,i]);var y=v?a.createElement(Jt,Object(C.a)({},m,{mobile:i,ref:e})):a.createElement($t,Object(C.a)({},m,{ref:e}));return a.createElement("div",null,a.createElement(zt,m),y)}));te.displayName="Popup";var ee=te,ne=a.createContext(null);function ie(){}function re(){return""}function oe(t){return t?t.ownerDocument:window.document}var se=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var ae,le,ce=(ae=ht.a,(le=function(t){Object(x.a)(n,t);var e=Object(T.a)(n);function n(t){var i,r;return Object(S.a)(this,n),(i=e.call(this,t)).popupRef=a.createRef(),i.triggerRef=a.createRef(),i.attachId=void 0,i.clickOutsideHandler=void 0,i.touchOutsideHandler=void 0,i.contextMenuOutsideHandler1=void 0,i.contextMenuOutsideHandler2=void 0,i.mouseDownTimeout=void 0,i.focusTime=void 0,i.preClickTime=void 0,i.preTouchTime=void 0,i.delayTimer=void 0,i.hasPopupMouseDown=void 0,i.onMouseEnter=function(t){var e=i.props.mouseEnterDelay;i.fireEvents("onMouseEnter",t),i.delaySetPopupVisible(!0,e,e?null:t)},i.onMouseMove=function(t){i.fireEvents("onMouseMove",t),i.setPoint(t)},i.onMouseLeave=function(t){i.fireEvents("onMouseLeave",t),i.delaySetPopupVisible(!1,i.props.mouseLeaveDelay)},i.onPopupMouseEnter=function(){i.clearDelayTimer()},i.onPopupMouseLeave=function(t){var e;t.relatedTarget&&!t.relatedTarget.setTimeout&&Object(at.a)(null===(e=i.popupRef.current)||void 0===e?void 0:e.getElement(),t.relatedTarget)||i.delaySetPopupVisible(!1,i.props.mouseLeaveDelay)},i.onFocus=function(t){i.fireEvents("onFocus",t),i.clearDelayTimer(),i.isFocusToShow()&&(i.focusTime=Date.now(),i.delaySetPopupVisible(!0,i.props.focusDelay))},i.onMouseDown=function(t){i.fireEvents("onMouseDown",t),i.preClickTime=Date.now()},i.onTouchStart=function(t){i.fireEvents("onTouchStart",t),i.preTouchTime=Date.now()},i.onBlur=function(t){i.fireEvents("onBlur",t),i.clearDelayTimer(),i.isBlurToHide()&&i.delaySetPopupVisible(!1,i.props.blurDelay)},i.onContextMenu=function(t){t.preventDefault(),i.fireEvents("onContextMenu",t),i.setPopupVisible(!0,t)},i.onContextMenuClose=function(){i.isContextMenuToShow()&&i.close()},i.onClick=function(t){if(i.fireEvents("onClick",t),i.focusTime){var e;if(i.preClickTime&&i.preTouchTime?e=Math.min(i.preClickTime,i.preTouchTime):i.preClickTime?e=i.preClickTime:i.preTouchTime&&(e=i.preTouchTime),Math.abs(e-i.focusTime)<20)return;i.focusTime=0}i.preClickTime=0,i.preTouchTime=0,i.isClickToShow()&&(i.isClickToHide()||i.isBlurToHide())&&t&&t.preventDefault&&t.preventDefault();var n=!i.state.popupVisible;(i.isClickToHide()&&!n||n&&i.isClickToShow())&&i.setPopupVisible(!i.state.popupVisible,t)},i.onPopupMouseDown=function(){var t;i.hasPopupMouseDown=!0,clearTimeout(i.mouseDownTimeout),i.mouseDownTimeout=window.setTimeout((function(){i.hasPopupMouseDown=!1}),0),i.context&&(t=i.context).onPopupMouseDown.apply(t,arguments)},i.onDocumentClick=function(t){if(!i.props.mask||i.props.maskClosable){var e=t.target,n=i.getRootDomNode(),r=i.getPopupDomNode();Object(at.a)(n,e)&&!i.isContextMenuOnly()||Object(at.a)(r,e)||i.hasPopupMouseDown||i.close()}},i.getRootDomNode=function(){var t=i.props.getTriggerDOMNode;if(t)return t(i.triggerRef.current);try{var e=Object(lt.a)(i.triggerRef.current);if(e)return e}catch(t){}return ot.a.findDOMNode(Object(w.a)(i))},i.getPopupClassNameFromAlign=function(t){var e=[],n=i.props,r=n.popupPlacement,o=n.builtinPlacements,s=n.prefixCls,a=n.alignPoint,l=n.getPopupClassNameFromAlign;return r&&o&&e.push(function(t,e,n,i){for(var r=n.points,o=Object.keys(t),s=0;s<o.length;s+=1){var a=o[s];if(dt(t[a].points,r,i))return"".concat(e,"-placement-").concat(a)}return""}(o,s,t,a)),l&&e.push(l(t)),e.join(" ")},i.getComponent=function(){var t=i.props,e=t.prefixCls,n=t.destroyPopupOnHide,r=t.popupClassName,o=t.onPopupAlign,s=t.popupMotion,l=t.popupAnimation,c=t.popupTransitionName,u=t.popupStyle,h=t.mask,d=t.maskAnimation,f=t.maskTransitionName,p=t.maskMotion,v=t.zIndex,g=t.popup,m=t.stretch,y=t.alignPoint,b=t.mobile,E=t.forceRender,S=i.state,k=S.popupVisible,w=S.point,x=i.getPopupAlign(),T={};return i.isMouseEnterToShow()&&(T.onMouseEnter=i.onPopupMouseEnter),i.isMouseLeaveToHide()&&(T.onMouseLeave=i.onPopupMouseLeave),T.onMouseDown=i.onPopupMouseDown,T.onTouchStart=i.onPopupMouseDown,a.createElement(ee,Object(C.a)({prefixCls:e,destroyPopupOnHide:n,visible:k,point:y&&w,className:r,align:x,onAlign:o,animation:l,getClassNameFromAlign:i.getPopupClassNameFromAlign},T,{stretch:m,getRootDomNode:i.getRootDomNode,style:u,mask:h,zIndex:v,transitionName:c,maskAnimation:d,maskTransitionName:f,maskMotion:p,ref:i.popupRef,motion:s,mobile:b,forceRender:E}),"function"==typeof g?g():g)},i.attachParent=function(t){st.a.cancel(i.attachId);var e,n=i.props,r=n.getPopupContainer,o=n.getDocument,s=i.getRootDomNode();r?(s||0===r.length)&&(e=r(s)):e=o(i.getRootDomNode()).body,e?e.appendChild(t):i.attachId=Object(st.a)((function(){i.attachParent(t)}))},i.getContainer=function(){var t=(0,i.props.getDocument)(i.getRootDomNode()).createElement("div");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",i.attachParent(t),t},i.setPoint=function(t){i.props.alignPoint&&t&&i.setState({point:{pageX:t.pageX,pageY:t.pageY}})},i.handlePortalUpdate=function(){i.state.prevPopupVisible!==i.state.popupVisible&&i.props.afterPopupVisibleChange(i.state.popupVisible)},i.triggerContextValue={onPopupMouseDown:i.onPopupMouseDown},r="popupVisible"in t?!!t.popupVisible:!!t.defaultPopupVisible,i.state={prevPopupVisible:r,popupVisible:r},se.forEach((function(t){i["fire".concat(t)]=function(e){i.fireEvents(t,e)}})),i}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var t,e=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(t=e.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(ut.a)(t,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(t=t||e.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(ut.a)(t,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(t=t||e.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(ut.a)(t,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(ut.a)(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),st.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var t;return(null===(t=this.popupRef.current)||void 0===t?void 0:t.getElement())||null}},{key:"getPopupAlign",value:function(){var t=this.props,e=t.popupPlacement,n=t.popupAlign,i=t.builtinPlacements;return e&&i?function(t,e,n){var i=t[e]||{};return Object(s.a)(Object(s.a)({},i),n)}(i,e,n):n}},{key:"setPopupVisible",value:function(t,e){var n=this.props.alignPoint,i=this.state.popupVisible;this.clearDelayTimer(),i!==t&&("popupVisible"in this.props||this.setState({popupVisible:t,prevPopupVisible:i}),this.props.onPopupVisibleChange(t)),n&&e&&t&&this.setPoint(e)}},{key:"delaySetPopupVisible",value:function(t,e,n){var i=this,r=1e3*e;if(this.clearDelayTimer(),r){var o=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){i.setPopupVisible(t,o),i.clearDelayTimer()}),r)}else this.setPopupVisible(t,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(t){var e=this.props.children.props,n=this.props;return e[t]&&n[t]?this["fire".concat(t)]:e[t]||n[t]}},{key:"isClickToShow",value:function(){var t=this.props,e=t.action,n=t.showAction;return-1!==e.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var t=this.props.action;return"contextMenu"===t||1===t.length&&"contextMenu"===t[0]}},{key:"isContextMenuToShow",value:function(){var t=this.props,e=t.action,n=t.showAction;return-1!==e.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var t=this.props,e=t.action,n=t.hideAction;return-1!==e.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var t=this.props,e=t.action,n=t.showAction;return-1!==e.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var t=this.props,e=t.action,n=t.hideAction;return-1!==e.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var t=this.props,e=t.action,n=t.showAction;return-1!==e.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var t=this.props,e=t.action,n=t.hideAction;return-1!==e.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var t;this.state.popupVisible&&(null===(t=this.popupRef.current)||void 0===t||t.forceAlign())}},{key:"fireEvents",value:function(t,e){var n=this.props.children.props[t];n&&n(e);var i=this.props[t];i&&i(e)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,e=this.props,n=e.children,i=e.forceRender,r=e.alignPoint,o=e.className,l=e.autoDestroy,u=a.Children.only(n),h={key:"trigger"};this.isContextMenuToShow()?h.onContextMenu=this.onContextMenu:h.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(h.onClick=this.onClick,h.onMouseDown=this.onMouseDown,h.onTouchStart=this.onTouchStart):(h.onClick=this.createTwoChains("onClick"),h.onMouseDown=this.createTwoChains("onMouseDown"),h.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(h.onMouseEnter=this.onMouseEnter,r&&(h.onMouseMove=this.onMouseMove)):h.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?h.onMouseLeave=this.onMouseLeave:h.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(h.onFocus=this.onFocus,h.onBlur=this.onBlur):(h.onFocus=this.createTwoChains("onFocus"),h.onBlur=this.createTwoChains("onBlur"));var d=c()(u&&u.props&&u.props.className,o);d&&(h.className=d);var f=Object(s.a)({},h);Object(ct.c)(u)&&(f.ref=Object(ct.a)(this.triggerRef,u.ref));var p,v=a.cloneElement(u,f);return(t||this.popupRef.current||i)&&(p=a.createElement(ae,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&l&&(p=null),a.createElement(ne.Provider,{value:this.triggerContextValue},v,p)}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=t.popupVisible,i={};return void 0!==n&&e.popupVisible!==n&&(i.popupVisible=n,i.prevPopupVisible=e.popupVisible),i}}]),n}(a.Component)).contextType=ne,le.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:re,getDocument:oe,onPopupVisibleChange:ie,afterPopupVisibleChange:ie,onPopupAlign:ie,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},le),ue={adjustX:1,adjustY:1},he={topLeft:{points:["bl","tl"],overflow:ue,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ue,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ue,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ue,offset:[4,0]}},de={topLeft:{points:["bl","tl"],overflow:ue,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ue,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ue,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ue,offset:[4,0]}},fe=0,pe={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},ve=function(t,e,n){var r=J(e),o=t.getState();t.setState({defaultActiveFirst:Object(s.a)(Object(s.a)({},o.defaultActiveFirst),{},Object(i.a)({},r,n))})},ge=function(t){Object(x.a)(n,t);var e=Object(T.a)(n);function n(t){var i;Object(S.a)(this,n),(i=e.call(this,t)).onDestroy=function(t){i.props.onDestroy(t)},i.onKeyDown=function(t){var e=t.keyCode,n=i.menuInstance,r=i.props.store,o=i.getVisible();if(e===m.a.ENTER)return i.onTitleClick(t),ve(r,i.props.eventKey,!0),!0;if(e===m.a.RIGHT)return o?n.onKeyDown(t):(i.triggerOpenChange(!0),ve(r,i.props.eventKey,!0)),!0;if(e===m.a.LEFT){var s;if(!o)return;return(s=n.onKeyDown(t))||(i.triggerOpenChange(!1),s=!0),s}return!o||e!==m.a.UP&&e!==m.a.DOWN?void 0:n.onKeyDown(t)},i.onOpenChange=function(t){i.props.onOpenChange(t)},i.onPopupVisibleChange=function(t){i.triggerOpenChange(t,t?"mouseenter":"mouseleave")},i.onMouseEnter=function(t){var e=i.props,n=e.eventKey,r=e.onMouseEnter,o=e.store;ve(o,i.props.eventKey,!1),r({key:n,domEvent:t})},i.onMouseLeave=function(t){var e=i.props,n=e.parentMenu,r=e.eventKey,o=e.onMouseLeave;n.subMenuInstance=Object(w.a)(i),o({key:r,domEvent:t})},i.onTitleMouseEnter=function(t){var e=i.props,n=e.eventKey,r=e.onItemHover,o=e.onTitleMouseEnter;r({key:n,hover:!0}),o({key:n,domEvent:t})},i.onTitleMouseLeave=function(t){var e=i.props,n=e.parentMenu,r=e.eventKey,o=e.onItemHover,s=e.onTitleMouseLeave;n.subMenuInstance=Object(w.a)(i),o({key:r,hover:!1}),s({key:r,domEvent:t})},i.onTitleClick=function(t){var e=Object(w.a)(i).props;e.onTitleClick({key:e.eventKey,domEvent:t}),"hover"!==e.triggerSubMenuAction&&(i.triggerOpenChange(!i.getVisible(),"click"),ve(e.store,i.props.eventKey,!1))},i.onSubMenuClick=function(t){"function"==typeof i.props.onClick&&i.props.onClick(i.addKeyPath(t))},i.onSelect=function(t){i.props.onSelect(t)},i.onDeselect=function(t){i.props.onDeselect(t)},i.getPrefixCls=function(){return"".concat(i.props.rootPrefixCls,"-submenu")},i.getActiveClassName=function(){return"".concat(i.getPrefixCls(),"-active")},i.getDisabledClassName=function(){return"".concat(i.getPrefixCls(),"-disabled")},i.getSelectedClassName=function(){return"".concat(i.getPrefixCls(),"-selected")},i.getOpenClassName=function(){return"".concat(i.props.rootPrefixCls,"-submenu-open")},i.getVisible=function(){return i.state.isOpen},i.getMode=function(){return i.state.mode},i.saveMenuInstance=function(t){i.menuInstance=t},i.addKeyPath=function(t){return Object(s.a)(Object(s.a)({},t),{},{keyPath:(t.keyPath||[]).concat(i.props.eventKey)})},i.triggerOpenChange=function(t,e){var n=i.props.eventKey,r=function(){i.onOpenChange({key:n,item:Object(w.a)(i),trigger:e,open:t})};"mouseenter"===e?i.mouseenterTimeout=setTimeout((function(){r()}),0):r()},i.isChildrenSelected=function(){var t={find:!1};return function t(e,n,i){e&&!i.find&&a.Children.forEach(e,(function(e){if(e){var r=e.type;if(!r||!(r.isSubMenu||r.isMenuItem||r.isMenuItemGroup))return;-1!==n.indexOf(e.key)?i.find=!0:e.props.children&&t(e.props.children,n,i)}}))}(i.props.children,i.props.selectedKeys,t),t.find},i.isInlineMode=function(){return"inline"===i.getMode()},i.adjustWidth=function(){if(i.subMenuTitle&&i.menuInstance){var t=rt.findDOMNode(i.menuInstance);t.offsetWidth>=i.subMenuTitle.offsetWidth||(t.style.minWidth="".concat(i.subMenuTitle.offsetWidth,"px"))}},i.saveSubMenuTitle=function(t){i.subMenuTitle=t},i.getBaseProps=function(){var t=Object(w.a)(i).props,e=i.getMode();return{mode:"horizontal"===e?"vertical":e,visible:i.getVisible(),level:t.level+1,inlineIndent:t.inlineIndent,focusable:!1,onClick:i.onSubMenuClick,onSelect:i.onSelect,onDeselect:i.onDeselect,onDestroy:i.onDestroy,selectedKeys:t.selectedKeys,eventKey:"".concat(t.eventKey,"-menu-"),openKeys:t.openKeys,motion:t.motion,onOpenChange:i.onOpenChange,subMenuOpenDelay:t.subMenuOpenDelay,parentMenu:Object(w.a)(i),subMenuCloseDelay:t.subMenuCloseDelay,forceSubMenuRender:t.forceSubMenuRender,triggerSubMenuAction:t.triggerSubMenuAction,builtinPlacements:t.builtinPlacements,defaultActiveFirst:t.store.getState().defaultActiveFirst[J(t.eventKey)],multiple:t.multiple,prefixCls:t.rootPrefixCls,id:i.internalMenuId,manualRef:i.saveMenuInstance,itemIcon:t.itemIcon,expandIcon:t.expandIcon,direction:t.direction}},i.getMotion=function(t,e){var n=Object(w.a)(i).haveRendered,r=i.props,o=r.motion,a=r.rootPrefixCls;return Object(s.a)(Object(s.a)({},o),{},{leavedClassName:"".concat(a,"-hidden"),removeOnLeave:!1,motionAppear:n||!e||"inline"!==t})};var r=t.store,o=t.eventKey,l=r.getState().defaultActiveFirst;i.isRootMenu=!1;var c=!1;return l&&(c=l[o]),ve(r,o,c),i.state={mode:t.mode,isOpen:t.isOpen},i}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var t=this,e=this.props,n=e.mode,i=e.parentMenu,r=e.manualRef,o=e.isOpen,s=function(){t.setState({mode:n,isOpen:o})},a=o!==this.state.isOpen,l=n!==this.state.mode;(l||a)&&(st.a.cancel(this.updateStateRaf),l?this.updateStateRaf=Object(st.a)(s):s()),r&&r(this),"horizontal"===n&&(null==i?void 0:i.isRootMenu)&&o&&(this.minWidthTimeout=setTimeout((function(){return t.adjustWidth()}),0))}},{key:"componentWillUnmount",value:function(){var t=this.props,e=t.onDestroy,n=t.eventKey;e&&e(n),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),st.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(t,e){var n=this.getBaseProps();return a.createElement(Te,Object(C.a)({},n,{id:this.internalMenuId,className:t,style:e}),this.props.children)}},{key:"renderChildren",value:function(){var t=this,e=this.getBaseProps(),n=e.mode,r=e.visible,o=e.forceSubMenuRender,s=e.direction,l=this.getMotion(n,r);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||r||o,!this.haveOpened)return a.createElement("div",null);var u=c()("".concat(e.prefixCls,"-sub"),Object(i.a)({},"".concat(e.prefixCls,"-rtl"),"rtl"===s));return this.isInlineMode()?a.createElement(Gt,Object(C.a)({visible:e.visible,forceRender:o},l),(function(e){var n=e.className,i=e.style,r=c()(u,n);return t.renderPopupMenu(r,i)})):this.renderPopupMenu(u)}},{key:"render",value:function(){var t,e,n,r=Object(s.a)({},this.props),o=this.getVisible(),l=this.getPrefixCls(),u=this.isInlineMode(),h=this.getMode(),d=c()(l,"".concat(l,"-").concat(h),(t={},Object(i.a)(t,r.className,!!r.className),Object(i.a)(t,this.getOpenClassName(),o),Object(i.a)(t,this.getActiveClassName(),r.active||o&&!u),Object(i.a)(t,this.getDisabledClassName(),r.disabled),Object(i.a)(t,this.getSelectedClassName(),this.isChildrenSelected()),t));this.internalMenuId||(r.eventKey?this.internalMenuId="".concat(r.eventKey,"$Menu"):(fe+=1,this.internalMenuId="$__$".concat(fe,"$Menu")));var f={},p={},v={};r.disabled||(f={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},p={onClick:this.onTitleClick},v={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var g={},m="rtl"===r.direction;u&&(m?g.paddingRight=r.inlineIndent*r.level:g.paddingLeft=r.inlineIndent*r.level);var y={};this.getVisible()&&(y={"aria-owns":this.internalMenuId});var b=null;"horizontal"!==h&&(b=this.props.expandIcon,"function"==typeof this.props.expandIcon&&(b=a.createElement(this.props.expandIcon,Object(s.a)({},this.props))));var E=a.createElement("div",Object(C.a)({ref:this.saveSubMenuTitle,style:g,className:"".concat(l,"-title"),role:"button"},v,p,{"aria-expanded":o},y,{"aria-haspopup":"true",title:"string"==typeof r.title?r.title:void 0}),r.title,b||a.createElement("i",{className:"".concat(l,"-arrow")})),S=this.renderChildren(),k=(null===(e=r.parentMenu)||void 0===e?void 0:e.isRootMenu)?r.parentMenu.props.getPopupContainer:function(t){return t.parentNode},w=pe[h],x=r.popupOffset?{offset:r.popupOffset}:{},T=c()((n={},Object(i.a)(n,r.popupClassName,r.popupClassName&&!u),Object(i.a)(n,"".concat(l,"-rtl"),m),n)),O=r.disabled,_=r.triggerSubMenuAction,A=r.subMenuOpenDelay,L=r.forceSubMenuRender,R=r.subMenuCloseDelay,D=r.builtinPlacements;tt.forEach((function(t){return delete r[t]})),delete r.onClick;var I=m?Object(s.a)(Object(s.a)({},de),D):Object(s.a)(Object(s.a)({},he),D);delete r.direction;var M=this.getBaseProps(),P=u?null:this.getMotion(M.mode,M.visible);return a.createElement("li",Object(C.a)({},r,f,{className:d,role:"menuitem"}),a.createElement(ce,{prefixCls:l,popupClassName:c()("".concat(l,"-popup"),T),getPopupContainer:k,builtinPlacements:I,popupPlacement:w,popupVisible:!u&&o,popupAlign:x,popup:u?null:S,action:O||u?[]:[_],mouseEnterDelay:A,mouseLeaveDelay:R,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:L,popupMotion:P},E),u?S:null)}}]),n}(a.Component);ge.defaultProps={onMouseEnter:$,onMouseLeave:$,onTitleMouseEnter:$,onTitleMouseLeave:$,onTitleClick:$,manualRef:$,mode:"vertical",title:""};var me=Object(O.b)((function(t,e){var n=t.openKeys,i=t.activeKey,r=t.selectedKeys,o=e.eventKey,s=e.subMenuKey;return{isOpen:n.indexOf(o)>-1,active:i[s]===o,selectedKeys:r}}))(ge);me.isSubMenu=!0;var ye=me,be=function(t){Object(x.a)(n,t);var e=Object(T.a)(n);function n(){var t;return Object(S.a)(this,n),(t=e.apply(this,arguments)).resizeObserver=null,t.mutationObserver=null,t.originalTotalWidth=0,t.overflowedItems=[],t.menuItemSizes=[],t.cancelFrameId=null,t.state={lastVisibleIndex:void 0},t.childRef=a.createRef(),t.getMenuItemNodes=function(){var e=t.props.prefixCls,n=t.childRef.current;return n?[].slice.call(n.children).filter((function(t){return t.className.split(" ").indexOf("".concat(e,"-overflowed-submenu"))<0})):[]},t.getOverflowedSubMenuItem=function(e,n,i){var r=t.props,l=r.overflowedIndicator,c=r.level,u=r.mode,h=r.prefixCls,d=r.theme;if(1!==c||"horizontal"!==u)return null;var f=t.props.children[0].props,p=(f.children,f.title,f.style),v=Object(o.a)(f,["children","title","style"]),g=Object(s.a)({},p),m="".concat(e,"-overflowed-indicator"),y="".concat(e,"-overflowed-indicator");0===n.length&&!0!==i?g=Object(s.a)(Object(s.a)({},g),{},{display:"none"}):i&&(g=Object(s.a)(Object(s.a)({},g),{},{visibility:"hidden",position:"absolute"}),m="".concat(m,"-placeholder"),y="".concat(y,"-placeholder"));var b=d?"".concat(h,"-").concat(d):"",E={};return tt.forEach((function(t){void 0!==v[t]&&(E[t]=v[t])})),a.createElement(ye,Object(C.a)({title:l,className:"".concat(h,"-overflowed-submenu"),popupClassName:b},E,{key:m,eventKey:y,disabled:!1,style:g}),n)},t.setChildrenWidthAndResize=function(){if("horizontal"===t.props.mode){var e=t.childRef.current;if(e){var n=e.children;if(n&&0!==n.length){var i=e.children[n.length-1];nt(i,"display","inline-block");var r=t.getMenuItemNodes(),o=r.filter((function(t){return t.className.split(" ").indexOf("menuitem-overflowed")>=0}));o.forEach((function(t){nt(t,"display","inline-block")})),t.menuItemSizes=r.map((function(t){return et(t,!0)})),o.forEach((function(t){nt(t,"display","none")})),t.overflowedIndicatorWidth=et(e.children[e.children.length-1],!0),t.originalTotalWidth=t.menuItemSizes.reduce((function(t,e){return t+e}),0),t.handleResize(),nt(i,"display","none")}}}},t.handleResize=function(){if("horizontal"===t.props.mode){var e=t.childRef.current;if(e){var n=et(e);t.overflowedItems=[];var i,r=0;t.originalTotalWidth>n+.5&&(i=-1,t.menuItemSizes.forEach((function(e){(r+=e)+t.overflowedIndicatorWidth<=n&&(i+=1)}))),t.setState({lastVisibleIndex:i})}}},t}return Object(k.a)(n,[{key:"componentDidMount",value:function(){var t=this;if(this.setChildrenWidthAndResize(),1===this.props.level&&"horizontal"===this.props.mode){var e=this.childRef.current;if(!e)return;this.resizeObserver=new it.default((function(e){e.forEach((function(){var e=t.cancelFrameId;cancelAnimationFrame(e),t.cancelFrameId=requestAnimationFrame(t.setChildrenWidthAndResize)}))})),[].slice.call(e.children).concat(e).forEach((function(e){t.resizeObserver.observe(e)})),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver((function(){t.resizeObserver.disconnect(),[].slice.call(e.children).concat(e).forEach((function(e){t.resizeObserver.observe(e)})),t.setChildrenWidthAndResize()})),this.mutationObserver.observe(e,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(t){var e=this,n=this.state.lastVisibleIndex;return(t||[]).reduce((function(i,r,o){var s=r;if("horizontal"===e.props.mode){var l=e.getOverflowedSubMenuItem(r.props.eventKey,[]);void 0!==n&&-1!==e.props.className.indexOf("".concat(e.props.prefixCls,"-root"))&&(o>n&&(s=a.cloneElement(r,{style:{display:"none"},eventKey:"".concat(r.props.eventKey,"-hidden"),className:"".concat("menuitem-overflowed")})),o===n+1&&(e.overflowedItems=t.slice(n+1).map((function(t){return a.cloneElement(t,{key:t.props.eventKey,mode:"vertical-left"})})),l=e.getOverflowedSubMenuItem(r.props.eventKey,e.overflowedItems)));var c=[].concat(Object(d.a)(i),[l,s]);return o===t.length-1&&c.push(e.getOverflowedSubMenuItem(r.props.eventKey,[],!0)),c}return[].concat(Object(d.a)(i),[s])}),[])}},{key:"render",value:function(){var t=this.props,e=(t.visible,t.prefixCls,t.overflowedIndicator,t.mode,t.level,t.tag),n=t.children,i=(t.theme,Object(o.a)(t,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"])),r=e;return a.createElement(r,Object(C.a)({ref:this.childRef},i),this.renderChildren(n))}}]),n}(a.Component);be.defaultProps={tag:"div",className:""};var Ee=be;function Ce(t,e,n){var r=t.getState();t.setState({activeKey:Object(s.a)(Object(s.a)({},r.activeKey),{},Object(i.a)({},e,n))})}function Se(t){return t.eventKey||"0-menu-"}function ke(t,e){var n,i=e,r=t.children,o=t.eventKey;if(i&&(Z(r,(function(t,e){t&&t.props&&!t.props.disabled&&i===Q(t,o,e)&&(n=!0)})),n))return i;return i=null,t.defaultActiveFirst?(Z(r,(function(t,e){i||!t||t.props.disabled||(i=Q(t,o,e))})),i):i}function we(t){if(t){var e=this.instanceArray.indexOf(t);-1!==e?this.instanceArray[e]=t:this.instanceArray.push(t)}}var xe=function(t){Object(x.a)(n,t);var e=Object(T.a)(n);function n(t){var r;return Object(S.a)(this,n),(r=e.call(this,t)).onKeyDown=function(t,e){var n,i=t.keyCode;if(r.getFlatInstanceArray().forEach((function(e){e&&e.props.active&&e.onKeyDown&&(n=e.onKeyDown(t))})),n)return 1;var o=null;return i!==m.a.UP&&i!==m.a.DOWN||(o=r.step(i===m.a.UP?-1:1)),o?(t.preventDefault(),Ce(r.props.store,Se(r.props),o.props.eventKey),"function"==typeof e&&e(o),1):void 0},r.onItemHover=function(t){var e=t.key,n=t.hover;Ce(r.props.store,Se(r.props),n?e:null)},r.onDeselect=function(t){r.props.onDeselect(t)},r.onSelect=function(t){r.props.onSelect(t)},r.onClick=function(t){r.props.onClick(t)},r.onOpenChange=function(t){r.props.onOpenChange(t)},r.onDestroy=function(t){r.props.onDestroy(t)},r.getFlatInstanceArray=function(){return r.instanceArray},r.step=function(t){var e=r.getFlatInstanceArray(),n=r.props.store.getState().activeKey[Se(r.props)],i=e.length;if(!i)return null;t<0&&(e=e.concat().reverse());var o=-1;if(e.every((function(t,e){return!t||t.props.eventKey!==n||(o=e,!1)})),r.props.defaultActiveFirst||-1===o||(s=e.slice(o,i-1)).length&&!s.every((function(t){return!!t.props.disabled}))){var s,a=(o+1)%i,l=a;do{var c=e[l];if(c&&!c.props.disabled)return c;l=(l+1)%i}while(l!==a);return null}},r.renderCommonMenuItem=function(t,e,n){var i=r.props.store.getState(),o=Object(w.a)(r).props,l=Q(t,o.eventKey,e),c=t.props;if(!c||"string"==typeof t.type)return t;var u=l===i.activeKey,h=Object(s.a)(Object(s.a)({mode:c.mode||o.mode,level:o.level,inlineIndent:o.inlineIndent,renderMenuItem:r.renderMenuItem,rootPrefixCls:o.prefixCls,index:e,parentMenu:o.parentMenu,manualRef:c.disabled?void 0:Object(A.a)(t.ref,we.bind(Object(w.a)(r))),eventKey:l,active:!c.disabled&&u,multiple:o.multiple,onClick:function(t){(c.onClick||$)(t),r.onClick(t)},onItemHover:r.onItemHover,motion:o.motion,subMenuOpenDelay:o.subMenuOpenDelay,subMenuCloseDelay:o.subMenuCloseDelay,forceSubMenuRender:o.forceSubMenuRender,onOpenChange:r.onOpenChange,onDeselect:r.onDeselect,onSelect:r.onSelect,builtinPlacements:o.builtinPlacements,itemIcon:c.itemIcon||r.props.itemIcon,expandIcon:c.expandIcon||r.props.expandIcon},n),{},{direction:o.direction});return("inline"===o.mode||X.any)&&(h.triggerSubMenuAction="click"),a.cloneElement(t,Object(s.a)(Object(s.a)({},h),{},{key:l||e}))},r.renderMenuItem=function(t,e,n){if(!t)return null;var i=r.props.store.getState(),o={openKeys:i.openKeys,selectedKeys:i.selectedKeys,triggerSubMenuAction:r.props.triggerSubMenuAction,subMenuKey:n};return r.renderCommonMenuItem(t,e,o)},t.store.setState({activeKey:Object(s.a)(Object(s.a)({},t.store.getState().activeKey),{},Object(i.a)({},t.eventKey,ke(t,t.activeKey)))}),r.instanceArray=[],r}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(t){return this.props.visible||t.visible||this.props.className!==t.className||!R()(this.props.style,t.style)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n="activeKey"in e?e.activeKey:e.store.getState().activeKey[Se(e)],i=ke(e,n);if(i!==n)Ce(e.store,Se(e),i);else if("activeKey"in t){i!==ke(t,t.activeKey)&&Ce(e.store,Se(e),i)}}},{key:"render",value:function(){var t=this,e=Object(C.a)({},this.props);this.instanceArray=[];var n={className:c()(e.prefixCls,e.className,"".concat(e.prefixCls,"-").concat(e.mode)),role:e.role||"menu"};e.id&&(n.id=e.id),e.focusable&&(n.tabIndex=0,n.onKeyDown=this.onKeyDown);var i=e.prefixCls,r=e.eventKey,o=e.visible,s=e.level,l=e.mode,h=e.overflowedIndicator,d=e.theme;return tt.forEach((function(t){return delete e[t]})),delete e.onClick,a.createElement(Ee,Object(C.a)({},e,{prefixCls:i,mode:l,tag:"ul",level:s,theme:d,visible:o,overflowedIndicator:h},n),Object(u.a)(e.children).map((function(e,n){return t.renderMenuItem(e,n,r||"0-menu-")})))}}]),n}(a.Component);xe.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:$};var Te=Object(O.b)()(xe),Oe=n("Kwbf");function _e(t,e,n){var i=t.prefixCls,r=t.motion,o=t.defaultMotions,s=void 0===o?{}:o,a=t.openAnimation,l=t.openTransitionName,c=e.switchingModeFromInline;if(r)return r;if("object"===Object(D.a)(a)&&a)Object(Oe.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if("string"==typeof a)return{motionName:"".concat(i,"-open-").concat(a)};if(l)return{motionName:l};var u=s[n];return u||(c?null:s.other)}var Ae=function(t){Object(x.a)(n,t);var e=Object(T.a)(n);function n(t){var i;Object(S.a)(this,n),(i=e.call(this,t)).onSelect=function(t){var e=Object(w.a)(i).props;if(e.selectable){var n=i.store.getState().selectedKeys,r=t.key;n=e.multiple?n.concat([r]):[r],"selectedKeys"in e||i.store.setState({selectedKeys:n}),e.onSelect(Object(s.a)(Object(s.a)({},t),{},{selectedKeys:n}))}},i.onClick=function(t){var e=i.getRealMenuMode(),n=Object(w.a)(i),r=n.store,o=n.props.onOpenChange;"inline"===e||"openKeys"in i.props||(r.setState({openKeys:[]}),o([])),i.props.onClick(t)},i.onKeyDown=function(t,e){i.innerMenu.getWrappedInstance().onKeyDown(t,e)},i.onOpenChange=function(t){var e=Object(w.a)(i).props,n=i.store.getState().openKeys.concat(),r=!1,o=function(t){var e=!1;if(t.open)(e=-1===n.indexOf(t.key))&&n.push(t.key);else{var i=n.indexOf(t.key);(e=-1!==i)&&n.splice(i,1)}r=r||e};Array.isArray(t)?t.forEach(o):o(t),r&&("openKeys"in i.props||i.store.setState({openKeys:n}),e.onOpenChange(n))},i.onDeselect=function(t){var e=Object(w.a)(i).props;if(e.selectable){var n=i.store.getState().selectedKeys.concat(),r=t.key,o=n.indexOf(r);-1!==o&&n.splice(o,1),"selectedKeys"in e||i.store.setState({selectedKeys:n}),e.onDeselect(Object(s.a)(Object(s.a)({},t),{},{selectedKeys:n}))}},i.onMouseEnter=function(t){i.restoreModeVerticalFromInline();var e=i.props.onMouseEnter;e&&e(t)},i.onTransitionEnd=function(t){var e="width"===t.propertyName&&t.target===t.currentTarget,n=t.target.className,r="[object SVGAnimatedString]"===Object.prototype.toString.call(n)?n.animVal:n,o="font-size"===t.propertyName&&r.indexOf("anticon")>=0;(e||o)&&i.restoreModeVerticalFromInline()},i.setInnerMenu=function(t){i.innerMenu=t},i.isRootMenu=!0;var r=t.defaultSelectedKeys,o=t.defaultOpenKeys;return"selectedKeys"in t&&(r=t.selectedKeys||[]),"openKeys"in t&&(o=t.openKeys||[]),i.store=Object(O.c)({selectedKeys:r,openKeys:o,activeKey:{"0-menu-":ke(t,t.activeKey)}}),i.state={switchingModeFromInline:!1,prevProps:t,inlineOpenKeys:[],store:i.store},i}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.siderCollapsed,i=e.inlineCollapsed,r=e.onOpenChange;(!t.inlineCollapsed&&i||!t.siderCollapsed&&n)&&r([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var t=this.props.collapsedWidth,e=this.store,n=this.prevOpenKeys;this.getInlineCollapsed()&&(0===t||"0"===t||"0px"===t)?(this.prevOpenKeys=e.getState().openKeys.concat(),this.store.setState({openKeys:[]})):n&&(this.store.setState({openKeys:n}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var t=this.props.mode,e=this.state.switchingModeFromInline,n=this.getInlineCollapsed();return e&&n?"inline":n?"vertical":t}},{key:"getInlineCollapsed",value:function(){var t=this.props,e=t.inlineCollapsed,n=t.siderCollapsed;return void 0!==n?n:e}},{key:"restoreModeVerticalFromInline",value:function(){this.state.switchingModeFromInline&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var t=Object(s.a)({},Object(_.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),e=this.getRealMenuMode();return t.className+=" ".concat(t.prefixCls,"-root"),"rtl"===t.direction&&(t.className+=" ".concat(t.prefixCls,"-rtl")),delete(t=Object(s.a)(Object(s.a)({},t),{},{mode:e,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:_e(this.props,this.state,e)})).openAnimation,delete t.openTransitionName,a.createElement(O.a,{store:this.store},a.createElement(Te,Object(C.a)({},t,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var n=e.prevProps,i=e.store,r=i.getState(),o={},s={prevProps:t};return"inline"===n.mode&&"inline"!==t.mode&&(s.switchingModeFromInline=!0),"openKeys"in t?o.openKeys=t.openKeys||[]:((t.inlineCollapsed&&!n.inlineCollapsed||t.siderCollapsed&&!n.siderCollapsed)&&(s.switchingModeFromInline=!0,s.inlineOpenKeys=r.openKeys,o.openKeys=[]),(!t.inlineCollapsed&&n.inlineCollapsed||!t.siderCollapsed&&n.siderCollapsed)&&(o.openKeys=e.inlineOpenKeys,s.inlineOpenKeys=[])),Object.keys(o).length&&i.setState(o),s}}]),n}(a.Component);Ae.defaultProps={selectable:!0,onClick:$,onSelect:$,onOpenChange:$,onDeselect:$,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:a.createElement("span",null,"···")};var Le=Ae,Re=function(t){Object(x.a)(n,t);var e=Object(T.a)(n);function n(){var t;return Object(S.a)(this,n),(t=e.apply(this,arguments)).onKeyDown=function(e){if(e.keyCode===m.a.ENTER)return t.onClick(e),!0},t.onMouseLeave=function(e){var n=t.props,i=n.eventKey,r=n.onItemHover,o=n.onMouseLeave;r({key:i,hover:!1}),o({key:i,domEvent:e})},t.onMouseEnter=function(e){var n=t.props,i=n.eventKey,r=n.onItemHover,o=n.onMouseEnter;r({key:i,hover:!0}),o({key:i,domEvent:e})},t.onClick=function(e){var n=t.props,i=n.eventKey,r=n.multiple,o=n.onClick,s=n.onSelect,a=n.onDeselect,l=n.isSelected,c={key:i,keyPath:[i],item:Object(w.a)(t),domEvent:e};o(c),r?l?a(c):s(c):l||s(c)},t.saveNode=function(e){t.node=e},t}return Object(k.a)(n,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var t=this.props;t.onDestroy&&t.onDestroy(t.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var t,e=Object(s.a)({},this.props),n=c()(this.getPrefixCls(),e.className,(t={},Object(i.a)(t,this.getActiveClassName(),!e.disabled&&e.active),Object(i.a)(t,this.getSelectedClassName(),e.isSelected),Object(i.a)(t,this.getDisabledClassName(),e.disabled),t)),r=Object(s.a)(Object(s.a)({},e.attribute),{},{title:"string"==typeof e.title?e.title:void 0,className:n,role:e.role||"menuitem","aria-disabled":e.disabled});"option"===e.role?r=Object(s.a)(Object(s.a)({},r),{},{role:"option","aria-selected":e.isSelected}):null!==e.role&&"none"!==e.role||(r.role="none");var o={onClick:e.disabled?null:this.onClick,onMouseLeave:e.disabled?null:this.onMouseLeave,onMouseEnter:e.disabled?null:this.onMouseEnter},l=Object(s.a)({},e.style);"inline"===e.mode&&("rtl"===e.direction?l.paddingRight=e.inlineIndent*e.level:l.paddingLeft=e.inlineIndent*e.level),tt.forEach((function(t){return delete e[t]})),delete e.direction;var u=this.props.itemIcon;return"function"==typeof this.props.itemIcon&&(u=a.createElement(this.props.itemIcon,this.props)),a.createElement("li",Object(C.a)({},Object(_.a)(e,["onClick","onMouseEnter","onMouseLeave","onSelect"]),r,o,{style:l,ref:this.saveNode}),e.children,u)}}]),n}(a.Component);Re.isMenuItem=!0,Re.defaultProps={onSelect:$,onMouseEnter:$,onMouseLeave:$,manualRef:$};var De=Object(O.b)((function(t,e){var n=t.activeKey,i=t.selectedKeys,r=e.eventKey;return{active:n[e.subMenuKey]===r,isSelected:Array.isArray(i)?-1!==i.indexOf(r):i===r}}))(Re),Ie=function(t){Object(x.a)(n,t);var e=Object(T.a)(n);function n(){var t;return Object(S.a)(this,n),(t=e.apply(this,arguments)).renderInnerMenuItem=function(e){var n=t.props;return(0,n.renderMenuItem)(e,n.index,t.props.subMenuKey)},t}return Object(k.a)(n,[{key:"render",value:function(){var t=Object(C.a)({},this.props),e=t.className,n=void 0===e?"":e,i=t.rootPrefixCls,r="".concat(i,"-item-group-title"),o="".concat(i,"-item-group-list"),s=t.title,l=t.children;return tt.forEach((function(e){return delete t[e]})),delete t.direction,a.createElement("li",Object(C.a)({},t,{onClick:function(t){return t.stopPropagation()},className:"".concat(n," ").concat(i,"-item-group")}),a.createElement("div",{className:r,title:"string"==typeof s?s:void 0},s),a.createElement("ul",{className:o},a.Children.map(l,this.renderInnerMenuItem)))}}]),n}(a.Component);Ie.isMenuItemGroup=!0,Ie.defaultProps={disabled:!0};var Me=function(t){var e=t.className,n=t.rootPrefixCls,i=t.style;return a.createElement("li",{className:"".concat(e," ").concat(n,"-item-divider"),style:i})};Me.defaultProps={disabled:!0,className:"",style:{}};var Pe=Le,Ne=n("eDIo");var je=a.forwardRef((function(t,e){var n=t.prefixCls,i=t.editable,r=t.locale,o=t.style;return i&&!1!==i.showAdd?a.createElement("button",{ref:e,type:"button",className:"".concat(n,"-nav-add"),style:o,"aria-label":(null==r?void 0:r.addAriaLabel)||"Add tab",onClick:function(t){i.onEdit("add",{event:t})}},i.addIcon||"+"):null}));var Be=a.forwardRef((function(t,e){var n=t.prefixCls,o=t.id,s=t.tabs,l=t.locale,u=t.mobile,h=t.moreIcon,d=void 0===h?"More":h,f=t.moreTransitionName,p=t.style,v=t.className,g=t.editable,y=t.tabBarGutter,b=t.rtl,E=t.onTabClick,C=Object(a.useState)(!1),S=Object(r.a)(C,2),k=S[0],w=S[1],x=Object(a.useState)(null),T=Object(r.a)(x,2),O=T[0],_=T[1],A="".concat(o,"-more-popup"),L="".concat(n,"-dropdown"),R=null!==O?"".concat(A,"-").concat(O):null,D=null==l?void 0:l.dropdownAriaLabel,I=a.createElement(Pe,{onClick:function(t){var e=t.key,n=t.domEvent;E(e,n),w(!1)},id:A,tabIndex:-1,role:"listbox","aria-activedescendant":R,selectedKeys:[O],"aria-label":void 0!==D?D:"expanded dropdown"},s.map((function(t){return a.createElement(De,{key:t.key,id:"".concat(A,"-").concat(t.key),role:"option","aria-controls":o&&"".concat(o,"-panel-").concat(t.key),disabled:t.disabled},t.tab)})));function M(t){for(var e=s.filter((function(t){return!t.disabled})),n=e.findIndex((function(t){return t.key===O}))||0,i=e.length,r=0;r<i;r+=1){var o=e[n=(n+t+i)%i];if(!o.disabled)return void _(o.key)}}Object(a.useEffect)((function(){var t=document.getElementById(R);t&&t.scrollIntoView&&t.scrollIntoView(!1)}),[O]),Object(a.useEffect)((function(){k||_(null)}),[k]);var P=Object(i.a)({},b?"marginLeft":"marginRight",y);s.length||(P.visibility="hidden",P.order=1);var N=c()(Object(i.a)({},"".concat(L,"-rtl"),b)),j=u?null:a.createElement(Ne.a,{prefixCls:L,overlay:I,trigger:["hover"],visible:k,transitionName:f,onVisibleChange:w,overlayClassName:N,mouseEnterDelay:.1,mouseLeaveDelay:.1},a.createElement("button",{type:"button",className:"".concat(n,"-nav-more"),style:P,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":A,id:"".concat(o,"-more"),"aria-expanded":k,onKeyDown:function(t){var e=t.which;if(k)switch(e){case m.a.UP:M(-1),t.preventDefault();break;case m.a.DOWN:M(1),t.preventDefault();break;case m.a.ESC:w(!1);break;case m.a.SPACE:case m.a.ENTER:null!==O&&E(O,t)}else[m.a.DOWN,m.a.SPACE,m.a.ENTER].includes(e)&&(w(!0),t.preventDefault())}},d));return a.createElement("div",{className:c()("".concat(n,"-nav-operations"),v),style:p,ref:e},j,a.createElement(je,{prefixCls:n,locale:l,editable:g}))})),Fe=Object(a.createContext)(null),Ue=Math.pow(.995,20);function Ge(t,e){var n=a.useRef(t),i=a.useState({}),o=Object(r.a)(i,2)[1];return[n.current,function(t){var i="function"==typeof t?t(n.current):t;i!==n.current&&e(i,n.current),n.current=i,o({})}]}var He=function(t){var e,n=t.position,i=t.prefixCls,r=t.extra;if(!r)return null;var o=r;return"right"===n&&(e=o.right||!o.left&&o||null),"left"===n&&(e=o.left||null),e?a.createElement("div",{className:"".concat(i,"-extra-content")},e):null};var ze=a.forwardRef((function(t,e){var n,o,l=a.useContext(Fe),u=l.prefixCls,h=l.tabs,f=t.className,m=t.style,C=t.id,S=t.animated,k=t.activeKey,w=t.rtl,x=t.extra,T=t.editable,O=t.locale,_=t.tabPosition,A=t.tabBarGutter,L=t.children,R=t.onTabClick,D=t.onTabScroll,I=Object(a.useRef)(),M=Object(a.useRef)(),P=Object(a.useRef)(),N=Object(a.useRef)(),j=(o=Object(a.useRef)(new Map),[function(t){return o.current.has(t)||o.current.set(t,a.createRef()),o.current.get(t)},function(t){o.current.delete(t)}]),B=Object(r.a)(j,2),F=B[0],U=B[1],G="top"===_||"bottom"===_,H=Ge(0,(function(t,e){G&&D&&D({direction:t>e?"left":"right"})})),z=Object(r.a)(H,2),V=z[0],K=z[1],W=Ge(0,(function(t,e){!G&&D&&D({direction:t>e?"top":"bottom"})})),Y=Object(r.a)(W,2),q=Y[0],X=Y[1],$=Object(a.useState)(0),Q=Object(r.a)($,2),J=Q[0],Z=Q[1],tt=Object(a.useState)(0),et=Object(r.a)(tt,2),nt=et[0],it=et[1],rt=Object(a.useState)(0),ot=Object(r.a)(rt,2),st=ot[0],at=ot[1],lt=Object(a.useState)(0),ct=Object(r.a)(lt,2),ut=ct[0],ht=ct[1],dt=Object(a.useState)(null),ft=Object(r.a)(dt,2),pt=ft[0],vt=ft[1],gt=Object(a.useState)(null),mt=Object(r.a)(gt,2),yt=mt[0],bt=mt[1],Et=Object(a.useState)(0),Ct=Object(r.a)(Et,2),St=Ct[0],kt=Ct[1],wt=Object(a.useState)(0),xt=Object(r.a)(wt,2),Tt=xt[0],Ot=xt[1],_t=function(t){var e=Object(a.useRef)([]),n=Object(a.useState)({}),i=Object(r.a)(n,2)[1],o=Object(a.useRef)("function"==typeof t?t():t),s=g((function(){var t=o.current;e.current.forEach((function(e){t=e(t)})),e.current=[],o.current=t,i({})}));return[o.current,function(t){e.current.push(t),s()}]}(new Map),At=Object(r.a)(_t,2),Lt=At[0],Rt=At[1],Dt=function(t,e,n){return Object(a.useMemo)((function(){for(var n,i=new Map,r=e.get(null===(n=t[0])||void 0===n?void 0:n.key)||b,o=r.left+r.width,a=0;a<t.length;a+=1){var l,c=t[a].key,u=e.get(c);if(!u)u=e.get(null===(l=t[a-1])||void 0===l?void 0:l.key)||b;var h=i.get(c)||Object(s.a)({},u);h.right=o-h.left-h.width,i.set(c,h)}return i}),[t.map((function(t){return t.key})).join("_"),e,n])}(h,Lt,J),It="".concat(u,"-nav-operations-hidden"),Mt=0,Pt=0;function Nt(t){return t<Mt?[Mt,!1]:t>Pt?[Pt,!1]:[t,!0]}G?w?(Mt=0,Pt=Math.max(0,J-pt)):(Mt=Math.min(0,pt-J),Pt=0):(Mt=Math.min(0,yt-nt),Pt=0);var jt=Object(a.useRef)(),Bt=Object(a.useState)(),Ft=Object(r.a)(Bt,2),Ut=Ft[0],Gt=Ft[1];function Ht(){Gt(Date.now())}function zt(){window.clearTimeout(jt.current)}function Vt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,e=Dt.get(t);if(e)if(G){var n=V;w?e.right<V?n=e.right:e.right+e.width>V+pt&&(n=e.right+e.width-pt):e.left<-V?n=-e.left:e.left+e.width>-V+pt&&(n=-(e.left+e.width-pt)),X(0),K(Nt(n)[0])}else{var i=q;e.top<-q?i=-e.top:e.top+e.height>-q+yt&&(i=-(e.top+e.height-yt)),K(0),X(Nt(i)[0])}}!function(t,e){var n=Object(a.useState)(),i=Object(r.a)(n,2),o=i[0],s=i[1],l=Object(a.useState)(0),c=Object(r.a)(l,2),u=c[0],h=c[1],d=Object(a.useState)(0),f=Object(r.a)(d,2),p=f[0],v=f[1],g=Object(a.useState)(),m=Object(r.a)(g,2),y=m[0],b=m[1],E=Object(a.useRef)(),C=Object(a.useRef)(0),S=Object(a.useRef)(!1),k=Object(a.useRef)(),w=Object(a.useRef)(null);w.current={onTouchStart:function(t){var e=t.touches[0],n=e.screenX,i=e.screenY;s({x:n,y:i}),window.clearInterval(E.current)},onTouchMove:function(t){if(o){t.preventDefault();var n=t.touches[0],i=n.screenX,r=n.screenY;s({x:i,y:r});var a=i-o.x,l=r-o.y;e(a,l);var c=Date.now();h(c),v(c-u),b({x:a,y:l})}},onTouchEnd:function(){if(o&&(s(null),b(null),y)){var t=y.x/p,n=y.y/p,i=Math.abs(t),r=Math.abs(n);if(Math.max(i,r)<.1)return;var a=t,l=n;E.current=window.setInterval((function(){Math.abs(a)<.01&&Math.abs(l)<.01?window.clearInterval(E.current):e(20*(a*=Ue),20*(l*=Ue))}),20)}},onWheel:function(t){var n=t.deltaX,i=t.deltaY,r=0,o=Math.abs(n),s=Math.abs(i);o===s?r="x"===k.current?n:i:o>s?(r=n,k.current="x"):(r=i,k.current="y");var a=Date.now();a-C.current>100&&(S.current=!1),(e(-r,-r)||S.current)&&(t.preventDefault(),S.current=!0),C.current=a}},a.useEffect((function(){function e(t){w.current.onTouchMove(t)}function n(t){w.current.onTouchEnd(t)}return document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchend",n,{passive:!1}),t.current.addEventListener("touchstart",(function(t){w.current.onTouchStart(t)}),{passive:!1}),t.current.addEventListener("wheel",(function(t){w.current.onWheel(t)})),function(){document.removeEventListener("touchmove",e),document.removeEventListener("touchend",n)}}),[])}(I,(function(t,e){var n=!1;function i(t,e){t((function(t){var i=Nt(t+e),o=Object(r.a)(i,2),s=o[0],a=o[1];return n=a,s}))}if(G){if(pt>=J)return n;i(K,t)}else{if(yt>=nt)return n;i(X,e)}return zt(),Ht(),n})),Object(a.useEffect)((function(){return zt(),Ut&&(jt.current=window.setTimeout((function(){Gt(0)}),100)),zt}),[Ut]);var Kt=function(t,e,n,i,r){var o,s,l,c=r.tabs,u=r.tabPosition,h=r.rtl;["top","bottom"].includes(u)?(o="width",s=h?"right":"left",l=Math.abs(e.left)):(o="height",s="top",l=-e.top);var d=e[o],f=n[o],p=i[o],v=d;return f+p>d&&(v=d-p),Object(a.useMemo)((function(){if(!c.length)return[0,0];for(var e=c.length,n=e,i=0;i<e;i+=1){var r=t.get(c[i].key)||E;if(r[s]+r[o]>l+v){n=i-1;break}}for(var a=0,u=e-1;u>=0;u-=1){if((t.get(c[u].key)||E)[s]<l){a=u+1;break}}return[a,n]}),[t,l,v,u,c.map((function(t){return t.key})).join("_"),h])}(Dt,{width:pt,height:yt,left:V,top:q},{width:st,height:ut},{width:St,height:Tt},Object(s.a)(Object(s.a)({},t),{},{tabs:h})),Wt=Object(r.a)(Kt,2),Yt=Wt[0],qt=Wt[1],Xt=h.map((function(t){var e=t.key;return a.createElement(y,{id:C,prefixCls:u,key:e,rtl:w,tab:t,closable:t.closable,editable:T,active:e===k,tabPosition:_,tabBarGutter:A,renderWrapper:L,removeAriaLabel:null==O?void 0:O.removeAriaLabel,ref:F(e),onClick:function(t){R(e,t)},onRemove:function(){U(e)},onFocus:function(){Vt(e),Ht(),w||(I.current.scrollLeft=0),I.current.scrollTop=0}})})),$t=g((function(){var t,e,n,i,r,o,s,a,l,c=(null===(t=I.current)||void 0===t?void 0:t.offsetWidth)||0,u=(null===(e=I.current)||void 0===e?void 0:e.offsetHeight)||0,d=(null===(n=N.current)||void 0===n?void 0:n.offsetWidth)||0,f=(null===(i=N.current)||void 0===i?void 0:i.offsetHeight)||0,p=(null===(r=P.current)||void 0===r?void 0:r.offsetWidth)||0,v=(null===(o=P.current)||void 0===o?void 0:o.offsetHeight)||0;vt(c),bt(u),kt(d),Ot(f);var g=((null===(s=M.current)||void 0===s?void 0:s.offsetWidth)||0)-d,m=((null===(a=M.current)||void 0===a?void 0:a.offsetHeight)||0)-f;Z(g),it(m);var y=null===(l=P.current)||void 0===l?void 0:l.className.includes(It);at(g-(y?0:p)),ht(m-(y?0:v)),Rt((function(){var t=new Map;return h.forEach((function(e){var n=e.key,i=F(n).current;i&&t.set(n,{width:i.offsetWidth,height:i.offsetHeight,left:i.offsetLeft,top:i.offsetTop})})),t}))})),Qt=h.slice(0,Yt),Jt=h.slice(qt+1),Zt=[].concat(Object(d.a)(Qt),Object(d.a)(Jt)),te=Object(a.useState)(),ee=Object(r.a)(te,2),ne=ee[0],ie=ee[1],re=Dt.get(k),oe=Object(a.useRef)();function se(){p.a.cancel(oe.current)}Object(a.useEffect)((function(){var t={};return re&&(G?(w?t.right=re.right:t.left=re.left,t.width=re.width):(t.top=re.top,t.height=re.height)),se(),oe.current=p()((function(){ie(t)})),se}),[re,G,w]),Object(a.useEffect)((function(){Vt()}),[k,re,Dt,G]),Object(a.useEffect)((function(){$t()}),[w,A,k,h.map((function(t){return t.key})).join("_")]);var ae,le,ce,ue,he=!!Zt.length,de="".concat(u,"-nav-wrap");return G?w?(le=V>0,ae=V+pt<J):(ae=V<0,le=-V+pt<J):(ce=q<0,ue=-q+yt<nt),a.createElement("div",{ref:e,role:"tablist",className:c()("".concat(u,"-nav"),f),style:m,onKeyDown:function(){Ht()}},a.createElement(He,{position:"left",extra:x,prefixCls:u}),a.createElement(v.a,{onResize:$t},a.createElement("div",{className:c()(de,(n={},Object(i.a)(n,"".concat(de,"-ping-left"),ae),Object(i.a)(n,"".concat(de,"-ping-right"),le),Object(i.a)(n,"".concat(de,"-ping-top"),ce),Object(i.a)(n,"".concat(de,"-ping-bottom"),ue),n)),ref:I},a.createElement(v.a,{onResize:$t},a.createElement("div",{ref:M,className:"".concat(u,"-nav-list"),style:{transform:"translate(".concat(V,"px, ").concat(q,"px)"),transition:Ut?"none":void 0}},Xt,a.createElement(je,{ref:N,prefixCls:u,locale:O,editable:T,style:{visibility:he?"hidden":null}}),a.createElement("div",{className:c()("".concat(u,"-ink-bar"),Object(i.a)({},"".concat(u,"-ink-bar-animated"),S.inkBar)),style:ne}))))),a.createElement(Be,Object.assign({},t,{ref:P,prefixCls:u,tabs:Zt,className:!he&&It})),a.createElement(He,{position:"right",extra:x,prefixCls:u}))}));function Ve(t){var e=t.id,n=t.activeKey,r=t.animated,o=t.tabPosition,s=t.rtl,l=t.destroyInactiveTabPane,u=a.useContext(Fe),h=u.prefixCls,d=u.tabs,f=r.tabPane,p=d.findIndex((function(t){return t.key===n}));return a.createElement("div",{className:c()("".concat(h,"-content-holder"))},a.createElement("div",{className:c()("".concat(h,"-content"),"".concat(h,"-content-").concat(o),Object(i.a)({},"".concat(h,"-content-animated"),f)),style:p&&f?Object(i.a)({},s?"marginRight":"marginLeft","-".concat(p,"00%")):null},d.map((function(t){return a.cloneElement(t.node,{key:t.key,prefixCls:h,tabKey:t.key,id:e,animated:f,active:t.key===n,destroyInactiveTabPane:l})}))))}function Ke(t){var e=t.prefixCls,n=t.forceRender,i=t.className,o=t.style,l=t.id,u=t.active,h=t.animated,d=t.destroyInactiveTabPane,f=t.tabKey,p=t.children,v=a.useState(n),g=Object(r.a)(v,2),m=g[0],y=g[1];a.useEffect((function(){u?y(!0):d&&y(!1)}),[u,d]);var b={};return u||(h?(b.visibility="hidden",b.height=0,b.overflowY="hidden"):b.display="none"),a.createElement("div",{id:l&&"".concat(l,"-panel-").concat(f),role:"tabpanel",tabIndex:u?0:-1,"aria-labelledby":l&&"".concat(l,"-tab-").concat(f),"aria-hidden":!u,style:Object(s.a)(Object(s.a)({},b),o),className:c()("".concat(e,"-tabpane"),u&&"".concat(e,"-tabpane-active"),i)},(u||m||n)&&p)}var We=0;var Ye=a.forwardRef((function(t,e){var n,l,d=t.id,f=t.prefixCls,p=void 0===f?"rc-tabs":f,v=t.className,g=t.children,m=t.direction,y=t.activeKey,b=t.defaultActiveKey,E=t.editable,C=t.animated,S=t.tabPosition,k=void 0===S?"top":S,w=t.tabBarGutter,x=t.tabBarStyle,T=t.tabBarExtraContent,O=t.locale,_=t.moreIcon,A=t.moreTransitionName,L=t.destroyInactiveTabPane,R=t.renderTabBar,D=t.onChange,I=t.onTabClick,M=t.onTabScroll,P=Object(o.a)(t,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),N=function(t){return Object(u.a)(t).map((function(t){if(a.isValidElement(t)){var e=void 0!==t.key?String(t.key):void 0;return Object(s.a)(Object(s.a)({key:e},t.props),{},{node:t})}return null})).filter((function(t){return t}))}(g),j="rtl"===m;l=!1===C?{inkBar:!1,tabPane:!1}:Object(s.a)({inkBar:!0,tabPane:!1},!0!==C?C:null);var B=Object(a.useState)(!1),F=Object(r.a)(B,2),U=F[0],G=F[1];Object(a.useEffect)((function(){var t;G((t=navigator.userAgent||navigator.vendor||window.opera,!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t.substr(0,4)))))}),[]);var H=Object(h.a)((function(){var t;return null===(t=N[0])||void 0===t?void 0:t.key}),{value:y,defaultValue:b}),z=Object(r.a)(H,2),V=z[0],K=z[1],W=Object(a.useState)((function(){return N.findIndex((function(t){return t.key===V}))})),Y=Object(r.a)(W,2),q=Y[0],X=Y[1];Object(a.useEffect)((function(){var t,e=N.findIndex((function(t){return t.key===V}));-1===e&&(e=Math.max(0,Math.min(q,N.length-1)),K(null===(t=N[e])||void 0===t?void 0:t.key));X(e)}),[N.map((function(t){return t.key})).join("_"),V,q]);var $=Object(h.a)(null,{value:d}),Q=Object(r.a)($,2),J=Q[0],Z=Q[1],tt=k;U&&!["left","right"].includes(k)&&(tt="top"),Object(a.useEffect)((function(){d||(Z("rc-tabs-".concat(We)),We+=1)}),[]);var et,nt={id:J,activeKey:V,animated:l,tabPosition:tt,rtl:j,mobile:U},it=Object(s.a)(Object(s.a)({},nt),{},{editable:E,locale:O,moreIcon:_,moreTransitionName:A,tabBarGutter:w,onTabClick:function(t,e){null==I||I(t,e),K(t),null==D||D(t)},onTabScroll:M,extra:T,style:x,panes:g});return et=R?R(it,ze):a.createElement(ze,Object.assign({},it)),a.createElement(Fe.Provider,{value:{tabs:N,prefixCls:p}},a.createElement("div",Object.assign({ref:e,id:d,className:c()(p,"".concat(p,"-").concat(tt),(n={},Object(i.a)(n,"".concat(p,"-mobile"),U),Object(i.a)(n,"".concat(p,"-editable"),E),Object(i.a)(n,"".concat(p,"-rtl"),j),n),v)},P),et,a.createElement(Ve,Object.assign({destroyInactiveTabPane:L},nt,{animated:l}))))}));Ye.TabPane=Ke;var qe=Ye;e.b=qe},n6Qo:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/Footer/index.js + 2 modules ***!
|
|
|
\**************************************************************/
|
|
|
/*! exports provided: default, FooterComponents */
|
|
|
/*! exports used: FooterComponents, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/Cell/index.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/context/TableContext.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n("q1tI"),r=n("biw7"),o=n("fyJ8");e.b=function(t){var e=t.children,n=i.useContext(r.a).prefixCls;return i.createElement("tfoot",{className:"".concat(n,"-summary")},e)};var s={Cell:function(t){var e=t.className,n=t.index,s=t.children,a=t.colSpan,l=t.rowSpan,c=i.useContext(r.a),u=c.prefixCls,h=c.fixedInfoList[n];return i.createElement(o.a,Object.assign({className:e,index:n,component:"td",prefixCls:u,record:null,dataIndex:null,render:function(){return{children:s,props:{colSpan:a,rowSpan:l}}}},h))},Row:function(t){return i.createElement("tr",Object.assign({},t))}}},nnTU:
|
|
|
/*!********************************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/platform/commands/common/commands.js ***!
|
|
|
\********************************************************************************/
|
|
|
/*! exports provided: ICommandService, CommandsRegistry */
|
|
|
/*! exports used: CommandsRegistry, ICommandService */function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return h}));var i=n(/*! ../../../base/common/lifecycle.js */"pmY6"),r=n(/*! ../../../base/common/types.js */"746U"),o=n(/*! ../../instantiation/common/instantiation.js */"Cg/j"),s=n(/*! ../../../base/common/event.js */"MI8n"),a=n(/*! ../../../base/common/linkedList.js */"24hK"),l=n(/*! ../../../base/common/map.js */"QDVR"),c=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i},u=Object(o.c)("commandService"),h=new(function(){function t(){this._commands=new Map,this._onDidRegisterCommand=new s.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return t.prototype.registerCommand=function(t,e){var n=this;if(!t)throw new Error("invalid command");if("string"==typeof t){if(!e)throw new Error("invalid command");return this.registerCommand({id:t,handler:e})}if(t.description){for(var o=[],s=0,l=t.description.args;s<l.length;s++){var u=l[s];o.push(u.constraint)}var h=t.handler;t.handler=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Object(r.m)(e,o),h.apply(void 0,c([t],e))}}var d=t.id,f=this._commands.get(d);f||(f=new a.a,this._commands.set(d,f));var p=f.unshift(t),v=Object(i.h)((function(){p();var t=n._commands.get(d);(null==t?void 0:t.isEmpty())&&n._commands.delete(d)}));return this._onDidRegisterCommand.fire(d),v},t.prototype.registerCommandAlias=function(t,e){return h.registerCommand(t,(function(t){for(var n,i=[],r=1;r<arguments.length;r++)i[r-1]=arguments[r];return(n=t.get(u)).executeCommand.apply(n,c([e],i))}))},t.prototype.getCommand=function(t){var e=this._commands.get(t);if(e&&!e.isEmpty())return e.iterator().next().value},t.prototype.getCommands=function(){for(var t=new Map,e=0,n=Object(l.d)(this._commands);e<n.length;e++){var i=n[e],r=this.getCommand(i);r&&t.set(i,r)}return t},t}())},p5ED:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/components/PreviewAll/index.tsx ***!
|
|
|
\*********************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(t,e,n){"use strict";n(/*! antd/es/button/style */"+L6B");var i=n(/*! antd/es/button */"2/Rp"),r=(n(/*! antd/es/tooltip/style */"5Dmo"),n(/*! antd/es/tooltip */"3S7+")),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */"9og8"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */"WmNS"),c=n.n(l),u=n(/*! react */"q1tI"),h=n.n(u),d=n(/*! ./index.less?modules */"vHTk"),f=n.n(d),p=n(/*! @ant-design/icons */"yEEn"),v=n(/*! @/components/monaco-editor */"ZW9T"),g=n(/*! @/utils/util */"1vsH"),m=n(/*! @/service/exercise */"V0Rq"),y=n(/*! @/utils/env */"m3rI");e.a=function(t){var e,n,l,d,b,E,C=t.editOffice,S=void 0===C?"view":C,k=(t.name,t.data),w=(t.theme,t.type),x=t.filename,T=t.monacoEditor,O=t.className,_=t.style,A=t.close,L=t.onClose,R=t.hasMask,D=t.disabledDownload,I=t.onImgDimensions,M=t.otherData,P=Object(u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),N=Object(a.a)(P,2),j=(N[0],N[1],Object(u.useState)("")),B=Object(a.a)(j,2),F=(B[0],B[1]),U=Object(u.useState)(),G=Object(a.a)(U,2),H=G[0],z=G[1],V="build"===window.ENV?"/react/build":"",K=location.host.startsWith("localhost")?y.a.PROXY_SERVER:y.a.API_SERVER,W=Object(u.useRef)();null!==(e=k)&&void 0!==e&&e.startsWith("/api")&&"txt"!==w&&(k=y.a.API_SERVER+k),"office"===w&&Object(g.P)(k).filesize>10485760&&(w="other"),x&&(T.filename=x),Object(u.useEffect)((function(){var t,e,n=null===(t=document.cookie)||void 0===t||null===(e=t.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==n||n.map((function(t){var e=t.split("=");"_educoder_session"===e[0]&&F(e[1])}))}),[]),Object(u.useEffect)((function(){"office"===w&&Y()}),[w,k]);var Y=function(){var t=Object(s.a)(c.a.mark((function t(){var e,n,i;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("data:",k),e=k,k.startsWith("http")||(e=location.origin+e),n=new URL(e).pathname.split("/").pop(),t.next=6,Object(m.U)({attachment_id:n});case 6:i=t.sent,z(i);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),q=function(){k.startsWith("http")||k.startsWith("blob:")?X():Object(g.x)(x||"educoder",k,x)},X=function(){Object(g.v)(x||"educoder",decodeURIComponent(k))};return h.a.createElement("div",{style:Object(o.a)({},_||{}),className:"".concat(R&&f.a.bgBlack," ").concat(w?f.a.wrp:"hide")},A&&h.a.createElement("div",{className:f.a.close,ref:W},!!I&&h.a.createElement(r.a,{title:"点击对图片进行批注",getPopupContainer:function(){return W.current}},h.a.createElement("span",{onClick:function(){L(),I()}},h.a.createElement("i",{className:"icon-yulanpizhu"}))),!D&&h.a.createElement(r.a,{title:"点击下载此文件",getPopupContainer:function(){return W.current}},h.a.createElement("span",{onClick:X},h.a.createElement("i",{className:"icon-quxiaozhiding"}))),h.a.createElement(r.a,{title:"关闭",getPopupContainer:function(){return W.current}},h.a.createElement("span",{className:"",onClick:L},h.a.createElement("i",{className:"icon-guanbi1"})))),h.a.createElement("div",{className:"".concat(f.a[O]," ").concat(O," ").concat(f.a.monaco," ").concat("txt"===w?"show":"hide")},"txt"===w&&h.a.createElement(v.b,T)),"audio"===w&&h.a.createElement("audio",{src:"".concat((null===(n=k)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(l=k)||void 0===l?void 0:l.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(k),autoPlay:!0}),"video"===w&&h.a.createElement(h.a.Fragment,null,(null===(d=k)||void 0===d?void 0:d.indexOf("http"))>-1?h.a.createElement("video",{controls:!0,src:"".concat(k),autoPlay:!0}):h.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(k),autoPlay:!0})),"office"===w&&H&&h.a.createElement("iframe",{src:"".concat(V,"/office.html?key=").concat(H.key,"&url=").concat(K+H.url,"&callbackUrl=").concat(K+H.callbackUrl,"&fileType=").concat(H.fileType,"&title=").concat(H.title,"&model=").concat(S,"&officeServer=").concat(y.a.OFFICE_SERVER,"&disabledDownload=").concat(!!D)}),("xlsx"===w||"doc"===w||"pptx"===w||"docx"===w)&&h.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(M.key,"&url=").concat(y.a.API_SERVER+M.url,"&callbackUrl=").concat(y.a.API_SERVER+M.callbackUrl,"&fileType=").concat(M.fileType,"&title=").concat(M.title,"&model=").concat(M.model)}),"html"===w&&h.a.createElement("iframe",{src:k+"&disposition=inline"}),"pdf"===w&&h.a.createElement("embed",{className:f.a.embed,src:k}),"image"===w&&h.a.createElement("img",{src:"".concat((null===(b=k)||void 0===b?void 0:b.indexOf("http://"))>-1||(null===(E=k)||void 0===E?void 0:E.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(k)}),"other"===w&&h.a.createElement("div",null,h.a.createElement(i.a,{type:"primary",size:"large",onClick:q},h.a.createElement(p.a,null),"点击下载")),"download"===w&&h.a.createElement(i.a,{type:"primary",size:"large",onClick:q},h.a.createElement(p.a,null),"点击下载"))}},pIsd:
|
|
|
/*!***************************************!*\
|
|
|
!*** ./node_modules/json2mq/index.js ***!
|
|
|
\***************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var i=n(/*! string-convert/camel2hyphen */"BJfS"),r=function(t){var e="",n=Object.keys(t);return n.forEach((function(r,o){var s=t[r];(function(t){return/[height|width]$/.test(t)})(r=i(r))&&"number"==typeof s&&(s+="px"),e+=!0===s?r:!1===s?"not "+r:"("+r+": "+s+")",o<n.length-1&&(e+=" and ")})),e};t.exports=function(t){var e="";return"string"==typeof t?t:t instanceof Array?(t.forEach((function(n,i){e+=r(n),i<t.length-1&&(e+=", ")})),e):r(t)}},pmY6:
|
|
|
/*!********************************************************************!*\
|
|
|
!*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***!
|
|
|
\********************************************************************/
|
|
|
/*! exports provided: isDisposable, dispose, combinedDisposable, toDisposable, DisposableStore, Disposable, MutableDisposable, ImmortalReference */
|
|
|
/*! exports used: Disposable, DisposableStore, ImmortalReference, MutableDisposable, combinedDisposable, dispose, isDisposable, toDisposable */function(t,e,n){"use strict";n.d(e,"g",(function(){return r})),n.d(e,"f",(function(){return o})),n.d(e,"e",(function(){return s})),n.d(e,"h",(function(){return a})),n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return u})),n.d(e,"c",(function(){return h}));function i(t){}function r(t){return"function"==typeof t.dispose&&0===t.dispose.length}function o(t){return Array.isArray(t)?(t.forEach((function(t){t&&t.dispose()})),[]):t?(t.dispose(),t):void 0}function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.forEach(i),{dispose:function(){return o(t)}}}function a(t){var e={dispose:function(){t()}};return e}var l=function(){function t(){this._toDispose=new Set,this._isDisposed=!1}return t.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this.clear())},t.prototype.clear=function(){this._toDispose.forEach((function(t){return t.dispose()})),this._toDispose.clear()},t.prototype.add=function(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?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},t}(),c=function(){function t(){this._store=new l}return t.prototype.dispose=function(){this._store.dispose()},t.prototype._register=function(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)},t.None=Object.freeze({dispose:function(){}}),t}(),u=function(){function t(){this._isDisposed=!1}return Object.defineProperty(t.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(t){this._isDisposed||t===this._value||(this._value&&this._value.dispose(),this._value=t)},enumerable:!0,configurable:!0}),t.prototype.clear=function(){this.value=void 0},t.prototype.dispose=function(){this._isDisposed=!0,this._value&&this._value.dispose(),this._value=void 0},t}(),h=function(){function t(t){this.object=t}return t.prototype.dispose=function(){},t}()},"rAM+":
|
|
|
/*!*******************************************************************************************************************!*\
|
|
|
!*** ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js ***!
|
|
|
\*******************************************************************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function r(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=Object(i.a)(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,s=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw s}}}}},rUJ1:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/marked/src/helpers.js ***!
|
|
|
\********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: escape */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){const n=/[&<>"']/,i=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},a=t=>s[t];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(t){return t.replace(l,(t,e)=>"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):"")}const u=/(^|[^\[])\^/g;const h=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const f={},p=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function m(t,e){f[" "+t]||(p.test(t)?f[" "+t]=t+"/":f[" "+t]=y(t,"/",!0));const n=-1===(t=f[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(v,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(g,"$1")+e:t+e}function y(t,e,n){const i=t.length;if(0===i)return"";let r=0;for(;r<i;){const o=t.charAt(i-r-1);if(o!==e||n){if(o===e||!n)break;r++}else r++}return t.substr(0,i-r)}t.exports={escape:function(t,e){if(e){if(n.test(t))return t.replace(i,a)}else if(r.test(t))return t.replace(o,a);return t},unescape:c,edit:function(t,e){t=t.source||t,e=e||"";const n={replace:(e,i)=>(i=(i=i.source||i).replace(u,"$1"),t=t.replace(e,i),n),getRegex:()=>new RegExp(t,e)};return n},cleanUrl:function(t,e,n){if(t){let t;try{t=decodeURIComponent(c(n)).replace(h,"").toLowerCase()}catch(t){return null}if(0===t.indexOf("javascript:")||0===t.indexOf("vbscript:")||0===t.indexOf("data:"))return null}e&&!d.test(n)&&(n=m(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n},resolveUrl:m,noopTest:{exec:function(){}},merge:function(t){let e,n,i=1;for(;i<arguments.length;i++)for(n in e=arguments[i],e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},splitCells:function(t,e){const n=t.replace(/\|/g,(t,e,n)=>{let i=!1,r=e;for(;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/);let i=0;if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n},rtrim:y,findClosingBracket:function(t,e){if(-1===t.indexOf(e[1]))return-1;const n=t.length;let i=0,r=0;for(;r<n;r++)if("\\"===t[r])r++;else if(t[r]===e[0])i++;else if(t[r]===e[1]&&(i--,i<0))return r;return-1},checkSanitizeDeprecation:function(t){t&&t.sanitize&&!t.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")}}},sR1s:
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/utils/valueUtil.js ***!
|
|
|
\*****************************************************/
|
|
|
/*! exports provided: getPathValue, getColumnsKey, mergeObject, validateValue */
|
|
|
/*! exports used: getColumnsKey, getPathValue, mergeObject, validateValue */function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return l}));var i=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU");function r(t){return null==t?[]:Array.isArray(t)?t:[t]}function o(t,e){if(!e&&"number"!=typeof e)return t;for(var n=r(e),i=t,o=0;o<n.length;o+=1){if(!i)return null;i=i[n[o]]}return i}function s(t){var e=[],n={};return t.forEach((function(t){for(var i=t||{},o=i.key,s=i.dataIndex,a=o||r(s).join("-")||"RC_TABLE_KEY";n[a];)a="".concat(a,"_next");n[a]=!0,e.push(a)})),e}function a(){var t={};function e(t,n){n&&Object.keys(n).forEach((function(r){var o=n[r];o&&"object"===Object(i.a)(o)?(t[r]=t[r]||{},e(t[r],o)):t[r]=o}))}for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return r.forEach((function(n){e(t,n)})),t}function l(t){return null!=t}},sboe:
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/rc-tree/es/contextTypes.js ***!
|
|
|
\*************************************************/
|
|
|
/*! exports provided: TreeContext */
|
|
|
/*! exports used: TreeContext */function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(/*! react */"q1tI"),r=i.createContext(null)},t23M:
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/rc-resize-observer/es/index.js ***!
|
|
|
\*****************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(t,e,n){"use strict";var i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),r=n(/*! @babel/runtime/helpers/esm/classCallCheck */"1OyB"),o=n(/*! @babel/runtime/helpers/esm/createClass */"vuIU"),s=n(/*! @babel/runtime/helpers/esm/inherits */"Ji7U"),a=n(/*! @babel/runtime/helpers/esm/createSuper */"LK+K"),l=n(/*! react */"q1tI"),c=n(/*! rc-util/es/Dom/findDOMNode */"m+aA"),u=n(/*! rc-util/es/Children/toArray */"Zm9Q"),h=n(/*! rc-util/es/warning */"Kwbf"),d=n(/*! rc-util/es/ref */"c+Xe"),f=n(/*! resize-observer-polyfill */"bdgK"),p=function(t){Object(s.a)(n,t);var e=Object(a.a)(n);function n(){var t;return Object(r.a)(this,n),(t=e.apply(this,arguments)).resizeObserver=null,t.childNode=null,t.currentElement=null,t.state={width:0,height:0,offsetHeight:0,offsetWidth:0},t.onResize=function(e){var n=t.props.onResize,r=e[0].target,o=r.getBoundingClientRect(),s=o.width,a=o.height,l=r.offsetWidth,c=r.offsetHeight,u=Math.floor(s),h=Math.floor(a);if(t.state.width!==u||t.state.height!==h||t.state.offsetWidth!==l||t.state.offsetHeight!==c){var d={width:u,height:h,offsetWidth:l,offsetHeight:c};t.setState(d),n&&Promise.resolve().then((function(){n(Object(i.a)(Object(i.a)({},d),{},{offsetWidth:l,offsetHeight:c}))}))}},t.setChildNode=function(e){t.childNode=e},t}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){if(this.props.disabled)this.destroyObserver();else{var t=Object(c.a)(this.childNode||this);t!==this.currentElement&&(this.destroyObserver(),this.currentElement=t),!this.resizeObserver&&t&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(t))}}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var t=this.props.children,e=Object(u.a)(t);if(e.length>1)Object(h.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(0===e.length)return Object(h.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var n=e[0];if(l.isValidElement(n)&&Object(d.c)(n)){var i=n.ref;e[0]=l.cloneElement(n,{ref:Object(d.a)(i,this.setChildNode)})}return 1===e.length?e[0]:e.map((function(t,e){return!l.isValidElement(t)||"key"in t&&null!==t.key?t:l.cloneElement(t,{key:"".concat("rc-observer-key","-").concat(e)})}))}}]),n}(l.Component);p.displayName="ResizeObserver",e.a=p},t6v1:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/assets/images/question/a2.svg ***!
|
|
|
\*******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/a2.5b5c5524.svg"},uf8j:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/assets/images/question/a.svg ***!
|
|
|
\******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/a.11a2629b.svg"},ulZh:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/hls.js/dist/hls.js ***!
|
|
|
\*****************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){var i;"undefined"!=typeof window&&(i=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/eventemitter3/index.js ***!
|
|
|
\*********************************************/
|
|
|
/*! no static exports found */function(t,e,n){"use strict";var i=Object.prototype.hasOwnProperty,r="~";function o(){}function s(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,i||t,o),l=r?r+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(r=!1)),c.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},c.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s},c.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},c.prototype.emit=function(t,e,n,i,o,s){var a=r?r+t:t;if(!this._events[a])return!1;var l,c,u=this._events[a],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,n),!0;case 4:return u.fn.call(u.context,e,n,i),!0;case 5:return u.fn.call(u.context,e,n,i,o),!0;case 6:return u.fn.call(u.context,e,n,i,o,s),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(t,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,e);break;case 3:u[c].fn.call(u[c].context,e,n);break;case 4:u[c].fn.call(u[c].context,e,n,i);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},c.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},c.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},c.prototype.removeListener=function(t,e,n,i){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return l(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||n&&s.context!==n||l(this,o);else{for(var a=0,c=[],u=s.length;a<u;a++)(s[a].fn!==e||i&&!s[a].once||n&&s[a].context!==n)&&c.push(s[a]);c.length?this._events[o]=1===c.length?c[0]:c:l(this,o)}return this},c.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&l(this,e)):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t.exports=c},"./node_modules/url-toolkit/src/url-toolkit.js":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/url-toolkit/src/url-toolkit.js ***!
|
|
|
\*****************************************************/
|
|
|
/*! no static exports found */function(t,e,n){var i,r,o,s,a;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,r=/^([^\/?#]*)([^]*)$/,o=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(t,e,n){if(n=n||{},t=t.trim(),!(e=e.trim())){if(!n.alwaysNormalize)return t;var i=a.parseURL(t);if(!i)throw new Error("Error trying to parse base URL.");return i.path=a.normalizePath(i.path),a.buildURLFromParts(i)}var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return n.alwaysNormalize?(o.path=a.normalizePath(o.path),a.buildURLFromParts(o)):e;var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var l=r.exec(s.path);s.netLoc=l[1],s.path=l[2]}s.netLoc&&!s.path&&(s.path="/");var c={scheme:s.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(c.netLoc=s.netLoc,"/"!==o.path[0]))if(o.path){var u=s.path,h=u.substring(0,u.lastIndexOf("/")+1)+o.path;c.path=a.normalizePath(h)}else c.path=s.path,o.params||(c.params=s.params,o.query||(c.query=s.query));return null===c.path&&(c.path=n.alwaysNormalize?a.normalizePath(o.path):o.path),a.buildURLFromParts(c)},parseURL:function(t){var e=i.exec(t);return e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(o,"");t.length!==(t=t.replace(s,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=a},"./node_modules/webworkify-webpack/index.js":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/webworkify-webpack/index.js ***!
|
|
|
\**************************************************/
|
|
|
/*! no static exports found */function(t,e,n){function i(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n.oe=function(t){throw console.error(t),t};var i=n(n.s=ENTRY_MODULE);return i.default||i}function r(t){return(t+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function o(t,e,i){var o={};o[i]=[];var s=e.toString(),a=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return o;for(var l,c=a[1],u=new RegExp("(\\\\n|\\W)"+r(c)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");l=u.exec(s);)"dll-reference"!==l[3]&&o[i].push(l[3]);for(u=new RegExp("\\("+r(c)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");l=u.exec(s);)t[l[2]]||(o[i].push(l[1]),t[l[2]]=n(l[1]).m),o[l[2]]=o[l[2]]||[],o[l[2]].push(l[4]);for(var h,d=Object.keys(o),f=0;f<d.length;f++)for(var p=0;p<o[d[f]].length;p++)h=o[d[f]][p],isNaN(1*h)||(o[d[f]][p]=1*o[d[f]][p]);return o}function s(t){return Object.keys(t).reduce((function(e,n){return e||t[n].length>0}),!1)}t.exports=function(t,e){e=e||{};var r={main:n.m},a=e.all?{main:Object.keys(r.main)}:function(t,e){for(var n={main:[e]},i={main:[]},r={main:{}};s(n);)for(var a=Object.keys(n),l=0;l<a.length;l++){var c=a[l],u=n[c].pop();if(r[c]=r[c]||{},!r[c][u]&&t[c][u]){r[c][u]=!0,i[c]=i[c]||[],i[c].push(u);for(var h=o(t,t[c][u],c),d=Object.keys(h),f=0;f<d.length;f++)n[d[f]]=n[d[f]]||[],n[d[f]]=n[d[f]].concat(h[d[f]])}}return i}(r,t),l="";Object.keys(a).filter((function(t){return"main"!==t})).forEach((function(t){for(var e=0;a[t][e];)e++;a[t].push(e),r[t][e]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+t+" = ("+i.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+a[t].map((function(e){return JSON.stringify(e)+": "+r[t][e].toString()})).join(",")+"});\n"})),l=l+"new (("+i.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+a.main.map((function(t){return JSON.stringify(t)+": "+r.main[t].toString()})).join(",")+"}))(self);";var c=new window.Blob([l],{type:"text/javascript"});if(e.bare)return c;var u=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(c),h=new window.Worker(u);return h.objectURL=u,h}},"./src/config.ts":
|
|
|
/*!***********************!*\
|
|
|
!*** ./src/config.ts ***!
|
|
|
\***********************/
|
|
|
/*! exports provided: hlsDefaultConfig, mergeConfig, enableStreamingMode */function(t,e,n){"use strict";n.r(e),n.d(e,"hlsDefaultConfig",(function(){return k})),n.d(e,"mergeConfig",(function(){return w})),n.d(e,"enableStreamingMode",(function(){return x}));var i=n(/*! ./controller/abr-controller */"./src/controller/abr-controller.ts"),r=n(/*! ./controller/audio-stream-controller */"./src/controller/audio-stream-controller.ts"),o=n(/*! ./controller/audio-track-controller */"./src/controller/audio-track-controller.ts"),s=n(/*! ./controller/subtitle-stream-controller */"./src/controller/subtitle-stream-controller.ts"),a=n(/*! ./controller/subtitle-track-controller */"./src/controller/subtitle-track-controller.ts"),l=n(/*! ./controller/buffer-controller */"./src/controller/buffer-controller.ts"),c=n(/*! ./controller/timeline-controller */"./src/controller/timeline-controller.ts"),u=n(/*! ./controller/cap-level-controller */"./src/controller/cap-level-controller.ts"),h=n(/*! ./controller/fps-controller */"./src/controller/fps-controller.ts"),d=n(/*! ./controller/eme-controller */"./src/controller/eme-controller.ts"),f=n(/*! ./controller/cmcd-controller */"./src/controller/cmcd-controller.ts"),p=n(/*! ./utils/xhr-loader */"./src/utils/xhr-loader.ts"),v=n(/*! ./utils/fetch-loader */"./src/utils/fetch-loader.ts"),g=n(/*! ./utils/cues */"./src/utils/cues.ts"),m=n(/*! ./utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts"),y=n(/*! ./utils/logger */"./src/utils/logger.ts");function b(){return(b=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?E(Object(n),!0).forEach((function(e){S(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function S(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var k=C(C({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,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:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:i.default,bufferController:l.default,capLevelController:u.default,fpsController:h.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:m.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},{cueHandler:g.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}),{},{subtitleStreamController:s.SubtitleStreamController,subtitleTrackController:a.default,timelineController:c.TimelineController,audioStreamController:r.default,audioTrackController:o.default,emeController:d.default,cmcdController:f.default});function w(t,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return b({},t,e)}function x(t){var e=t.loader;e!==v.default&&e!==p.default?(y.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1):Object(v.fetchSupported)()&&(t.loader=v.default,t.progressive=!0,t.enableSoftwareAES=!0,y.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}},"./src/controller/abr-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/abr-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../utils/ewma-bandwidth-estimator */"./src/utils/ewma-bandwidth-estimator.ts"),o=n(/*! ../events */"./src/events.ts"),s=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=n(/*! ../errors */"./src/errors.ts"),l=n(/*! ../types/loader */"./src/types/loader.ts"),c=n(/*! ../utils/logger */"./src/utils/logger.ts");function u(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var h=function(){function t(t){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=t;var e=t.config;this.bwEstimator=new r.default(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate),this.registerListeners()}var e,n,h,d=t.prototype;return d.registerListeners=function(){var t=this.hls;t.on(o.Events.FRAG_LOADING,this.onFragLoading,this),t.on(o.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var t=this.hls;t.off(o.Events.FRAG_LOADING,this.onFragLoading,this),t.off(o.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},d.onFragLoading=function(t,e){var n,i=e.frag;i.type===l.PlaylistLevelType.MAIN&&(this.timer||(this.fragCurrent=i,this.partCurrent=null!=(n=e.part)?n:null,this.timer=self.setInterval(this.onCheck,100)))},d.onLevelLoaded=function(t,e){var n=this.hls.config;e.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD)},d._abandonRulesCheck=function(){var t=this.fragCurrent,e=this.partCurrent,n=this.hls,r=n.autoLevelEnabled,a=n.config,l=n.media;if(t&&l){var u=e?e.stats:t.stats,h=e?e.duration:t.duration;if(u.aborted)return c.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);if(r&&!l.paused&&l.playbackRate&&l.readyState){var d=performance.now()-u.loading.start,f=Math.abs(l.playbackRate);if(!(d<=500*h/f)){var p=n.levels,v=n.minAutoLevel,g=p[t.level],m=u.total||Math.max(u.loaded,Math.round(h*g.maxBitrate/8)),y=Math.max(1,u.bwEstimate?u.bwEstimate/8:1e3*u.loaded/d),b=(m-u.loaded)/y,E=l.currentTime,C=(s.BufferHelper.bufferInfo(l,E,a.maxBufferHole).end-E)/f;if(!(C>=2*h/f||b<=C)){var S,k=Number.POSITIVE_INFINITY;for(S=t.level-1;S>v&&!((k=h*p[S].maxBitrate/(6.4*y))<C);S--);if(!(k>=b)){var w=this.bwEstimator.getEstimate();c.logger.warn("Fragment "+t.sn+(e?" part "+e.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+S+"\n Current BW estimate: "+(Object(i.isFiniteNumber)(w)?(w/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+b.toFixed(3)+" s\n Estimated load time for the next fragment: "+k.toFixed(3)+" s\n Time to underbuffer: "+C.toFixed(3)+" s"),n.nextLoadLevel=S,this.bwEstimator.sample(d,u.loaded),this.clearTimer(),t.loader&&(this.fragCurrent=this.partCurrent=null,t.loader.abort()),n.trigger(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:u})}}}}}},d.onFragLoaded=function(t,e){var n=e.frag,r=e.part;if(n.type===l.PlaylistLevelType.MAIN&&Object(i.isFiniteNumber)(n.sn)){var s=r?r.stats:n.stats,a=r?r.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var c=this.hls.levels[n.level],u=(c.loaded?c.loaded.bytes:0)+s.loaded,h=(c.loaded?c.loaded.duration:0)+a;c.loaded={bytes:u,duration:h},c.realBitrate=Math.round(8*u/h)}if(n.bitrateTest){var d={stats:s,frag:n,part:r,id:n.type};this.onFragBuffered(o.Events.FRAG_BUFFERED,d),n.bitrateTest=!1}}},d.onFragBuffered=function(t,e){var n=e.frag,i=e.part,r=i?i.stats:n.stats;if(!r.aborted&&n.type===l.PlaylistLevelType.MAIN&&"initSegment"!==n.sn){var o=r.parsing.end-r.loading.start;this.bwEstimator.sample(o,r.loaded),r.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}},d.onError=function(t,e){switch(e.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},d.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},d.getNextABRAutoLevel=function(){var t=this.fragCurrent,e=this.partCurrent,n=this.hls,i=n.maxAutoLevel,r=n.config,o=n.minAutoLevel,a=n.media,l=e?e.duration:t?t.duration:0,u=a?a.currentTime:0,h=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():r.abrEwmaDefaultEstimate,f=(s.BufferHelper.bufferInfo(a,u,r.maxBufferHole).end-u)/h,p=this.findBestLevel(d,o,i,f,r.abrBandWidthFactor,r.abrBandWidthUpFactor);if(p>=0)return p;c.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var v=l?Math.min(l,r.maxStarvationDelay):r.maxStarvationDelay,g=r.abrBandWidthFactor,m=r.abrBandWidthUpFactor;if(!f){var y=this.bitrateTestDelay;y&&(v=(l?Math.min(l,r.maxLoadingDelay):r.maxLoadingDelay)-y,c.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),g=m=1)}return p=this.findBestLevel(d,o,i,f+v,g,m),Math.max(p,0)},d.findBestLevel=function(t,e,n,i,r,o){for(var s,a=this.fragCurrent,l=this.partCurrent,u=this.lastLoadedFragLevel,h=this.hls.levels,d=h[u],f=!(null==d||null===(s=d.details)||void 0===s||!s.live),p=null==d?void 0:d.codecSet,v=l?l.duration:a?a.duration:0,g=n;g>=e;g--){var m=h[g];if(m&&(!p||m.codecSet===p)){var y=m.details,b=(l?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||v,E=void 0;E=g<=u?r*t:o*t;var C=h[g].maxBitrate,S=C*b/E;if(c.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+g+"/"+Math.round(E)+"/"+C+"/"+b+"/"+i+"/"+S),E>C&&(!S||f&&!this.bitrateTestDelay||S<i))return g}}return-1},e=t,(n=[{key:"nextAutoLevel",get:function(){var t=this._nextAutoLevel,e=this.bwEstimator;if(!(-1===t||e&&e.canEstimate()))return t;var n=this.getNextABRAutoLevel();return-1!==t&&(n=Math.min(t,n)),n},set:function(t){this._nextAutoLevel=t}}])&&u(e.prototype,n),h&&u(e,h),t}();e.default=h},"./src/controller/audio-stream-controller.ts":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./src/controller/audio-stream-controller.ts ***!
|
|
|
\***************************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),o=n(/*! ../events */"./src/events.ts"),s=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=n(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),l=n(/*! ../types/level */"./src/types/level.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts"),u=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),h=n(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts"),d=n(/*! ../demux/transmuxer-interface */"./src/demux/transmuxer-interface.ts"),f=n(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),p=n(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),v=n(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),g=n(/*! ../errors */"./src/errors.ts"),m=n(/*! ../utils/logger */"./src/utils/logger.ts");function y(){return(y=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function b(t,e){return(b=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var E=function(t){var e,n;function E(e,n){var i;return(i=t.call(this,e,n,"[audio-stream-controller]")||this).videoBuffer=null,i.videoTrackCC=-1,i.waitingVideoCC=-1,i.audioSwitch=!1,i.trackId=-1,i.waitingData=null,i.mainDetails=null,i.bufferFlushed=!1,i._registerListeners(),i}n=t,(e=E).prototype=Object.create(n.prototype),e.prototype.constructor=e,b(e,n);var C=E.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var t=this.hls;t.on(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(o.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(o.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(o.Events.ERROR,this.onError,this),t.on(o.Events.BUFFER_RESET,this.onBufferReset,this),t.on(o.Events.BUFFER_CREATED,this.onBufferCreated,this),t.on(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(o.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var t=this.hls;t.off(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(o.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(o.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(o.Events.ERROR,this.onError,this),t.off(o.Events.BUFFER_RESET,this.onBufferReset,this),t.off(o.Events.BUFFER_CREATED,this.onBufferCreated,this),t.off(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(o.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onInitPtsFound=function(t,e){var n=e.frag,i=e.id,o=e.initPTS;if("main"===i){var s=n.cc;this.initPTS[n.cc]=o,this.log("InitPTS for cc: "+s+" found from main: "+o),this.videoTrackCC=s,this.state===r.State.WAITING_INIT_PTS&&this.tick()}},C.startLoad=function(t){if(!this.levels)return this.startPosition=t,void(this.state=r.State.STOPPED);var e=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,e>0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=r.State.IDLE):(this.loadedmetadata=!1,this.state=r.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},C.doTick=function(){switch(this.state){case r.State.IDLE:this.doTickIdle();break;case r.State.WAITING_TRACK:var e,n=this.levels,i=this.trackId,o=null==n||null===(e=n[i])||void 0===e?void 0:e.details;if(o){if(this.waitForCdnTuneIn(o))break;this.state=r.State.WAITING_INIT_PTS}break;case r.State.FRAG_LOADING_WAITING_RETRY:var a,l=performance.now(),c=this.retryDate;(!c||l>=c||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=r.State.IDLE);break;case r.State.WAITING_INIT_PTS:var u=this.waitingData;if(u){var h=u.frag,d=u.part,f=u.cache,v=u.complete;if(void 0!==this.initPTS[h.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=r.State.FRAG_LOADING;var g={frag:h,part:d,payload:f.flush(),networkDetails:null};this._handleFragmentLoadProgress(g),v&&t.prototype._handleFragmentLoadComplete.call(this,g)}else if(this.videoTrackCC!==this.waitingVideoCC)m.logger.log("Waiting fragment cc ("+h.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var y=this.getLoadPosition(),b=s.BufferHelper.bufferInfo(this.mediaBuffer,y,this.config.maxBufferHole);Object(p.fragmentWithinToleranceTest)(b.end,this.config.maxFragLookUpTolerance,h)<0&&(m.logger.log("Waiting fragment cc ("+h.cc+") @ "+h.start+" cancelled because another fragment at "+b.end+" is needed"),this.clearWaitingFragment())}}else this.state=r.State.IDLE}this.onTickEnd()},C.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=r.State.IDLE)},C.onTickEnd=function(){var t=this.media;if(t&&t.readyState){var e=(this.mediaBuffer?this.mediaBuffer:t).buffered;!this.loadedmetadata&&e.length&&(this.loadedmetadata=!0),this.lastCurrentTime=t.currentTime}},C.doTickIdle=function(){var t,e,n=this.hls,i=this.levels,s=this.media,a=this.trackId,l=n.config;if(i&&i[a]&&(s||!this.startFragRequested&&l.startFragPrefetch)){var h=i[a].details;if(!h||h.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(h))this.state=r.State.WAITING_TRACK;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.ElementaryStreamTypes.AUDIO,c.PlaylistLevelType.AUDIO));var d=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,c.PlaylistLevelType.AUDIO);if(null!==d){var f=d.len,p=this.getMaxBufferLength(),v=this.audioSwitch;if(!(f>=p)||v){if(!v&&this._streamEnded(d,h))return n.trigger(o.Events.BUFFER_EOS,{type:"audio"}),void(this.state=r.State.ENDED);var g=h.fragments[0].start,m=d.end;if(v){var y=this.getLoadPosition();m=y,h.PTSKnown&&y<g&&(d.end>g||d.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=g+.05)}var b=this.getNextFragment(m,h);b?"identity"!==(null===(t=b.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=b.decryptdata)&&void 0!==e&&e.key?this.loadFragment(b,h,m):this.loadKey(b,h):this.bufferFlushed=!0}}}}},C.getMaxBufferLength=function(){var e=t.prototype.getMaxBufferLength.call(this),n=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,c.PlaylistLevelType.MAIN);return null===n?e:Math.max(e,n.len)},C.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},C.onAudioTracksUpdated=function(t,e){var n=e.audioTracks;this.resetTransmuxer(),this.levels=n.map((function(t){return new l.Level(t)}))},C.onAudioTrackSwitching=function(t,e){var n=!!e.url;this.trackId=e.id;var i=this.fragCurrent;null!=i&&i.loader&&i.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),n?this.setInterval(100):this.resetTransmuxer(),n?(this.audioSwitch=!0,this.state=r.State.IDLE):this.state=r.State.STOPPED,this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},C.onLevelLoaded=function(t,e){this.mainDetails=e.details},C.onAudioTrackLoaded=function(t,e){var n,i=this.levels,o=e.details,s=e.id;if(i){this.log("Track "+s+" loaded ["+o.startSN+","+o.endSN+"],duration:"+o.totalduration);var a=i[s],l=0;if(o.live||null!==(n=a.details)&&void 0!==n&&n.live){var c=this.mainDetails;if(o.fragments[0]||(o.deltaUpdateFailed=!0),o.deltaUpdateFailed||!c)return;!a.details&&o.hasProgramDateTime&&c.hasProgramDateTime?(Object(v.alignMediaPlaylistByPDT)(o,c),l=o.fragments[0].start):l=this.alignPlaylists(o,a.details)}a.details=o,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&o.live||this.setStartPosition(a.details,l),this.state!==r.State.WAITING_TRACK||this.waitForCdnTuneIn(o)||(this.state=r.State.IDLE),this.tick()}else this.warn("Audio tracks were reset while loading level "+s)},C._handleFragmentLoadProgress=function(t){var e,n=t.frag,i=t.part,o=t.payload,s=this.config,a=this.trackId,l=this.levels;if(l){var u=l[a];console.assert(u,"Audio track is defined on fragment load progress");var p=u.details;console.assert(p,"Audio track details are defined on fragment load progress");var v=s.defaultAudioCodec||u.audioCodec||"mp4a.40.2",g=this.transmuxer;g||(g=this.transmuxer=new d.default(this.hls,c.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var y=this.initPTS[n.cc],b=null===(e=n.initSegment)||void 0===e?void 0:e.data;if(void 0!==y){var E=i?i.index:-1,C=-1!==E,S=new f.ChunkMetadata(n.level,n.sn,n.stats.chunkCount,o.byteLength,E,C);g.push(o,b,v,"",n,i,p.totalduration,!1,S,y)}else m.logger.log("Unknown video PTS for cc "+n.cc+", waiting for video PTS before demuxing audio frag "+n.sn+" of ["+p.startSN+" ,"+p.endSN+"],track "+a),(this.waitingData=this.waitingData||{frag:n,part:i,cache:new h.default,complete:!1}).cache.push(new Uint8Array(o)),this.waitingVideoCC=this.videoTrackCC,this.state=r.State.WAITING_INIT_PTS}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+n.sn+" of level "+n.level+" will not be buffered")},C._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},C.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},C.onBufferCreated=function(t,e){var n=e.tracks.audio;n&&(this.mediaBuffer=n.buffer),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},C.onFragBuffered=function(t,e){var n=e.frag,i=e.part;n.type===c.PlaylistLevelType.AUDIO&&(this.fragContextChanged(n)?this.warn("Fragment "+n.sn+(i?" p: "+i.index:"")+" of level "+n.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==n.sn&&(this.fragPrevious=n,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(n,i)))},C.onError=function(e,n){switch(n.details){case g.ErrorDetails.FRAG_LOAD_ERROR:case g.ErrorDetails.FRAG_LOAD_TIMEOUT:case g.ErrorDetails.KEY_LOAD_ERROR:case g.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.AUDIO,n);break;case g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case g.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==r.State.ERROR&&this.state!==r.State.STOPPED&&(this.state=n.fatal?r.State.ERROR:r.State.IDLE,this.warn(n.details+" while loading frag, switching to "+this.state+" state"));break;case g.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===n.parent&&(this.state===r.State.PARSING||this.state===r.State.PARSED)){var i=!0,o=this.getFwdBufferInfo(this.mediaBuffer,c.PlaylistLevelType.AUDIO);o&&o.len>.5&&(i=!this.reduceMaxBufferLength(o.len)),i&&(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()}}},C.onBufferFlushed=function(t,e){e.type===u.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},C._handleTransmuxComplete=function(t){var e,n="audio",i=this.hls,s=t.remuxResult,a=t.chunkMeta,l=this.getCurrentContext(a);if(!l)return this.warn("The loading context changed while buffering fragment "+a.sn+" of level "+a.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(a.level);var c=l.frag,h=l.part,d=s.audio,f=s.text,p=s.id3,v=s.initSegment;if(!this.fragContextChanged(c)){if(this.state=r.State.PARSING,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=v&&v.tracks&&(this._bufferInitSegment(v.tracks,c,a),i.trigger(o.Events.FRAG_PARSING_INIT_SEGMENT,{frag:c,id:n,tracks:v.tracks})),d){var g=d.startPTS,m=d.endPTS,b=d.startDTS,E=d.endDTS;h&&(h.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:g,endPTS:m,startDTS:b,endDTS:E}),c.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,g,m,b,E),this.bufferFragmentData(d,c,h,a)}if(null!=p&&null!==(e=p.samples)&&void 0!==e&&e.length){var C=y({frag:c,id:n},p);i.trigger(o.Events.FRAG_PARSING_METADATA,C)}if(f){var S=y({frag:c,id:n},f);i.trigger(o.Events.FRAG_PARSING_USERDATA,S)}}},C._bufferInitSegment=function(t,e,n){if(this.state===r.State.PARSING){t.video&&delete t.video;var i=t.audio;if(i){i.levelCodec=i.codec,i.id="audio",this.log("Init audio buffer, container:"+i.container+", codecs[parsed]=["+i.codec+"]"),this.hls.trigger(o.Events.BUFFER_CODECS,t);var s=i.initSegment;if(null!=s&&s.byteLength){var a={type:"audio",frag:e,part:null,chunkMeta:n,parent:e.type,data:s};this.hls.trigger(o.Events.BUFFER_APPENDING,a)}this.tick()}}},C.loadFragment=function(e,n,o){var s=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||s===a.FragmentState.NOT_LOADED||s===a.FragmentState.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e):n.live&&!Object(i.isFiniteNumber)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=r.State.WAITING_INIT_PTS):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,n,o)))},C.completeAudioSwitch=function(){var e=this.hls,n=this.media,i=this.trackId;n&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,e.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:i})},E}(r.default);e.default=E},"./src/controller/audio-track-controller.ts":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/controller/audio-track-controller.ts ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../events */"./src/events.ts"),r=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),s=n(/*! ../types/loader */"./src/types/loader.ts");function a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=function(t){var e,n;function o(e){var n;return(n=t.call(this,e,"[audio-track-controller]")||this).tracks=[],n.groupId=null,n.tracksInGroup=[],n.trackId=-1,n.trackName="",n.selectDefaultTrack=!0,n.registerListeners(),n}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,l(e,n);var c,u,h,d=o.prototype;return d.registerListeners=function(){var t=this.hls;t.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(i.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(i.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(i.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var t=this.hls;t.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(i.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(i.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(i.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,t.prototype.destroy.call(this)},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},d.onManifestParsed=function(t,e){this.tracks=e.audioTracks||[]},d.onAudioTrackLoaded=function(t,e){var n=e.id,i=e.details,r=this.tracksInGroup[n];if(r){var o=r.details;r.details=e.details,this.log("audioTrack "+n+" loaded ["+i.startSN+"-"+i.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,e,o))}else this.warn("Invalid audio track id "+n)},d.onLevelLoading=function(t,e){this.switchLevel(e.level)},d.onLevelSwitching=function(t,e){this.switchLevel(e.level)},d.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.audioGroupIds){var n=e.audioGroupIds[e.urlId];if(this.groupId!==n){this.groupId=n;var r=this.tracks.filter((function(t){return!n||t.groupId===n}));this.selectDefaultTrack&&!r.some((function(t){return t.default}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=r;var o={audioTracks:r};this.log("Updating audio tracks, "+r.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(i.Events.AUDIO_TRACKS_UPDATED,o),this.selectInitialTrack()}}},d.onError=function(e,n){t.prototype.onError.call(this,e,n),!n.fatal&&n.context&&n.context.type===s.PlaylistContextType.AUDIO_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},d.setAudioTrack=function(t){var e=this.tracksInGroup;if(t<0||t>=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var n=e[this.trackId];this.log("Now switching to audio-track index "+t);var r=e[t],o=r.id,s=r.groupId,a=void 0===s?"":s,l=r.name,c=r.type,u=r.url;if(this.trackId=t,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(i.Events.AUDIO_TRACK_SWITCHING,{id:o,groupId:a,name:l,type:c,url:u}),!r.details||r.details.live){var h=this.switchParams(r.url,null==n?void 0:n.details);this.loadPlaylist(h)}}},d.selectInitialTrack=function(){var t=this.tracksInGroup;console.assert(t.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,n=this.findTrackId(e)||this.findTrackId();-1!==n?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},d.findTrackId=function(t){for(var e=this.tracksInGroup,n=0;n<e.length;n++){var i=e[n];if((!this.selectDefaultTrack||i.default)&&(!t||t===i.name))return i.id}return-1},d.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var n=e.id,r=e.groupId,o=e.url;if(t)try{o=t.addDirectives(o)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("loading audio-track playlist for id: "+n),this.clearTimer(),this.hls.trigger(i.Events.AUDIO_TRACK_LOADING,{url:o,id:n,groupId:r,deliveryDirectives:t||null})}},c=o,(u=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}}])&&a(c.prototype,u),h&&a(c,h),o}(o.default);e.default=c},"./src/controller/base-playlist-controller.ts":
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./src/controller/base-playlist-controller.ts ***!
|
|
|
\****************************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return l}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../types/level */"./src/types/level.ts"),o=n(/*! ./level-helper */"./src/controller/level-helper.ts"),s=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! ../errors */"./src/errors.ts"),l=function(){function t(t,e){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=s.logger.log.bind(s.logger,e+":"),this.warn=s.logger.warn.bind(s.logger,e+":"),this.hls=t}var e=t.prototype;return e.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},e.onError=function(t,e){e.fatal&&e.type===a.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(t,e){var n=null==e?void 0:e.renditionReports;if(n)for(var o=0;o<n.length;o++){var s=n[o],a=""+s.URI;if(a===t.substr(-a.length)){var l=parseInt(s["LAST-MSN"]),c=parseInt(s["LAST-PART"]);if(e&&this.hls.config.lowLatencyMode){var u=Math.min(e.age-e.partTarget,e.targetduration);void 0!==c&&u>e.partTarget&&(c+=1)}if(Object(i.isFiniteNumber)(l))return new r.HlsUrlParameters(l,Object(i.isFiniteNumber)(c)?c:void 0,r.HlsSkip.No)}}},e.loadPlaylist=function(t){},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,n){var i=this,r=e.details,s=e.stats,a=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(r.advancedDateTime=Date.now()-a,r.live||null!=n&&n.live){if(r.reloaded(n),n&&this.log("live playlist "+t+" "+(r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:"MISSED")),n&&r.fragments.length>0&&Object(o.mergeDetails)(n,r),!this.canLoad||!r.live)return;var l,c=void 0,u=void 0;if(r.canBlockReload&&r.endSN&&r.advanced){var h=this.hls.config.lowLatencyMode,d=r.lastPartSn,f=r.endSN,p=r.lastPartIndex,v=d===f;-1!==p?(c=v?f+1:d,u=v?h?0:p:p+1):c=f+1;var g=r.age,m=g+r.ageHeader,y=Math.min(m-r.partTarget,1.5*r.targetduration);if(y>0){if(n&&y>n.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+n.tuneInGoal+" to: "+y+" with playlist age: "+r.age),y=0;else{var b=Math.floor(y/r.targetduration);c+=b,void 0!==u&&(u+=Math.round(y%r.targetduration/r.partTarget)),this.log("CDN Tune-in age: "+r.ageHeader+"s last advanced "+g.toFixed(2)+"s goal: "+y+" skip sn "+b+" to part "+u)}r.tuneInGoal=y}if(l=this.getDeliveryDirectives(r,e.deliveryDirectives,c,u),h||!v)return void this.loadPlaylist(l)}else l=this.getDeliveryDirectives(r,e.deliveryDirectives,c,u);var E=Object(o.computeReloadInterval)(r,s);void 0!==c&&r.canBlockReload&&(E-=r.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(E)+" ms"),this.timer=self.setTimeout((function(){return i.loadPlaylist(l)}),E)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,n,i){var o=Object(r.getSkipValue)(t,n);return null!=e&&e.skip&&t.deltaUpdateFailed&&(n=e.msn,i=e.part,o=r.HlsSkip.No),new r.HlsUrlParameters(n,i,o)},e.retryLoadingOrFail=function(t){var e,n=this,i=this.hls.config,r=this.retryCount<i.levelLoadingMaxRetry;if(r)if(this.retryCount++,t.details.indexOf("LoadTimeOut")>-1&&null!==(e=t.context)&&void 0!==e&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var o=Math.min(Math.pow(2,this.retryCount)*i.levelLoadingRetryDelay,i.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return n.loadPlaylist()}),o),this.warn("retry playlist loading #"+this.retryCount+" in "+o+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return r},t}()},"./src/controller/base-stream-controller.ts":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/controller/base-stream-controller.ts ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: State, default */function(t,e,n){"use strict";n.r(e),n.d(e,"State",(function(){return C})),n.d(e,"default",(function(){return S}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../task-loop */"./src/task-loop.ts"),o=n(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),s=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=n(/*! ../utils/logger */"./src/utils/logger.ts"),l=n(/*! ../events */"./src/events.ts"),c=n(/*! ../errors */"./src/errors.ts"),u=n(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),h=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),d=n(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),f=n(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),p=n(/*! ./level-helper */"./src/controller/level-helper.ts"),v=n(/*! ../loader/fragment-loader */"./src/loader/fragment-loader.ts"),g=n(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),m=n(/*! ../utils/time-ranges */"./src/utils/time-ranges.ts"),y=n(/*! ../types/loader */"./src/types/loader.ts");function b(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function E(t,e){return(E=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var C={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"},S=function(t){var e,n;function r(e,n,i){var r;return(r=t.call(this)||this).hls=void 0,r.fragPrevious=null,r.fragCurrent=null,r.fragmentTracker=void 0,r.transmuxer=null,r._state=C.STOPPED,r.media=void 0,r.mediaBuffer=void 0,r.config=void 0,r.bitrateTest=!1,r.lastCurrentTime=0,r.nextLoadPosition=0,r.startPosition=0,r.loadedmetadata=!1,r.fragLoadError=0,r.retryDate=0,r.levels=null,r.fragmentLoader=void 0,r.levelLastLoaded=null,r.startFragRequested=!1,r.decrypter=void 0,r.initPTS=[],r.onvseeking=null,r.onvended=null,r.logPrefix="",r.log=void 0,r.warn=void 0,r.logPrefix=i,r.log=a.logger.log.bind(a.logger,i+":"),r.warn=a.logger.warn.bind(a.logger,i+":"),r.hls=e,r.fragmentLoader=new v.default(e.config),r.fragmentTracker=n,r.config=e.config,r.decrypter=new g.default(e,e.config),e.on(l.Events.KEY_LOADED,r.onKeyLoaded,function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(r)),r}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,E(e,n);var S,k,w,x=r.prototype;return x.doTick=function(){this.onTickEnd()},x.onTickEnd=function(){},x.startLoad=function(t){},x.stopLoad=function(){this.fragmentLoader.abort();var t=this.fragCurrent;t&&this.fragmentTracker.removeFragment(t),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=C.STOPPED},x._streamEnded=function(t,e){var n=this.fragCurrent,i=this.fragmentTracker;if(!e.live&&n&&n.sn===e.endSN&&!t.nextStart){var r=i.getState(n);return r===o.FragmentState.PARTIAL||r===o.FragmentState.OK}return!1},x.onMediaAttached=function(t,e){var n=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),n.addEventListener("seeking",this.onvseeking),n.addEventListener("ended",this.onvended);var i=this.config;this.levels&&i.autoStartLoad&&this.state===C.STOPPED&&this.startLoad(i.startPosition)},x.onMediaDetaching=function(){var t=this.media;null!=t&&t.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},x.onMediaSeeking=function(){var t=this.config,e=this.fragCurrent,n=this.media,r=this.mediaBuffer,o=this.state,a=n?n.currentTime:0,l=s.BufferHelper.bufferInfo(r||n,a,t.maxBufferHole);if(this.log("media seeking to "+(Object(i.isFiniteNumber)(a)?a.toFixed(3):a)+", state: "+o),o===C.ENDED)this.resetLoadingState();else if(e&&!l.len){var c=t.maxFragLookUpTolerance,u=e.start-c,h=a>e.start+e.duration+c;(a<u||h)&&(h&&e.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),e.loader.abort()),this.resetLoadingState())}n&&(this.lastCurrentTime=a),this.loadedmetadata||l.len||(this.nextLoadPosition=this.startPosition=a),this.tickImmediate()},x.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},x.onKeyLoaded=function(t,e){if(this.state===C.KEY_LOADING&&e.frag===this.fragCurrent&&this.levels){this.state=C.IDLE;var n=this.levels[e.frag.level].details;n&&this.loadFragment(e.frag,n,e.frag.start)}},x.onHandlerDestroying=function(){this.stopLoad(),t.prototype.onHandlerDestroying.call(this)},x.onHandlerDestroyed=function(){this.state=C.STOPPED,this.hls.off(l.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,t.prototype.onHandlerDestroyed.call(this)},x.loadKey=function(t,e){this.log("Loading key for "+t.sn+" of ["+e.startSN+"-"+e.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level),this.state=C.KEY_LOADING,this.fragCurrent=t,this.hls.trigger(l.Events.KEY_LOADING,{frag:t})},x.loadFragment=function(t,e,n){this._loadFragForPlayback(t,e,n)},x._loadFragForPlayback=function(t,e,n){var i=this;this._doFragLoad(t,e,n,(function(e){if(i.fragContextChanged(t))return i.warn("Fragment "+t.sn+(e.part?" p: "+e.part.index:"")+" of level "+t.level+" was dropped during download."),void i.fragmentTracker.removeFragment(t);t.stats.chunkCount++,i._handleFragmentLoadProgress(e)})).then((function(e){if(e){i.fragLoadError=0;var n=i.state;if(!i.fragContextChanged(t))return"payload"in e&&(i.log("Loaded fragment "+t.sn+" of level "+t.level),i.hls.trigger(l.Events.FRAG_LOADED,e),i.state===C.BACKTRACKING)?(i.fragmentTracker.backtrack(t,e),void i.resetFragmentLoading(t)):void i._handleFragmentLoadComplete(e);(n===C.FRAG_LOADING||n===C.BACKTRACKING||!i.fragCurrent&&n===C.PARSING)&&(i.fragmentTracker.removeFragment(t),i.state=C.IDLE)}})).catch((function(e){i.warn(e),i.resetFragmentLoading(t)}))},x.flushMainBuffer=function(t,e,n){if(void 0===n&&(n=null),t-e){var i={startOffset:t,endOffset:e,type:n};this.fragLoadError=0,this.hls.trigger(l.Events.BUFFER_FLUSHING,i)}},x._loadInitSegment=function(t){var e=this;this._doFragLoad(t).then((function(n){if(!n||e.fragContextChanged(t)||!e.levels)throw new Error("init load aborted");return n})).then((function(n){var i=e.hls,r=n.payload,o=t.decryptdata;if(r&&r.byteLength>0&&o&&o.key&&o.iv&&"AES-128"===o.method){var s=self.performance.now();return e.decrypter.webCryptoDecrypt(new Uint8Array(r),o.key.buffer,o.iv.buffer).then((function(e){var r=self.performance.now();return i.trigger(l.Events.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:s,tdecrypt:r}}),n.payload=e,n}))}return n})).then((function(n){var i=e.fragCurrent,r=e.hls,o=e.levels;if(!o)throw new Error("init load aborted, missing levels");var s=o[t.level].details;console.assert(s,"Level details are defined when init segment is loaded");var a=t.stats;e.state=C.IDLE,e.fragLoadError=0,t.data=new Uint8Array(n.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),n.frag===i&&r.trigger(l.Events.FRAG_BUFFERED,{stats:a,frag:i,part:null,id:t.type}),e.tick()})).catch((function(n){e.warn(n),e.resetFragmentLoading(t)}))},x.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},x.fragBufferedComplete=function(t,e){var n=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" "+m.default.toString(s.BufferHelper.getBuffered(n))),this.state=C.IDLE,this.tick()},x._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var n=t.frag,i=t.part,r=t.partsLoaded,o=!r||0===r.length||r.some((function(t){return!t})),s=new u.ChunkMetadata(n.level,n.sn,n.stats.chunkCount+1,0,i?i.index:-1,!o);e.flush(s)}},x._handleFragmentLoadProgress=function(t){},x._doFragLoad=function(t,e,n,r){var o=this;if(void 0===n&&(n=null),!this.levels)throw new Error("frag load aborted, missing levels");if(n=Math.max(t.start,n||0),this.config.lowLatencyMode&&e){var s=e.partList;if(s&&r){n>t.end&&e.fragmentHint&&(t=e.fragmentHint);var a=this.getNextPart(s,t,n);if(a>-1){var c=s[a];return this.log("Loading part sn: "+t.sn+" p: "+c.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+a+"-"+(s.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(n.toFixed(3))),this.nextLoadPosition=c.start+c.duration,this.state=C.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:t,part:s[a],targetBufferTime:n}),this.doFragPartsLoad(t,s,a,r).catch((function(t){return o.handleFragLoadError(t)}))}if(!t.url||this.loadedEndOfParts(s,n))return Promise.resolve(null)}}return this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(n.toFixed(3))),Object(i.isFiniteNumber)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=C.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:t,targetBufferTime:n}),this.fragmentLoader.load(t,r).catch((function(t){return o.handleFragLoadError(t)}))},x.doFragPartsLoad=function(t,e,n,i){var r=this;return new Promise((function(o,s){var a=[];!function n(c){var u=e[c];r.fragmentLoader.loadPart(t,u,i).then((function(i){a[u.index]=i;var s=i.part;r.hls.trigger(l.Events.FRAG_LOADED,i);var h=e[c+1];if(!h||h.fragment!==t)return o({frag:t,part:s,partsLoaded:a});n(c+1)})).catch(s)}(n)}))},x.handleFragLoadError=function(t){var e=t.data;return e&&e.details===c.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(l.Events.ERROR,e),null},x._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===C.PARSING){var n=e.frag,i=e.part,r=e.level,o=self.performance.now();n.stats.parsing.end=o,i&&(i.stats.parsing.end=o),this.updateLevelTiming(n,i,r,t.partial)}else this.fragCurrent||(this.state=C.IDLE)},x.getCurrentContext=function(t){var e=this.levels,n=t.level,i=t.sn,r=t.part;if(!e||!e[n])return this.warn("Levels object was unset while buffering fragment "+i+" of level "+n+". The current chunk will not be buffered."),null;var o=e[n],s=r>-1?Object(p.getPartWith)(o,i,r):null,a=s?s.fragment:Object(p.getFragmentWithSN)(o,i,this.fragCurrent);return a?{frag:a,part:s,level:o}:null},x.bufferFragmentData=function(t,e,n,i){if(t&&this.state===C.PARSING){var r=t.data1,o=t.data2,s=r;if(r&&o&&(s=Object(h.appendUint8Array)(r,o)),s&&s.length){var a={type:t.type,frag:e,part:n,chunkMeta:i,parent:e.type,data:s};this.hls.trigger(l.Events.BUFFER_APPENDING,a),t.dropped&&t.independent&&!n&&this.flushBufferGap(e)}}},x.flushBufferGap=function(t){var e=this.media;if(e)if(s.BufferHelper.isBuffered(e,e.currentTime)){var n=e.currentTime,i=s.BufferHelper.bufferInfo(e,n,0),r=t.duration,o=Math.min(2*this.config.maxFragLookUpTolerance,.25*r),a=Math.max(Math.min(t.start-o,i.end-o),n+o);t.start-a>o&&this.flushMainBuffer(a,t.start)}else this.flushMainBuffer(0,t.start)},x.getFwdBufferInfo=function(t,e){var n=this.config,r=this.getLoadPosition();if(!Object(i.isFiniteNumber)(r))return null;var o=s.BufferHelper.bufferInfo(t,r,n.maxBufferHole);if(0===o.len&&void 0!==o.nextStart){var a=this.fragmentTracker.getBufferedFrag(r,e);if(a&&o.nextStart<a.end)return s.BufferHelper.bufferInfo(t,r,Math.max(o.nextStart,n.maxBufferHole))}return o},x.getMaxBufferLength=function(t){var e,n=this.config;return e=t?Math.max(8*n.maxBufferSize/t,n.maxBufferLength):n.maxBufferLength,Math.min(e,n.maxMaxBufferLength)},x.reduceMaxBufferLength=function(t){var e=this.config,n=t||e.maxBufferLength;return e.maxMaxBufferLength>=n&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},x.getNextFragment=function(t,e){var n,i,r=e.fragments,o=r.length;if(!o)return null;var s,a=this.config,l=r[0].start;if(e.live){var c=a.initialLiveManifestSize;if(o<c)return this.warn("Not enough fragments to start playback (have: "+o+", need: "+c+")"),null;e.PTSKnown||this.startFragRequested||-1!==this.startPosition||(s=this.getInitialLiveFragment(e,r),this.startPosition=s?this.hls.liveSyncPosition||s.start:t)}else t<=l&&(s=r[0]);if(!s){var u=a.lowLatencyMode?e.partEnd:e.fragmentEnd;s=this.getFragmentAtPosition(t,u,e)}return null===(n=s)||void 0===n||!n.initSegment||null!==(i=s)&&void 0!==i&&i.initSegment.data||this.bitrateTest||(s=s.initSegment),s},x.getNextPart=function(t,e,n){for(var i=-1,r=!1,o=!0,s=0,a=t.length;s<a;s++){var l=t[s];if(o=o&&!l.independent,i>-1&&n<l.start)break;var c=l.loaded;!c&&(r||l.independent||o)&&l.fragment===e&&(i=s),r=c}return i},x.loadedEndOfParts=function(t,e){var n=t[t.length-1];return n&&e>n.start&&n.loaded},x.getInitialLiveFragment=function(t,e){var n=this.fragPrevious,i=null;if(n){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+n.programDateTime),i=Object(f.findFragmentByPDT)(e,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!i){var r=n.sn+1;if(r>=t.startSN&&r<=t.endSN){var o=e[r-t.startSN];n.cc===o.cc&&(i=o,this.log("Live playlist, switching playlist, load frag with next SN: "+i.sn))}i||(i=Object(f.findFragWithCC)(e,n.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+i.sn)}}else{var s=this.hls.liveSyncPosition;null!==s&&(i=this.getFragmentAtPosition(s,this.bitrateTest?t.fragmentEnd:t.edge,t))}return i},x.getFragmentAtPosition=function(t,e,n){var i,r=this.config,s=this.fragPrevious,a=n.fragments,l=n.endSN,c=n.fragmentHint,u=r.maxFragLookUpTolerance,h=!!(r.lowLatencyMode&&n.partList&&c);if(h&&c&&!this.bitrateTest&&(a=a.concat(c),l=c.sn),t<e){var d=t>e-u?0:u;i=Object(f.findFragmentByPTS)(s,a,t,d)}else i=a[a.length-1];if(i){var p=i.sn-n.startSN,v=s&&i.level===s.level,g=a[p+1];if(this.fragmentTracker.getState(i)===o.FragmentState.BACKTRACKED){i=null;for(var m=p;a[m]&&this.fragmentTracker.getState(a[m])===o.FragmentState.BACKTRACKED;)i=s?a[m--]:a[--m];i||(i=g)}else s&&i.sn===s.sn&&!h&&v&&(i.sn<l&&this.fragmentTracker.getState(g)!==o.FragmentState.OK?(this.log("SN "+i.sn+" just loaded, load next one: "+g.sn),i=g):i=null)}return i},x.synchronizeToLiveEdge=function(t){var e=this.config,n=this.media;if(n){var i=this.hls.liveSyncPosition,r=n.currentTime,o=t.fragments[0].start,s=t.edge,a=r>=o-e.maxFragLookUpTolerance&&r<=s;if(null!==i&&n.duration>i&&(r<i||!a)){var l=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;(!a&&n.readyState<4||r<s-l)&&(this.loadedmetadata||(this.nextLoadPosition=i),n.readyState&&(this.warn("Playback: "+r.toFixed(3)+" is located too far from the end of live sliding playlist: "+s+", reset currentTime to : "+i.toFixed(3)),n.currentTime=i))}}},x.alignPlaylists=function(t,e){var n=this.levels,r=this.levelLastLoaded,o=this.fragPrevious,s=null!==r?n[r]:null,a=t.fragments.length;if(!a)return this.warn("No fragments in live playlist"),0;var l=t.fragments[0].start,c=!e,u=t.alignedSliding&&Object(i.isFiniteNumber)(l);if(c||!u&&!l){Object(d.alignStream)(o,s,t);var h=t.fragments[0].start;return this.log("Live playlist sliding: "+h.toFixed(2)+" start-sn: "+(e?e.startSN:"na")+"->"+t.startSN+" prev-sn: "+(o?o.sn:"na")+" fragments: "+a),h}return l},x.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},x.setStartPosition=function(t,e){var n=this.startPosition;if(n<e&&(n=-1),-1===n||-1===this.lastCurrentTime){var r=t.startTimeOffset;Object(i.isFiniteNumber)(r)?(n=e+r,r<0&&(n+=t.totalduration),n=Math.min(Math.max(e,n),e+t.totalduration),this.log("Start time offset "+r+" found in playlist, adjust startPosition to "+n),this.startPosition=n):t.live?n=this.hls.liveSyncPosition||e:this.startPosition=n=0,this.lastCurrentTime=n}this.nextLoadPosition=n},x.getLoadPosition=function(){var t=this.media,e=0;return this.loadedmetadata&&t?e=t.currentTime:this.nextLoadPosition&&(e=this.nextLoadPosition),e},x.handleFragLoadAborted=function(t,e){this.transmuxer&&"initSegment"!==t.sn&&t.stats.aborted&&(this.warn("Fragment "+t.sn+(e?" part"+e.index:"")+" of level "+t.level+" was aborted"),this.resetFragmentLoading(t))},x.resetFragmentLoading=function(t){this.fragCurrent&&this.fragContextChanged(t)||(this.state=C.IDLE)},x.onFragmentOrKeyLoadError=function(t,e){if(!e.fatal){var n=e.frag;if(n&&n.type===t){var i=this.fragCurrent;console.assert(i&&n.sn===i.sn&&n.level===i.level&&n.urlId===i.urlId,"Frag load error must match current frag to retry");var r=this.config;if(this.fragLoadError+1<=r.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(n.level))return;var o=Math.min(Math.pow(2,this.fragLoadError)*r.fragLoadingRetryDelay,r.fragLoadingMaxRetryTimeout);this.warn("Fragment "+n.sn+" of "+t+" "+n.level+" failed to load, retrying in "+o+"ms"),this.retryDate=self.performance.now()+o,this.fragLoadError++,this.state=C.FRAG_LOADING_WAITING_RETRY}else e.levelRetry?(t===y.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=C.IDLE):(a.logger.error(e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.hls.stopLoad(),this.state=C.ERROR)}}},x.afterBufferFlushed=function(t,e,n){if(t){var i=s.BufferHelper.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,i,n),this.state===C.ENDED&&this.resetLoadingState()}},x.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=C.IDLE},x.resetLiveStartWhenNotLoaded=function(t){if(!this.loadedmetadata){this.startFragRequested=!1;var e=this.levels?this.levels[t].details:null;if(null!=e&&e.live)return this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},x.updateLevelTiming=function(t,e,n,i){var r=this,o=n.details;console.assert(!!o,"level.details must be defined"),Object.keys(t.elementaryStreams).reduce((function(e,s){var a=t.elementaryStreams[s];if(a){var c=a.endPTS-a.startPTS;if(c<=0)return r.warn("Could not parse fragment "+t.sn+" "+s+" duration reliably ("+c+") resetting transmuxer to fallback to playlist timing"),r.resetTransmuxer(),e||!1;var u=i?0:Object(p.updateFragPTSDTS)(o,t,a.startPTS,a.endPTS,a.startDTS,a.endDTS);return r.hls.trigger(l.Events.LEVEL_PTS_UPDATED,{details:o,level:n,drift:u,type:s,frag:t,start:a.startPTS,end:a.endPTS}),!0}return e}),!1)?(this.state=C.PARSED,this.hls.trigger(l.Events.FRAG_PARSED,{frag:t,part:e})):this.resetLoadingState()},x.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S=r,(k=[{key:"state",get:function(){return this._state},set:function(t){var e=this._state;e!==t&&(this._state=t,this.log(e+"->"+t))}}])&&b(S.prototype,k),w&&b(S,w),r}(r.default)},"./src/controller/buffer-controller.ts":
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/controller/buffer-controller.ts ***!
|
|
|
\*********************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return f}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ../errors */"./src/errors.ts"),a=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),l=n(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),c=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),u=n(/*! ./buffer-operation-queue */"./src/controller/buffer-operation-queue.ts"),h=Object(l.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,f=function(){function t(t){var e=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 t=e.hls,n=e.media,i=e.mediaSource;o.logger.log("[buffer-controller]: Media source opened"),n&&(e.updateMediaElementDuration(),t.trigger(r.Events.MEDIA_ATTACHED,{media:n})),i&&i.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){o.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){o.logger.log("[buffer-controller]: Media source ended")},this.hls=t,this._initSourceBuffer(),this.registerListeners()}var e=t.prototype;return e.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},e.destroy=function(){this.unregisterListeners(),this.details=null},e.registerListeners=function(){var t=this.hls;t.on(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(r.Events.BUFFER_RESET,this.onBufferReset,this),t.on(r.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(r.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(r.Events.BUFFER_EOS,this.onBufferEos,this),t.on(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(r.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(r.Events.FRAG_PARSED,this.onFragParsed,this),t.on(r.Events.FRAG_CHANGED,this.onFragChanged,this)},e.unregisterListeners=function(){var t=this.hls;t.off(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(r.Events.BUFFER_RESET,this.onBufferReset,this),t.off(r.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(r.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(r.Events.BUFFER_EOS,this.onBufferEos,this),t.off(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(r.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(r.Events.FRAG_PARSED,this.onFragParsed,this),t.off(r.Events.FRAG_CHANGED,this.onFragChanged,this)},e._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new u.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},e.onManifestParsed=function(t,e){var n=2;(e.audio&&!e.video||!e.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,o.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.onMediaAttaching=function(t,e){var n=this.media=e.media;if(n&&h){var i=this.mediaSource=new h;i.addEventListener("sourceopen",this._onMediaSourceOpen),i.addEventListener("sourceended",this._onMediaSourceEnded),i.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(i),this._objectUrl=n.src}},e.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,n=this._objectUrl;if(e){if(o.logger.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){o.logger.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(n&&self.URL.revokeObjectURL(n),t.src===n?(t.removeAttribute("src"),t.load()):o.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(r.Events.MEDIA_DETACHED,void 0)},e.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach((function(e){var n=t.sourceBuffer[e];try{n&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(n),t.sourceBuffer[e]=void 0)}catch(t){o.logger.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}})),this._initSourceBuffer()},e.onBufferCodecs=function(t,e){var n=this,i=this.getSourceBufferTypes().length;Object.keys(e).forEach((function(t){if(i){var r=n.tracks[t];if(r&&"function"==typeof r.buffer.changeType){var o=e[t],s=o.codec,a=o.levelCodec,l=o.container;if((r.levelCodec||r.codec).replace(d,"$1")!==(a||s).replace(d,"$1")){var c=l+";codecs="+(a||s);n.appendChangeType(t,c)}}}else n.pendingTracks[t]=e[t]})),i||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},e.appendChangeType=function(t,e){var n=this,i=this.operationQueue,r={execute:function(){var r=n.sourceBuffer[t];r&&(o.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),r.changeType(e)),i.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){o.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}};i.append(r,t)},e.onBufferAppending=function(t,e){var n=this,i=this.hls,l=this.operationQueue,c=this.tracks,u=e.data,h=e.type,d=e.frag,f=e.part,p=e.chunkMeta,v=p.buffering[h],g=self.performance.now();v.start=g;var m=d.stats.buffering,y=f?f.stats.buffering:null;0===m.start&&(m.start=g),y&&0===y.start&&(y.start=g);var b=c.audio,E="audio"===h&&1===p.id&&"audio/mpeg"===(null==b?void 0:b.container),C={execute:function(){if(v.executeStart=self.performance.now(),E){var t=n.sourceBuffer[h];if(t){var e=d.start-t.timestampOffset;Math.abs(e)>=.1&&(o.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+e+") sn: "+d.sn+")"),t.timestampOffset=d.start)}}n.appendExecutor(u,h)},onStart:function(){},onComplete:function(){var t=self.performance.now();v.executeEnd=v.end=t,0===m.first&&(m.first=t),y&&0===y.first&&(y.first=t);var e=n.sourceBuffer,i={};for(var o in e)i[o]=a.BufferHelper.getBuffered(e[o]);n.appendError=0,n.hls.trigger(r.Events.BUFFER_APPENDED,{type:h,frag:d,part:f,chunkMeta:p,parent:d.type,timeRanges:i})},onError:function(t){o.logger.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",t);var e={type:s.ErrorTypes.MEDIA_ERROR,parent:d.type,details:s.ErrorDetails.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=s.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,e.details=s.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>i.config.appendErrorMaxRetry&&(o.logger.error("[buffer-controller]: Failed "+i.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0)),i.trigger(r.Events.ERROR,e)}};l.append(C,h)},e.onBufferFlushing=function(t,e){var n=this,i=this.operationQueue,s=function(t){return{execute:n.removeExecutor.bind(n,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(r.Events.BUFFER_FLUSHED,{type:t})},onError:function(e){o.logger.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?i.append(s(e.type),e.type):this.getSourceBufferTypes().forEach((function(t){i.append(s(t),t)}))},e.onFragParsed=function(t,e){var n=this,i=e.frag,s=e.part,a=[],l=s?s.elementaryStreams:i.elementaryStreams;l[c.ElementaryStreamTypes.AUDIOVIDEO]?a.push("audiovideo"):(l[c.ElementaryStreamTypes.AUDIO]&&a.push("audio"),l[c.ElementaryStreamTypes.VIDEO]&&a.push("video")),0===a.length&&o.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+i.type+" level: "+i.level+" sn: "+i.sn),this.blockBuffers((function(){var t=self.performance.now();i.stats.buffering.end=t,s&&(s.stats.buffering.end=t);var e=s?s.stats:i.stats;n.hls.trigger(r.Events.FRAG_BUFFERED,{frag:i,part:s,stats:e,id:i.type})}),a)},e.onFragChanged=function(t,e){this.flushBackBuffer()},e.onBufferEos=function(t,e){var n=this;this.getSourceBufferTypes().reduce((function(t,i){var r=n.sourceBuffer[i];return e.type&&e.type!==i||r&&!r.ended&&(r.ended=!0,o.logger.log("[buffer-controller]: "+i+" sourceBuffer now EOS")),t&&!(r&&!r.ended)}),!0)&&this.blockBuffers((function(){var t=n.mediaSource;t&&"open"===t.readyState&&t.endOfStream()}))},e.onLevelUpdated=function(t,e){var n=e.details;n.fragments.length&&(this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},e.flushBackBuffer=function(){var t=this.hls,e=this.details,n=this.media,o=this.sourceBuffer;if(n&&null!==e){var s=this.getSourceBufferTypes();if(s.length){var l=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if(Object(i.isFiniteNumber)(l)&&!(l<0)){var c=n.currentTime,u=e.levelTargetDuration,h=Math.max(l,u),d=Math.floor(c/u)*u-h;s.forEach((function(n){var i=o[n];if(i){var s=a.BufferHelper.getBuffered(i);s.length>0&&d>s.start(0)&&(t.trigger(r.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),e.live&&t.trigger(r.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),t.trigger(r.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:n}))}}))}}}},e.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,n=this.media,r=this.mediaSource,s=t.fragments[0].start+t.totalduration,a=n.duration,l=Object(i.isFiniteNumber)(r.duration)?r.duration:0;t.live&&e.config.liveDurationInfinity?(o.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),r.duration=1/0,this.updateSeekableRange(t)):(s>l&&s>a||!Object(i.isFiniteNumber)(a))&&(o.logger.log("[buffer-controller]: Updating Media Source duration to "+s.toFixed(3)),r.duration=s)}},e.updateSeekableRange=function(t){var e=this.mediaSource,n=t.fragments;if(n.length&&t.live&&null!=e&&e.setLiveSeekableRange){var i=Math.max(0,n[0].start),r=Math.max(i,i+t.totalduration);e.setLiveSeekableRange(i,r)}},e.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,n=this.pendingTracks,i=Object.keys(n).length;if(i&&!t||2===i){this.createSourceBuffers(n),this.pendingTracks={};var o=this.getSourceBufferTypes();if(0===o.length)return void this.hls.trigger(r.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});o.forEach((function(t){e.executeNext(t)}))}},e.createSourceBuffers=function(t){var e=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var i=0;for(var a in t)if(!e[a]){var l=t[a];if(!l)throw Error("source buffer exists for track "+a+", however track does not");var c=l.levelCodec||l.codec,u=l.container+";codecs="+c;o.logger.log("[buffer-controller]: creating sourceBuffer("+u+")");try{var h=e[a]=n.addSourceBuffer(u),d=a;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[a]={buffer:h,codec:c,container:l.container,levelCodec:l.levelCodec,id:l.id},i++}catch(t){o.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(r.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:u})}}i&&this.hls.trigger(r.Events.BUFFER_CREATED,{tracks:this.tracks})},e._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},e._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},e._onSBUpdateError=function(t,e){o.logger.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(r.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(t);n&&n.onError(e)},e.removeExecutor=function(t,e,n){var r=this.media,s=this.mediaSource,a=this.operationQueue,l=this.sourceBuffer[t];if(!r||!s||!l)return o.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void a.shiftAndExecuteNext(t);var c=Object(i.isFiniteNumber)(r.duration)?r.duration:1/0,u=Object(i.isFiniteNumber)(s.duration)?s.duration:1/0,h=Math.max(0,e),d=Math.min(n,c,u);d>h?(o.logger.log("[buffer-controller]: Removing ["+h+","+d+"] from the "+t+" SourceBuffer"),console.assert(!l.updating,t+" sourceBuffer must not be updating"),l.remove(h,d)):a.shiftAndExecuteNext(t)},e.appendExecutor=function(t,e){var n=this.operationQueue,i=this.sourceBuffer[e];if(!i)return o.logger.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),void n.shiftAndExecuteNext(e);i.ended=!1,console.assert(!i.updating,e+" sourceBuffer must not be updating"),i.appendBuffer(t)},e.blockBuffers=function(t,e){var n=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return o.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(t);var i=this.operationQueue,r=e.map((function(t){return i.appendBlocker(t)}));Promise.all(r).then((function(){t(),e.forEach((function(t){var e=n.sourceBuffer[t];e&&e.updating||i.shiftAndExecuteNext(t)}))}))},e.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},e.addBufferListener=function(t,e,n){var i=this.sourceBuffer[t];if(i){var r=n.bind(this,t);this.listeners[t].push({event:e,listener:r}),i.addEventListener(e,r)}},e.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach((function(t){e.removeEventListener(t.event,t.listener)}))},t}()},"./src/controller/buffer-operation-queue.ts":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/controller/buffer-operation-queue.ts ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return r}));var i=n(/*! ../utils/logger */"./src/utils/logger.ts"),r=function(){function t(t){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}var e=t.prototype;return e.append=function(t,e){var n=this.queues[e];n.push(t),1===n.length&&this.buffers[e]&&this.executeNext(e)},e.insertAbort=function(t,e){this.queues[e].unshift(t),this.executeNext(e)},e.appendBlocker=function(t){var e,n=new Promise((function(t){e=t})),i={execute:e,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(i,t),n},e.executeNext=function(t){var e=this.buffers,n=this.queues,r=e[t],o=n[t];if(o.length){var s=o[0];try{s.execute()}catch(e){i.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),s.onError(e),r&&r.updating||(o.shift(),this.executeNext(t))}}},e.shiftAndExecuteNext=function(t){this.queues[t].shift(),this.executeNext(t)},e.current=function(t){return this.queues[t][0]},t}()},"./src/controller/cap-level-controller.ts":
|
|
|
/*!************************************************!*\
|
|
|
!*** ./src/controller/cap-level-controller.ts ***!
|
|
|
\************************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../events */"./src/events.ts");function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(){function t(t){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=t,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,o,s=t.prototype;return s.setStreamController=function(t){this.streamController=t},s.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},s.registerListeners=function(){var t=this.hls;t.on(i.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},s.unregisterListener=function(){var t=this.hls;t.off(i.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},s.onFpsDropLevelCapping=function(e,n){t.isLevelAllowed(n.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(n.droppedLevel)},s.onMediaAttaching=function(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null},s.onManifestParsed=function(t,e){var n=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,n.config.capLevelToPlayerSize&&e.video&&this.startCapping()},s.onBufferCodecs=function(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()},s.onMediaDetaching=function(){this.stopCapping()},s.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},s.getMaxLevel=function(e){var n=this,i=this.hls.levels;if(!i.length)return-1;var r=i.filter((function(i,r){return t.isLevelAllowed(r,n.restrictedLevels)&&r<=e}));return this.clientRect=null,t.getMaxLevelByMediaSize(r,this.mediaWidth,this.mediaHeight)},s.startCapping=function(){this.timer||(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())},s.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},s.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var n=t.getBoundingClientRect();e.width=n.width,e.height=n.height,e.width||e.height||(e.width=n.right-n.left||t.width||0,e.height=n.bottom-n.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,n){if(!t||!t.length)return-1;for(var i,r,o=t.length-1,s=0;s<t.length;s+=1){var a=t[s];if((a.width>=e||a.height>=n)&&(i=a,!(r=t[s+1])||i.width!==r.width||i.height!==r.height)){o=s;break}}return o},e=t,o=[{key:"contentScaleFactor",get:function(){var t=1;try{t=self.devicePixelRatio}catch(t){}return t}}],(n=[{key:"mediaWidth",get:function(){return this.getDimensions().width*t.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*t.contentScaleFactor}}])&&r(e.prototype,n),o&&r(e,o),t}();e.default=o},"./src/controller/cmcd-controller.ts":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/controller/cmcd-controller.ts ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return d}));var i=n(/*! ../events */"./src/events.ts"),r=n(/*! ../types/cmcd */"./src/types/cmcd.ts"),o=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),s=n(/*! ../utils/logger */"./src/utils/logger.ts");function a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function l(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}function c(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var d=function(){function t(e){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(t){try{n.apply(t,{ot:r.CMCDObjectType.MANIFEST,su:!n.initialized})}catch(t){s.logger.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=function(t){try{var e=t.frag,i=n.hls.levels[e.level],o=n.getObjectType(e),a={d:1e3*e.duration,ot:o};o!==r.CMCDObjectType.VIDEO&&o!==r.CMCDObjectType.AUDIO&&o!=r.CMCDObjectType.MUXED||(a.br=i.bitrate/1e3,a.tb=n.getTopBandwidth(o),a.bl=n.getBufferLength(o)),n.apply(t,a)}catch(t){s.logger.warn("Could not generate segment CMCD data.",t)}},this.hls=e;var i=this.config=e.config,o=i.cmcd;null!=o&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=o.sessionId||t.uuid(),this.cid=o.contentId,this.useHeaders=!0===o.useHeaders,this.registerListeners())}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(i.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(i.Events.BUFFER_CREATED,this.onBufferCreated,this)},e.unregisterListeners=function(){var t=this.hls;t.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(i.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(i.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},e.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},e.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},e.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},e.onBufferCreated=function(t,e){var n,i;this.audioBuffer=null===(n=e.tracks.audio)||void 0===n?void 0:n.buffer,this.videoBuffer=null===(i=e.tracks.video)||void 0===i?void 0:i.buffer},e.createData=function(){var t;return{v:r.CMCDVersion,sf:r.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:null===(t=this.media)||void 0===t?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},e.apply=function(e,n){void 0===n&&(n={}),h(n,this.createData());var i=n.ot===r.CMCDObjectType.INIT||n.ot===r.CMCDObjectType.VIDEO||n.ot===r.CMCDObjectType.MUXED;if(this.starved&&i&&(n.bs=!0,n.su=!0,this.starved=!1),null==n.su&&(n.su=this.buffering),this.useHeaders){var o=t.toHeaders(n);if(!Object.keys(o).length)return;e.headers||(e.headers={}),h(e.headers,o)}else{var s=t.toQuery(n);if(!s)return;e.url=t.appendQueryToUri(e.url,s)}},e.getObjectType=function(t){var e=t.type;return"subtitle"===e?r.CMCDObjectType.TIMED_TEXT:"initSegment"===t.sn?r.CMCDObjectType.INIT:"audio"===e?r.CMCDObjectType.AUDIO:"main"===e?this.hls.audioTracks.length?r.CMCDObjectType.VIDEO:r.CMCDObjectType.MUXED:void 0},e.getTopBandwidth=function(t){for(var e,n=0,i=c(t===r.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels);!(e=i()).done;){var o=e.value;o.bitrate>n&&(n=o.bitrate)}return n>0?n:NaN},e.getBufferLength=function(t){var e=this.hls.media,n=t===r.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return n&&e?1e3*o.BufferHelper.bufferInfo(n,e.currentTime,this.config.maxBufferHole).len:NaN},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,n=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new n(t)}var i=t.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(t,n,i){e(t),this.loader.load(t,n,i)},l(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,n=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new n(t)}var i=t.prototype;return i.destroy=function(){this.loader.destroy()},i.abort=function(){this.loader.abort()},i.load=function(t,n,i){e(t),this.loader.load(t,n,i)},l(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.substr(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,n=[],i=function(t){return!Number.isNaN(t)&&null!=t&&""!==t&&!1!==t},r=function(t){return Math.round(t)},o=function(t){return 100*r(t/100)},s={br:r,d:r,bl:o,dl:o,mtp:o,nor:function(t){return encodeURIComponent(t)},rtp:o,tb:r},a=c(Object.keys(t||{}).sort());!(e=a()).done;){var l=e.value,u=t[l];if(i(u)&&!("v"===l&&1===u||"pr"==l&&1===u)){var h=s[l];h&&(u=h(u));var d=typeof u,f=void 0;f="ot"===l||"sf"===l||"st"===l?l+"="+u:"boolean"===d?l:"number"===d?l+"="+u:l+"="+JSON.stringify(u),n.push(f)}}return n.join(",")},t.toHeaders=function(e){for(var n={},i=["Object","Request","Session","Status"],r=[{},{},{},{}],o={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},s=0,a=Object.keys(e);s<a.length;s++){var l=a[s];r[null!=o[l]?o[l]:1][l]=e[l]}for(var c=0;c<r.length;c++){var u=t.serialize(r[c]);u&&(n["CMCD-"+i[c]]=u)}return n},t.toQuery=function(e){return"CMCD="+encodeURIComponent(t.serialize(e))},t.appendQueryToUri=function(t,e){if(!e)return t;var n=t.includes("?")?"&":"?";return""+t+n+e},t}()},"./src/controller/eme-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/eme-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../events */"./src/events.ts"),r=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ../utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts");function a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var l=function(){function t(t){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=t,this._config=t.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 e,n,l,c=t.prototype;return c.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},c._registerListeners=function(){this.hls.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(i.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c._unregisterListeners=function(){this.hls.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(i.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c.getLicenseServerUrl=function(t){switch(t){case s.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+t+'"')},c._attemptKeySystemAccess=function(t,e,n){var i=this,r=function(t,e,n,i){switch(t){case s.KeySystems.WIDEVINE:return function(t,e,n){var i={audioCapabilities:[],videoCapabilities:[]};return t.forEach((function(t){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+t+'"',robustness:n.audioRobustness||""})})),e.forEach((function(t){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+t+'"',robustness:n.videoRobustness||""})})),[i]}(e,n,i);default:throw new Error("Unknown key-system: "+t)}}(t,e,n,this._drmSystemOptions);o.logger.log("Requesting encrypted media key-system access");var a=this.requestMediaKeySystemAccess(t,r);this.mediaKeysPromise=a.then((function(e){return i._onMediaKeySystemAccessObtained(t,e)})),a.catch((function(e){o.logger.error('Failed to obtain key-system "'+t+'" access:',e)}))},c._onMediaKeySystemAccessObtained=function(t,e){var n=this;o.logger.log('Access for key-system "'+t+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:e,mediaKeySystemDomain:t};this._mediaKeysList.push(i);var r=Promise.resolve().then((function(){return e.createMediaKeys()})).then((function(e){return i.mediaKeys=e,o.logger.log('Media-keys created for key-system "'+t+'"'),n._onMediaKeysCreated(),e}));return r.catch((function(t){o.logger.error("Failed to create media-keys:",t)})),r},c._onMediaKeysCreated=function(){var t=this;this._mediaKeysList.forEach((function(e){e.mediaKeysSession||(e.mediaKeysSession=e.mediaKeys.createSession(),t._onNewMediaKeySession(e.mediaKeysSession))}))},c._onNewMediaKeySession=function(t){var e=this;o.logger.log("New key-system session "+t.sessionId),t.addEventListener("message",(function(n){e._onKeySessionMessage(t,n.message)}),!1)},c._onKeySessionMessage=function(t,e){o.logger.log("Got EME message event, creating license request"),this._requestLicense(e,(function(e){o.logger.log("Received license data (length: "+(e?e.byteLength:e)+"), updating key-session"),t.update(e)}))},c.onMediaEncrypted=function(t){var e=this;if(o.logger.log('Media is encrypted using "'+t.initDataType+'" init data type'),!this.mediaKeysPromise)return o.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),void this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.KEY_SYSTEM_ERROR,details:r.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});var n=function(n){e._media&&(e._attemptSetMediaKeys(n),e._generateRequestWithPreferredKeySession(t.initDataType,t.initData))};this.mediaKeysPromise.then(n).catch(n)},c._attemptSetMediaKeys=function(t){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var e=this._mediaKeysList[0];if(!e||!e.mediaKeys)return o.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.KEY_SYSTEM_ERROR,details:r.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});o.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(e.mediaKeys),this._hasSetMediaKeys=!0}},c._generateRequestWithPreferredKeySession=function(t,e){var n=this,s=this._mediaKeysList[0];if(!s)return o.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.KEY_SYSTEM_ERROR,details:r.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(s.mediaKeysSessionInitialized)o.logger.warn("Key-Session already initialized but requested again");else{var a=s.mediaKeysSession;if(!a)return o.logger.error("Fatal: Media is encrypted but no key-session existing"),void this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.KEY_SYSTEM_ERROR,details:r.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});if(!e)return o.logger.warn("Fatal: initData required for generating a key session is null"),void this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.KEY_SYSTEM_ERROR,details:r.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});o.logger.log('Generating key-session request for "'+t+'" init data type'),s.mediaKeysSessionInitialized=!0,a.generateRequest(t,e).then((function(){o.logger.debug("Key-session generation succeeded")})).catch((function(t){o.logger.error("Error generating key-session request:",t),n.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.KEY_SYSTEM_ERROR,details:r.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})}))}},c._createLicenseXhr=function(t,e,n){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,t,e,n);var r=this._licenseXhrSetup;if(r)try{r.call(this.hls,i,t),r=void 0}catch(t){o.logger.error(t)}try{i.readyState||i.open("POST",t,!0),r&&r.call(this.hls,i,t)}catch(t){throw new Error("issue setting up KeySystem license XHR "+t)}return i},c._onLicenseRequestReadyStageChange=function(t,e,n,s){switch(t.readyState){case 4:if(200===t.status){this._requestLicenseFailureCount=0,o.logger.log("License request succeeded");var a=t.response,l=this._licenseResponseCallback;if(l)try{a=l.call(this.hls,t,e)}catch(t){o.logger.error(t)}s(a)}else{if(o.logger.error("License Request XHR failed ("+e+"). Status: "+t.status+" ("+t.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>3)return void this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.KEY_SYSTEM_ERROR,details:r.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var c=3-this._requestLicenseFailureCount+1;o.logger.warn("Retrying license request, "+c+" attempts left"),this._requestLicense(n,s)}}},c._generateLicenseRequestChallenge=function(t,e){switch(t.mediaKeySystemDomain){case s.KeySystems.WIDEVINE:return e}throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},c._requestLicense=function(t,e){o.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n)return o.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.KEY_SYSTEM_ERROR,details:r.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var s=this.getLicenseServerUrl(n.mediaKeySystemDomain),a=this._createLicenseXhr(s,t,e);o.logger.log("Sending license request to URL: "+s);var l=this._generateLicenseRequestChallenge(n,t);a.send(l)}catch(t){o.logger.error("Failure requesting DRM license: "+t),this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.KEY_SYSTEM_ERROR,details:r.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},c.onMediaAttached=function(t,e){if(this._emeEnabled){var n=e.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)}},c.onMediaDetached=function(){var t=this._media,e=this._mediaKeysList;t&&(t.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map((function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch((function(){}))}))).then((function(){return t.setMediaKeys(null)})).catch((function(){})))},c.onManifestParsed=function(t,e){if(this._emeEnabled){var n=e.levels.map((function(t){return t.audioCodec})).filter((function(t){return!!t})),i=e.levels.map((function(t){return t.videoCodec})).filter((function(t){return!!t}));this._attemptKeySystemAccess(s.KeySystems.WIDEVINE,n,i)}},e=t,(n=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&a(e.prototype,n),l&&a(e,l),t}();e.default=l},"./src/controller/fps-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/fps-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../events */"./src/events.ts"),r=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=function(){function t(t){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=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var n=this.hls.config;if(n.capLevelOnFPSDrop){var i=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=i,i&&"function"==typeof i.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}},e.checkFPS=function(t,e,n){var o=performance.now();if(e){if(this.lastTime){var s=o-this.lastTime,a=n-this.lastDroppedFrames,l=e-this.lastDecodedFrames,c=1e3*a/s,u=this.hls;if(u.trigger(i.Events.FPS_DROP,{currentDropped:a,currentDecoded:l,totalDroppedFrames:n}),c>0&&a>u.config.fpsDroppedMonitoringThreshold*l){var h=u.currentLevel;r.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(-1===u.autoLevelCapping||u.autoLevelCapping>=h)&&(h-=1,u.trigger(i.Events.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:u.currentLevel}),u.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=n,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}();e.default=o},"./src/controller/fragment-finders.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/controller/fragment-finders.ts ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: findFragmentByPDT, findFragmentByPTS, fragmentWithinToleranceTest, pdtWithinToleranceTest, findFragWithCC */function(t,e,n){"use strict";n.r(e),n.d(e,"findFragmentByPDT",(function(){return o})),n.d(e,"findFragmentByPTS",(function(){return s})),n.d(e,"fragmentWithinToleranceTest",(function(){return a})),n.d(e,"pdtWithinToleranceTest",(function(){return l})),n.d(e,"findFragWithCC",(function(){return c}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../utils/binary-search */"./src/utils/binary-search.ts");function o(t,e,n){if(null===e||!Array.isArray(t)||!t.length||!Object(i.isFiniteNumber)(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;n=n||0;for(var r=0;r<t.length;++r){var o=t[r];if(l(e,n,o))return o}return null}function s(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0);var o=null;if(t?o=e[t.sn-e[0].sn+1]||null:0===n&&0===e[0].start&&(o=e[0]),o&&0===a(n,i,o))return o;var s=r.default.search(e,a.bind(null,n,i));return s||o}function a(t,e,n){void 0===t&&(t=0),void 0===e&&(e=0);var i=Math.min(e,n.duration+(n.deltaPTS?n.deltaPTS:0));return n.start+n.duration-i<=t?1:n.start-i>t&&n.start?-1:0}function l(t,e,n){var i=1e3*Math.min(e,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-i>t}function c(t,e){return r.default.search(t,(function(t){return t.cc<e?1:t.cc>e?-1:0}))}},"./src/controller/fragment-tracker.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/controller/fragment-tracker.ts ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: FragmentState, FragmentTracker */function(t,e,n){"use strict";n.r(e),n.d(e,"FragmentState",(function(){return i})),n.d(e,"FragmentTracker",(function(){return s}));var i,r=n(/*! ../events */"./src/events.ts"),o=n(/*! ../types/loader */"./src/types/loader.ts");!function(t){t.NOT_LOADED="NOT_LOADED",t.BACKTRACKED="BACKTRACKED",t.APPENDING="APPENDING",t.PARTIAL="PARTIAL",t.OK="OK"}(i||(i={}));var s=function(){function t(t){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=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(r.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.on(r.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(r.Events.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(r.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.off(r.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(r.Events.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},e.getAppendedFrag=function(t,e){if(e===o.PlaylistLevelType.MAIN){var n=this.activeFragment,i=this.activeParts;if(!n)return null;if(i)for(var r=i.length;r--;){var s=i[r],a=s?s.end:n.appendedPTS;if(s.start<=t&&void 0!==a&&t<=a)return r>9&&(this.activeParts=i.slice(r-9)),s}else if(n.start<=t&&void 0!==n.appendedPTS&&t<=n.appendedPTS)return n}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var n=this.fragments,i=Object.keys(n),r=i.length;r--;){var o=n[i[r]];if((null==o?void 0:o.body.type)===e&&o.buffered){var s=o.body;if(s.start<=t&&t<=s.end)return s}}return null},e.detectEvictedFragments=function(t,e,n){var i=this;Object.keys(this.fragments).forEach((function(r){var o=i.fragments[r];if(o)if(o.buffered){var s=o.range[t];s&&s.time.some((function(t){var n=!i.isTimeBuffered(t.startPTS,t.endPTS,e);return n&&i.removeFragment(o.body),n}))}else o.body.type===n&&i.removeFragment(o.body)}))},e.detectPartialFragments=function(t){var e=this,n=this.timeRanges,i=t.frag,r=t.part;if(n&&"initSegment"!==i.sn){var o=l(i),s=this.fragments[o];s&&(Object.keys(n).forEach((function(t){var o=i.elementaryStreams[t];if(o){var a=n[t],l=null!==r||!0===o.partial;s.range[t]=e.getBufferedTimes(i,r,l,a)}})),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body))}},e.fragBuffered=function(t){var e=l(t),n=this.fragments[e];n&&(n.backtrack=n.loaded=null,n.buffered=!0)},e.getBufferedTimes=function(t,e,n,i){for(var r={time:[],partial:n},o=e?e.start:t.start,s=e?e.end:t.end,a=t.minEndPTS||s,l=t.maxStartPTS||o,c=0;c<i.length;c++){var u=i.start(c)-this.bufferPadding,h=i.end(c)+this.bufferPadding;if(l>=u&&a<=h){r.time.push({startPTS:Math.max(o,i.start(c)),endPTS:Math.min(s,i.end(c))});break}if(o<h&&s>u)r.partial=!0,r.time.push({startPTS:Math.max(o,i.start(c)),endPTS:Math.min(s,i.end(c))});else if(s<=u)break}return r},e.getPartialFragment=function(t){var e,n,i,r=null,o=0,s=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach((function(c){var u=l[c];u&&a(u)&&(n=u.body.start-s,i=u.body.end+s,t>=n&&t<=i&&(e=Math.min(t-n,i-t),o<=e&&(r=u.body,o=e)))})),r},e.getState=function(t){var e=l(t),n=this.fragments[e];return n?n.buffered?a(n)?i.PARTIAL:i.OK:n.backtrack?i.BACKTRACKED:i.APPENDING:i.NOT_LOADED},e.backtrack=function(t,e){var n=l(t),i=this.fragments[n];if(!i||i.backtrack)return null;var r=i.backtrack=e||i.loaded;return i.loaded=null,r},e.getBacktrackData=function(t){var e=l(t),n=this.fragments[e];if(n){var i,r=n.backtrack;if(null!=r&&null!==(i=r.payload)&&void 0!==i&&i.byteLength)return r;this.removeFragment(t)}return null},e.isTimeBuffered=function(t,e,n){for(var i,r,o=0;o<n.length;o++){if(i=n.start(o)-this.bufferPadding,r=n.end(o)+this.bufferPadding,t>=i&&e<=r)return!0;if(e<=i)return!1}return!1},e.onFragLoaded=function(t,e){var n=e.frag,i=e.part;if("initSegment"!==n.sn&&!n.bitrateTest&&!i){var r=l(n);this.fragments[r]={body:n,loaded:e,backtrack:null,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var n=this,i=e.frag,r=e.part,s=e.timeRanges;if(i.type===o.PlaylistLevelType.MAIN)if(this.activeFragment=i,r){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(r)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach((function(t){var e=s[t];if(n.detectEvictedFragments(t,e),!r)for(var o=0;o<e.length;o++)i.appendedPTS=Math.max(e.end(o),i.appendedPTS||0)}))},e.onFragBuffered=function(t,e){this.detectPartialFragments(e)},e.hasFragment=function(t){var e=l(t);return!!this.fragments[e]},e.removeFragmentsInRange=function(t,e,n){var i=this;Object.keys(this.fragments).forEach((function(r){var o=i.fragments[r];if(o&&o.buffered){var s=o.body;s.type===n&&s.start<e&&s.end>t&&i.removeFragment(s)}}))},e.removeFragment=function(t){var e=l(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[e]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function a(t){var e,n;return t.buffered&&((null===(e=t.range.video)||void 0===e?void 0:e.partial)||(null===(n=t.range.audio)||void 0===n?void 0:n.partial))}function l(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}},"./src/controller/gap-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/gap-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: STALL_MINIMUM_DURATION_MS, MAX_START_GAP_JUMP, SKIP_BUFFER_HOLE_STEP_SECONDS, SKIP_BUFFER_RANGE_START, default */function(t,e,n){"use strict";n.r(e),n.d(e,"STALL_MINIMUM_DURATION_MS",(function(){return a})),n.d(e,"MAX_START_GAP_JUMP",(function(){return l})),n.d(e,"SKIP_BUFFER_HOLE_STEP_SECONDS",(function(){return c})),n.d(e,"SKIP_BUFFER_RANGE_START",(function(){return u})),n.d(e,"default",(function(){return h}));var i=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),r=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../events */"./src/events.ts"),s=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=250,l=2,c=.1,u=.05,h=function(){function t(t,e,n,i){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=t,this.media=e,this.fragmentTracker=n,this.hls=i}var e=t.prototype;return e.destroy=function(){this.hls=this.fragmentTracker=this.media=null},e.poll=function(t){var e=this.config,n=this.media,r=this.stalled,o=n.currentTime,c=n.seeking,u=this.seeking&&!c,h=!this.seeking&&c;if(this.seeking=c,o===t){if((h||u)&&(this.stalled=null),!n.paused&&!n.ended&&0!==n.playbackRate&&i.BufferHelper.getBuffered(n).length){var d=i.BufferHelper.bufferInfo(n,o,0),f=d.len>0,p=d.nextStart||0;if(f||p){if(c){var v=d.len>l,g=!p||p-o>l&&!this.fragmentTracker.getPartialFragment(o);if(v||g)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var m,y=Math.max(p,d.start||0)-o,b=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,E=(null==b||null===(m=b.details)||void 0===m?void 0:m.live)?2*b.details.targetduration:l;if(y>0&&y<=E)return void this._trySkipBufferHole(null)}var C=self.performance.now();if(null!==r){var S=C-r;!c&&S>=a&&this._reportStall(d.len);var k=i.BufferHelper.bufferInfo(n,o,e.maxBufferHole);this._tryFixBufferStall(k,S)}else this.stalled=C}}}else if(this.moved=!0,null!==r){if(this.stallReported){var w=self.performance.now()-r;s.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},e._tryFixBufferStall=function(t,e){var n=this.config,i=this.fragmentTracker,r=this.media.currentTime,o=i.getPartialFragment(r);o&&this._trySkipBufferHole(o)||t.len>n.maxBufferHole&&e>1e3*n.highBufferWatchdogPeriod&&(s.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},e._reportStall=function(t){var e=this.hls,n=this.media;this.stallReported||(this.stallReported=!0,s.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+t+")"),e.trigger(o.Events.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},e._trySkipBufferHole=function(t){for(var e=this.config,n=this.hls,a=this.media,l=a.currentTime,h=0,d=i.BufferHelper.getBuffered(a),f=0;f<d.length;f++){var p=d.start(f);if(l+e.maxBufferHole>=h&&l<p){var v=Math.max(p+u,a.currentTime+c);return s.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+v),this.moved=!0,this.stalled=null,a.currentTime=v,t&&n.trigger(o.Events.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+v,frag:t}),v}h=d.end(f)}return 0},e._tryNudgeBuffer=function(){var t=this.config,e=this.hls,n=this.media,i=n.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<t.nudgeMaxRetry){var l=i+a*t.nudgeOffset;s.logger.warn("Nudging 'currentTime' from "+i+" to "+l),n.currentTime=l,e.trigger(o.Events.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else s.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+t.nudgeMaxRetry+" nudges"),e.trigger(o.Events.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},t}()},"./src/controller/id3-track-controller.ts":
|
|
|
/*!************************************************!*\
|
|
|
!*** ./src/controller/id3-track-controller.ts ***!
|
|
|
\************************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../events */"./src/events.ts"),r=n(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),o=n(/*! ../demux/id3 */"./src/demux/id3.ts"),s=function(){function t(t){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e.destroy=function(){this._unregisterListeners()},e._registerListeners=function(){var t=this.hls;t.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(i.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},e._unregisterListeners=function(){var t=this.hls;t.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(i.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},e.onMediaAttached=function(t,e){this.media=e.media},e.onMediaDetaching=function(){this.id3Track&&(Object(r.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null)},e.getID3Track=function(t){if(this.media){for(var e=0;e<t.length;e++){var n=t[e];if("metadata"===n.kind&&"id3"===n.label)return Object(r.sendAddTrackEvent)(n,this.media),n}return this.media.addTextTrack("metadata","id3")}},e.onFragParsingMetadata=function(t,e){if(this.media){var n=e.frag,i=e.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var r=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<i.length;s++){var a=o.getID3Frames(i[s].data);if(a){var l=i[s].pts,c=s<i.length-1?i[s+1].pts:n.end;c-l<=0&&(c=l+.25);for(var u=0;u<a.length;u++){var h=a[u];if(!o.isTimeStampFrame(h)){var d=new r(l,c,"");d.value=h,this.id3Track.addCue(d)}}}}}},e.onBufferFlushing=function(t,e){var n=e.startOffset,i=e.endOffset,o=e.type;if(!o||"audio"===o){var s=this.id3Track;s&&Object(r.removeCuesInRange)(s,n,i)}},t}();e.default=s},"./src/controller/latency-controller.ts":
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./src/controller/latency-controller.ts ***!
|
|
|
\**********************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return a}));var i=n(/*! ../errors */"./src/errors.ts"),r=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts");function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var a=function(){function t(t){var e=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 e.timeupdate()},this.hls=t,this.config=t.config,this.registerListeners()}var e,n,a,l=t.prototype;return l.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},l.registerListeners=function(){this.hls.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(r.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(r.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){this.hls.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(r.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(r.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(r.Events.ERROR,this.onError)},l.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},l.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},l.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},l.onLevelUpdated=function(t,e){var n=e.details;this.levelDetails=n,n.advanced&&this.timeupdate(),!n.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},l.onError=function(t,e){e.details===i.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,o.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},l.timeupdate=function(){var t=this.media,e=this.levelDetails;if(t&&e){this.currentTime=t.currentTime;var n=this.computeLatency();if(null!==n){this._latency=n;var i=this.config,r=i.lowLatencyMode,o=i.maxLiveSyncPlaybackRate;if(r&&1!==o){var s=this.targetLatency;if(null!==s){var a=n-s,l=a<Math.min(this.maxLatency,s+e.targetduration);if(e.live&&l&&a>.05&&this.forwardBufferLength>1){var c=Math.min(2,Math.max(1,o)),u=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;t.playbackRate=Math.min(c,Math.max(1,u))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},l.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},l.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=t,(n=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,n=t.partHoldBack,i=t.targetduration,r=this.config,o=r.liveSyncDuration,s=r.liveSyncDurationCount,a=r.lowLatencyMode,l=this.hls.userConfig,c=a&&n||e;(l.liveSyncDuration||l.liveSyncDurationCount||0===c)&&(c=void 0!==o?o:s*i);var u=i;return c+Math.min(1*this.stallCount,u)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,n=this.levelDetails;if(null===t||null===e||null===n)return null;var i=n.edge,r=t-e-this.edgeStalled,o=i-n.totalduration,s=i-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(o,r),s)}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var n=t.buffered.length;return n?t.buffered.end(n-1):e.edge-this.currentTime}}])&&s(e.prototype,n),a&&s(e,a),t}()},"./src/controller/level-controller.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/controller/level-controller.ts ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return p}));var i=n(/*! ../types/level */"./src/types/level.ts"),r=n(/*! ../events */"./src/events.ts"),o=n(/*! ../errors */"./src/errors.ts"),s=n(/*! ../utils/codecs */"./src/utils/codecs.ts"),a=n(/*! ./level-helper */"./src/controller/level-helper.ts"),l=n(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts");function u(){return(u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function h(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),p=function(t){var e,n;function l(e){var n;return(n=t.call(this,e,"[level-controller]")||this)._levels=[],n._firstLevel=-1,n._startLevel=void 0,n.currentLevelIndex=-1,n.manualLevelIndex=-1,n.onParsedComplete=void 0,n._registerListeners(),n}n=t,(e=l).prototype=Object.create(n.prototype),e.prototype.constructor=e,d(e,n);var p,v,g,m=l.prototype;return m._registerListeners=function(){var t=this.hls;t.on(r.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(r.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(r.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(r.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(r.Events.ERROR,this.onError,this)},m._unregisterListeners=function(){var t=this.hls;t.off(r.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(r.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(r.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(r.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(r.Events.ERROR,this.onError,this)},m.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},m.startLoad=function(){this._levels.forEach((function(t){t.loadError=0})),t.prototype.startLoad.call(this)},m.onManifestLoaded=function(t,e){var n,l,c=[],u=[],h=[],d={},p=!1,v=!1,g=!1;if(e.levels.forEach((function(t){var e=t.attrs;p=p||!(!t.width||!t.height),v=v||!!t.videoCodec,g=g||!!t.audioCodec,f&&t.audioCodec&&-1!==t.audioCodec.indexOf("mp4a.40.34")&&(t.audioCodec=void 0);var n=t.bitrate+"-"+t.attrs.RESOLUTION+"-"+t.attrs.CODECS;(l=d[n])?l.url.push(t.url):(l=new i.Level(t),d[n]=l,c.push(l)),e&&(e.AUDIO&&Object(a.addGroupId)(l,"audio",e.AUDIO),e.SUBTITLES&&Object(a.addGroupId)(l,"text",e.SUBTITLES))})),(p||v)&&g&&(c=c.filter((function(t){var e=t.videoCodec,n=t.width,i=t.height;return!!e||!(!n||!i)}))),c=c.filter((function(t){var e=t.audioCodec,n=t.videoCodec;return(!e||Object(s.isCodecSupportedInMp4)(e,"audio"))&&(!n||Object(s.isCodecSupportedInMp4)(n,"video"))})),e.audioTracks&&(u=e.audioTracks.filter((function(t){return!t.audioCodec||Object(s.isCodecSupportedInMp4)(t.audioCodec,"audio")})),Object(a.assignTrackIdsByGroup)(u)),e.subtitles&&(h=e.subtitles,Object(a.assignTrackIdsByGroup)(h)),c.length>0){n=c[0].bitrate,c.sort((function(t,e){return t.bitrate-e.bitrate})),this._levels=c;for(var m=0;m<c.length;m++)if(c[m].bitrate===n){this._firstLevel=m,this.log("manifest loaded, "+c.length+" level(s) found, first bitrate: "+n);break}var y=g&&!v,b={levels:c,audioTracks:u,subtitleTracks:h,firstLevel:this._firstLevel,stats:e.stats,audio:g,video:v,altAudio:!y&&u.some((function(t){return!!t.url}))};this.hls.trigger(r.Events.MANIFEST_PARSED,b),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(r.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,reason:"no level with compatible codecs found in manifest"})},m.onError=function(e,n){if(t.prototype.onError.call(this,e,n),!n.fatal){var i=n.context,r=this._levels[this.currentLevelIndex];if(i&&(i.type===c.PlaylistContextType.AUDIO_TRACK&&r.audioGroupIds&&i.groupId===r.audioGroupIds[r.urlId]||i.type===c.PlaylistContextType.SUBTITLE_TRACK&&r.textGroupIds&&i.groupId===r.textGroupIds[r.urlId]))this.redundantFailover(this.currentLevelIndex);else{var s,a=!1,l=!0;switch(n.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:if(n.frag){var u=this._levels[n.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(s=n.frag.level)):s=n.frag.level}break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:i&&(i.deliveryDirectives&&(l=!1),s=i.level),a=!0;break;case o.ErrorDetails.REMUX_ALLOC_ERROR:s=n.level,a=!0}void 0!==s&&this.recoverLevel(n,s,a,l)}}},m.recoverLevel=function(t,e,n,i){var r=t.details,o=this._levels[e];if(o.loadError++,n){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(i){var s=o.url.length;if(s>1&&o.loadError<s)t.levelRetry=!0,this.redundantFailover(e);else if(-1===this.manualLevelIndex){var a=0===e?this._levels.length-1:e-1;this.currentLevelIndex!==a&&0===this._levels[a].loadError&&(this.warn(r+": switch to "+a),t.levelRetry=!0,this.hls.nextAutoLevel=a)}}},m.redundantFailover=function(t){var e=this._levels[t],n=e.url.length;if(n>1){var i=(e.urlId+1)%n;this.warn("Switching to redundant URL-id "+i),this._levels.forEach((function(t){t.urlId=i})),this.level=t}},m.onFragLoaded=function(t,e){var n=e.frag;if(void 0!==n&&n.type===c.PlaylistLevelType.MAIN){var i=this._levels[n.level];void 0!==i&&(i.fragmentError=0,i.loadError=0)}},m.onLevelLoaded=function(t,e){var n,i,r=e.level,o=e.details,s=this._levels[r];if(!s)return this.warn("Invalid level index "+r),void(null!==(i=e.deliveryDirectives)&&void 0!==i&&i.skip&&(o.deltaUpdateFailed=!0));r===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0,this.retryCount=0),this.playlistLoaded(r,e,s.details)):null!==(n=e.deliveryDirectives)&&void 0!==n&&n.skip&&(o.deltaUpdateFailed=!0)},m.onAudioTrackSwitched=function(t,e){var n=this.hls.levels[this.currentLevelIndex];if(n&&n.audioGroupIds){for(var i=-1,r=this.hls.audioTracks[e.id].groupId,o=0;o<n.audioGroupIds.length;o++)if(n.audioGroupIds[o]===r){i=o;break}i!==n.urlId&&(n.urlId=i,this.startLoad())}},m.loadPlaylist=function(t){var e=this.currentLevelIndex,n=this._levels[e];if(this.canLoad&&n&&n.url.length>0){var i=n.urlId,o=n.url[i];if(t)try{o=t.addDirectives(o)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+e+(t?" at sn "+t.msn+" part "+t.part:"")+" with URL-id "+i+" "+o),this.clearTimer(),this.hls.trigger(r.Events.LEVEL_LOADING,{url:o,level:e,id:i,deliveryDirectives:t||null})}},m.removeLevel=function(t,e){var n=function(t,n){return n!==e},i=this._levels.filter((function(i,r){return r!==t||i.url.length>1&&void 0!==e&&(i.url=i.url.filter(n),i.audioGroupIds&&(i.audioGroupIds=i.audioGroupIds.filter(n)),i.textGroupIds&&(i.textGroupIds=i.textGroupIds.filter(n)),i.urlId=0,!0)})).map((function(t,e){var n=t.details;return null!=n&&n.fragments&&n.fragments.forEach((function(t){t.level=e})),t}));this._levels=i,this.hls.trigger(r.Events.LEVELS_UPDATED,{levels:i})},p=l,(v=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,n=this._levels;if(0!==n.length&&(this.currentLevelIndex!==t||null===(e=n[t])||void 0===e||!e.details)){if(t<0||t>=n.length){var i=t<0;if(this.hls.trigger(r.Events.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.LEVEL_SWITCH_ERROR,level:t,fatal:i,reason:"invalid level idx"}),i)return;t=Math.min(t,n.length-1)}this.clearTimer();var s=this.currentLevelIndex,a=n[s],l=n[t];this.log("switching to level "+t+" from "+s),this.currentLevelIndex=t;var c=u({},l,{level:t,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete c._urlId,this.hls.trigger(r.Events.LEVEL_SWITCHING,c);var h=l.details;if(!h||h.live){var d=this.switchParams(l.uri,null==a?void 0:a.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}])&&h(p.prototype,v),g&&h(p,g),l}(l.default)},"./src/controller/level-helper.ts":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/controller/level-helper.ts ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: addGroupId, assignTrackIdsByGroup, updatePTS, updateFragPTSDTS, mergeDetails, mapPartIntersection, mapFragmentIntersection, adjustSliding, addSliding, computeReloadInterval, getFragmentWithSN, getPartWith */function(t,e,n){"use strict";n.r(e),n.d(e,"addGroupId",(function(){return o})),n.d(e,"assignTrackIdsByGroup",(function(){return s})),n.d(e,"updatePTS",(function(){return a})),n.d(e,"updateFragPTSDTS",(function(){return c})),n.d(e,"mergeDetails",(function(){return u})),n.d(e,"mapPartIntersection",(function(){return h})),n.d(e,"mapFragmentIntersection",(function(){return d})),n.d(e,"adjustSliding",(function(){return f})),n.d(e,"addSliding",(function(){return p})),n.d(e,"computeReloadInterval",(function(){return v})),n.d(e,"getFragmentWithSN",(function(){return g})),n.d(e,"getPartWith",(function(){return m}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../utils/logger */"./src/utils/logger.ts");function o(t,e,n){switch(e){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(n);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(n)}}function s(t){var e={};t.forEach((function(t){var n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++}))}function a(t,e,n){l(t[e],t[n])}function l(t,e){var n=e.startPTS;if(Object(i.isFiniteNumber)(n)){var r,o=0;e.sn>t.sn?(o=n-t.start,r=t):(o=t.start-n,r=e),r.duration!==o&&(r.duration=o)}else e.sn>t.sn?t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration:e.start=Math.max(t.start-e.duration,0)}function c(t,e,n,o,s,a){o-n<=0&&(r.logger.warn("Fragment should have a positive duration",e),o=n+e.duration,a=s+e.duration);var c=n,u=o,h=e.startPTS,d=e.endPTS;if(Object(i.isFiniteNumber)(h)){var f=Math.abs(h-n);Object(i.isFiniteNumber)(e.deltaPTS)?e.deltaPTS=Math.max(f,e.deltaPTS):e.deltaPTS=f,c=Math.max(n,h),n=Math.min(n,h),s=Math.min(s,e.startDTS),u=Math.min(o,d),o=Math.max(o,d),a=Math.max(a,e.endDTS)}e.duration=o-n;var p=n-e.start;e.appendedPTS=o,e.start=e.startPTS=n,e.maxStartPTS=c,e.startDTS=s,e.endPTS=o,e.minEndPTS=u,e.endDTS=a;var v,g=e.sn;if(!t||g<t.startSN||g>t.endSN)return 0;var m=g-t.startSN,y=t.fragments;for(y[m]=e,v=m;v>0;v--)l(y[v],y[v-1]);for(v=m;v<y.length-1;v++)l(y[v],y[v+1]);return t.fragmentHint&&l(y[y.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,p}function u(t,e){for(var n=null,o=t.fragments,s=o.length-1;s>=0;s--){var a=o[s].initSegment;if(a){n=a;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var l,u=0;if(d(t,e,(function(t,r){t.relurl&&(u=t.cc-r.cc),Object(i.isFiniteNumber)(t.startPTS)&&Object(i.isFiniteNumber)(t.endPTS)&&(r.start=r.startPTS=t.startPTS,r.startDTS=t.startDTS,r.appendedPTS=t.appendedPTS,r.maxStartPTS=t.maxStartPTS,r.endPTS=t.endPTS,r.endDTS=t.endDTS,r.minEndPTS=t.minEndPTS,r.duration=t.endPTS-t.startPTS,r.duration&&(l=r),e.PTSKnown=e.alignedSliding=!0),r.elementaryStreams=t.elementaryStreams,r.loader=t.loader,r.stats=t.stats,r.urlId=t.urlId,t.initSegment&&(r.initSegment=t.initSegment,n=t.initSegment)})),n&&(e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments).forEach((function(t){var e;t.initSegment&&t.initSegment.relurl!==(null===(e=n)||void 0===e?void 0:e.relurl)||(t.initSegment=n)})),e.skippedSegments&&(e.deltaUpdateFailed=e.fragments.some((function(t){return!t})),e.deltaUpdateFailed)){r.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=e.skippedSegments;p--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}var v=e.fragments;if(u){r.logger.warn("discontinuity sliding from playlist, take drift into account");for(var g=0;g<v.length;g++)v[g].cc+=u}e.skippedSegments&&(e.startCC=e.fragments[0].cc),h(t.partList,e.partList,(function(t,e){e.elementaryStreams=t.elementaryStreams,e.stats=t.stats})),l?c(e,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):f(t,e),v.length&&(e.totalduration=e.edge-v[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;var m=e.advancedDateTime;if(e.advanced&&m){var y=e.edge;e.driftStart||(e.driftStartTime=m,e.driftStart=y),e.driftEndTime=m,e.driftEnd=y}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime}function h(t,e,n){if(t&&e)for(var i=0,r=0,o=t.length;r<=o;r++){var s=t[r],a=e[r+i];s&&a&&s.index===a.index&&s.fragment.sn===a.fragment.sn?n(s,a):i--}}function d(t,e,n){for(var i=e.skippedSegments,r=Math.max(t.startSN,e.startSN)-e.startSN,o=(t.fragmentHint?1:0)+(i?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,s=e.startSN-t.startSN,a=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,c=r;c<=o;c++){var u=l[s+c],h=a[c];i&&!h&&c<i&&(h=e.fragments[c]=u),u&&h&&n(u,h)}}function f(t,e){var n=e.startSN+e.skippedSegments-t.startSN,i=t.fragments;n<0||n>=i.length||p(e,i[n].start)}function p(t,e){if(e){for(var n=t.fragments,i=t.skippedSegments;i<n.length;i++)n[i].start+=e;t.fragmentHint&&(t.fragmentHint.start+=e)}}function v(t,e){var n,i=1e3*t.levelTargetDuration,r=i/2,o=t.age,s=o>0&&o<3*i,a=e.loading.end-e.loading.start,l=t.availabilityDelay;if(!1===t.updated)if(s){var c=333*t.misses;n=Math.max(Math.min(r,2*a),c),t.availabilityDelay=(t.availabilityDelay||0)+n}else n=r;else s?(l=Math.min(l||i/2,o),t.availabilityDelay=l,n=l+i-o):n=i-a;return Math.round(n)}function g(t,e,n){if(!t||!t.details)return null;var i=t.details,r=i.fragments[e-i.startSN];return r||((r=i.fragmentHint)&&r.sn===e?r:e<i.startSN&&n&&n.sn===e?n:null)}function m(t,e,n){if(!t||!t.details)return null;var i=t.details.partList;if(i)for(var r=i.length;r--;){var o=i[r];if(o.index===n&&o.fragment.sn===e)return o}return null}},"./src/controller/stream-controller.ts":
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/controller/stream-controller.ts ***!
|
|
|
\*********************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),o=n(/*! ../is-supported */"./src/is-supported.ts"),s=n(/*! ../events */"./src/events.ts"),a=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),l=n(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts"),u=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),h=n(/*! ../demux/transmuxer-interface */"./src/demux/transmuxer-interface.ts"),d=n(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),f=n(/*! ./gap-controller */"./src/controller/gap-controller.ts"),p=n(/*! ../errors */"./src/errors.ts"),v=n(/*! ../utils/logger */"./src/utils/logger.ts");function g(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function m(t,e){return(m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var y=function(t){var e,n;function y(e,n){var i;return(i=t.call(this,e,n,"[stream-controller]")||this).audioCodecSwap=!1,i.gapController=null,i.level=-1,i._forceStartLoad=!1,i.altAudio=!1,i.audioOnly=!1,i.fragPlaying=null,i.onvplaying=null,i.onvseeked=null,i.fragLastKbps=0,i.stalled=!1,i.couldBacktrack=!1,i.audioCodecSwitch=!1,i.videoBuffer=null,i._registerListeners(),i}n=t,(e=y).prototype=Object.create(n.prototype),e.prototype.constructor=e,m(e,n);var b,E,C,S=y.prototype;return S._registerListeners=function(){var t=this.hls;t.on(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(s.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(s.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(s.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(s.Events.ERROR,this.onError,this),t.on(s.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(s.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(s.Events.BUFFER_CREATED,this.onBufferCreated,this),t.on(s.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(s.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(s.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var t=this.hls;t.off(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(s.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(s.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(s.Events.ERROR,this.onError,this),t.off(s.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(s.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(s.Events.BUFFER_CREATED,this.onBufferCreated,this),t.off(s.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(s.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(s.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},S.startLoad=function(t){if(this.levels){var e=this.lastCurrentTime,n=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var i=n.startLevel;-1===i&&(n.config.testBandwidth?(i=0,this.bitrateTest=!0):i=n.nextAutoLevel),this.level=n.nextLoadLevel=i,this.loadedmetadata=!1}e>0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=r.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=r.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case r.State.IDLE:this.doTickIdle();break;case r.State.WAITING_LEVEL:var t,e=this.levels,n=this.level,i=null==e||null===(t=e[n])||void 0===t?void 0:t.details;if(i&&(!i.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(i))break;this.state=r.State.IDLE;break}break;case r.State.FRAG_LOADING_WAITING_RETRY:var o,s=self.performance.now(),a=this.retryDate;(!a||s>=a||null!==(o=this.media)&&void 0!==o&&o.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=r.State.IDLE)}this.onTickEnd()},S.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var t,e,n=this.hls,i=this.levelLastLoaded,o=this.levels,a=this.media,h=n.config,d=n.nextLoadLevel;if(null!==i&&(a||!this.startFragRequested&&h.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&o&&o[d]){var f=o[d];this.level=n.nextLoadLevel=d;var p=f.details;if(!p||this.state===r.State.WAITING_LEVEL||p.live&&this.levelLastLoaded!==d)this.state=r.State.WAITING_LEVEL;else{var v=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:a,c.PlaylistLevelType.MAIN);if(null!==v&&!(v.len>=this.getMaxBufferLength(f.maxBitrate))){if(this._streamEnded(v,p)){var g={};return this.altAudio&&(g.type="video"),this.hls.trigger(s.Events.BUFFER_EOS,g),void(this.state=r.State.ENDED)}var m=v.end,y=this.getNextFragment(m,p);if(this.couldBacktrack&&!this.fragPrevious&&y&&"initSegment"!==y.sn){var b=y.sn-p.startSN;b>1&&(y=p.fragments[b-1],this.fragmentTracker.removeFragment(y))}if(y&&this.fragmentTracker.getState(y)===l.FragmentState.OK&&this.nextLoadPosition>m){var E=this.audioOnly&&!this.altAudio?u.ElementaryStreamTypes.AUDIO:u.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(a,E,c.PlaylistLevelType.MAIN),y=this.getNextFragment(this.nextLoadPosition,p)}y&&(!y.initSegment||y.initSegment.data||this.bitrateTest||(y=y.initSegment),"identity"!==(null===(t=y.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=y.decryptdata)&&void 0!==e&&e.key?this.loadFragment(y,p,m):this.loadKey(y,p))}}}},S.loadFragment=function(e,n,i){var r,o=this.fragmentTracker.getState(e);if(this.fragCurrent=e,o===l.FragmentState.BACKTRACKED){var s=this.fragmentTracker.getBacktrackData(e);if(s)return this._handleFragmentLoadProgress(s),void this._handleFragmentLoadComplete(s);o=l.FragmentState.NOT_LOADED}o===l.FragmentState.NOT_LOADED||o===l.FragmentState.PARTIAL?"initSegment"===e.sn?this._loadInitSegment(e):this.bitrateTest?(e.bitrateTest=!0,this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,n,i)):o===l.FragmentState.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null===(r=this.media)||void 0===r?void 0:r.buffered.length)&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,c.PlaylistLevelType.MAIN);return e&&"fragment"in e?e.fragment:e},S.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,c.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var n,i=this.getAppendedFrag(e.currentTime);if(i&&i.start>1&&this.flushMainBuffer(0,i.start-1),!e.paused&&t){var r=t[this.hls.nextLoadLevel],o=this.fragLastKbps;n=o&&this.fragCurrent?this.fragCurrent.duration*r.maxBitrate/(1e3*o)+1:0}else n=0;var s=this.getBufferedFrag(e.currentTime+n);if(s){var a=this.followingBufferedFrag(s);if(a){this.abortCurrentFrag();var l=a.maxStartPTS?a.maxStartPTS:a.start,c=a.duration,u=Math.max(s.end,l+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,.5*c),.75*c));this.flushMainBuffer(u,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var t=this.fragCurrent;this.fragCurrent=null,null!=t&&t.loader&&t.loader.abort(),this.state===r.State.KEY_LOADING&&(this.state=r.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(e,n){t.prototype.flushMainBuffer.call(this,e,n,this.altAudio?"video":null)},S.onMediaAttached=function(e,n){t.prototype.onMediaAttached.call(this,e,n);var i=n.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new f.default(this.config,i,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var e=this.media;e&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;Object(i.isFiniteNumber)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(s.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},S.onManifestParsed=function(t,e){var n,i=!1,r=!1;e.levels.forEach((function(t){(n=t.audioCodec)&&(-1!==n.indexOf("mp4a.40.2")&&(i=!0),-1!==n.indexOf("mp4a.40.5")&&(r=!0))})),this.audioCodecSwitch=i&&r&&!Object(o.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},S.onLevelLoading=function(t,e){var n=this.levels;if(n&&this.state===r.State.IDLE){var i=n[e.level];(!i.details||i.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(i.details))&&(this.state=r.State.WAITING_LEVEL)}},S.onLevelLoaded=function(t,e){var n,i=this.levels,o=e.level,a=e.details,l=a.totalduration;if(i){this.log("Level "+o+" loaded ["+a.startSN+","+a.endSN+"], cc ["+a.startCC+", "+a.endCC+"] duration:"+l);var c=this.fragCurrent;!c||this.state!==r.State.FRAG_LOADING&&this.state!==r.State.FRAG_LOADING_WAITING_RETRY||c.level!==e.level&&c.loader&&(this.state=r.State.IDLE,c.loader.abort());var u=i[o],h=0;if(a.live||null!==(n=u.details)&&void 0!==n&&n.live){if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed)return;h=this.alignPlaylists(a,u.details)}if(u.details=a,this.levelLastLoaded=o,this.hls.trigger(s.Events.LEVEL_UPDATED,{details:a,level:o}),this.state===r.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(a))return;this.state=r.State.IDLE}this.startFragRequested?a.live&&this.synchronizeToLiveEdge(a):this.setStartPosition(a,h),this.tick()}else this.warn("Levels were reset while loading level "+o)},S._handleFragmentLoadProgress=function(t){var e,n=t.frag,i=t.part,r=t.payload,o=this.levels;if(o){var s=o[n.level],a=s.details;if(a){var l=s.videoCodec,u=a.PTSKnown||!a.live,f=null===(e=n.initSegment)||void 0===e?void 0:e.data,p=this._getAudioCodec(s),v=this.transmuxer=this.transmuxer||new h.default(this.hls,c.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),g=i?i.index:-1,m=-1!==g,y=new d.ChunkMetadata(n.level,n.sn,n.stats.chunkCount,r.byteLength,g,m),b=this.initPTS[n.cc];v.push(r,f,p,l,n,i,a.totalduration,u,y,b)}else this.warn("Dropping fragment "+n.sn+" of level "+n.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+n.sn+" of level "+n.level+" will not be buffered")},S.onAudioTrackSwitching=function(t,e){var n=this.altAudio,i=!!e.url,r=e.id;if(!i){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var o=this.fragCurrent;null!=o&&o.loader&&(this.log("Switching to main audio track, cancel main fragment load"),o.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var a=this.hls;n&&a.trigger(s.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:r})}},S.onAudioTrackSwitched=function(t,e){var n=e.id,i=!!this.hls.audioTracks[n].url;if(i){var r=this.videoBuffer;r&&this.mediaBuffer!==r&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=r)}this.altAudio=i,this.tick()},S.onBufferCreated=function(t,e){var n,i,r=e.tracks,o=!1;for(var s in r){var a=r[s];if("main"===a.id){if(i=s,n=a,"video"===s){var l=r[s];l&&(this.videoBuffer=l.buffer)}}else o=!0}o&&n?(this.log("Alternate track found, use "+i+".buffered to schedule main fragment loading"),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(t,e){var n=e.frag,i=e.part;if(!n||n.type===c.PlaylistLevelType.MAIN){if(this.fragContextChanged(n))return this.warn("Fragment "+n.sn+(i?" p: "+i.index:"")+" of level "+n.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===r.State.PARSED&&(this.state=r.State.IDLE));var o=i?i.stats:n.stats;this.fragLastKbps=Math.round(8*o.total/(o.buffering.end-o.loading.first)),"initSegment"!==n.sn&&(this.fragPrevious=n),this.fragBufferedComplete(n,i)}},S.onError=function(t,e){switch(e.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.MAIN,e);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==r.State.ERROR&&(e.fatal?(this.warn(""+e.details),this.state=r.State.ERROR):e.levelRetry||this.state!==r.State.WAITING_LEVEL||(this.state=r.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===r.State.PARSING||this.state===r.State.PARSED)){var n=!0,i=this.getFwdBufferInfo(this.media,c.PlaylistLevelType.MAIN);i&&i.len>.5&&(n=!this.reduceMaxBufferLength(i.len)),n&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},S.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){var n=a.BufferHelper.getBuffered(t);!this.loadedmetadata&&n.length?(this.loadedmetadata=!0,this.seekToStartPos()):e.poll(this.lastCurrentTime),this.lastCurrentTime=t.currentTime}},S.onFragLoadEmergencyAborted=function(){this.state=r.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(t,e){var n=e.type;if(n!==u.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var i=(n===u.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(i,n,c.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(t,e){this.levels=e.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var t=this.media,e=t.currentTime,n=this.startPosition;if(n>=0&&e<n){if(t.seeking)return void v.logger.log("could not seek to "+n+", already seeking at "+e);var i=a.BufferHelper.getBuffered(t),r=(i.length?i.start(0):0)-n;r>0&&(r<this.config.maxBufferHole||r<this.config.maxFragLookUpTolerance)&&(v.logger.log("adjusting start position by "+r+" to match buffer start"),n+=r,this.startPosition=n),this.log("seek to target start position "+n+" from current time "+e),t.currentTime=n}},S._getAudioCodec=function(t){var e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e},S._loadBitrateTestFrag=function(t){var e=this;this._doFragLoad(t).then((function(n){var i=e.hls;if(n&&!i.nextLoadLevel&&!e.fragContextChanged(t)){e.fragLoadError=0,e.state=r.State.IDLE,e.startFragRequested=!1,e.bitrateTest=!1;var o=t.stats;o.parsing.start=o.parsing.end=o.buffering.start=o.buffering.end=self.performance.now(),i.trigger(s.Events.FRAG_LOADED,n)}}))},S._handleTransmuxComplete=function(t){var e,n="main",o=this.hls,a=t.remuxResult,l=t.chunkMeta,c=this.getCurrentContext(l);if(!c)return this.warn("The loading context changed while buffering fragment "+l.sn+" of level "+l.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(l.level);var h=c.frag,d=c.part,f=c.level,p=a.video,v=a.text,g=a.id3,m=a.initSegment,y=this.altAudio?void 0:a.audio;if(!this.fragContextChanged(h)){if(this.state=r.State.PARSING,m){m.tracks&&(this._bufferInitSegment(f,m.tracks,h,l),o.trigger(s.Events.FRAG_PARSING_INIT_SEGMENT,{frag:h,id:n,tracks:m.tracks}));var b=m.initPTS,E=m.timescale;Object(i.isFiniteNumber)(b)&&(this.initPTS[h.cc]=b,o.trigger(s.Events.INIT_PTS_FOUND,{frag:h,id:n,initPTS:b,timescale:E}))}if(p&&!1!==a.independent){if(f.details){var C=p.startPTS,S=p.endPTS,k=p.startDTS,w=p.endDTS;if(d)d.elementaryStreams[p.type]={startPTS:C,endPTS:S,startDTS:k,endDTS:w};else if(p.firstKeyFrame&&p.independent&&(this.couldBacktrack=!0),p.dropped&&p.independent){if(this.getLoadPosition()+this.config.maxBufferHole<C)return void this.backtrack(h);h.setElementaryStreamInfo(p.type,h.start,S,h.start,w,!0)}h.setElementaryStreamInfo(p.type,C,S,k,w),this.bufferFragmentData(p,h,d,l)}}else if(!1===a.independent)return void this.backtrack(h);if(y){var x=y.startPTS,T=y.endPTS,O=y.startDTS,_=y.endDTS;d&&(d.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:x,endPTS:T,startDTS:O,endDTS:_}),h.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,x,T,O,_),this.bufferFragmentData(y,h,d,l)}if(null!=g&&null!==(e=g.samples)&&void 0!==e&&e.length){var A={frag:h,id:n,samples:g.samples};o.trigger(s.Events.FRAG_PARSING_METADATA,A)}if(v){var L={frag:h,id:n,samples:v.samples};o.trigger(s.Events.FRAG_PARSING_USERDATA,L)}}},S._bufferInitSegment=function(t,e,n,i){var o=this;if(this.state===r.State.PARSING){this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&delete e.audio;var a=e.audio,l=e.video,c=e.audiovideo;if(a){var u=t.audioCodec,h=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==a.metadata.channelCount&&-1===h.indexOf("firefox")&&(u="mp4a.40.5")),-1!==h.indexOf("android")&&"audio/mpeg"!==a.container&&(u="mp4a.40.2",this.log("Android: force audio codec to "+u)),t.audioCodec&&t.audioCodec!==u&&this.log('Swapping manifest audio codec "'+t.audioCodec+'" for "'+u+'"'),a.levelCodec=u,a.id="main",this.log("Init audio buffer, container:"+a.container+", codecs[selected/level/parsed]=["+(u||"")+"/"+(t.audioCodec||"")+"/"+a.codec+"]")}l&&(l.levelCodec=t.videoCodec,l.id="main",this.log("Init video buffer, container:"+l.container+", codecs[level/parsed]=["+(t.videoCodec||"")+"/"+l.codec+"]")),c&&this.log("Init audiovideo buffer, container:"+c.container+", codecs[level/parsed]=["+(t.attrs.CODECS||"")+"/"+c.codec+"]"),this.hls.trigger(s.Events.BUFFER_CODECS,e),Object.keys(e).forEach((function(t){var r=e[t].initSegment;null!=r&&r.byteLength&&o.hls.trigger(s.Events.BUFFER_APPENDING,{type:t,data:r,frag:n,part:null,chunkMeta:i,parent:n.type})})),this.tick()}},S.backtrack=function(t){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(t);var e=this.fragmentTracker.backtrack(t);this.fragPrevious=null,this.nextLoadPosition=t.start,e?this.resetFragmentLoading(t):this.state=r.State.BACKTRACKING},S.checkFragmentChanged=function(){var t=this.media,e=null;if(t&&t.readyState>1&&!1===t.seeking){var n=t.currentTime;if(a.BufferHelper.isBuffered(t,n)?e=this.getAppendedFrag(n):a.BufferHelper.isBuffered(t,n+.1)&&(e=this.getAppendedFrag(n+.1)),e){var i=this.fragPlaying,r=e.level;i&&e.sn===i.sn&&i.level===r&&e.urlId===i.urlId||(this.hls.trigger(s.Events.FRAG_CHANGED,{frag:e}),i&&i.level===r||this.hls.trigger(s.Events.LEVEL_SWITCHED,{level:r}),this.fragPlaying=e)}}},b=y,(E=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);return this.followingBufferedFrag(e)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&g(b.prototype,E),C&&g(b,C),y}(r.default)},"./src/controller/subtitle-stream-controller.ts":
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/controller/subtitle-stream-controller.ts ***!
|
|
|
\******************************************************/
|
|
|
/*! exports provided: SubtitleStreamController */function(t,e,n){"use strict";n.r(e),n.d(e,"SubtitleStreamController",(function(){return v}));var i=n(/*! ../events */"./src/events.ts"),r=n(/*! ../utils/logger */"./src/utils/logger.ts"),o=n(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),s=n(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),a=n(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),l=n(/*! ./level-helper */"./src/controller/level-helper.ts"),c=n(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),u=n(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),h=n(/*! ../types/loader */"./src/types/loader.ts"),d=n(/*! ../types/level */"./src/types/level.ts");function f(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var v=function(t){var e,n;function v(e,n){var i;return(i=t.call(this,e,n,"[subtitle-stream-controller]")||this).levels=[],i.currentTrackId=-1,i.tracksBuffered=[],i.mainDetails=null,i._registerListeners(),i}n=t,(e=v).prototype=Object.create(n.prototype),e.prototype.constructor=e,p(e,n);var g,m,y,b=v.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var t=this.hls;t.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.on(i.Events.ERROR,this.onError,this),t.on(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(i.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(i.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(i.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b._unregisterListeners=function(){var t=this.hls;t.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.Events.LEVEL_LOADED,this.onLevelLoaded,this),t.off(i.Events.ERROR,this.onError,this),t.off(i.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(i.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(i.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(i.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},b.startLoad=function(){this.stopLoad(),this.state=u.State.IDLE,this.setInterval(500),this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},b.onLevelLoaded=function(t,e){this.mainDetails=e.details},b.onSubtitleFragProcessed=function(t,e){var n=e.frag,i=e.success;if(this.fragPrevious=n,this.state=u.State.IDLE,i){var r=this.tracksBuffered[this.currentTrackId];if(r){for(var o,s=n.start,a=0;a<r.length;a++)if(s>=r[a].start&&s<=r[a].end){o=r[a];break}var l=n.start+n.duration;o?o.end=l:(o={start:s,end:l},r.push(o)),this.fragmentTracker.fragBuffered(n)}}},b.onBufferFlushing=function(t,e){var n=e.startOffset,i=e.endOffset;if(0===n&&i!==Number.POSITIVE_INFINITY){var r=this.currentTrackId,o=this.levels;if(!o.length||!o[r]||!o[r].details)return;var s=i-o[r].details.targetduration;if(s<=0)return;e.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach((function(t){for(var e=0;e<t.length;)if(t[e].end<=s)t.shift();else{if(!(t[e].start<s))break;t[e].start=s,e++}})),this.fragmentTracker.removeFragmentsInRange(n,s,h.PlaylistLevelType.SUBTITLE)}},b.onError=function(t,e){var n,i=e.frag;i&&i.type===h.PlaylistLevelType.SUBTITLE&&(null!==(n=this.fragCurrent)&&void 0!==n&&n.loader&&this.fragCurrent.loader.abort(),this.state=u.State.IDLE)},b.onSubtitleTracksUpdated=function(t,e){var n=this,i=e.subtitleTracks;this.tracksBuffered=[],this.levels=i.map((function(t){return new d.Level(t)})),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach((function(t){n.tracksBuffered[t.id]=[]})),this.mediaBuffer=null},b.onSubtitleTrackSwitch=function(t,e){if(this.currentTrackId=e.id,this.levels.length&&-1!==this.currentTrackId){var n=this.levels[this.currentTrackId];null!=n&&n.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,n&&this.setInterval(500)}else this.clearInterval()},b.onSubtitleTrackLoaded=function(t,e){var n,i=e.details,r=e.id,o=this.currentTrackId,c=this.levels;if(c.length){var h=c[o];if(!(r>=c.length||r!==o)&&h){if(this.mediaBuffer=this.mediaBufferTimeRanges,i.live||null!==(n=h.details)&&void 0!==n&&n.live){var d=this.mainDetails;if(i.deltaUpdateFailed||!d)return;var f=d.fragments[0];h.details?0===this.alignPlaylists(i,h.details)&&f&&Object(l.addSliding)(i,f.start):i.hasProgramDateTime&&d.hasProgramDateTime?Object(a.alignMediaPlaylistByPDT)(i,d):f&&Object(l.addSliding)(i,f.start)}h.details=i,this.levelLastLoaded=r,this.tick(),i.live&&!this.fragCurrent&&this.media&&this.state===u.State.IDLE&&(Object(s.findFragmentByPTS)(null,i.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0))}}},b._handleFragmentLoadComplete=function(t){var e=t.frag,n=t.payload,r=e.decryptdata,o=this.hls;if(!this.fragContextChanged(e)&&n&&n.byteLength>0&&r&&r.key&&r.iv&&"AES-128"===r.method){var s=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer).then((function(t){var n=performance.now();o.trigger(i.Events.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:s,tdecrypt:n}})}))}},b.doTick=function(){if(this.media){if(this.state===u.State.IDLE){var t,e=this.currentTrackId,n=this.levels;if(!n.length||!n[e]||!n[e].details)return;var a=n[e].details,l=a.targetduration,h=this.config,d=this.media,f=o.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,d.currentTime-l,h.maxBufferHole),p=f.end;if(f.len>this.getMaxBufferLength()+l)return;console.assert(a,"Subtitle track details are defined on idle subtitle stream controller tick");var v,g=a.fragments,m=g.length,y=a.edge,b=this.fragPrevious;if(p<y){var E=h.maxFragLookUpTolerance;b&&a.hasProgramDateTime&&(v=Object(s.findFragmentByPDT)(g,b.endProgramDateTime,E)),v||!(v=Object(s.findFragmentByPTS)(b,g,p,E))&&b&&b.start<g[0].start&&(v=g[0])}else v=g[m-1];null!==(t=v)&&void 0!==t&&t.encrypted?(r.logger.log("Loading key for "+v.sn),this.state=u.State.KEY_LOADING,this.hls.trigger(i.Events.KEY_LOADING,{frag:v})):v&&this.fragmentTracker.getState(v)===c.FragmentState.NOT_LOADED&&this.loadFragment(v,a,p)}}else this.state=u.State.IDLE},b.loadFragment=function(e,n,i){this.fragCurrent=e,t.prototype.loadFragment.call(this,e,n,i)},g=v,(m=[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}])&&f(g.prototype,m),y&&f(g,y),v}(u.default)},"./src/controller/subtitle-track-controller.ts":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./src/controller/subtitle-track-controller.ts ***!
|
|
|
\*****************************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../events */"./src/events.ts"),r=n(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),o=n(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),s=n(/*! ../types/loader */"./src/types/loader.ts");function a(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=function(t){var e,n;function o(e){var n;return(n=t.call(this,e,"[subtitle-track-controller]")||this).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}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,l(e,n);var c,h,d,f=o.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,t.prototype.destroy.call(this)},f.registerListeners=function(){var t=this.hls;t.on(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(i.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(i.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(i.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var t=this.hls;t.off(i.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(i.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(i.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(i.Events.ERROR,this.onError,this)},f.onMediaAttached=function(t,e){this.media=e.media,this.media&&(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))},f.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},f.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),u(this.media.textTracks).forEach((function(t){Object(r.clearCurrentCues)(t)})),this.subtitleTrack=-1,this.media=null)},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},f.onSubtitleTrackLoaded=function(t,e){var n=e.id,i=e.details,r=this.trackId,o=this.tracksInGroup[r];if(o){var s=o.details;o.details=e.details,this.log("subtitle track "+n+" loaded ["+i.startSN+"-"+i.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,e,s))}else this.warn("Invalid subtitle track id "+n)},f.onLevelLoading=function(t,e){this.switchLevel(e.level)},f.onLevelSwitching=function(t,e){this.switchLevel(e.level)},f.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var n=e.textGroupIds[e.urlId];if(this.groupId!==n){var r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,o=this.tracks.filter((function(t){return!n||t.groupId===n}));this.tracksInGroup=o;var s=this.findTrackId(null==r?void 0:r.name)||this.findTrackId();this.groupId=n;var a={subtitleTracks:o};this.log("Updating subtitle tracks, "+o.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(i.Events.SUBTITLE_TRACKS_UPDATED,a),-1!==s&&this.setSubtitleTrack(s,r)}}},f.findTrackId=function(t){for(var e=this.tracksInGroup,n=0;n<e.length;n++){var i=e[n];if((!this.selectDefaultTrack||i.default)&&(!t||t===i.name))return i.id}return-1},f.onError=function(e,n){t.prototype.onError.call(this,e,n),!n.fatal&&n.context&&n.context.type===s.PlaylistContextType.SUBTITLE_TRACK&&n.context.id===this.trackId&&n.context.groupId===this.groupId&&this.retryLoadingOrFail(n)},f.loadPlaylist=function(t){var e=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(e)){var n=e.id,r=e.groupId,o=e.url;if(t)try{o=t.addDirectives(o)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(i.Events.SUBTITLE_TRACK_LOADING,{url:o,id:n,groupId:r,deliveryDirectives:t||null})}},f.toggleTrackModes=function(t){var e=this,n=this.media,i=this.subtitleDisplay,r=this.trackId;if(n){var o=u(n.textTracks),s=o.filter((function(t){return t.groupId===e.groupId}));if(-1===t)[].slice.call(o).forEach((function(t){t.mode="disabled"}));else{var a=s[r];a&&(a.mode="disabled")}var l=s[t];l&&(l.mode=i?"showing":"hidden")}},f.setSubtitleTrack=function(t,e){var n,r=this.tracksInGroup;if(this.media){if(this.trackId!==t&&this.toggleTrackModes(t),!(this.trackId===t&&(-1===t||null!==(n=r[t])&&void 0!==n&&n.details)||t<-1||t>=r.length)){this.clearTimer();var o=r[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,o){var s=o.id,a=o.groupId,l=void 0===a?"":a,c=o.name,u=o.type,h=o.url;this.hls.trigger(i.Events.SUBTITLE_TRACK_SWITCH,{id:s,groupId:l,name:c,type:u,url:h});var d=this.switchParams(o.url,null==e?void 0:e.details);this.loadPlaylist(d)}else this.hls.trigger(i.Events.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=u(this.media.textTracks),n=0;n<e.length;n++)if("hidden"===e[n].mode)t=n;else if("showing"===e[n].mode){t=n;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)}},c=o,(h=[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var e=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,e)}}])&&a(c.prototype,h),d&&a(c,d),o}(o.default);function u(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];"subtitles"===i.kind&&i.label&&e.push(t[n])}return e}e.default=c},"./src/controller/timeline-controller.ts":
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./src/controller/timeline-controller.ts ***!
|
|
|
\***********************************************/
|
|
|
/*! exports provided: TimelineController */function(t,e,n){"use strict";n.r(e),n.d(e,"TimelineController",(function(){return d}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/cea-608-parser */"./src/utils/cea-608-parser.ts"),s=n(/*! ../utils/output-filter */"./src/utils/output-filter.ts"),a=n(/*! ../utils/webvtt-parser */"./src/utils/webvtt-parser.ts"),l=n(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),c=n(/*! ../utils/imsc1-ttml-parser */"./src/utils/imsc1-ttml-parser.ts"),u=n(/*! ../types/loader */"./src/types/loader.ts"),h=n(/*! ../utils/logger */"./src/utils/logger.ts"),d=function(){function t(t){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={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.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 e=new s.default(this,"textTrack1"),n=new s.default(this,"textTrack2"),i=new s.default(this,"textTrack3"),a=new s.default(this,"textTrack4");this.cea608Parser1=new o.default(1,e,n),this.cea608Parser2=new o.default(3,i,a)}t.on(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(r.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(r.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(r.Events.FRAG_LOADING,this.onFragLoading,this),t.on(r.Events.FRAG_LOADED,this.onFragLoaded,this),t.on(r.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(r.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(r.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(r.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var e=t.prototype;return e.destroy=function(){var t=this.hls;t.off(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(r.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(r.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(r.Events.FRAG_LOADING,this.onFragLoading,this),t.off(r.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(r.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(r.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(r.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(r.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},e.addCues=function(t,e,n,i,o){for(var s,a,l,c,u=!1,h=o.length;h--;){var d=o[h],f=(s=d[0],a=d[1],l=e,c=n,Math.min(a,c)-Math.max(s,l));if(f>=0&&(d[0]=Math.min(d[0],e),d[1]=Math.max(d[1],n),u=!0,f/(n-e)>.5))return}if(u||o.push([e,n]),this.config.renderTextTracksNatively){var p=this.captionsTracks[t];this.Cues.newCue(p,e,n,i)}else{var v=this.Cues.newCue(null,e,n,i);this.hls.trigger(r.Events.CUES_PARSED,{type:"captions",cues:v,track:t})}},e.onInitPtsFound=function(t,e){var n=this,i=e.frag,o=e.id,s=e.initPTS,a=e.timescale,l=this.unparsedVttFrags;"main"===o&&(this.initPTS[i.cc]=s,this.timescale[i.cc]=a),l.length&&(this.unparsedVttFrags=[],l.forEach((function(t){n.onFragLoaded(r.Events.FRAG_LOADED,t)})))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var n=0;n<e.textTracks.length;n++){var i=e.textTracks[n];if(i[t])return i}return null},e.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},e.createNativeTrack=function(t){if(!this.captionsTracks[t]){var e=this.captionsProperties,n=this.captionsTracks,i=this.media,r=e[t],o=r.label,s=r.languageCode,a=this.getExistingTrack(t);if(a)n[t]=a,Object(l.clearCurrentCues)(n[t]),Object(l.sendAddTrackEvent)(n[t],i);else{var c=this.createTextTrack("captions",o,s);c&&(c[t]=!0,n[t]=c)}}},e.createNonNativeTrack=function(t){if(!this.nonNativeCaptionsTracks[t]){var e=this.captionsProperties[t];if(e){var n={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=n,this.hls.trigger(r.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[n]})}}},e.createTextTrack=function(t,e,n){var i=this.media;if(i)return i.addTextTrack(t,e,n)},e.onMediaAttaching=function(t,e){this.media=e.media,this._cleanTracks()},e.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach((function(e){Object(l.clearCurrentCues)(t[e]),delete t[e]})),this.nonNativeCaptionsTracks={}},e.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},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())},e._cleanTracks=function(){var t=this.media;if(t){var e=t.textTracks;if(e)for(var n=0;n<e.length;n++)Object(l.clearCurrentCues)(e[n])}},e.onSubtitleTracksUpdated=function(t,e){var n=this;this.textTracks=[];var i=e.subtitleTracks||[],o=i.some((function(t){return t.textCodec===c.IMSC1_CODEC}));if(this.config.enableWebVTT||o&&this.config.enableIMSC1){var s=this.tracks&&i&&this.tracks.length===i.length;if(this.tracks=i||[],this.config.renderTextTracksNatively){var a=this.media?this.media.textTracks:[];this.tracks.forEach((function(t,e){var i;if(e<a.length){for(var r=null,o=0;o<a.length;o++)if(f(a[o],t)){r=a[o];break}r&&(i=r)}i?Object(l.clearCurrentCues)(i):(i=n.createTextTrack("subtitles",t.name,t.lang))&&(i.mode="disabled"),i&&(i.groupId=t.groupId,n.textTracks.push(i))}))}else if(!s&&this.tracks&&this.tracks.length){var u=this.tracks.map((function(t){return{label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t}}));this.hls.trigger(r.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:u})}}},e.onManifestLoaded=function(t,e){var n=this;this.config.enableCEA708Captions&&e.captions&&e.captions.forEach((function(t){var e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(e){var i="textTrack"+e[1],r=n.captionsProperties[i];r&&(r.label=t.name,t.lang&&(r.languageCode=t.lang),r.media=t)}}))},e.onFragLoading=function(t,e){var n=this.cea608Parser1,i=this.cea608Parser2,r=this.lastSn,o=this.lastPartIndex;if(this.enabled&&n&&i&&e.frag.type===u.PlaylistLevelType.MAIN){var s,a,l=e.frag.sn,c=null!=(s=null==e||null===(a=e.part)||void 0===a?void 0:a.index)?s:-1;l===r+1||l===r&&c===o+1||(n.reset(),i.reset()),this.lastSn=l,this.lastPartIndex=c}},e.onFragLoaded=function(t,e){var n=e.frag,o=e.payload,s=this.initPTS,a=this.unparsedVttFrags;if(n.type===u.PlaylistLevelType.SUBTITLE)if(o.byteLength){if(!Object(i.isFiniteNumber)(s[n.cc]))return a.push(e),void(s.length&&this.hls.trigger(r.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Missing initial subtitle PTS")}));var l=n.decryptdata;if(null==l||null==l.key||"AES-128"!==l.method){var h=this.tracks[n.level],d=this.vttCCs;d[n.cc]||(d[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),h&&h.textCodec===c.IMSC1_CODEC?this._parseIMSC1(n,o):this._parseVTTs(n,o,d)}}else this.hls.trigger(r.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})},e._parseIMSC1=function(t,e){var n=this,i=this.hls;Object(c.parseIMSC1)(e,this.initPTS[t.cc],this.timescale[t.cc],(function(e){n._appendCues(e,t.level),i.trigger(r.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(e){h.logger.log("Failed to parse IMSC1: "+e),i.trigger(r.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})}))},e._parseVTTs=function(t,e,n){var i=this,o=this.hls;Object(a.parseWebVTT)(e,this.initPTS[t.cc],this.timescale[t.cc],n,t.cc,t.start,(function(e){i._appendCues(e,t.level),o.trigger(r.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(function(n){i._fallbackToIMSC1(t,e),h.logger.log("Failed to parse VTT cue: "+n),o.trigger(r.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:n})}))},e._fallbackToIMSC1=function(t,e){var n=this,i=this.tracks[t.level];i.textCodec||Object(c.parseIMSC1)(e,this.initPTS[t.cc],this.timescale[t.cc],(function(){i.textCodec=c.IMSC1_CODEC,n._parseIMSC1(t,e)}),(function(){i.textCodec="wvtt"}))},e._appendCues=function(t,e){var n=this.hls;if(this.config.renderTextTracksNatively){var i=this.textTracks[e];if("disabled"===i.mode)return;t.forEach((function(t){return Object(l.addCueToTrack)(i,t)}))}else{var o=this.tracks[e].default?"default":"subtitles"+e;n.trigger(r.Events.CUES_PARSED,{type:"subtitles",cues:t,track:o})}},e.onFragDecrypted=function(t,e){var n=e.frag;if(n.type===u.PlaylistLevelType.SUBTITLE){if(!Object(i.isFiniteNumber)(this.initPTS[n.cc]))return void this.unparsedVttFrags.push(e);this.onFragLoaded(r.Events.FRAG_LOADED,e)}},e.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},e.onFragParsingUserdata=function(t,e){var n=this.cea608Parser1,i=this.cea608Parser2;if(this.enabled&&n&&i)for(var r=0;r<e.samples.length;r++){var o=e.samples[r].bytes;if(o){var s=this.extractCea608Data(o);n.addData(e.samples[r].pts,s[0]),i.addData(e.samples[r].pts,s[1])}}},e.onBufferFlushing=function(t,e){var n=e.startOffset,i=e.endOffset,r=e.endOffsetSubtitles,o=e.type,s=this.media;if(s&&!(s.currentTime<i)){if(!o||"video"===o){var a=this.captionsTracks;Object.keys(a).forEach((function(t){return Object(l.removeCuesInRange)(a[t],n,i)}))}if(this.config.renderTextTracksNatively&&0===n&&void 0!==r){var c=this.textTracks;Object.keys(c).forEach((function(t){return Object(l.removeCuesInRange)(c[t],n,r)}))}}},e.extractCea608Data=function(t){for(var e=31&t[0],n=2,i=[[],[]],r=0;r<e;r++){var o=t[n++],s=127&t[n++],a=127&t[n++],l=3&o;0===s&&0===a||0!=(4&o)&&(0!==l&&1!==l||(i[l].push(s),i[l].push(a)))}return i},t}();function f(t,e){return t&&t.label===e.name&&!(t.textTrack1||t.textTrack2)}},"./src/crypt/aes-crypto.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/crypt/aes-crypto.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return i}));var i=function(){function t(t,e){this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=e}return t.prototype.decrypt=function(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)},t}()},"./src/crypt/aes-decryptor.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/crypt/aes-decryptor.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: removePadding, default */function(t,e,n){"use strict";n.r(e),n.d(e,"removePadding",(function(){return r})),n.d(e,"default",(function(){return o}));var i=n(/*! ../utils/typed-array */"./src/utils/typed-array.ts");function r(t){var e=t.byteLength,n=e&&new DataView(t.buffer).getUint8(e-1);return n?Object(i.sliceUint8)(t,0,e-n):t}var o=function(){function t(){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 e=t.prototype;return e.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),n=new Uint32Array(4),i=0;i<4;i++)n[i]=e.getUint32(4*i);return n},e.initTable=function(){var t=this.sBox,e=this.invSBox,n=this.subMix,i=n[0],r=n[1],o=n[2],s=n[3],a=this.invSubMix,l=a[0],c=a[1],u=a[2],h=a[3],d=new Uint32Array(256),f=0,p=0,v=0;for(v=0;v<256;v++)d[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,t[f]=g,e[g]=f;var m=d[f],y=d[m],b=d[y],E=257*d[g]^16843008*g;i[f]=E<<24|E>>>8,r[f]=E<<16|E>>>16,o[f]=E<<8|E>>>24,s[f]=E,E=16843009*b^65537*y^257*m^16843008*f,l[g]=E<<24|E>>>8,c[g]=E<<16|E>>>16,u[g]=E<<8|E>>>24,h[g]=E,f?(f=m^d[d[d[b^m]]],p^=d[d[p]]):f=p=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),n=!0,i=0;i<e.length&&n;)n=e[i]===this.key[i],i++;if(!n){this.key=e;var r=this.keySize=e.length;if(4!==r&&6!==r&&8!==r)throw new Error("Invalid aes key size="+r);var o,s,a,l,c=this.ksRows=4*(r+6+1),u=this.keySchedule=new Uint32Array(c),h=this.invKeySchedule=new Uint32Array(c),d=this.sBox,f=this.rcon,p=this.invSubMix,v=p[0],g=p[1],m=p[2],y=p[3];for(o=0;o<c;o++)o<r?a=u[o]=e[o]:(l=a,o%r==0?(l=d[(l=l<<8|l>>>24)>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[255&l],l^=f[o/r|0]<<24):r>6&&o%r==4&&(l=d[l>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[255&l]),u[o]=a=(u[o-r]^l)>>>0);for(s=0;s<c;s++)o=c-s,l=3&s?u[o]:u[o-4],h[s]=s<4||o<=4?l:v[d[l>>>24]]^g[d[l>>>16&255]]^m[d[l>>>8&255]]^y[d[255&l]],h[s]=h[s]>>>0}},e.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},e.decrypt=function(t,e,n){for(var i,r,o,s,a,l,c,u,h,d,f,p,v,g,m=this.keySize+6,y=this.invKeySchedule,b=this.invSBox,E=this.invSubMix,C=E[0],S=E[1],k=E[2],w=E[3],x=this.uint8ArrayToUint32Array_(n),T=x[0],O=x[1],_=x[2],A=x[3],L=new Int32Array(t),R=new Int32Array(L.length),D=this.networkToHostOrderSwap;e<L.length;){for(h=D(L[e]),d=D(L[e+1]),f=D(L[e+2]),p=D(L[e+3]),a=h^y[0],l=p^y[1],c=f^y[2],u=d^y[3],v=4,g=1;g<m;g++)i=C[a>>>24]^S[l>>16&255]^k[c>>8&255]^w[255&u]^y[v],r=C[l>>>24]^S[c>>16&255]^k[u>>8&255]^w[255&a]^y[v+1],o=C[c>>>24]^S[u>>16&255]^k[a>>8&255]^w[255&l]^y[v+2],s=C[u>>>24]^S[a>>16&255]^k[l>>8&255]^w[255&c]^y[v+3],a=i,l=r,c=o,u=s,v+=4;i=b[a>>>24]<<24^b[l>>16&255]<<16^b[c>>8&255]<<8^b[255&u]^y[v],r=b[l>>>24]<<24^b[c>>16&255]<<16^b[u>>8&255]<<8^b[255&a]^y[v+1],o=b[c>>>24]<<24^b[u>>16&255]<<16^b[a>>8&255]<<8^b[255&l]^y[v+2],s=b[u>>>24]<<24^b[a>>16&255]<<16^b[l>>8&255]<<8^b[255&c]^y[v+3],R[e]=D(i^T),R[e+1]=D(s^O),R[e+2]=D(o^_),R[e+3]=D(r^A),T=h,O=d,_=f,A=p,e+=4}return R.buffer},t}()},"./src/crypt/decrypter.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/crypt/decrypter.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return c}));var i=n(/*! ./aes-crypto */"./src/crypt/aes-crypto.ts"),r=n(/*! ./fast-aes-key */"./src/crypt/fast-aes-key.ts"),o=n(/*! ./aes-decryptor */"./src/crypt/aes-decryptor.ts"),s=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),l=n(/*! ../utils/typed-array */"./src/utils/typed-array.ts"),c=function(){function t(t,e,n){var i=(void 0===n?{}:n).removePKCS7Padding,r=void 0===i||i;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=t,this.config=e,this.removePKCS7Padding=r,r)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(t){}null===this.subtle&&(this.config.enableSoftwareAES=!0)}var e=t.prototype;return e.destroy=function(){this.observer=null},e.isSync=function(){return this.config.enableSoftwareAES},e.flush=function(){var t=this.currentResult;if(t){var e=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?Object(o.removePadding)(e):e}this.reset()},e.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},e.decrypt=function(t,e,n,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(t),e,n);var r=this.flush();r&&i(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(t),e,n).then(i)},e.softwareDecrypt=function(t,e,n){var i=this.currentIV,r=this.currentResult,s=this.remainderData;this.logOnce("JS AES decrypt"),s&&(t=Object(a.appendUint8Array)(s,t),this.remainderData=null);var c=this.getValidChunk(t);if(!c.length)return null;i&&(n=i);var u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new o.default),u.expandKey(e);var h=r;return this.currentResult=u.decrypt(c.buffer,0,n),this.currentIV=Object(l.sliceUint8)(c,-16).buffer,h||null},e.webCryptoDecrypt=function(t,e,n){var o=this,s=this.subtle;return this.key===e&&this.fastAesKey||(this.key=e,this.fastAesKey=new r.default(s,e)),this.fastAesKey.expandKey().then((function(e){return s?new i.default(s,n).decrypt(t.buffer,e):Promise.reject(new Error("web crypto not initialized"))})).catch((function(i){return o.onWebCryptoError(i,t,e,n)}))},e.onWebCryptoError=function(t,e,n,i){return s.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",t),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(e,n,i)},e.getValidChunk=function(t){var e=t,n=t.length-t.length%16;return n!==t.length&&(e=Object(l.sliceUint8)(t,0,n),this.remainderData=Object(l.sliceUint8)(t,n)),e},e.logOnce=function(t){this.logEnabled&&(s.logger.log("[decrypter.ts]: "+t),this.logEnabled=!1)},t}()},"./src/crypt/fast-aes-key.ts":
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/crypt/fast-aes-key.ts ***!
|
|
|
\***********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return i}));var i=function(){function t(t,e){this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=e}return t.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},t}()},"./src/demux/aacdemuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/aacdemuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),r=n(/*! ./adts */"./src/demux/adts.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ../demux/id3 */"./src/demux/id3.ts");function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=function(t){var e,n;function i(e,n){var i;return(i=t.call(this)||this).observer=void 0,i.config=void 0,i.observer=e,i.config=n,i}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,a(e,n);var l=i.prototype;return l.resetInitSegment=function(e,n,i){t.prototype.resetInitSegment.call(this,e,n,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}},i.probe=function(t){if(!t)return!1;for(var e=(s.getID3Data(t,0)||[]).length,n=t.length;e<n;e++)if(r.probe(t,e))return o.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(t,e){return r.canParse(t,e)},l.appendFrame=function(t,e,n){r.initTrackConfig(t,this.observer,e,n,t.manifestCodec);var i=r.appendFrame(t,e,n,this.initPTS,this.frameIndex);if(i&&0===i.missing)return i},i}(i.default);l.minProbeByteLength=9,e.default=l},"./src/demux/adts.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/demux/adts.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: getAudioConfig, isHeaderPattern, getHeaderLength, getFullFrameLength, canGetFrameLength, isHeader, canParse, probe, initTrackConfig, getFrameDuration, parseFrameHeader, appendFrame */function(t,e,n){"use strict";n.r(e),n.d(e,"getAudioConfig",(function(){return s})),n.d(e,"isHeaderPattern",(function(){return a})),n.d(e,"getHeaderLength",(function(){return l})),n.d(e,"getFullFrameLength",(function(){return c})),n.d(e,"canGetFrameLength",(function(){return u})),n.d(e,"isHeader",(function(){return h})),n.d(e,"canParse",(function(){return d})),n.d(e,"probe",(function(){return f})),n.d(e,"initTrackConfig",(function(){return p})),n.d(e,"getFrameDuration",(function(){return v})),n.d(e,"parseFrameHeader",(function(){return g})),n.d(e,"appendFrame",(function(){return m}));var i=n(/*! ../utils/logger */"./src/utils/logger.ts"),r=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../events */"./src/events.ts");function s(t,e,n,s){var a,l,c,u,h=navigator.userAgent.toLowerCase(),d=s,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];a=1+((192&e[n+2])>>>6);var p=(60&e[n+2])>>>2;if(!(p>f.length-1))return c=(1&e[n+2])<<2,c|=(192&e[n+3])>>>6,i.logger.log("manifest codec:"+s+", ADTS type:"+a+", samplingIndex:"+p),/firefox/i.test(h)?p>=6?(a=5,u=new Array(4),l=p-3):(a=2,u=new Array(2),l=p):-1!==h.indexOf("android")?(a=2,u=new Array(2),l=p):(a=5,u=new Array(4),s&&(-1!==s.indexOf("mp4a.40.29")||-1!==s.indexOf("mp4a.40.5"))||!s&&p>=6?l=p-3:((s&&-1!==s.indexOf("mp4a.40.2")&&(p>=6&&1===c||/vivaldi/i.test(h))||!s&&1===c)&&(a=2,u=new Array(2)),l=p)),u[0]=a<<3,u[0]|=(14&p)>>1,u[1]|=(1&p)<<7,u[1]|=c<<3,5===a&&(u[1]|=(14&l)>>1,u[2]=(1&l)<<7,u[2]|=8,u[3]=0),{config:u,samplerate:f[p],channelCount:c,codec:"mp4a.40."+a,manifestCodec:d};t.trigger(o.Events.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+p})}function a(t,e){return 255===t[e]&&240==(246&t[e+1])}function l(t,e){return 1&t[e+1]?7:9}function c(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function u(t,e){return e+5<t.length}function h(t,e){return e+1<t.length&&a(t,e)}function d(t,e){return u(t,e)&&a(t,e)&&c(t,e)<=t.length-e}function f(t,e){if(h(t,e)){var n=l(t,e);if(e+n>=t.length)return!1;var i=c(t,e);if(i<=n)return!1;var r=e+i;return r===t.length||h(t,r)}return!1}function p(t,e,n,r,o){if(!t.samplerate){var a=s(e,n,r,o);if(!a)return;t.config=a.config,t.samplerate=a.samplerate,t.channelCount=a.channelCount,t.codec=a.codec,t.manifestCodec=a.manifestCodec,i.logger.log("parsed codec:"+t.codec+", rate:"+a.samplerate+", channels:"+a.channelCount)}}function v(t){return 9216e4/t}function g(t,e,n,i,r){var o=l(t,e),s=c(t,e);if((s-=o)>0)return{headerLength:o,frameLength:s,stamp:n+i*r}}function m(t,e,n,i,r){var o=g(e,n,i,r,v(t.samplerate));if(o){var s,a=o.frameLength,l=o.headerLength,c=o.stamp,u=l+a,h=Math.max(0,n+u-e.length);h?(s=new Uint8Array(u-l)).set(e.subarray(n+l,e.length),0):s=e.subarray(n+l,n+u);var d={unit:s,pts:c};return h||t.samples.push(d),{sample:d,length:u,missing:h}}}},"./src/demux/base-audio-demuxer.ts":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/demux/base-audio-demuxer.ts ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: initPTSFn, default */function(t,e,n){"use strict";n.r(e),n.d(e,"initPTSFn",(function(){return c}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../demux/id3 */"./src/demux/id3.ts"),o=n(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),s=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),a=n(/*! ../utils/typed-array */"./src/utils/typed-array.ts"),l=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(){},e.resetContiguity=function(){},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,n){},e.demux=function(t,e){this.cachedData&&(t=Object(s.appendUint8Array)(this.cachedData,t),this.cachedData=null);var n,i,l=r.getID3Data(t,0),u=l?l.length:0,h=this._audioTrack,d=this._id3Track,f=l?r.getTimeStamp(l):void 0,p=t.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=c(f,e)),l&&l.length>0&&d.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),i=this.initPTS;u<p;){if(this.canParse(t,u)){var v=this.appendFrame(h,t,u);v?(this.frameIndex++,i=v.sample.pts,n=u+=v.length):u=p}else r.canParse(t,u)?(l=r.getID3Data(t,u),d.samples.push({pts:i,dts:i,data:l}),n=u+=l.length):u++;if(u===p&&n!==p){var g=Object(a.sliceUint8)(t,n);this.cachedData?this.cachedData=Object(s.appendUint8Array)(this.cachedData,g):this.cachedData=g}}return{audioTrack:h,avcTrack:Object(o.dummyTrack)(),id3Track:d,textTrack:Object(o.dummyTrack)()}},e.demuxSampleAes=function(t,e,n){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},e.flush=function(t){var e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(o.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(o.dummyTrack)()}},e.destroy=function(){},t}(),c=function(t,e){return Object(i.isFiniteNumber)(t)?90*t:9e4*e};e.default=l},"./src/demux/chunk-cache.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/demux/chunk-cache.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return i}));var i=function(){function t(){this.chunks=[],this.dataLength=0}var e=t.prototype;return e.push=function(t){this.chunks.push(t),this.dataLength+=t.length},e.flush=function(){var t,e=this.chunks,n=this.dataLength;return e.length?(t=1===e.length?e[0]:function(t,e){for(var n=new Uint8Array(e),i=0,r=0;r<t.length;r++){var o=t[r];n.set(o,i),i+=o.length}return n}(e,n),this.reset(),t):new Uint8Array(0)},e.reset=function(){this.chunks.length=0,this.dataLength=0},t}()},"./src/demux/dummy-demuxed-track.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/demux/dummy-demuxed-track.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: dummyTrack */function(t,e,n){"use strict";function i(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}n.r(e),n.d(e,"dummyTrack",(function(){return i}))},"./src/demux/exp-golomb.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/exp-golomb.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../utils/logger */"./src/utils/logger.ts"),r=function(){function t(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}var e=t.prototype;return e.loadWord=function(){var t=this.data,e=this.bytesAvailable,n=t.byteLength-e,i=new Uint8Array(4),r=Math.min(4,e);if(0===r)throw new Error("no bytes available");i.set(t.subarray(n,n+r)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=8*r,this.bytesAvailable-=r},e.skipBits=function(t){var e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),n=this.word>>>32-e;return t>32&&i.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),(e=t-e)>0&&this.bitsAvailable?n<<e|this.readBits(e):n},e.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if(0!=(this.word&2147483648>>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,n=8,i=0;i<t;i++)0!==n&&(n=(e+this.readEG()+256)%256),e=0===n?e:n},e.readSPS=function(){var t,e,n,i=0,r=0,o=0,s=0,a=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),u=this.readBoolean.bind(this),h=this.skipBits.bind(this),d=this.skipEG.bind(this),f=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);a();var v=a();if(l(5),h(3),a(),f(),100===v||110===v||122===v||244===v||44===v||83===v||86===v||118===v||128===v){var g=c();if(3===g&&h(1),f(),f(),h(1),u())for(e=3!==g?8:12,n=0;n<e;n++)u()&&p(n<6?16:64)}f();var m=c();if(0===m)c();else if(1===m)for(h(1),d(),d(),t=c(),n=0;n<t;n++)d();f(),h(1);var y=c(),b=c(),E=l(1);0===E&&h(1),h(1),u()&&(i=c(),r=c(),o=c(),s=c());var C=[1,1];if(u()&&u())switch(a()){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:C=[a()<<8|a(),a()<<8|a()]}return{width:Math.ceil(16*(y+1)-2*i-2*r),height:(2-E)*(b+1)*16-(E?2:4)*(o+s),pixelRatio:C}},e.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},t}();e.default=r},"./src/demux/id3.ts":
|
|
|
/*!**************************!*\
|
|
|
!*** ./src/demux/id3.ts ***!
|
|
|
\**************************/
|
|
|
/*! exports provided: isHeader, isFooter, getID3Data, canParse, getTimeStamp, isTimeStampFrame, getID3Frames, decodeFrame, utf8ArrayToStr, testables */function(t,e,n){"use strict";n.r(e),n.d(e,"isHeader",(function(){return r})),n.d(e,"isFooter",(function(){return o})),n.d(e,"getID3Data",(function(){return s})),n.d(e,"canParse",(function(){return l})),n.d(e,"getTimeStamp",(function(){return c})),n.d(e,"isTimeStampFrame",(function(){return u})),n.d(e,"getID3Frames",(function(){return d})),n.d(e,"decodeFrame",(function(){return f})),n.d(e,"utf8ArrayToStr",(function(){return y})),n.d(e,"testables",(function(){return b}));var i,r=function(t,e){return e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},o=function(t,e){return e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128},s=function(t,e){for(var n=e,i=0;r(t,e);)i+=10,i+=a(t,e+6),o(t,e+10)&&(i+=10),e+=i;if(i>0)return t.subarray(n,n+i)},a=function(t,e){var n=0;return n=(127&t[e])<<21,n|=(127&t[e+1])<<14,n|=(127&t[e+2])<<7,n|=127&t[e+3]},l=function(t,e){return r(t,e)&&a(t,e+6)+10<=t.length-e},c=function(t){for(var e=d(t),n=0;n<e.length;n++){var i=e[n];if(u(i))return m(i)}},u=function(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info},h=function(t){var e=String.fromCharCode(t[0],t[1],t[2],t[3]),n=a(t,4);return{type:e,size:n,data:t.subarray(10,10+n)}},d=function(t){for(var e=0,n=[];r(t,e);){for(var i=a(t,e+6),s=(e+=10)+i;e+8<s;){var l=h(t.subarray(e)),c=f(l);c&&n.push(c),e+=l.size+10}o(t,e)&&(e+=10)}return n},f=function(t){return"PRIV"===t.type?p(t):"W"===t.type[0]?g(t):v(t)},p=function(t){if(!(t.size<2)){var e=y(t.data,!0),n=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:n.buffer}}},v=function(t){if(!(t.size<2)){if("TXXX"===t.type){var e=1,n=y(t.data.subarray(e),!0);e+=n.length+1;var i=y(t.data.subarray(e));return{key:t.type,info:n,data:i}}var r=y(t.data.subarray(1));return{key:t.type,data:r}}},g=function(t){if("WXXX"===t.type){if(t.size<2)return;var e=1,n=y(t.data.subarray(e),!0);e+=n.length+1;var i=y(t.data.subarray(e));return{key:t.type,info:n,data:i}}var r=y(t.data);return{key:t.type,data:r}},m=function(t){if(8===t.data.byteLength){var e=new Uint8Array(t.data),n=1&e[3],i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,n&&(i+=47721858.84),Math.round(i)}},y=function(t,e){void 0===e&&(e=!1);var n=E();if(n){var i=n.decode(t);if(e){var r=i.indexOf("\0");return-1!==r?i.substring(0,r):i}return i.replace(/\0/g,"")}for(var o,s,a,l=t.length,c="",u=0;u<l;){if(0===(o=t[u++])&&e)return c;if(0!==o&&3!==o)switch(o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(o);break;case 12:case 13:s=t[u++],c+=String.fromCharCode((31&o)<<6|63&s);break;case 14:s=t[u++],a=t[u++],c+=String.fromCharCode((15&o)<<12|(63&s)<<6|(63&a)<<0)}}return c},b={decodeTextFrame:v};function E(){return i||void 0===self.TextDecoder||(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/mp3demuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),r=n(/*! ../demux/id3 */"./src/demux/id3.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! ./mpegaudio */"./src/demux/mpegaudio.ts");function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,a(e,n);var l=i.prototype;return l.resetInitSegment=function(e,n,i){t.prototype.resetInitSegment.call(this,e,n,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:e,duration:i,inputTimeScale:9e4,dropped:0}},i.probe=function(t){if(!t)return!1;for(var e=(r.getID3Data(t,0)||[]).length,n=t.length;e<n;e++)if(s.probe(t,e))return o.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(t,e){return s.canParse(t,e)},l.appendFrame=function(t,e,n){if(null!==this.initPTS)return s.appendFrame(t,e,n,this.initPTS,this.frameIndex)},i}(i.default);l.minProbeByteLength=4,e.default=l},"./src/demux/mp4demuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/mp4demuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),r=n(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),o=function(){function t(t,e){this.remainderData=null,this.config=void 0,this.config=e}var e=t.prototype;return e.resetTimeStamp=function(){},e.resetInitSegment=function(){},e.resetContiguity=function(){},t.probe=function(t){return Object(i.findBox)({data:t,start:0,end:Math.min(t.length,16384)},["moof"]).length>0},e.demux=function(t){var e=t,n=Object(r.dummyTrack)();if(this.config.progressive){this.remainderData&&(e=Object(i.appendUint8Array)(this.remainderData,t));var o=Object(i.segmentValidRange)(e);this.remainderData=o.remainder,n.samples=o.valid||new Uint8Array}else n.samples=e;return{audioTrack:Object(r.dummyTrack)(),avcTrack:n,id3Track:Object(r.dummyTrack)(),textTrack:Object(r.dummyTrack)()}},e.flush=function(){var t=Object(r.dummyTrack)();return t.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(r.dummyTrack)(),avcTrack:t,id3Track:Object(r.dummyTrack)(),textTrack:Object(r.dummyTrack)()}},e.demuxSampleAes=function(t,e,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}();o.minProbeByteLength=1024,e.default=o},"./src/demux/mpegaudio.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/demux/mpegaudio.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: appendFrame, parseHeader, isHeaderPattern, isHeader, canParse, probe */function(t,e,n){"use strict";n.r(e),n.d(e,"appendFrame",(function(){return l})),n.d(e,"parseHeader",(function(){return c})),n.d(e,"isHeaderPattern",(function(){return u})),n.d(e,"isHeader",(function(){return h})),n.d(e,"canParse",(function(){return d})),n.d(e,"probe",(function(){return f}));var i=null,r=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],o=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],s=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],a=[0,1,1,4];function l(t,e,n,i,r){if(!(n+24>e.length)){var o=c(e,n);if(o&&n+o.frameLength<=e.length){var s=i+r*(9e4*o.samplesPerFrame/o.sampleRate),a={unit:e.subarray(n,n+o.frameLength),pts:s,dts:s};return t.config=[],t.channelCount=o.channelCount,t.samplerate=o.sampleRate,t.samples.push(a),{sample:a,length:o.frameLength,missing:0}}}}function c(t,e){var n=t[e+1]>>3&3,l=t[e+1]>>1&3,c=t[e+2]>>4&15,u=t[e+2]>>2&3;if(1!==n&&0!==c&&15!==c&&3!==u){var h=t[e+2]>>1&1,d=t[e+3]>>6,f=1e3*r[14*(3===n?3-l:3===l?3:4)+c-1],p=o[3*(3===n?0:2===n?1:2)+u],v=3===d?1:2,g=s[n][l],m=a[l],y=8*g*m,b=Math.floor(g*f/p+h)*m;if(null===i){var E=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);i=E?parseInt(E[1]):0}return!!i&&i<=87&&2===l&&f>=224e3&&0===d&&(t[e+3]=128|t[e+3]),{sampleRate:p,channelCount:v,frameLength:b,samplesPerFrame:y}}}function u(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function h(t,e){return e+1<t.length&&u(t,e)}function d(t,e){return u(t,e)&&4<=t.length-e}function f(t,e){if(e+1<t.length&&u(t,e)){var n=c(t,e),i=4;null!=n&&n.frameLength&&(i=n.frameLength);var r=e+i;return r===t.length||h(t,r)}return!1}},"./src/demux/sample-aes.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/sample-aes.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),r=n(/*! ./tsdemuxer */"./src/demux/tsdemuxer.ts"),o=function(){function t(t,e,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new i.default(t,e,{removePKCS7Padding:!1})}var e=t.prototype;return e.decryptBuffer=function(t,e){this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,e)},e.decryptAacSample=function(t,e,n,i){var r=t[e].unit,o=r.subarray(16,r.length-r.length%16),s=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),a=this;this.decryptBuffer(s,(function(o){var s=new Uint8Array(o);r.set(s,16),i||a.decryptAacSamples(t,e+1,n)}))},e.decryptAacSamples=function(t,e,n){for(;;e++){if(e>=t.length)return void n();if(!(t[e].unit.length<32)){var i=this.decrypter.isSync();if(this.decryptAacSample(t,e,n,i),!i)return}}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,n=new Int8Array(e),i=0,r=32;r<=t.length-16;r+=160,i+=16)n.set(t.subarray(r,r+16),i);return n},e.getAvcDecryptedUnit=function(t,e){for(var n=new Uint8Array(e),i=0,r=32;r<=t.length-16;r+=160,i+=16)t.set(n.subarray(i,i+16),r);return t},e.decryptAvcSample=function(t,e,n,i,o,s){var a=Object(r.discardEPB)(o.data),l=this.getAvcEncryptedData(a),c=this;this.decryptBuffer(l.buffer,(function(r){o.data=c.getAvcDecryptedUnit(a,r),s||c.decryptAvcSamples(t,e,n+1,i)}))},e.decryptAvcSamples=function(t,e,n,i){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,n=0){if(e>=t.length)return void i();for(var r=t[e].units;!(n>=r.length);n++){var o=r[n];if(!(o.data.length<=48||1!==o.type&&5!==o.type)){var s=this.decrypter.isSync();if(this.decryptAvcSample(t,e,n,i,o,s),!s)return}}}},t}();e.default=o},"./src/demux/transmuxer-interface.ts":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/demux/transmuxer-interface.ts ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return h}));var i=n(/*! webworkify-webpack */"./node_modules/webworkify-webpack/index.js"),r=n(/*! ../events */"./src/events.ts"),o=n(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),s=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! ../errors */"./src/errors.ts"),l=n(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),c=n(/*! eventemitter3 */"./node_modules/eventemitter3/index.js"),u=Object(l.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function t(t,e,n,l){var h=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=t,this.id=e,this.onTransmuxComplete=n,this.onFlush=l;var d=t.config,f=function(e,n){(n=n||{}).frag=h.frag,n.id=h.id,t.trigger(e,n)};this.observer=new c.EventEmitter,this.observer.on(r.Events.FRAG_DECRYPTED,f),this.observer.on(r.Events.ERROR,f);var p={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(d.enableWorker&&"undefined"!=typeof Worker){var g;s.logger.log("demuxing in webworker");try{g=this.worker=i(/*! ../demux/transmuxer-worker.ts */"./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(e){t.trigger(r.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(e.message+" ("+e.filename+":"+e.lineno+")")})},g.postMessage({cmd:"init",typeSupported:p,vendor:v,id:e,config:JSON.stringify(d)})}catch(t){s.logger.warn("Error in worker:",t),s.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new o.default(this.observer,p,d,v,e),this.worker=null}}else this.transmuxer=new o.default(this.observer,p,d,v,e)}var e=t.prototype;return e.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},e.push=function(t,e,n,i,r,a,l,c,u,h){var d=this;u.transmuxing.start=self.performance.now();var f=this.transmuxer,p=this.worker,v=a?a.start:r.start,g=r.decryptdata,m=this.frag,y=!(m&&r.cc===m.cc),b=!(m&&u.level===m.level),E=m?u.sn-m.sn:-1,C=this.part?u.part-this.part.index:1,S=!b&&(1===E||0===E&&1===C),k=self.performance.now();(b||E||0===r.stats.parsing.start)&&(r.stats.parsing.start=k),!a||!C&&S||(a.stats.parsing.start=k);var w=new o.TransmuxState(y,S,c,b,v);if(!S||y){s.logger.log("[transmuxer-interface, "+r.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+y+"\n trackSwitch: "+b+"\n contiguous: "+S+"\n accurateTimeOffset: "+c+"\n timeOffset: "+v);var x=new o.TransmuxConfig(n,i,e,l,h);this.configureTransmuxer(x)}if(this.frag=r,this.part=a,p)p.postMessage({cmd:"demux",data:t,decryptdata:g,chunkMeta:u,state:w},t instanceof ArrayBuffer?[t]:[]);else if(f){var T=f.push(t,g,u,w);Object(o.isPromise)(T)?T.then((function(t){d.handleTransmuxComplete(t)})):this.handleTransmuxComplete(T)}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var n=this.transmuxer,i=this.worker;if(i)i.postMessage({cmd:"flush",chunkMeta:t});else if(n){var r=n.flush(t);Object(o.isPromise)(r)?r.then((function(n){e.handleFlushResult(n,t)})):this.handleFlushResult(r,t)}},e.handleFlushResult=function(t,e){var n=this;t.forEach((function(t){n.handleTransmuxComplete(t)})),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,n=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,n.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,n=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):n&&n.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}()},"./src/demux/transmuxer-worker.ts":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/demux/transmuxer-worker.ts ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return a}));var i=n(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),r=n(/*! ../events */"./src/events.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=n(/*! eventemitter3 */"./node_modules/eventemitter3/index.js");function a(t){var e=new s.EventEmitter,n=function(e,n){t.postMessage({event:e,data:n})};e.on(r.Events.FRAG_DECRYPTED,n),e.on(r.Events.ERROR,n),t.addEventListener("message",(function(r){var s=r.data;switch(s.cmd){case"init":var a=JSON.parse(s.config);t.transmuxer=new i.default(e,s.typeSupported,a,s.vendor,s.id),Object(o.enableLogs)(a.debug),n("init",null);break;case"configure":t.transmuxer.configure(s.config);break;case"demux":var c=t.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(i.isPromise)(c)?c.then((function(e){l(t,e)})):l(t,c);break;case"flush":var h=s.chunkMeta,d=t.transmuxer.flush(h);Object(i.isPromise)(d)?d.then((function(e){u(t,e,h)})):u(t,d,h)}}))}function l(t,e){if((n=e.remuxResult).audio||n.video||n.text||n.id3||n.initSegment){var n,i=[],r=e.remuxResult,o=r.audio,s=r.video;o&&c(i,o),s&&c(i,s),t.postMessage({event:"transmuxComplete",data:e},i)}}function c(t,e){e.data1&&t.push(e.data1.buffer),e.data2&&t.push(e.data2.buffer)}function u(t,e,n){e.forEach((function(e){l(t,e)})),t.postMessage({event:"flush",data:n})}},"./src/demux/transmuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/transmuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default, isPromise, TransmuxConfig, TransmuxState */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y})),n.d(e,"isPromise",(function(){return E})),n.d(e,"TransmuxConfig",(function(){return C})),n.d(e,"TransmuxState",(function(){return S}));var i,r=n(/*! ../events */"./src/events.ts"),o=n(/*! ../errors */"./src/errors.ts"),s=n(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),a=n(/*! ../demux/aacdemuxer */"./src/demux/aacdemuxer.ts"),l=n(/*! ../demux/mp4demuxer */"./src/demux/mp4demuxer.ts"),c=n(/*! ../demux/tsdemuxer */"./src/demux/tsdemuxer.ts"),u=n(/*! ../demux/mp3demuxer */"./src/demux/mp3demuxer.ts"),h=n(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.ts"),d=n(/*! ../remux/passthrough-remuxer */"./src/remux/passthrough-remuxer.ts"),f=n(/*! ./chunk-cache */"./src/demux/chunk-cache.ts"),p=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),v=n(/*! ../utils/logger */"./src/utils/logger.ts");try{i=self.performance.now.bind(self.performance)}catch(t){v.logger.debug("Unable to use Performance API on this environment"),i=self.Date.now}var g=[{demux:c.default,remux:h.default},{demux:l.default,remux:d.default},{demux:a.default,remux:h.default},{demux:u.default,remux:h.default}],m=1024;g.forEach((function(t){var e=t.demux;m=Math.max(m,e.minProbeByteLength)}));var y=function(){function t(t,e,n,i,r){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 f.default,this.observer=t,this.typeSupported=e,this.config=n,this.vendor=i,this.id=r}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,n,r){var o=this,s=n.transmuxing;s.executeStart=i();var a=new Uint8Array(t),l=this.cache,c=this.config,u=this.currentTransmuxState,h=this.transmuxConfig;r&&(this.currentTransmuxState=r);var d=function(t,e){var n=null;return t.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(n=e),n}(a,e);if(d&&"AES-128"===d.method){var f=this.getDecrypter();if(!c.enableSoftwareAES)return this.decryptionPromise=f.webCryptoDecrypt(a,d.key.buffer,d.iv.buffer).then((function(t){var e=o.push(t,null,n);return o.decryptionPromise=null,e})),this.decryptionPromise;var v=f.softwareDecrypt(a,d.key.buffer,d.iv.buffer);if(!v)return s.executeEnd=i(),b(n);a=new Uint8Array(v)}var g=r||u,m=g.contiguous,y=g.discontinuity,E=g.trackSwitch,C=g.accurateTimeOffset,S=g.timeOffset,k=h.audioCodec,w=h.videoCodec,x=h.defaultInitPts,T=h.duration,O=h.initSegmentData;if((y||E)&&this.resetInitSegment(O,k,w,T),y&&this.resetInitialTimestamp(x),m||this.resetContiguity(),this.needsProbing(a,y,E)){if(l.dataLength){var _=l.flush();a=Object(p.appendUint8Array)(_,a)}this.configureTransmuxer(a,h)}var A=this.transmux(a,d,S,C,n),L=this.currentTransmuxState;return L.contiguous=!0,L.discontinuity=!1,L.trackSwitch=!1,s.executeEnd=i(),A},e.flush=function(t){var e=this,n=t.transmuxing;n.executeStart=i();var s=this.decrypter,a=this.cache,l=this.currentTransmuxState,c=this.decryptionPromise;if(c)return c.then((function(){return e.flush(t)}));var u=[],h=l.timeOffset;if(s){var d=s.flush();d&&u.push(this.push(d,null,t))}var f=a.dataLength;a.reset();var p=this.demuxer,v=this.remuxer;if(!p||!v)return f>=m&&this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),n.executeEnd=i(),[b(t)];var g=p.flush(h);return E(g)?g.then((function(n){return e.flushRemux(u,n,t),u})):(this.flushRemux(u,g,t),u)},e.flushRemux=function(t,e,n){var r=e.audioTrack,o=e.avcTrack,s=e.id3Track,a=e.textTrack,l=this.currentTransmuxState,c=l.accurateTimeOffset,u=l.timeOffset;v.logger.log("[transmuxer.ts]: Flushed fragment "+n.sn+(n.part>-1?" p: "+n.part:"")+" of level "+n.level);var h=this.remuxer.remux(r,o,s,a,u,c,!0,this.id);t.push({remuxResult:h,chunkMeta:n}),n.transmuxing.executeEnd=i()},e.resetInitialTimestamp=function(t){var e=this.demuxer,n=this.remuxer;e&&n&&(e.resetTimeStamp(t),n.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,n,i){var r=this.demuxer,o=this.remuxer;r&&o&&(r.resetInitSegment(e,n,i),o.resetInitSegment(t,e,n))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,n,i,r){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,n,i,r):this.transmuxUnencrypted(t,n,i,r)},e.transmuxUnencrypted=function(t,e,n,i){var r=this.demuxer.demux(t,e,!1,!this.config.progressive),o=r.audioTrack,s=r.avcTrack,a=r.id3Track,l=r.textTrack;return{remuxResult:this.remuxer.remux(o,s,a,l,e,n,!1,this.id),chunkMeta:i}},e.transmuxSampleAes=function(t,e,n,i,r){var o=this;return this.demuxer.demuxSampleAes(t,e,n).then((function(t){return{remuxResult:o.remuxer.remux(t.audioTrack,t.avcTrack,t.id3Track,t.textTrack,n,i,!1,o.id),chunkMeta:r}}))},e.configureTransmuxer=function(t,e){for(var n,i=this.config,r=this.observer,o=this.typeSupported,s=this.vendor,a=e.audioCodec,c=e.defaultInitPts,u=e.duration,h=e.initSegmentData,f=e.videoCodec,p=0,m=g.length;p<m;p++)if(g[p].demux.probe(t)){n=g[p];break}n||(v.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),n={demux:l.default,remux:d.default});var y=this.demuxer,b=this.remuxer,E=n.remux,C=n.demux;b&&b instanceof E||(this.remuxer=new E(r,i,o,s)),y&&y instanceof C||(this.demuxer=new C(r,i,o),this.probe=C.probe),this.resetInitSegment(h,a,f,u),this.resetInitialTimestamp(c)},e.needsProbing=function(t,e,n){return!this.demuxer||!this.remuxer||e||n},e.getDecrypter=function(){var t=this.decrypter;return t||(t=this.decrypter=new s.default(this.observer,this.config)),t},t}(),b=function(t){return{remuxResult:{},chunkMeta:t}};function E(t){return"then"in t&&t.then instanceof Function}var C=function(t,e,n,i,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=n,this.duration=i,this.defaultInitPts=r},S=function(t,e,n,i,r){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=n,this.trackSwitch=i,this.timeOffset=r}},"./src/demux/tsdemuxer.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/demux/tsdemuxer.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: discardEPB, default */function(t,e,n){"use strict";n.r(e),n.d(e,"discardEPB",(function(){return E}));var i=n(/*! ./adts */"./src/demux/adts.ts"),r=n(/*! ./mpegaudio */"./src/demux/mpegaudio.ts"),o=n(/*! ./exp-golomb */"./src/demux/exp-golomb.ts"),s=n(/*! ./id3 */"./src/demux/id3.ts"),a=n(/*! ./sample-aes */"./src/demux/sample-aes.ts"),l=n(/*! ../events */"./src/events.ts"),c=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),u=n(/*! ../utils/logger */"./src/utils/logger.ts"),h=n(/*! ../errors */"./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},f=function(){function t(t,e,n){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=e,this.typeSupported=n}t.probe=function(e){var n=t.syncOffset(e);return!(n<0||(n&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+n+", junk ahead ?"),0))},t.syncOffset=function(t){for(var e=Math.min(1e3,t.length-564),n=0;n<e;){if(71===t[n]&&71===t[n+188]&&71===t[n+376])return n;n++}return-1},t.createTrack=function(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:d[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}};var e=t.prototype;return e.resetInitSegment=function(e,n,i){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=t.createTrack("video",i),this._audioTrack=t.createTrack("audio",i),this._id3Track=t.createTrack("id3",i),this._txtTrack=t.createTrack("text",i),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=e,this.videoCodec=n,this._duration=i},e.resetTimeStamp=function(){},e.resetContiguity=function(){var t=this._audioTrack,e=this._avcTrack,n=this._id3Track;t&&(t.pesData=null),e&&(e.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},e.demux=function(e,n,i,r){var o;void 0===i&&(i=!1),void 0===r&&(r=!1),i||(this.sampleAes=null);var s=this._avcTrack,a=this._audioTrack,d=this._id3Track,f=s.pid,p=s.pesData,y=a.pid,b=d.pid,E=a.pesData,C=d.pesData,S=!1,k=this.pmtParsed,w=this._pmtId,x=e.length;if(this.remainderData&&(x=(e=Object(c.appendUint8Array)(this.remainderData,e)).length,this.remainderData=null),x<188&&!r)return this.remainderData=e,{audioTrack:a,avcTrack:s,id3Track:d,textTrack:this._txtTrack};var T=Math.max(0,t.syncOffset(e));(x-=(x+T)%188)<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,x,e.buffer.byteLength-x));for(var O=T;O<x;O+=188)if(71===e[O]){var _=!!(64&e[O+1]),A=((31&e[O+1])<<8)+e[O+2],L=void 0;if((48&e[O+3])>>4>1){if((L=O+5+e[O+4])===O+188)continue}else L=O+4;switch(A){case f:_&&(p&&(o=m(p))&&this.parseAVCPES(o,!1),p={data:[],size:0}),p&&(p.data.push(e.subarray(L,O+188)),p.size+=O+188-L);break;case y:_&&(E&&(o=m(E))&&(a.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),E={data:[],size:0}),E&&(E.data.push(e.subarray(L,O+188)),E.size+=O+188-L);break;case b:_&&(C&&(o=m(C))&&this.parseID3PES(o),C={data:[],size:0}),C&&(C.data.push(e.subarray(L,O+188)),C.size+=O+188-L);break;case 0:_&&(L+=e[L]+1),w=this._pmtId=v(e,L);break;case w:_&&(L+=e[L]+1);var R=g(e,L,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,i);(f=R.avc)>0&&(s.pid=f),(y=R.audio)>0&&(a.pid=y,a.isAAC=R.isAAC),(b=R.id3)>0&&(d.pid=b),S&&!k&&(u.logger.log("reparse from beginning"),S=!1,O=T-188),k=this.pmtParsed=!0;break;case 17:case 8191:break;default:S=!0}}else this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});s.pesData=p,a.pesData=E,d.pesData=C;var D={audioTrack:a,avcTrack:s,id3Track:d,textTrack:this._txtTrack};return r&&this.extractRemainingSamples(D),D},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,n=t.audioTrack,i=t.avcTrack,r=t.id3Track,o=i.pesData,s=n.pesData,a=r.pesData;o&&(e=m(o))?(this.parseAVCPES(e,!0),i.pesData=null):i.pesData=o,s&&(e=m(s))?(n.isAAC?this.parseAACPES(e):this.parseMPEGPES(e),n.pesData=null):(null!=s&&s.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),n.pesData=s),a&&(e=m(a))?(this.parseID3PES(e),r.pesData=null):r.pesData=a},e.demuxSampleAes=function(t,e,n){var i=this.demux(t,n,!0,!this.config.progressive),r=this.sampleAes=new a.default(this.observer,this.config,e);return this.decrypt(i,r)},e.decrypt=function(t,e){return new Promise((function(n){var i=t.audioTrack,r=t.avcTrack;i.samples&&i.isAAC?e.decryptAacSamples(i.samples,0,(function(){r.samples?e.decryptAvcSamples(r.samples,0,0,(function(){n(t)})):n(t)})):r.samples&&e.decryptAvcSamples(r.samples,0,0,(function(){n(t)}))}))},e.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},e.parseAVCPES=function(t,e){var n,i=this,r=this._avcTrack,a=this.parseAVCNALu(t.data),l=this.avcSample,c=!1;t.data=null,l&&a.length&&!r.audFound&&(y(l,r),l=this.avcSample=p(!1,t.pts,t.dts,"")),a.forEach((function(e){switch(e.type){case 1:n=!0,l||(l=i.avcSample=p(!0,t.pts,t.dts,"")),l.frame=!0;var a=e.data;if(c&&a.length>4){var u=new o.default(a).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:n=!0,l||(l=i.avcSample=p(!0,t.pts,t.dts,"")),l.key=!0,l.frame=!0;break;case 6:n=!0;var h=new o.default(E(e.data));h.readUByte();for(var d=0,f=0,v=!1,g=0;!v&&h.bytesAvailable>1;){d=0;do{d+=g=h.readUByte()}while(255===g);f=0;do{f+=g=h.readUByte()}while(255===g);if(4===d&&0!==h.bytesAvailable){if(v=!0,181===h.readUByte()&&49===h.readUShort()&&1195456820===h.readUInt()&&3===h.readUByte()){for(var m=h.readUByte(),C=31&m,S=[m,h.readUByte()],k=0;k<C;k++)S.push(h.readUByte()),S.push(h.readUByte()),S.push(h.readUByte());b(i._txtTrack.samples,{type:3,pts:t.pts,bytes:S})}}else if(5===d&&0!==h.bytesAvailable){if(v=!0,f>16){for(var w=[],x=0;x<16;x++)w.push(h.readUByte().toString(16)),3!==x&&5!==x&&7!==x&&9!==x||w.push("-");for(var T=f-16,O=new Uint8Array(T),_=0;_<T;_++)O[_]=h.readUByte();b(i._txtTrack.samples,{pts:t.pts,payloadType:d,uuid:w.join(""),userData:Object(s.utf8ArrayToStr)(O),userDataBytes:O})}}else if(f<h.bytesAvailable)for(var A=0;A<f;A++)h.readUByte()}break;case 7:if(n=!0,c=!0,!r.sps){var L=new o.default(e.data).readSPS();r.width=L.width,r.height=L.height,r.pixelRatio=L.pixelRatio,r.sps=[e.data],r.duration=i._duration;for(var R=e.data.subarray(1,4),D="avc1.",I=0;I<3;I++){var M=R[I].toString(16);M.length<2&&(M="0"+M),D+=M}r.codec=D}break;case 8:n=!0,r.pps||(r.pps=[e.data]);break;case 9:n=!1,r.audFound=!0,l&&y(l,r),l=i.avcSample=p(!1,t.pts,t.dts,"");break;case 12:n=!1;break;default:n=!1,l&&(l.debug+="unknown NAL "+e.type+" ")}l&&n&&l.units.push(e)})),e&&l&&(y(l,r),this.avcSample=null)},e.getLastNalUnit=function(){var t,e,n=this.avcSample;if(!n||0===n.units.length){var i=this._avcTrack.samples;n=i[i.length-1]}if(null!==(t=n)&&void 0!==t&&t.units){var r=n.units;e=r[r.length-1]}return e},e.parseAVCNALu=function(t){var e,n,i=t.byteLength,r=this._avcTrack,o=r.naluState||0,s=o,a=[],l=0,c=-1,u=0;for(-1===o&&(c=0,u=31&t[0],o=0,l=1);l<i;)if(e=t[l++],o)if(1!==o)if(e)if(1===e){if(c>=0){var h={data:t.subarray(c,l-o-1),type:u};a.push(h)}else{var d=this.getLastNalUnit();if(d&&(s&&l<=4-s&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-s)),(n=l-o-1)>0)){var f=new Uint8Array(d.data.byteLength+n);f.set(d.data,0),f.set(t.subarray(0,n),d.data.byteLength),d.data=f,d.state=0}}l<i?(c=l,u=31&t[l],o=0):o=-1}else o=0;else o=3;else o=e?0:2;else o=e?0:1;if(c>=0&&o>=0){var p={data:t.subarray(c,i),type:u,state:o};a.push(p)}if(0===a.length){var v=this.getLastNalUnit();if(v){var g=new Uint8Array(v.data.byteLength+t.byteLength);g.set(v.data,0),g.set(t,v.data.byteLength),v.data=g}}return r.naluState=o,a},e.parseAACPES=function(t){var e,n,r,o,s,a=0,c=this._audioTrack,d=this.aacOverFlow,f=t.data;if(d){this.aacOverFlow=null;var p=d.sample.unit.byteLength,v=Math.min(d.missing,p),g=p-v;d.sample.unit.set(f.subarray(0,v),g),c.samples.push(d.sample),a=d.missing}for(e=a,n=f.length;e<n-1&&!i.isHeader(f,e);e++);if(e===a||(e<n-1?(r="AAC PES did not start with ADTS header,offset:"+e,o=!1):(r="no ADTS header found in AAC PES",o=!0),u.logger.warn("parsing error:"+r),this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:o,reason:r}),!o)){if(i.initTrackConfig(c,this.observer,f,e,this.audioCodec),void 0!==t.pts)s=t.pts;else{if(!d)return void u.logger.warn("[tsdemuxer]: AAC PES unknown PTS");var m=i.getFrameDuration(c.samplerate);s=d.sample.pts+m}for(var y=0;e<n;){if(i.isHeader(f,e)){if(e+5<n){var b=i.appendFrame(c,f,e,s,y);if(b){if(!b.missing){e+=b.length,y++;continue}this.aacOverFlow=b}}break}e++}}},e.parseMPEGPES=function(t){var e=t.data,n=e.length,i=0,o=0,s=t.pts;if(void 0!==s)for(;o<n;)if(r.isHeader(e,o)){var a=r.appendFrame(this._audioTrack,e,o,s,i);if(!a)break;o+=a.length,i++}else o++;else u.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")},e.parseID3PES=function(t){void 0!==t.pts?this._id3Track.samples.push(t):u.logger.warn("[tsdemuxer]: ID3 PES unknown PTS")},t}();function p(t,e,n,i){return{key:t,frame:!1,pts:e,dts:n,units:[],debug:i,length:0}}function v(t,e){return(31&t[e+10])<<8|t[e+11]}function g(t,e,n,i){var r={audio:-1,avc:-1,id3:-1,isAAC:!0},o=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<o;){var s=(31&t[e+1])<<8|t[e+2];switch(t[e]){case 207:if(!i){u.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===r.audio&&(r.audio=s);break;case 21:-1===r.id3&&(r.id3=s);break;case 219:if(!i){u.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===r.avc&&(r.avc=s);break;case 3:case 4:n?-1===r.audio&&(r.audio=s,r.isAAC=!1):u.logger.log("MPEG audio found, not supported in this browser");break;case 36:u.logger.warn("Unsupported HEVC stream type found")}e+=5+((15&t[e+3])<<8|t[e+4])}return r}function m(t){var e,n,i,r,o,s=0,a=t.data;if(!t||0===t.size)return null;for(;a[0].length<19&&a.length>1;){var l=new Uint8Array(a[0].length+a[1].length);l.set(a[0]),l.set(a[1],a[0].length),a[0]=l,a.splice(1,1)}if(1===((e=a[0])[0]<<16)+(e[1]<<8)+e[2]){if((n=(e[4]<<8)+e[5])&&n>t.size-6)return null;var c=e[7];192&c&&(r=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&c?r-(o=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(u.logger.warn(Math.round((r-o)/9e4)+"s delta between PTS and DTS, align them"),r=o):o=r);var h=(i=e[8])+9;if(t.size<=h)return null;t.size-=h;for(var d=new Uint8Array(t.size),f=0,p=a.length;f<p;f++){var v=(e=a[f]).byteLength;if(h){if(h>v){h-=v;continue}e=e.subarray(h),v-=h,h=0}d.set(e,s),s+=v}return n&&(n-=i+3),{data:d,pts:r,dts:o,len:n}}return null}function y(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var n=e.samples,i=n.length;if(!i)return void e.dropped++;var r=n[i-1];t.pts=r.pts,t.dts=r.dts}e.samples.push(t)}t.debug.length&&u.logger.log(t.pts+"/"+t.dts+":"+t.debug)}function b(t,e){var n=t.length;if(n>0){if(e.pts>=t[n-1].pts)t.push(e);else for(var i=n-1;i>=0;i--)if(e.pts<t[i].pts){t.splice(i,0,e);break}}else t.push(e)}function E(t){for(var e=t.byteLength,n=[],i=1;i<e-2;)0===t[i]&&0===t[i+1]&&3===t[i+2]?(n.push(i+2),i+=2):i++;if(0===n.length)return t;var r=e-n.length,o=new Uint8Array(r),s=0;for(i=0;i<r;s++,i++)s===n[0]&&(s++,n.shift()),o[i]=t[s];return o}f.minProbeByteLength=188,e.default=f},"./src/errors.ts":
|
|
|
/*!***********************!*\
|
|
|
!*** ./src/errors.ts ***!
|
|
|
\***********************/
|
|
|
/*! exports provided: ErrorTypes, ErrorDetails */function(t,e,n){"use strict";var i,r;n.r(e),n.d(e,"ErrorTypes",(function(){return i})),n.d(e,"ErrorDetails",(function(){return r})),function(t){t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError"}(i||(i={})),function(t){t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.UNKNOWN="unknown"}(r||(r={}))},"./src/events.ts":
|
|
|
/*!***********************!*\
|
|
|
!*** ./src/events.ts ***!
|
|
|
\***********************/
|
|
|
/*! exports provided: Events */function(t,e,n){"use strict";var i;n.r(e),n.d(e,"Events",(function(){return i})),function(t){t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached"}(i||(i={}))},"./src/hls.ts":
|
|
|
/*!********************!*\
|
|
|
!*** ./src/hls.ts ***!
|
|
|
\********************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y}));var i=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),r=n(/*! ./loader/playlist-loader */"./src/loader/playlist-loader.ts"),o=n(/*! ./loader/key-loader */"./src/loader/key-loader.ts"),s=n(/*! ./controller/id3-track-controller */"./src/controller/id3-track-controller.ts"),a=n(/*! ./controller/latency-controller */"./src/controller/latency-controller.ts"),l=n(/*! ./controller/level-controller */"./src/controller/level-controller.ts"),c=n(/*! ./controller/fragment-tracker */"./src/controller/fragment-tracker.ts"),u=n(/*! ./controller/stream-controller */"./src/controller/stream-controller.ts"),h=n(/*! ./is-supported */"./src/is-supported.ts"),d=n(/*! ./utils/logger */"./src/utils/logger.ts"),f=n(/*! ./config */"./src/config.ts"),p=n(/*! eventemitter3 */"./node_modules/eventemitter3/index.js"),v=n(/*! ./events */"./src/events.ts"),g=n(/*! ./errors */"./src/errors.ts");function m(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var y=function(){function t(e){void 0===e&&(e={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.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 n=this.config=Object(f.mergeConfig)(t.DefaultConfig,e);this.userConfig=e,Object(d.enableLogs)(n.debug),this._autoLevelCapping=-1,n.progressive&&Object(f.enableStreamingMode)(n);var i=n.abrController,h=n.bufferController,v=n.capLevelController,g=n.fpsController,m=this.abrController=new i(this),y=this.bufferController=new h(this),b=this.capLevelController=new v(this),E=new g(this),C=new r.default(this),S=new o.default(this),k=new s.default(this),w=this.levelController=new l.default(this),x=new c.FragmentTracker(this),T=this.streamController=new u.default(this,x);b.setStreamController(T),E.setStreamController(T);var O=[w,T];this.networkControllers=O;var _=[C,S,m,y,b,E,k,x];this.audioTrackController=this.createController(n.audioTrackController,null,O),this.createController(n.audioStreamController,x,O),this.subtitleTrackController=this.createController(n.subtitleTrackController,null,O),this.createController(n.subtitleStreamController,x,O),this.createController(n.timelineController,null,_),this.emeController=this.createController(n.emeController,null,_),this.cmcdController=this.createController(n.cmcdController,null,_),this.latencyController=this.createController(a.default,null,_),this.coreComponents=_}t.isSupported=function(){return Object(h.isSupported)()};var e,n,y,b=t.prototype;return b.createController=function(t,e,n){if(t){var i=e?new t(this,e):new t(this);return n&&n.push(i),i}return null},b.on=function(t,e,n){void 0===n&&(n=this),this._emitter.on(t,e,n)},b.once=function(t,e,n){void 0===n&&(n=this),this._emitter.once(t,e,n)},b.removeAllListeners=function(t){this._emitter.removeAllListeners(t)},b.off=function(t,e,n,i){void 0===n&&(n=this),this._emitter.off(t,e,n,i)},b.listeners=function(t){return this._emitter.listeners(t)},b.emit=function(t,e,n){return this._emitter.emit(t,e,n)},b.trigger=function(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(e){d.logger.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),this.trigger(v.Events.ERROR,{type:g.ErrorTypes.OTHER_ERROR,details:g.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:t,error:e})}return!1},b.listenerCount=function(t){return this._emitter.listenerCount(t)},b.destroy=function(){d.logger.log("destroy"),this.trigger(v.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(t){return t.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(t){return t.destroy()})),this.coreComponents.length=0},b.attachMedia=function(t){d.logger.log("attachMedia"),this._media=t,this.trigger(v.Events.MEDIA_ATTACHING,{media:t})},b.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(v.Events.MEDIA_DETACHING,void 0),this._media=null},b.loadSource=function(t){this.stopLoad();var e=this.media,n=this.url,r=this.url=i.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});d.logger.log("loadSource:"+r),e&&n&&n!==r&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(e)),this.trigger(v.Events.MANIFEST_LOADING,{url:t})},b.startLoad=function(t){void 0===t&&(t=-1),d.logger.log("startLoad("+t+")"),this.networkControllers.forEach((function(e){e.startLoad(t)}))},b.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach((function(t){t.stopLoad()}))},b.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},b.recoverMediaError=function(){d.logger.log("recoverMediaError");var t=this._media;this.detachMedia(),t&&this.attachMedia(t)},b.removeLevel=function(t,e){void 0===e&&(e=0),this.levelController.removeLevel(t,e)},e=t,y=[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return v.Events}},{key:"ErrorTypes",get:function(){return g.ErrorTypes}},{key:"ErrorDetails",get:function(){return g.ErrorDetails}},{key:"DefaultConfig",get:function(){return t.defaultConfig?t.defaultConfig:f.hlsDefaultConfig},set:function(e){t.defaultConfig=e}}],(n=[{key:"levels",get:function(){var t=this.levelController.levels;return t||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(t){d.logger.log("set currentLevel:"+t),this.loadLevel=t,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(t){d.logger.log("set nextLevel:"+t),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(t){d.logger.log("set loadLevel:"+t),this.levelController.manualLevel=t}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(t){this.levelController.nextLoadLevel=t}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(t){d.logger.log("set firstLevel:"+t),this.levelController.firstLevel=t}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(t){d.logger.log("set startLevel:"+t),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(t){var e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(t){this._autoLevelCapping!==t&&(d.logger.log("set autoLevelCapping:"+t),this._autoLevelCapping=t)}},{key:"bandwidthEstimate",get:function(){var t=this.abrController.bwEstimator;return t?t.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var t=this.levels,e=this.config.minAutoBitrate;if(!t)return 0;for(var n=t.length,i=0;i<n;i++)if(t[i].maxBitrate>e)return i;return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,e=this.autoLevelCapping;return-1===e&&t&&t.length?t.length-1:e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{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}}])&&m(e.prototype,n),y&&m(e,y),t}();y.defaultConfig=void 0},"./src/is-supported.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/is-supported.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: isSupported, changeTypeSupported */function(t,e,n){"use strict";n.r(e),n.d(e,"isSupported",(function(){return o})),n.d(e,"changeTypeSupported",(function(){return s}));var i=n(/*! ./utils/mediasource-helper */"./src/utils/mediasource-helper.ts");function r(){return self.SourceBuffer||self.WebKitSourceBuffer}function o(){var t=Object(i.getMediaSource)();if(!t)return!1;var e=r(),n=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),o=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!n&&!!o}function s(){var t,e=r();return"function"==typeof(null==e||null===(t=e.prototype)||void 0===t?void 0:t.changeType)}},"./src/loader/fragment-loader.ts":
|
|
|
/*!***************************************!*\
|
|
|
!*** ./src/loader/fragment-loader.ts ***!
|
|
|
\***************************************/
|
|
|
/*! exports provided: default, LoadError */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return h})),n.d(e,"LoadError",(function(){return f}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../errors */"./src/errors.ts");function o(t){var e="function"==typeof Map?new Map:void 0;return(o=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return s(t,arguments,c(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),l(i,t)})(t)}function s(t,e,n){return(s=a()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&l(r,n.prototype),r}).apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var u=Math.pow(2,17),h=function(){function t(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var n=this,i=t.url;if(!i)return Promise.reject(new f({type:r.ErrorTypes.NETWORK_ERROR,details:r.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(i?"part list":"url")));this.abort();var o=this.config,s=o.fLoader,a=o.loader;return new Promise((function(i,l){n.loader&&n.loader.destroy();var c=n.loader=t.loader=s?new s(o):new a(o),h=d(t),p={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:u};t.stats=c.stats,c.load(h,p,{onSuccess:function(e,r,o,s){n.resetLoader(t,c),i({frag:t,part:null,payload:e.data,networkDetails:s})},onError:function(e,i,o){n.resetLoader(t,c),l(new f({type:r.ErrorTypes.NETWORK_ERROR,details:r.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:o}))},onAbort:function(e,i,o){n.resetLoader(t,c),l(new f({type:r.ErrorTypes.NETWORK_ERROR,details:r.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:o}))},onTimeout:function(e,i,o){n.resetLoader(t,c),l(new f({type:r.ErrorTypes.NETWORK_ERROR,details:r.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:o}))},onProgress:function(n,i,r,o){e&&e({frag:t,part:null,payload:r,networkDetails:o})}})}))},e.loadPart=function(t,e,n){var i=this;this.abort();var o=this.config,s=o.fLoader,a=o.loader;return new Promise((function(l,c){i.loader&&i.loader.destroy();var h=i.loader=t.loader=s?new s(o):new a(o),p=d(t,e),v={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:u};e.stats=h.stats,h.load(p,v,{onSuccess:function(r,o,s,a){i.resetLoader(t,h),i.updateStatsFromPart(t,e);var c={frag:t,part:e,payload:r.data,networkDetails:a};n(c),l(c)},onError:function(n,o,s){i.resetLoader(t,h),c(new f({type:r.ErrorTypes.NETWORK_ERROR,details:r.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:n,networkDetails:s}))},onAbort:function(n,o,s){t.stats.aborted=e.stats.aborted,i.resetLoader(t,h),c(new f({type:r.ErrorTypes.NETWORK_ERROR,details:r.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:s}))},onTimeout:function(n,o,s){i.resetLoader(t,h),c(new f({type:r.ErrorTypes.NETWORK_ERROR,details:r.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:s}))}})}))},e.updateStatsFromPart=function(t,e){var n=t.stats,i=e.stats,r=i.total;if(n.loaded+=i.loaded,r){var o=Math.round(t.duration/e.duration),s=Math.min(Math.round(n.loaded/r),o),a=(o-s)*Math.round(n.loaded/s);n.total=n.loaded+a}else n.total=Math.max(n.loaded,n.total);var l=n.loading,c=i.loading;l.start?l.first+=c.first-c.start:(l.start=c.start,l.first=c.first),l.end=c.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function d(t,e){void 0===e&&(e=null);var n=e||t,r={frag:t,part:e,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},o=n.byteRangeStartOffset,s=n.byteRangeEndOffset;return Object(i.isFiniteNumber)(o)&&Object(i.isFiniteNumber)(s)&&(r.rangeStart=o,r.rangeEnd=s),r}var f=function(t){var e,n;function i(e){for(var n,i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return(n=t.call.apply(t,[this].concat(r))||this).data=void 0,n.data=e,n}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,l(e,n),i}(o(Error))},"./src/loader/fragment.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/loader/fragment.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: ElementaryStreamTypes, BaseSegment, Fragment, Part */function(t,e,n){"use strict";n.r(e),n.d(e,"ElementaryStreamTypes",(function(){return i})),n.d(e,"BaseSegment",(function(){return f})),n.d(e,"Fragment",(function(){return p})),n.d(e,"Part",(function(){return v}));var i,r=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),o=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),s=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! ./level-key */"./src/loader/level-key.ts"),l=n(/*! ./load-stats */"./src/loader/load-stats.ts");function c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,u(t,e)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function d(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),t}!function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"}(i||(i={}));var f=function(){function t(t){var e;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((e={})[i.AUDIO]=null,e[i.VIDEO]=null,e[i.AUDIOVIDEO]=null,e),this.baseurl=t}return t.prototype.setByteRange=function(t,e){var n=t.split("@",2),i=[];1===n.length?i[0]=e?e.byteRangeEndOffset:0:i[0]=parseInt(n[1]),i[1]=parseInt(n[0])+i[0],this._byteRange=i},d(t,[{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(o.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(t){this._url=t}}]),t}(),p=function(t){function e(e,n){var i;return(i=t.call(this,n)||this)._decryptdata=null,i.rawProgramDateTime=null,i.programDateTime=null,i.tagList=[],i.duration=0,i.sn=0,i.levelkey=void 0,i.type=void 0,i.loader=null,i.level=-1,i.cc=0,i.startPTS=void 0,i.endPTS=void 0,i.appendedPTS=void 0,i.startDTS=void 0,i.endDTS=void 0,i.start=0,i.deltaPTS=void 0,i.maxStartPTS=void 0,i.minEndPTS=void 0,i.stats=new l.LoadStats,i.urlId=0,i.data=void 0,i.bitrateTest=!1,i.title=null,i.initSegment=null,i.type=e,i}c(e,t);var n=e.prototype;return n.createInitializationVector=function(t){for(var e=new Uint8Array(16),n=12;n<16;n++)e[n]=t>>8*(15-n)&255;return e},n.setDecryptDataFromLevelKey=function(t,e){var n=t;return"AES-128"===(null==t?void 0:t.method)&&t.uri&&!t.iv&&((n=a.LevelKey.fromURI(t.uri)).method=t.method,n.iv=this.createInitializationVector(e),n.keyFormat="identity"),n},n.setElementaryStreamInfo=function(t,e,n,i,r,o){void 0===o&&(o=!1);var s=this.elementaryStreams,a=s[t];a?(a.startPTS=Math.min(a.startPTS,e),a.endPTS=Math.max(a.endPTS,n),a.startDTS=Math.min(a.startDTS,i),a.endDTS=Math.max(a.endDTS,r)):s[t]={startPTS:e,endPTS:n,startDTS:i,endDTS:r,partial:o}},n.clearElementaryStreamInfo=function(){var t=this.elementaryStreams;t[i.AUDIO]=null,t[i.VIDEO]=null,t[i.AUDIOVIDEO]=null},d(e,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var t=this.sn;"number"!=typeof t&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&s.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),t=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,t)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(r.isFiniteNumber)(this.programDateTime))return null;var t=Object(r.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){var t;return!(null===(t=this.decryptdata)||void 0===t||!t.keyFormat||!this.decryptdata.uri)}}]),e}(f),v=function(t){function e(e,n,i,r,o){var s;(s=t.call(this,i)||this).fragOffset=0,s.duration=0,s.gap=!1,s.independent=!1,s.relurl=void 0,s.fragment=void 0,s.index=void 0,s.stats=new l.LoadStats,s.duration=e.decimalFloatingPoint("DURATION"),s.gap=e.bool("GAP"),s.independent=e.bool("INDEPENDENT"),s.relurl=e.enumeratedString("URI"),s.fragment=n,s.index=r;var a=e.enumeratedString("BYTERANGE");return a&&s.setByteRange(a,o),o&&(s.fragOffset=o.fragOffset+o.duration),s}return c(e,t),d(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(f)},"./src/loader/key-loader.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/loader/key-loader.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return s}));var i=n(/*! ../events */"./src/events.ts"),r=n(/*! ../errors */"./src/errors.ts"),o=n(/*! ../utils/logger */"./src/utils/logger.ts"),s=function(){function t(t){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){this.hls.on(i.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(i.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){for(var t in this._unregisterListeners(),this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={}},e.onKeyLoading=function(t,e){var n=e.frag,r=n.type,s=this.loaders[r];if(n.decryptdata){var a=n.decryptdata.uri;if(a!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(s&&(o.logger.warn("abort previous key loader for type:"+r),s.abort()),!a)return void o.logger.warn("key uri is falsy");var c=l.loader,u=n.loader=this.loaders[r]=new c(l);this.decrypturl=a,this.decryptkey=null;var h={url:a,frag:n,responseType:"arraybuffer"},d={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(h,d,f)}else this.decryptkey&&(n.decryptdata.key=this.decryptkey,this.hls.trigger(i.Events.KEY_LOADED,{frag:n}))}else o.logger.warn("Missing decryption data on fragment in onKeyLoading")},e.loadsuccess=function(t,e,n){var r=n.frag;r.decryptdata?(this.decryptkey=r.decryptdata.key=new Uint8Array(t.data),r.loader=null,delete this.loaders[r.type],this.hls.trigger(i.Events.KEY_LOADED,{frag:r})):o.logger.error("after key load, decryptdata unset")},e.loaderror=function(t,e){var n=e.frag,o=n.loader;o&&o.abort(),delete this.loaders[n.type],this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.NETWORK_ERROR,details:r.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:n,response:t})},e.loadtimeout=function(t,e){var n=e.frag,o=n.loader;o&&o.abort(),delete this.loaders[n.type],this.hls.trigger(i.Events.ERROR,{type:r.ErrorTypes.NETWORK_ERROR,details:r.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:n})},t}()},"./src/loader/level-details.ts":
|
|
|
/*!*************************************!*\
|
|
|
!*** ./src/loader/level-details.ts ***!
|
|
|
\*************************************/
|
|
|
/*! exports provided: LevelDetails */function(t,e,n){"use strict";n.r(e),n.d(e,"LevelDetails",(function(){return o}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts");function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(){function t(t){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=t}var e,n,o;return t.prototype.reloaded=function(t){if(!t)return this.advanced=!0,void(this.updated=!0);var e=this.lastPartSn-t.lastPartSn,n=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!n||!!e,this.advanced=this.endSN>t.endSN||e>0||0===e&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},e=t,(n=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(i.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!==(t=this.fragments)&&void 0!==t&&t.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 t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&r(e.prototype,n),o&&r(e,o),t}()},"./src/loader/level-key.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/loader/level-key.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: LevelKey */function(t,e,n){"use strict";n.r(e),n.d(e,"LevelKey",(function(){return o}));var i=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js");function r(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(){function t(t,e){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,this._uri=e?Object(i.buildAbsoluteURL)(t,e,{alwaysNormalize:!0}):t}var e,n,o;return t.fromURL=function(e,n){return new t(e,n)},t.fromURI=function(e){return new t(e)},e=t,(n=[{key:"uri",get:function(){return this._uri}}])&&r(e.prototype,n),o&&r(e,o),t}()},"./src/loader/load-stats.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/loader/load-stats.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: LoadStats */function(t,e,n){"use strict";n.r(e),n.d(e,"LoadStats",(function(){return i}));var i=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":
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/loader/m3u8-parser.ts ***!
|
|
|
\***********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return g}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),o=n(/*! ./fragment */"./src/loader/fragment.ts"),s=n(/*! ./level-details */"./src/loader/level-details.ts"),a=n(/*! ./level-key */"./src/loader/level-key.ts"),l=n(/*! ../utils/attr-list */"./src/utils/attr-list.ts"),c=n(/*! ../utils/logger */"./src/utils/logger.ts"),u=n(/*! ../utils/codecs */"./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,d=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),p=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("|")),v=/\.(mp4|m4s|m4v|m4a)$/i,g=function(){function t(){}return t.findGroup=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(i.id===e)return i}},t.convertAVC1ToAVCOTI=function(t){var e=t.split(".");if(e.length>2){var n=e.shift()+".";return n+=parseInt(e.shift()).toString(16),n+=("000"+parseInt(e.shift()).toString(16)).substr(-4)}return t},t.resolve=function(t,e){return r.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,n){var i,r=[],o={},s=!1;for(h.lastIndex=0;null!=(i=h.exec(e));)if(i[1]){var a=new l.AttrList(i[1]),c={attrs:a,bitrate:a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),name:a.NAME,url:t.resolve(i[2],n)},u=a.decimalResolution("RESOLUTION");u&&(c.width=u.width,c.height=u.height),m((a.CODECS||"").split(/[ ,]+/).filter((function(t){return t})),c),c.videoCodec&&-1!==c.videoCodec.indexOf("avc1")&&(c.videoCodec=t.convertAVC1ToAVCOTI(c.videoCodec)),r.push(c)}else if(i[3]){var d=new l.AttrList(i[3]);d["DATA-ID"]&&(s=!0,o[d["DATA-ID"]]=d)}return{levels:r,sessionData:s?o:null}},t.parseMasterPlaylistMedia=function(e,n,i,r){var o;void 0===r&&(r=[]);var s=[],a=0;for(d.lastIndex=0;null!==(o=d.exec(e));){var c=new l.AttrList(o[1]);if(c.TYPE===i){var u={attrs:c,bitrate:0,id:a++,groupId:c["GROUP-ID"],instreamId:c["INSTREAM-ID"],name:c.NAME||c.LANGUAGE||"",type:i,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:c.LANGUAGE,url:c.URI?t.resolve(c.URI,n):""};if(r.length){var h=t.findGroup(r,u.groupId)||r[0];y(u,h,"audioCodec"),y(u,h,"textCodec")}s.push(u)}}return s},t.parseLevelPlaylist=function(t,e,n,u,h){var d,g,m,y=new s.LevelDetails(e),E=y.fragments,C=null,S=0,k=0,w=0,x=0,T=null,O=new o.Fragment(u,e),_=-1,A=!1;for(f.lastIndex=0,y.m3u8=t;null!==(d=f.exec(t));){A&&(A=!1,(O=new o.Fragment(u,e)).start=w,O.sn=S,O.cc=x,O.level=n,C&&(O.initSegment=C,O.rawProgramDateTime=C.rawProgramDateTime));var L=d[1];if(L){O.duration=parseFloat(L);var R=(" "+d[2]).slice(1);O.title=R||null,O.tagList.push(R?["INF",L,R]:["INF",L])}else if(d[3])Object(i.isFiniteNumber)(O.duration)&&(O.start=w,m&&(O.levelkey=m),O.sn=S,O.level=n,O.cc=x,O.urlId=h,E.push(O),O.relurl=(" "+d[3]).slice(1),b(O,T),T=O,w+=O.duration,S++,k=0,A=!0);else if(d[4]){var D=(" "+d[4]).slice(1);T?O.setByteRange(D,T):O.setByteRange(D)}else if(d[5])O.rawProgramDateTime=(" "+d[5]).slice(1),O.tagList.push(["PROGRAM-DATE-TIME",O.rawProgramDateTime]),-1===_&&(_=E.length);else{if(!(d=d[0].match(p))){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(g=1;g<d.length&&void 0===d[g];g++);var I=(" "+d[g]).slice(1),M=(" "+d[g+1]).slice(1),P=d[g+2]?(" "+d[g+2]).slice(1):"";switch(I){case"PLAYLIST-TYPE":y.type=M.toUpperCase();break;case"MEDIA-SEQUENCE":S=y.startSN=parseInt(M);break;case"SKIP":var N=new l.AttrList(M),j=N.decimalInteger("SKIPPED-SEGMENTS");if(Object(i.isFiniteNumber)(j)){y.skippedSegments=j;for(var B=j;B--;)E.unshift(null);S+=j}var F=N.enumeratedString("RECENTLY-REMOVED-DATERANGES");F&&(y.recentlyRemovedDateranges=F.split("\t"));break;case"TARGETDURATION":y.targetduration=parseFloat(M);break;case"VERSION":y.version=parseInt(M);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(M||P)&&O.tagList.push(P?[M,P]:[M]);break;case"DIS":x++;case"GAP":O.tagList.push([I]);break;case"BITRATE":O.tagList.push([I,M]);break;case"DISCONTINUITY-SEQ":x=parseInt(M);break;case"KEY":var U,G=new l.AttrList(M),H=G.enumeratedString("METHOD"),z=G.URI,V=G.hexadecimalInteger("IV"),K=G.enumeratedString("KEYFORMATVERSIONS"),W=G.enumeratedString("KEYID"),Y=null!=(U=G.enumeratedString("KEYFORMAT"))?U:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf(Y)>-1){c.logger.warn("Keyformat "+Y+" is not supported from the manifest");continue}if("identity"!==Y)continue;H&&(m=a.LevelKey.fromURL(e,z),z&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(H)>=0&&(m.method=H,m.keyFormat=Y,W&&(m.keyID=W),K&&(m.keyFormatVersions=K),m.iv=V));break;case"START":var q=new l.AttrList(M).decimalFloatingPoint("TIME-OFFSET");Object(i.isFiniteNumber)(q)&&(y.startTimeOffset=q);break;case"MAP":var X=new l.AttrList(M);O.relurl=X.URI,X.BYTERANGE&&O.setByteRange(X.BYTERANGE),O.level=n,O.sn="initSegment",m&&(O.levelkey=m),O.initSegment=null,C=O,A=!0;break;case"SERVER-CONTROL":var $=new l.AttrList(M);y.canBlockReload=$.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=$.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&$.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=$.optionalFloat("PART-HOLD-BACK",0),y.holdBack=$.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var Q=new l.AttrList(M);y.partTarget=Q.decimalFloatingPoint("PART-TARGET");break;case"PART":var J=y.partList;J||(J=y.partList=[]);var Z=k>0?J[J.length-1]:void 0,tt=k++,et=new o.Part(new l.AttrList(M),O,e,tt,Z);J.push(et),O.duration+=et.duration;break;case"PRELOAD-HINT":var nt=new l.AttrList(M);y.preloadHint=nt;break;case"RENDITION-REPORT":var it=new l.AttrList(M);y.renditionReports=y.renditionReports||[],y.renditionReports.push(it);break;default:c.logger.warn("line parsed but not handled: "+d)}}}T&&!T.relurl?(E.pop(),w-=T.duration,y.partList&&(y.fragmentHint=T)):y.partList&&(b(O,T),O.cc=x,y.fragmentHint=O);var rt=E.length,ot=E[0],st=E[rt-1];if((w+=y.skippedSegments*y.targetduration)>0&&rt&&st){y.averagetargetduration=w/rt;var at=st.sn;y.endSN="initSegment"!==at?at:0,ot&&(y.startCC=ot.cc,ot.initSegment||y.fragments.every((function(t){return t.relurl&&(e=t.relurl,v.test(null!=(n=null===(i=r.parseURL(e))||void 0===i?void 0:i.path)?n:""));var e,n,i}))&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(O=new o.Fragment(u,e)).relurl=st.relurl,O.level=n,O.sn="initSegment",ot.initSegment=O,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(w+=y.fragmentHint.duration),y.totalduration=w,y.endCC=x,_>0&&function(t,e){for(var n=t[e],i=e;i--;){var r=t[i];if(!r)return;r.programDateTime=n.programDateTime-1e3*r.duration,n=r}}(E,_),y},t}();function m(t,e){["video","audio","text"].forEach((function(n){var i=t.filter((function(t){return Object(u.isCodecType)(t,n)}));if(i.length){var r=i.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)}));e[n+"Codec"]=r.length>0?r[0]:i[0],t=t.filter((function(t){return-1===i.indexOf(t)}))}})),e.unknownCodecs=t}function y(t,e,n){var i=e[n];i&&(t[n]=i)}function b(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),Object(i.isFiniteNumber)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":
|
|
|
/*!***************************************!*\
|
|
|
!*** ./src/loader/playlist-loader.ts ***!
|
|
|
\***************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../events */"./src/events.ts"),o=n(/*! ../errors */"./src/errors.ts"),s=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),l=n(/*! ./m3u8-parser */"./src/loader/m3u8-parser.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts"),u=n(/*! ../utils/attr-list */"./src/utils/attr-list.ts");function h(t,e){var n=t.url;return void 0!==n&&0!==n.indexOf("data:")||(n=e.url),n}var d=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(r.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(r.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(r.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(r.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(r.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(r.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,n=e.pLoader,i=e.loader,r=new(n||i)(e);return t.loader=r,this.loaders[t.type]=r,r},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var n=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:c.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var n=e.id,i=e.level,r=e.url,o=e.deliveryDirectives;this.load({id:n,groupId:null,level:i,responseType:"text",type:c.PlaylistContextType.LEVEL,url:r,deliveryDirectives:o})},e.onAudioTrackLoading=function(t,e){var n=e.id,i=e.groupId,r=e.url,o=e.deliveryDirectives;this.load({id:n,groupId:i,level:null,responseType:"text",type:c.PlaylistContextType.AUDIO_TRACK,url:r,deliveryDirectives:o})},e.onSubtitleTrackLoading=function(t,e){var n=e.id,i=e.groupId,r=e.url,o=e.deliveryDirectives;this.load({id:n,groupId:i,level:null,responseType:"text",type:c.PlaylistContextType.SUBTITLE_TRACK,url:r,deliveryDirectives:o})},e.load=function(t){var e,n,i,r,o,a,l=this.hls.config,u=this.getInternalLoader(t);if(u){var h=u.context;if(h&&h.url===t.url)return void s.logger.trace("[playlist-loader]: playlist request ongoing");s.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),u.abort()}switch(t.type){case c.PlaylistContextType.MANIFEST:n=l.manifestLoadingMaxRetry,i=l.manifestLoadingTimeOut,r=l.manifestLoadingRetryDelay,o=l.manifestLoadingMaxRetryTimeout;break;case c.PlaylistContextType.LEVEL:case c.PlaylistContextType.AUDIO_TRACK:case c.PlaylistContextType.SUBTITLE_TRACK:n=0,i=l.levelLoadingTimeOut;break;default:n=l.levelLoadingMaxRetry,i=l.levelLoadingTimeOut,r=l.levelLoadingRetryDelay,o=l.levelLoadingMaxRetryTimeout}if(u=this.createInternalLoader(t),null!==(e=t.deliveryDirectives)&&void 0!==e&&e.part&&(t.type===c.PlaylistContextType.LEVEL&&null!==t.level?a=this.hls.levels[t.level].details:t.type===c.PlaylistContextType.AUDIO_TRACK&&null!==t.id?a=this.hls.audioTracks[t.id].details:t.type===c.PlaylistContextType.SUBTITLE_TRACK&&null!==t.id&&(a=this.hls.subtitleTracks[t.id].details),a)){var d=a.partTarget,f=a.targetduration;d&&f&&(i=Math.min(1e3*Math.max(3*d,.8*f),i))}var p={timeout:i,maxRetry:n,retryDelay:r,maxRetryDelay:o,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(t,p,v)},e.loadsuccess=function(t,e,n,i){if(void 0===i&&(i=null),n.isSidxRequest)return this.handleSidxRequest(t,n),void this.handlePlaylistLoaded(t,e,n,i);this.resetInternalLoader(n.type);var r=t.data;0===r.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),r.indexOf("#EXTINF:")>0||r.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,n,i):this.handleMasterPlaylist(t,e,n,i)):this.handleManifestParsingError(t,n,"no EXTM3U delimiter",i)},e.loaderror=function(t,e,n){void 0===n&&(n=null),this.handleNetworkError(e,n,!1,t)},e.loadtimeout=function(t,e,n){void 0===n&&(n=null),this.handleNetworkError(e,n,!0)},e.handleMasterPlaylist=function(t,e,n,i){var o=this.hls,a=t.data,c=h(t,n),d=l.default.parseMasterPlaylist(a,c),f=d.levels,p=d.sessionData;if(f.length){var v=f.map((function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}})),g=f.map((function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}})),m=l.default.parseMasterPlaylistMedia(a,c,"AUDIO",v),y=l.default.parseMasterPlaylistMedia(a,c,"SUBTITLES",g),b=l.default.parseMasterPlaylistMedia(a,c,"CLOSED-CAPTIONS");m.length&&(m.some((function(t){return!t.url}))||!f[0].audioCodec||f[0].attrs.AUDIO||(s.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new u.AttrList({}),bitrate:0,url:""}))),o.trigger(r.Events.MANIFEST_LOADED,{levels:f,audioTracks:m,subtitles:y,captions:b,url:c,stats:e,networkDetails:i,sessionData:p})}else this.handleManifestParsingError(t,n,"no level found in manifest",i)},e.handleTrackOrLevelPlaylist=function(t,e,n,s){var a=this.hls,d=n.id,f=n.level,p=n.type,v=h(t,n),g=Object(i.isFiniteNumber)(d)?d:0,m=Object(i.isFiniteNumber)(f)?f:g,y=function(t){switch(t.type){case c.PlaylistContextType.AUDIO_TRACK:return c.PlaylistLevelType.AUDIO;case c.PlaylistContextType.SUBTITLE_TRACK:return c.PlaylistLevelType.SUBTITLE;default:return c.PlaylistLevelType.MAIN}}(n),b=l.default.parseLevelPlaylist(t.data,v,m,y,g);if(b.fragments.length){if(p===c.PlaylistContextType.MANIFEST){var E={attrs:new u.AttrList({}),bitrate:0,details:b,name:"",url:v};a.trigger(r.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:v,stats:e,networkDetails:s,sessionData:null})}if(e.parsing.end=performance.now(),b.needSidxRanges){var C,S=null===(C=b.fragments[0].initSegment)||void 0===C?void 0:C.url;this.load({url:S,isSidxRequest:!0,type:p,level:f,levelDetails:b,id:d,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else n.levelDetails=b,this.handlePlaylistLoaded(t,e,n,s)}else a.trigger(r.Events.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:"number"==typeof n.level?n.level:void 0})},e.handleSidxRequest=function(t,e){var n=Object(a.parseSegmentIndex)(new Uint8Array(t.data));if(n){var i=n.references,r=e.levelDetails;i.forEach((function(t,e){var i=t.info,o=r.fragments[e];0===o.byteRange.length&&o.setByteRange(String(1+i.end-i.start)+"@"+String(i.start)),o.initSegment&&o.initSegment.setByteRange(String(n.moovEndOffset)+"@0")}))}},e.handleManifestParsingError=function(t,e,n,i){this.hls.trigger(r.Events.ERROR,{type:o.ErrorTypes.NETWORK_ERROR,details:o.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:e.type===c.PlaylistContextType.MANIFEST,url:t.url,reason:n,response:t,context:e,networkDetails:i})},e.handleNetworkError=function(t,e,n,i){void 0===n&&(n=!1),s.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var a=o.ErrorDetails.UNKNOWN,l=!1,u=this.getInternalLoader(t);switch(t.type){case c.PlaylistContextType.MANIFEST:a=n?o.ErrorDetails.MANIFEST_LOAD_TIMEOUT:o.ErrorDetails.MANIFEST_LOAD_ERROR,l=!0;break;case c.PlaylistContextType.LEVEL:a=n?o.ErrorDetails.LEVEL_LOAD_TIMEOUT:o.ErrorDetails.LEVEL_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.AUDIO_TRACK:a=n?o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.SUBTITLE_TRACK:a=n?o.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:o.ErrorDetails.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(t.type);var h={type:o.ErrorTypes.NETWORK_ERROR,details:a,fatal:l,url:t.url,loader:u,context:t,networkDetails:e};i&&(h.response=i),this.hls.trigger(r.Events.ERROR,h)},e.handlePlaylistLoaded=function(t,e,n,i){var o=n.type,s=n.level,a=n.id,l=n.groupId,u=n.loader,h=n.levelDetails,d=n.deliveryDirectives;if(null!=h&&h.targetduration){if(u)switch(h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),u.getCacheAge&&!isNaN(h.ageHeader)||(h.ageHeader=0)),o){case c.PlaylistContextType.MANIFEST:case c.PlaylistContextType.LEVEL:this.hls.trigger(r.Events.LEVEL_LOADED,{details:h,level:s||0,id:a||0,stats:e,networkDetails:i,deliveryDirectives:d});break;case c.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(r.Events.AUDIO_TRACK_LOADED,{details:h,id:a||0,groupId:l||"",stats:e,networkDetails:i,deliveryDirectives:d});break;case c.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(r.Events.SUBTITLE_TRACK_LOADED,{details:h,id:a||0,groupId:l||"",stats:e,networkDetails:i,deliveryDirectives:d})}}else this.handleManifestParsingError(t,n,"invalid target duration",i)},t}();e.default=d},"./src/polyfills/number.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/polyfills/number.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: isFiniteNumber, MAX_SAFE_INTEGER */function(t,e,n){"use strict";n.r(e),n.d(e,"isFiniteNumber",(function(){return i})),n.d(e,"MAX_SAFE_INTEGER",(function(){return r}));var i=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},r=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/remux/aac-helper.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=function(){function t(){}return t.getSilentFrame=function(t,e){switch(t){case"mp4a.40.2":if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)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(6===e)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(1===e)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(2===e)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(3===e)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])}},t}();e.default=i},"./src/remux/mp4-generator.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/remux/mp4-generator.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=Math.pow(2,32)-1,r=function(){function t(){}return t.init=function(){var e;for(e in t.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:[]},t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var n=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]),i=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]);t.HDLR_TYPES={video:n,audio:i};var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),o=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=o,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var s=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,s,l,s,a),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,r))},t.box=function(t){for(var e=8,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];for(var o=i.length,s=o;o--;)e+=i[o].byteLength;var a=new Uint8Array(e);for(a[0]=e>>24&255,a[1]=e>>16&255,a[2]=e>>8&255,a[3]=255&e,a.set(t,4),o=0,e=8;o<s;o++)a.set(i[o],e),e+=i[o].byteLength;return a},t.hdlr=function(e){return t.box(t.types.hdlr,t.HDLR_TYPES[e])},t.mdat=function(e){return t.box(t.types.mdat,e)},t.mdhd=function(e,n){n*=e;var r=Math.floor(n/(i+1)),o=Math.floor(n%(i+1));return t.box(t.types.mdhd,new Uint8Array([1,0,0,0,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,255&e,r>>24,r>>16&255,r>>8&255,255&r,o>>24,o>>16&255,o>>8&255,255&o,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,n,i){return t.box(t.types.moof,t.mfhd(e),t.traf(i,n))},t.moov=function(e){for(var n=e.length,i=[];n--;)i[n]=t.trak(e[n]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(t.mvex(e)))},t.mvex=function(e){for(var n=e.length,i=[];n--;)i[n]=t.trex(e[n]);return t.box.apply(null,[t.types.mvex].concat(i))},t.mvhd=function(e,n){n*=e;var r=Math.floor(n/(i+1)),o=Math.floor(n%(i+1)),s=new Uint8Array([1,0,0,0,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,255&e,r>>24,r>>16&255,r>>8&255,255&r,o>>24,o>>16&255,o>>8&255,255&o,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 t.box(t.types.mvhd,s)},t.sdtp=function(e){var n,i,r=e.samples||[],o=new Uint8Array(4+r.length);for(n=0;n<r.length;n++)i=r[n].flags,o[n+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return t.box(t.types.sdtp,o)},t.stbl=function(e){return t.box(t.types.stbl,t.stsd(e),t.box(t.types.stts,t.STTS),t.box(t.types.stsc,t.STSC),t.box(t.types.stsz,t.STSZ),t.box(t.types.stco,t.STCO))},t.avc1=function(e){var n,i,r,o=[],s=[];for(n=0;n<e.sps.length;n++)r=(i=e.sps[n]).byteLength,o.push(r>>>8&255),o.push(255&r),o=o.concat(Array.prototype.slice.call(i));for(n=0;n<e.pps.length;n++)r=(i=e.pps[n]).byteLength,s.push(r>>>8&255),s.push(255&r),s=s.concat(Array.prototype.slice.call(i));var a=t.box(t.types.avcC,new Uint8Array([1,o[3],o[4],o[5],255,224|e.sps.length].concat(o).concat([e.pps.length]).concat(s))),l=e.width,c=e.height,u=e.pixelRatio[0],h=e.pixelRatio[1];return t.box(t.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,l>>8&255,255&l,c>>8&255,255&c,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,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,h>>24,h>>16&255,h>>8&255,255&h])))},t.esds=function(t){var e=t.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(t.config).concat([6,1,2]))},t.mp4a=function(e){var n=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var n=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var n=e.id,r=e.duration*e.timescale,o=e.width,s=e.height,a=Math.floor(r/(i+1)),l=Math.floor(r%(i+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,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,255&n,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,l>>24,l>>16&255,l>>8&255,255&l,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,o>>8&255,255&o,0,0,s>>8&255,255&s,0,0]))},t.traf=function(e,n){var r=t.sdtp(e),o=e.id,s=Math.floor(n/(i+1)),a=Math.floor(n%(i+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,a>>24,a>>16&255,a>>8&255,255&a])),t.trun(e,r.length+16+20+8+16+8+8),r)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var n=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,n){var i,r,o,s,a,l,c=e.samples||[],u=c.length,h=12+16*u,d=new Uint8Array(h);for(n+=8+h,d.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0),i=0;i<u;i++)o=(r=c[i]).duration,s=r.size,a=r.flags,l=r.cts,d.set([o>>>24&255,o>>>16&255,o>>>8&255,255&o,s>>>24&255,s>>>16&255,s>>>8&255,255&s,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,61440&a.degradPrio,15&a.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*i);return t.box(t.types.trun,d)},t.initSegment=function(e){t.types||t.init();var n=t.moov(e),i=new Uint8Array(t.FTYP.byteLength+n.byteLength);return i.set(t.FTYP),i.set(n,t.FTYP.byteLength),i},t}();r.types=void 0,r.HDLR_TYPES=void 0,r.STTS=void 0,r.STSC=void 0,r.STCO=void 0,r.STSZ=void 0,r.VMHD=void 0,r.SMHD=void 0,r.STSD=void 0,r.FTYP=void 0,r.DINF=void 0,e.default=r},"./src/remux/mp4-remuxer.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/remux/mp4-remuxer.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default, normalizePts */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return v})),n.d(e,"normalizePts",(function(){return g}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ./aac-helper */"./src/remux/aac-helper.ts"),o=n(/*! ./mp4-generator */"./src/remux/mp4-generator.ts"),s=n(/*! ../events */"./src/events.ts"),a=n(/*! ../errors */"./src/errors.ts"),l=n(/*! ../utils/logger */"./src/utils/logger.ts"),c=n(/*! ../types/loader */"./src/types/loader.ts"),u=n(/*! ../utils/timescale-conversion */"./src/utils/timescale-conversion.ts");function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var d=null,f=null,p=!1,v=function(){function t(t,e,n,i){if(void 0===i&&(i=""),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=t,this.config=e,this.typeSupported=n,this.ISGenerated=!1,null===d){var r=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);d=r?parseInt(r[1]):0}if(null===f){var o=navigator.userAgent.match(/Safari\/(\d+)/i);f=o?parseInt(o[1]):0}p=!!d&&d<75||!!f&&f<600}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){l.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t},e.resetNextTimestamp=function(){l.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},e.resetInitSegment=function(){l.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},e.getVideoStartPts=function(t){var e=!1,n=t.reduce((function(t,n){var i=n.pts-t;return i<-4294967296?(e=!0,g(t,n.pts)):i>0?t:n.pts}),t[0].pts);return e&&l.logger.debug("PTS rollover detected"),n},e.remux=function(t,e,n,i,r,o,s,a){var u,h,d,f,p,v,m=r,y=r,b=t.pid>-1,E=e.pid>-1,C=e.samples.length,S=t.samples.length>0,k=C>1;if((!b||S)&&(!E||k)||this.ISGenerated||s){this.ISGenerated||(d=this.generateIS(t,e,r));var w=this.isVideoContiguous,x=-1;if(k&&(x=function(t){for(var e=0;e<t.length;e++)if(t[e].key)return e;return-1}(e.samples),!w&&this.config.forceKeyFrameOnDiscontinuity))if(v=!0,x>0){l.logger.warn("[mp4-remuxer]: Dropped "+x+" out of "+C+" video samples due to a missing keyframe");var T=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(x),e.dropped+=x,y+=(e.samples[0].pts-T)/(e.timescale||9e4)}else-1===x&&(l.logger.warn("[mp4-remuxer]: No keyframe found out of "+C+" video samples"),v=!1);if(this.ISGenerated){if(S&&k){var O=this.getVideoStartPts(e.samples),_=(g(t.samples[0].pts,O)-O)/e.inputTimeScale;m+=Math.max(0,_),y+=Math.max(0,-_)}if(S){if(t.samplerate||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(t,e,r)),h=this.remuxAudio(t,m,this.isAudioContiguous,o,E||k||a===c.PlaylistLevelType.AUDIO?y:void 0),k){var A=h?h.endPTS-h.startPTS:0;e.inputTimeScale||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(t,e,r)),u=this.remuxVideo(e,y,w,A)}}else k&&(u=this.remuxVideo(e,y,w,0));u&&(u.firstKeyFrame=x,u.independent=-1!==x)}}return this.ISGenerated&&(n.samples.length&&(p=this.remuxID3(n,r)),i.samples.length&&(f=this.remuxText(i,r))),{audio:h,video:u,initSegment:d,independent:v,text:f,id3:p}},e.generateIS=function(t,e,n){var r,s,a,l=t.samples,c=e.samples,u=this.typeSupported,h={},d=!Object(i.isFiniteNumber)(this._initPTS),f="audio/mp4";if(d&&(r=s=1/0),t.config&&l.length&&(t.timescale=t.samplerate,t.isAAC||(u.mpeg?(f="audio/mpeg",t.codec=""):u.mp3&&(t.codec="mp3")),h.audio={id:"audio",container:f,codec:t.codec,initSegment:!t.isAAC&&u.mpeg?new Uint8Array(0):o.default.initSegment([t]),metadata:{channelCount:t.channelCount}},d&&(a=t.inputTimeScale,r=s=l[0].pts-Math.round(a*n))),e.sps&&e.pps&&c.length&&(e.timescale=e.inputTimeScale,h.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:o.default.initSegment([e]),metadata:{width:e.width,height:e.height}},d)){a=e.inputTimeScale;var p=this.getVideoStartPts(c),v=Math.round(a*n);s=Math.min(s,g(c[0].dts,p)-v),r=Math.min(r,p-v)}if(Object.keys(h).length)return this.ISGenerated=!0,d&&(this._initPTS=r,this._initDTS=s),{tracks:h,initPTS:r,timescale:a}},e.remuxVideo=function(t,e,n,i){var r,c,f,v=t.inputTimeScale,y=t.samples,b=[],E=y.length,C=this._initPTS,S=this.nextAvcDts,k=8,w=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,T=0,O=!1;n&&null!==S||(S=e*v-(y[0].pts-g(y[0].dts,y[0].pts)));for(var _=0;_<E;_++){var A=y[_];A.pts=g(A.pts-C,S),A.dts=g(A.dts-C,S),A.dts>A.pts&&(T=Math.max(Math.min(T,A.pts-A.dts),-18e3)),A.dts<y[_>0?_-1:_].dts&&(O=!0)}O&&y.sort((function(t,e){var n=t.dts-e.dts,i=t.pts-e.pts;return n||i})),c=y[0].dts,f=y[y.length-1].dts;var L=Math.round((f-c)/(E-1));if(T<0){if(T<-2*L){l.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(u.toMsFromMpegTsClock)(-L,!0)+" ms");for(var R=T,D=0;D<E;D++)y[D].dts=R=Math.max(R,y[D].pts-L),y[D].pts=Math.max(R,y[D].pts)}else{l.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(u.toMsFromMpegTsClock)(T,!0)+" ms to overcome this issue");for(var I=0;I<E;I++)y[I].dts=y[I].dts+T}c=y[0].dts}if(n){var M=c-S,P=M>L;if(P||M<-1){P?l.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(M,!0)+" ms ("+M+"dts) hole between fragments detected, filling it"):l.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(-M,!0)+" ms ("+M+"dts) overlapping between fragments detected"),c=S;var N=y[0].pts-M;y[0].dts=c,y[0].pts=N,l.logger.log("Video: First PTS/DTS adjusted: "+Object(u.toMsFromMpegTsClock)(N,!0)+"/"+Object(u.toMsFromMpegTsClock)(c,!0)+", delta: "+Object(u.toMsFromMpegTsClock)(M,!0)+" ms")}}p&&(c=Math.max(0,c));for(var j=0,B=0,F=0;F<E;F++){for(var U=y[F],G=U.units,H=G.length,z=0,V=0;V<H;V++)z+=G[V].data.length;B+=z,j+=H,U.length=z,U.dts=Math.max(U.dts,c),U.pts=Math.max(U.pts,U.dts,0),w=Math.min(U.pts,w),x=Math.max(U.pts,x)}f=y[E-1].dts;var K,W=B+4*j+8;try{K=new Uint8Array(W)}catch(t){return void this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:W,reason:"fail allocating video mdat "+W})}var Y=new DataView(K.buffer);Y.setUint32(0,W),K.set(o.default.types.mdat,4);for(var q=0;q<E;q++){for(var X=y[q],$=X.units,Q=0,J=0,Z=$.length;J<Z;J++){var tt=$[J],et=tt.data,nt=tt.data.byteLength;Y.setUint32(k,nt),k+=4,K.set(et,k),k+=nt,Q+=4+nt}if(q<E-1)r=y[q+1].dts-X.dts;else{var it=this.config,rt=X.dts-y[q>0?q-1:q].dts;if(it.stretchShortVideoTrack&&null!==this.nextAudioPts){var ot=Math.floor(it.maxBufferHole*v),st=(i?w+i*v:this.nextAudioPts)-X.pts;st>ot?((r=st-rt)<0&&(r=rt),l.logger.log("[mp4-remuxer]: It is approximately "+st/90+" ms to the next segment; using duration "+r/90+" ms for the last video frame.")):r=rt}else r=rt}var at=Math.round(X.pts-X.dts);b.push(new m(X.key,r,Q,at))}if(b.length&&d&&d<70){var lt=b[0].flags;lt.dependsOn=2,lt.isNonSync=0}console.assert(void 0!==r,"mp4SampleDuration must be computed"),this.nextAvcDts=S=f+r,this.isVideoContiguous=!0;var ct={data1:o.default.moof(t.sequenceNumber++,c,h({},t,{samples:b})),data2:K,startPTS:w/v,endPTS:(x+r)/v,startDTS:c/v,endDTS:S/v,type:"video",hasAudio:!1,hasVideo:!0,nb:b.length,dropped:t.dropped};return t.samples=[],t.dropped=0,console.assert(K.length,"MDAT length must not be zero"),ct},e.remuxAudio=function(t,e,n,i,c){var u=t.inputTimeScale,d=u/(t.samplerate?t.samplerate:u),f=t.isAAC?1024:1152,p=f*d,v=this._initPTS,y=!t.isAAC&&this.typeSupported.mpeg,b=[],E=t.samples,C=y?0:8,S=this.nextAudioPts||-1,k=e*u;if(this.isAudioContiguous=n=n||E.length&&S>0&&(i&&Math.abs(k-S)<9e3||Math.abs(g(E[0].pts-v,k)-S)<20*p),E.forEach((function(t){t.pts=g(t.pts-v,k)})),!n||S<0){if(!(E=E.filter((function(t){return t.pts>=0}))).length)return;S=0===c?0:i?Math.max(0,k):E[0].pts}if(t.isAAC)for(var w=void 0!==c,x=this.config.maxAudioFramesDrift,T=0,O=S;T<E.length;T++){var _=E[T],A=_.pts,L=A-O,R=Math.abs(1e3*L/u);if(L<=-x*p&&w)0===T&&(l.logger.warn("Audio frame @ "+(A/u).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*L/u)+" ms."),this.nextAudioPts=S=O=A);else if(L>=x*p&&R<1e4&&w){var D=Math.round(L/p);(O=A-D*p)<0&&(D--,O+=p),0===T&&(this.nextAudioPts=S=O),l.logger.warn("[mp4-remuxer]: Injecting "+D+" audio frame @ "+(O/u).toFixed(3)+"s due to "+Math.round(1e3*L/u)+" ms gap.");for(var I=0;I<D;I++){var M=Math.max(O,0),P=r.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);P||(l.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),P=_.unit.subarray()),E.splice(T,0,{unit:P,pts:M}),O+=p,T++}}_.pts=O,O+=p}for(var N,j=null,B=null,F=0,U=E.length;U--;)F+=E[U].unit.byteLength;for(var G=0,H=E.length;G<H;G++){var z=E[G],V=z.unit,K=z.pts;if(null!==B)b[G-1].duration=Math.round((K-B)/d);else{if(n&&t.isAAC&&(K=S),j=K,!(F>0))return;F+=C;try{N=new Uint8Array(F)}catch(t){return void this.observer.emit(s.Events.ERROR,s.Events.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:F,reason:"fail allocating audio mdat "+F})}y||(new DataView(N.buffer).setUint32(0,F),N.set(o.default.types.mdat,4))}N.set(V,C);var W=V.byteLength;C+=W,b.push(new m(!0,f,W,0)),B=K}var Y=b.length;if(Y){var q=b[b.length-1];this.nextAudioPts=S=B+d*q.duration;var X=y?new Uint8Array(0):o.default.moof(t.sequenceNumber++,j/d,h({},t,{samples:b}));t.samples=[];var $=j/u,Q=S/u,J={data1:X,data2:N,startPTS:$,endPTS:Q,startDTS:$,endDTS:Q,type:"audio",hasAudio:!0,hasVideo:!1,nb:Y};return this.isAudioContiguous=!0,console.assert(N.length,"MDAT length must not be zero"),J}},e.remuxEmptyAudio=function(t,e,n,i){var o=t.inputTimeScale,s=o/(t.samplerate?t.samplerate:o),a=this.nextAudioPts,c=(null!==a?a:i.startDTS*o)+this._initDTS,u=i.endDTS*o+this._initDTS,h=1024*s,d=Math.ceil((u-c)/h),f=r.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(l.logger.warn("[mp4-remuxer]: remux empty Audio"),f){for(var p=[],v=0;v<d;v++){var g=c+v*h;p.push({unit:f,pts:g,dts:g})}return t.samples=p,this.remuxAudio(t,e,n,!1)}l.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},e.remuxID3=function(t,e){var n=t.samples.length;if(n){for(var i=t.inputTimeScale,r=this._initPTS,o=this._initDTS,s=0;s<n;s++){var a=t.samples[s];a.pts=g(a.pts-r,e*i)/i,a.dts=g(a.dts-o,e*i)/i}var l=t.samples;return t.samples=[],{samples:l}}},e.remuxText=function(t,e){var n=t.samples.length;if(n){for(var i=t.inputTimeScale,r=this._initPTS,o=0;o<n;o++){var s=t.samples[o];s.pts=g(s.pts-r,e*i)/i}t.samples.sort((function(t,e){return t.pts-e.pts}));var a=t.samples;return t.samples=[],{samples:a}}},t}();function g(t,e){var n;if(null===e)return t;for(n=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=n;return t}var m=function(t,e,n,i){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=n,this.cts=i,this.flags=new y(t)},y=function(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}},"./src/remux/passthrough-remuxer.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/remux/passthrough-remuxer.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),o=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),s=n(/*! ../utils/logger */"./src/utils/logger.ts"),a=function(){function t(){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 e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){this.initPTS=t,this.lastEndDTS=null},e.resetNextTimestamp=function(){this.lastEndDTS=null},e.resetInitSegment=function(t,e,n){this.audioCodec=e,this.videoCodec=n,this.generateInitSegment(t),this.emitInitSegment=!0},e.generateInitSegment=function(t){var e=this.audioCodec,n=this.videoCodec;if(!t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var i=this.initData=Object(r.parseInitSegment)(t);e||(e=c(i.audio,o.ElementaryStreamTypes.AUDIO)),n||(n=c(i.video,o.ElementaryStreamTypes.VIDEO));var a={};i.audio&&i.video?a.audiovideo={container:"video/mp4",codec:e+","+n,initSegment:t,id:"main"}:i.audio?a.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:i.video?a.video={container:"video/mp4",codec:n,initSegment:t,id:"main"}:s.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},e.remux=function(t,e,n,o,a){var c=this.initPTS,u=this.lastEndDTS,h={audio:void 0,video:void 0,text:o,id3:n,initSegment:void 0};Object(i.isFiniteNumber)(u)||(u=this.lastEndDTS=a||0);var d=e.samples;if(!d||!d.length)return h;var f={initPTS:void 0,timescale:1},p=this.initData;if(p&&p.length||(this.generateInitSegment(d),p=this.initData),!p||!p.length)return s.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1),Object(i.isFiniteNumber)(c)||(this.initPTS=f.initPTS=c=l(p,d,u));var v=Object(r.getDuration)(d,p),g=u,m=v+g;Object(r.offsetStartDTS)(p,d,c),v>0?this.lastEndDTS=m:(s.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var y=!!p.audio,b=!!p.video,E="";y&&(E+="audio"),b&&(E+="video");var C={data1:d,startPTS:g,startDTS:g,endPTS:m,endDTS:m,type:E,hasAudio:y,hasVideo:b,nb:1,dropped:0};return h.audio="audio"===C.type?C:void 0,h.video="audio"!==C.type?C:void 0,h.text=o,h.id3=n,h.initSegment=f,h},t}(),l=function(t,e,n){return Object(r.getStartDTS)(t,e)-n};function c(t,e){var n=null==t?void 0:t.codec;return n&&n.length>4?n:"hvc1"===n?"hvc1.1.c.L120.90":"av01"===n?"av01.0.04M.08":"avc1"===n||e===o.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}e.default=a},"./src/task-loop.ts":
|
|
|
/*!**************************!*\
|
|
|
!*** ./src/task-loop.ts ***!
|
|
|
\**************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return i}));var i=function(){function t(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var e=t.prototype;return e.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},e.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.onHandlerDestroyed=function(){},e.hasInterval=function(){return!!this._tickInterval},e.hasNextTick=function(){return!!this._tickTimer},e.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,t),!0)},e.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}()},"./src/types/cmcd.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/types/cmcd.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: CMCDVersion, CMCDObjectType, CMCDStreamingFormat, CMCDStreamType */function(t,e,n){"use strict";n.r(e),n.d(e,"CMCDVersion",(function(){return s})),n.d(e,"CMCDObjectType",(function(){return i})),n.d(e,"CMCDStreamingFormat",(function(){return r})),n.d(e,"CMCDStreamType",(function(){return o}));var i,r,o,s=1;!function(t){t.MANIFEST="m",t.AUDIO="a",t.VIDEO="v",t.MUXED="av",t.INIT="i",t.CAPTION="c",t.TIMED_TEXT="tt",t.KEY="k",t.OTHER="o"}(i||(i={})),function(t){t.DASH="d",t.HLS="h",t.SMOOTH="s",t.OTHER="o"}(r||(r={})),function(t){t.VOD="v",t.LIVE="l"}(o||(o={}))},"./src/types/level.ts":
|
|
|
/*!****************************!*\
|
|
|
!*** ./src/types/level.ts ***!
|
|
|
\****************************/
|
|
|
/*! exports provided: HlsSkip, getSkipValue, HlsUrlParameters, Level */function(t,e,n){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var r;function o(t,e){var n=t.canSkipUntil,i=t.canSkipDateRanges,o=t.endSN;return n&&(void 0!==e?e-o:0)<n?i?r.v2:r.Yes:r.No}n.r(e),n.d(e,"HlsSkip",(function(){return r})),n.d(e,"getSkipValue",(function(){return o})),n.d(e,"HlsUrlParameters",(function(){return s})),n.d(e,"Level",(function(){return a})),function(t){t.No="",t.Yes="YES",t.v2="v2"}(r||(r={}));var s=function(){function t(t,e,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=n}return t.prototype.addDirectives=function(t){var e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.toString()},t}(),a=function(){function t(t){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=[t.url],this.attrs=t.attrs,this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.unknownCodecs=t.unknownCodecs,this.codecSet=[t.videoCodec,t.audioCodec].filter((function(t){return t})).join(",").replace(/\.[^.,]+/g,"")}var e,n,r;return e=t,(n=[{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(t){var e=t%this.url.length;this._urlId!==e&&(this.details=void 0,this._urlId=e)}}])&&i(e.prototype,n),r&&i(e,r),t}()},"./src/types/loader.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/types/loader.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: PlaylistContextType, PlaylistLevelType */function(t,e,n){"use strict";var i,r;n.r(e),n.d(e,"PlaylistContextType",(function(){return i})),n.d(e,"PlaylistLevelType",(function(){return r})),function(t){t.MANIFEST="manifest",t.LEVEL="level",t.AUDIO_TRACK="audioTrack",t.SUBTITLE_TRACK="subtitleTrack"}(i||(i={})),function(t){t.MAIN="main",t.AUDIO="audio",t.SUBTITLE="subtitle"}(r||(r={}))},"./src/types/transmuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/types/transmuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: ChunkMetadata */function(t,e,n){"use strict";n.r(e),n.d(e,"ChunkMetadata",(function(){return i}));var i=function(t,e,n,i,r,o){void 0===i&&(i=0),void 0===r&&(r=-1),void 0===o&&(o=!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={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=n,this.size=i,this.part=r,this.partial=o}},"./src/utils/attr-list.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/utils/attr-list.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: AttrList */function(t,e,n){"use strict";n.r(e),n.d(e,"AttrList",(function(){return o}));var i=/^(\d+)x(\d+)$/,r=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,o=function(){function t(e){for(var n in"string"==typeof e&&(e=t.parseAttrList(e)),e)e.hasOwnProperty(n)&&(this[n]=e[n])}var e=t.prototype;return e.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var n=new Uint8Array(e.length/2),i=0;i<e.length/2;i++)n[i]=parseInt(e.slice(2*i,2*i+2),16);return n}return null},e.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var n=this[t];return n?parseFloat(n):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=i.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,n={};for(r.lastIndex=0;null!==(e=r.exec(t));){var i=e[2];0===i.indexOf('"')&&i.lastIndexOf('"')===i.length-1&&(i=i.slice(1,-1)),n[e[1]]=i}return n},t}()},"./src/utils/binary-search.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/binary-search.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),e.default={search:function(t,e){for(var n=0,i=t.length-1,r=null,o=null;n<=i;){var s=e(o=t[r=(n+i)/2|0]);if(s>0)n=r+1;else{if(!(s<0))return o;i=r-1}}return null}}},"./src/utils/buffer-helper.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/buffer-helper.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: BufferHelper */function(t,e,n){"use strict";n.r(e),n.d(e,"BufferHelper",(function(){return o}));var i=n(/*! ./logger */"./src/utils/logger.ts"),r={length:0,start:function(){return 0},end:function(){return 0}},o=function(){function t(){}return t.isBuffered=function(e,n){try{if(e)for(var i=t.getBuffered(e),r=0;r<i.length;r++)if(n>=i.start(r)&&n<=i.end(r))return!0}catch(t){}return!1},t.bufferInfo=function(e,n,i){try{if(e){var r,o=t.getBuffered(e),s=[];for(r=0;r<o.length;r++)s.push({start:o.start(r),end:o.end(r)});return this.bufferedInfo(s,n,i)}}catch(t){}return{len:0,start:n,end:n,nextStart:void 0}},t.bufferedInfo=function(t,e,n){e=Math.max(0,e),t.sort((function(t,e){var n=t.start-e.start;return n||e.end-t.end}));var i=[];if(n)for(var r=0;r<t.length;r++){var o=i.length;if(o){var s=i[o-1].end;t[r].start-s<n?t[r].end>s&&(i[o-1].end=t[r].end):i.push(t[r])}else i.push(t[r])}else i=t;for(var a,l=0,c=e,u=e,h=0;h<i.length;h++){var d=i[h].start,f=i[h].end;if(e+n>=d&&e<f)c=d,l=(u=f)-e;else if(e+n<d){a=d;break}}return{len:l,start:c||0,end:u||0,nextStart:a}},t.getBuffered=function(t){try{return t.buffered}catch(t){return i.logger.log("failed to get media.buffered",t),r}},t}()},"./src/utils/cea-608-parser.ts":
|
|
|
/*!*************************************!*\
|
|
|
!*** ./src/utils/cea-608-parser.ts ***!
|
|
|
\*************************************/
|
|
|
/*! exports provided: Row, CaptionScreen, default */function(t,e,n){"use strict";n.r(e),n.d(e,"Row",(function(){return g})),n.d(e,"CaptionScreen",(function(){return m}));var i,r=n(/*! ../utils/logger */"./src/utils/logger.ts"),o={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},s=function(t){var e=t;return o.hasOwnProperty(t)&&(e=o[t]),String.fromCharCode(e)},a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},l={17:2,18:4,21:6,22:8,23:10,19:13,20:15},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(t){t[t.ERROR=0]="ERROR",t[t.TEXT=1]="TEXT",t[t.WARNING=2]="WARNING",t[t.INFO=2]="INFO",t[t.DEBUG=3]="DEBUG",t[t.DATA=3]="DATA"}(i||(i={}));var d=function(){function t(){this.time=null,this.verboseLevel=i.ERROR}return t.prototype.log=function(t,e){this.verboseLevel>=t&&r.logger.log(this.time+" ["+t+"] "+e)},t}(),f=function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n].toString(16));return e},p=function(){function t(t,e,n,i,r){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=t||"white",this.underline=e||!1,this.italics=n||!1,this.background=i||"black",this.flash=r||!1}var e=t.prototype;return e.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},e.setStyles=function(t){for(var e=["foreground","underline","italics","background","flash"],n=0;n<e.length;n++){var i=e[n];t.hasOwnProperty(i)&&(this[i]=t[i])}},e.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},e.equals=function(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash},e.copy=function(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash},e.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},t}(),v=function(){function t(t,e,n,i,r,o){this.uchar=void 0,this.penState=void 0,this.uchar=t||" ",this.penState=new p(e,n,i,r,o)}var e=t.prototype;return e.reset=function(){this.uchar=" ",this.penState.reset()},e.setChar=function(t,e){this.uchar=t,this.penState.copy(e)},e.setPenState=function(t){this.penState.copy(t)},e.equals=function(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)},e.copy=function(t){this.uchar=t.uchar,this.penState.copy(t.penState)},e.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},t}(),g=function(){function t(t){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var e=0;e<100;e++)this.chars.push(new v);this.logger=t,this.pos=0,this.currPenState=new p}var e=t.prototype;return e.equals=function(t){for(var e=!0,n=0;n<100;n++)if(!this.chars[n].equals(t.chars[n])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<100;e++)this.chars[e].copy(t.chars[e])},e.isEmpty=function(){for(var t=!0,e=0;e<100;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t},e.setCursor=function(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(i.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>100&&(this.logger.log(i.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var n=this.pos+1;n<e+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(e)},e.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},e.insertChar=function(t){t>=144&&this.backSpace();var e=s(t);this.pos>=100?this.logger.log(i.ERROR,"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e<100;e++)this.chars[e].reset()},e.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},e.clearToEndOfRow=function(){this.clearFromPos(this.pos)},e.getTextString=function(){for(var t=[],e=!0,n=0;n<100;n++){var i=this.chars[n].uchar;" "!==i&&(e=!1),t.push(i)}return e?"":t.join("")},e.setPenStyles=function(t){this.currPenState.setStyles(t),this.chars[this.pos].setPenState(this.currPenState)},t}(),m=function(){function t(t){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var e=0;e<15;e++)this.rows.push(new g(t));this.logger=t,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var e=t.prototype;return e.reset=function(){for(var t=0;t<15;t++)this.rows[t].clear();this.currRow=14},e.equals=function(t){for(var e=!0,n=0;n<15;n++)if(!this.rows[n].equals(t.rows[n])){e=!1;break}return e},e.copy=function(t){for(var e=0;e<15;e++)this.rows[e].copy(t.rows[e])},e.isEmpty=function(){for(var t=!0,e=0;e<15;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t},e.backSpace=function(){this.rows[this.currRow].backSpace()},e.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},e.insertChar=function(t){this.rows[this.currRow].insertChar(t)},e.setPen=function(t){this.rows[this.currRow].setPenStyles(t)},e.moveCursor=function(t){this.rows[this.currRow].moveCursor(t)},e.setCursor=function(t){this.logger.log(i.INFO,"setCursor: "+t),this.rows[this.currRow].setCursor(t)},e.setPAC=function(t){this.logger.log(i.INFO,"pacData = "+JSON.stringify(t));var e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(var n=0;n<15;n++)this.rows[n].clear();var r=this.currRow+1-this.nrRollUpRows,o=this.lastOutputScreen;if(o){var s=o.rows[r].cueStartTime,a=this.logger.time;if(s&&null!==a&&s<a)for(var l=0;l<this.nrRollUpRows;l++)this.rows[e-this.nrRollUpRows+l+1].copy(o.rows[r+l])}}this.currRow=e;var c=this.rows[this.currRow];if(null!==t.indent){var u=t.indent,h=Math.max(u-1,0);c.setCursor(t.indent),t.color=c.chars[h].penState.foreground}var d={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(d)},e.setBkgData=function(t){this.logger.log(i.INFO,"bkgData = "+JSON.stringify(t)),this.backSpace(),this.setPen(t),this.insertChar(32)},e.setRollUpRows=function(t){this.nrRollUpRows=t},e.rollUp=function(){if(null!==this.nrRollUpRows){this.logger.log(i.TEXT,this.getDisplayText());var t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(i.INFO,"Rolling up")}else this.logger.log(i.DEBUG,"roll_up but nrRollUpRows not set yet")},e.getDisplayText=function(t){t=t||!1;for(var e=[],n="",i=-1,r=0;r<15;r++){var o=this.rows[r].getTextString();o&&(i=r+1,t?e.push("Row "+i+": '"+o+"'"):e.push(o.trim()))}return e.length>0&&(n=t?"["+e.join(" | ")+"]":e.join("\n")),n},e.getTextAndFormat=function(){return this.rows},t}(),y=function(){function t(t,e,n){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=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new m(n),this.nonDisplayedMemory=new m(n),this.lastOutputScreen=new m(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}var e=t.prototype;return e.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(i.INFO,"MODE="+t),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)},e.insertChars=function(t){for(var e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(i.INFO,n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(i.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},e.ccRCL=function(){this.logger.log(i.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},e.ccBS=function(){this.logger.log(i.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},e.ccAOF=function(){},e.ccAON=function(){},e.ccDER=function(){this.logger.log(i.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},e.ccRU=function(t){this.logger.log(i.INFO,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)},e.ccFON=function(){this.logger.log(i.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},e.ccRDC=function(){this.logger.log(i.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},e.ccTR=function(){this.logger.log(i.INFO,"TR"),this.setMode("MODE_TEXT")},e.ccRTD=function(){this.logger.log(i.INFO,"RTD"),this.setMode("MODE_TEXT")},e.ccEDM=function(){this.logger.log(i.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},e.ccCR=function(){this.logger.log(i.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},e.ccENM=function(){this.logger.log(i.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},e.ccEOC=function(){if(this.logger.log(i.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(i.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},e.ccTO=function(t){this.logger.log(i.INFO,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)},e.ccMIDROW=function(t){var e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{var n=Math.floor(t/2)-16;e.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}this.logger.log(i.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}(),b=function(){function t(t,e,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var i=new d;this.channels=[null,new y(t,e,i),new y(t+1,n,i)],this.cmdHistory={a:null,b:null},this.logger=i}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var n,r,o,s=!1;this.logger.time=t;for(var a=0;a<e.length;a+=2)if(r=127&e[a],o=127&e[a+1],0!==r||0!==o){if(this.logger.log(i.DATA,"["+f([e[a],e[a+1]])+"] -> ("+f([r,o])+")"),(n=this.parseCmd(r,o))||(n=this.parseMidrow(r,o)),n||(n=this.parsePAC(r,o)),n||(n=this.parseBackgroundAttributes(r,o)),!n&&(s=this.parseChars(r,o))){var l=this.currentChannel;l&&l>0?this.channels[l].insertChars(s):this.logger.log(i.WARNING,"No channel found yet. TEXT-MODE?")}n||s||this.logger.log(i.WARNING,"Couldn't parse cleaned data "+f([r,o])+" orig: "+f([e[a],e[a+1]]))}},e.parseCmd=function(t,e){var n=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=33&&e<=35))return!1;if(C(t,e,n))return E(null,null,n),this.logger.log(i.DEBUG,"Repeated command ("+f([t,e])+") is dropped"),!0;var r=20===t||21===t||23===t?1:2,o=this.channels[r];return 20===t||21===t||28===t||29===t?32===e?o.ccRCL():33===e?o.ccBS():34===e?o.ccAOF():35===e?o.ccAON():36===e?o.ccDER():37===e?o.ccRU(2):38===e?o.ccRU(3):39===e?o.ccRU(4):40===e?o.ccFON():41===e?o.ccRDC():42===e?o.ccTR():43===e?o.ccRTD():44===e?o.ccEDM():45===e?o.ccCR():46===e?o.ccENM():47===e&&o.ccEOC():o.ccTO(e-32),E(t,e,n),this.currentChannel=r,!0},e.parseMidrow=function(t,e){var n=0;if((17===t||25===t)&&e>=32&&e<=47){if((n=17===t?1:2)!==this.currentChannel)return this.logger.log(i.ERROR,"Mismatch channel in midrow parsing"),!1;var r=this.channels[n];return!!r&&(r.ccMIDROW(e),this.logger.log(i.DEBUG,"MIDROW ("+f([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var n,i=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127||(16===t||24===t)&&e>=64&&e<=95))return!1;if(C(t,e,i))return E(null,null,i),!0;var r=t<=23?1:2;n=e>=64&&e<=95?1===r?a[t]:c[t]:1===r?l[t]:u[t];var o=this.channels[r];return!!o&&(o.setPAC(this.interpretPAC(n,e)),E(t,e,i),this.currentChannel=r,!0)},e.interpretPAC=function(t,e){var n,i={color:null,italics:!1,indent:null,underline:!1,row:t};return n=e>95?e-96:e-64,i.underline=1==(1&n),n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((n-16)/2),i},e.parseChars=function(t,e){var n,r,o=null,a=null;if(t>=25?(n=2,a=t-8):(n=1,a=t),a>=17&&a<=19?(r=17===a?e+80:18===a?e+112:e+144,this.logger.log(i.INFO,"Special char '"+s(r)+"' in channel "+n),o=[r]):t>=32&&t<=127&&(o=0===e?[t]:[t,e]),o){var l=f(o);this.logger.log(i.DEBUG,"Char codes = "+l.join(",")),E(t,e,this.cmdHistory)}return o},e.parseBackgroundAttributes=function(t,e){var n;if(!((16===t||24===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=45&&e<=47))return!1;var i={};16===t||24===t?(n=Math.floor((e-32)/2),i.background=h[n],e%2==1&&(i.background=i.background+"_semi")):45===e?i.background="transparent":(i.foreground="black",47===e&&(i.underline=!0));var r=t<=23?1:2;return this.channels[r].setBkgData(i),E(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;t<Object.keys(this.channels).length;t++){var e=this.channels[t];e&&e.reset()}this.cmdHistory={a:null,b:null}},e.cueSplitAtTime=function(t){for(var e=0;e<this.channels.length;e++){var n=this.channels[e];n&&n.cueSplitAtTime(t)}},t}();function E(t,e,n){n.a=t,n.b=e}function C(t,e,n){return n.a===t&&n.b===e}e.default=b},"./src/utils/codecs.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/utils/codecs.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: isCodecType, isCodecSupportedInMp4 */function(t,e,n){"use strict";n.r(e),n.d(e,"isCodecType",(function(){return r})),n.d(e,"isCodecSupportedInMp4",(function(){return o}));var i={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 r(t,e){var n=i[e];return!!n&&!0===n[t.slice(0,4)]}function o(t,e){return MediaSource.isTypeSupported((e||"video")+'/mp4;codecs="'+t+'"')}},"./src/utils/cues.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/utils/cues.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ./vttparser */"./src/utils/vttparser.ts"),r=n(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts"),o=n(/*! ./texttrack-utils */"./src/utils/texttrack-utils.ts"),s=/\s/,a={newCue:function(t,e,n,a){for(var l,c,u,h,d,f=[],p=self.VTTCue||self.TextTrackCue,v=0;v<a.rows.length;v++)if(u=!0,h=0,d="",!(l=a.rows[v]).isEmpty()){for(var g=0;g<l.chars.length;g++)s.test(l.chars[g].uchar)&&u?h++:(d+=l.chars[g].uchar,u=!1);l.cueStartTime=e,e===n&&(n+=1e-4),h>=16?h--:h++;var m=Object(i.fixLineBreaks)(d.trim()),y=Object(r.generateCueId)(e,n,m);t&&t.cues&&t.cues.getCueById(y)||((c=new p(e,n,m)).id=y,c.line=v+1,c.align="left",c.position=10+Math.min(80,10*Math.floor(8*h/32)),f.push(c))}return t&&f.length&&(f.sort((function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line})),f.forEach((function(e){return Object(o.addCueToTrack)(t,e)}))),f}};e.default=a},"./src/utils/discontinuities.ts":
|
|
|
/*!**************************************!*\
|
|
|
!*** ./src/utils/discontinuities.ts ***!
|
|
|
\**************************************/
|
|
|
/*! exports provided: findFirstFragWithCC, shouldAlignOnDiscontinuities, findDiscontinuousReferenceFrag, adjustSlidingStart, alignStream, alignPDT, alignFragmentByPDTDelta, alignMediaPlaylistByPDT */function(t,e,n){"use strict";n.r(e),n.d(e,"findFirstFragWithCC",(function(){return s})),n.d(e,"shouldAlignOnDiscontinuities",(function(){return a})),n.d(e,"findDiscontinuousReferenceFrag",(function(){return l})),n.d(e,"adjustSlidingStart",(function(){return u})),n.d(e,"alignStream",(function(){return h})),n.d(e,"alignPDT",(function(){return d})),n.d(e,"alignFragmentByPDTDelta",(function(){return f})),n.d(e,"alignMediaPlaylistByPDT",(function(){return p}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ./logger */"./src/utils/logger.ts"),o=n(/*! ../controller/level-helper */"./src/controller/level-helper.ts");function s(t,e){for(var n=null,i=0,r=t.length;i<r;i++){var o=t[i];if(o&&o.cc===e){n=o;break}}return n}function a(t,e,n){return!(!e.details||!(n.endCC>n.startCC||t&&t.cc<n.startCC))}function l(t,e){var n=t.fragments,i=e.fragments;if(i.length&&n.length){var o=s(n,i[0].cc);if(o&&(!o||o.startPTS))return o;r.logger.log("No frag in previous level to align on")}else r.logger.log("No fragments to align")}function c(t,e){if(t){var n=t.start+e;t.start=t.startPTS=n,t.endPTS=n+t.duration}}function u(t,e){for(var n=e.fragments,i=0,r=n.length;i<r;i++)c(n[i],t);e.fragmentHint&&c(e.fragmentHint,t),e.alignedSliding=!0}function h(t,e,n){e&&(function(t,e,n){if(a(t,n,e)){var o=l(n.details,e);o&&Object(i.isFiniteNumber)(o.start)&&(r.logger.log("Adjusting PTS using last level due to CC increase within current level "+e.url),u(o.start,e))}}(t,n,e),!n.alignedSliding&&e.details&&d(n,e.details),n.alignedSliding||!e.details||n.skippedSegments||Object(o.adjustSliding)(e.details,n))}function d(t,e){if(e.fragments.length&&t.hasProgramDateTime&&e.hasProgramDateTime){var n=e.fragments[0].programDateTime,o=t.fragments[0].programDateTime,s=(o-n)/1e3+e.fragments[0].start;s&&Object(i.isFiniteNumber)(s)&&(r.logger.log("Adjusting PTS using programDateTime delta "+(o-n)+"ms, sliding:"+s.toFixed(3)+" "+t.url+" "),u(s,t))}}function f(t,e){var n=t.programDateTime;if(n){var i=(n-e)/1e3;t.start=t.startPTS=i,t.endPTS=i+t.duration}}function p(t,e){if(e.fragments.length&&t.hasProgramDateTime&&e.hasProgramDateTime){var n=e.fragments[0].programDateTime-1e3*e.fragments[0].start;t.fragments.forEach((function(t){f(t,n)})),t.fragmentHint&&f(t.fragmentHint,n),t.alignedSliding=!0}}},"./src/utils/ewma-bandwidth-estimator.ts":
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./src/utils/ewma-bandwidth-estimator.ts ***!
|
|
|
\***********************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../utils/ewma */"./src/utils/ewma.ts"),r=function(){function t(t,e,n){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new i.default(t),this.fast_=new i.default(e)}var e=t.prototype;return e.update=function(t,e){var n=this.slow_,r=this.fast_;this.slow_.halfLife!==t&&(this.slow_=new i.default(t,n.getEstimate(),n.getTotalWeight())),this.fast_.halfLife!==e&&(this.fast_=new i.default(e,r.getEstimate(),r.getTotalWeight()))},e.sample=function(t,e){var n=(t=Math.max(t,this.minDelayMs_))/1e3,i=8*e/n;this.fast_.sample(n,i),this.slow_.sample(n,i)},e.canEstimate=function(){var t=this.fast_;return t&&t.getTotalWeight()>=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}();e.default=r},"./src/utils/ewma.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/utils/ewma.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=function(){function t(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=n}var e=t.prototype;return e.sample=function(t,e){var n=Math.pow(this.alpha_,t);this.estimate_=e*(1-n)+n*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}();e.default=i},"./src/utils/fetch-loader.ts":
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/utils/fetch-loader.ts ***!
|
|
|
\***********************************/
|
|
|
/*! exports provided: fetchSupported, default */function(t,e,n){"use strict";n.r(e),n.d(e,"fetchSupported",(function(){return d}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),o=n(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts");function s(t){var e="function"==typeof Map?new Map:void 0;return(s=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return a(t,arguments,u(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),c(i,t)})(t)}function a(t,e,n){return(a=l()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&c(r,n.prototype),r}).apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function d(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var f=function(){function t(t){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=t.fetchSetup||p,this.controller=new self.AbortController,this.stats=new r.LoadStats}var e=t.prototype;return e.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},e.abortInternal=function(){var t=this.response;t&&t.ok||(this.stats.aborted=!0,this.controller.abort())},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},e.load=function(t,e,n){var r=this,o=this.stats;if(o.loading.start)throw new Error("Loader can only be used once.");o.loading.start=self.performance.now();var s=function(t,e){var n={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(h({},t.headers))};return t.rangeEnd&&n.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),n}(t,this.controller.signal),a=n.onProgress,l="arraybuffer"===t.responseType,c=l?"byteLength":"length";this.context=t,this.config=e,this.callbacks=n,this.request=this.fetchSetup(t,s),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout((function(){r.abortInternal(),n.onTimeout(o,t,r.response)}),e.timeout),self.fetch(this.request).then((function(n){if(r.response=r.loader=n,!n.ok){var s=n.status,c=n.statusText;throw new v(c||"fetch, bad network response",s,n)}return o.loading.first=Math.max(self.performance.now(),o.loading.start),o.total=parseInt(n.headers.get("Content-Length")||"0"),a&&Object(i.isFiniteNumber)(e.highWaterMark)?r.loadProgressively(n,o,t,e.highWaterMark,a):l?n.arrayBuffer():n.text()})).then((function(s){var l=r.response;self.clearTimeout(r.requestTimeout),o.loading.end=Math.max(self.performance.now(),o.loading.first),o.loaded=o.total=s[c];var u={url:l.url,data:s};a&&!Object(i.isFiniteNumber)(e.highWaterMark)&&a(o,t,s,l),n.onSuccess(u,o,t,l)})).catch((function(e){if(self.clearTimeout(r.requestTimeout),!o.aborted){var i=e.code||0;n.onError({code:i,text:e.message},t,e.details)}}))},e.getCacheAge=function(){var t=null;if(this.response){var e=this.response.headers.get("age");t=e?parseFloat(e):null}return t},e.loadProgressively=function(t,e,n,i,r){void 0===i&&(i=0);var s=new o.default,a=t.body.getReader();return function o(){return a.read().then((function(a){if(a.done)return s.dataLength&&r(e,n,s.flush(),t),Promise.resolve(new ArrayBuffer(0));var l=a.value,c=l.length;return e.loaded+=c,c<i||s.dataLength?(s.push(l),s.dataLength>=i&&r(e,n,s.flush(),t)):r(e,n,l,t),o()})).catch((function(){return Promise.reject()}))}()},t}();function p(t,e){return new self.Request(t.url,e)}var v=function(t){var e,n;function i(e,n,i){var r;return(r=t.call(this,e)||this).code=void 0,r.details=void 0,r.code=n,r.details=i,r}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,c(e,n),i}(s(Error));e.default=f},"./src/utils/imsc1-ttml-parser.ts":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/utils/imsc1-ttml-parser.ts ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: IMSC1_CODEC, parseIMSC1 */function(t,e,n){"use strict";n.r(e),n.d(e,"IMSC1_CODEC",(function(){return u})),n.d(e,"parseIMSC1",(function(){return p}));var i=n(/*! ./mp4-tools */"./src/utils/mp4-tools.ts"),r=n(/*! ./vttparser */"./src/utils/vttparser.ts"),o=n(/*! ./vttcue */"./src/utils/vttcue.ts"),s=n(/*! ../demux/id3 */"./src/demux/id3.ts"),a=n(/*! ./timescale-conversion */"./src/utils/timescale-conversion.ts"),l=n(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts");function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var u="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,f={left:"start",center:"center",right:"end",start:"start",end:"end"};function p(t,e,n,r,u){var h=Object(i.findBox)(new Uint8Array(t),["mdat"]);if(0!==h.length){var d=h[0],p=Object(s.utf8ArrayToStr)(new Uint8Array(t,d.start,d.end-d.start)),E=Object(a.toTimescaleFromScale)(e,1,n);try{r(function(t,e){var n=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("tt")[0];if(!n)throw new Error("Invalid ttml");var i={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},r=Object.keys(i).reduce((function(t,e){return t[e]=n.getAttribute("ttp:"+e)||i[e],t}),{}),s="preserve"!==n.getAttribute("xml:space"),a=g(v(n,"styling","style")),u=g(v(n,"layout","region")),h=v(n,"body","[begin]");return[].map.call(h,(function(t){var n=function t(e,n){return[].slice.call(e.childNodes).reduce((function(e,i,r){var o;return"br"===i.nodeName&&r?e+"\n":null!==(o=i.childNodes)&&void 0!==o&&o.length?t(i,n):n?e+i.textContent.trim().replace(/\s+/g," "):e+i.textContent}),"")}(t,s);if(!n||!t.hasAttribute("begin"))return null;var i=b(t.getAttribute("begin"),r),h=b(t.getAttribute("dur"),r),d=b(t.getAttribute("end"),r);if(null===i)throw y(t);if(null===d){if(null===h)throw y(t);d=i+h}var p=new o.default(i-e,d-e,n);p.id=Object(l.generateCueId)(p.startTime,p.endTime,p.text);var v=u[t.getAttribute("region")],g=a[t.getAttribute("style")];p.position=10,p.size=80;var E=function(t,e){var n="http://www.w3.org/ns/ttml#styling";return["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce((function(i,r){var o=m(e,n,r)||m(t,n,r);return o&&(i[r]=o),i}),{})}(v,g),C=E.textAlign;if(C){var S=f[C];S&&(p.lineAlign=S),p.align=C}return c(p,E),p})).filter((function(t){return null!==t}))}(p,E))}catch(t){u(t)}}else u(new Error("Could not parse IMSC1 mdat"))}function v(t,e,n){var i=t.getElementsByTagName(e)[0];return i?[].slice.call(i.querySelectorAll(n)):[]}function g(t){return t.reduce((function(t,e){var n=e.getAttribute("xml:id");return n&&(t[n]=e),t}),{})}function m(t,e,n){return t.hasAttributeNS(e,n)?t.getAttributeNS(e,n):null}function y(t){return new Error("Could not parse ttml timestamp "+t)}function b(t,e){if(!t)return null;var n=Object(r.parseTimeStamp)(t);return null===n&&(h.test(t)?n=function(t,e){var n=h.exec(t),i=(0|n[4])+(0|n[5])/e.subFrameRate;return 3600*(0|n[1])+60*(0|n[2])+(0|n[3])+i/e.frameRate}(t,e):d.test(t)&&(n=function(t,e){var n=d.exec(t),i=Number(n[1]);switch(n[2]){case"h":return 3600*i;case"m":return 60*i;case"ms":return 1e3*i;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}(t,e))),n}},"./src/utils/logger.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/utils/logger.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: enableLogs, logger */function(t,e,n){"use strict";n.r(e),n.d(e,"enableLogs",(function(){return a})),n.d(e,"logger",(function(){return l}));var i=function(){},r={trace:i,debug:i,log:i,warn:i,info:i,error:i},o=r;function s(t){var e=self.console[t];return e?e.bind(self.console,"["+t+"] >"):i}function a(t){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];n.forEach((function(e){o[e]=t[e]?t[e].bind(t):s(e)}))}(t,"debug","log","info","warn","error");try{o.log()}catch(t){o=r}}else o=r}var l=r},"./src/utils/mediakeys-helper.ts":
|
|
|
/*!***************************************!*\
|
|
|
!*** ./src/utils/mediakeys-helper.ts ***!
|
|
|
\***************************************/
|
|
|
/*! exports provided: KeySystems, requestMediaKeySystemAccess */function(t,e,n){"use strict";var i;n.r(e),n.d(e,"KeySystems",(function(){return i})),n.d(e,"requestMediaKeySystemAccess",(function(){return r})),function(t){t.WIDEVINE="com.widevine.alpha",t.PLAYREADY="com.microsoft.playready"}(i||(i={}));var r="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null},"./src/utils/mediasource-helper.ts":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/utils/mediasource-helper.ts ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: getMediaSource */function(t,e,n){"use strict";function i(){return self.MediaSource||self.WebKitMediaSource}n.r(e),n.d(e,"getMediaSource",(function(){return i}))},"./src/utils/mp4-tools.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/utils/mp4-tools.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: bin2str, readUint16, readUint32, writeUint32, findBox, parseSegmentIndex, parseInitSegment, getStartDTS, getDuration, computeRawDurationFromSamples, offsetStartDTS, segmentValidRange, appendUint8Array */function(t,e,n){"use strict";n.r(e),n.d(e,"bin2str",(function(){return a})),n.d(e,"readUint16",(function(){return l})),n.d(e,"readUint32",(function(){return c})),n.d(e,"writeUint32",(function(){return u})),n.d(e,"findBox",(function(){return h})),n.d(e,"parseSegmentIndex",(function(){return d})),n.d(e,"parseInitSegment",(function(){return f})),n.d(e,"getStartDTS",(function(){return p})),n.d(e,"getDuration",(function(){return v})),n.d(e,"computeRawDurationFromSamples",(function(){return g})),n.d(e,"offsetStartDTS",(function(){return m})),n.d(e,"segmentValidRange",(function(){return y})),n.d(e,"appendUint8Array",(function(){return b}));var i=n(/*! ./typed-array */"./src/utils/typed-array.ts"),r=n(/*! ../loader/fragment */"./src/loader/fragment.ts"),o=Math.pow(2,32)-1,s=[].push;function a(t){return String.fromCharCode.apply(null,t)}function l(t,e){"data"in t&&(e+=t.start,t=t.data);var n=t[e]<<8|t[e+1];return n<0?65536+n:n}function c(t,e){"data"in t&&(e+=t.start,t=t.data);var n=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return n<0?4294967296+n:n}function u(t,e,n){"data"in t&&(e+=t.start,t=t.data),t[e]=n>>24,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n}function h(t,e){var n,i,r,o=[];if(!e.length)return o;"data"in t?(n=t.data,i=t.start,r=t.end):(i=0,r=(n=t).byteLength);for(var l=i;l<r;){var u=c(n,l),d=u>1?l+u:r;if(a(n.subarray(l+4,l+8))===e[0])if(1===e.length)o.push({data:n,start:l+8,end:d});else{var f=h({data:n,start:l+8,end:d},e.slice(1));f.length&&s.apply(o,f)}l=d}return o}function d(t){var e=h(t,["moov"])[0],n=e?e.end:null,i=h(t,["sidx"]);if(!i||!i[0])return null;var r=[],o=i[0],s=o.data[0],a=0===s?8:16,u=c(o,a);a+=4,a+=0===s?8:16,a+=2;var d=o.end+0,f=l(o,a);a+=2;for(var p=0;p<f;p++){var v=a,g=c(o,v);v+=4;var m=2147483647&g;if(1==(2147483648&g)>>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var y=c(o,v);v+=4,r.push({referenceSize:m,subsegmentDuration:y,info:{duration:y/u,start:d,end:d+m-1}}),d+=m,a=v+=4}return{earliestPresentationTime:0,timescale:u,version:s,referencesCount:f,references:r,moovEndOffset:n}}function f(t){for(var e=[],n=h(t,["moov","trak"]),i=0;i<n.length;i++){var o=n[i],s=h(o,["tkhd"])[0];if(s){var l=s.data[s.start],u=0===l?12:20,d=c(s,u),f=h(o,["mdia","mdhd"])[0];if(f){var p=c(f,u=0===(l=f.data[f.start])?12:20),v=h(o,["mdia","hdlr"])[0];if(v){var g=a(v.data.subarray(v.start+8,v.start+12)),m={soun:r.ElementaryStreamTypes.AUDIO,vide:r.ElementaryStreamTypes.VIDEO}[g];if(m){var y=h(o,["mdia","minf","stbl","stsd"])[0],b=void 0;y&&(b=a(y.data.subarray(y.start+12,y.start+16))),e[d]={timescale:p,type:m},e[m]={timescale:p,id:d,codec:b}}}}}}return h(t,["moov","mvex","trex"]).forEach((function(t){var n=c(t,4),i=e[n];i&&(i.default={duration:c(t,12),flags:c(t,20)})})),e}function p(t,e){return h(e,["moof","traf"]).reduce((function(e,n){var i=h(n,["tfdt"])[0],r=i.data[i.start],o=h(n,["tfhd"]).reduce((function(e,n){var o=c(n,4),s=t[o];if(s){var a=c(i,4);1===r&&(a*=Math.pow(2,32),a+=c(i,8));var l=a/(s.timescale||9e4);if(isFinite(l)&&(null===e||l<e))return l}return e}),null);return null!==o&&isFinite(o)&&(null===e||o<e)?o:e}),null)||0}function v(t,e){for(var n=0,i=0,o=0,s=h(t,["moof","traf"]),a=0;a<s.length;a++){var l=s[a],u=h(l,["tfhd"])[0],f=e[c(u,4)];if(f){var p=f.default,v=c(u,0)|(null==p?void 0:p.flags),m=null==p?void 0:p.duration;8&v&&(m=c(u,2&v?12:8));for(var y=f.timescale||9e4,b=h(l,["trun"]),E=0;E<b.length;E++)n=m?m*c(b[E],4):g(b[E]),f.type===r.ElementaryStreamTypes.VIDEO?i+=n/y:f.type===r.ElementaryStreamTypes.AUDIO&&(o+=n/y)}}if(0===i&&0===o){var C=d(t);if(null!=C&&C.references)return C.references.reduce((function(t,e){return t+e.info.duration||0}),0)}return i||o}function g(t){var e=c(t,0),n=8;1&e&&(n+=4),4&e&&(n+=4);for(var i=0,r=c(t,4),o=0;o<r;o++)256&e&&(i+=c(t,n),n+=4),512&e&&(n+=4),1024&e&&(n+=4),2048&e&&(n+=4);return i}function m(t,e,n){h(e,["moof","traf"]).forEach((function(e){h(e,["tfhd"]).forEach((function(i){var r=c(i,4),s=t[r];if(s){var a=s.timescale||9e4;h(e,["tfdt"]).forEach((function(t){var e=t.data[t.start],i=c(t,4);if(0===e)u(t,4,i-n*a);else{i*=Math.pow(2,32),i+=c(t,8),i-=n*a,i=Math.max(i,0);var r=Math.floor(i/(o+1)),s=Math.floor(i%(o+1));u(t,4,r),u(t,8,s)}}))}}))}))}function y(t){var e={valid:null,remainder:null},n=h(t,["moof"]);if(!n)return e;if(n.length<2)return e.remainder=t,e;var r=n[n.length-1];return e.valid=Object(i.sliceUint8)(t,0,r.start-8),e.remainder=Object(i.sliceUint8)(t,r.start-8),e}function b(t,e){var n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}},"./src/utils/output-filter.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/output-filter.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return i}));var i=function(){function t(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}var e=t.prototype;return e.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},e.newCue=function(t,e,n){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[]},t}()},"./src/utils/texttrack-utils.ts":
|
|
|
/*!**************************************!*\
|
|
|
!*** ./src/utils/texttrack-utils.ts ***!
|
|
|
\**************************************/
|
|
|
/*! exports provided: sendAddTrackEvent, addCueToTrack, clearCurrentCues, removeCuesInRange, getCuesInRange */function(t,e,n){"use strict";n.r(e),n.d(e,"sendAddTrackEvent",(function(){return r})),n.d(e,"addCueToTrack",(function(){return o})),n.d(e,"clearCurrentCues",(function(){return s})),n.d(e,"removeCuesInRange",(function(){return a})),n.d(e,"getCuesInRange",(function(){return l}));var i=n(/*! ./logger */"./src/utils/logger.ts");function r(t,e){var n;try{n=new Event("addtrack")}catch(t){(n=document.createEvent("Event")).initEvent("addtrack",!1,!1)}n.track=t,e.dispatchEvent(n)}function o(t,e){var n=t.mode;if("disabled"===n&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(n){i.logger.debug("[texttrack-utils]: "+n);var r=new self.TextTrackCue(e.startTime,e.endTime,e.text);r.id=e.id,t.addCue(r)}"disabled"===n&&(t.mode=n)}function s(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var n=t.cues.length;n--;)t.removeCue(t.cues[n]);"disabled"===e&&(t.mode=e)}function a(t,e,n){var i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var r=l(t.cues,e,n),o=0;o<r.length;o++)t.removeCue(r[o]);"disabled"===i&&(t.mode=i)}function l(t,e,n){var i=[],r=function(t,e){if(e<t[0].startTime)return 0;var n=t.length-1;if(e>t[n].endTime)return-1;for(var i=0,r=n;i<=r;){var o=Math.floor((r+i)/2);if(e<t[o].startTime)r=o-1;else{if(!(e>t[o].startTime&&i<n))return o;i=o+1}}return t[i].startTime-e<e-t[r].startTime?i:r}(t,e);if(r>-1)for(var o=r,s=t.length;o<s;o++){var a=t[o];if(a.startTime>=e&&a.endTime<=n)i.push(a);else if(a.startTime>n)return i}return i}},"./src/utils/time-ranges.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/utils/time-ranges.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),e.default={toString:function(t){for(var e="",n=t.length,i=0;i<n;i++)e+="["+t.start(i).toFixed(3)+","+t.end(i).toFixed(3)+"]";return e}}},"./src/utils/timescale-conversion.ts":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/utils/timescale-conversion.ts ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: toTimescaleFromBase, toTimescaleFromScale, toMsFromMpegTsClock, toMpegTsClockFromTimescale */function(t,e,n){"use strict";function i(t,e,n,i){void 0===n&&(n=1),void 0===i&&(i=!1);var r=t*e*n;return i?Math.round(r):r}function r(t,e,n,r){return void 0===n&&(n=1),void 0===r&&(r=!1),i(t,e,1/n,r)}function o(t,e){return void 0===e&&(e=!1),i(t,1e3,1/9e4,e)}function s(t,e){return void 0===e&&(e=1),i(t,9e4,1/e)}n.r(e),n.d(e,"toTimescaleFromBase",(function(){return i})),n.d(e,"toTimescaleFromScale",(function(){return r})),n.d(e,"toMsFromMpegTsClock",(function(){return o})),n.d(e,"toMpegTsClockFromTimescale",(function(){return s}))},"./src/utils/typed-array.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/utils/typed-array.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: sliceUint8 */function(t,e,n){"use strict";function i(t,e,n){return Uint8Array.prototype.slice?t.slice(e,n):new Uint8Array(Array.prototype.slice.call(t,e,n))}n.r(e),n.d(e,"sliceUint8",(function(){return i}))},"./src/utils/vttcue.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/utils/vttcue.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e),e.default=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var t=["","lr","rl"],e=["start","middle","end","left","right"];function n(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;var n=e.toLowerCase();return!!~t.indexOf(n)&&n}function i(t){return n(e,t)}function r(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var s in o)t[s]=o[s]}return t}function o(e,o,s){var a=this,l={enumerable:!0};a.hasBeenReset=!1;var c="",u=!1,h=e,d=o,f=s,p=null,v="",g=!0,m="auto",y="start",b=50,E="middle",C=50,S="middle";Object.defineProperty(a,"id",r({},l,{get:function(){return c},set:function(t){c=""+t}})),Object.defineProperty(a,"pauseOnExit",r({},l,{get:function(){return u},set:function(t){u=!!t}})),Object.defineProperty(a,"startTime",r({},l,{get:function(){return h},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");h=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",r({},l,{get:function(){return d},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");d=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",r({},l,{get:function(){return f},set:function(t){f=""+t,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",r({},l,{get:function(){return p},set:function(t){p=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",r({},l,{get:function(){return v},set:function(e){var i=function(e){return n(t,e)}(e);if(!1===i)throw new SyntaxError("An invalid or illegal string was specified.");v=i,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",r({},l,{get:function(){return g},set:function(t){g=!!t,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",r({},l,{get:function(){return m},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");m=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",r({},l,{get:function(){return y},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",r({},l,{get:function(){return b},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",r({},l,{get:function(){return E},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");E=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",r({},l,{get:function(){return C},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");C=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",r({},l,{get:function(){return S},set:function(t){var e=i(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");S=e,this.hasBeenReset=!0}})),a.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}()},"./src/utils/vttparser.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/utils/vttparser.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: parseTimeStamp, fixLineBreaks, VTTParser */function(t,e,n){"use strict";n.r(e),n.d(e,"parseTimeStamp",(function(){return o})),n.d(e,"fixLineBreaks",(function(){return h})),n.d(e,"VTTParser",(function(){return d}));var i=n(/*! ./vttcue */"./src/utils/vttcue.ts"),r=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function o(t){function e(t,e,n,i){return 3600*(0|t)+60*(0|e)+(0|n)+parseFloat(i||0)}var n=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?e(n[2],n[3],0,n[4]):e(n[1],n[2],n[3],n[4]):null}var s=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,n){return n?this.has(t)?this.values[t]:e[n]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,n){for(var i=0;i<n.length;++i)if(e===n[i]){this.set(t,e);break}},e.integer=function(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},e.percent=function(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){var n=parseFloat(e);if(n>=0&&n<=100)return this.set(t,n),!0}return!1},t}();function a(t,e,n,i){var r=i?t.split(i):[t];for(var o in r)if("string"==typeof r[o]){var s=r[o].split(n);2===s.length&&e(s[0],s[1])}}var l=new i.default(0,0,""),c="middle"===l.align?"middle":"center";function u(t,e,n){var i=t;function r(){var e=o(t);if(null===e)throw new Error("Malformed timestamp: "+i);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function u(){t=t.replace(/^\s+/,"")}if(u(),e.startTime=r(),u(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+i);t=t.substr(3),u(),e.endTime=r(),u(),function(t,e){var i=new s;a(t,(function(t,e){var r;switch(t){case"region":for(var o=n.length-1;o>=0;o--)if(n[o].id===e){i.set(t,n[o].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":r=e.split(","),i.integer(t,r[0]),i.percent(t,r[0])&&i.set("snapToLines",!1),i.alt(t,r[0],["auto"]),2===r.length&&i.alt("lineAlign",r[1],["start",c,"end"]);break;case"position":r=e.split(","),i.percent(t,r[0]),2===r.length&&i.alt("positionAlign",r[1],["start",c,"end","line-left","line-right","auto"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start",c,"end","left","right"])}}),/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical","");var r=i.get("line","auto");"auto"===r&&-1===l.line&&(r=-1),e.line=r,e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100),e.align=i.get("align",c);var o=i.get("position","auto");"auto"===o&&50===l.position&&(o="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=o}(t,e)}function h(t){return t.replace(/<br(?: \/)?>/gi,"\n")}var d=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new r,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function n(){var t=e.buffer,n=0;for(t=h(t);n<t.length&&"\r"!==t[n]&&"\n"!==t[n];)++n;var i=t.substr(0,n);return"\r"===t[n]&&++n,"\n"===t[n]&&++n,e.buffer=t.substr(n),i}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{var r="";if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;var o=(r=n()).match(/^()?WEBVTT([ \t].*)?$/);if(!o||!o[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}for(var s=!1;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(s?s=!1:r=n(),e.state){case"HEADER":/:/.test(r)?a(r,(function(t,e){}),/:/):r||(e.state="ID");continue;case"NOTE":r||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){e.state="NOTE";break}if(!r)continue;if(e.cue=new i.default(0,0,""),e.state="CUE",-1===r.indexOf("--\x3e")){e.cue.id=r;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{u(r,e.cue,e.regionList)}catch(t){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var l=-1!==r.indexOf("--\x3e");if(!r||l&&(s=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(null===e.cue)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=r;continue;case"BADCUE":r||(e.state="ID")}}}catch(t){"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this},e.flush=function(){try{if((this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state||"BADWEBVTT"===this.state)throw new Error("Malformed WebVTT signature.")}catch(t){this.onparsingerror&&this.onparsingerror(t)}return this.onflush&&this.onflush(),this},t}()},"./src/utils/webvtt-parser.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/webvtt-parser.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: generateCueId, parseWebVTT */function(t,e,n){"use strict";n.r(e),n.d(e,"generateCueId",(function(){return h})),n.d(e,"parseWebVTT",(function(){return d}));var i=n(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),r=n(/*! ./vttparser */"./src/utils/vttparser.ts"),o=n(/*! ../demux/id3 */"./src/demux/id3.ts"),s=n(/*! ./timescale-conversion */"./src/utils/timescale-conversion.ts"),a=n(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.ts"),l=/\r\n|\n\r|\n|\r/g,c=function(t,e,n){return void 0===n&&(n=0),t.substr(n,e.length)===e},u=function(t){for(var e=5381,n=t.length;n;)e=33*e^t.charCodeAt(--n);return(e>>>0).toString()};function h(t,e,n){return u(t.toString())+u(e.toString())+u(n)}function d(t,e,n,u,d,f,p,v){var g,m=new r.VTTParser,y=Object(o.utf8ArrayToStr)(new Uint8Array(t)).trim().replace(l,"\n").split("\n"),b=[],E=Object(s.toMpegTsClockFromTimescale)(e,n),C="00:00.000",S=0,k=0,w=!0,x=!1;m.oncue=function(t){var e=u[d],n=u.ccOffset,i=(S-E)/9e4;if(null!=e&&e.new&&(void 0!==k?n=u.ccOffset=e.start:function(t,e,n){var i=t[e],r=t[i.prevCC];if(!r||!r.new&&i.new)return t.ccOffset=t.presentationOffset=i.start,void(i.new=!1);for(;null!==(o=r)&&void 0!==o&&o.new;){var o;t.ccOffset+=i.start-r.start,i.new=!1,r=t[(i=r).prevCC]}t.presentationOffset=n}(u,d,i)),i&&(n=i-u.presentationOffset),x){var r=t.endTime-t.startTime,o=Object(a.normalizePts)(9e4*(t.startTime+n-k),9e4*f)/9e4;t.startTime=o,t.endTime=o+r}var s=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(s)),t.id||(t.id=h(t.startTime,t.endTime,s)),t.endTime>0&&b.push(t)},m.onparsingerror=function(t){g=t},m.onflush=function(){g?v(g):p(b)},y.forEach((function(t){if(w){if(c(t,"X-TIMESTAMP-MAP=")){w=!1,x=!0,t.substr(16).split(",").forEach((function(t){c(t,"LOCAL:")?C=t.substr(6):c(t,"MPEGTS:")&&(S=parseInt(t.substr(7)))}));try{k=function(t){var e=parseInt(t.substr(-3)),n=parseInt(t.substr(-6,2)),r=parseInt(t.substr(-9,2)),o=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;if(!(Object(i.isFiniteNumber)(e)&&Object(i.isFiniteNumber)(n)&&Object(i.isFiniteNumber)(r)&&Object(i.isFiniteNumber)(o)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*n,e+=6e4*r,e+=36e5*o}(C)/1e3}catch(t){x=!1,g=t}return}""===t&&(w=!1)}m.parse(t+"\n")})),m.flush()}},"./src/utils/xhr-loader.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/utils/xhr-loader.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(t,e,n){"use strict";n.r(e);var i=n(/*! ../utils/logger */"./src/utils/logger.ts"),r=n(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),o=/^age:\s*[\d.]+\s*$/m,s=function(){function t(t){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=t?t.xhrSetup:null,this.stats=new r.LoadStats,this.retryDelay=0}var e=t.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(t,e,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=n,this.retryDelay=e.retryDelay,this.loadInternal()},e.loadInternal=function(){var t=this.config,e=this.context;if(t){var n=this.loader=new self.XMLHttpRequest,i=this.stats;i.loading.first=0,i.loaded=0;var r=this.xhrSetup;try{if(r)try{r(n,e.url)}catch(t){n.open("GET",e.url,!0),r(n,e.url)}n.readyState||n.open("GET",e.url,!0);var o=this.context.headers;if(o)for(var s in o)n.setRequestHeader(s,o[s])}catch(t){return void this.callbacks.onError({code:n.status,text:t.message},e,n)}e.rangeEnd&&n.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),n.onreadystatechange=this.readystatechange.bind(this),n.onprogress=this.loadprogress.bind(this),n.responseType=e.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout),n.send()}},e.readystatechange=function(){var t=this.context,e=this.loader,n=this.stats;if(t&&e){var r=e.readyState,o=this.config;if(!n.aborted&&r>=2)if(self.clearTimeout(this.requestTimeout),0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start)),4===r){e.onreadystatechange=null,e.onprogress=null;var s=e.status;if(s>=200&&s<300){var a,l;if(n.loading.end=Math.max(self.performance.now(),n.loading.first),l="arraybuffer"===t.responseType?(a=e.response).byteLength:(a=e.responseText).length,n.loaded=n.total=l,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(n,t,a,e),!this.callbacks)return;var u={url:e.responseURL,data:a};this.callbacks.onSuccess(u,n,t,e)}else n.retry>=o.maxRetry||s>=400&&s<499?(i.logger.error(s+" while loading "+t.url),this.callbacks.onError({code:s,text:e.statusText},t,e)):(i.logger.warn(s+" while loading "+t.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,o.maxRetryDelay),n.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)}},e.loadtimeout=function(){i.logger.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&o.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},t}();e.default=s}}).default},t.exports=i())},vHTk:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/components/PreviewAll/index.less?modules ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/Table.js + 17 modules ***!
|
|
|
\********************************************************/
|
|
|
/*! exports provided: INTERNAL_HOOKS, default */
|
|
|
/*! exports used: INTERNAL_HOOKS, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/raf/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-resize-observer/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/Cell/index.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/Footer/index.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/context/TableContext.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/hooks/useColumns.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/sugar/Column.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/sugar/ColumnGroup.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/utils/legacyUtil.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-table/es/utils/valueUtil.js because of ./node_modules/antd/es/table/Table.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/addEventListener.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/css.js because of ./node_modules/rc-image/es/Image.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/getScrollBarSize.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(t,e,n){"use strict";n.d(e,"a",(function(){return J}));var i=n("rePB"),r=n("VTBJ"),o=n("KQm4"),s=n("U8pU"),a=n("ODXe"),l=n("q1tI"),c=n("TSYQ"),u=n.n(c),h=n("Gytx"),d=n.n(h),f=n("Kwbf"),p=n("t23M"),v=n("qx4F"),g=n("6eGT"),m=n("IBYe"),y=n("Ff2n"),b=n("c+Xe"),E=n("fyJ8"),C=n("biw7");function S(t,e,n,i,r){var o,s,a=n[t]||{},l=n[e]||{};"left"===a.fixed?o=i.left[t]:"right"===l.fixed&&(s=i.right[e]);var c=!1,u=!1,h=!1,d=!1,f=n[e+1],p=n[t-1];if("rtl"===r){if(void 0!==o)d=!(p&&"left"===p.fixed);else if(void 0!==s){h=!(f&&"right"===f.fixed)}}else if(void 0!==o){c=!(f&&"left"===f.fixed)}else if(void 0!==s){u=!(p&&"right"===p.fixed)}return{fixLeft:o,fixRight:s,lastFixLeft:c,firstFixRight:u,lastFixRight:h,firstFixLeft:d,isSticky:i.isSticky}}var k=n("sR1s");function w(t){var e,n=t.cells,i=t.stickyOffsets,r=t.flattenColumns,o=t.rowComponent,s=t.cellComponent,a=t.onHeaderRow,c=t.index,u=l.useContext(C.a),h=u.prefixCls,d=u.direction;a&&(e=a(n.map((function(t){return t.column})),c));var f=Object(k.a)(n.map((function(t){return t.column})));return l.createElement(o,Object.assign({},e),n.map((function(t,e){var n,o=t.column,a=S(t.colStart,t.colEnd,r,i,d);return o&&o.onHeaderCell&&(n=t.column.onHeaderCell(o)),l.createElement(E.a,Object.assign({},t,{ellipsis:o.ellipsis,align:o.align,component:s,prefixCls:h,key:f[e]},a,{additionalProps:n,rowType:"header"}))})))}w.displayName="HeaderRow";var x=w;var T=function(t){var e=t.stickyOffsets,n=t.columns,i=t.flattenColumns,r=t.onHeaderRow,o=l.useContext(C.a),s=o.prefixCls,a=o.getComponent,c=l.useMemo((function(){return function(t){var e=[];!function t(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e[r]=e[r]||[];var o=i,s=n.filter(Boolean).map((function(n){var i={key:n.key,className:n.className||"",children:n.title,column:n,colStart:o},s=1,a=n.children;return a&&a.length>0&&(s=t(a,o,r+1).reduce((function(t,e){return t+e}),0),i.hasSubColumns=!0),"colSpan"in n&&(s=n.colSpan),"rowSpan"in n&&(i.rowSpan=n.rowSpan),i.colSpan=s,i.colEnd=i.colStart+s-1,e[r].push(i),o+=s,s}));return s}(t,0);for(var n=e.length,i=function(t){e[t].forEach((function(e){"rowSpan"in e||e.hasSubColumns||(e.rowSpan=n-t)}))},r=0;r<n;r+=1)i(r);return e}(n)}),[n]),u=a(["header","wrapper"],"thead"),h=a(["header","row"],"tr"),d=a(["header","cell"],"th");return l.createElement(u,{className:"".concat(s,"-thead")},c.map((function(t,n){return l.createElement(x,{key:n,flattenColumns:i,cells:t,stickyOffsets:e,rowComponent:h,cellComponent:d,onHeaderRow:r,index:n})})))},O=n("hW8S");var _=function(t){for(var e=t.colWidths,n=t.columns,i=[],r=!1,o=(t.columCount||n.length)-1;o>=0;o-=1){var s=e[o],a=n&&n[o],c=a&&a[O.a];(s||c||r)&&(i.unshift(l.createElement("col",Object.assign({key:o,style:{width:s,minWidth:s}},c))),r=!0)}return l.createElement("colgroup",null,i)};var A=l.forwardRef((function(t,e){var n=t.noData,s=t.columns,a=t.flattenColumns,c=t.colWidths,h=t.columCount,d=t.stickyOffsets,f=t.direction,p=t.fixHeader,v=t.offsetHeader,g=t.stickyClassName,m=t.onScroll,E=Object(y.a)(t,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),S=l.useContext(C.a),k=S.prefixCls,w=S.scrollbarSize,x=S.isSticky,O=x&&!p?0:w,A=l.useRef(null),L=l.useCallback((function(t){Object(b.b)(e,t),Object(b.b)(A,t)}),[]);l.useEffect((function(){var t;function e(t){var e=t.currentTarget,n=t.deltaX;n&&(m({currentTarget:e,scrollLeft:e.scrollLeft+n}),t.preventDefault())}return null===(t=A.current)||void 0===t||t.addEventListener("wheel",e),function(){var t;null===(t=A.current)||void 0===t||t.removeEventListener("wheel",e)}}),[]);var R=a[a.length-1],D={fixed:R?R.fixed:null,onHeaderCell:function(){return{className:"".concat(k,"-cell-scrollbar")}}},I=Object(l.useMemo)((function(){return O?[].concat(Object(o.a)(s),[D]):s}),[O,s]),M=Object(l.useMemo)((function(){return O?[].concat(Object(o.a)(a),[D]):a}),[O,a]),P=Object(l.useMemo)((function(){var t=d.right,e=d.left;return Object(r.a)(Object(r.a)({},d),{},{left:"rtl"===f?[].concat(Object(o.a)(e.map((function(t){return t+O}))),[0]):e,right:"rtl"===f?t:[].concat(Object(o.a)(t.map((function(t){return t+O}))),[0]),isSticky:x})}),[O,d,x]),N=function(t,e){return Object(l.useMemo)((function(){for(var n=[],i=0;i<e;i+=1){var r=t[i];if(void 0===r)return null;n[i]=r}return n}),[t.join("_"),e])}(c,h);return l.createElement("div",{style:Object(r.a)({overflow:"hidden"},x?{top:v}:{}),ref:L,className:u()("".concat(k,"-header"),Object(i.a)({},g,!!g))},l.createElement("table",{style:{tableLayout:"fixed",visibility:n||N?null:"hidden"}},l.createElement(_,{colWidths:N?[].concat(Object(o.a)(N),[O]):[],columCount:h+1,columns:M}),l.createElement(T,Object.assign({},E,{stickyOffsets:P,columns:I,flattenColumns:M}))))}));A.displayName="FixedHeader";var L=A,R=l.createContext(null);var D=function(t){var e=t.prefixCls,n=t.children,i=t.component,r=t.cellComponent,o=t.fixHeader,s=t.fixColumn,a=t.horizonScroll,c=t.className,u=t.expanded,h=t.componentWidth,d=t.colSpan,f=l.useContext(C.a).scrollbarSize;return l.useMemo((function(){var t=n;return s&&(t=l.createElement("div",{style:{width:h-(o?f:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(e,"-expanded-row-fixed")},t)),l.createElement(i,{className:c,style:{display:u?null:"none"}},l.createElement(E.a,{component:r,prefixCls:e,colSpan:d},t))}),[n,i,o,a,c,u,h,d,f])};function I(t){var e=t.className,n=t.style,i=t.record,o=t.index,s=t.rowKey,c=t.getRowKey,h=t.rowExpandable,d=t.expandedKeys,f=t.onRow,p=t.indent,v=void 0===p?0:p,g=t.rowComponent,m=t.cellComponent,y=t.childrenColumnName,b=l.useContext(C.a),S=b.prefixCls,w=b.fixedInfoList,x=l.useContext(R),T=x.fixHeader,O=x.fixColumn,_=x.horizonScroll,A=x.componentWidth,L=x.flattenColumns,M=x.expandableType,P=x.expandRowByClick,N=x.onTriggerExpand,j=x.rowClassName,B=x.expandedRowClassName,F=x.indentSize,U=x.expandIcon,G=x.expandedRowRender,H=x.expandIconColumnIndex,z=l.useState(!1),V=Object(a.a)(z,2),K=V[0],W=V[1],Y=d&&d.has(t.recordKey);l.useEffect((function(){Y&&W(!0)}),[Y]);var q,X="row"===M&&(!h||h(i)),$="nest"===M,Q=y&&i&&i[y],J=X||$;f&&(q=f(i,o));var Z;"string"==typeof j?Z=j:"function"==typeof j&&(Z=j(i,o,v));var tt,et,nt=Object(k.a)(L),it=l.createElement(g,Object.assign({},q,{"data-row-key":s,className:u()(e,"".concat(S,"-row"),"".concat(S,"-row-level-").concat(v),Z,q&&q.className),style:Object(r.a)(Object(r.a)({},n),q?q.style:null),onClick:function(t){if(P&&J&&N(i,t),q&&q.onClick){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];(e=q).onClick.apply(e,[t].concat(r))}}}),L.map((function(t,e){var n,r,s=t.render,a=t.dataIndex,c=t.className,u=nt[e],h=w[e];return e===(H||0)&&$&&(n=l.createElement(l.Fragment,null,l.createElement("span",{style:{paddingLeft:"".concat(F*v,"px")},className:"".concat(S,"-row-indent indent-level-").concat(v)}),U({prefixCls:S,expanded:Y,expandable:Q,record:i,onExpand:N}))),t.onCell&&(r=t.onCell(i,o)),l.createElement(E.a,Object.assign({className:c,ellipsis:t.ellipsis,align:t.align,component:m,prefixCls:S,key:u,record:i,index:o,dataIndex:a,render:s,shouldCellUpdate:t.shouldCellUpdate},h,{appendNode:n,additionalProps:r}))})));if(X&&(K||Y)){var rt=G(i,o,v+1,Y),ot=B&&B(i,o,v);tt=l.createElement(D,{expanded:Y,className:u()("".concat(S,"-expanded-row"),"".concat(S,"-expanded-row-level-").concat(v+1),ot),prefixCls:S,fixHeader:T,fixColumn:O,horizonScroll:_,component:g,componentWidth:A,cellComponent:m,colSpan:L.length},rt)}return Q&&Y&&(et=(i[y]||[]).map((function(e,n){var i=c(e,n);return l.createElement(I,Object.assign({},t,{key:i,rowKey:i,record:e,recordKey:i,index:n,indent:v+1}))}))),l.createElement(l.Fragment,null,it,tt,et)}I.displayName="BodyRow";var M=I,P=l.createContext(null);function N(t){var e=t.columnKey,n=t.onColumnResize,i=l.useRef();return l.useEffect((function(){i.current&&n(e,i.current.offsetWidth)}),[]),l.createElement(p.a,{onResize:function(t){var i=t.offsetWidth;n(e,i)}},l.createElement("td",{ref:i,style:{padding:0,border:0,height:0}},l.createElement("div",{style:{height:0,overflow:"hidden"}}," ")))}var j=l.memo((function(t){var e=t.data,n=t.getRowKey,i=t.measureColumnWidth,r=t.expandedKeys,o=t.onRow,s=t.rowExpandable,a=t.emptyNode,c=t.childrenColumnName,u=l.useContext(P).onColumnResize,h=l.useContext(C.a),d=h.prefixCls,f=h.getComponent,p=l.useContext(R),v=p.fixHeader,g=p.horizonScroll,m=p.flattenColumns,y=p.componentWidth;return l.useMemo((function(){var t,h=f(["body","wrapper"],"tbody"),p=f(["body","row"],"tr"),b=f(["body","cell"],"td");t=e.length?e.map((function(t,e){var i=n(t,e);return l.createElement(M,{key:i,rowKey:i,record:t,recordKey:i,index:e,rowComponent:p,cellComponent:b,expandedKeys:r,onRow:o,getRowKey:n,rowExpandable:s,childrenColumnName:c})})):l.createElement(D,{expanded:!0,className:"".concat(d,"-placeholder"),prefixCls:d,fixHeader:v,fixColumn:g,horizonScroll:g,component:p,componentWidth:y,cellComponent:b,colSpan:m.length},a);var E=Object(k.a)(m);return l.createElement(h,{className:"".concat(d,"-tbody")},i&&l.createElement("tr",{"aria-hidden":"true",className:"".concat(d,"-measure-row"),style:{height:0}},E.map((function(t){return l.createElement(N,{key:t,columnKey:t,onColumnResize:u})}))),t)}),[e,d,o,i,r,n,f,y,a,m])}));j.displayName="Body";var B=j,F=n("wRmb"),U=n("xEkU"),G=n.n(U);function H(t){var e=Object(l.useRef)(t),n=Object(l.useState)({}),i=Object(a.a)(n,2)[1],r=Object(l.useRef)(null),o=Object(l.useRef)([]);return Object(l.useEffect)((function(){return function(){G.a.cancel(r.current)}}),[]),[e.current,function(t){null===r.current&&(o.current=[],r.current=G()((function(){o.current.forEach((function(t){e.current=t(e.current)})),r.current=null,i({})}))),o.current.push(t)}]}var z=function(t,e,n){return Object(l.useMemo)((function(){for(var i=[],r=[],o=0,s=0,a=0;a<e;a+=1)if("rtl"===n){r[a]=s,s+=t[a]||0;var l=e-a-1;i[l]=o,o+=t[l]||0}else{i[a]=o,o+=t[a]||0;var c=e-a-1;r[c]=s,s+=t[c]||0}return{left:i,right:r}}),[t,e,n])};var V=function(t){var e=t.className,n=t.children;return l.createElement("div",{className:e},n)},K=n("n6Qo");function W(t){var e,n=t.prefixCls,r=t.record,o=t.onExpand,s=t.expanded,a=t.expandable,c="".concat(n,"-row-expand-icon");if(!a)return l.createElement("span",{className:u()(c,"".concat(n,"-row-spaced"))});return l.createElement("span",{className:u()(c,(e={},Object(i.a)(e,"".concat(n,"-row-expanded"),s),Object(i.a)(e,"".concat(n,"-row-collapsed"),!s),e)),onClick:function(t){o(r,t),t.stopPropagation()}})}var Y=n("zT1h"),q=n("y0+3"),X=l.forwardRef((function(t,e){var n,o,s=t.scrollBodyRef,c=t.onScroll,h=t.offsetScroll,d=l.useContext(C.a).prefixCls,f=(null===(n=s.current)||void 0===n?void 0:n.scrollWidth)||0,p=(null===(o=s.current)||void 0===o?void 0:o.clientWidth)||0,g=f&&p*(p/f),m=l.useRef(),y=H({scrollLeft:0,isHiddenScrollBar:!1}),b=Object(a.a)(y,2),E=b[0],S=b[1],k=l.useRef({delta:0,x:0}),w=l.useState(!1),x=Object(a.a)(w,2),T=x[0],O=x[1],_=function(){O(!1)},A=function(t){var e,n=(t||(null===(e=window)||void 0===e?void 0:e.event)).buttons;if(T&&0!==n){var i=k.current.x+t.pageX-k.current.x-k.current.delta;i<=0&&(i=0),i+g>=p&&(i=p-g),c({scrollLeft:i/p*(f+2)}),k.current.x=t.pageX}else T&&O(!1)},L=function(){var t=Object(q.b)(s.current).top,e=t+s.current.offsetHeight,n=document.documentElement.scrollTop+window.innerHeight;e-Object(v.a)()<=n||t>=n-h?S((function(t){return Object(r.a)(Object(r.a)({},t),{},{isHiddenScrollBar:!0})})):S((function(t){return Object(r.a)(Object(r.a)({},t),{},{isHiddenScrollBar:!1})}))},R=function(t){S((function(e){return Object(r.a)(Object(r.a)({},e),{},{scrollLeft:t/f*p||0})}))};return l.useImperativeHandle(e,(function(){return{setScrollLeft:R}})),l.useEffect((function(){var t=Object(Y.a)(document.body,"mouseup",_,!1),e=Object(Y.a)(document.body,"mousemove",A,!1);return L(),function(){t.remove(),e.remove()}}),[g,T]),l.useEffect((function(){var t=Object(Y.a)(window,"scroll",L,!1),e=Object(Y.a)(window,"resize",L,!1);return function(){t.remove(),e.remove()}}),[]),l.useEffect((function(){E.isHiddenScrollBar||S((function(t){var e,n;return Object(r.a)(Object(r.a)({},t),{},{scrollLeft:s.current.scrollLeft/(null===(e=s.current)||void 0===e?void 0:e.scrollWidth)*(null===(n=s.current)||void 0===n?void 0:n.clientWidth)})}))}),[E.isHiddenScrollBar]),f<=p||!g||E.isHiddenScrollBar?null:l.createElement("div",{style:{height:Object(v.a)(),width:p,bottom:h},className:"".concat(d,"-sticky-scroll")},l.createElement("div",{onMouseDown:function(t){t.persist(),k.current.delta=t.pageX-E.scrollLeft,k.current.x=0,O(!0),t.preventDefault()},ref:m,className:u()("".concat(d,"-sticky-scroll-bar"),Object(i.a)({},"".concat(d,"-sticky-scroll-bar-active"),T)),style:{width:"".concat(g,"px"),transform:"translate3d(".concat(E.scrollLeft,"px, 0, 0)")}}))}));var $=[],Q={},J="rc-table-internal-hook",Z=l.memo((function(t){return t.children}),(function(t,e){return!!d()(t.props,e.props)&&(t.pingLeft!==e.pingLeft||t.pingRight!==e.pingRight)}));function tt(t){var e,n=t.prefixCls,c=t.className,h=t.rowClassName,d=t.style,g=t.data,m=t.rowKey,y=t.scroll,b=t.tableLayout,E=t.direction,w=t.title,x=t.footer,A=t.summary,D=t.id,I=t.showHeader,M=t.components,N=t.emptyText,j=t.onRow,U=t.onHeaderRow,G=t.internalHooks,Y=t.transformColumns,q=t.internalRefs,tt=t.sticky,et=g||$,nt=!!et.length,it=l.useState(0),rt=Object(a.a)(it,2),ot=rt[0],st=rt[1];l.useEffect((function(){st(Object(v.a)())}));var at,lt,ct,ut=l.useMemo((function(){return Object(k.c)(M,{})}),[M]),ht=l.useCallback((function(t,e){return Object(k.b)(ut,t)||e}),[ut]),dt=l.useMemo((function(){return"function"==typeof m?m:function(t){return t&&t[m]}}),[m]),ft=Object(O.c)(t),pt=ft.expandIcon,vt=ft.expandedRowKeys,gt=ft.defaultExpandedRowKeys,mt=ft.defaultExpandAllRows,yt=ft.expandedRowRender,bt=ft.onExpand,Et=ft.onExpandedRowsChange,Ct=ft.expandRowByClick,St=ft.rowExpandable,kt=ft.expandIconColumnIndex,wt=ft.expandedRowClassName,xt=ft.childrenColumnName,Tt=ft.indentSize,Ot=pt||W,_t=xt||"children",At=l.useMemo((function(){return yt?"row":!!(t.expandable&&G===J&&t.expandable.__PARENT_RENDER_ICON__||et.some((function(t){return t&&"object"===Object(s.a)(t)&&t[_t]})))&&"nest"}),[!!yt,et]),Lt=l.useState((function(){return gt||(mt?function(t,e,n){var i=[];return function t(r){(r||[]).forEach((function(r,o){i.push(e(r,o)),t(r[n])}))}(t),i}(et,dt,_t):[])})),Rt=Object(a.a)(Lt,2),Dt=Rt[0],It=Rt[1],Mt=l.useMemo((function(){return new Set(vt||Dt||[])}),[vt,Dt]),Pt=l.useCallback((function(t){var e,n=dt(t,et.indexOf(t)),i=Mt.has(n);i?(Mt.delete(n),e=Object(o.a)(Mt)):e=[].concat(Object(o.a)(Mt),[n]),It(e),bt&&bt(!i,t),Et&&Et(e)}),[dt,Mt,et,bt,Et]),Nt=l.useState(0),jt=Object(a.a)(Nt,2),Bt=jt[0],Ft=jt[1],Ut=Object(F.b)(Object(r.a)(Object(r.a)(Object(r.a)({},t),ft),{},{expandable:!!yt,expandedKeys:Mt,getRowKey:dt,onTriggerExpand:Pt,expandIcon:Ot,expandIconColumnIndex:kt,direction:E}),G===J?Y:null),Gt=Object(a.a)(Ut,2),Ht=Gt[0],zt=Gt[1],Vt=l.useMemo((function(){return{columns:Ht,flattenColumns:zt}}),[Ht,zt]),Kt=l.useRef(),Wt=l.useRef(),Yt=l.useRef(),qt=l.useState(!1),Xt=Object(a.a)(qt,2),$t=Xt[0],Qt=Xt[1],Jt=l.useState(!1),Zt=Object(a.a)(Jt,2),te=Zt[0],ee=Zt[1],ne=H(new Map),ie=Object(a.a)(ne,2),re=ie[0],oe=ie[1],se=Object(k.a)(zt).map((function(t){return re.get(t)})),ae=l.useMemo((function(){return se}),[se.join("_")]),le=z(ae,zt.length,E),ce=y&&Object(k.d)(y.y),ue=y&&Object(k.d)(y.x),he=ue&&zt.some((function(t){return t.fixed})),de=l.useRef(),fe=function(t,e){return l.useMemo((function(){var n=!!t;return{isSticky:n,stickyClassName:n?"".concat(e,"-sticky-header"):"",offsetHeader:"object"===Object(s.a)(t)&&t.offsetHeader||0,offsetScroll:"object"===Object(s.a)(t)&&t.offsetScroll||0}}),[t,e])}(tt,n),pe=fe.isSticky,ve=fe.offsetHeader,ge=fe.offsetScroll,me=fe.stickyClassName;ce&&(lt={overflowY:"scroll",maxHeight:y.y}),ue&&(at={overflowX:"auto"},ce||(lt={overflowY:"hidden"}),ct={width:!0===y.x?"auto":y.x,minWidth:"100%"});var ye=l.useCallback((function(t,e){oe((function(n){var i=new Map(n);return i.set(t,e),i}))}),[]),be=function(t){var e=Object(l.useRef)(t),n=Object(l.useRef)(null);function i(){window.clearTimeout(n.current)}return Object(l.useEffect)((function(){return i}),[]),[function(t){e.current=t,i(),n.current=window.setTimeout((function(){e.current=null,n.current=null}),100)},function(){return e.current}]}(null),Ee=Object(a.a)(be,2),Ce=Ee[0],Se=Ee[1];function ke(t,e){e&&("function"==typeof e?e(t):e.scrollLeft!==t&&(e.scrollLeft=t))}var we=function(t){var e,n=t.currentTarget,i=t.scrollLeft,r="number"==typeof i?i:n.scrollLeft,o=n||Q;Se()&&Se()!==o||(Ce(o),ke(r,Wt.current),ke(r,Yt.current),ke(r,null===(e=de.current)||void 0===e?void 0:e.setScrollLeft));if(n){var s=n.scrollWidth,a=n.clientWidth;Qt(r>0),ee(r<s-a)}},xe=function(){Yt.current&&we({currentTarget:Yt.current})};l.useEffect((function(){return xe}),[]),l.useEffect((function(){ue&&xe()}),[ue]),l.useEffect((function(){G===J&&q&&(q.body.current=Yt.current)}));var Te,Oe,_e=ht(["table"],"table"),Ae=l.useMemo((function(){return b||(he?"max-content"===y.x?"auto":"fixed":ce||zt.some((function(t){return t.ellipsis}))?"fixed":"auto")}),[ce,he,zt,b]),Le={colWidths:ae,columCount:zt.length,stickyOffsets:le,onHeaderRow:U,fixHeader:ce},Re=l.useMemo((function(){return nt?null:"function"==typeof N?N():N}),[nt,N]),De=l.createElement(B,{data:et,measureColumnWidth:ce||ue||pe,expandedKeys:Mt,rowExpandable:St,getRowKey:dt,onRow:j,emptyNode:Re,childrenColumnName:_t}),Ie=l.createElement(_,{colWidths:zt.map((function(t){return t.width})),columns:zt}),Me=A&&l.createElement(K.b,null,A(et)),Pe=ht(["body"]);ce||pe?("function"==typeof Pe?(Oe=Pe(et,{scrollbarSize:ot,ref:Yt,onScroll:we}),Le.colWidths=zt.map((function(t,e){var n=t.width,i=e===Ht.length-1?n-ot:n;return"number"!=typeof i||Number.isNaN(i)?(Object(f.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0):i}))):Oe=l.createElement("div",{style:Object(r.a)(Object(r.a)({},at),lt),onScroll:we,ref:Yt,className:u()("".concat(n,"-body"))},l.createElement(_e,{style:Object(r.a)(Object(r.a)({},ct),{},{tableLayout:Ae})},Ie,De,Me),pe&&l.createElement(X,{ref:de,offsetScroll:ge,scrollBodyRef:Yt,onScroll:we})),Te=l.createElement(l.Fragment,null,!1!==I&&l.createElement(L,Object.assign({noData:!et.length},Le,Vt,{direction:E,offsetHeader:ve,stickyClassName:me,ref:Wt,onScroll:we})),Oe)):Te=l.createElement("div",{style:Object(r.a)(Object(r.a)({},at),lt),className:u()("".concat(n,"-content")),onScroll:we,ref:Yt},l.createElement(_e,{style:Object(r.a)(Object(r.a)({},ct),{},{tableLayout:Ae})},Ie,!1!==I&&l.createElement(T,Object.assign({},Le,Vt)),De,Me));var Ne=Object(O.b)(t),je=l.createElement("div",Object.assign({className:u()(n,c,(e={},Object(i.a)(e,"".concat(n,"-rtl"),"rtl"===E),Object(i.a)(e,"".concat(n,"-ping-left"),$t),Object(i.a)(e,"".concat(n,"-ping-right"),te),Object(i.a)(e,"".concat(n,"-layout-fixed"),"fixed"===b),Object(i.a)(e,"".concat(n,"-fixed-header"),ce),Object(i.a)(e,"".concat(n,"-fixed-column"),he),Object(i.a)(e,"".concat(n,"-scroll-horizontal"),ue),Object(i.a)(e,"".concat(n,"-has-fix-left"),zt[0]&&zt[0].fixed),Object(i.a)(e,"".concat(n,"-has-fix-right"),zt[zt.length-1]&&"right"===zt[zt.length-1].fixed),e)),style:d,id:D,ref:Kt},Ne),l.createElement(Z,{pingLeft:$t,pingRight:te,props:Object(r.a)(Object(r.a)({},t),{},{stickyOffsets:le,mergedExpandedKeys:Mt})},w&&l.createElement(V,{className:"".concat(n,"-title")},w(et)),l.createElement("div",{className:"".concat(n,"-container")},Te),x&&l.createElement(V,{className:"".concat(n,"-footer")},x(et))));ue&&(je=l.createElement(p.a,{onResize:function(t){var e=t.width;xe(),Ft(Kt.current?Kt.current.offsetWidth:e)}},je));var Be=l.useMemo((function(){return{prefixCls:n,getComponent:ht,scrollbarSize:ot,direction:E,fixedInfoList:zt.map((function(t,e){return S(e,e,zt,le,E)})),isSticky:pe}}),[n,ht,ot,E,zt,le,E,pe]),Fe=l.useMemo((function(){return Object(r.a)(Object(r.a)({},Vt),{},{tableLayout:Ae,rowClassName:h,expandedRowClassName:wt,componentWidth:Bt,fixHeader:ce,fixColumn:he,horizonScroll:ue,expandIcon:Ot,expandableType:At,expandRowByClick:Ct,expandedRowRender:yt,onTriggerExpand:Pt,expandIconColumnIndex:kt,indentSize:Tt})}),[Vt,Ae,h,wt,Bt,ce,he,ue,Ot,At,Ct,yt,Pt,kt,Tt]),Ue=l.useMemo((function(){return{onColumnResize:ye}}),[ye]);return l.createElement(C.a.Provider,{value:Be},l.createElement(R.Provider,{value:Fe},l.createElement(P.Provider,{value:Ue},je)))}tt.Column=m.a,tt.ColumnGroup=g.a,tt.Summary=K.a,tt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};e.b=tt},wRmb:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/rc-table/es/hooks/useColumns.js ***!
|
|
|
\******************************************************/
|
|
|
/*! exports provided: convertChildrenToColumns, default */
|
|
|
/*! exports used: convertChildrenToColumns, default */function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(/*! @babel/runtime/helpers/esm/defineProperty */"rePB"),r=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),o=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),s=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),a=n(/*! react */"q1tI"),l=(n(/*! rc-util/es/warning */"Kwbf"),n(/*! rc-util/es/Children/toArray */"Zm9Q")),c=n(/*! ../utils/legacyUtil */"hW8S");function u(t){return Object(l.a)(t).filter((function(t){return a.isValidElement(t)})).map((function(t){var e=t.key,n=t.props,i=n.children,r=Object(s.a)(n,["children"]),a=Object(o.a)({key:e},r);return i&&(a.children=u(i)),a}))}function h(t){return t.reduce((function(t,e){var n=e.fixed,i=!0===n?"left":n,s=e.children;return s&&s.length>0?[].concat(Object(r.a)(t),Object(r.a)(h(s).map((function(t){return Object(o.a)({fixed:i},t)})))):[].concat(Object(r.a)(t),[Object(o.a)(Object(o.a)({},e),{},{fixed:i})])}),[])}e.b=function(t,e){var n=t.prefixCls,r=t.columns,l=t.children,d=t.expandable,f=t.expandedKeys,p=t.getRowKey,v=t.onTriggerExpand,g=t.expandIcon,m=t.rowExpandable,y=t.expandIconColumnIndex,b=t.direction,E=t.expandRowByClick,C=a.useMemo((function(){return r||u(l)}),[r,l]),S=a.useMemo((function(){if(d){var t,e=y||0,r=C[e],o=(t={},Object(i.a)(t,c.a,{className:"".concat(n,"-expand-icon-col")}),Object(i.a)(t,"title",""),Object(i.a)(t,"fixed",r?r.fixed:null),Object(i.a)(t,"className","".concat(n,"-row-expand-icon-cell")),Object(i.a)(t,"render",(function(t,e,i){var r=p(e,i),o=f.has(r),s=!m||m(e),l=g({prefixCls:n,expanded:o,expandable:s,record:e,onExpand:v});return E?a.createElement("span",{onClick:function(t){return t.stopPropagation()}},l):l})),t),s=C.slice();return e>=0&&s.splice(e,0,o),s}return C}),[d,C,p,f,g,b]),k=a.useMemo((function(){var t=S;return e&&(t=e(t)),t.length||(t=[{render:function(){return null}}]),t}),[e,S,b]),w=a.useMemo((function(){return"rtl"===b?function(t){return t.map((function(t){var e=t.fixed,n=Object(s.a)(t,["fixed"]),i=e;return"left"===e?i="right":"right"===e&&(i="left"),Object(o.a)({fixed:i},n)}))}(h(k)):h(k)}),[k,b]);return[k,w]}},wwSX:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/assets/images/question/b2.svg ***!
|
|
|
\*******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/b2.5b0009be.svg"},"y0+3":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/Dom/css.js ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: get, set, getOuterWidth, getOuterHeight, getDocSize, getClientSize, getScroll, getOffset */
|
|
|
/*! exports used: getClientSize, getOffset */function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}));function i(){return{width:document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}}function r(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||document.body.clientLeft||0),top:e.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||document.body.clientTop||0)}}},y3Jh:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/pages/Question/Index/index.tsx ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/.umi-production/core/routes.ts (referenced with import()) */function(t,e,n){"use strict";n.r(e);n(/*! antd/es/carousel/style */"fV52");var i=n(/*! antd/es/carousel */"3I+P"),r=(n(/*! antd/es/table/style */"g9YV"),n(/*! antd/es/table */"wCAj")),o=(n(/*! antd/es/tabs/style */"Znn+"),n(/*! antd/es/tabs */"ZTPi")),s=(n(/*! antd/es/input/style */"5NDa"),n(/*! antd/es/input */"5rEg")),a=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),l=(n(/*! antd/es/menu/style */"lUTK"),n(/*! antd/es/menu */"BvKs")),c=(n(/*! antd/es/modal/style */"2qtc"),n(/*! antd/es/modal */"kLXV")),u=(n(/*! antd/es/message/style */"miYZ"),n(/*! antd/es/message */"tsqr")),h=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),d=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/toConsumableArray */"oBTY"),f=(n(/*! antd/es/button/style */"+L6B"),n(/*! antd/es/button */"2/Rp")),p=(n(/*! antd/es/dropdown/style */"qVdP"),n(/*! antd/es/dropdown */"jsC+")),v=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */"9og8"),g=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),m=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties */"PpiC"),y=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */"WmNS"),b=n.n(y),E=n(/*! react */"q1tI"),C=n.n(E),S=n(/*! umi */"Ty5D"),k=n(/*! umi */"9kvl"),w=n(/*! @/components/RenderHtml */"9Bee"),x=n(/*! moment */"wd/R"),T=n.n(x),O=n(/*! @/utils/env */"m3rI"),_=n(/*! @/utils/fetch */"ErOA"),A=n(/*! ./index.less?modules */"5A5F"),L=n.n(A),R=n(/*! @/utils/authority */"xKgJ"),D=n(/*! @/assets/images/question/v.svg */"zqRK"),I=n.n(D),M=n(/*! @/assets/images/question/a.svg */"uf8j"),P=n.n(M),N=n(/*! @/assets/images/question/b.svg */"yR49"),j=n.n(N),B=n(/*! @/assets/images/question/c.svg */"3SPk"),F=n.n(B),U=n(/*! @/assets/images/question/a1.svg */"eZjB"),G=n.n(U),H=n(/*! @/assets/images/question/a2.svg */"t6v1"),z=n.n(H),V=n(/*! @/assets/images/question/b1.svg */"+92d"),K=n.n(V),W=n(/*! @/assets/images/question/b2.svg */"wwSX"),Y=n.n(W),q=n(/*! @/assets/images/question/b3.svg */"zlzj"),X=n.n(q),$=n(/*! @/assets/images/question/dau.svg */"+RDj"),Q=n.n($),J=n(/*! lodash */"LvDl"),Z=n.n(J),tt=n(/*! @/utils/util */"1vsH"),et=n(/*! @/assets/images/pclose.png */"yDOu"),nt=n.n(et);e.default=Object(k.a)((function(t){return{user:t.user,globalSetting:t.globalSetting}}))((function(t){var e,n,y,x,A,D,M,N,B,U,H,V,W,q,$,J,et,it=t.globalSetting,rt=t.user,ot=t.dispatch,st=(Object(m.a)(t,["globalSetting","user","dispatch"]),Object(S.h)()),at={page:1,per_page:30,tag_discipline_id:[-1],source_discipline_id:[-1],status:null,difficulty:null,search:"",save_search:"",sort_by:null,sort_direction:null,filter:(null==st||null===(e=st.query)||void 0===e?void 0:e.tab)||"public"},lt=Object(E.useState)(0),ct=Object(g.a)(lt,2),ut=ct[0],ht=ct[1],dt=Object(E.useState)(0),ft=Object(g.a)(dt,2),pt=ft[0],vt=ft[1],gt=Object(E.useState)(0),mt=Object(g.a)(gt,2),yt=mt[0],bt=mt[1],Et=Object(E.useState)([]),Ct=Object(g.a)(Et,2),St=Ct[0],kt=Ct[1],wt=Object(E.useState)([]),xt=Object(g.a)(wt,2),Tt=xt[0],Ot=xt[1],_t=Object(E.useState)({}),At=Object(g.a)(_t,2),Lt=At[0],Rt=At[1],Dt=Object(E.useState)(!1),It=Object(g.a)(Dt,2),Mt=It[0],Pt=It[1],Nt=Object(E.useState)([]),jt=Object(g.a)(Nt,2),Bt=jt[0],Ft=jt[1],Ut=Object(E.useState)(!0),Gt=Object(g.a)(Ut,2),Ht=Gt[0],zt=Gt[1],Vt=Object(E.useState)(null),Kt=Object(g.a)(Vt,2),Wt=Kt[0],Yt=Kt[1],qt=Object(E.useState)(at),Xt=Object(g.a)(qt,2),$t=Xt[0],Qt=Xt[1],Jt=Object(E.useRef)(null),Zt=Object(E.useRef)(null),te=Object(E.useState)([]),ee=Object(g.a)(te,2),ne=ee[0],ie=ee[1],re=Object(E.useMemo)((function(){return["not_reviewed","under_review","review_finished"].includes($t.filter)}),[$t.filter]),oe=Object(E.useState)(!1),se=Object(g.a)(oe,2),ae=se[0],le=se[1],ce=Object(E.useState)(!1),ue=Object(g.a)(ce,2),he=ue[0],de=ue[1],fe=Object(E.useState)(""),pe=Object(g.a)(fe,2),ve=pe[0],ge=pe[1],me=Object(E.useState)([]),ye=Object(g.a)(me,2),be=ye[0],Ee=ye[1],Ce=Object(E.useState)(!1),Se=Object(g.a)(Ce,2),ke=Se[0],we=Se[1],xe=Object(E.useState)([]),Te=Object(g.a)(xe,2),Oe=Te[0],_e=Te[1],Ae=function(){var t=Object(v.a)(b.a.mark((function t(e,n,i){var r,o,s,a,l;return b.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.persist(),null!=e&&null!==(r=e.target)&&void 0!==r&&null!==(o=r.style)&&void 0!==o&&o.pointerEvents&&(e.target.style.pointerEvents="none"),t.next=4,Object(_.a)("/api/practices/".concat(n.identifier,"/start"),{method:"get"});case 4:if(0!==(null==(l=t.sent)?void 0:l.status)){t.next=10;break}if(!i){t.next=9;break}return Object(tt.O)("/problems/".concat(null==l?void 0:l.identifier,"/oj/").concat(null==n?void 0:n.identifier,"?tab=3")),t.abrupt("return");case 9:Object(tt.O)("/problems/".concat(null==l?void 0:l.identifier,"/oj/").concat(null==n?void 0:n.identifier));case 10:null!=e&&null!==(s=e.target)&&void 0!==s&&null!==(a=s.style)&&void 0!==a&&a.pointerEvents&&(e.target.style.pointerEvents="auto");case 11:case"end":return t.stop()}}),t)})));return function(e,n,i){return t.apply(this,arguments)}}();Object(E.useEffect)((function(){var t=T()().add(0,"days").unix(),e=localStorage.getItem("problemsclose");e?t>parseInt(e)&&we(!0):we(!0)}),[]);var Le=["未发布","已公开","未审核","审核中","未公开","未通过"],Re=[{title:"题目名称",dataIndex:"name",ellipsis:!0,render:function(t,e){return C.a.createElement("div",{className:L.a.titleWarp},"mine"===(null==$t?void 0:$t.filter)?C.a.createElement("span",{className:L.a.tag},Le[e.practice_status]):null,C.a.createElement("span",{title:t,className:L.a.hov,onClick:function(t){return Ae(t,e)}},t))}},"public"===(null==$t?void 0:$t.filter)?{title:"题解",dataIndex:"solution_count",width:100,sorter:!0,render:function(t,e){return C.a.createElement("span",{style:{display:"flex"}},C.a.createElement("span",{onClick:function(t){return Ae(t,e,!0)},className:"current"},t),(null==e?void 0:e.has_video_solution)&&C.a.createElement("img",{className:"ml5",src:I.a}))}}:null,"public"===(null==$t?void 0:$t.filter)?{title:"通过率",dataIndex:"pass_ratio",sorter:!0,width:90}:null,{title:"难度",dataIndex:"difficulty",sorter:!0,align:"center",width:90,render:function(t){return C.a.createElement(C.a.Fragment,null,1===t&&C.a.createElement("span",{className:L.a["btn-style-1"]},"简单"),2===t&&C.a.createElement("span",{className:L.a["btn-style-2"]},"适中"),3===t&&C.a.createElement("span",{className:L.a["btn-style-3"]},"困难"))}},"public"===(null==$t?void 0:$t.filter)?{title:"人数",dataIndex:"user_count",align:"center",sorter:!0,width:80}:null,"public"===(null==$t?void 0:$t.filter)?{title:"状态",dataIndex:"status",width:90,render:function(t,e){return Object(R.p)()?C.a.createElement(C.a.Fragment,null,Wt===(null==e?void 0:e.identifier)?C.a.createElement("span",{className:L.a.hovBtn,onClick:function(t){return Ae(t,e)}},"开启刷题"):C.a.createElement(C.a.Fragment,null,0===t&&C.a.createElement("span",{style:{color:"#666666"}},"未开启"),1===t&&C.a.createElement("span",{style:{color:"#666666"}},"进行中"),2===t&&C.a.createElement("span",{style:{color:"#666666"}},"已通过"))):"-"}}:null,"public"!==(null==$t?void 0:$t.filter)?{title:"知识点",dataIndex:"tag_disciplines_name",ellipsis:!0,width:200,render:function(t){return C.a.createElement("span",null,null==t?void 0:t.join("、"))}}:null,"all"===(null==$t?void 0:$t.filter)?{title:"创建者",dataIndex:"creator",ellipsis:!0,width:100}:null,"public"!==(null==$t?void 0:$t.filter)?{title:"更新时间",dataIndex:"updated_at",sorter:!0,width:180}:null,Object(R.v)()?{title:"操作",dataIndex:"action",key:"action",align:"center",width:80,render:function(t,e){return C.a.createElement(p.a,{className:"ml10",overlay:Ve(null==e?void 0:e.identifier,e)},C.a.createElement("span",{style:{cursor:"default"},onClick:function(t){return t.preventDefault()}},C.a.createElement("span",{className:"c-grey-666"},"更多"),C.a.createElement("i",{style:{display:"inline-block",transform:"scale(0.6)",fontSize:12},className:"c-grey-c iconfont icon-xiajiantou1"})))}}:Mt&&"public"!==(null==$t?void 0:$t.filter)?{title:"操作",dataIndex:"action",key:"action",align:"center",width:80,render:function(t,e){return null!=e&&e.is_self&&1!==(null==e?void 0:e.practice_status)?C.a.createElement(p.a,{className:"ml10",overlay:Ke(null==e?void 0:e.identifier,e)},C.a.createElement("span",{style:{cursor:"default"},onClick:function(t){return t.preventDefault()}},C.a.createElement("span",{className:"c-grey-666"},"更多"),C.a.createElement("i",{style:{display:"inline-block",transform:"scale(0.6)",fontSize:12},className:"c-grey-c iconfont icon-xiajiantou1"}))):"-"}}:null].filter((function(t){return!!t})),De=[{title:"题目名称",dataIndex:"name",ellipsis:!0,render:function(t,e){return C.a.createElement("span",{className:L.a.hov,onClick:function(t){return Ae(t,e)}},t)}},{title:"难度",dataIndex:"difficulty",sorter:!0,align:"center",width:90,render:function(t){return C.a.createElement(C.a.Fragment,null,1===t&&C.a.createElement("span",{className:L.a["btn-style-1"]},"简单"),2===t&&C.a.createElement("span",{className:L.a["btn-style-2"]},"适中"),3===t&&C.a.createElement("span",{className:L.a["btn-style-3"]},"困难"))}},"not_reviewed"===(null==$t?void 0:$t.filter)?{title:"创建者",dataIndex:"creator",ellipsis:!0,width:100}:{title:"审核者",dataIndex:"reviewer",ellipsis:!0,width:100},"not_reviewed"===(null==$t?void 0:$t.filter)?{title:"发布时间",dataIndex:"submit_time",width:180}:null,"under_review"===(null==$t?void 0:$t.filter)?{title:"开始审核时间",dataIndex:"start_review_time",width:180}:null,"review_finished"===(null==$t?void 0:$t.filter)?{title:"最后审核时间",dataIndex:"review_time",width:180}:null,{title:"操作",dataIndex:"action",key:"action",align:"center",width:120,render:function(t,e){var n;switch(null==$t?void 0:$t.filter){case"under_review":n=C.a.createElement("div",{style:{display:"flex"}},C.a.createElement(f.a,{type:"link",size:"small",onClick:function(t){return Ae(t,e)}},"审核"),C.a.createElement(f.a,{type:"link",style:{color:"#666"},size:"small",onClick:function(t){return Ne({e:t,record:e,op:"release"})}},"移出"));break;case"review_finished":n=C.a.createElement(f.a,{type:"link",size:"small",onClick:function(t){le(!0),Ie(e)}},"审核记录");break;default:n=C.a.createElement(f.a,{type:"link",block:!0,onClick:function(t){return Ne({e:t,record:e,op:"claim"})}},"开始审核")}return n}}].filter((function(t){return!!t})),Ie=function(){var t=Object(v.a)(b.a.mark((function t(e){var n;return b.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ee([]),t.next=3,Object(_.a)("/api/practices/".concat(e.identifier,"/review_list"),{method:"get"});case 3:n=t.sent,Ee(null==n?void 0:n.reviews_list);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Me=[{title:"审核时间",dataIndex:"review_time",key:"review_time",render:function(t,e){return C.a.createElement("span",null,T()(t).format("YYYY-MM-DD HH:mm:ss"))}},{title:"审核者",dataIndex:"reviewer",key:"reviewer"},{title:"审核结果",dataIndex:"status",width:120,key:"status",render:function(t,e){return"5"===t||5===t?C.a.createElement("div",{style:{display:"flex",alignItems:"center"}},C.a.createElement("div",{style:{color:"#333333",marginRight:"5px",whiteSpace:"nowrap"}},"未通过"),C.a.createElement("div",{style:{color:"#0152d9",whiteSpace:"nowrap",cursor:"pointer"},onClick:function(){ge(e.description),de(!0)}},"查看原因")):C.a.createElement("span",null,"已通过")}}];Object(E.useEffect)((function(){Be(),Pe($t)}),[]),Object(E.useEffect)((function(){var t;0!==St.length&&((null==Jt||null===(t=Jt.current)||void 0===t?void 0:t.clientHeight)>92&&ht(1))}),[St]),Object(E.useEffect)((function(){var t;0!==Tt.length&&((null==Zt||null===(t=Zt.current)||void 0===t?void 0:t.clientHeight)>92&&vt(1))}),[Tt]),Object(E.useEffect)((function(){return ot({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),ot({type:"globalSetting/setShowQuestionBackTop",payload:!0}),function(){ot({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),ot({type:"globalSetting/setShowQuestionBackTop",payload:!1})}}),[]),Object(E.useEffect)((function(){var t;("人工智能科研服务平台"===document.title||"首页"===document.title||"实践教学平台"===document.title||null!==(t=document.title)&&void 0!==t&&t.includes("img"))&&(document.title="在线刷题")}),[it]),Object(E.useEffect)((function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}}),[]);var Pe=function(){var t=Object(v.a)(b.a.mark((function t(e){var n,i,r,o;return b.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=Z.a.cloneDeep(e)).tag_discipline_id=null!==(n=r.tag_discipline_id)&&void 0!==n&&n.includes(-1)?[]:r.tag_discipline_id,r.source_discipline_id=null!==(i=r.source_discipline_id)&&void 0!==i&&i.includes(-1)?[]:r.source_discipline_id,console.log(r,"sendData"),zt(!0),Ft([]),t.next=8,Object(_.a)("/api/practices.json",{method:"get",params:r});case 8:o=t.sent,ie([]),zt(!1),bt(null==o?void 0:o.practices_count),Ft(null==o?void 0:o.practices_list),_e((null==o?void 0:o.recommend_subjects)||[]);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ne=function(){var t=Object(v.a)(b.a.mark((function t(e){var n,i,r,o,s,a;return b.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.op,i=e.description,r=e.record,o=e.e,s={op:n,description:i},zt(!0),t.next=5,Object(_.a)("/api/practices/".concat(r.identifier,"/review"),{method:"post",body:s});case 5:a=t.sent,zt(!1),"claim"!==n||0!==a.status&&"0"!==a.status||Ae(o,r),Pe($t);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),je=function(){var t=Object(v.a)(b.a.mark((function t(e){return b.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return zt(!0),t.next=3,Object(_.a)("/api/practices/".concat(e.identifier,"/publish"),{method:"post"});case 3:t.sent,zt(!1),Pe($t);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Be=function(){var t=Object(v.a)(b.a.mark((function t(){var e,n,i,r,o,s;return b.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(_.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice",position:"index"}});case 2:return n=t.sent,t.next=5,Object(_.a)("/api/tag_disciplines.json",{method:"get",params:{target:"practice_source",position:"index"}});case 5:return i=t.sent,t.next=8,Object(_.a)("/api/mypractices/rank_list",{method:"get",params:{}});case 8:r=t.sent,null!=n&&n.tag_disciplines&&(o=[{id:-1,name:"全部",count:null==n?void 0:n.totalCount}].concat(Object(d.a)(null==n?void 0:n.tag_disciplines)),kt(o)),null!=i&&i.tag_disciplines&&(s=[{id:-1,name:"全部",count:null==i?void 0:i.totalCount}].concat(Object(d.a)(null==i?void 0:i.tag_disciplines)),Ot(s)),Rt(r||{}),Pt(null==r||null===(e=r.my_record)||void 0===e?void 0:e.outsource);case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Fe=function(t,e){var n;$t.page=1;var i=$t["".concat(e,"_discipline_id")];null!==(n=$t["".concat(e,"_discipline_id")])&&void 0!==n&&n.includes(t)?i=i.filter((function(e){return e!==t})):i.push(t),-1===t?i=[-1]:(i=i.filter((function(t){return-1!==t}))).length||(i=[-1]),$t["".concat(e,"_discipline_id")]=i,Qt(Object(h.a)({},$t)),Pe($t)},Ue=function(t,e){$t.page=1,$t[e]="number"==typeof t?t:null,Qt(Object(h.a)({},$t)),Pe($t)},Ge=function(t){$t.page=1,$t.filter=t,$t.status=null,$t.practice_status=null,Qt(Object(h.a)({},$t)),Pe($t)},He=function(t,e){if(0!==(null==e?void 0:e.length)){var n=function(){var n=Object(v.a)(b.a.mark((function n(){var i,r;return b.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(_.a)("/api/practices/batch_op.json",{method:"post",body:{identifier:e,op:t}});case 2:0===(null==(i=n.sent)?void 0:i.status)&&(r=1===Bt.length&&1!==$t.page?$t.page-1:$t.page,$t.page=r,Qt(Object(h.a)({},$t)),Pe($t));case 4:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();-1!==t?n():c.a.confirm({centered:!0,width:500,okText:"确定",cancelText:"取消",title:"删除确认",icon:null,className:"custom-modal-divider",content:"删除后题目将不可再找回。",onOk:n})}else u.b.warn("请选择试题")},ze=C.a.createElement(l.a,null,"public"===(null==$t?void 0:$t.filter)?C.a.createElement(l.a.Item,{onClick:function(){return He(0,ne)}},"批量移出公共"):[C.a.createElement(l.a.Item,{key:2,onClick:function(){return He(1,ne)}},"批量移入公共"),C.a.createElement(l.a.Item,{key:1,onClick:function(){return He(0,ne)}},"批量移出公共")],"public"!==(null==$t?void 0:$t.filter)&&C.a.createElement(l.a.Item,{onClick:function(){return He(-1,ne)}},"批量删除")),Ve=function(t,e){return C.a.createElement(l.a,null,1===(null==e?void 0:e.practice_status)?C.a.createElement(l.a.Item,{onClick:function(){return He(0,[t])}},"移出公共"):C.a.createElement(l.a.Item,{onClick:function(){return He(1,[t])}},"移入公共"),"mine"===(null==$t?void 0:$t.filter)?C.a.createElement(l.a.Item,{onClick:function(){return je(e)},disabled:![0,4,5].includes(e.practice_status)},[0,4,5].includes(e.practice_status)?"发布审核":"已发布审核"):null,C.a.createElement(l.a.Item,{onClick:function(){return Object(tt.O)("/problems/".concat(t,"/ojedit"))}},"编辑"),"public"!==(null==$t?void 0:$t.filter)&&C.a.createElement(l.a.Item,{onClick:function(){return He(-1,[t])}},"删除"))},Ke=function(t,e){return C.a.createElement(l.a,null,C.a.createElement(l.a.Item,{onClick:function(){return je(e)},disabled:![0,4,5].includes(e.practice_status)},[0,4,5].includes(e.practice_status)?"发布审核":"已发布审核"),C.a.createElement(l.a.Item,{onClick:function(){return Object(tt.O)("/problems/".concat(t,"/ojedit"))}},"编辑"),C.a.createElement(l.a.Item,{onClick:function(){return He(-1,[t])}},"删除"))},We={selectedRowKeys:ne,columnWidth:40,onChange:function(t){ie(t)}};return C.a.createElement("section",{className:L.a.wrap},C.a.createElement("div",{className:L.a.bg},C.a.createElement("div",{className:L.a.btnWrap},C.a.createElement("div",{className:L.a.text},C.a.createElement("span",null,"在线刷题"),C.a.createElement("span",null,"快速提高编程能力")),C.a.createElement(p.a,{className:"ml10",overlay:C.a.createElement(l.a,null,C.a.createElement(l.a.Item,{key:1,onClick:function(){k.d.push("/problems/add")}},"新建题目"),C.a.createElement(l.a.Item,{key:2,onClick:function(){k.d.push("/problems/batchAdd")}},"批量导入题目"))},C.a.createElement("div",{className:L.a.btn,style:{visibility:Object(R.v)()||Mt?"visible":"hidden"}},C.a.createElement("i",{className:"iconfont icon-a-hao font12 mr5"}),C.a.createElement("span",null,"新建题目"))))),C.a.createElement("div",{className:L.a.content},C.a.createElement("div",{className:L.a.left},C.a.createElement("div",{className:L.a.filterPoint},C.a.createElement("div",{className:L.a.btnWarp,ref:Jt,style:ut>0?{height:1===ut?92:"auto"}:{}},null==St?void 0:St.map((function(t){var e;return C.a.createElement("div",{onClick:function(){return Fe(t.id,"tag")},key:t.id,className:null!=$t&&null!==(e=$t.tag_discipline_id)&&void 0!==e&&e.includes(t.id)?L.a.btnActive:L.a.btn},C.a.createElement("span",{title:t.name},t.name),C.a.createElement("span",{style:{display:t.count?"block":"none"}},t.count))})),!!ut&&C.a.createElement(C.a.Fragment,null,1===ut?C.a.createElement("div",{onClick:function(){return ht(2)},className:L.a.action},"展开",C.a.createElement("i",{style:{transform:"scale(0.7)"},className:"iconfont icon-xiala"})):C.a.createElement("div",{onClick:function(){return ht(1)},className:L.a.action},"收起",C.a.createElement("i",{style:{transform:"rotate(180deg) translateY(1px) scale(0.7)"},className:"iconfont icon-xiala"}))))),!!Tt.length&&C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{className:L.a.line}),C.a.createElement("div",{className:L.a.filterOrigin},C.a.createElement("div",{className:L.a.btnWarp,ref:Zt,style:pt>0?{height:1===pt?92:"auto"}:{}},null==Tt?void 0:Tt.map((function(t){var e;return C.a.createElement("div",{onClick:function(){return Fe(t.id,"source")},key:t.id,className:null!=$t&&null!==(e=$t.source_discipline_id)&&void 0!==e&&e.includes(t.id)?L.a.btnActive:L.a.btn},C.a.createElement("span",{title:t.name},t.name),C.a.createElement("span",null,t.count))})),!!pt&&C.a.createElement(C.a.Fragment,null,1===pt?C.a.createElement("div",{onClick:function(){return vt(2)},className:L.a.action},"展开",C.a.createElement("i",{style:{transform:"scale(0.7)"},className:"iconfont icon-xiala"})):C.a.createElement("div",{onClick:function(){return vt(1)},className:L.a.action},"收起",C.a.createElement("i",{style:{transform:"rotate(180deg) translateY(1px) scale(0.7)"},className:"iconfont icon-xiala"})))))),C.a.createElement("div",{className:L.a.control},C.a.createElement(a.a,{allowClear:!0,placeholder:"难度",value:null==$t?void 0:$t.difficulty,onChange:function(t){return Ue(t,"difficulty")}},C.a.createElement(a.a.Option,{value:1},"简单"),C.a.createElement(a.a.Option,{value:2},"适中"),C.a.createElement(a.a.Option,{value:3},"困难")),Object(R.p)()&&"public"===$t.filter&&C.a.createElement(a.a,{allowClear:!0,placeholder:"状态",value:null==$t?void 0:$t.status,onChange:function(t){return Ue(t,"status")}},C.a.createElement(a.a.Option,{value:0},"未开启"),C.a.createElement(a.a.Option,{value:1},"进行中"),C.a.createElement(a.a.Option,{value:2},"已通过")),Object(R.p)()&&"mine"===$t.filter&&C.a.createElement(a.a,{allowClear:!0,placeholder:"状态",value:null==$t?void 0:$t.practice_status,onChange:function(t){return Ue(t,"practice_status")}},C.a.createElement(a.a.Option,{value:0},"未发布"),C.a.createElement(a.a.Option,{value:1},"已公开"),C.a.createElement(a.a.Option,{value:2},"未审核"),C.a.createElement(a.a.Option,{value:3},"审核中"),C.a.createElement(a.a.Option,{value:4},"未公开"),C.a.createElement(a.a.Option,{value:5},"未通过")),Object(R.p)()&&"all"===$t.filter&&C.a.createElement(a.a,{allowClear:!0,placeholder:"状态",value:null==$t?void 0:$t.practice_status,onChange:function(t){return Ue(t,"practice_status")}},C.a.createElement(a.a.Option,{value:0},"未发布"),C.a.createElement(a.a.Option,{value:1},"已公开"),C.a.createElement(a.a.Option,{value:2},"未审核"),C.a.createElement(a.a.Option,{value:3},"审核中"),C.a.createElement(a.a.Option,{value:4},"未公开"),C.a.createElement(a.a.Option,{value:5},"未通过")),C.a.createElement(s.a.Search,{placeholder:Object(R.v)()?"请输入题目名称、创建者搜索":"请输入题目名称搜索",value:null==$t?void 0:$t.save_search,onChange:function(t){return e=t.target.value,$t.page=1,$t.save_search=e,void Qt(Object(h.a)({},$t));var e},onSearch:function(){$t.page=1,$t.search=$t.save_search,Qt(Object(h.a)({},$t)),Pe($t)}})),C.a.createElement("div",{className:L.a.table},C.a.createElement("div",{className:L.a.tabWarp,style:Object(R.v)()||Mt?{}:{height:10,border:0}},Object(R.v)()?C.a.createElement(o.a,{className:L.a.tab,activeKey:re?"not_reviewed":$t.filter,onChange:Ge},C.a.createElement(o.a.TabPane,{tab:"公共",key:"public"}),C.a.createElement(o.a.TabPane,{tab:"全部",key:"all"}),C.a.createElement(o.a.TabPane,{tab:"我创建的",key:"mine"}),C.a.createElement(o.a.TabPane,{tab:"审核列表",key:"not_reviewed"})):Mt?C.a.createElement(o.a,{className:L.a.tab,activeKey:re?"not_reviewed":$t.filter,onChange:Ge},C.a.createElement(o.a.TabPane,{tab:"公共",key:"public"}),C.a.createElement(o.a.TabPane,{tab:"我创建的",key:"mine"}),C.a.createElement(o.a.TabPane,{tab:"审核列表",key:"not_reviewed"})):null,Object(R.v)()&&!re&&C.a.createElement(p.a,{overlay:ze},C.a.createElement("span",{className:"ant-dropdown-link font14 current",onClick:function(t){return t.preventDefault()}},"批量操作 ",C.a.createElement("i",{style:{display:"inline-block",transform:"scale(0.6)",fontSize:12},className:"iconfont icon-xiajiantou1"})))),re?C.a.createElement("div",{className:L.a.tabWarp2,style:Object(R.v)()||Mt?{}:{height:10,border:0}},C.a.createElement(o.a,{className:L.a.tab,activeKey:$t.filter,onChange:Ge},C.a.createElement(o.a.TabPane,{tab:"待审核",key:"not_reviewed"}),C.a.createElement(o.a.TabPane,{tab:"审核中",key:"under_review"}),C.a.createElement(o.a.TabPane,{tab:"已审核",key:"review_finished"}))):null,C.a.createElement(r.a,{rowSelection:Object(R.v)()?We:void 0,className:L.a.customTable,dataSource:Bt,bordered:!1,rowKey:function(t){return t.identifier},columns:re?De:Re,rowClassName:L.a.row,loading:Ht,onRow:function(t){return{onMouseEnter:function(e){Yt(null==t?void 0:t.identifier)},onMouseLeave:function(t){Yt(null)}}},onChange:function(t,e,n){$t.page=null==t?void 0:t.current,$t.per_page=null==t?void 0:t.pageSize,null!=n&&n.order?($t.sort_by=null==n?void 0:n.field,$t.sort_direction="ascend"===(null==n?void 0:n.order)?"asc":"desc"):($t.sort_by=null,$t.sort_direction=null),Qt(Object(h.a)({},$t)),Pe($t)},pagination:{pageSize:$t.per_page,total:yt,current:$t.page,showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,position:["bottomCenter"],showTotal:function(t){return C.a.createElement("span",{className:"mr10"},"共",C.a.createElement("span",{className:"c-orange"},t),"条数据")}}}))),C.a.createElement("div",{className:L.a.right},C.a.createElement("div",{className:L.a.title},C.a.createElement("img",{src:Object(R.p)()?O.a.IMG_SERVER+"/images/"+(null==Lt||null===(n=Lt.my_record)||void 0===n?void 0:n.image_url):Q.a}),C.a.createElement("span",null,"我的刷题统计")),C.a.createElement("ul",null,C.a.createElement("li",null,C.a.createElement("div",null,C.a.createElement("span",null,"通过率"),Object(R.p)()?C.a.createElement("span",null,(null==Lt||null===(y=Lt.my_record)||void 0===y?void 0:y.passed_ratio)||0,"%"):C.a.createElement("span",null,"-")),C.a.createElement("img",{src:P.a})),C.a.createElement("li",null,C.a.createElement("div",null,C.a.createElement("span",null,"刷题数"),Object(R.p)()?C.a.createElement("span",null,(null==Lt||null===(x=Lt.my_record)||void 0===x?void 0:x.passed_count)||0):C.a.createElement("span",null,"-")),C.a.createElement("img",{src:j.a})),C.a.createElement("li",null,C.a.createElement("div",null,C.a.createElement("span",null,"时长(h)"),Object(R.p)()?C.a.createElement("span",null,null==Lt||null===(A=Lt.my_record)||void 0===A||null===(D=A.time_count)||void 0===D?void 0:D.toFixed(2)):C.a.createElement("span",null,"-")),C.a.createElement("img",{src:F.a}))),!(null==Lt||null===(M=Lt.rank_list)||void 0===M||!M.length)&&C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{className:L.a.line}),2!=(null===(N=rt.userInfo)||void 0===N?void 0:N.user_id)&&Object(R.m)()&&(null==it||null===(B=it.setting)||void 0===B?void 0:B.main_site)&&ke&&(null==Oe?void 0:Oe.length)>0&&C.a.createElement("div",{className:L.a.problemsclose,style:{position:"relative"}},C.a.createElement(i.a,{autoplay:!0,pauseOnDotsHover:!0,style:{width:292,height:170,marginBottom:"10px",overflow:"hidden"}},null==Oe?void 0:Oe.map((function(t,e){return C.a.createElement("div",{style:{display:"flex"},key:e},C.a.createElement("a",{href:"/paths/".concat(t.identifier)},C.a.createElement("img",{style:{width:"292px",height:"170px",borderRadius:"4px"},src:O.a.IMG_SERVER+"/"+t.image_url})))}))),C.a.createElement("img",{className:L.a.imgsrc,onClick:function(){localStorage.setItem("problemsclose",T()().add(1,"days").unix()+""),we(!1)},src:nt.a})),C.a.createElement("div",{className:L.a.sort},C.a.createElement("div",{className:L.a.titles},C.a.createElement("img",{src:G.a}),C.a.createElement("span",null,"排行榜")),!(null==Lt||null===(U=Lt.my_record)||void 0===U||!U.rank)&&C.a.createElement("div",{className:L.a.li,style:{background:"#D3EAFF"}},C.a.createElement("span",null,C.a.createElement("span",{style:{fontWeight:600,color:"#0152d9"}},(null==Lt||null===(H=Lt.my_record)||void 0===H?void 0:H.rank)>999?"999+":null==Lt||null===(V=Lt.my_record)||void 0===V?void 0:V.rank)),C.a.createElement("img",{className:"ml10 mr10",style:{borderRadius:"50%"},width:26,height:26,src:O.a.IMG_SERVER+"/images/"+(null==Lt||null===(W=Lt.my_record)||void 0===W?void 0:W.image_url)}),C.a.createElement("span",{title:null==Lt||null===(q=Lt.my_record)||void 0===q?void 0:q.nickname,style:{color:"#656F87",maxWidth:96,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},null==Lt||null===($=Lt.my_record)||void 0===$?void 0:$.nickname),C.a.createElement("img",{className:"ml10",src:z.a}),C.a.createElement("span",{style:{marginLeft:"auto",color:"#0152d9"}},null==Lt||null===(J=Lt.my_record)||void 0===J?void 0:J.passed_count,"题")),null==Lt||null===(et=Lt.rank_list)||void 0===et?void 0:et.map((function(t,e){var n=e+1;return 0===e&&(n=K.a),1===e&&(n=Y.a),2===e&&(n=X.a),C.a.createElement("div",{className:L.a.li},C.a.createElement("span",null,"number"==typeof n?C.a.createElement("span",{style:{fontWeight:600}},n):C.a.createElement("img",{src:n})),C.a.createElement("img",{className:"ml10 mr10",style:{borderRadius:"50%"},width:26,height:26,src:O.a.IMG_SERVER+"/images/"+(null==t?void 0:t.image_url)}),C.a.createElement("span",{title:null==t?void 0:t.nickname,style:{color:"#656F87",width:96,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}},null==t?void 0:t.nickname),C.a.createElement("span",{style:{marginLeft:"auto"}},t.passed_count,"题"))})))))),C.a.createElement(c.a,{title:"审核记录",visible:ae,onOk:function(){},onCancel:function(){le(!1)},footer:null,closable:!0},C.a.createElement(r.a,{dataSource:be,columns:Me})),C.a.createElement(c.a,{title:"未通过原因",visible:he,onOk:function(){},onCancel:function(){de(!1)},footer:null,closable:!0},C.a.createElement(w.a,{value:ve})))}))},yDOu:
|
|
|
/*!**************************************!*\
|
|
|
!*** ./src/assets/images/pclose.png ***!
|
|
|
\**************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABZlJREFUaEPtmd1rXNUah5/1tfdkkrSNMdWO+C0pp6mKYhURURRFvPFGiwj+A4p44Y30pngj5+ZcHET/AUGkeuONiKIoIqJVRO0UDdpzPAen2hhTm2Qye68vWdlOmYQ2M/2gYaQDw2K+f8/7/t53r/WOYMhvYsj1cxFgszN4MQN/mwzEGM8om0KIeD7gz+hH1//getEvvDBYU9i/nzXizwXmrAB6hXdFN3dV4mcOV2urtRam0ahEN3dV68zhau2FORuQMwI4nfAkurUDsXC0Er00j1hZXAswMk4cm6xET+wgNo4SE8y5ggwM0BXfG/Gu8P8fQibBUxOIzjKi2ILY2l4L8EedmJ8g1kaJcwvEBHTlbsLpQAbNxkAA68V/CHJ6B2JV+CRivIWsaWQxhmgfR47VEbZYC2By4lKbWN9GyJeIHUdYbBBG5iuQ2aPEeyH02moQiIEBegpUNkEmm4xpJAVqSSGlQ3UkMpNIbxG1HOFsBaENsVMQlSGWgVALhKDxY55Ajl9yhGSvmQrgJMR5AeiNfor8FMi5/yLHM6TYhpIlatGitnhUO6BkjvIeoQUy+ApAKqKLBKWIocDXJf6Ewo8bfMjw8Th+sSRMXUOYg5Ay0S3ufhB9M5AAUvRTl5lYQCbb6AKVxPtFdNBo4VFRoaNFC4MSAeUE0oQKwEqijoQo8dHihcEJj4sKLx1OjeMShMvxyU4LE4RU3AninAC60d+7Fzkzg/hsHpVsUxh0V7yJGBcxUaJ1gXnwXhq7ruPqiS1sN4aRVQDLysIJjh0+wk/vfkjL5VgRcFpgrcB2IXKLS3a6YxLfbBIPHKjstBHEhhlYH/3Zo6ipY2iboQuPSeJLR6YzzC3TXPLw3dyxZZTLfED5gOy98ClJUMk6y/z69sd89tUsv7sSm2nKBJErrClxc9tx0zvwg2ZhIIBk4xT9ZB2Xo8uAySMGQS4V2f17uOK+27lHCEasR4VkqYg8iRBSFAlS4Y3Cx8jKB5/z0fsH+Tl4SiJFIbCZxOoCl6yUspAKup+NTgtw0j5vIJP3e6MvOmQdQwbkt+3k0kcf4KEYqTuPDin6EeUdSvz17TGC0ngl8FLitcIJQfvN93jni+/5DShqljLWKNdn4cBjG9toQ4Bu8XIYxR+o5P3lZTJtyYQkN4Havqd5cHSERmkxLqC9Q6c1ZSDGqoiFSMVI0BKnNC6tmcEur9B68WXetZJODBTOUI6OUqZaYCueXfh+xdwXoNc+K2BMXkU+3R++k6vvu537O5bMO4x1mD27eWL+OP9pHuEb/gJAEGeu46bJbVx78BCvGY1VGlszlB98zvtvf8pPKQvpbgvKEbCD2mhgAJ+j6w7T7pAhybVg5LknuWvqEnYWJZkLmNKSTV/Fnssv5ZbWHN8e+oFvUwZ238CNjSlu/OU3vpr9HwczQ6klNs8o537n+3+9yicuskKgqNco2wmwwA1SB30BWi3UbImaqqPbEaMyMueoOcHIP5/iESGZtJYsiU8QzmP+cS23JsGtYzQTQGM7MwnouyN8mSxkFGXKgjGUMTD//Cu8pSMrWtPxJWVdYOfauOkM32jgNyrkMwaIgjwEakZTe/FZHneeuvVktiRLLdV7jA/o3ddzcxK+urU+RvPQj3ytUg2oqnWajDKBaEV737953To6UtIRkeLCATzD4y6eI4Cgve+lCwgwdBbqdqGhLeLz2UYntnLll00OXNA2unrWHdYLWeogezdjK5Fa6J3Vhu6stxJJfHc3OpSbuV6A7mFmKLfTqzYa1gPNqbIwVEfKLkBa09Z6KA/164p5dcgwVGOV9VlIj4dusHUqiNSZhma02J0uDPVwt3dEMrTj9V6IXlt1nx+aPzjWg5wK5lTv6X2u38iw3+e7r/edjQ76RZv1vosAmxX5ixba7Mj/bTLwJ/OqjXyXcOSkAAAAAElFTkSuQmCC"},yR49:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/assets/images/question/b.svg ***!
|
|
|
\******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/b.cc9f9921.svg"},zlzj:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/assets/images/question/b3.svg ***!
|
|
|
\*******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/b3.3fc1fac8.svg"},zqRK:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/assets/images/question/v.svg ***!
|
|
|
\******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,n){t.exports=n.p+"static/v.aee324d0.svg"}}]); |