diff --git a/color.less b/color.less index a9691faa2a..a2d6f50803 100644 --- a/color.less +++ b/color.less @@ -84,7 +84,7 @@ html {--antd-wave-shadow-color: @primary-color;} .zoom-right-enter, .zoom-right-appear {animation-fill-mode: both;} .zoom-right-leave {animation-fill-mode: both;} .ant-alert {color: @text-color;border-radius: 2px;} -.ant-alert-success {background-color: color(~`colorPalette("@{error-color}", 1)`);border: 1px solid color(~`colorPalette("@{success-color}", 3)`);} +.ant-alert-success {background-color: color(~`colorPalette("@{success-color}", 1)`);border: 1px solid color(~`colorPalette("@{success-color}", 3)`);} .ant-alert-success .ant-alert-icon {color: @success-color;} .ant-alert-info {background-color: color(~`colorPalette("@{primary-color}", 1)`);border: 1px solid color(~`colorPalette("@{primary-color}", 3)`);} .ant-alert-info .ant-alert-icon {color: @primary-color;} @@ -727,42 +727,42 @@ tr > .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child::afte .ant-form-item-has-success.ant-form-item-has-feedback .ant-form-item-children-icon {color: @success-color;} .ant-form-item-has-warning .ant-form-item-explain, .ant-form-item-has-warning .ant-form-item-split {color: @warning-color;} .ant-form-item-has-warning .ant-input, .ant-form-item-has-warning .ant-input-affix-wrapper, .ant-form-item-has-warning .ant-input:hover, .ant-form-item-has-warning .ant-input-affix-wrapper:hover {border-color: @warning-color;} -.ant-form-item-has-warning .ant-input:focus, .ant-form-item-has-warning .ant-input-affix-wrapper:focus, .ant-form-item-has-warning .ant-input-focused, .ant-form-item-has-warning .ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(72, 41, 169, 0.2);} +.ant-form-item-has-warning .ant-input:focus, .ant-form-item-has-warning .ant-input-affix-wrapper:focus, .ant-form-item-has-warning .ant-input-focused, .ant-form-item-has-warning .ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(144, 84, 254, 0.2);} .ant-form-item-has-warning .ant-input:not(.ant-form-item-has-warning .ant-input-disabled) {background-color: #fff;} .ant-form-item-has-warning .ant-input-affix-wrapper:not(.ant-form-item-has-warning .ant-input-affix-wrapper-disabled) {background-color: #fff;} .ant-form-item-has-warning .ant-input-affix-wrapper input:focus {box-shadow: none !important;} -.ant-form-item-has-warning .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(72, 41, 169, 0.2);} +.ant-form-item-has-warning .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(144, 84, 254, 0.2);} .ant-form-item-has-warning .ant-input-prefix {color: @warning-color;} .ant-form-item-has-warning .ant-input-group-addon {color: @warning-color;border-color: @warning-color;} .ant-form-item-has-warning .has-feedback {color: @warning-color;} .ant-form-item-has-warning.ant-form-item-has-feedback .ant-form-item-children-icon {color: @warning-color;} .ant-form-item-has-warning .ant-select:not(.ant-select-borderless) .ant-select-selector {border-color: @warning-color !important;} -.ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector, .ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(72, 41, 169, 0.2);} +.ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector, .ant-form-item-has-warning .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(144, 84, 254, 0.2);} .ant-form-item-has-warning .ant-input-number, .ant-form-item-has-warning .ant-picker {border-color: @warning-color;} -.ant-form-item-has-warning .ant-input-number-focused, .ant-form-item-has-warning .ant-picker-focused, .ant-form-item-has-warning .ant-input-number:focus, .ant-form-item-has-warning .ant-picker:focus {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(72, 41, 169, 0.2);} +.ant-form-item-has-warning .ant-input-number-focused, .ant-form-item-has-warning .ant-picker-focused, .ant-form-item-has-warning .ant-input-number:focus, .ant-form-item-has-warning .ant-picker:focus {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(144, 84, 254, 0.2);} .ant-form-item-has-warning .ant-input-number:not([disabled]):hover, .ant-form-item-has-warning .ant-picker:not([disabled]):hover {border-color: @warning-color;} -.ant-form-item-has-warning .ant-cascader-picker:focus .ant-cascader-input {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(72, 41, 169, 0.2);} +.ant-form-item-has-warning .ant-cascader-picker:focus .ant-cascader-input {border-color: color(~`colorPalette("@{warning-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(144, 84, 254, 0.2);} .ant-form-item-has-error .ant-form-item-explain, .ant-form-item-has-error .ant-form-item-split {color: @error-color;} .ant-form-item-has-error .ant-input, .ant-form-item-has-error .ant-input-affix-wrapper, .ant-form-item-has-error .ant-input:hover, .ant-form-item-has-error .ant-input-affix-wrapper:hover {border-color: @error-color;} -.ant-form-item-has-error .ant-input:focus, .ant-form-item-has-error .ant-input-affix-wrapper:focus, .ant-form-item-has-error .ant-input-focused, .ant-form-item-has-error .ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(14, 76, 252, 0.2);} +.ant-form-item-has-error .ant-input:focus, .ant-form-item-has-error .ant-input-affix-wrapper:focus, .ant-form-item-has-error .ant-input-focused, .ant-form-item-has-error .ant-input-affix-wrapper-focused {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(51, 142, 45, 0.2);} .ant-form-item-has-error .ant-input:not(.ant-form-item-has-error .ant-input-disabled) {background-color: #fff;} .ant-form-item-has-error .ant-input-affix-wrapper:not(.ant-form-item-has-error .ant-input-affix-wrapper-disabled) {background-color: #fff;} .ant-form-item-has-error .ant-input-affix-wrapper input:focus {box-shadow: none !important;} -.ant-form-item-has-error .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(14, 76, 252, 0.2);} +.ant-form-item-has-error .ant-calendar-picker-open .ant-calendar-picker-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(51, 142, 45, 0.2);} .ant-form-item-has-error .ant-input-prefix {color: @error-color;} .ant-form-item-has-error .ant-input-group-addon {color: @error-color;border-color: @error-color;} .ant-form-item-has-error .has-feedback {color: @error-color;} .ant-form-item-has-error.ant-form-item-has-feedback .ant-form-item-children-icon {color: @error-color;} .ant-form-item-has-error .ant-select:not(.ant-select-borderless) .ant-select-selector {border-color: @error-color !important;} -.ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector, .ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(14, 76, 252, 0.2);} +.ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-open .ant-select-selector, .ant-form-item-has-error .ant-select:not(.ant-select-borderless).ant-select-focused .ant-select-selector {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(51, 142, 45, 0.2);} .ant-form-item-has-error .ant-input-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {border: 0;} .ant-form-item-has-error .ant-select.ant-select-auto-complete .ant-input:focus {border-color: @error-color;} .ant-form-item-has-error .ant-input-number, .ant-form-item-has-error .ant-picker {border-color: @error-color;} -.ant-form-item-has-error .ant-input-number-focused, .ant-form-item-has-error .ant-picker-focused, .ant-form-item-has-error .ant-input-number:focus, .ant-form-item-has-error .ant-picker:focus {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(14, 76, 252, 0.2);} +.ant-form-item-has-error .ant-input-number-focused, .ant-form-item-has-error .ant-picker-focused, .ant-form-item-has-error .ant-input-number:focus, .ant-form-item-has-error .ant-picker:focus {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(51, 142, 45, 0.2);} .ant-form-item-has-error .ant-input-number:not([disabled]):hover, .ant-form-item-has-error .ant-picker:not([disabled]):hover {border-color: @error-color;} .ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor, .ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):hover {border-color: @error-color;} -.ant-form-item-has-error .ant-mention-wrapper.ant-mention-active:not([disabled]) .ant-mention-editor, .ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):focus {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(14, 76, 252, 0.2);} -.ant-form-item-has-error .ant-cascader-picker:focus .ant-cascader-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(14, 76, 252, 0.2);} +.ant-form-item-has-error .ant-mention-wrapper.ant-mention-active:not([disabled]) .ant-mention-editor, .ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):focus {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(51, 142, 45, 0.2);} +.ant-form-item-has-error .ant-cascader-picker:focus .ant-cascader-input {border-color: color(~`colorPalette("@{error-color}", 5)`);border-right-width: 1px !important;box-shadow: 0 0 0 2px rgba(51, 142, 45, 0.2);} .ant-form-item-has-error .ant-transfer-list {border-color: @error-color;} .ant-form-item-has-error .ant-transfer-list-search:not([disabled]) {border-color: @border-color-base;} .ant-form-item-has-error .ant-transfer-list-search:not([disabled]):hover {border-color: color(~`colorPalette("@{primary-color}", 5)`);border-right-width: 1px !important;} diff --git a/index.html b/index.html index f1d0d9df00..8c258a0cf6 100644 --- a/index.html +++ b/index.html @@ -127,6 +127,6 @@ - + diff --git a/p__Classrooms__Lists__CommonHomework__Edit__index.ea8f5b6c.async.js b/p__Classrooms__Lists__CommonHomework__Edit__index.ea8f5b6c.async.js index 87fc2ec502..e71c2b3f80 100644 --- a/p__Classrooms__Lists__CommonHomework__Edit__index.ea8f5b6c.async.js +++ b/p__Classrooms__Lists__CommonHomework__Edit__index.ea8f5b6c.async.js @@ -1,8 +1,8 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[50,5,6,7],{"+NIl":function(pt,Te,q){(function(ue){ue(q("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(J,_){"use strict";function X(p,m){p.cmdState.push(m)}function F(p){return p.cmdState.length>0?p.cmdState[p.cmdState.length-1]:null}function P(p){var m=p.cmdState.pop();m&&m.closeBracket()}function W(p){for(var m=p.cmdState,g=m.length-1;g>=0;g--){var a=m[g];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function U(p,m,g){return function(){this.name=p,this.bracketNo=0,this.style=m,this.styles=g,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=U("importmodule","tag",["string","builtin"]),O.documentclass=U("documentclass","tag",["","atom"]),O.usepackage=U("usepackage","tag",["atom"]),O.begin=U("begin","tag",["atom"]),O.end=U("end","tag",["atom"]),O.label=U("label","tag",["atom"]),O.ref=U("ref","tag",["atom"]),O.eqref=U("eqref","tag",["atom"]),O.cite=U("cite","tag",["atom"]),O.bibitem=U("bibitem","tag",["atom"]),O.Bibitem=U("Bibitem","tag",["atom"]),O.RBibitem=U("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(p,m){p.f=m}function d(p,m){var g;if(p.match(/^\\[a-zA-Z@]+/)){var a=p.current().slice(1);return g=O.hasOwnProperty(a)?O[a]:O.DEFAULT,g=new g,X(m,g),L(m,T),g.style}if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/\\]/))return"tag";if(p.match("\\["))return L(m,function(s,l){return f(s,l,"\\]")}),"keyword";if(p.match("\\("))return L(m,function(s,l){return f(s,l,"\\)")}),"keyword";if(p.match("$$"))return L(m,function(s,l){return f(s,l,"$$")}),"keyword";if(p.match("$"))return L(m,function(s,l){return f(s,l,"$")}),"keyword";var i=p.next();if(i=="%")return p.skipToEnd(),"comment";if(i=="}"||i=="]"){if(g=F(m),g)g.closeBracket(i),L(m,T);else return"error";return"bracket"}else return i=="{"||i=="["?(g=O.DEFAULT,g=new g,X(m,g),"bracket"):/\d/.test(i)?(p.eatWhile(/[\w.%]/),"atom"):(p.eatWhile(/[\w\-_]/),g=W(m),g.name=="begin"&&(g.argument=p.current()),g.styleIdentifier())}function f(p,m,g){if(p.eatSpace())return null;if(g&&p.match(g))return L(m,d),"keyword";if(p.match(/^\\[a-zA-Z@]+/))return"tag";if(p.match(/^[a-zA-Z]+/))return"variable-2";if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/]/))return"tag";if(p.match(/^[\^_&]/))return"tag";if(p.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(p.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=p.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(p.skipToEnd(),"comment"):"error"}function T(p,m){var g=p.peek(),a;return g=="{"||g=="["?(a=F(m),a.openBracket(g),p.eat(g),L(m,d),"bracket"):/[ \t\r]/.test(g)?(p.eat(g),null):(L(m,d),P(m),d(p,m))}return{startState:function(){var p=_.inMathMode?function(m,g){return f(m,g)}:d;return{cmdState:[],f:p}},copyState:function(p){return{cmdState:p.cmdState.slice(),f:p.f}},token:function(p,m){return m.f(p,m)},blankLine:function(p){p.f=d,p.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"+ua5":function(pt,Te,q){},"/cxE":function(pt,Te,q){"use strict";q.d(Te,"e",function(){return _}),q.d(Te,"f",function(){return X}),q.d(Te,"g",function(){return F}),q.d(Te,"d",function(){return W}),q.d(Te,"a",function(){return U}),q.d(Te,"b",function(){return O}),q.d(Te,"c",function(){return L});var ue=function(){function d(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(function(){throw f.stack?new Error(f.message+` +(window.webpackJsonp=window.webpackJsonp||[]).push([[50,5,6,7],{"+NIl":function(pt,Te,q){(function(ue){ue(q("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(J,_){"use strict";function X(p,m){p.cmdState.push(m)}function F(p){return p.cmdState.length>0?p.cmdState[p.cmdState.length-1]:null}function P(p){var m=p.cmdState.pop();m&&m.closeBracket()}function W(p){for(var m=p.cmdState,g=m.length-1;g>=0;g--){var a=m[g];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function U(p,m,g){return function(){this.name=p,this.bracketNo=0,this.style=m,this.styles=g,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=U("importmodule","tag",["string","builtin"]),O.documentclass=U("documentclass","tag",["","atom"]),O.usepackage=U("usepackage","tag",["atom"]),O.begin=U("begin","tag",["atom"]),O.end=U("end","tag",["atom"]),O.label=U("label","tag",["atom"]),O.ref=U("ref","tag",["atom"]),O.eqref=U("eqref","tag",["atom"]),O.cite=U("cite","tag",["atom"]),O.bibitem=U("bibitem","tag",["atom"]),O.Bibitem=U("Bibitem","tag",["atom"]),O.RBibitem=U("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(p,m){p.f=m}function h(p,m){var g;if(p.match(/^\\[a-zA-Z@]+/)){var a=p.current().slice(1);return g=O.hasOwnProperty(a)?O[a]:O.DEFAULT,g=new g,X(m,g),L(m,T),g.style}if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/\\]/))return"tag";if(p.match("\\["))return L(m,function(s,l){return f(s,l,"\\]")}),"keyword";if(p.match("\\("))return L(m,function(s,l){return f(s,l,"\\)")}),"keyword";if(p.match("$$"))return L(m,function(s,l){return f(s,l,"$$")}),"keyword";if(p.match("$"))return L(m,function(s,l){return f(s,l,"$")}),"keyword";var i=p.next();if(i=="%")return p.skipToEnd(),"comment";if(i=="}"||i=="]"){if(g=F(m),g)g.closeBracket(i),L(m,T);else return"error";return"bracket"}else return i=="{"||i=="["?(g=O.DEFAULT,g=new g,X(m,g),"bracket"):/\d/.test(i)?(p.eatWhile(/[\w.%]/),"atom"):(p.eatWhile(/[\w\-_]/),g=W(m),g.name=="begin"&&(g.argument=p.current()),g.styleIdentifier())}function f(p,m,g){if(p.eatSpace())return null;if(g&&p.match(g))return L(m,h),"keyword";if(p.match(/^\\[a-zA-Z@]+/))return"tag";if(p.match(/^[a-zA-Z]+/))return"variable-2";if(p.match(/^\\[$&%#{}_]/))return"tag";if(p.match(/^\\[,;!\/]/))return"tag";if(p.match(/^[\^_&]/))return"tag";if(p.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(p.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=p.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(p.skipToEnd(),"comment"):"error"}function T(p,m){var g=p.peek(),a;return g=="{"||g=="["?(a=F(m),a.openBracket(g),p.eat(g),L(m,h),"bracket"):/[ \t\r]/.test(g)?(p.eat(g),null):(L(m,h),P(m),h(p,m))}return{startState:function(){var p=_.inMathMode?function(m,g){return f(m,g)}:h;return{cmdState:[],f:p}},copyState:function(p){return{cmdState:p.cmdState.slice(),f:p.f}},token:function(p,m){return m.f(p,m)},blankLine:function(p){p.f=h,p.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"+ua5":function(pt,Te,q){},"/cxE":function(pt,Te,q){"use strict";q.d(Te,"e",function(){return _}),q.d(Te,"f",function(){return X}),q.d(Te,"g",function(){return F}),q.d(Te,"d",function(){return W}),q.d(Te,"a",function(){return U}),q.d(Te,"b",function(){return O}),q.d(Te,"c",function(){return L});var ue=function(){function h(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(function(){throw f.stack?new Error(f.message+` -`+f.stack):f},0)}}return d.prototype.emit=function(f){this.listeners.forEach(function(T){T(f)})},d.prototype.onUnexpectedError=function(f){this.unexpectedErrorHandler(f),this.emit(f)},d.prototype.onUnexpectedExternalError=function(f){this.unexpectedErrorHandler(f)},d}(),J=new ue;function _(d){W(d)||J.onUnexpectedError(d);return}function X(d){W(d)||J.onUnexpectedExternalError(d);return}function F(d){if(d instanceof Error){var f=d.name,T=d.message,p=d.stacktrace||d.stack;return{$isError:!0,name:f,message:T,stack:p}}return d}var P="Canceled";function W(d){return d instanceof Error&&d.name===P&&d.message===P}function U(){var d=new Error(P);return d.name=d.message,d}function O(d){return d?new Error("Illegal argument: "+d):new Error("Illegal argument")}function L(d){return d?new Error("Illegal state: "+d):new Error("Illegal state")}},"19Vz":function(pt,Te,q){(function(ue){ue(q("VrN/"))})(function(ue){ue.defineOption("placeholder","",function(U,O,L){var d=L&&L!=ue.Init;if(O&&!d)U.on("blur",F),U.on("change",P),U.on("swapDoc",P),ue.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){X(U)}),P(U);else if(!O&&d){U.off("blur",F),U.off("change",P),U.off("swapDoc",P),ue.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),J(U);var f=U.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}O&&!U.hasFocus()&&F(U)});function J(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function _(U){J(U);var O=U.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=U.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var L=U.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),O.appendChild(L),U.display.lineSpace.insertBefore(O,U.display.lineSpace.firstChild)}function X(U){setTimeout(function(){var O=!1,L=U.getInputField();L.nodeName=="TEXTAREA"?O=!L.value:U.lineCount()==1&&(O=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),O?_(U):J(U)},20)}function F(U){W(U)&&_(U)}function P(U){var O=U.getWrapperElement(),L=W(U);O.className=O.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?_(U):J(U)}function W(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(pt,Te,q){(function(ue){ue(q("VrN/"))})(function(ue){"use strict";var J={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},_={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ue.defineMode("xml",function(X,F){var P=X.indentUnit,W={},U=F.htmlMode?J:_;for(var O in U)W[O]=U[O];for(var O in F)W[O]=F[O];var L,d;function f(u,A){function S(B){return A.tokenize=B,B(u,A)}var D=u.next();if(D=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?S(m("atom","]]>")):null:u.match("--")?S(m("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),S(g(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),A.tokenize=m("meta","?>"),"meta"):(L=u.eat("/")?"closeTag":"openTag",A.tokenize=T,"tag bracket");if(D=="&"){var I;return u.eat("#")?u.eat("x")?I=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):I=u.eatWhile(/[\d]/)&&u.eat(";"):I=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),I?"atom":"error"}else return u.eatWhile(/[^&<]/),null}f.isInText=!0;function T(u,A){var S=u.next();if(S==">"||S=="/"&&u.eat(">"))return A.tokenize=f,L=S==">"?"endTag":"selfcloseTag","tag bracket";if(S=="=")return L="equals",null;if(S=="<"){A.tokenize=f,A.state=l,A.tagName=A.tagStart=null;var D=A.tokenize(u,A);return D?D+" tag error":"tag error"}else return/[\'\"]/.test(S)?(A.tokenize=p(S),A.stringStartCol=u.column(),A.tokenize(u,A)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(u){var A=function(S,D){for(;!S.eol();)if(S.next()==u){D.tokenize=T;break}return"string"};return A.isInAttribute=!0,A}function m(u,A){return function(S,D){for(;!S.eol();){if(S.match(A)){D.tokenize=f;break}S.next()}return u}}function g(u){return function(A,S){for(var D;(D=A.next())!=null;){if(D=="<")return S.tokenize=g(u+1),S.tokenize(A,S);if(D==">")if(u==1){S.tokenize=f;break}else return S.tokenize=g(u-1),S.tokenize(A,S)}return"meta"}}function a(u,A,S){this.prev=u.context,this.tagName=A,this.indent=u.indented,this.startOfLine=S,(W.doNotIndent.hasOwnProperty(A)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function i(u){u.context&&(u.context=u.context.prev)}function s(u,A){for(var S;;){if(!u.context)return;if(S=u.context.tagName,!W.contextGrabbers.hasOwnProperty(S)||!W.contextGrabbers[S].hasOwnProperty(A))return;i(u)}}function l(u,A,S){return u=="openTag"?(S.tagStart=A.column(),C):u=="closeTag"?v:l}function C(u,A,S){return u=="word"?(S.tagName=A.current(),d="tag",w):W.allowMissingTagName&&u=="endTag"?(d="tag bracket",w(u,A,S)):(d="error",C)}function v(u,A,S){if(u=="word"){var D=A.current();return S.context&&S.context.tagName!=D&&W.implicitlyClosed.hasOwnProperty(S.context.tagName)&&i(S),S.context&&S.context.tagName==D||W.matchClosing===!1?(d="tag",y):(d="tag error",R)}else return W.allowMissingTagName&&u=="endTag"?(d="tag bracket",y(u,A,S)):(d="error",R)}function y(u,A,S){return u!="endTag"?(d="error",y):(i(S),l)}function R(u,A,S){return d="error",y(u,A,S)}function w(u,A,S){if(u=="word")return d="attribute",x;if(u=="endTag"||u=="selfcloseTag"){var D=S.tagName,I=S.tagStart;return S.tagName=S.tagStart=null,u=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(D)?s(S,D):(s(S,D),S.context=new a(S,D,I==S.indented)),l}return d="error",w}function x(u,A,S){return u=="equals"?b:(W.allowMissing||(d="error"),w(u,A,S))}function b(u,A,S){return u=="string"?h:u=="word"&&W.allowUnquoted?(d="string",w):(d="error",w(u,A,S))}function h(u,A,S){return u=="string"?h:w(u,A,S)}return{startState:function(u){var A={tokenize:f,state:l,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(A.baseIndent=u),A},token:function(u,A){if(!A.tagName&&u.sol()&&(A.indented=u.indentation()),u.eatSpace())return null;L=null;var S=A.tokenize(u,A);return(S||L)&&S!="comment"&&(d=null,A.state=A.state(L||S,u,A),d&&(S=d=="error"?S+" error":d)),S},indent:function(u,A,S){var D=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+P;if(D&&D.noIndent)return ue.Pass;if(u.tokenize!=T&&u.tokenize!=f)return S?S.match(/^(\s*)/)[0].length:0;if(u.tagName)return W.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+P*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/$/,blockCommentStart:"",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(u){u.state==b&&(u.state=w)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var A=[],S=u.context;S;S=S.prev)S.tagName&&A.push(S.tagName);return A.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return _});var ue=q("JYp7"),J=function(){function X(F){this.element=F,this.next=X.Undefined,this.prev=X.Undefined}return X.Undefined=new X(void 0),X}(),_=function(){function X(){this._first=J.Undefined,this._last=J.Undefined,this._size=0}return Object.defineProperty(X.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),X.prototype.isEmpty=function(){return this._first===J.Undefined},X.prototype.clear=function(){this._first=J.Undefined,this._last=J.Undefined,this._size=0},X.prototype.unshift=function(F){return this._insert(F,!1)},X.prototype.push=function(F){return this._insert(F,!0)},X.prototype._insert=function(F,P){var W=this,U=new J(F);if(this._first===J.Undefined)this._first=U,this._last=U;else if(P){var O=this._last;this._last=U,U.prev=O,O.next=U}else{var L=this._first;this._first=U,U.next=L,L.prev=U}this._size+=1;var d=!1;return function(){d||(d=!0,W._remove(U))}},X.prototype.shift=function(){if(this._first===J.Undefined)return;var F=this._first.element;return this._remove(this._first),F},X.prototype.pop=function(){if(this._last===J.Undefined)return;var F=this._last.element;return this._remove(this._last),F},X.prototype._remove=function(F){if(F.prev!==J.Undefined&&F.next!==J.Undefined){var P=F.prev;P.next=F.next,F.next.prev=P}else F.prev===J.Undefined&&F.next===J.Undefined?(this._first=J.Undefined,this._last=J.Undefined):F.next===J.Undefined?(this._last=this._last.prev,this._last.next=J.Undefined):F.prev===J.Undefined&&(this._first=this._first.next,this._first.prev=J.Undefined);this._size-=1},X.prototype.iterator=function(){var F,P=this._first;return{next:function(){return P===J.Undefined?ue.c:(F?F.value=P.element:F={done:!1,value:P.element},P=P.next,F)}}},X.prototype.toArray=function(){for(var F=[],P=this._first;P!==J.Undefined;P=P.next)F.push(P.element);return F},X}()},"500L":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return v});var ue=q("+L6B"),J=q("2/Rp"),_=q("2qtc"),X=q("kLXV"),F=q("9og8"),P=q("k1fw"),W=q("miYZ"),U=q("tsqr"),O=q("oBTY"),L=q("tJVT"),d=q("DZo9"),f=q("8z0m"),T=q("WmNS"),p=q.n(T),m=q("q1tI"),g=q.n(m),a=q("m3rI"),i=q("wzkS"),s=q("y5JW"),l=q("LtfV"),C=f.a.Dragger;function v(y){var R=[];return y&&y.length>0&&(R=y.map(function(w){return{uid:w.id,id:w.id,name:w.title+s.c+w.filesize,url:w.url,filesize:w.filesize,status:"done",response:{id:w.id}}})),R}Te.b=function(y){var R=y.value,w=y.onChange,x=y.action,b=y.className,h=y.maxSize,u=h===void 0?150:h,A=y.title,S=A===void 0?"\u4E0A\u4F20\u9644\u4EF6":A,D=y.showRemoveModal,I=D===void 0?!1:D,B=y.accept,j=B===void 0?"":B,z=y.additionalText,M=y.isDragger,N=y.number,Y=N===void 0?1e3:N,ee=y.aloneClear,le=ee===void 0?!1:ee,fe=y.restrict,Oe=fe===void 0?!0:fe,Se=Object(m.useState)(!1),ke=Object(L.a)(Se,2),Le=ke[0],Ae=ke[1],ge=Object(m.useState)(R||[]),de=Object(L.a)(ge,2),re=de[0],he=de[1];Object(m.useEffect)(function(){R&&(he(Object(O.a)(R)),Y===(R==null?void 0:R.length)&&Ae(!0))},[R]);var se=function(){setTimeout(function(){re.pop(),he(Object(O.a)(re))},500)},De={multiple:!0,disabled:Le,accept:j,withCredentials:!0,fileList:re,beforeUpload:function(me,we){var Me=me.size/1024/1024;return re.concat(we).length>Y?(re.pop(),he(Object(O.a)(re)),U.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(Y,"\u4E2A\u6587\u4EF6")),le?Promise.reject():(se(),!1)):Me=Y?Ae(!0):Ae(!1),he(Object(O.a)(we)),we=we.map(function(Me){var Fe;if(Me!=null&&(Fe=Me.response)!==null&&Fe!==void 0&&Fe.id){var Ue;Me.url="/api/attachments/".concat(Me==null||((Ue=Me.response)===null||Ue===void 0)?void 0:Ue.id)}return Me.name.indexOf(s.c)===-1&&(Me.name="".concat(Me.name).concat(s.c).concat(Object(s.a)(Me.size))),Object(P.a)({},Me)}),console.log("info:",me),w(we)},onRemove:function(){var ae=Object(F.a)(p.a.mark(function we(Me){var Fe;return p.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(Fe=function(){var et=Object(F.a)(p.a.mark(function Je(){var Ze,Ye;return p.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(Ze=Me.response?Me.response.id:Me.id,!Ze){qe.next=8;break}return qe.next=4,Object(i.d)(Me.response?Me.response.id:Me.uid);case 4:return Ye=qe.sent,qe.abrupt("return",Ye);case 8:return qe.abrupt("return",!0);case 9:case"end":return qe.stop()}},Je)}));return function(){return et.apply(this,arguments)}}(),!I){Be.next=5;break}return Be.abrupt("return",new Promise(function(et,Je){X.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:g.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Ze=Object(F.a)(p.a.mark(function dt(){var qe;return p.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return Ie.next=2,Fe();case 2:qe=Ie.sent,U.b.success("\u5220\u9664\u6210\u529F"),et(!0);case 5:case"end":return Ie.stop()}},dt)}));function Ye(){return Ze.apply(this,arguments)}return Ye}(),onCancel:function(){return et(!1)}})}));case 5:return Be.next=7,Fe();case 7:return Be.abrupt("return",Be.sent);case 8:case"end":return Be.stop()}},we)}));function me(we){return ae.apply(this,arguments)}return me}()};function ie(ae){ae.preventDefault(),ae.stopPropagation()}return g.a.createElement("div",{className:"multi-upload ".concat(b||"")},M&&g.a.createElement(C,De,g.a.createElement("p",{className:"ant-upload-drag-icon"},g.a.createElement(l.a,null)),g.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",g.a.createElement("br",null),g.a.createElement("span",{style:{display:Oe?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",u,"MB) ")),z),!M&&g.a.createElement(f.a,De,g.a.createElement(J.a,{disabled:Le},S),g.a.createElement("span",{onClick:ie,style:{marginLeft:10,color:"#FA6400",display:Oe?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",u,"MB) ")))}},"55Ip":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return s}),q.d(Te,"b",function(){return w});var ue=q("Ty5D"),J=q("dI71"),_=q("q1tI"),X=q.n(_),F=q("YS25"),P=q("17x9"),W=q.n(P),U=q("wx14"),O=q("zLVn"),L=q("9R94"),d=function(b){Object(J.a)(h,b);function h(){for(var A,S=arguments.length,D=new Array(S),I=0;I1&&arguments[1]!==void 0?arguments[1]:0,m=(W[T[p+0]]+W[T[p+1]]+W[T[p+2]]+W[T[p+3]]+"-"+W[T[p+4]]+W[T[p+5]]+"-"+W[T[p+6]]+W[T[p+7]]+"-"+W[T[p+8]]+W[T[p+9]]+"-"+W[T[p+10]]+W[T[p+11]]+W[T[p+12]]+W[T[p+13]]+W[T[p+14]]+W[T[p+15]]).toLowerCase();if(!P(m))throw TypeError("Stringified UUID is invalid");return m}var L=O;function d(T,p,m){T=T||{};var g=T.random||(T.rng||_)();if(g[6]=g[6]&15|64,g[8]=g[8]&63|128,p){m=m||0;for(var a=0;a<16;++a)p[m+a]=g[a];return p}return L(g)}var f=Te.a=d},"7ahc":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return C});var ue=q("k1fw"),J=q("0Owb"),_=q("+L6B"),X=q("2/Rp"),F=q("y8nQ"),P=q("Vl3Y"),W=q("tJVT"),U=q("OaEy"),O=q("2fM7"),L=q("q1tI"),d=q.n(L),f=q("VrN/"),T=q.n(f),p=q("p77/"),m=q.n(p),g=q("c5Ni"),a=q.n(g),i=O.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},l={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Te.b=function(v){var y=v.callback,R=v.onCancel,w=Object(L.useState)("python"),x=Object(W.a)(w,2),b=x[0],h=x[1];function u(S){h(l[S][1])}function A(S){y(S)}return d.a.createElement(P.a,Object(J.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:A}),d.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},d.a.createElement(O.a,{onChange:u},Object.keys(l).map(function(S){return d.a.createElement(i,{key:S,value:S},l[S][0])}))),d.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},d.a.createElement(C,{mode:b})),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),d.a.createElement(X.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function C(v){var y=v.value,R=v.onChange,w=v.mode,x=v.options,b=x===void 0?{}:x,h=Object(L.useRef)(),u=Object(L.useState)(),A=Object(W.a)(u,2),S=A[0],D=A[1];return Object(L.useEffect)(function(){if(S){function I(B){var j=B.getValue();R&&R(j)}return S.on("change",I),function(){S.off("change",I)}}},[S,R]),Object(L.useEffect)(function(){S&&S.setOption("mode",w)},[S,w]),Object(L.useEffect)(function(){S&&((y!==S.getValue()||y==="")&&setTimeout(function(){S.setValue(y||" ")},300))},[S,y]),Object(L.useEffect)(function(){if(h.current&&!S){var I=T.a.fromTextArea(h.current,Object(ue.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));D(I)}},[h.current,S]),d.a.createElement("div",{className:"my-codemirror-container"},d.a.createElement("textarea",{ref:h}))}},"8EBN":function(pt,Te,q){(function(ue){ue(q("VrN/"))})(function(ue){"use strict";ue.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var J=0;J-1&&X.substring(W+1,X.length);if(U)return ue.findModeByExtension(U)},ue.findModeByName=function(X){X=X.toLowerCase();for(var F=0;F0&&T[T.length-1])&&(a[0]===6||a[0]===2)){L=0;continue}if(a[0]===3&&(!T||a[1]>T[0]&&a[1]")):null:u.match("--")?S(m("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),S(g(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),A.tokenize=m("meta","?>"),"meta"):(L=u.eat("/")?"closeTag":"openTag",A.tokenize=T,"tag bracket");if(D=="&"){var I;return u.eat("#")?u.eat("x")?I=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):I=u.eatWhile(/[\d]/)&&u.eat(";"):I=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),I?"atom":"error"}else return u.eatWhile(/[^&<]/),null}f.isInText=!0;function T(u,A){var S=u.next();if(S==">"||S=="/"&&u.eat(">"))return A.tokenize=f,L=S==">"?"endTag":"selfcloseTag","tag bracket";if(S=="=")return L="equals",null;if(S=="<"){A.tokenize=f,A.state=l,A.tagName=A.tagStart=null;var D=A.tokenize(u,A);return D?D+" tag error":"tag error"}else return/[\'\"]/.test(S)?(A.tokenize=p(S),A.stringStartCol=u.column(),A.tokenize(u,A)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(u){var A=function(S,D){for(;!S.eol();)if(S.next()==u){D.tokenize=T;break}return"string"};return A.isInAttribute=!0,A}function m(u,A){return function(S,D){for(;!S.eol();){if(S.match(A)){D.tokenize=f;break}S.next()}return u}}function g(u){return function(A,S){for(var D;(D=A.next())!=null;){if(D=="<")return S.tokenize=g(u+1),S.tokenize(A,S);if(D==">")if(u==1){S.tokenize=f;break}else return S.tokenize=g(u-1),S.tokenize(A,S)}return"meta"}}function a(u,A,S){this.prev=u.context,this.tagName=A,this.indent=u.indented,this.startOfLine=S,(W.doNotIndent.hasOwnProperty(A)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function i(u){u.context&&(u.context=u.context.prev)}function s(u,A){for(var S;;){if(!u.context)return;if(S=u.context.tagName,!W.contextGrabbers.hasOwnProperty(S)||!W.contextGrabbers[S].hasOwnProperty(A))return;i(u)}}function l(u,A,S){return u=="openTag"?(S.tagStart=A.column(),C):u=="closeTag"?v:l}function C(u,A,S){return u=="word"?(S.tagName=A.current(),h="tag",w):W.allowMissingTagName&&u=="endTag"?(h="tag bracket",w(u,A,S)):(h="error",C)}function v(u,A,S){if(u=="word"){var D=A.current();return S.context&&S.context.tagName!=D&&W.implicitlyClosed.hasOwnProperty(S.context.tagName)&&i(S),S.context&&S.context.tagName==D||W.matchClosing===!1?(h="tag",y):(h="tag error",R)}else return W.allowMissingTagName&&u=="endTag"?(h="tag bracket",y(u,A,S)):(h="error",R)}function y(u,A,S){return u!="endTag"?(h="error",y):(i(S),l)}function R(u,A,S){return h="error",y(u,A,S)}function w(u,A,S){if(u=="word")return h="attribute",x;if(u=="endTag"||u=="selfcloseTag"){var D=S.tagName,I=S.tagStart;return S.tagName=S.tagStart=null,u=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(D)?s(S,D):(s(S,D),S.context=new a(S,D,I==S.indented)),l}return h="error",w}function x(u,A,S){return u=="equals"?b:(W.allowMissing||(h="error"),w(u,A,S))}function b(u,A,S){return u=="string"?d:u=="word"&&W.allowUnquoted?(h="string",w):(h="error",w(u,A,S))}function d(u,A,S){return u=="string"?d:w(u,A,S)}return{startState:function(u){var A={tokenize:f,state:l,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(A.baseIndent=u),A},token:function(u,A){if(!A.tagName&&u.sol()&&(A.indented=u.indentation()),u.eatSpace())return null;L=null;var S=A.tokenize(u,A);return(S||L)&&S!="comment"&&(h=null,A.state=A.state(L||S,u,A),h&&(S=h=="error"?S+" error":h)),S},indent:function(u,A,S){var D=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+P;if(D&&D.noIndent)return ue.Pass;if(u.tokenize!=T&&u.tokenize!=f)return S?S.match(/^(\s*)/)[0].length:0;if(u.tagName)return W.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+P*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/$/,blockCommentStart:"",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(u){u.state==b&&(u.state=w)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var A=[],S=u.context;S;S=S.prev)S.tagName&&A.push(S.tagName);return A.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return _});var ue=q("JYp7"),J=function(){function X(F){this.element=F,this.next=X.Undefined,this.prev=X.Undefined}return X.Undefined=new X(void 0),X}(),_=function(){function X(){this._first=J.Undefined,this._last=J.Undefined,this._size=0}return Object.defineProperty(X.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),X.prototype.isEmpty=function(){return this._first===J.Undefined},X.prototype.clear=function(){this._first=J.Undefined,this._last=J.Undefined,this._size=0},X.prototype.unshift=function(F){return this._insert(F,!1)},X.prototype.push=function(F){return this._insert(F,!0)},X.prototype._insert=function(F,P){var W=this,U=new J(F);if(this._first===J.Undefined)this._first=U,this._last=U;else if(P){var O=this._last;this._last=U,U.prev=O,O.next=U}else{var L=this._first;this._first=U,U.next=L,L.prev=U}this._size+=1;var h=!1;return function(){h||(h=!0,W._remove(U))}},X.prototype.shift=function(){if(this._first===J.Undefined)return;var F=this._first.element;return this._remove(this._first),F},X.prototype.pop=function(){if(this._last===J.Undefined)return;var F=this._last.element;return this._remove(this._last),F},X.prototype._remove=function(F){if(F.prev!==J.Undefined&&F.next!==J.Undefined){var P=F.prev;P.next=F.next,F.next.prev=P}else F.prev===J.Undefined&&F.next===J.Undefined?(this._first=J.Undefined,this._last=J.Undefined):F.next===J.Undefined?(this._last=this._last.prev,this._last.next=J.Undefined):F.prev===J.Undefined&&(this._first=this._first.next,this._first.prev=J.Undefined);this._size-=1},X.prototype.iterator=function(){var F,P=this._first;return{next:function(){return P===J.Undefined?ue.c:(F?F.value=P.element:F={done:!1,value:P.element},P=P.next,F)}}},X.prototype.toArray=function(){for(var F=[],P=this._first;P!==J.Undefined;P=P.next)F.push(P.element);return F},X}()},"500L":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return v});var ue=q("+L6B"),J=q("2/Rp"),_=q("2qtc"),X=q("kLXV"),F=q("9og8"),P=q("k1fw"),W=q("miYZ"),U=q("tsqr"),O=q("oBTY"),L=q("tJVT"),h=q("DZo9"),f=q("8z0m"),T=q("WmNS"),p=q.n(T),m=q("q1tI"),g=q.n(m),a=q("m3rI"),i=q("wzkS"),s=q("y5JW"),l=q("LtfV"),C=f.a.Dragger;function v(y){var R=[];return y&&y.length>0&&(R=y.map(function(w){return{uid:w.id,id:w.id,name:w.title+s.c+w.filesize,url:w.url,filesize:w.filesize,status:"done",response:{id:w.id}}})),R}Te.b=function(y){var R=y.value,w=y.onChange,x=y.action,b=y.className,d=y.maxSize,u=d===void 0?150:d,A=y.title,S=A===void 0?"\u4E0A\u4F20\u9644\u4EF6":A,D=y.showRemoveModal,I=D===void 0?!1:D,B=y.accept,j=B===void 0?"":B,z=y.additionalText,M=y.isDragger,N=y.number,Y=N===void 0?1e3:N,ee=y.aloneClear,le=ee===void 0?!1:ee,fe=y.restrict,Oe=fe===void 0?!0:fe,Se=Object(m.useState)(!1),ke=Object(L.a)(Se,2),Le=ke[0],Ae=ke[1],ge=Object(m.useState)(R||[]),he=Object(L.a)(ge,2),re=he[0],de=he[1];Object(m.useEffect)(function(){R&&(de(Object(O.a)(R)),Y===(R==null?void 0:R.length)&&Ae(!0))},[R]);var se=function(){setTimeout(function(){re.pop(),de(Object(O.a)(re))},500)},De={multiple:!0,disabled:Le,accept:j,withCredentials:!0,fileList:re,beforeUpload:function(me,we){var Me=me.size/1024/1024;return re.concat(we).length>Y?(re.pop(),de(Object(O.a)(re)),U.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(Y,"\u4E2A\u6587\u4EF6")),le?Promise.reject():(se(),!1)):Me=Y?Ae(!0):Ae(!1),de(Object(O.a)(we)),we=we.map(function(Me){var Fe;if(Me!=null&&(Fe=Me.response)!==null&&Fe!==void 0&&Fe.id){var Ue;Me.url="/api/attachments/".concat(Me==null||((Ue=Me.response)===null||Ue===void 0)?void 0:Ue.id)}return Me.name.indexOf(s.c)===-1&&(Me.name="".concat(Me.name).concat(s.c).concat(Object(s.a)(Me.size))),Object(P.a)({},Me)}),console.log("info:",me),w(we)},onRemove:function(){var ae=Object(F.a)(p.a.mark(function we(Me){var Fe;return p.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if(Fe=function(){var et=Object(F.a)(p.a.mark(function Je(){var Ze,Ye;return p.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(Ze=Me.response?Me.response.id:Me.id,!Ze){qe.next=8;break}return qe.next=4,Object(i.d)(Me.response?Me.response.id:Me.uid);case 4:return Ye=qe.sent,qe.abrupt("return",Ye);case 8:return qe.abrupt("return",!0);case 9:case"end":return qe.stop()}},Je)}));return function(){return et.apply(this,arguments)}}(),!I){Be.next=5;break}return Be.abrupt("return",new Promise(function(et,Je){X.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:g.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Ze=Object(F.a)(p.a.mark(function ht(){var qe;return p.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return Ie.next=2,Fe();case 2:qe=Ie.sent,U.b.success("\u5220\u9664\u6210\u529F"),et(!0);case 5:case"end":return Ie.stop()}},ht)}));function Ye(){return Ze.apply(this,arguments)}return Ye}(),onCancel:function(){return et(!1)}})}));case 5:return Be.next=7,Fe();case 7:return Be.abrupt("return",Be.sent);case 8:case"end":return Be.stop()}},we)}));function me(we){return ae.apply(this,arguments)}return me}()};function ie(ae){ae.preventDefault(),ae.stopPropagation()}return g.a.createElement("div",{className:"multi-upload ".concat(b||"")},M&&g.a.createElement(C,De,g.a.createElement("p",{className:"ant-upload-drag-icon"},g.a.createElement(l.a,null)),g.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",g.a.createElement("br",null),g.a.createElement("span",{style:{display:Oe?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",u,"MB) ")),z),!M&&g.a.createElement(f.a,De,g.a.createElement(J.a,{disabled:Le},S),g.a.createElement("span",{onClick:ie,style:{marginLeft:10,color:"#FA6400",display:Oe?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",u,"MB) ")))}},"55Ip":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return s}),q.d(Te,"b",function(){return w});var ue=q("Ty5D"),J=q("dI71"),_=q("q1tI"),X=q.n(_),F=q("YS25"),P=q("17x9"),W=q.n(P),U=q("wx14"),O=q("zLVn"),L=q("9R94"),h=function(b){Object(J.a)(d,b);function d(){for(var A,S=arguments.length,D=new Array(S),I=0;I1&&arguments[1]!==void 0?arguments[1]:0,m=(W[T[p+0]]+W[T[p+1]]+W[T[p+2]]+W[T[p+3]]+"-"+W[T[p+4]]+W[T[p+5]]+"-"+W[T[p+6]]+W[T[p+7]]+"-"+W[T[p+8]]+W[T[p+9]]+"-"+W[T[p+10]]+W[T[p+11]]+W[T[p+12]]+W[T[p+13]]+W[T[p+14]]+W[T[p+15]]).toLowerCase();if(!P(m))throw TypeError("Stringified UUID is invalid");return m}var L=O;function h(T,p,m){T=T||{};var g=T.random||(T.rng||_)();if(g[6]=g[6]&15|64,g[8]=g[8]&63|128,p){m=m||0;for(var a=0;a<16;++a)p[m+a]=g[a];return p}return L(g)}var f=Te.a=h},"7ahc":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return C});var ue=q("k1fw"),J=q("0Owb"),_=q("+L6B"),X=q("2/Rp"),F=q("y8nQ"),P=q("Vl3Y"),W=q("tJVT"),U=q("OaEy"),O=q("2fM7"),L=q("q1tI"),h=q.n(L),f=q("VrN/"),T=q.n(f),p=q("p77/"),m=q.n(p),g=q("c5Ni"),a=q.n(g),i=O.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},l={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Te.b=function(v){var y=v.callback,R=v.onCancel,w=Object(L.useState)("python"),x=Object(W.a)(w,2),b=x[0],d=x[1];function u(S){d(l[S][1])}function A(S){y(S)}return h.a.createElement(P.a,Object(J.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:A}),h.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},h.a.createElement(O.a,{onChange:u},Object.keys(l).map(function(S){return h.a.createElement(i,{key:S,value:S},l[S][0])}))),h.a.createElement(P.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},h.a.createElement(C,{mode:b})),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),h.a.createElement(X.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function C(v){var y=v.value,R=v.onChange,w=v.mode,x=v.options,b=x===void 0?{}:x,d=Object(L.useRef)(),u=Object(L.useState)(),A=Object(W.a)(u,2),S=A[0],D=A[1];return Object(L.useEffect)(function(){if(S){function I(B){var j=B.getValue();R&&R(j)}return S.on("change",I),function(){S.off("change",I)}}},[S,R]),Object(L.useEffect)(function(){S&&S.setOption("mode",w)},[S,w]),Object(L.useEffect)(function(){S&&((y!==S.getValue()||y==="")&&setTimeout(function(){S.setValue(y||" ")},300))},[S,y]),Object(L.useEffect)(function(){if(d.current&&!S){var I=T.a.fromTextArea(d.current,Object(ue.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));D(I)}},[d.current,S]),h.a.createElement("div",{className:"my-codemirror-container"},h.a.createElement("textarea",{ref:d}))}},"8EBN":function(pt,Te,q){(function(ue){ue(q("VrN/"))})(function(ue){"use strict";ue.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var J=0;J-1&&X.substring(W+1,X.length);if(U)return ue.findModeByExtension(U)},ue.findModeByName=function(X){X=X.toLowerCase();for(var F=0;F0&&T[T.length-1])&&(a[0]===6||a[0]===2)){L=0;continue}if(a[0]===3&&(!T||a[1]>T[0]&&a[1]=G.length?$.slice(G.length):$}).join(` -`)}var a=[],i=["
    "],s=new p.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){a.length=0,i=["
      "]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function y(K,c,E,G){if(c>=K.length||K[c].level<=E)return c;var $=K[c];G.push("
    • "+$.text+""),c++;var V=[];return c=y(K,c,$.level,V),V.length>0&&(G.push("
        "),V.forEach(function(xe){G.push(xe)}),G.push("
      ")),G.push("
    • "),c=y(K,c,E,G),c}function R(){return y(a,0,0,i),i.push("
    "),i.join("")}var w={heading:function(c){var E=l.exec(c);if(E)return{type:"heading",raw:E[0],depth:E[1].length,text:E[2]}},fences:function(c){var E=this.rules.block.fences.exec(c);if(E){var G=E[0],$=g(G,E[3]||""),V=E[2]?E[2].trim():E[2];if(["latex","katex","math"].indexOf(V)>=0){var xe=h(),Ge=$;$=xe,u[xe]={type:"block",expression:Ge}}return{type:"code",raw:G,lang:V,text:$}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,h=function(){return"__special_katext_id_".concat(b++,"__")},u={};function A(){return u}function S(){b=0,u={}}function D(K){return K=K.replace(x,function(c,E){var G=h();return u[G]={type:"inline",expression:E},G}),K}var I=s.listitem;s.listitem=function(K){return I(D(K))};var B=s.paragraph;s.paragraph=function(K){return B(D(K))};var j=s.tablecell;s.tablecell=function(K,c){return j(D(K),c)},s.code=function(K,c,E){var G=(c||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"

    ".concat(K,"

    "):'
    ').concat(E?K:Object(m.escape)(K,!0),`
    +`)}var a=[],i=["
      "],s=new p.a.Renderer,l=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){a.length=0,i=["
        "]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function y(K,c,E,G){if(c>=K.length||K[c].level<=E)return c;var $=K[c];G.push("
      • "+$.text+""),c++;var V=[];return c=y(K,c,$.level,V),V.length>0&&(G.push("
          "),V.forEach(function(xe){G.push(xe)}),G.push("
        ")),G.push("
      • "),c=y(K,c,E,G),c}function R(){return y(a,0,0,i),i.push("
      "),i.join("")}var w={heading:function(c){var E=l.exec(c);if(E)return{type:"heading",raw:E[0],depth:E[1].length,text:E[2]}},fences:function(c){var E=this.rules.block.fences.exec(c);if(E){var G=E[0],$=g(G,E[3]||""),V=E[2]?E[2].trim():E[2];if(["latex","katex","math"].indexOf(V)>=0){var xe=d(),Ge=$;$=xe,u[xe]={type:"block",expression:Ge}}return{type:"code",raw:G,lang:V,text:$}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,d=function(){return"__special_katext_id_".concat(b++,"__")},u={};function A(){return u}function S(){b=0,u={}}function D(K){return K=K.replace(x,function(c,E){var G=d();return u[G]={type:"inline",expression:E},G}),K}var I=s.listitem;s.listitem=function(K){return I(D(K))};var B=s.paragraph;s.paragraph=function(K){return B(D(K))};var j=s.tablecell;s.tablecell=function(K,c){return j(D(K),c)},s.code=function(K,c,E){var G=(c||"").match(/\S*/)[0];return G?["latex","katex","math"].indexOf(G)>=0?"

      ".concat(K,"

      "):'
      ').concat(E?K:Object(m.escape)(K,!0),`
      `):'
      '+(E?K:Object(m.escape)(K,!0))+"
      "},s.heading=function(K,c,E){var G=this.options.headerPrefix+E.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return a.push({anchor:G,level:c,text:K}),"'+K+""},p.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),p.a.use({tokenizer:w,renderer:s});var z=p.a,M=q("SJMd"),N=q("ulZh"),Y=q.n(N),ee=q("m3rI"),le=q("Oy/b"),fe=q("p5ED"),Oe=q("ErOA");/*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -16,7 +16,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Se=function(K,c){return(Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,G){E.__proto__=G}||function(E,G){for(var $ in G)Object.prototype.hasOwnProperty.call(G,$)&&(E[$]=G[$])})(K,c)};function ke(K,c){function E(){this.constructor=K}Se(K,c),K.prototype=c===null?Object.create(c):(E.prototype=c.prototype,new E)}function Le(K,c,E,G){return new(E||(E=Promise))(function($,V){function xe(mt){try{tt(G.next(mt))}catch(Ke){V(Ke)}}function Ge(mt){try{tt(G.throw(mt))}catch(Ke){V(Ke)}}function tt(mt){var Ke;mt.done?$(mt.value):(Ke=mt.value,Ke instanceof E?Ke:new E(function(At){At(Ke)})).then(xe,Ge)}tt((G=G.apply(K,c||[])).next())})}function Ae(K,c){var E,G,$,V,xe={label:0,sent:function(){if(1&$[0])throw $[1];return $[1]},trys:[],ops:[]};return V={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function Ge(tt){return function(mt){return function(Ke){if(E)throw new TypeError("Generator is already executing.");for(;xe;)try{if(E=1,G&&($=2&Ke[0]?G.return:Ke[0]?G.throw||(($=G.return)&&$.call(G),0):G.next)&&!($=$.call(G,Ke[1])).done)return $;switch(G=0,$&&(Ke=[2&Ke[0],$.value]),Ke[0]){case 0:case 1:$=Ke;break;case 4:return xe.label++,{value:Ke[1],done:!1};case 5:xe.label++,G=Ke[1],Ke=[0];continue;case 7:Ke=xe.ops.pop(),xe.trys.pop();continue;default:if(!($=xe.trys,($=$.length>0&&$[$.length-1])||Ke[0]!==6&&Ke[0]!==2)){xe=0;continue}if(Ke[0]===3&&(!$||Ke[1]>$[0]&&Ke[1]<$[3])){xe.label=Ke[1];break}if(Ke[0]===6&&xe.label<$[1]){xe.label=$[1],$=Ke;break}if($&&xe.label<$[2]){xe.label=$[2],xe.ops.push(Ke);break}$[2]&&xe.ops.pop(),xe.trys.pop();continue}Ke=c.call(K,xe)}catch(At){Ke=[6,At],G=0}finally{E=$=0}if(5&Ke[0])throw Ke[1];return{value:Ke[0]?Ke[1]:void 0,done:!0}}([tt,mt])}}}function ge(){for(var K=0,c=0,E=arguments.length;c0&&$[$.length-1])||Ke[0]!==6&&Ke[0]!==2)){xe=0;continue}if(Ke[0]===3&&(!$||Ke[1]>$[0]&&Ke[1]<$[3])){xe.label=Ke[1];break}if(Ke[0]===6&&xe.label<$[1]){xe.label=$[1],$=Ke;break}if($&&xe.label<$[2]){xe.label=$[2],xe.ops.push(Ke);break}$[2]&&xe.ops.pop(),xe.trys.pop();continue}Ke=c.call(K,xe)}catch(At){Ke=[6,At],G=0}finally{E=$=0}if(5&Ke[0])throw Ke[1];return{value:Ke[0]?Ke[1]:void 0,done:!0}}([tt,mt])}}}function ge(){for(var K=0,c=0,E=arguments.length;c')||this;return xe.colors=[],xe.addTransparent=!1,xe.colorBoxes=[],xe.colors=G,xe.currentColor=$,xe.setCurrentColor=xe.setCurrentColor.bind(xe),xe.getColorBox=xe.getColorBox.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.whiteSpace="nowrap",this.colors.forEach(function($){var V=E.getColorBox($);G.appendChild(V),E.colorBoxes.push(V)}),G},c.prototype.getColorBox=function(E){var G=this,$=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-$,xe=document.createElement("div");xe.style.display="inline-block",xe.style.boxSizing="content-box",xe.style.width=V-2+"px",xe.style.height=V-2+"px",xe.style.padding="1px",xe.style.marginRight="2px",xe.style.marginBottom="2px",xe.style.borderWidth="2px",xe.style.borderStyle="solid",xe.style.borderRadius=(V+2)/2+"px",xe.style.borderColor=E===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",xe.addEventListener("click",function(){G.setCurrentColor(E,xe)});var Ge=document.createElement("div");return Ge.style.display="inline-block",Ge.style.width=V-2+"px",Ge.style.height=V-2+"px",Ge.style.backgroundColor=E,Ge.style.borderRadius=V/2+"px",E==="transparent"&&(Ge.style.fill=this.uiStyleSettings.toolboxAccentColor,Ge.innerHTML=` - `),xe.appendChild(Ge),xe},c.prototype.setCurrentColor=function(E,G){var $=this;this.currentColor=E,this.colorBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(E)},c}(Me),Ue=function(){function K(c,E,G){this._state="new",this._isSelected=!1,this._container=c,this._overlayContainer=E,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(K.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(c){return!1},Object.defineProperty(K.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),K.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},K.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},K.prototype.pointerDown=function(c,E){},K.prototype.dblClick=function(c,E){},K.prototype.manipulate=function(c){},K.prototype.pointerUp=function(c){this.stateChanged()},K.prototype.dispose=function(){},K.prototype.addMarkerVisualToContainer=function(c){this.container.childNodes.length>0?this.container.insertBefore(c,this.container.childNodes[0]):this.container.appendChild(c)},K.prototype.getState=function(){return{typeName:K.typeName,state:this.state,notes:this.notes}},K.prototype.restoreState=function(c){this._state=c.state,this.notes=c.notes},K.prototype.scale=function(c,E){},K.prototype.colorChanged=function(c){this.onColorChanged&&this.onColorChanged(c),this.stateChanged()},K.prototype.fillColorChanged=function(c){this.onFillColorChanged&&this.onFillColorChanged(c),this.stateChanged()},K.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var c=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),c.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(c)&&this.onStateChanged(this)}},K.typeName="MarkerBase",K}(),Be=function(){function K(){this.findGripByVisual=this.findGripByVisual.bind(this)}return K.prototype.findGripByVisual=function(c){return this.topLeft.ownsTarget(c)?this.topLeft:this.topCenter.ownsTarget(c)?this.topCenter:this.topRight.ownsTarget(c)?this.topRight:this.centerLeft.ownsTarget(c)?this.centerLeft:this.centerRight.ownsTarget(c)?this.centerRight:this.bottomLeft.ownsTarget(c)?this.bottomLeft:this.bottomCenter.ownsTarget(c)?this.bottomCenter:this.bottomRight.ownsTarget(c)?this.bottomRight:void 0},K}(),et=function(){function K(){this.GRIP_SIZE=10,this.visual=de.createGroup(),this.visual.appendChild(de.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(de.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return K.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},K}(),Je=function(){function K(){}return K.toITransformMatrix=function(c){return{a:c.a,b:c.b,c:c.c,d:c.d,e:c.e,f:c.f}},K.toSVGMatrix=function(c,E){return c.a=E.a,c.b=E.b,c.c=E.c,c.d=E.d,c.e=E.e,c.f=E.f,c},K}(),Ze=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(de.createTransform()),V.setupControlBox(),V}return ke(c,K),Object.defineProperty(c.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"visual",{get:function(){return this._visual},set:function(E){this._visual=E;var G=de.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(E){return!!K.prototype.ownsTarget.call(this,E)||!!(this.controlGrips.findGripByVisual(E)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(E))},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(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 $=this.unrotatePoint(E);if(this.manipulationStartX=$.x,this.manipulationStartY=$.y,this.offsetX=$.x-this.left,this.offsetY=$.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var xe=this.container.transform.baseVal.getItem(0);xe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(xe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},c.prototype.pointerUp=function(E){var G=this.state;K.prototype.pointerUp.call(this,E),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(E),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},c.prototype.moveVisual=function(E){this.visual.style.transform="translate("+E.x+"px, "+E.y+"px)"},c.prototype.manipulate=function(E){var G=this.unrotatePoint(E);this.state==="creating"?this.resize(E):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(E)},c.prototype.resize=function(E){var G=this.manipulationStartLeft,$=this.manipulationStartWidth,V=this.manipulationStartTop,xe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+E.x-this.manipulationStartX,$=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:$=this.manipulationStartWidth+E.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+E.y-this.manipulationStartY,xe=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:xe=this.manipulationStartHeight+E.y-this.manipulationStartY}$>=0?(this.left=G,this.width=$):(this.left=G+$,this.width=-$),xe>=0?(this.top=V,this.height=xe):(this.top=V+xe,this.height=-xe),this.setSize()},c.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},c.prototype.rotate=function(E){if(Math.abs(E.x-this.centerX)>.1){var G=Math.sign(E.x-this.centerX);this.rotationAngle=180*Math.atan((E.y-this.centerY)/(E.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},c.prototype.applyRotation=function(){var E=this.container.transform.baseVal.getItem(0);E.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(E,0)},c.prototype.rotatePoint=function(E){if(this.rotationAngle===0)return E;var G=this.container.getCTM(),$=de.createPoint(E.x,E.y);return{x:($=$.matrixTransform(G)).x,y:$.y}},c.prototype.unrotatePoint=function(E){if(this.rotationAngle===0)return E;var G=this.container.getCTM();G=G.inverse();var $=de.createPoint(E.x,E.y);return{x:($=$.matrixTransform(G)).x,y:$.y}},c.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=de.createGroup();var E=de.createTransform();E.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(E),this.container.appendChild(this.controlBox),this.controlRect=de.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=de.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 Be,this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){var E=this.controlBox.transform.baseVal.getItem(0);E.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(E,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},c.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},c.prototype.createGrip=function(){var E=new et;return E.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.controlGrips.topLeft.GRIP_SIZE,G=-E/2,$=G,V=(this.width+this.CB_DISTANCE)/2-E/2,xe=(this.height+this.CB_DISTANCE)/2-E/2,Ge=this.height+this.CB_DISTANCE-E/2,tt=this.width+this.CB_DISTANCE-E/2;this.positionGrip(this.controlGrips.topLeft.visual,G,$),this.positionGrip(this.controlGrips.topCenter.visual,V,$),this.positionGrip(this.controlGrips.topRight.visual,tt,$),this.positionGrip(this.controlGrips.centerLeft.visual,G,xe),this.positionGrip(this.controlGrips.centerRight.visual,tt,xe),this.positionGrip(this.controlGrips.bottomLeft.visual,G,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,tt,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,$-3*this.CB_DISTANCE)},c.prototype.positionGrip=function(E,G,$){var V=E.transform.baseVal.getItem(0);V.setTranslate(G,$),E.transform.baseVal.replaceItem(V,0)},c.prototype.hideControlBox=function(){this.controlBox.style.display="none"},c.prototype.showControlBox=function(){this.controlBox.style.display=""},c.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},K.prototype.getState.call(this))},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G);var $=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:$.x*E,y:$.y*G});this.left=V.x,this.top=V.y,this.width=this.width*E,this.height=this.height*G,this.adjustControlBox()},c}(Ue),Ye=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual)},c.prototype.createVisual=function(){this.visual=de.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.manipulate=function(E){K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),this.setSize()},c.prototype.setSize=function(){K.prototype.setSize.call(this),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){K.prototype.pointerUp.call(this,E),this.setSize()},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(E),this.stateChanged()},c.prototype.setFillColor=function(E){this.fillColor=E,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},K.prototype.getState.call(this))},c.prototype.restoreState=function(E){var G=E;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),K.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setSize()},c.title="Rectangle marker",c}(Ze),dt=function(K){function c(E,G,$,V){var xe=K.call(this,E,V||'')||this;return xe.widths=[],xe.widthBoxes=[],xe.widths=G,xe.currentWidth=$,xe.setCurrentWidth=xe.setCurrentWidth.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function($){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=$===E.currentWidth?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentWidth($,V)}),G.appendChild(V);var xe=document.createElement("div");xe.innerText=$.toString(),xe.style.marginRight="5px",V.appendChild(xe);var Ge=document.createElement("div");Ge.style.minHeight="20px",Ge.style.flexGrow="2",Ge.style.display="flex",Ge.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=$+"px solid "+E.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",Ge.appendChild(tt),V.appendChild(Ge),E.widthBoxes.push(V)}),G},c.prototype.setCurrentWidth=function(E,G){var $=this;this.currentWidth=E,this.widthBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},c}(Me),qe=function(K){function c(E,G,$,V){var xe=K.call(this,E,V||'')||this;return xe.styles=[],xe.styleBoxes=[],xe.styles=G,xe.currentStyle=$,xe.setCurrentStyle=xe.setCurrentStyle.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function($){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/E.styles.length-5+"%",V.style.borderColor=$===E.currentStyle?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentStyle($,V)}),G.appendChild(V);var xe=document.createElement("div");xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.overflow="hidden";var Ge=` + `),xe.appendChild(Ge),xe},c.prototype.setCurrentColor=function(E,G){var $=this;this.currentColor=E,this.colorBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(E)},c}(Me),Ue=function(){function K(c,E,G){this._state="new",this._isSelected=!1,this._container=c,this._overlayContainer=E,this.globalSettings=G,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(K.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(c){return!1},Object.defineProperty(K.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),K.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},K.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},K.prototype.pointerDown=function(c,E){},K.prototype.dblClick=function(c,E){},K.prototype.manipulate=function(c){},K.prototype.pointerUp=function(c){this.stateChanged()},K.prototype.dispose=function(){},K.prototype.addMarkerVisualToContainer=function(c){this.container.childNodes.length>0?this.container.insertBefore(c,this.container.childNodes[0]):this.container.appendChild(c)},K.prototype.getState=function(){return{typeName:K.typeName,state:this.state,notes:this.notes}},K.prototype.restoreState=function(c){this._state=c.state,this.notes=c.notes},K.prototype.scale=function(c,E){},K.prototype.colorChanged=function(c){this.onColorChanged&&this.onColorChanged(c),this.stateChanged()},K.prototype.fillColorChanged=function(c){this.onFillColorChanged&&this.onFillColorChanged(c),this.stateChanged()},K.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var c=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),c.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(c)&&this.onStateChanged(this)}},K.typeName="MarkerBase",K}(),Be=function(){function K(){this.findGripByVisual=this.findGripByVisual.bind(this)}return K.prototype.findGripByVisual=function(c){return this.topLeft.ownsTarget(c)?this.topLeft:this.topCenter.ownsTarget(c)?this.topCenter:this.topRight.ownsTarget(c)?this.topRight:this.centerLeft.ownsTarget(c)?this.centerLeft:this.centerRight.ownsTarget(c)?this.centerRight:this.bottomLeft.ownsTarget(c)?this.bottomLeft:this.bottomCenter.ownsTarget(c)?this.bottomCenter:this.bottomRight.ownsTarget(c)?this.bottomRight:void 0},K}(),et=function(){function K(){this.GRIP_SIZE=10,this.visual=he.createGroup(),this.visual.appendChild(he.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(he.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return K.prototype.ownsTarget=function(c){return c===this.visual||c===this.visual.childNodes[0]||c===this.visual.childNodes[1]},K}(),Je=function(){function K(){}return K.toITransformMatrix=function(c){return{a:c.a,b:c.b,c:c.c,d:c.d,e:c.e,f:c.f}},K.toSVGMatrix=function(c,E){return c.a=E.a,c.b=E.b,c.c=E.c,c.d=E.d,c.e=E.e,c.f=E.f,c},K}(),Ze=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(he.createTransform()),V.setupControlBox(),V}return ke(c,K),Object.defineProperty(c.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"visual",{get:function(){return this._visual},set:function(E){this._visual=E;var G=he.createTransform();this._visual.transform.baseVal.appendItem(G)},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(E){return!!K.prototype.ownsTarget.call(this,E)||!!(this.controlGrips.findGripByVisual(E)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(E))},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(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 $=this.unrotatePoint(E);if(this.manipulationStartX=$.x,this.manipulationStartY=$.y,this.offsetX=$.x-this.left,this.offsetY=$.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(G),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(G)){this.activeGrip=this.rotatorGrip;var V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var xe=this.container.transform.baseVal.getItem(0);xe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(xe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},c.prototype.pointerUp=function(E){var G=this.state;K.prototype.pointerUp.call(this,E),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(E),this._state="select",G==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},c.prototype.moveVisual=function(E){this.visual.style.transform="translate("+E.x+"px, "+E.y+"px)"},c.prototype.manipulate=function(E){var G=this.unrotatePoint(E);this.state==="creating"?this.resize(E):this.state==="move"?(this.left=this.manipulationStartLeft+(G.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(G.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(G):this.state==="rotate"&&this.rotate(E)},c.prototype.resize=function(E){var G=this.manipulationStartLeft,$=this.manipulationStartWidth,V=this.manipulationStartTop,xe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:G=this.manipulationStartLeft+E.x-this.manipulationStartX,$=this.manipulationStartWidth+this.manipulationStartLeft-G;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:$=this.manipulationStartWidth+E.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+E.y-this.manipulationStartY,xe=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:xe=this.manipulationStartHeight+E.y-this.manipulationStartY}$>=0?(this.left=G,this.width=$):(this.left=G+$,this.width=-$),xe>=0?(this.top=V,this.height=xe):(this.top=V+xe,this.height=-xe),this.setSize()},c.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},c.prototype.rotate=function(E){if(Math.abs(E.x-this.centerX)>.1){var G=Math.sign(E.x-this.centerX);this.rotationAngle=180*Math.atan((E.y-this.centerY)/(E.x-this.centerX))/Math.PI+90*G,this.applyRotation()}},c.prototype.applyRotation=function(){var E=this.container.transform.baseVal.getItem(0);E.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(E,0)},c.prototype.rotatePoint=function(E){if(this.rotationAngle===0)return E;var G=this.container.getCTM(),$=he.createPoint(E.x,E.y);return{x:($=$.matrixTransform(G)).x,y:$.y}},c.prototype.unrotatePoint=function(E){if(this.rotationAngle===0)return E;var G=this.container.getCTM();G=G.inverse();var $=he.createPoint(E.x,E.y);return{x:($=$.matrixTransform(G)).x,y:$.y}},c.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=he.createGroup();var E=he.createTransform();E.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(E),this.container.appendChild(this.controlBox),this.controlRect=he.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=he.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 Be,this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){var E=this.controlBox.transform.baseVal.getItem(0);E.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(E,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},c.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},c.prototype.createGrip=function(){var E=new et;return E.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.controlGrips.topLeft.GRIP_SIZE,G=-E/2,$=G,V=(this.width+this.CB_DISTANCE)/2-E/2,xe=(this.height+this.CB_DISTANCE)/2-E/2,Ge=this.height+this.CB_DISTANCE-E/2,tt=this.width+this.CB_DISTANCE-E/2;this.positionGrip(this.controlGrips.topLeft.visual,G,$),this.positionGrip(this.controlGrips.topCenter.visual,V,$),this.positionGrip(this.controlGrips.topRight.visual,tt,$),this.positionGrip(this.controlGrips.centerLeft.visual,G,xe),this.positionGrip(this.controlGrips.centerRight.visual,tt,xe),this.positionGrip(this.controlGrips.bottomLeft.visual,G,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,V,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,tt,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,$-3*this.CB_DISTANCE)},c.prototype.positionGrip=function(E,G,$){var V=E.transform.baseVal.getItem(0);V.setTranslate(G,$),E.transform.baseVal.replaceItem(V,0)},c.prototype.hideControlBox=function(){this.controlBox.style.display="none"},c.prototype.showControlBox=function(){this.controlBox.style.display=""},c.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},K.prototype.getState.call(this))},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.left=G.left,this.top=G.top,this.width=G.width,this.height=G.height,this.rotationAngle=G.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,G.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,G.containerTransformMatrix))},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G);var $=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:$.x*E,y:$.y*G});this.left=V.x,this.top=V.y,this.width=this.width*E,this.height=this.height*G,this.adjustControlBox()},c}(Ue),Ye=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual)},c.prototype.createVisual=function(){this.visual=he.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.manipulate=function(E){K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),this.setSize()},c.prototype.setSize=function(){K.prototype.setSize.call(this),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){K.prototype.pointerUp.call(this,E),this.setSize()},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.visual&&he.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(E),this.stateChanged()},c.prototype.setFillColor=function(E){this.fillColor=E,this.visual&&he.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.visual&&he.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.visual&&he.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},c.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},K.prototype.getState.call(this))},c.prototype.restoreState=function(E){var G=E;this.fillColor=G.fillColor,this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.opacity=G.opacity,this.createVisual(),K.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setSize()},c.title="Rectangle marker",c}(Ze),ht=function(K){function c(E,G,$,V){var xe=K.call(this,E,V||'')||this;return xe.widths=[],xe.widthBoxes=[],xe.widths=G,xe.currentWidth=$,xe.setCurrentWidth=xe.setCurrentWidth.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.widths.forEach(function($){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=$===E.currentWidth?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentWidth($,V)}),G.appendChild(V);var xe=document.createElement("div");xe.innerText=$.toString(),xe.style.marginRight="5px",V.appendChild(xe);var Ge=document.createElement("div");Ge.style.minHeight="20px",Ge.style.flexGrow="2",Ge.style.display="flex",Ge.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=$+"px solid "+E.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",Ge.appendChild(tt),V.appendChild(Ge),E.widthBoxes.push(V)}),G},c.prototype.setCurrentWidth=function(E,G){var $=this;this.currentWidth=E,this.widthBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},c}(Me),qe=function(K){function c(E,G,$,V){var xe=K.call(this,E,V||'')||this;return xe.styles=[],xe.styleBoxes=[],xe.styles=G,xe.currentStyle=$,xe.setCurrentStyle=xe.setCurrentStyle.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",this.styles.forEach(function($){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/E.styles.length-5+"%",V.style.borderColor=$===E.currentStyle?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentStyle($,V)}),G.appendChild(V);var xe=document.createElement("div");xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.overflow="hidden";var Ge=` - `;xe.innerHTML=Ge,V.appendChild(xe),E.styleBoxes.push(V)}),G},c.prototype.setCurrentStyle=function(E,G){var $=this;this.currentStyle=E,this.styleBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},c}(Me),ot=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.strokeColor=$.defaultColor,V.strokeWidth=$.defaultStrokeWidth,V.strokeDasharray=$.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",$.defaultColorSet,$.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new dt("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return ke(c,K),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="FrameMarker",c.title="Frame marker",c.icon='',c}(Ye),Ie=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},Qe=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return ke(c,K),c.prototype.ownsTarget=function(E){return!!K.prototype.ownsTarget.call(this,E)||!(!this.grip1.ownsTarget(E)&&!this.grip2.ownsTarget(E))},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.manipulationStartX=E.x,this.manipulationStartY=E.y,this.state==="new"&&(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,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},c.prototype.pointerUp=function(E){var G=this.state;K.prototype.pointerUp.call(this,E),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(E),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},c.prototype.adjustVisual=function(){},c.prototype.manipulate=function(E){this.state==="creating"?this.resize(E):this.state==="move"?(this.x1=this.manipulationStartX1+E.x-this.manipulationStartX,this.y1=this.manipulationStartY1+E.y-this.manipulationStartY,this.x2=this.manipulationStartX2+E.x-this.manipulationStartX,this.y2=this.manipulationStartY2+E.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(E)},c.prototype.resize=function(E){switch(this.activeGrip){case this.grip1:this.x1=E.x,this.y1=E.y;break;case this.grip2:case void 0:this.x2=E.x,this.y2=E.y}this.adjustVisual(),this.adjustControlBox()},c.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=de.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){this.positionGrips()},c.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},c.prototype.createGrip=function(){var E=new et;return E.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-E/2,this.y1-E/2),this.positionGrip(this.grip2.visual,this.x2-E/2,this.y2-E/2)},c.prototype.positionGrip=function(E,G,$){var V=E.transform.baseVal.getItem(0);V.setTranslate(G,$),E.transform.baseVal.replaceItem(V,0)},c.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},K.prototype.getState.call(this))},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.x1=this.x1*E,this.y1=this.y1*G,this.x2=this.x2*E,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},c}(Ue),st=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=$.defaultColor,V.strokeWidth=$.defaultStrokeWidth,V.strokeDasharray=$.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",$.defaultColorSet,$.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new dt("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorLine&&E!==this.visibleLine)},c.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=de.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},c.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()),de.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},c.typeName="LineMarker",c.title="Line marker",c.icon='',c}(Qe),je=function(K){function c(E,G,$,V){var xe=K.call(this,E,V||'')||this;return xe.fonts=[],xe.fontBoxes=[],xe.fonts=G,xe.currentFont=$,xe.setCurrentFont=xe.setCurrentFont.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function($){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/E.fonts.length-5+"%",V.style.borderColor=$===E.currentFont?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentFont($,V)}),G.appendChild(V);var xe=document.createElement("div");xe.style.display="flex",xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.fontFamily=$,xe.style.overflow="hidden";var Ge=document.createElement("div");Ge.style.whiteSpace="nowrap",Ge.style.overflow="hidden",Ge.style.textOverflow="ellipsis",Ge.innerHTML="The quick brown fox jumps over the lazy dog",xe.appendChild(Ge),V.appendChild(xe),E.fontBoxes.push(V)}),G},c.prototype.setCurrentFont=function(E,G){var $=this;this.currentFont=E,this.fontBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},c}(Me),Xe=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=$.defaultColor,V.fontFamily=$.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new Fe("Color",$.defaultColorSet,$.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new je("Font",$.defaultFontFamilies,$.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return ke(c,K),c.prototype.ownsTarget=function(E){if(K.prototype.ownsTarget.call(this,E)||E===this.visual||E===this.textElement||E===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function($){$===E&&(G=!0)}),G},c.prototype.createVisual=function(){this.visual=de.createGroup(),this.bgRectangle=de.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=de.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.isMoved=!1,this.pointerDownPoint=E,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.renderText=function(){var E=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(G){E.textElement.appendChild(de.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},c.prototype.getTextScale=function(){var E=this.textElement.getBBox(),G=1;if(E.width>0&&E.height>0){var $=(1*this.width-this.width*this.padding*2/100)/E.width,V=(1*this.height-this.height*this.padding*2/100)/E.height;G=Math.min($,V)}return G},c.prototype.getTextPosition=function(E){var G=this.textElement.getBBox(),$=0,V=0;return G.width>0&&G.height>0&&($=(this.width-G.width*E)/2,V=this.height/2-G.height*E/2),{x:$,y:V}},c.prototype.sizeText=function(){var E=this.textElement.getBBox(),G=this.getTextScale(),$=this.getTextPosition(G);$.y-=E.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+$.x+"px, "+$.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate($.x,$.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},c.prototype.manipulate=function(E){K.prototype.manipulate.call(this,E),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(E.x-this.pointerDownPoint.x)>5||Math.abs(E.y-this.pointerDownPoint.y)>5)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),this.isMoved=!0,this.setSize(),this.sizeText()},c.prototype.setSize=function(){K.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},c.prototype.pointerUp=function(E){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),K.prototype.pointerUp.call(this,E),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},c.prototype.showTextEditor=function(){var E=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(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(E.textEditor.style.fontSize);E.textEditor.clientWidth>=Number.parseInt(E.textEditor.style.maxWidth)&&G>.9;)G-=.1,E.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var $=G.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode($)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){E.textEditDivClicked(E.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},c.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var E=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),$=this.textElement.getBBox(),V={x:$.width*E,y:$.height*E};G.x-=V.x/2,G.y-=V.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*E,12)+"px",this.textElement.style.display="none"}},c.prototype.textEditDivClicked=function(E){this.text=E.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},c.prototype.select=function(){K.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},c.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),K.prototype.deselect.call(this)},c.prototype.dblClick=function(E,G){K.prototype.dblClick.call(this,E,G),this.showTextEditor()},c.prototype.setColor=function(E){this.textElement&&de.setAttributes(this.textElement,[["fill",E]]),this.color=E,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(E)},c.prototype.setFont=function(E){this.textElement&&de.setAttributes(this.textElement,[["font-family",E]]),this.fontFamily=E,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},c.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},c.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){var G=E;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),K.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setSize(),this.sizeText(),this.positionTextEditor()},c.typeName="TextMarker",c.title="Text marker",c.icon='',c}(Ze),Ce=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=$.defaultColor,V.lineWidth=$.defaultStrokeWidth,V.pixelRatio=$.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new Fe("Color",$.defaultColorSet,$.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new dt("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.drawingImage)},c.prototype.createVisual=function(){this.visual=de.createGroup(),this.drawingImage=de.createImage(),this.visual.appendChild(this.drawingImage);var E=de.createTransform();this.visual.transform.baseVal.appendItem(E),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,G){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(E.x,E.y),this.drawing=!0):K.prototype.pointerDown.call(this,E,G)},c.prototype.manipulate=function(E){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(E.x,E.y),this.canvasContext.stroke()):K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):K.prototype.pointerUp.call(this,E)},c.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)},c.prototype.select=function(){this.state==="creating"&&this.finishCreation(),K.prototype.select.call(this)},c.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),K.prototype.deselect.call(this)},c.prototype.finishCreation=function(){for(var E=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],$=G[0],V=G[1],xe=G[2],Ge=G[3],tt=!1,mt=0;mt0&&(tt=!0,mtGe&&(Ge=mt),Ke>xe&&(xe=Ke));if(tt){this.left=$/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(xe-$)/this.pixelRatio,this.height=(Ge-V)/this.pixelRatio;var At=document.createElement("canvas");At.width=xe-$,At.height=Ge-V,At.getContext("2d").putImageData(this.canvasContext.getImageData($,V,xe-$,Ge-V),0,0),this.drawingImgUrl=At.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},c.prototype.setDrawingImage=function(){de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},c.prototype.setColor=function(E){this.color=E,this.colorChanged(E)},c.prototype.setLineWidth=function(E){this.lineWidth=E},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({drawingImgUrl:this.drawingImgUrl},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){this.createVisual(),K.prototype.restoreState.call(this,E),this.drawingImgUrl=E.drawingImgUrl,this.setDrawingImage()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setDrawingImage()},c.typeName="FreehandMarker",c.title="Freehand marker",c.icon='',c}(Ze),be=function(K){function c(E,G,$){var V=K.call(this,E,$||'')||this;return V.typeBoxes=[],V.currentType=G,V.setCurrentType=V.setCurrentType.bind(V),V}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var $=function(Ge){var tt="both";switch(Ge){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var mt=document.createElement("div");if(mt.style.display="flex",mt.style.flexGrow="2",mt.style.alignItems="center",mt.style.justifyContent="space-between",mt.style.padding="5px",mt.style.borderWidth="2px",mt.style.borderStyle="solid",mt.style.borderColor=tt===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",mt.addEventListener("click",function(){E.setCurrentType(tt,mt)}),G.appendChild(mt),tt==="both"||tt==="start"){var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.alignItems="center",Ke.style.minHeight="20px",Ke.innerHTML=` + `;xe.innerHTML=Ge,V.appendChild(xe),E.styleBoxes.push(V)}),G},c.prototype.setCurrentStyle=function(E,G){var $=this;this.currentStyle=E,this.styleBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},c}(Me),ot=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.strokeColor=$.defaultColor,V.strokeWidth=$.defaultStrokeWidth,V.strokeDasharray=$.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",$.defaultColorSet,$.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new ht("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return ke(c,K),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="FrameMarker",c.title="Frame marker",c.icon='',c}(Ye),Ie=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},Qe=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return ke(c,K),c.prototype.ownsTarget=function(E){return!!K.prototype.ownsTarget.call(this,E)||!(!this.grip1.ownsTarget(E)&&!this.grip2.ownsTarget(E))},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.manipulationStartX=E.x,this.manipulationStartY=E.y,this.state==="new"&&(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,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(G)?this.activeGrip=this.grip1:this.grip2.ownsTarget(G)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},c.prototype.pointerUp=function(E){var G=this.state;K.prototype.pointerUp.call(this,E),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(E),this._state="select",G==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},c.prototype.adjustVisual=function(){},c.prototype.manipulate=function(E){this.state==="creating"?this.resize(E):this.state==="move"?(this.x1=this.manipulationStartX1+E.x-this.manipulationStartX,this.y1=this.manipulationStartY1+E.y-this.manipulationStartY,this.x2=this.manipulationStartX2+E.x-this.manipulationStartX,this.y2=this.manipulationStartY2+E.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(E)},c.prototype.resize=function(E){switch(this.activeGrip){case this.grip1:this.x1=E.x,this.y1=E.y;break;case this.grip2:case void 0:this.x2=E.x,this.y2=E.y}this.adjustVisual(),this.adjustControlBox()},c.prototype.select=function(){K.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},c.prototype.deselect=function(){K.prototype.deselect.call(this),this.controlBox.style.display="none"},c.prototype.setupControlBox=function(){this.controlBox=he.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},c.prototype.adjustControlBox=function(){this.positionGrips()},c.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},c.prototype.createGrip=function(){var E=new et;return E.visual.transform.baseVal.appendItem(he.createTransform()),this.controlBox.appendChild(E.visual),E},c.prototype.positionGrips=function(){var E=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-E/2,this.y1-E/2),this.positionGrip(this.grip2.visual,this.x2-E/2,this.y2-E/2)},c.prototype.positionGrip=function(E,G,$){var V=E.transform.baseVal.getItem(0);V.setTranslate(G,$),E.transform.baseVal.replaceItem(V,0)},c.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},K.prototype.getState.call(this))},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.x1=G.x1,this.y1=G.y1,this.x2=G.x2,this.y2=G.y2},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.x1=this.x1*E,this.y1=this.y1*G,this.x2=this.x2*E,this.y2=this.y2*G,this.adjustVisual(),this.adjustControlBox()},c}(Ue),st=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=$.defaultColor,V.strokeWidth=$.defaultStrokeWidth,V.strokeDasharray=$.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",$.defaultColorSet,$.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new ht("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorLine&&E!==this.visibleLine)},c.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorLine=he.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=he.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},c.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()),he.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.createVisual(),this.adjustVisual()},c.typeName="LineMarker",c.title="Line marker",c.icon='',c}(Qe),je=function(K){function c(E,G,$,V){var xe=K.call(this,E,V||'')||this;return xe.fonts=[],xe.fontBoxes=[],xe.fonts=G,xe.currentFont=$,xe.setCurrentFont=xe.setCurrentFont.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.overflow="hidden",G.style.flexGrow="2",this.fonts.forEach(function($){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/E.fonts.length-5+"%",V.style.borderColor=$===E.currentFont?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentFont($,V)}),G.appendChild(V);var xe=document.createElement("div");xe.style.display="flex",xe.style.minHeight="20px",xe.style.flexGrow="2",xe.style.fontFamily=$,xe.style.overflow="hidden";var Ge=document.createElement("div");Ge.style.whiteSpace="nowrap",Ge.style.overflow="hidden",Ge.style.textOverflow="ellipsis",Ge.innerHTML="The quick brown fox jumps over the lazy dog",xe.appendChild(Ge),V.appendChild(xe),E.fontBoxes.push(V)}),G},c.prototype.setCurrentFont=function(E,G){var $=this;this.currentFont=E,this.fontBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},c}(Me),Xe=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=$.defaultColor,V.fontFamily=$.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new Fe("Color",$.defaultColorSet,$.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new je("Font",$.defaultFontFamilies,$.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return ke(c,K),c.prototype.ownsTarget=function(E){if(K.prototype.ownsTarget.call(this,E)||E===this.visual||E===this.textElement||E===this.bgRectangle)return!0;var G=!1;return this.textElement.childNodes.forEach(function($){$===E&&(G=!0)}),G},c.prototype.createVisual=function(){this.visual=he.createGroup(),this.bgRectangle=he.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=he.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.textElement.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.isMoved=!1,this.pointerDownPoint=E,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(E),this._state="creating")},c.prototype.renderText=function(){var E=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(G){E.textElement.appendChild(he.createTSpan(G.trim()===""?" ":G.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},c.prototype.getTextScale=function(){var E=this.textElement.getBBox(),G=1;if(E.width>0&&E.height>0){var $=(1*this.width-this.width*this.padding*2/100)/E.width,V=(1*this.height-this.height*this.padding*2/100)/E.height;G=Math.min($,V)}return G},c.prototype.getTextPosition=function(E){var G=this.textElement.getBBox(),$=0,V=0;return G.width>0&&G.height>0&&($=(this.width-G.width*E)/2,V=this.height/2-G.height*E/2),{x:$,y:V}},c.prototype.sizeText=function(){var E=this.textElement.getBBox(),G=this.getTextScale(),$=this.getTextPosition(G);$.y-=E.y*G,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+$.x+"px, "+$.y+"px) scale("+G+", "+G+")":(this.textElement.transform.baseVal.getItem(0).setTranslate($.x,$.y),this.textElement.transform.baseVal.getItem(1).setScale(G,G))},c.prototype.manipulate=function(E){K.prototype.manipulate.call(this,E),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(E.x-this.pointerDownPoint.x)>5||Math.abs(E.y-this.pointerDownPoint.y)>5)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),this.isMoved=!0,this.setSize(),this.sizeText()},c.prototype.setSize=function(){K.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},c.prototype.pointerUp=function(E){var G=this.state;G==="creating"&&(this._suppressMarkerCreateEvent=!0),K.prototype.pointerUp.call(this,E),this.setSize(),(G==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},c.prototype.showTextEditor=function(){var E=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(G){G.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var G=Number.parseFloat(E.textEditor.style.fontSize);E.textEditor.clientWidth>=Number.parseInt(E.textEditor.style.maxWidth)&&G>.9;)G-=.1,E.textEditor.style.fontSize=Math.max(G,.9)+"em"}),this.textEditor.addEventListener("keyup",function(G){G.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(G){if(G.clipboardData){var $=G.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode($)),G.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){E.textEditDivClicked(E.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},c.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var E=this.getTextScale(),G=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),$=this.textElement.getBBox(),V={x:$.width*E,y:$.height*E};G.x-=V.x/2,G.y-=V.y/2,this.textEditor.style.top=G.y+"px",this.textEditor.style.left=G.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-G.x+"px",this.textEditor.style.fontSize=Math.max(16*E,12)+"px",this.textElement.style.display="none"}},c.prototype.textEditDivClicked=function(E){this.text=E.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},c.prototype.select=function(){K.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},c.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),K.prototype.deselect.call(this)},c.prototype.dblClick=function(E,G){K.prototype.dblClick.call(this,E,G),this.showTextEditor()},c.prototype.setColor=function(E){this.textElement&&he.setAttributes(this.textElement,[["fill",E]]),this.color=E,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(E)},c.prototype.setFont=function(E){this.textElement&&he.setAttributes(this.textElement,[["font-family",E]]),this.fontFamily=E,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},c.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},c.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){var G=E;this.color=G.color,this.fontFamily=G.fontFamily,this.padding=G.padding,this.text=G.text,this.createVisual(),K.prototype.restoreState.call(this,E),this.setSize()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setSize(),this.sizeText(),this.positionTextEditor()},c.typeName="TextMarker",c.title="Text marker",c.icon='',c}(Ze),Ce=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=$.defaultColor,V.lineWidth=$.defaultStrokeWidth,V.pixelRatio=$.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new Fe("Color",$.defaultColorSet,$.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new ht("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.drawingImage)},c.prototype.createVisual=function(){this.visual=he.createGroup(),this.drawingImage=he.createImage(),this.visual.appendChild(this.drawingImage);var E=he.createTransform();this.visual.transform.baseVal.appendItem(E),this.addMarkerVisualToContainer(this.visual)},c.prototype.pointerDown=function(E,G){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(E.x,E.y),this.drawing=!0):K.prototype.pointerDown.call(this,E,G)},c.prototype.manipulate=function(E){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(E.x,E.y),this.canvasContext.stroke()):K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){K.prototype.resize.call(this,E),he.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},c.prototype.pointerUp=function(E){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):K.prototype.pointerUp.call(this,E)},c.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)},c.prototype.select=function(){this.state==="creating"&&this.finishCreation(),K.prototype.select.call(this)},c.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),K.prototype.deselect.call(this)},c.prototype.finishCreation=function(){for(var E=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),G=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],$=G[0],V=G[1],xe=G[2],Ge=G[3],tt=!1,mt=0;mt0&&(tt=!0,mtGe&&(Ge=mt),Ke>xe&&(xe=Ke));if(tt){this.left=$/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(xe-$)/this.pixelRatio,this.height=(Ge-V)/this.pixelRatio;var At=document.createElement("canvas");At.width=xe-$,At.height=Ge-V,At.getContext("2d").putImageData(this.canvasContext.getImageData($,V,xe-$,Ge-V),0,0),this.drawingImgUrl=At.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},c.prototype.setDrawingImage=function(){he.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),he.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},c.prototype.setColor=function(E){this.color=E,this.colorChanged(E)},c.prototype.setLineWidth=function(E){this.lineWidth=E},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({drawingImgUrl:this.drawingImgUrl},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){this.createVisual(),K.prototype.restoreState.call(this,E),this.drawingImgUrl=E.drawingImgUrl,this.setDrawingImage()},c.prototype.scale=function(E,G){K.prototype.scale.call(this,E,G),this.setDrawingImage()},c.typeName="FreehandMarker",c.title="Freehand marker",c.icon='',c}(Ze),be=function(K){function c(E,G,$){var V=K.call(this,E,$||'')||this;return V.typeBoxes=[],V.currentType=G,V.setCurrentType=V.setCurrentType.bind(V),V}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2";for(var $=function(Ge){var tt="both";switch(Ge){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var mt=document.createElement("div");if(mt.style.display="flex",mt.style.flexGrow="2",mt.style.alignItems="center",mt.style.justifyContent="space-between",mt.style.padding="5px",mt.style.borderWidth="2px",mt.style.borderStyle="solid",mt.style.borderColor=tt===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",mt.addEventListener("click",function(){E.setCurrentType(tt,mt)}),G.appendChild(mt),tt==="both"||tt==="start"){var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.alignItems="center",Ke.style.minHeight="20px",Ke.innerHTML=` `,Ke.style.marginLeft="5px",mt.appendChild(Ke)}var At=document.createElement("div");At.style.display="flex",At.style.alignItems="center",At.style.minHeight="20px",At.style.flexGrow="2";var It=document.createElement("hr");if(It.style.minWidth="20px",It.style.border="0px",It.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),It.style.flexGrow="2",At.appendChild(It),mt.appendChild(At),tt==="both"||tt==="end"){var er=document.createElement("div");er.style.display="flex",er.style.alignItems="center",er.style.minHeight="20px",er.innerHTML=` - `,er.style.marginRight="5px",mt.appendChild(er)}V.typeBoxes.push(mt)},V=this,xe=0;xe<4;xe++)$(xe);return G},c.prototype.setCurrentType=function(E,G){var $=this;this.currentType=E,this.typeBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},c}(Me),Ee=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new be("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.arrow1&&E!==this.arrow2)},c.prototype.getArrowPoints=function(E,G){var $=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return E-$/2+","+(G+V/2)+" "+E+","+(G-V/2)+" "+(E+$/2)+","+(G+V/2)},c.prototype.createTips=function(){this.arrow1=de.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=de.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow2)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(K.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",de.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),de.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),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(E,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var $=this.arrow2.transform.baseVal.getItem(0);$.setRotate(E+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem($,0)}},c.prototype.setArrowType=function(E){this.arrowType=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({arrowType:this.arrowType},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},c.typeName="ArrowMarker",c.title="Arrow marker",c.icon='',c}(st),ne=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.fillColor=$.defaultFillColor,V.strokeWidth=0,V.fillPanel=new Fe("Color",$.defaultColorSet,$.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return ke(c,K),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="CoverMarker",c.title="Cover marker",c.icon='',c}(Ye),oe=function(K){function c(E,G,$,V){var xe=K.call(this,E,V||'')||this;return xe.opacities=[],xe.opacityBoxes=[],xe.opacities=G,xe.currentOpacity=$,xe.setCurrentOpacity=xe.setCurrentOpacity.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function($){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=$===E.currentOpacity?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentOpacity($,V)}),G.appendChild(V);var xe=document.createElement("div");xe.innerText=100*$+"%",V.appendChild(xe),E.opacityBoxes.push(V)}),G},c.prototype.setCurrentOpacity=function(E,G){var $=this;this.currentOpacity=E,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},c}(Me),ce=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=$.defaultHighlightColor,V.strokeWidth=0,V.opacity=$.defaultHighlightOpacity,V.fillPanel=new Fe("Color",$.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new oe("Opacity",$.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return ke(c,K),c.prototype.setOpacity=function(E){this.opacity=E,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="HighlightMarker",c.title="Highlight marker",c.icon='',c}(ne),ve='',Ne=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=$.defaultStrokeColor,V.bgColor=$.defaultFillColor,V.fontFamily=$.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new Fe("Text color",$.defaultColorSet,V.color,''),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new Fe("Fill color",$.defaultColorSet,V.bgColor,ve),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new je("Font",$.defaultFontFamilies,$.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new et,V.tipGrip.visual.transform.baseVal.appendItem(de.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return ke(c,K),c.prototype.ownsTarget=function(E){return K.prototype.ownsTarget.call(this,E)||this.tipGrip.ownsTarget(E)||this.tip===E},c.prototype.createTip=function(){de.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=de.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},c.prototype.pointerDown=function(E,G){this.state==="new"&&K.prototype.pointerDown.call(this,E,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):K.prototype.pointerDown.call(this,E,G)},c.prototype.pointerUp=function(E){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,K.prototype.pointerUp.call(this,E);else{var G=this.state==="creating";K.prototype.pointerUp.call(this,E),this.setTipPoints(G),this.positionTip()}},c.prototype.manipulate=function(E){if(this.tipMoving){var G=this.unrotatePoint(E);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else K.prototype.manipulate.call(this,E)},c.prototype.setBgColor=function(E){this.bgRectangle&&this.tip&&(de.setAttributes(this.bgRectangle,[["fill",E]]),de.setAttributes(this.tip,[["fill",E]])),this.bgColor=E,this.fillColorChanged(E)},c.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},c.prototype.setTipPoints=function(E){E===void 0&&(E=!1);var G=Math.min(this.height/2,15),$=this.height/5;E&&(this.tipPosition={x:G+$/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?V.1)){var E=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(E,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var $=this.tip2.transform.baseVal.getItem(0);$.setRotate(E+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem($,0)}},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E),this.createTips(),this.adjustVisual()},c.typeName="MeasurementMarker",c.title="Measurement marker",c.icon='',c}(st),it=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.strokePanel.colors=$.defaultColorSet,V.fillColor="transparent",V}return ke(c,K),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="EllipseFrameMarker",c.title="Ellipse frame marker",c.icon='',c}(Re),ct=function(){function K(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),K.prototype.addUndoStep=function(c){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(c)||(this.undoStack.push(c),JSON.stringify(this.lastRedoStep)!==JSON.stringify(c)&&this.redoStack.splice(0,this.redoStack.length))},K.prototype.replaceLastUndoStep=function(c){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=c)},K.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},K.prototype.undo=function(){if(this.undoStack.length>1){var c=this.undoStack.pop();return c!==void 0&&this.redoStack.push(c),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},K.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},K}(),ht=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=$.defaultColor,V.strokeWidth=$.defaultStrokeWidth,V.strokeDasharray=$.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",$.defaultColorSet,$.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new dt("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorCurve&&E!==this.visibleCurve&&!this.curveGrip.ownsTarget(E))},c.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},c.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorCurve=de.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=de.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=E.x,this.curveY=E.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},c.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),de.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setupControlBox=function(){K.prototype.setupControlBox.call(this),this.curveControlLine1=de.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=de.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)},c.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,K.prototype.addControlGrips.call(this)},c.prototype.positionGrips=function(){K.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()))},c.prototype.manipulate=function(E){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+E.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+E.y-this.manipulationStartY),K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){this.activeGrip===this.curveGrip&&(this.curveX=E.x,this.curveY=E.y),K.prototype.resize.call(this,E),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual()},c.prototype.scale=function(E,G){this.curveX=this.curveX*E,this.curveY=this.curveY*G,K.prototype.scale.call(this,E,G)},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},c.typeName="CurveMarker",c.title="Curve marker",c.icon='',c}(Qe),Lt=function(){function K(c,E){E===void 0&&(E=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=c,this.cancelable=E}return Object.defineProperty(K.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),K.prototype.preventDefault=function(){this._defaultPrevented=!0},K}(),wt=function(K){function c(E,G,$){var V=K.call(this,E,!1)||this;return V.dataUrl=G,V.state=$,V}return ke(c,K),c}(Lt),ft=function(K){function c(E,G,$){$===void 0&&($=!1);var V=K.call(this,E,$)||this;return V.marker=G,V}return ke(c,K),c}(Lt),zt=function(){function K(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return K.prototype.addEventListener=function(c,E){this[c].push(E)},K.prototype.removeEventListener=function(c,E){var G=this[c].indexOf(E);G>-1&&this[c].splice(G,1)},K}(),Ft=function(){function K(c){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ie,this._isOpen=!1,this.undoRedoManager=new ct,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 zt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=K.instanceCounter++,this.styles=new De(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=c,this.targetRoot=document.body,this.width=c.clientWidth,this.height=c.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(K.prototype,"ALL_MARKER_TYPES",{get:function(){return[ot,Ce,Ee,Xe,it,Re,ce,Ne,ze,ne,st,ht]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ot,Ce,Ee,Xe,Re,ce,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ot,Ce,Ee,Xe,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(c){var E=this;this._availableMarkerTypes.splice(0),c.forEach(function(G){if(typeof G=="string"){var $=E.ALL_MARKER_TYPES.find(function(V){return V.typeName===G});$!==void 0&&E._availableMarkerTypes.push($)}else E._availableMarkerTypes.push(G)})},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(c){this._zoomLevel=c,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),K.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},K.prototype.show=function(){var c=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(E){return E(new Lt(c))})},K.prototype.render=function(){return Le(this,void 0,void 0,function(){var c;return Ae(this,function(E){switch(E.label){case 0:return this.setCurrentMarker(),(c=new he).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.markersOnly=this.renderMarkersOnly,c.width=this.renderWidth,c.height=this.renderHeight,[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return E.sent(),[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,E.sent()]}})})},K.prototype.close=function(c){var E=this;if(c===void 0&&(c=!1),this.isOpen){var G=!1;c||this.eventListeners.beforeclose.forEach(function($){var V=new Lt(E,!0);$(V),V.defaultPrevented&&(G=!0)}),G||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function($){return $(new Lt(E))}),this.detachEvents(),this._isOpen=!1)}},K.prototype.addMarkersToToolbar=function(){for(var c,E=[],G=0;Gthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*c:this.editorCanvas.clientWidth,G=E',c.title="Powered by marker.js",c.style.display="grid",c.style.alignItems="center",c.style.justifyItems="center",c.style.padding="3px",c.style.width="20px",c.style.height="20px",this.logoUI.appendChild(c),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},K.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},K.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},K.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},K.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new me(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(c),1),c.dispose()},K.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},K.prototype.toolbarButtonClicked=function(c,E){if(c==="marker"&&E!==void 0)this.createNewMarker(E);else if(c==="action")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":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},K.prototype.deleteSelectedMarker=function(){var c=this;if(this._currentMarker!==void 0){var E=!1;if(this.eventListeners.markerbeforedelete.forEach(function($){var V=new ft(c,c._currentMarker,!0);$(V),V.defaultPrevented&&(E=!0)}),!E){var G=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($){return $(new ft(c,G))})}}},K.prototype.clear=function(){var c=this,E=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(xe){var Ge=new ft(c,void 0,!0);xe(Ge),Ge.defaultPrevented&&(E=!0)}),!E)){this.setCurrentMarker();for(var G=function(xe){var Ge=$.markers[xe];$.setCurrentMarker($.markers[xe]),$._currentMarker.dispose(),$.markerImage.removeChild($._currentMarker.container),$.markers.splice($.markers.indexOf($._currentMarker),1),$.eventListeners.markerdelete.forEach(function(tt){return tt(new ft(c,Ge))})},$=this,V=this.markers.length-1;V>=0;V--)G(V);this.addUndoStep()}},Object.defineProperty(K.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),K.prototype.showNotesEditor=function(){var c;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(c=this._currentMarker.notes)!==null&&c!==void 0?c:"",this.overlayContainer.appendChild(this.notesArea))},K.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},K.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},K.prototype.addUndoStep=function(){var c=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var E=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===E.width&&G.height===E.height){var $=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(E),$1&&this.panTo({x:c.clientX,y:c.clientY}))},K.prototype.onPointerUp=function(c){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(c.clientX,c.clientY)),this.isDragging=!1,this.addUndoStep()},K.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},K.prototype.onKeyUp=function(c){this._currentMarker===void 0||this.notesArea!==void 0||c.key!=="Delete"&&c.key!=="Backspace"||this.deleteSelectedMarker()},K.prototype.clientToLocalCoordinates=function(c,E){var G=this.markerImage.getBoundingClientRect();return{x:(c-G.left)/this.zoomLevel,y:(E-G.top)/this.zoomLevel}},K.prototype.onWindowResize=function(){this.positionUI()},K.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},K.prototype.addLicenseKey=function(c){re.addKey(c)},K.prototype.addEventListener=function(c,E){this.eventListeners.addEventListener(c,E)},K.prototype.removeEventListener=function(c,E){this.eventListeners.removeEventListener(c,E)},K.prototype.renderState=function(c){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(c),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(K.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),K.prototype.focus=function(){var c=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(E){return E(new Lt(c))}))},K.prototype.blur=function(){var c=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(E){return E(new Lt(c))}))},K.instanceCounter=0,K}();/* ********************************** + `,er.style.marginRight="5px",mt.appendChild(er)}V.typeBoxes.push(mt)},V=this,xe=0;xe<4;xe++)$(xe);return G},c.prototype.setCurrentType=function(E,G){var $=this;this.currentType=E,this.typeBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings!==void 0?$.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},c}(Me),Ee=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new be("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.arrow1&&E!==this.arrow2)},c.prototype.getArrowPoints=function(E,G){var $=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return E-$/2+","+(G+V/2)+" "+E+","+(G-V/2)+" "+(E+$/2)+","+(G+V/2)},c.prototype.createTips=function(){this.arrow1=he.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=he.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(he.createTransform()),this.visual.appendChild(this.arrow2)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.state==="creating"&&this.createTips()},c.prototype.adjustVisual=function(){if(K.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",he.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),he.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),G=this.arrow1.transform.baseVal.getItem(0);G.setRotate(E,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(G,0);var $=this.arrow2.transform.baseVal.getItem(0);$.setRotate(E+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem($,0)}},c.prototype.setArrowType=function(E){this.arrowType=E,this.adjustVisual(),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({arrowType:this.arrowType},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.arrowType=G.arrowType,this.createTips(),this.adjustVisual()},c.typeName="ArrowMarker",c.title="Arrow marker",c.icon='',c}(st),ne=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.fillColor=$.defaultFillColor,V.strokeWidth=0,V.fillPanel=new Fe("Color",$.defaultColorSet,$.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return ke(c,K),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="CoverMarker",c.title="Cover marker",c.icon='',c}(Ye),oe=function(K){function c(E,G,$,V){var xe=K.call(this,E,V||'')||this;return xe.opacities=[],xe.opacityBoxes=[],xe.opacities=G,xe.currentOpacity=$,xe.setCurrentOpacity=xe.setCurrentOpacity.bind(xe),xe}return ke(c,K),c.prototype.getUi=function(){var E=this,G=document.createElement("div");return G.style.display="flex",G.style.overflow="hidden",G.style.flexGrow="2",G.style.justifyContent="space-between",this.opacities.forEach(function($){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=$===E.currentOpacity?E.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){E.setCurrentOpacity($,V)}),G.appendChild(V);var xe=document.createElement("div");xe.innerText=100*$+"%",V.appendChild(xe),E.opacityBoxes.push(V)}),G},c.prototype.setCurrentOpacity=function(E,G){var $=this;this.currentOpacity=E,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===G?$.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},c}(Me),ce=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=$.defaultHighlightColor,V.strokeWidth=0,V.opacity=$.defaultHighlightOpacity,V.fillPanel=new Fe("Color",$.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new oe("Opacity",$.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return ke(c,K),c.prototype.setOpacity=function(E){this.opacity=E,this.visual&&he.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="HighlightMarker",c.title="Highlight marker",c.icon='',c}(ne),ve='',Ne=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=$.defaultStrokeColor,V.bgColor=$.defaultFillColor,V.fontFamily=$.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new Fe("Text color",$.defaultColorSet,V.color,''),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new Fe("Fill color",$.defaultColorSet,V.bgColor,ve),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new je("Font",$.defaultFontFamilies,$.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new et,V.tipGrip.visual.transform.baseVal.appendItem(he.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return ke(c,K),c.prototype.ownsTarget=function(E){return K.prototype.ownsTarget.call(this,E)||this.tipGrip.ownsTarget(E)||this.tip===E},c.prototype.createTip=function(){he.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=he.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},c.prototype.pointerDown=function(E,G){this.state==="new"&&K.prototype.pointerDown.call(this,E,G),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(G)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):K.prototype.pointerDown.call(this,E,G)},c.prototype.pointerUp=function(E){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,K.prototype.pointerUp.call(this,E);else{var G=this.state==="creating";K.prototype.pointerUp.call(this,E),this.setTipPoints(G),this.positionTip()}},c.prototype.manipulate=function(E){if(this.tipMoving){var G=this.unrotatePoint(E);this.tipPosition={x:G.x-this.manipulationStartLeft,y:G.y-this.manipulationStartTop},this.positionTip()}else K.prototype.manipulate.call(this,E)},c.prototype.setBgColor=function(E){this.bgRectangle&&this.tip&&(he.setAttributes(this.bgRectangle,[["fill",E]]),he.setAttributes(this.tip,[["fill",E]])),this.bgColor=E,this.fillColorChanged(E)},c.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},c.prototype.setTipPoints=function(E){E===void 0&&(E=!1);var G=Math.min(this.height/2,15),$=this.height/5;E&&(this.tipPosition={x:G+$/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?V.1)){var E=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),G=this.tip1.transform.baseVal.getItem(0);G.setRotate(E,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(G,0);var $=this.tip2.transform.baseVal.getItem(0);$.setRotate(E+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem($,0)}},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E),this.createTips(),this.adjustVisual()},c.typeName="MeasurementMarker",c.title="Measurement marker",c.icon='',c}(st),it=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.strokePanel.colors=$.defaultColorSet,V.fillColor="transparent",V}return ke(c,K),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=K.prototype.getState.call(this);return E.typeName=c.typeName,E},c.typeName="EllipseFrameMarker",c.title="Ellipse frame marker",c.icon='',c}(Re),ct=function(){function K(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),K.prototype.addUndoStep=function(c){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(c)||(this.undoStack.push(c),JSON.stringify(this.lastRedoStep)!==JSON.stringify(c)&&this.redoStack.splice(0,this.redoStack.length))},K.prototype.replaceLastUndoStep=function(c){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=c)},K.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},K.prototype.undo=function(){if(this.undoStack.length>1){var c=this.undoStack.pop();return c!==void 0&&this.redoStack.push(c),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},K.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},K}(),dt=function(K){function c(E,G,$){var V=K.call(this,E,G,$)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=$.defaultColor,V.strokeWidth=$.defaultStrokeWidth,V.strokeDasharray=$.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",$.defaultColorSet,$.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new ht("Line width",$.defaultStrokeWidths,$.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new qe("Line style",$.defaultStrokeDasharrays,$.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return ke(c,K),c.prototype.ownsTarget=function(E){return!(!K.prototype.ownsTarget.call(this,E)&&E!==this.visual&&E!==this.selectorCurve&&E!==this.visibleCurve&&!this.curveGrip.ownsTarget(E))},c.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},c.prototype.createVisual=function(){this.visual=he.createGroup(),this.selectorCurve=he.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=he.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)},c.prototype.pointerDown=function(E,G){K.prototype.pointerDown.call(this,E,G),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=E.x,this.curveY=E.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(G)&&(this.activeGrip=this.curveGrip,this._state="resize")},c.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),he.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),he.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),he.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},c.prototype.setupControlBox=function(){K.prototype.setupControlBox.call(this),this.curveControlLine1=he.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=he.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)},c.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,K.prototype.addControlGrips.call(this)},c.prototype.positionGrips=function(){K.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()))},c.prototype.manipulate=function(E){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+E.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+E.y-this.manipulationStartY),K.prototype.manipulate.call(this,E)},c.prototype.resize=function(E){this.activeGrip===this.curveGrip&&(this.curveX=E.x,this.curveY=E.y),K.prototype.resize.call(this,E),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},c.prototype.setStrokeColor=function(E){this.strokeColor=E,this.adjustVisual(),this.colorChanged(E)},c.prototype.setStrokeWidth=function(E){this.strokeWidth=E,this.adjustVisual()},c.prototype.setStrokeDasharray=function(E){this.strokeDasharray=E,this.adjustVisual()},c.prototype.scale=function(E,G){this.curveX=this.curveX*E,this.curveY=this.curveY*G,K.prototype.scale.call(this,E,G)},Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),c.prototype.getState=function(){var E=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},K.prototype.getState.call(this));return E.typeName=c.typeName,E},c.prototype.restoreState=function(E){K.prototype.restoreState.call(this,E);var G=E;this.strokeColor=G.strokeColor,this.strokeWidth=G.strokeWidth,this.strokeDasharray=G.strokeDasharray,this.curveX=G.curveX,this.curveY=G.curveY,this.createVisual(),this.adjustVisual()},c.typeName="CurveMarker",c.title="Curve marker",c.icon='',c}(Qe),Lt=function(){function K(c,E){E===void 0&&(E=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=c,this.cancelable=E}return Object.defineProperty(K.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),K.prototype.preventDefault=function(){this._defaultPrevented=!0},K}(),wt=function(K){function c(E,G,$){var V=K.call(this,E,!1)||this;return V.dataUrl=G,V.state=$,V}return ke(c,K),c}(Lt),ft=function(K){function c(E,G,$){$===void 0&&($=!1);var V=K.call(this,E,$)||this;return V.marker=G,V}return ke(c,K),c}(Lt),zt=function(){function K(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return K.prototype.addEventListener=function(c,E){this[c].push(E)},K.prototype.removeEventListener=function(c,E){var G=this[c].indexOf(E);G>-1&&this[c].splice(G,1)},K}(),Ft=function(){function K(c){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ie,this._isOpen=!1,this.undoRedoManager=new ct,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 zt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=K.instanceCounter++,this.styles=new De(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=c,this.targetRoot=document.body,this.width=c.clientWidth,this.height=c.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(K.prototype,"ALL_MARKER_TYPES",{get:function(){return[ot,Ce,Ee,Xe,it,Re,ce,Ne,ze,ne,st,dt]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ot,Ce,Ee,Xe,Re,ce,Ne]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ot,Ce,Ee,Xe,ce]},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(c){var E=this;this._availableMarkerTypes.splice(0),c.forEach(function(G){if(typeof G=="string"){var $=E.ALL_MARKER_TYPES.find(function(V){return V.typeName===G});$!==void 0&&E._availableMarkerTypes.push($)}else E._availableMarkerTypes.push(G)})},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(c){this._zoomLevel=c,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),K.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},K.prototype.show=function(){var c=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(E){return E(new Lt(c))})},K.prototype.render=function(){return Le(this,void 0,void 0,function(){var c;return Ae(this,function(E){switch(E.label){case 0:return this.setCurrentMarker(),(c=new de).naturalSize=this.renderAtNaturalSize,c.imageType=this.renderImageType,c.imageQuality=this.renderImageQuality,c.markersOnly=this.renderMarkersOnly,c.width=this.renderWidth,c.height=this.renderHeight,[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return E.sent(),[4,c.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,E.sent()]}})})},K.prototype.close=function(c){var E=this;if(c===void 0&&(c=!1),this.isOpen){var G=!1;c||this.eventListeners.beforeclose.forEach(function($){var V=new Lt(E,!0);$(V),V.defaultPrevented&&(G=!0)}),G||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function($){return $(new Lt(E))}),this.detachEvents(),this._isOpen=!1)}},K.prototype.addMarkersToToolbar=function(){for(var c,E=[],G=0;Gthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*c:this.editorCanvas.clientWidth,G=E',c.title="Powered by marker.js",c.style.display="grid",c.style.alignItems="center",c.style.justifyItems="center",c.style.padding="3px",c.style.width="20px",c.style.height="20px",this.logoUI.appendChild(c),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},K.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},K.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},K.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},K.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new me(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(c),1),c.dispose()},K.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},K.prototype.toolbarButtonClicked=function(c,E){if(c==="marker"&&E!==void 0)this.createNewMarker(E);else if(c==="action")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":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},K.prototype.deleteSelectedMarker=function(){var c=this;if(this._currentMarker!==void 0){var E=!1;if(this.eventListeners.markerbeforedelete.forEach(function($){var V=new ft(c,c._currentMarker,!0);$(V),V.defaultPrevented&&(E=!0)}),!E){var G=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($){return $(new ft(c,G))})}}},K.prototype.clear=function(){var c=this,E=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(xe){var Ge=new ft(c,void 0,!0);xe(Ge),Ge.defaultPrevented&&(E=!0)}),!E)){this.setCurrentMarker();for(var G=function(xe){var Ge=$.markers[xe];$.setCurrentMarker($.markers[xe]),$._currentMarker.dispose(),$.markerImage.removeChild($._currentMarker.container),$.markers.splice($.markers.indexOf($._currentMarker),1),$.eventListeners.markerdelete.forEach(function(tt){return tt(new ft(c,Ge))})},$=this,V=this.markers.length-1;V>=0;V--)G(V);this.addUndoStep()}},Object.defineProperty(K.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),K.prototype.showNotesEditor=function(){var c;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(c=this._currentMarker.notes)!==null&&c!==void 0?c:"",this.overlayContainer.appendChild(this.notesArea))},K.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},K.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},K.prototype.addUndoStep=function(){var c=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var E=this.getState(),G=this.undoRedoManager.getLastUndoStep();if(!G||G.width===E.width&&G.height===E.height){var $=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(E),$1&&this.panTo({x:c.clientX,y:c.clientY}))},K.prototype.onPointerUp=function(c){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(c.clientX,c.clientY)),this.isDragging=!1,this.addUndoStep()},K.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},K.prototype.onKeyUp=function(c){this._currentMarker===void 0||this.notesArea!==void 0||c.key!=="Delete"&&c.key!=="Backspace"||this.deleteSelectedMarker()},K.prototype.clientToLocalCoordinates=function(c,E){var G=this.markerImage.getBoundingClientRect();return{x:(c-G.left)/this.zoomLevel,y:(E-G.top)/this.zoomLevel}},K.prototype.onWindowResize=function(){this.positionUI()},K.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var c=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=c+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},K.prototype.addLicenseKey=function(c){re.addKey(c)},K.prototype.addEventListener=function(c,E){this.eventListeners.addEventListener(c,E)},K.prototype.removeEventListener=function(c,E){this.eventListeners.removeEventListener(c,E)},K.prototype.renderState=function(c){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(c),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(K.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),K.prototype.focus=function(){var c=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(E){return E(new Lt(c))}))},K.prototype.blur=function(){var c=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(E){return E(new Lt(c))}))},K.instanceCounter=0,K}();/* ********************************** cropro version 1.2.0 @license SEE LICENSE IN LICENSE @@ -231,28 +231,28 @@ PERFORMANCE OF THIS SOFTWARE. `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new xt("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; - `))},K.instanceCounter=0,K}(),lt=q("8hTe"),Pt=q.n(lt),Kt=/]*>/g;function Yt(K){var c=document.createElement("div");return c.innerHTML=K,c.childNodes.length===0?"":c.childNodes[0].nodeValue}var qt=Te.a=function(K){var c=K.value,E=c===void 0?"":c,G=K.edit,$=G===void 0?!1:G,V=K.className,xe=K.showTextOnly,Ge=K.showLines,tt=K.replaces,mt=K.zoomImg,Ke=K.hasMask,At=K.style,It=At===void 0?{}:At,er=K.stylesPrev,Kr=er===void 0?{}:er,Vr=String(E),pr=Object(L.useRef)(),Qr=Object(L.useRef)(),Gn=Object(L.useState)(""),_r=Object(W.a)(Gn,2),Xr=_r[0],jr=_r[1],bn=Object(L.useState)("office"),nn=Object(W.a)(bn,2),mn=nn[0],dn=nn[1],hi=function(){var jt=new He(Qr.current);jt.displayMode="popup",jt.addRenderEventListener(function(){var Er=Object(P.a)(O.a.mark(function Ut(dr){var Vt;return O.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return pr.current.style.display="none",lr.next=3,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr}});case 3:Vt=lr.sent,Vt!=null&&Vt.id&&tt(Qr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 5:case"end":return lr.stop()}},Ut)}));return function(Ut){return Er.apply(this,arguments)}}()),jt.show()},zn=function(){var jt=new Ft(Qr.current);jt.settings.displayMode="popup",jt.addEventListener("render",function(){var Er=Object(P.a)(O.a.mark(function Ut(dr){var Vt;return O.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:if(pr.current.style.display="none",!Qr.current){lr.next=6;break}return lr.next=4,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr.dataUrl}});case 4:Vt=lr.sent,Vt!=null&&Vt.id&&tt(Qr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 6:case"end":return lr.stop()}},Ut)}));return function(Ut){return Er.apply(this,arguments)}}()),jt.show(),window.markerArea=jt},an=Object(L.useMemo)(function(){try{var or=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,jt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Er=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Vr=Vr.replace(or,"("+ee.a.API_SERVER+"/api/attachments/").replace(jt,'"'+ee.a.API_SERVER+"/api/attachments/").replace(Er,'"'+ee.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,` + `))},K.instanceCounter=0,K}(),lt=q("8hTe"),Pt=q.n(lt),Kt=/]*>/g;function Yt(K){var c=document.createElement("div");return c.innerHTML=K,c.childNodes.length===0?"":c.childNodes[0].nodeValue}var qt=Te.a=function(K){var c=K.value,E=c===void 0?"":c,G=K.edit,$=G===void 0?!1:G,V=K.className,xe=K.showTextOnly,Ge=K.showLines,tt=K.replaces,mt=K.zoomImg,Ke=K.hasMask,At=K.style,It=At===void 0?{}:At,er=K.stylesPrev,Kr=er===void 0?{}:er,Vr=String(E),pr=Object(L.useRef)(),Qr=Object(L.useRef)(),Gn=Object(L.useState)(""),_r=Object(W.a)(Gn,2),Xr=_r[0],jr=_r[1],bn=Object(L.useState)("office"),nn=Object(W.a)(bn,2),mn=nn[0],hn=nn[1],di=function(){var jt=new He(Qr.current);jt.displayMode="popup",jt.addRenderEventListener(function(){var Er=Object(P.a)(O.a.mark(function Ut(hr){var Vt;return O.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return pr.current.style.display="none",lr.next=3,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hr}});case 3:Vt=lr.sent,Vt!=null&&Vt.id&&tt(Qr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 5:case"end":return lr.stop()}},Ut)}));return function(Ut){return Er.apply(this,arguments)}}()),jt.show()},zn=function(){var jt=new Ft(Qr.current);jt.settings.displayMode="popup",jt.addEventListener("render",function(){var Er=Object(P.a)(O.a.mark(function Ut(hr){var Vt;return O.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:if(pr.current.style.display="none",!Qr.current){lr.next=6;break}return lr.next=4,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hr.dataUrl}});case 4:Vt=lr.sent,Vt!=null&&Vt.id&&tt(Qr.current.getAttribute("src").replace(ee.a.API_SERVER,""),"/api/attachments/".concat(Vt==null?void 0:Vt.id,"?type=").concat(Vt.content_type));case 6:case"end":return lr.stop()}},Ut)}));return function(Ut){return Er.apply(this,arguments)}}()),jt.show(),window.markerArea=jt},an=Object(L.useMemo)(function(){try{var or=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,jt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Er=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Vr=Vr.replace(or,"("+ee.a.API_SERVER+"/api/attachments/").replace(jt,'"'+ee.a.API_SERVER+"/api/attachments/").replace(Er,'"'+ee.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,` `),Vr=Vr.replace(new RegExp("(?[TOC]

      ",R()),C()),Ut=Ut.replace(/(__special_katext_id_\d+__)/g,function(hn,lr){var Or=dr[lr],Kn=Or.type,Vn=Or.expression;return Object(le.renderToString)(Yt(Vn)||"",{displayMode:Kn==="block",throwOnError:!1,output:"html"})}),Ut=Ut.replace(/▁/g,"\u2581\u2581\u2581"),S(),xe){var Vt=document.createElement("div");return Vt.innerHTML=Ut,Vt.innerText}return setTimeout(function(){return _n()},500),Ut},[Vr]),Yr=Object(L.useRef)();v.WebkitLineClamp=Ge,Ge&&(It=Object(F.a)(Object(F.a)({},It),v));function kn(or){var jt=or.target;if(jt.tagName.toUpperCase()==="IMG"){if(mt){var Er=jt.getAttribute("src");jr(Er),dn("image")}}else if(jt.tagName.toUpperCase()==="A"){var Ut=jt.getAttribute("href");if(Ut.indexOf("office")>-1)or.preventDefault(),jr(Ut),dn("office");else if(Ut.indexOf("application/pdf")>-1)or.preventDefault(),jr(Ut),dn("pdf");else if(Ut.indexOf("type=text")>-1)or.preventDefault(),jr(Ut),dn("html");else if(Ut.startsWith("#")){or.preventDefault();var dr=document.getElementById(Ut.replace("#",""));dr&&dr.scrollIntoView(!0)}}}var _n=function(){var jt,Er=(jt=Yr.current)===null||jt===void 0?void 0:jt.querySelectorAll("video");Er==null||Er.forEach(function(Ut){if(Ut.oncontextmenu=function(){return!1},Ut.src.indexOf(".m3u8")>-1&&!Ut.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var dr=new Y.a;dr.loadSource(Ut.src),dr.attachMedia(Ut)}}})};Object(L.useEffect)(function(){if(Yr.current&&an&&(an.match(Kt)&&window.PR.prettyPrint()),Yr.current)return Yr.current.addEventListener("click",kn),function(){Yr.current.removeEventListener("click",kn),S(),C()}},[an,Yr.current,kn]);var ci=function(jt){if(!$)return;jt.target.nodeName==="IMG"?(pr.current.style.display="flex",pr.current.style.width=jt.target.clientWidth+"px",pr.current.style.height=jt.target.clientHeight+"px",pr.current.style.top=jt.target.offsetTop+"px",pr.current.style.left=jt.target.offsetLeft+"px",Qr.current.src=jt.target.getAttribute("src")):pr.current.style.display="none"};return d.a.createElement("div",{style:{position:"relative"}},d.a.createElement("div",{ref:Yr,style:Object(F.a)({},It),className:"".concat(V||""," markdown-body ").concat(Pt.a.mdBody),onMouseOver:ci,dangerouslySetInnerHTML:{__html:an}}),d.a.createElement("div",{ref:pr,className:Pt.a.button},d.a.createElement(J.a,null,d.a.createElement(X.a,{onClick:function(){return hi()}},"\u88C1\u526A"),d.a.createElement(X.a,{onClick:function(){return zn()}},"\u7F16\u8F91"))),d.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),d.a.createElement(fe.a,{close:!0,data:Xr,hasMask:Ke,type:Xr!=null&&Xr.length?mn:"",style:Object(F.a)({},Kr),onClose:function(){return jr("")}}))}},"9VGf":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return _});var ue=q("q1tI"),J=q.n(ue);function _(X,F){var P=Object(ue.useRef)();Object(ue.useEffect)(function(){P.current=X}),Object(ue.useEffect)(function(){function W(){P.current()}if(F!==null){var U=setInterval(W,F);return function(){return clearInterval(U)}}},[F])}},BU3w:function(pt,Te,q){"use strict";q.d(Te,"a",function(){return P});var ue=q("MNnm"),J="rc-util-key";function _(W){if(W.attachTo)return W.attachTo;var U=document.querySelector("head");return U||document.body}function X(W){var U,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var L=document.createElement("style");if((U=O.csp)===null||U===void 0?void 0:U.nonce){var d;L.nonce=(d=O.csp)===null||d===void 0?void 0:d.nonce}L.innerHTML=W;var f=_(O),T=f.firstChild;return O.prepend&&f.prepend?f.prepend(L):O.prepend&&T?f.insertBefore(L,T):f.appendChild(L),L}var F=new Map;function P(W,U){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=_(O);if(!F.has(L)){var d=X("",O),f=d.parentNode;F.set(L,f),f.removeChild(d)}var T=Array.from(F.get(L).children).find(function(i){return i.tagName==="STYLE"&&i[J]===U});if(T){var p,m;if(((p=O.csp)===null||p===void 0?void 0:p.nonce)&&T.nonce!==((m=O.csp)===null||m===void 0?void 0:m.nonce)){var g;T.nonce=(g=O.csp)===null||g===void 0?void 0:g.nonce}return T.innerHTML!==W&&(T.innerHTML=W),T}var a=X(W,O);return a[J]=U,a}},Bd2K:function(pt,Te,q){(function(ue){ue(q("VrN/"),q("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(O,L,d){if(d!=ue.Init&&d&&O.removeKeyMap("autoCloseTags"),!L)return;var f={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(f["'/'"]=function(T){return P(T)}),(typeof L!="object"||L.whenOpening!==!1)&&(f["'>'"]=function(T){return X(T)}),O.addKeyMap(f)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],_=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(O){if(O.getOption("disableInput"))return ue.Pass;for(var L=O.listSelections(),d=[],f=O.getOption("autoCloseTags"),T=0;Tp.ch&&(s=s.slice(0,s.length-m.end+p.ch));var y=s.toLowerCase();if(!s||m.type=="string"&&(m.end!=p.ch||!/[\"\']/.test(m.string.charAt(m.string.length-1))||m.string.length==1)||m.type=="tag"&&i.close||m.string.indexOf("/")==p.ch-m.start-1||C&&W(C,y)>-1||U(O,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(a)||[],s,p,!0))return ue.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&W(R,s)>-1){d[T]={text:"/>",newPos:ue.Pos(p.line,p.ch+2)};continue}var w=v&&W(v,y)>-1;d[T]={indent:w,text:">"+(w?` +`)}catch(dn){}var Ut=z(Vr),hr=A();if(Vr.match(/\[TOC\]/)&&(Ut=Ut.replace("

      [TOC]

      ",R()),C()),Ut=Ut.replace(/(__special_katext_id_\d+__)/g,function(dn,lr){var Or=hr[lr],Kn=Or.type,Vn=Or.expression;return Object(le.renderToString)(Yt(Vn)||"",{displayMode:Kn==="block",throwOnError:!1,output:"html"})}),Ut=Ut.replace(/▁/g,"\u2581\u2581\u2581"),S(),xe){var Vt=document.createElement("div");return Vt.innerHTML=Ut,Vt.innerText}return setTimeout(function(){return _n()},500),Ut},[Vr]),Yr=Object(L.useRef)();v.WebkitLineClamp=Ge,Ge&&(It=Object(F.a)(Object(F.a)({},It),v));function kn(or){var jt=or.target;if(jt.tagName.toUpperCase()==="IMG"){if(mt){var Er=jt.getAttribute("src");jr(Er),hn("image")}}else if(jt.tagName.toUpperCase()==="A"){var Ut=jt.getAttribute("href");if(Ut.indexOf("office")>-1)or.preventDefault(),jr(Ut),hn("office");else if(Ut.indexOf("application/pdf")>-1)or.preventDefault(),jr(Ut),hn("pdf");else if(Ut.indexOf("type=text")>-1)or.preventDefault(),jr(Ut),hn("html");else if(Ut.startsWith("#")){or.preventDefault();var hr=document.getElementById(Ut.replace("#",""));hr&&hr.scrollIntoView(!0)}}}var _n=function(){var jt,Er=(jt=Yr.current)===null||jt===void 0?void 0:jt.querySelectorAll("video");Er==null||Er.forEach(function(Ut){if(Ut.oncontextmenu=function(){return!1},Ut.src.indexOf(".m3u8")>-1&&!Ut.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var hr=new Y.a;hr.loadSource(Ut.src),hr.attachMedia(Ut)}}})};Object(L.useEffect)(function(){if(Yr.current&&an&&(an.match(Kt)&&window.PR.prettyPrint()),Yr.current)return Yr.current.addEventListener("click",kn),function(){Yr.current.removeEventListener("click",kn),S(),C()}},[an,Yr.current,kn]);var ci=function(jt){if(!$)return;jt.target.nodeName==="IMG"?(pr.current.style.display="flex",pr.current.style.width=jt.target.clientWidth+"px",pr.current.style.height=jt.target.clientHeight+"px",pr.current.style.top=jt.target.offsetTop+"px",pr.current.style.left=jt.target.offsetLeft+"px",Qr.current.src=jt.target.getAttribute("src")):pr.current.style.display="none"};return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:Yr,style:Object(F.a)({},It),className:"".concat(V||""," markdown-body ").concat(Pt.a.mdBody),onMouseOver:ci,dangerouslySetInnerHTML:{__html:an}}),h.a.createElement("div",{ref:pr,className:Pt.a.button},h.a.createElement(J.a,null,h.a.createElement(X.a,{onClick:function(){return di()}},"\u88C1\u526A"),h.a.createElement(X.a,{onClick:function(){return zn()}},"\u7F16\u8F91"))),h.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),h.a.createElement(fe.a,{close:!0,data:Xr,hasMask:Ke,type:Xr!=null&&Xr.length?mn:"",style:Object(F.a)({},Kr),onClose:function(){return jr("")}}))}},"9VGf":function(pt,Te,q){"use strict";q.d(Te,"a",function(){return _});var ue=q("q1tI"),J=q.n(ue);function _(X,F){var P=Object(ue.useRef)();Object(ue.useEffect)(function(){P.current=X}),Object(ue.useEffect)(function(){function W(){P.current()}if(F!==null){var U=setInterval(W,F);return function(){return clearInterval(U)}}},[F])}},BU3w:function(pt,Te,q){"use strict";q.d(Te,"a",function(){return P});var ue=q("MNnm"),J="rc-util-key";function _(W){if(W.attachTo)return W.attachTo;var U=document.querySelector("head");return U||document.body}function X(W){var U,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var L=document.createElement("style");if((U=O.csp)===null||U===void 0?void 0:U.nonce){var h;L.nonce=(h=O.csp)===null||h===void 0?void 0:h.nonce}L.innerHTML=W;var f=_(O),T=f.firstChild;return O.prepend&&f.prepend?f.prepend(L):O.prepend&&T?f.insertBefore(L,T):f.appendChild(L),L}var F=new Map;function P(W,U){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=_(O);if(!F.has(L)){var h=X("",O),f=h.parentNode;F.set(L,f),f.removeChild(h)}var T=Array.from(F.get(L).children).find(function(i){return i.tagName==="STYLE"&&i[J]===U});if(T){var p,m;if(((p=O.csp)===null||p===void 0?void 0:p.nonce)&&T.nonce!==((m=O.csp)===null||m===void 0?void 0:m.nonce)){var g;T.nonce=(g=O.csp)===null||g===void 0?void 0:g.nonce}return T.innerHTML!==W&&(T.innerHTML=W),T}var a=X(W,O);return a[J]=U,a}},Bd2K:function(pt,Te,q){(function(ue){ue(q("VrN/"),q("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(O,L,h){if(h!=ue.Init&&h&&O.removeKeyMap("autoCloseTags"),!L)return;var f={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(f["'/'"]=function(T){return P(T)}),(typeof L!="object"||L.whenOpening!==!1)&&(f["'>'"]=function(T){return X(T)}),O.addKeyMap(f)});var J=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],_=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(O){if(O.getOption("disableInput"))return ue.Pass;for(var L=O.listSelections(),h=[],f=O.getOption("autoCloseTags"),T=0;Tp.ch&&(s=s.slice(0,s.length-m.end+p.ch));var y=s.toLowerCase();if(!s||m.type=="string"&&(m.end!=p.ch||!/[\"\']/.test(m.string.charAt(m.string.length-1))||m.string.length==1)||m.type=="tag"&&i.close||m.string.indexOf("/")==p.ch-m.start-1||C&&W(C,y)>-1||U(O,g.mode.xmlCurrentContext&&g.mode.xmlCurrentContext(a)||[],s,p,!0))return ue.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&W(R,s)>-1){h[T]={text:"/>",newPos:ue.Pos(p.line,p.ch+2)};continue}var w=v&&W(v,y)>-1;h[T]={indent:w,text:">"+(w?` -`:"")+"",newPos:w?ue.Pos(p.line+1,0):ue.Pos(p.line,p.ch+1)}}for(var x=typeof f=="object"&&f.dontIndentOnAutoClose,T=L.length-1;T>=0;T--){var b=d[T];O.replaceRange(b.text,L[T].head,L[T].anchor,"+insert");var h=O.listSelections().slice(0);h[T]={head:b.newPos,anchor:b.newPos},O.setSelections(h),!x&&b.indent&&(O.indentLine(b.newPos.line,null,!0),O.indentLine(b.newPos.line+1,null,!0))}}function F(O,L){for(var d=O.listSelections(),f=[],T=L?"/":""&&(C+=">"),f[g]=C}if(O.replaceSelections(f),d=O.listSelections(),!m)for(var g=0;g=0&&L[a]==d;a--)++g;f=m.to;for(var a=1;a0){for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:"",L=[],d=0;dCe.length)&&(be=Ce.length);for(var Ee=0,ne=new Array(be);Ee=Ce.length?{done:!0}:{done:!1,value:Ce[ne++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Ee=Ce[Symbol.iterator](),Ee.next.bind(Ee)}function P(Ce,be){return be={exports:{}},Ce(be,be.exports),be.exports}var W=P(function(Ce){function be(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Ee(ne){Ce.exports.defaults=ne}Ce.exports={defaults:be(),getDefaults:be,changeDefaults:Ee}}),U=W.defaults,O=W.getDefaults,L=W.changeDefaults,d=/[&<>"']/,f=/[&<>"']/g,T=/[<>"']|&(?!#?\w+;)/,p=/[<>"']|&(?!#?\w+;)/g,m={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(be){return m[be]};function a(Ce,be){if(be){if(d.test(Ce))return Ce.replace(f,g)}else if(T.test(Ce))return Ce.replace(p,g);return Ce}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Ce){return Ce.replace(i,function(be,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var l=/(^|[^\[])\^/g;function C(Ce,be){Ce=Ce.source||Ce,be=be||"";var Ee={replace:function(oe,ce){return ce=ce.source||ce,ce=ce.replace(l,"$1"),Ce=Ce.replace(oe,ce),Ee},getRegex:function(){return new RegExp(Ce,be)}};return Ee}var v=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ce,be,Ee){if(Ce){var ne;try{ne=decodeURIComponent(s(Ee)).replace(v,"").toLowerCase()}catch(oe){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}be&&!y.test(Ee)&&(Ee=u(be,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(oe){return null}return Ee}var w={},x=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(Ce,be){w[" "+Ce]||(x.test(Ce)?w[" "+Ce]=Ce+"/":w[" "+Ce]=I(Ce,"/",!0)),Ce=w[" "+Ce];var Ee=Ce.indexOf(":")===-1;return be.substring(0,2)==="//"?Ee?be:Ce.replace(b,"$1")+be:be.charAt(0)==="/"?Ee?be:Ce.replace(h,"$1")+be:Ce+be}var A={exec:function(){}};function S(Ce){for(var be=1,Ee,ne;be=0&&Ne[ze]==="\\";)Re=!Re;return Re?"|":" |"}),ne=Ee.split(/ \|/),oe=0;if(ne.length>be)ne.splice(be);else for(;ne.length",newPos:w?ue.Pos(p.line+1,0):ue.Pos(p.line,p.ch+1)}}for(var x=typeof f=="object"&&f.dontIndentOnAutoClose,T=L.length-1;T>=0;T--){var b=h[T];O.replaceRange(b.text,L[T].head,L[T].anchor,"+insert");var d=O.listSelections().slice(0);d[T]={head:b.newPos,anchor:b.newPos},O.setSelections(d),!x&&b.indent&&(O.indentLine(b.newPos.line,null,!0),O.indentLine(b.newPos.line+1,null,!0))}}function F(O,L){for(var h=O.listSelections(),f=[],T=L?"/":""&&(C+=">"),f[g]=C}if(O.replaceSelections(f),h=O.listSelections(),!m)for(var g=0;g=0&&L[a]==h;a--)++g;f=m.to;for(var a=1;a0){for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:"",L=[],h=0;hCe.length)&&(be=Ce.length);for(var Ee=0,ne=new Array(be);Ee=Ce.length?{done:!0}:{done:!1,value:Ce[ne++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return Ee=Ce[Symbol.iterator](),Ee.next.bind(Ee)}function P(Ce,be){return be={exports:{}},Ce(be,be.exports),be.exports}var W=P(function(Ce){function be(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Ee(ne){Ce.exports.defaults=ne}Ce.exports={defaults:be(),getDefaults:be,changeDefaults:Ee}}),U=W.defaults,O=W.getDefaults,L=W.changeDefaults,h=/[&<>"']/,f=/[&<>"']/g,T=/[<>"']|&(?!#?\w+;)/,p=/[<>"']|&(?!#?\w+;)/g,m={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(be){return m[be]};function a(Ce,be){if(be){if(h.test(Ce))return Ce.replace(f,g)}else if(T.test(Ce))return Ce.replace(p,g);return Ce}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(Ce){return Ce.replace(i,function(be,Ee){return Ee=Ee.toLowerCase(),Ee==="colon"?":":Ee.charAt(0)==="#"?Ee.charAt(1)==="x"?String.fromCharCode(parseInt(Ee.substring(2),16)):String.fromCharCode(+Ee.substring(1)):""})}var l=/(^|[^\[])\^/g;function C(Ce,be){Ce=Ce.source||Ce,be=be||"";var Ee={replace:function(oe,ce){return ce=ce.source||ce,ce=ce.replace(l,"$1"),Ce=Ce.replace(oe,ce),Ee},getRegex:function(){return new RegExp(Ce,be)}};return Ee}var v=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ce,be,Ee){if(Ce){var ne;try{ne=decodeURIComponent(s(Ee)).replace(v,"").toLowerCase()}catch(oe){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}be&&!y.test(Ee)&&(Ee=u(be,Ee));try{Ee=encodeURI(Ee).replace(/%25/g,"%")}catch(oe){return null}return Ee}var w={},x=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(Ce,be){w[" "+Ce]||(x.test(Ce)?w[" "+Ce]=Ce+"/":w[" "+Ce]=I(Ce,"/",!0)),Ce=w[" "+Ce];var Ee=Ce.indexOf(":")===-1;return be.substring(0,2)==="//"?Ee?be:Ce.replace(b,"$1")+be:be.charAt(0)==="/"?Ee?be:Ce.replace(d,"$1")+be:Ce+be}var A={exec:function(){}};function S(Ce){for(var be=1,Ee,ne;be=0&&Ne[ze]==="\\";)Re=!Re;return Re?"|":" |"}),ne=Ee.split(/ \|/),oe=0;if(ne.length>be)ne.splice(be);else for(;ne.length=ne.length?oe.slice(ne.length):oe}).join(` `)}var Se=function(){function Ce(Ee){this.options=Ee||M}var be=Ce.prototype;return be.space=function(ne){var oe=this.rules.block.newline.exec(ne);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:` `}},be.code=function(ne,oe){var ce=this.rules.block.code.exec(ne);if(ce){var ve=oe[oe.length-1];if(ve&&ve.type==="paragraph")return{raw:ce[0],text:ce[0].trimRight()};var Ne=ce[0].replace(/^ {4}/gm,"");return{type:"code",raw:ce[0],codeBlockStyle:"indented",text:this.options.pedantic?Ne:N(Ne,` `)}}},be.fences=function(ne){var oe=this.rules.block.fences.exec(ne);if(oe){var ce=oe[0],ve=Oe(ce,oe[3]||"");return{type:"code",raw:ce,lang:oe[2]?oe[2].trim():oe[2],text:ve}}},be.heading=function(ne){var oe=this.rules.block.heading.exec(ne);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},be.nptable=function(ne){var oe=this.rules.block.nptable.exec(ne);if(oe){var ce={type:"table",header:Y(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(` -`):[],raw:oe[0]};if(ce.header.length===ce.align.length){var ve=ce.align.length,Ne;for(Ne=0;Ne ?/gm,"");return{type:"blockquote",raw:oe[0],text:ce}}},be.list=function(ne){var oe=this.rules.block.list.exec(ne);if(oe){for(var ce=oe[0],ve=oe[2],Ne=ve.length>1,Re=ve[ve.length-1]===")",ze={type:"list",raw:ce,ordered:Ne,start:Ne?+ve.slice(0,-1):"",loose:!1,items:[]},it=oe[0].match(this.rules.block.item),ct=!1,ht,Lt,wt,ft,zt,Ft,Jt,Ht=it.length,kt=0;kt1||this.options.smartLists&&wt!==ve)&&(ft=it.slice(kt+1).join(` -`),ze.raw=ze.raw.substring(0,ze.raw.length-ft.length),kt=Ht-1)),zt=ct||/\n\n(?!\s*$)/.test(ht),kt!==Ht-1&&(ct=ht.charAt(ht.length-1)===` -`,zt||(zt=ct)),zt&&(ze.loose=!0),Ft=/^\[[ xX]\] /.test(ht),Jt=void 0,Ft&&(Jt=ht[1]!==" ",ht=ht.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:ce,task:Ft,checked:Jt,loose:zt,text:ht});return ze}},be.html=function(ne){var oe=this.rules.block.html.exec(ne);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):ee(oe[0]):oe[0]}},be.def=function(ne){var oe=this.rules.block.def.exec(ne);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var ce=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:oe[0],href:oe[2],title:oe[3]}}},be.table=function(ne){var oe=this.rules.block.table.exec(ne);if(oe){var ce={type:"table",header:Y(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(` +`):[],raw:oe[0]};if(ce.header.length===ce.align.length){var ve=ce.align.length,Ne;for(Ne=0;Ne ?/gm,"");return{type:"blockquote",raw:oe[0],text:ce}}},be.list=function(ne){var oe=this.rules.block.list.exec(ne);if(oe){for(var ce=oe[0],ve=oe[2],Ne=ve.length>1,Re=ve[ve.length-1]===")",ze={type:"list",raw:ce,ordered:Ne,start:Ne?+ve.slice(0,-1):"",loose:!1,items:[]},it=oe[0].match(this.rules.block.item),ct=!1,dt,Lt,wt,ft,zt,Ft,Jt,Ht=it.length,kt=0;kt1||this.options.smartLists&&wt!==ve)&&(ft=it.slice(kt+1).join(` +`),ze.raw=ze.raw.substring(0,ze.raw.length-ft.length),kt=Ht-1)),zt=ct||/\n\n(?!\s*$)/.test(dt),kt!==Ht-1&&(ct=dt.charAt(dt.length-1)===` +`,zt||(zt=ct)),zt&&(ze.loose=!0),Ft=/^\[[ xX]\] /.test(dt),Jt=void 0,Ft&&(Jt=dt[1]!==" ",dt=dt.replace(/^\[[ xX]\] +/,"")),ze.items.push({type:"list_item",raw:ce,task:Ft,checked:Jt,loose:zt,text:dt});return ze}},be.html=function(ne){var oe=this.rules.block.html.exec(ne);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):ee(oe[0]):oe[0]}},be.def=function(ne){var oe=this.rules.block.def.exec(ne);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var ce=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:ce,raw:oe[0],href:oe[2],title:oe[3]}}},be.table=function(ne){var oe=this.rules.block.table.exec(ne);if(oe){var ce={type:"table",header:Y(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(` `):[]};if(ce.header.length===ce.align.length){ce.raw=oe[0];var ve=ce.align.length,Ne;for(Ne=0;Ne/i.test(ve[0])&&(oe=!1),!ce&&/^<(pre|code|kbd|script)(\s|>)/i.test(ve[0])?ce=!0:ce&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ve[0])&&(ce=!1),{type:this.options.sanitize?"text":"html",raw:ve[0],inLink:oe,inRawBlock:ce,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):ee(ve[0]):ve[0]}},be.link=function(ne){var oe=this.rules.inline.link.exec(ne);if(oe){var ce=le(oe[2],"()");if(ce>-1){var ve=oe[0].indexOf("!")===0?5:4,Ne=ve+oe[1].length+ce;oe[2]=oe[2].substring(0,ce),oe[0]=oe[0].substring(0,Ne).trim(),oe[3]=""}var Re=oe[2],ze="";if(this.options.pedantic){var it=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Re);it?(Re=it[1],ze=it[3]):ze=""}else ze=oe[3]?oe[3].slice(1,-1):"";Re=Re.trim().replace(/^<([\s\S]*)>$/,"$1");var ct=fe(oe,{href:Re&&Re.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},oe[0]);return ct}},be.reflink=function(ne,oe){var ce;if((ce=this.rules.inline.reflink.exec(ne))||(ce=this.rules.inline.nolink.exec(ne))){var ve=(ce[2]||ce[1]).replace(/\s+/g," ");if(ve=oe[ve.toLowerCase()],!ve||!ve.href){var Ne=ce[0].charAt(0);return{type:"text",raw:Ne,text:Ne}}var Re=fe(ce,ve,ce[0]);return Re}},be.strong=function(ne,oe,ce){ce===void 0&&(ce="");var ve=this.rules.inline.strong.start.exec(ne);if(ve&&(!ve[1]||ve[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){oe=oe.slice(-1*ne.length);var Ne=ve[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ne.lastIndex=0;for(var Re;(ve=Ne.exec(oe))!=null;)if(Re=this.rules.inline.strong.middle.exec(oe.slice(0,ve.index+3)),Re)return{type:"strong",raw:ne.slice(0,Re[0].length),text:ne.slice(2,Re[0].length-2)}}},be.em=function(ne,oe,ce){ce===void 0&&(ce="");var ve=this.rules.inline.em.start.exec(ne);if(ve&&(!ve[1]||ve[1]&&(ce===""||this.rules.inline.punctuation.exec(ce)))){oe=oe.slice(-1*ne.length);var Ne=ve[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ne.lastIndex=0;for(var Re;(ve=Ne.exec(oe))!=null;)if(Re=this.rules.inline.em.middle.exec(oe.slice(0,ve.index+2)),Re)return{type:"em",raw:ne.slice(0,Re[0].length),text:ne.slice(1,Re[0].length-1)}}},be.codespan=function(ne){var oe=this.rules.inline.code.exec(ne);if(oe){var ce=oe[2].replace(/\n/g," "),ve=/[^ ]/.test(ce),Ne=ce.startsWith(" ")&&ce.endsWith(" ");return ve&&Ne&&(ce=ce.substring(1,ce.length-1)),ce=ee(ce,!0),{type:"codespan",raw:oe[0],text:ce}}},be.br=function(ne){var oe=this.rules.inline.br.exec(ne);if(oe)return{type:"br",raw:oe[0]}},be.del=function(ne){var oe=this.rules.inline.del.exec(ne);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},be.autolink=function(ne,oe){var ce=this.rules.inline.autolink.exec(ne);if(ce){var ve,Ne;return ce[2]==="@"?(ve=ee(this.options.mangle?oe(ce[1]):ce[1]),Ne="mailto:"+ve):(ve=ee(ce[1]),Ne=ve),{type:"link",raw:ce[0],text:ve,href:Ne,tokens:[{type:"text",raw:ve,text:ve}]}}},be.url=function(ne,oe){var ce;if(ce=this.rules.inline.url.exec(ne)){var ve,Ne;if(ce[2]==="@")ve=ee(this.options.mangle?oe(ce[0]):ce[0]),Ne="mailto:"+ve;else{var Re;do Re=ce[0],ce[0]=this.rules.inline._backpedal.exec(ce[0])[0];while(Re!==ce[0]);ve=ee(ce[0]),ce[1]==="www."?Ne="http://"+ve:Ne=ve}return{type:"link",raw:ce[0],text:ve,href:Ne,tokens:[{type:"text",raw:ve,text:ve}]}}},be.inlineText=function(ne,oe,ce){var ve=this.rules.inline.text.exec(ne);if(ve){var Ne;return oe?Ne=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):ee(ve[0]):ve[0]:Ne=ee(this.options.smartypants?ce(ve[0]):ve[0]),{type:"text",raw:ve[0],text:Ne}}},Ce}(),ke=z.noopTest,Le=z.edit,Ae=z.merge,ge={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ke,table:ke,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ge._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ge.def=Le(ge.def).replace("label",ge._label).replace("title",ge._title).getRegex(),ge.bullet=/(?:[*+-]|\d{1,9}[.)])/,ge.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ge.item=Le(ge.item,"gm").replace(/bull/g,ge.bullet).getRegex(),ge.list=Le(ge.list).replace(/bull/g,ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ge.def.source+")").getRegex(),ge._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",ge._comment=//,ge.html=Le(ge.html,"i").replace("comment",ge._comment).replace("tag",ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge.paragraph=Le(ge._paragraph).replace("hr",ge.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",")|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.blockquote=Le(ge.blockquote).replace("paragraph",ge.paragraph).getRegex(),ge.normal=Ae({},ge),ge.gfm=Ae({},ge.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*|$)"}),ge.gfm.nptable=Le(ge.gfm.nptable).replace("hr",ge.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",")|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.gfm.table=Le(ge.gfm.table).replace("hr",ge.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",")|<(?:script|pre|style|!--)").replace("tag",ge._tag).getRegex(),ge.pedantic=Ae({},ge.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ge._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ke,paragraph:Le(ge.normal._paragraph).replace("hr",ge.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var de={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ke,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:ke,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",de.punctuation=Le(de.punctuation).replace(/punctuation/g,de._punctuation).getRegex(),de._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",de._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",de.em.start=Le(de.em.start).replace(/punctuation/g,de._punctuation).getRegex(),de.em.middle=Le(de.em.middle).replace(/punctuation/g,de._punctuation).replace(/overlapSkip/g,de._overlapSkip).getRegex(),de.em.endAst=Le(de.em.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.em.endUnd=Le(de.em.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.start=Le(de.strong.start).replace(/punctuation/g,de._punctuation).getRegex(),de.strong.middle=Le(de.strong.middle).replace(/punctuation/g,de._punctuation).replace(/blockSkip/g,de._blockSkip).getRegex(),de.strong.endAst=Le(de.strong.endAst,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.strong.endUnd=Le(de.strong.endUnd,"g").replace(/punctuation/g,de._punctuation).getRegex(),de.blockSkip=Le(de._blockSkip,"g").getRegex(),de.overlapSkip=Le(de._overlapSkip,"g").getRegex(),de._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,de._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,de._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])?)+(?![-_])/,de.autolink=Le(de.autolink).replace("scheme",de._scheme).replace("email",de._email).getRegex(),de._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,de.tag=Le(de.tag).replace("comment",ge._comment).replace("attribute",de._attribute).getRegex(),de._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,de._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,de._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,de.link=Le(de.link).replace("label",de._label).replace("href",de._href).replace("title",de._title).getRegex(),de.reflink=Le(de.reflink).replace("label",de._label).getRegex(),de.reflinkSearch=Le(de.reflinkSearch,"g").replace("reflink",de.reflink).replace("nolink",de.nolink).getRegex(),de.normal=Ae({},de),de.pedantic=Ae({},de.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:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",de._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",de._label).getRegex()}),de.gfm=Ae({},de.normal,{escape:Le(de.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]*?(?:(?=[\\.5&&(ne="x"+ne.toString(16)),be+="&#"+ne+";";return be}var me=function(){function Ce(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||he,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:se.normal,inline:De.normal};this.options.pedantic?(ne.block=se.pedantic,ne.inline=De.pedantic):this.options.gfm&&(ne.block=se.gfm,this.options.breaks?ne.inline=De.breaks:ne.inline=De.gfm),this.tokenizer.rules=ne}Ce.lex=function(ne,oe){var ce=new Ce(oe);return ce.lex(ne)};var be=Ce.prototype;return be.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,` +]`).replace("lheading",ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ke,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:ke,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",he.punctuation=Le(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Le(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Le(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Le(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Le(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Le(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Le(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Le(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Le(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Le(he._blockSkip,"g").getRegex(),he.overlapSkip=Le(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._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])?)+(?![-_])/,he.autolink=Le(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Le(he.tag).replace("comment",ge._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Le(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Le(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Le(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=Ae({},he),he.pedantic=Ae({},he.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:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=Ae({},he.normal,{escape:Le(he.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]*?(?:(?=[\\.5&&(ne="x"+ne.toString(16)),be+="&#"+ne+";";return be}var me=function(){function Ce(Ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ee||de,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:se.normal,inline:De.normal};this.options.pedantic?(ne.block=se.pedantic,ne.inline=De.pedantic):this.options.gfm&&(ne.block=se.gfm,this.options.breaks?ne.inline=De.breaks:ne.inline=De.gfm),this.tokenizer.rules=ne}Ce.lex=function(ne,oe){var ce=new Ce(oe);return ce.lex(ne)};var be=Ce.prototype;return be.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},be.blockTokens=function(ne,oe,ce){oe===void 0&&(oe=[]),ce===void 0&&(ce=!0),ne=ne.replace(/^ +$/gm,"");for(var ve,Ne,Re,ze;ne;){if(ve=this.tokenizer.space(ne)){ne=ne.substring(ve.raw.length),ve.type&&oe.push(ve);continue}if(ve=this.tokenizer.code(ne,oe)){ne=ne.substring(ve.raw.length),ve.type?oe.push(ve):(ze=oe[oe.length-1],ze.raw+=` `+ve.raw,ze.text+=` `+ve.text);continue}if(ve=this.tokenizer.fences(ne)){ne=ne.substring(ve.raw.length),oe.push(ve);continue}if(ve=this.tokenizer.heading(ne)){ne=ne.substring(ve.raw.length),oe.push(ve);continue}if(ve=this.tokenizer.nptable(ne)){ne=ne.substring(ve.raw.length),oe.push(ve);continue}if(ve=this.tokenizer.hr(ne)){ne=ne.substring(ve.raw.length),oe.push(ve);continue}if(ve=this.tokenizer.blockquote(ne)){ne=ne.substring(ve.raw.length),ve.tokens=this.blockTokens(ve.text,[],ce),oe.push(ve);continue}if(ve=this.tokenizer.list(ne)){for(ne=ne.substring(ve.raw.length),Re=ve.items.length,Ne=0;Ne0)for(;(it=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)ct.includes(it[0].slice(it[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(it=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Re=this.tokenizer.escape(ne)){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(Re=this.tokenizer.tag(ne,ce,ve)){ne=ne.substring(Re.raw.length),ce=Re.inLink,ve=Re.inRawBlock,oe.push(Re);continue}if(Re=this.tokenizer.link(ne)){ne=ne.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,ve)),oe.push(Re);continue}if(Re=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,ve)),oe.push(Re);continue}if(Re=this.tokenizer.strong(ne,ze,Ne)){ne=ne.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],ce,ve),oe.push(Re);continue}if(Re=this.tokenizer.em(ne,ze,Ne)){ne=ne.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],ce,ve),oe.push(Re);continue}if(Re=this.tokenizer.codespan(ne)){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(Re=this.tokenizer.br(ne)){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(Re=this.tokenizer.del(ne)){ne=ne.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],ce,ve),oe.push(Re);continue}if(Re=this.tokenizer.autolink(ne,ae)){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(!ce&&(Re=this.tokenizer.url(ne,ae))){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(Re=this.tokenizer.inlineText(ne,ve,ie)){ne=ne.substring(Re.raw.length),Ne=Re.raw.slice(-1),oe.push(Re);continue}if(ne){var ht="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return oe},J(Ce,null,[{key:"rules",get:function(){return{block:se,inline:De}}}]),Ce}(),we=W.defaults,Me=z.cleanUrl,Fe=z.escape,Ue=function(){function Ce(Ee){this.options=Ee||we}var be=Ce.prototype;return be.code=function(ne,oe,ce){var ve=(oe||"").match(/\S*/)[0];if(this.options.highlight){var Ne=this.options.highlight(ne,ve);Ne!=null&&Ne!==ne&&(ce=!0,ne=Ne)}return ve?'
      '+(ce?ne:Fe(ne,!0))+`
      +`+ve.text);continue}if(ne){var it="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(it);break}else throw new Error(it)}}return oe},be.inline=function(ne){var oe,ce,ve,Ne,Re,ze,it=ne.length;for(oe=0;oe0)for(;(it=this.tokenizer.rules.inline.reflinkSearch.exec(ze))!=null;)ct.includes(it[0].slice(it[0].lastIndexOf("[")+1,-1))&&(ze=ze.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(it=this.tokenizer.rules.inline.blockSkip.exec(ze))!=null;)ze=ze.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+ze.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Re=this.tokenizer.escape(ne)){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(Re=this.tokenizer.tag(ne,ce,ve)){ne=ne.substring(Re.raw.length),ce=Re.inLink,ve=Re.inRawBlock,oe.push(Re);continue}if(Re=this.tokenizer.link(ne)){ne=ne.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,ve)),oe.push(Re);continue}if(Re=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Re.raw.length),Re.type==="link"&&(Re.tokens=this.inlineTokens(Re.text,[],!0,ve)),oe.push(Re);continue}if(Re=this.tokenizer.strong(ne,ze,Ne)){ne=ne.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],ce,ve),oe.push(Re);continue}if(Re=this.tokenizer.em(ne,ze,Ne)){ne=ne.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],ce,ve),oe.push(Re);continue}if(Re=this.tokenizer.codespan(ne)){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(Re=this.tokenizer.br(ne)){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(Re=this.tokenizer.del(ne)){ne=ne.substring(Re.raw.length),Re.tokens=this.inlineTokens(Re.text,[],ce,ve),oe.push(Re);continue}if(Re=this.tokenizer.autolink(ne,ae)){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(!ce&&(Re=this.tokenizer.url(ne,ae))){ne=ne.substring(Re.raw.length),oe.push(Re);continue}if(Re=this.tokenizer.inlineText(ne,ve,ie)){ne=ne.substring(Re.raw.length),Ne=Re.raw.slice(-1),oe.push(Re);continue}if(ne){var dt="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(dt);break}else throw new Error(dt)}}return oe},J(Ce,null,[{key:"rules",get:function(){return{block:se,inline:De}}}]),Ce}(),we=W.defaults,Me=z.cleanUrl,Fe=z.escape,Ue=function(){function Ce(Ee){this.options=Ee||we}var be=Ce.prototype;return be.code=function(ne,oe,ce){var ve=(oe||"").match(/\S*/)[0];if(this.options.highlight){var Ne=this.options.highlight(ne,ve);Ne!=null&&Ne!==ne&&(ce=!0,ne=Ne)}return ve?'
      '+(ce?ne:Fe(ne,!0))+`
      `:"
      "+(ce?ne:Fe(ne,!0))+`
      `},be.blockquote=function(ne){return`
      `+ne+`
      @@ -271,23 +271,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `},be.tablerow=function(ne){return` `+ne+` `},be.tablecell=function(ne,oe){var ce=oe.header?"th":"td",ve=oe.align?"<"+ce+' align="'+oe.align+'">':"<"+ce+">";return ve+ne+" -`},be.strong=function(ne){return""+ne+""},be.em=function(ne){return""+ne+""},be.codespan=function(ne){return""+ne+""},be.br=function(){return this.options.xhtml?"
      ":"
      "},be.del=function(ne){return""+ne+""},be.link=function(ne,oe,ce){if(ne=Me(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ce;var ve='",ve},be.image=function(ne,oe,ce){if(ne=Me(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ce;var ve=''+ce+'":">",ve},be.text=function(ne){return ne},Ce}(),Be=function(){function Ce(){}var be=Ce.prototype;return be.strong=function(ne){return ne},be.em=function(ne){return ne},be.codespan=function(ne){return ne},be.del=function(ne){return ne},be.html=function(ne){return ne},be.text=function(ne){return ne},be.link=function(ne,oe,ce){return""+ce},be.image=function(ne,oe,ce){return""+ce},be.br=function(){return""},Ce}(),et=function(){function Ce(){this.seen={}}var be=Ce.prototype;return be.slug=function(ne){var oe=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var ce=oe;do this.seen[ce]++,oe=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},Ce}(),Je=W.defaults,Ze=z.unescape,Ye=function(){function Ce(Ee){this.options=Ee||Je,this.options.renderer=this.options.renderer||new Ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new et}Ce.parse=function(ne,oe){var ce=new Ce(oe);return ce.parse(ne)};var be=Ce.prototype;return be.parse=function(ne,oe){oe===void 0&&(oe=!0);var ce="",ve,Ne,Re,ze,it,ct,ht,Lt,wt,ft,zt,Ft,Jt,Ht,kt,Ur,Zr,bt,Ct=ne.length;for(ve=0;ve0&&kt.tokens[0].type==="text"?(kt.tokens[0].text=bt+" "+kt.tokens[0].text,kt.tokens[0].tokens&&kt.tokens[0].tokens.length>0&&kt.tokens[0].tokens[0].type==="text"&&(kt.tokens[0].tokens[0].text=bt+" "+kt.tokens[0].tokens[0].text)):kt.tokens.unshift({type:"text",text:bt}):Ht+=bt),Ht+=this.parse(kt.tokens,Jt),wt+=this.renderer.listitem(Ht,Zr,Ur);ce+=this.renderer.list(wt,zt,Ft);continue}case"html":{ce+=this.renderer.html(ft.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(ft.tokens));continue}case"text":{for(wt=ft.tokens?this.parseInline(ft.tokens):ft.text;ve+1An error occurred:

      "+ot(Re.message+"",!0)+"
      ";throw Re}}je.options=je.setOptions=function(Ce){return dt(je.defaults,Ce),Qe(je.defaults),je},je.getDefaults=Ie,je.defaults=st,je.use=function(Ce){var be=dt({},Ce);if(Ce.renderer&&function(){var ne=je.defaults.renderer||new Ue,oe=function(Ne){var Re=ne[Ne];ne[Ne]=function(){for(var ze=arguments.length,it=new Array(ze),ct=0;ct`,triples:"",explode:"[]{}"},_=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(m,g,a){a&&a!=ue.Init&&(m.removeKeyMap(F),m.state.closeBrackets=null),g&&(P(X(g,"pairs")),m.state.closeBrackets=g,m.addKeyMap(F))});function X(m,g){return g=="pairs"&&typeof m=="string"?m:typeof m=="object"&&m[g]!=null?m[g]:J[g]}var F={Backspace:O,Enter:L};function P(m){for(var g=0;g=0;s--){var C=i[s].head;m.replaceRange("",_(C.line,C.ch-1),_(C.line,C.ch+1),"+delete")}}function L(m){var g=U(m),a=g&&X(g,"explode");if(!a||m.getOption("disableInput"))return ue.Pass;for(var i=m.listSelections(),s=0;s0;return{anchor:new _(m.anchor.line,m.anchor.ch+(g?-1:1)),head:new _(m.head.line,m.head.ch+(g?1:-1))}}function f(m,g){var a=U(m);if(!a||m.getOption("disableInput"))return ue.Pass;var i=X(a,"pairs"),s=i.indexOf(g);if(s==-1)return ue.Pass;for(var l=X(a,"closeBefore"),C=X(a,"triples"),v=i.charAt(s+1)==g,y=m.listSelections(),R=s%2==0,w,x=0;x=0&&m.getRange(h,_(h.line,h.ch+3))==g+g+g?u="skipThree":u="skip";else if(v&&h.ch>1&&C.indexOf(g)>=0&&m.getRange(_(h.line,h.ch-2),h)==g+g){if(h.ch>2&&/\bstring/.test(m.getTokenTypeAt(_(h.line,h.ch-2))))return ue.Pass;u="addFour"}else if(v){var S=h.ch==0?" ":m.getRange(_(h.line,h.ch-1),h);if(!ue.isWordChar(A)&&S!=g&&!ue.isWordChar(S))u="both";else return ue.Pass}else if(R&&(A.length===0||/\s/.test(A)||l.indexOf(A)>-1))u="both";else return ue.Pass;if(!w)w=u;else if(w!=u)return ue.Pass}var D=s%2?i.charAt(s-1):g,I=s%2?g:i.charAt(s+1);m.operation(function(){if(w=="skip")m.execCommand("goCharRight");else if(w=="skipThree")for(var B=0;B<3;B++)m.execCommand("goCharRight");else if(w=="surround"){for(var j=m.getSelections(),B=0;B0&&(le.percent=le.loaded/le.total*100),z.onProgress(le)});var N=new FormData;z.data&&Object.keys(z.data).forEach(function(ee){var le=z.data[ee];if(Array.isArray(le)){le.forEach(function(fe){N.append(ee+"[]",fe)});return}N.append(ee,z.data[ee])}),z.file instanceof Blob?N.append(z.filename,z.file,z.file.name):N.append(z.filename,z.file),M.onerror=function(le){z.onError(le)},M.onload=function(){return M.status<200||M.status>=300?z.onError(F(z,M),P(M)):z.onSuccess(P(M),M)},M.open(z.method,z.action,!0),z.withCredentials&&"withCredentials"in M&&(M.withCredentials=!0);var Y=z.headers||{};return Y["X-Requested-With"]!==null&&M.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(Y).forEach(function(ee){Y[ee]!==null&&M.setRequestHeader(ee,Y[ee])}),M.send(N),{abort:function(){M.abort()}}}var U=+new Date,O=0;function L(){return"rc-upload-"+U+"-"+ ++O}function d(z,M){return z.indexOf(M,z.length-M.length)!==-1}var f=function(z,M){if(z&&M){var N=Array.isArray(M)?M:M.split(","),Y=z.name||"",ee=z.type||"",le=ee.replace(/\/.*$/,"");return N.some(function(fe){var Oe=fe.trim();return Oe.charAt(0)==="."?d(Y.toLowerCase(),Oe.toLowerCase()):/\/\*$/.test(Oe)?le===Oe.replace(/\/.*$/,""):ee===Oe})}return!0};function T(z,M){var N=z.createReader(),Y=[];function ee(){N.readEntries(function(le){var fe=Array.prototype.slice.apply(le);Y=Y.concat(fe);var Oe=!fe.length;Oe?M(Y):ee()})}ee()}var p=function(M,N,Y){var ee=function le(fe,Oe){Oe=Oe||"",fe.isFile?fe.file(function(Se){Y(Se)&&(fe.fullPath&&!Se.webkitRelativePath&&(Object.defineProperties(Se,{webkitRelativePath:{writable:!0}}),Se.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(Se,{webkitRelativePath:{writable:!1}})),N([Se]))}):fe.isDirectory&&T(fe,function(Se){Se.forEach(function(ke){le(ke,""+Oe+fe.name+"/")})})};M.forEach(function(le){ee(le.webkitGetAsEntry())})},m=p,g=Object.assign||function(z){for(var M=1;M=0)continue;if(!Object.prototype.hasOwnProperty.call(z,Y))continue;N[Y]=z[Y]}return N}function C(z,M){if(!(z instanceof M))throw new TypeError("Cannot call a class as a function")}function v(z,M){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:z}function y(z,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);z.prototype=Object.create(M&&M.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(z,M):z.__proto__=M)}var R=function(M){return Object.keys(M).reduce(function(N,Y){return(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&(N[Y]=M[Y]),N},{})},w=function(z){y(M,z);function M(){var N,Y,ee,le;C(this,M);for(var fe=arguments.length,Oe=Array(fe),Se=0;Se=R?J:{done:!1,value:v[y++]}}}}O.fromArray=T;function p(v){return{next:function(){var y=v.next();return y.done?J:{done:!1,value:y.value}}}}O.fromNativeIterator=p;function m(v){return v?Array.isArray(v)?O.fromArray(v):v:O.empty()}O.from=m;function g(v,y){return{next:function(){var R=v.next();return R.done?J:{done:!1,value:y(R.value)}}}}O.map=g;function a(v,y){return{next:function(){for(;;){var R=v.next();if(R.done)return J;if(y(R.value))return{done:!1,value:R.value}}}}}O.filter=a;function i(v,y){for(var R=v.next();!R.done;R=v.next())y(R.value)}O.forEach=i;function s(v,y){y===void 0&&(y=Number.POSITIVE_INFINITY);var R=[];if(y===0)return R;for(var w=0,x=v.next();!x.done&&!(R.push(x.value),++w>=y);x=v.next());return R}O.collect=s;function l(){for(var v=[],y=0;y=v.length)return J;var w=v[R],x=w.next();return x.done?(R++,this.next()):x}}}O.concat=l;function C(v){return new X(v)}O.chain=C})(_||(_={}));var X=function(){function O(L){this.it=L}return O.prototype.next=function(){return this.it.next()},O}();function F(O){return Array.isArray(O)?_.fromArray(O):O||_.empty()}var P=function(){function O(L,d,f,T){d===void 0&&(d=0),f===void 0&&(f=L.length),T===void 0&&(T=d-1),this.items=L,this.start=d,this.end=f,this.index=T}return O.prototype.first=function(){return this.index=this.start,this.current()},O.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},O.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},O}(),W=function(O){ue(L,O);function L(d,f,T,p){return f===void 0&&(f=0),T===void 0&&(T=d.length),p===void 0&&(p=f-1),O.call(this,d,f,T,p)||this}return L.prototype.current=function(){return O.prototype.current.call(this)},L.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},L.prototype.first=function(){return this.index=this.start,this.current()},L.prototype.last=function(){return this.index=this.end-1,this.current()},L.prototype.parent=function(){return null},L}(P),U=function(){function O(L,d){this.iterator=L,this.fn=d}return O.prototype.next=function(){return this.fn(this.iterator.next())},O}()},LdHM:function(pt,Te,q){"use strict";q.d(Te,"b",function(){return l}),q.d(Te,"a",function(){return v});var ue=q("1OyB"),J=q("vuIU"),_=q("Ji7U"),X=q("LK+K"),F=q("q1tI"),P=q("rePB"),W=q("Ff2n"),U=q("ODXe"),O=q("4IlW"),L=q("bX4T"),d=q("YrtM"),f=q("TSYQ"),T=q.n(f),p=q("+nKL"),m=q("8OUc"),g=function(Y,ee){var le=Y.prefixCls,fe=Y.id,Oe=Y.flattenOptions,Se=Y.childrenAsData,ke=Y.values,Le=Y.searchValue,Ae=Y.multiple,ge=Y.defaultActiveFirstOption,de=Y.height,re=Y.itemHeight,he=Y.notFoundContent,se=Y.open,De=Y.menuItemSelectedIcon,ie=Y.virtual,ae=Y.onSelect,me=Y.onToggleOpen,we=Y.onActiveValue,Me=Y.onScroll,Fe=Y.onMouseEnter,Ue="".concat(le,"-item"),Be=Object(d.a)(function(){return Oe},[se,Oe],function(Xe,Ce){return Ce[0]&&Xe[1]!==Ce[1]}),et=F.useRef(null),Je=function(Ce){Ce.preventDefault()},Ze=function(Ce){et.current&&et.current.scrollTo({index:Ce})},Ye=function(Ce){for(var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ee=Be.length,ne=0;ne1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(N).map(function(ee,le){if(!F.isValidElement(ee)||!ee.type)return null;var fe=ee.type.isSelectOptGroup,Oe=ee.key,Se=ee.props,ke=Se.children,Le=Object(W.a)(Se,["children"]);return Y||!fe?w(ee):Object(y.a)(Object(y.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?le:Oe,"__"),label:Oe},Le),{},{options:x(ke)})}).filter(function(ee){return ee})}var b=q("2Qr1"),h=q("qNPg"),u=q("U8pU"),A=q("Kwbf"),S=q("WKfj");function D(N){var Y=N.mode,ee=N.options,le=N.children,fe=N.backfill,Oe=N.allowClear,Se=N.placeholder,ke=N.getInputElement,Le=N.showSearch,Ae=N.onSearch,ge=N.defaultOpen,de=N.autoFocus,re=N.labelInValue,he=N.value,se=N.inputValue,De=N.optionLabelProp,ie=Y==="multiple"||Y==="tags",ae=Le!==void 0?Le:ie||Y==="combobox",me=ee||x(le);if(Object(A.a)(Y!=="tags"||me.every(function(Ue){return!Ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var we=me.some(function(Ue){return Ue.options?Ue.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in Ue?Ue.value:Ue.key)=="number"});Object(A.a)(!we,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(A.a)(Y!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(A.a)(Y==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(A.a)(Y==="combobox"||!ke,"`getInputElement` only work with `combobox` mode."),Object(A.b)(Y!=="combobox"||!ke||!Oe||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ae&&!ae&&Y!=="combobox"&&Y!=="tags"&&Object(A.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(A.b)(!ge||de,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),he!=null){var Me=Object(S.d)(he);Object(A.a)(!re||Me.every(function(Ue){return Object(u.a)(Ue)==="object"&&("key"in Ue||"value"in Ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(A.a)(!ie||Array.isArray(he),"`value` should be array when `mode` is `multiple` or `tags`")}if(le){var Fe=null;Object(R.a)(le).some(function(Ue){if(!F.isValidElement(Ue)||!Ue.type)return!1;var Be=Ue.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var et=Object(R.a)(Ue.props.children).every(function(Je){return!F.isValidElement(Je)||!Ue.type||Je.type.isSelectOption?!0:(Fe=Je.type,!1)});return!et}return Fe=Be,!0}),Fe&&Object(A.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Fe.displayName||Fe.name||Fe,"`.")),Object(A.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=D,B=Object(h.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:x,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:I,fillOptionsWithMissingValue:b.a}),j=function(N){Object(_.a)(ee,N);var Y=Object(X.a)(ee);function ee(){var le;return Object(ue.a)(this,ee),le=Y.apply(this,arguments),le.selectRef=F.createRef(),le.focus=function(){le.selectRef.current.focus()},le.blur=function(){le.selectRef.current.blur()},le}return Object(J.a)(ee,[{key:"render",value:function(){return F.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(F.Component);j.Option=l,j.OptGroup=v;var z=j,M=Te.c=z},M8RZ:function(pt,Te,q){"use strict";q.d(Te,"a",function(){return O});var ue=q("fWQN"),J=q("mtLc"),_=q("yKVA"),X=q("879j"),F=q("q1tI"),P=q.n(F),W=q("i8i4"),U=q.n(W),O=function(L){Object(_.a)(f,L);var d=Object(X.a)(f);function f(T){var p;Object(ue.a)(this,f),p=d.call(this,T);var m=window.document;return p.node=m.createElement("div"),m.body.appendChild(p.node),p}return Object(J.a)(f,[{key:"render",value:function(){var p=this.props.children;return Object(W.createPortal)(p,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(P.a.Component)},MI8n:function(pt,Te,q){"use strict";q.d(Te,"b",function(){return P}),q.d(Te,"a",function(){return O}),q.d(Te,"e",function(){return L}),q.d(Te,"d",function(){return d}),q.d(Te,"c",function(){return f}),q.d(Te,"f",function(){return T});var ue=q("/cxE"),J=q("C/vA"),_=q("pmY6"),X=q("24hK"),F=function(){var p=function(m,g){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var s in i)i.hasOwnProperty(s)&&(a[s]=i[s])},p(m,g)};return function(m,g){p(m,g);function a(){this.constructor=m}m.prototype=g===null?Object.create(g):(a.prototype=g.prototype,new a)}}(),P;(function(p){p.None=function(){return _.a.None};function m(I){return function(B,j,z){j===void 0&&(j=null);var M=!1,N;return N=I(function(Y){return M?void 0:(N?N.dispose():M=!0,B.call(j,Y))},null,z),M&&N.dispose(),N}}p.once=m;function g(I,B){return v(function(j,z,M){return z===void 0&&(z=null),I(function(N){return j.call(z,B(N))},null,M)})}p.map=g;function a(I,B){return v(function(j,z,M){return z===void 0&&(z=null),I(function(N){B(N),j.call(z,N)},null,M)})}p.forEach=a;function i(I,B){return v(function(j,z,M){return z===void 0&&(z=null),I(function(N){return B(N)&&j.call(z,N)},null,M)})}p.filter=i;function s(I){return I}p.signal=s;function l(){for(var I=[],B=0;B1)&&fe.fire(Se),le=0},j)})},onLastListenerRemove:function(){N.dispose()}});return fe.event}p.debounce=y;function R(I){var B=new Date().getTime();return g(m(I),function(j){return new Date().getTime()-B})}p.stopwatch=R;function w(I){var B=!0,j;return i(I,function(z){var M=B||z!==j;return B=!1,j=z,M})}p.latch=w;function x(I,B,j){B===void 0&&(B=!1),j===void 0&&(j=[]);var z=j.slice(),M=I(function(ee){z?z.push(ee):Y.fire(ee)}),N=function(){z&&z.forEach(function(ee){return Y.fire(ee)}),z=null},Y=new O({onFirstListenerAdd:function(){M||(M=I(function(ee){return Y.fire(ee)}))},onFirstListenerDidAdd:function(){z&&(B?setTimeout(N):N())},onLastListenerRemove:function(){M&&M.dispose(),M=null}});return Y.event}p.buffer=x;var b=function(){function I(B){this.event=B}return I.prototype.map=function(B){return new I(g(this.event,B))},I.prototype.forEach=function(B){return new I(a(this.event,B))},I.prototype.filter=function(B){return new I(i(this.event,B))},I.prototype.reduce=function(B,j){return new I(C(this.event,B,j))},I.prototype.latch=function(){return new I(w(this.event))},I.prototype.debounce=function(B,j,z,M){return j===void 0&&(j=100),z===void 0&&(z=!1),new I(y(this.event,B,j,z,M))},I.prototype.on=function(B,j,z){return this.event(B,j,z)},I.prototype.once=function(B,j,z){return m(this.event)(B,j,z)},I}();function h(I){return new b(I)}p.chain=h;function u(I,B,j){j===void 0&&(j=function(ee){return ee});var z=function(){for(var ee=[],le=0;le"+ne+""},be.em=function(ne){return""+ne+""},be.codespan=function(ne){return""+ne+""},be.br=function(){return this.options.xhtml?"
      ":"
      "},be.del=function(ne){return""+ne+""},be.link=function(ne,oe,ce){if(ne=Me(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ce;var ve='
      ",ve},be.image=function(ne,oe,ce){if(ne=Me(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ce;var ve=''+ce+'":">",ve},be.text=function(ne){return ne},Ce}(),Be=function(){function Ce(){}var be=Ce.prototype;return be.strong=function(ne){return ne},be.em=function(ne){return ne},be.codespan=function(ne){return ne},be.del=function(ne){return ne},be.html=function(ne){return ne},be.text=function(ne){return ne},be.link=function(ne,oe,ce){return""+ce},be.image=function(ne,oe,ce){return""+ce},be.br=function(){return""},Ce}(),et=function(){function Ce(){this.seen={}}var be=Ce.prototype;return be.slug=function(ne){var oe=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var ce=oe;do this.seen[ce]++,oe=ce+"-"+this.seen[ce];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},Ce}(),Je=W.defaults,Ze=z.unescape,Ye=function(){function Ce(Ee){this.options=Ee||Je,this.options.renderer=this.options.renderer||new Ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new et}Ce.parse=function(ne,oe){var ce=new Ce(oe);return ce.parse(ne)};var be=Ce.prototype;return be.parse=function(ne,oe){oe===void 0&&(oe=!0);var ce="",ve,Ne,Re,ze,it,ct,dt,Lt,wt,ft,zt,Ft,Jt,Ht,kt,Ur,Zr,bt,Ct=ne.length;for(ve=0;ve0&&kt.tokens[0].type==="text"?(kt.tokens[0].text=bt+" "+kt.tokens[0].text,kt.tokens[0].tokens&&kt.tokens[0].tokens.length>0&&kt.tokens[0].tokens[0].type==="text"&&(kt.tokens[0].tokens[0].text=bt+" "+kt.tokens[0].tokens[0].text)):kt.tokens.unshift({type:"text",text:bt}):Ht+=bt),Ht+=this.parse(kt.tokens,Jt),wt+=this.renderer.listitem(Ht,Zr,Ur);ce+=this.renderer.list(wt,zt,Ft);continue}case"html":{ce+=this.renderer.html(ft.text);continue}case"paragraph":{ce+=this.renderer.paragraph(this.parseInline(ft.tokens));continue}case"text":{for(wt=ft.tokens?this.parseInline(ft.tokens):ft.text;ve+1An error occurred:

      "+ot(Re.message+"",!0)+"
      ";throw Re}}je.options=je.setOptions=function(Ce){return ht(je.defaults,Ce),Qe(je.defaults),je},je.getDefaults=Ie,je.defaults=st,je.use=function(Ce){var be=ht({},Ce);if(Ce.renderer&&function(){var ne=je.defaults.renderer||new Ue,oe=function(Ne){var Re=ne[Ne];ne[Ne]=function(){for(var ze=arguments.length,it=new Array(ze),ct=0;ct`,triples:"",explode:"[]{}"},_=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(m,g,a){a&&a!=ue.Init&&(m.removeKeyMap(F),m.state.closeBrackets=null),g&&(P(X(g,"pairs")),m.state.closeBrackets=g,m.addKeyMap(F))});function X(m,g){return g=="pairs"&&typeof m=="string"?m:typeof m=="object"&&m[g]!=null?m[g]:J[g]}var F={Backspace:O,Enter:L};function P(m){for(var g=0;g=0;s--){var C=i[s].head;m.replaceRange("",_(C.line,C.ch-1),_(C.line,C.ch+1),"+delete")}}function L(m){var g=U(m),a=g&&X(g,"explode");if(!a||m.getOption("disableInput"))return ue.Pass;for(var i=m.listSelections(),s=0;s0;return{anchor:new _(m.anchor.line,m.anchor.ch+(g?-1:1)),head:new _(m.head.line,m.head.ch+(g?1:-1))}}function f(m,g){var a=U(m);if(!a||m.getOption("disableInput"))return ue.Pass;var i=X(a,"pairs"),s=i.indexOf(g);if(s==-1)return ue.Pass;for(var l=X(a,"closeBefore"),C=X(a,"triples"),v=i.charAt(s+1)==g,y=m.listSelections(),R=s%2==0,w,x=0;x=0&&m.getRange(d,_(d.line,d.ch+3))==g+g+g?u="skipThree":u="skip";else if(v&&d.ch>1&&C.indexOf(g)>=0&&m.getRange(_(d.line,d.ch-2),d)==g+g){if(d.ch>2&&/\bstring/.test(m.getTokenTypeAt(_(d.line,d.ch-2))))return ue.Pass;u="addFour"}else if(v){var S=d.ch==0?" ":m.getRange(_(d.line,d.ch-1),d);if(!ue.isWordChar(A)&&S!=g&&!ue.isWordChar(S))u="both";else return ue.Pass}else if(R&&(A.length===0||/\s/.test(A)||l.indexOf(A)>-1))u="both";else return ue.Pass;if(!w)w=u;else if(w!=u)return ue.Pass}var D=s%2?i.charAt(s-1):g,I=s%2?g:i.charAt(s+1);m.operation(function(){if(w=="skip")m.execCommand("goCharRight");else if(w=="skipThree")for(var B=0;B<3;B++)m.execCommand("goCharRight");else if(w=="surround"){for(var j=m.getSelections(),B=0;B0&&(le.percent=le.loaded/le.total*100),z.onProgress(le)});var N=new FormData;z.data&&Object.keys(z.data).forEach(function(ee){var le=z.data[ee];if(Array.isArray(le)){le.forEach(function(fe){N.append(ee+"[]",fe)});return}N.append(ee,z.data[ee])}),z.file instanceof Blob?N.append(z.filename,z.file,z.file.name):N.append(z.filename,z.file),M.onerror=function(le){z.onError(le)},M.onload=function(){return M.status<200||M.status>=300?z.onError(F(z,M),P(M)):z.onSuccess(P(M),M)},M.open(z.method,z.action,!0),z.withCredentials&&"withCredentials"in M&&(M.withCredentials=!0);var Y=z.headers||{};return Y["X-Requested-With"]!==null&&M.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(Y).forEach(function(ee){Y[ee]!==null&&M.setRequestHeader(ee,Y[ee])}),M.send(N),{abort:function(){M.abort()}}}var U=+new Date,O=0;function L(){return"rc-upload-"+U+"-"+ ++O}function h(z,M){return z.indexOf(M,z.length-M.length)!==-1}var f=function(z,M){if(z&&M){var N=Array.isArray(M)?M:M.split(","),Y=z.name||"",ee=z.type||"",le=ee.replace(/\/.*$/,"");return N.some(function(fe){var Oe=fe.trim();return Oe.charAt(0)==="."?h(Y.toLowerCase(),Oe.toLowerCase()):/\/\*$/.test(Oe)?le===Oe.replace(/\/.*$/,""):ee===Oe})}return!0};function T(z,M){var N=z.createReader(),Y=[];function ee(){N.readEntries(function(le){var fe=Array.prototype.slice.apply(le);Y=Y.concat(fe);var Oe=!fe.length;Oe?M(Y):ee()})}ee()}var p=function(M,N,Y){var ee=function le(fe,Oe){Oe=Oe||"",fe.isFile?fe.file(function(Se){Y(Se)&&(fe.fullPath&&!Se.webkitRelativePath&&(Object.defineProperties(Se,{webkitRelativePath:{writable:!0}}),Se.webkitRelativePath=fe.fullPath.replace(/^\//,""),Object.defineProperties(Se,{webkitRelativePath:{writable:!1}})),N([Se]))}):fe.isDirectory&&T(fe,function(Se){Se.forEach(function(ke){le(ke,""+Oe+fe.name+"/")})})};M.forEach(function(le){ee(le.webkitGetAsEntry())})},m=p,g=Object.assign||function(z){for(var M=1;M=0)continue;if(!Object.prototype.hasOwnProperty.call(z,Y))continue;N[Y]=z[Y]}return N}function C(z,M){if(!(z instanceof M))throw new TypeError("Cannot call a class as a function")}function v(z,M){if(!z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:z}function y(z,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);z.prototype=Object.create(M&&M.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(z,M):z.__proto__=M)}var R=function(M){return Object.keys(M).reduce(function(N,Y){return(Y.substr(0,5)==="data-"||Y.substr(0,5)==="aria-"||Y==="role")&&(N[Y]=M[Y]),N},{})},w=function(z){y(M,z);function M(){var N,Y,ee,le;C(this,M);for(var fe=arguments.length,Oe=Array(fe),Se=0;Se=R?J:{done:!1,value:v[y++]}}}}O.fromArray=T;function p(v){return{next:function(){var y=v.next();return y.done?J:{done:!1,value:y.value}}}}O.fromNativeIterator=p;function m(v){return v?Array.isArray(v)?O.fromArray(v):v:O.empty()}O.from=m;function g(v,y){return{next:function(){var R=v.next();return R.done?J:{done:!1,value:y(R.value)}}}}O.map=g;function a(v,y){return{next:function(){for(;;){var R=v.next();if(R.done)return J;if(y(R.value))return{done:!1,value:R.value}}}}}O.filter=a;function i(v,y){for(var R=v.next();!R.done;R=v.next())y(R.value)}O.forEach=i;function s(v,y){y===void 0&&(y=Number.POSITIVE_INFINITY);var R=[];if(y===0)return R;for(var w=0,x=v.next();!x.done&&!(R.push(x.value),++w>=y);x=v.next());return R}O.collect=s;function l(){for(var v=[],y=0;y=v.length)return J;var w=v[R],x=w.next();return x.done?(R++,this.next()):x}}}O.concat=l;function C(v){return new X(v)}O.chain=C})(_||(_={}));var X=function(){function O(L){this.it=L}return O.prototype.next=function(){return this.it.next()},O}();function F(O){return Array.isArray(O)?_.fromArray(O):O||_.empty()}var P=function(){function O(L,h,f,T){h===void 0&&(h=0),f===void 0&&(f=L.length),T===void 0&&(T=h-1),this.items=L,this.start=h,this.end=f,this.index=T}return O.prototype.first=function(){return this.index=this.start,this.current()},O.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},O.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},O}(),W=function(O){ue(L,O);function L(h,f,T,p){return f===void 0&&(f=0),T===void 0&&(T=h.length),p===void 0&&(p=f-1),O.call(this,h,f,T,p)||this}return L.prototype.current=function(){return O.prototype.current.call(this)},L.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},L.prototype.first=function(){return this.index=this.start,this.current()},L.prototype.last=function(){return this.index=this.end-1,this.current()},L.prototype.parent=function(){return null},L}(P),U=function(){function O(L,h){this.iterator=L,this.fn=h}return O.prototype.next=function(){return this.fn(this.iterator.next())},O}()},LdHM:function(pt,Te,q){"use strict";q.d(Te,"b",function(){return l}),q.d(Te,"a",function(){return v});var ue=q("1OyB"),J=q("vuIU"),_=q("Ji7U"),X=q("LK+K"),F=q("q1tI"),P=q("rePB"),W=q("Ff2n"),U=q("ODXe"),O=q("4IlW"),L=q("bX4T"),h=q("YrtM"),f=q("TSYQ"),T=q.n(f),p=q("+nKL"),m=q("8OUc"),g=function(Y,ee){var le=Y.prefixCls,fe=Y.id,Oe=Y.flattenOptions,Se=Y.childrenAsData,ke=Y.values,Le=Y.searchValue,Ae=Y.multiple,ge=Y.defaultActiveFirstOption,he=Y.height,re=Y.itemHeight,de=Y.notFoundContent,se=Y.open,De=Y.menuItemSelectedIcon,ie=Y.virtual,ae=Y.onSelect,me=Y.onToggleOpen,we=Y.onActiveValue,Me=Y.onScroll,Fe=Y.onMouseEnter,Ue="".concat(le,"-item"),Be=Object(h.a)(function(){return Oe},[se,Oe],function(Xe,Ce){return Ce[0]&&Xe[1]!==Ce[1]}),et=F.useRef(null),Je=function(Ce){Ce.preventDefault()},Ze=function(Ce){et.current&&et.current.scrollTo({index:Ce})},Ye=function(Ce){for(var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ee=Be.length,ne=0;ne1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(N).map(function(ee,le){if(!F.isValidElement(ee)||!ee.type)return null;var fe=ee.type.isSelectOptGroup,Oe=ee.key,Se=ee.props,ke=Se.children,Le=Object(W.a)(Se,["children"]);return Y||!fe?w(ee):Object(y.a)(Object(y.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?le:Oe,"__"),label:Oe},Le),{},{options:x(ke)})}).filter(function(ee){return ee})}var b=q("2Qr1"),d=q("qNPg"),u=q("U8pU"),A=q("Kwbf"),S=q("WKfj");function D(N){var Y=N.mode,ee=N.options,le=N.children,fe=N.backfill,Oe=N.allowClear,Se=N.placeholder,ke=N.getInputElement,Le=N.showSearch,Ae=N.onSearch,ge=N.defaultOpen,he=N.autoFocus,re=N.labelInValue,de=N.value,se=N.inputValue,De=N.optionLabelProp,ie=Y==="multiple"||Y==="tags",ae=Le!==void 0?Le:ie||Y==="combobox",me=ee||x(le);if(Object(A.a)(Y!=="tags"||me.every(function(Ue){return!Ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var we=me.some(function(Ue){return Ue.options?Ue.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in Ue?Ue.value:Ue.key)=="number"});Object(A.a)(!we,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(A.a)(Y!=="combobox"||!De,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(A.a)(Y==="combobox"||!fe,"`backfill` only works with `combobox` mode."),Object(A.a)(Y==="combobox"||!ke,"`getInputElement` only work with `combobox` mode."),Object(A.b)(Y!=="combobox"||!ke||!Oe||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ae&&!ae&&Y!=="combobox"&&Y!=="tags"&&Object(A.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(A.b)(!ge||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),de!=null){var Me=Object(S.d)(de);Object(A.a)(!re||Me.every(function(Ue){return Object(u.a)(Ue)==="object"&&("key"in Ue||"value"in Ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(A.a)(!ie||Array.isArray(de),"`value` should be array when `mode` is `multiple` or `tags`")}if(le){var Fe=null;Object(R.a)(le).some(function(Ue){if(!F.isValidElement(Ue)||!Ue.type)return!1;var Be=Ue.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var et=Object(R.a)(Ue.props.children).every(function(Je){return!F.isValidElement(Je)||!Ue.type||Je.type.isSelectOption?!0:(Fe=Je.type,!1)});return!et}return Fe=Be,!0}),Fe&&Object(A.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Fe.displayName||Fe.name||Fe,"`.")),Object(A.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=D,B=Object(d.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:x,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:I,fillOptionsWithMissingValue:b.a}),j=function(N){Object(_.a)(ee,N);var Y=Object(X.a)(ee);function ee(){var le;return Object(ue.a)(this,ee),le=Y.apply(this,arguments),le.selectRef=F.createRef(),le.focus=function(){le.selectRef.current.focus()},le.blur=function(){le.selectRef.current.blur()},le}return Object(J.a)(ee,[{key:"render",value:function(){return F.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(F.Component);j.Option=l,j.OptGroup=v;var z=j,M=Te.c=z},M8RZ:function(pt,Te,q){"use strict";q.d(Te,"a",function(){return O});var ue=q("fWQN"),J=q("mtLc"),_=q("yKVA"),X=q("879j"),F=q("q1tI"),P=q.n(F),W=q("i8i4"),U=q.n(W),O=function(L){Object(_.a)(f,L);var h=Object(X.a)(f);function f(T){var p;Object(ue.a)(this,f),p=h.call(this,T);var m=window.document;return p.node=m.createElement("div"),m.body.appendChild(p.node),p}return Object(J.a)(f,[{key:"render",value:function(){var p=this.props.children;return Object(W.createPortal)(p,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(P.a.Component)},MI8n:function(pt,Te,q){"use strict";q.d(Te,"b",function(){return P}),q.d(Te,"a",function(){return O}),q.d(Te,"e",function(){return L}),q.d(Te,"d",function(){return h}),q.d(Te,"c",function(){return f}),q.d(Te,"f",function(){return T});var ue=q("/cxE"),J=q("C/vA"),_=q("pmY6"),X=q("24hK"),F=function(){var p=function(m,g){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var s in i)i.hasOwnProperty(s)&&(a[s]=i[s])},p(m,g)};return function(m,g){p(m,g);function a(){this.constructor=m}m.prototype=g===null?Object.create(g):(a.prototype=g.prototype,new a)}}(),P;(function(p){p.None=function(){return _.a.None};function m(I){return function(B,j,z){j===void 0&&(j=null);var M=!1,N;return N=I(function(Y){return M?void 0:(N?N.dispose():M=!0,B.call(j,Y))},null,z),M&&N.dispose(),N}}p.once=m;function g(I,B){return v(function(j,z,M){return z===void 0&&(z=null),I(function(N){return j.call(z,B(N))},null,M)})}p.map=g;function a(I,B){return v(function(j,z,M){return z===void 0&&(z=null),I(function(N){B(N),j.call(z,N)},null,M)})}p.forEach=a;function i(I,B){return v(function(j,z,M){return z===void 0&&(z=null),I(function(N){return B(N)&&j.call(z,N)},null,M)})}p.filter=i;function s(I){return I}p.signal=s;function l(){for(var I=[],B=0;B1)&&fe.fire(Se),le=0},j)})},onLastListenerRemove:function(){N.dispose()}});return fe.event}p.debounce=y;function R(I){var B=new Date().getTime();return g(m(I),function(j){return new Date().getTime()-B})}p.stopwatch=R;function w(I){var B=!0,j;return i(I,function(z){var M=B||z!==j;return B=!1,j=z,M})}p.latch=w;function x(I,B,j){B===void 0&&(B=!1),j===void 0&&(j=[]);var z=j.slice(),M=I(function(ee){z?z.push(ee):Y.fire(ee)}),N=function(){z&&z.forEach(function(ee){return Y.fire(ee)}),z=null},Y=new O({onFirstListenerAdd:function(){M||(M=I(function(ee){return Y.fire(ee)}))},onFirstListenerDidAdd:function(){z&&(B?setTimeout(N):N())},onLastListenerRemove:function(){M&&M.dispose(),M=null}});return Y.event}p.buffer=x;var b=function(){function I(B){this.event=B}return I.prototype.map=function(B){return new I(g(this.event,B))},I.prototype.forEach=function(B){return new I(a(this.event,B))},I.prototype.filter=function(B){return new I(i(this.event,B))},I.prototype.reduce=function(B,j){return new I(C(this.event,B,j))},I.prototype.latch=function(){return new I(w(this.event))},I.prototype.debounce=function(B,j,z,M){return j===void 0&&(j=100),z===void 0&&(z=!1),new I(y(this.event,B,j,z,M))},I.prototype.on=function(B,j,z){return this.event(B,j,z)},I.prototype.once=function(B,j,z){return m(this.event)(B,j,z)},I}();function d(I){return new b(I)}p.chain=d;function u(I,B,j){j===void 0&&(j=function(ee){return ee});var z=function(){for(var ee=[],le=0;le0?new U(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(p.prototype,"event",{get:function(){var m=this;return this._event||(this._event=function(g,a,i){m._listeners||(m._listeners=new X.a);var s=m._listeners.isEmpty();s&&m._options&&m._options.onFirstListenerAdd&&m._options.onFirstListenerAdd(m);var l=m._listeners.push(a?[g,a]:g);s&&m._options&&m._options.onFirstListenerDidAdd&&m._options.onFirstListenerDidAdd(m),m._options&&m._options.onListenerDidAdd&&m._options.onListenerDidAdd(m,g,a);var C;m._leakageMon&&(C=m._leakageMon.check(m._listeners.size));var v;return v={dispose:function(){if(C&&C(),v.dispose=p._noop,!m._disposed&&(l(),m._options&&m._options.onLastListenerRemove)){var y=m._listeners&&!m._listeners.isEmpty();y||m._options.onLastListenerRemove(m)}}},i instanceof _.b?i.add(v):Array.isArray(i)&&i.push(v),v}),this._event},enumerable:!0,configurable:!0}),p.prototype.fire=function(m){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new X.a);for(var g=this._listeners.iterator(),a=g.next();!a.done;a=g.next())this._deliveryQueue.push([a.value,m]);for(;this._deliveryQueue.size>0;){var i=this._deliveryQueue.shift(),s=i[0],l=i[1];try{typeof s=="function"?s.call(void 0,l):s[0].call(s[1],l)}catch(C){Object(ue.e)(C)}}}},p.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},p._noop=function(){},p}(),L=function(p){F(m,p);function m(g){var a=p.call(this,g)||this;return a._isPaused=0,a._eventQueue=new X.a,a._mergeFn=g&&g.merge,a}return m.prototype.pause=function(){this._isPaused++},m.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var g=this._eventQueue.toArray();this._eventQueue.clear(),p.prototype.fire.call(this,this._mergeFn(g))}else for(;!this._isPaused&&this._eventQueue.size!==0;)p.prototype.fire.call(this,this._eventQueue.shift())},m.prototype.fire=function(g){this._listeners&&(this._isPaused!==0?this._eventQueue.push(g):p.prototype.fire.call(this,g))},m}(O),d=function(){function p(){var m=this;this.hasListeners=!1,this.events=[],this.emitter=new O({onFirstListenerAdd:function(){return m.onFirstListenerAdd()},onLastListenerRemove:function(){return m.onLastListenerRemove()}})}return Object.defineProperty(p.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),p.prototype.add=function(m){var g=this,a={event:m,listener:null};this.events.push(a),this.hasListeners&&this.hook(a);var i=function(){g.hasListeners&&g.unhook(a);var s=g.events.indexOf(a);g.events.splice(s,1)};return Object(_.h)(Object(J.a)(i))},p.prototype.onFirstListenerAdd=function(){var m=this;this.hasListeners=!0,this.events.forEach(function(g){return m.hook(g)})},p.prototype.onLastListenerRemove=function(){var m=this;this.hasListeners=!1,this.events.forEach(function(g){return m.unhook(g)})},p.prototype.hook=function(m){var g=this;m.listener=m.event(function(a){return g.emitter.fire(a)})},p.prototype.unhook=function(m){m.listener&&m.listener.dispose(),m.listener=null},p.prototype.dispose=function(){this.emitter.dispose()},p}(),f=function(){function p(){this.buffers=[]}return p.prototype.wrapEvent=function(m){var g=this;return function(a,i,s){return m(function(l){var C=g.buffers[g.buffers.length-1];C?C.push(function(){return a.call(i,l)}):a.call(i,l)},void 0,s)}},p.prototype.bufferEvents=function(m){var g=[];this.buffers.push(g);var a=m();return this.buffers.pop(),g.forEach(function(i){return i()}),a},p}(),T=function(){function p(){var m=this;this.listening=!1,this.inputEvent=P.None,this.inputEventListener=_.a.None,this.emitter=new O({onFirstListenerDidAdd:function(){m.listening=!0,m.inputEventListener=m.inputEvent(m.emitter.fire,m.emitter)},onLastListenerRemove:function(){m.listening=!1,m.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(p.prototype,"input",{set:function(m){this.inputEvent=m,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=m(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),p.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},p}()},N0LK:function(pt,Te,q){"use strict";q.d(Te,"x",function(){return ue}),q.d(Te,"F",function(){return J}),q.d(Te,"r",function(){return X}),q.d(Te,"o",function(){return F}),q.d(Te,"p",function(){return P}),q.d(Te,"Q",function(){return W}),q.d(Te,"K",function(){return O}),q.d(Te,"k",function(){return L}),q.d(Te,"N",function(){return d}),q.d(Te,"m",function(){return f}),q.d(Te,"l",function(){return T}),q.d(Te,"I",function(){return p}),q.d(Te,"H",function(){return m}),q.d(Te,"q",function(){return g}),q.d(Te,"t",function(){return a}),q.d(Te,"D",function(){return i}),q.d(Te,"e",function(){return s}),q.d(Te,"f",function(){return l}),q.d(Te,"B",function(){return C}),q.d(Te,"C",function(){return v}),q.d(Te,"n",function(){return R}),q.d(Te,"O",function(){return x}),q.d(Te,"c",function(){return b}),q.d(Te,"d",function(){return h}),q.d(Te,"z",function(){return u}),q.d(Te,"A",function(){return A}),q.d(Te,"u",function(){return S}),q.d(Te,"E",function(){return I}),q.d(Te,"G",function(){return B}),q.d(Te,"i",function(){return z}),q.d(Te,"g",function(){return N}),q.d(Te,"v",function(){return ee}),q.d(Te,"h",function(){return le}),q.d(Te,"y",function(){return fe}),q.d(Te,"w",function(){return Oe}),q.d(Te,"a",function(){return Se}),q.d(Te,"P",function(){return ke}),q.d(Te,"L",function(){return Le}),q.d(Te,"J",function(){return Ae}),q.d(Te,"j",function(){return ge}),q.d(Te,"M",function(){return de}),q.d(Te,"s",function(){return re}),q.d(Te,"b",function(){return he});function ue(ie){return!ie||typeof ie!="string"?!0:ie.trim().length===0}function J(ie,ae,me){me===void 0&&(me="0");for(var we=""+ie,Me=[we],Fe=we.length;Fe=ae.length?we:ae[Fe]})}function F(ie){return ie.replace(/[<>&]/g,function(ae){switch(ae){case"<":return"<";case">":return">";case"&":return"&";default:return ae}})}function P(ie){return ie.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function W(ie,ae){ae===void 0&&(ae=" ");var me=U(ie,ae);return O(me,ae)}function U(ie,ae){if(!ie||!ae)return ie;var me=ae.length;if(me===0||ie.length===0)return ie;for(var we=0;ie.indexOf(ae,we)===we;)we=we+me;return ie.substring(we)}function O(ie,ae){if(!ie||!ae)return ie;var me=ae.length,we=ie.length;if(me===0||we===0)return ie;for(var Me=we,Fe=-1;!(Fe=ie.lastIndexOf(ae,Me-1),Fe===-1||Fe+me!==Me);){if(Fe===0)return"";Me=Fe}return ie.substring(0,Me)}function L(ie){return ie.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function d(ie,ae){if(ie.length0?ie.indexOf(ae,me)===me:me===0?ie===ae:!1}function T(ie,ae,me){if(me===void 0&&(me={}),!ie)throw new Error("Cannot create regex from empty string");ae||(ie=P(ie)),me.wholeWord&&(/\B/.test(ie.charAt(0))||(ie="\\b"+ie),/\B/.test(ie.charAt(ie.length-1))||(ie=ie+"\\b"));var we="";return me.global&&(we+="g"),me.matchCase||(we+="i"),me.multiline&&(we+="m"),me.unicode&&(we+="u"),new RegExp(ie,we)}function p(ie){if(ie.source==="^"||ie.source==="^$"||ie.source==="$"||ie.source==="^\\s*$")return!1;var ae=ie.exec("");return!!(ae&&ie.lastIndex===0)}function m(ie){return(ie.global?"g":"")+(ie.ignoreCase?"i":"")+(ie.multiline?"m":"")+(ie.unicode?"u":"")}function g(ie){for(var ae=0,me=ie.length;ae=0;me--){var we=ie.charCodeAt(me);if(we!==32&&we!==9)return me}return-1}function s(ie,ae){return ieae?1:0}function l(ie,ae){for(var me=Math.min(ie.length,ae.length),we=0;weae.length?1:0}function C(ie){return ie>=97&&ie<=122}function v(ie){return ie>=65&&ie<=90}function y(ie){return C(ie)||v(ie)}function R(ie,ae){return ie.length===ae.length&&w(ie,ae)}function w(ie,ae,me){me===void 0&&(me=ie.length);for(var we=0;weie.length?!1:w(ie,ae,me)}function b(ie,ae){var me,we=Math.min(ie.length,ae.length);for(me=0;me1){var we=ie.charCodeAt(ae-2);if(u(we))return(we-55296<<10)+(me-56320)+65536}return me}function I(ie,ae){var me=se.getInstance(),we=ae,Me=ie.length,Fe=S(ie,Me,ae);ae+=Fe>=65536?2:1;for(var Ue=me.getGraphemeBreakType(Fe);ae=65536?2:1,Ue=et}return ae-we}function B(ie,ae){var me=se.getInstance(),we=ae,Me=D(ie,ae);ae-=Me>=65536?2:1;for(var Fe=me.getGraphemeBreakType(Me);ae>0;){var Ue=D(ie,ae),Be=me.getGraphemeBreakType(Ue);if(he(Be,Fe))break;ae-=Ue>=65536?2:1,Fe=Be}return we-ae}var j=/(?:[\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 z(ie){return j.test(ie)}var M=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function N(ie){return M.test(ie)}var Y=/^[\t\n\r\x20-\x7E]*$/;function ee(ie){return Y.test(ie)}function le(ie){for(var ae=0,me=ie.length;ae=11904&&ie<=55215||ie>=63744&&ie<=64255||ie>=65281&&ie<=65374}function Oe(ie){return ie>=127462&&ie<=127487||ie>=9728&&ie<=10175||ie>=127744&&ie<=128591||ie>=128640&&ie<=128764||ie>=128992&&ie<=129003||ie>=129280&&ie<=129535||ie>=129648&&ie<=129651||ie>=129656&&ie<=129666||ie>=129680&&ie<=129685}var Se=String.fromCharCode(65279);function ke(ie){return!!(ie&&ie.length>0&&ie.charCodeAt(0)===65279)}function Le(ie){return btoa(encodeURIComponent(ie))}function Ae(ie,ae){for(var me="",we=0;weme[3*Me+1])Me=2*Me+1;else return me[3*Me+2];return 0},ie._INSTANCE=null,ie}();function De(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},Ot1p:function(pt,Te,q){"use strict";var ue=q("2qtc"),J=q("kLXV"),_=q("rAM+"),X=q("miYZ"),F=q("tsqr"),P=q("9og8"),W=q("tJVT"),U=q("jrin"),O=q("WmNS"),L=q.n(O),d=q("q1tI"),f=q.n(d),T=q("VrN/"),p=q.n(T),m=q("bdgK"),g=q("p77/"),a=q("Bd2K"),i=q("ELLl"),s=q("19Vz"),l=q("lZu9"),C=q("+NIl"),v=q("kSUc"),y=q("9Bee"),R=function(Re){var ze=Re.value,it=ze===void 0?"":ze,ct=Re.className,ht=Re.showTextOnly,Lt=Re.showLines,wt=Re.style,ft=wt===void 0?{}:wt,zt=Object(d.useMemo)(function(){return""},[it]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:zt}}))},w=q("0Owb"),x=q("dejd"),b=q("C+DQ"),h=q("1vsH"),u=q("m3rI"),A=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function S(Re){var ze=Re.onActionCallback,it=Re.title,ct=Re.icon,ht=Re.actionName,Lt=Re.className,wt=Lt===void 0?"":Lt,ft=Re.children;function zt(){ze(ht)}return f.a.createElement("a",{title:it,className:wt,onClick:zt},f.a.createElement("i",{className:"md-iconfont ".concat(ct)}),ft)}var D=function(Re){var ze=Re.watch,it=Re.showNullButton,ct=Re.onActionCallback,ht=Re.fullScreen,Lt=Re.insertTemp,wt=Re.hidetoolBar,ft=Re.uuid,zt=Re.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.D)("_educoder_session"),"&key=").concat(ft,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var Ft=[].concat(A,[{title:"".concat(ze?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ze?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Ft.map(function(Jt,Ht){return f.a.createElement("li",{key:Ht},Jt.actionName?f.a.createElement(S,Object(w.a)({},Jt,{onActionCallback:ct})):f.a.createElement("span",{className:"v-line"}))}),it?f.a.createElement("li",null,f.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ct},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Lt&&f.a.createElement("li",null,f.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Lt),onActionCallback:ct},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(S,{icon:"".concat(ht?"icon-shrink":"icon-enlarge"),title:ht?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ct})))},I=q("M8RZ"),B=q("+L6B"),j=q("2/Rp"),z=q("y8nQ"),M=q("Vl3Y"),N=q("5NDa"),Y=q("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},le=function(Re){var ze=Re.callback,it=Re.onCancel;function ct(ht){ze(ht)}return f.a.createElement(M.a,Object(w.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ct}),f.a.createElement(M.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(Y.a,null)),f.a.createElement(M.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(Y.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(j.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},fe=q("7ahc"),Oe=q("k1fw"),Se=q("HmJG"),ke=q("BjJ7"),Le=M.a.useForm,Ae={width:280,marginRight:10},ge={labelCol:{span:5},wrapperCol:{span:19}},de=function(Re){var ze=Re.callback,it=Re.onCancel,ct=Le(),ht=Object(W.a)(ct,1),Lt=ht[0],wt=Object(d.useRef)();function ft(Jt){ze(Object(Oe.a)(Object(Oe.a)({},Jt),{},{name:wt.current}))}function zt(Jt,Ht){Lt.setFieldsValue({src:"/api/attachments/".concat(Jt.id,"?type=").concat(Jt.content_type),type:Ht.type})}function Ft(Jt){var Ht=Jt.target.files[0];wt.current=Ht.name,he(Ht,zt)}return f.a.createElement(M.a,Object(w.a)({form:Lt},ge,{className:"upload-image-panel",onFinish:ft}),f.a.createElement(M.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(M.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},f.a.createElement(Y.a,{style:Ae})),f.a.createElement(re,{onFileChange:Ft}))),f.a.createElement(M.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},f.a.createElement(Y.a,{style:{width:264}})),f.a.createElement(M.a.Item,{style:{textAlign:"right"}},f.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(j.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))};function re(Re){var ze=Re.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:ze}))}function he(Re,ze){if(!Re)throw new String("\u6CA1\u6709\u6587\u4EF6");var it=new FormData;it.append("editormd-image-file",Re),it.append("file_param_name","editormd-image-file"),it.append("byxhr","true");var ct=new window.XMLHttpRequest;ct.withCredentials=!0,ct.addEventListener("load",function(ht){ze(JSON.parse(ht.target.responseText),Re)},!1),ct.addEventListener("error",function(ht){console.error(ht)},!1),ct.open("POST","".concat(ke.a,"/api/attachments.json")),ct.send(it)}var se=q("giR+"),De=q("fyUT"),ie=q("7Kak"),ae=q("9yH6"),me=ae.a.Group,we={margin:"0 8px"},Me=function(Re){var ze=Re.callback,it=Re.onCancel;function ct(ht){ze(ht)}return f.a.createElement(M.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ct},f.a.createElement("div",{className:"flex-container"},f.a.createElement("span",{style:we},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:we},"\u884C\u6570"),f.a.createElement(M.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(De.a,null)),f.a.createElement("span",{style:we},"\u5217\u6570"),f.a.createElement(M.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(De.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12}},f.a.createElement("span",{style:we},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(M.a.Item,{name:"align"},f.a.createElement(me,null,f.a.createElement(ae.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(ae.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(ae.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(ae.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(j.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},Fe=q("ErOA"),Ue=q("7Cbv"),Be="link",et="upload-image",Je="code-block",Ze="add-table",Ye="------------",dt={default:Ye,left:":".concat(Ye),center:":".concat(Ye,":"),right:"".concat(Ye,":")},qe=q("9VGf"),ot,Ie;function Qe(){}var st=0,je=1e4,Xe="\u2581",Ce=` +`),s=this._stacks.get(i)||0;if(this._stacks.set(i,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;var l,C=0;this._stacks.forEach(function(v,y){(!l||C0?new U(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(p.prototype,"event",{get:function(){var m=this;return this._event||(this._event=function(g,a,i){m._listeners||(m._listeners=new X.a);var s=m._listeners.isEmpty();s&&m._options&&m._options.onFirstListenerAdd&&m._options.onFirstListenerAdd(m);var l=m._listeners.push(a?[g,a]:g);s&&m._options&&m._options.onFirstListenerDidAdd&&m._options.onFirstListenerDidAdd(m),m._options&&m._options.onListenerDidAdd&&m._options.onListenerDidAdd(m,g,a);var C;m._leakageMon&&(C=m._leakageMon.check(m._listeners.size));var v;return v={dispose:function(){if(C&&C(),v.dispose=p._noop,!m._disposed&&(l(),m._options&&m._options.onLastListenerRemove)){var y=m._listeners&&!m._listeners.isEmpty();y||m._options.onLastListenerRemove(m)}}},i instanceof _.b?i.add(v):Array.isArray(i)&&i.push(v),v}),this._event},enumerable:!0,configurable:!0}),p.prototype.fire=function(m){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new X.a);for(var g=this._listeners.iterator(),a=g.next();!a.done;a=g.next())this._deliveryQueue.push([a.value,m]);for(;this._deliveryQueue.size>0;){var i=this._deliveryQueue.shift(),s=i[0],l=i[1];try{typeof s=="function"?s.call(void 0,l):s[0].call(s[1],l)}catch(C){Object(ue.e)(C)}}}},p.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},p._noop=function(){},p}(),L=function(p){F(m,p);function m(g){var a=p.call(this,g)||this;return a._isPaused=0,a._eventQueue=new X.a,a._mergeFn=g&&g.merge,a}return m.prototype.pause=function(){this._isPaused++},m.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var g=this._eventQueue.toArray();this._eventQueue.clear(),p.prototype.fire.call(this,this._mergeFn(g))}else for(;!this._isPaused&&this._eventQueue.size!==0;)p.prototype.fire.call(this,this._eventQueue.shift())},m.prototype.fire=function(g){this._listeners&&(this._isPaused!==0?this._eventQueue.push(g):p.prototype.fire.call(this,g))},m}(O),h=function(){function p(){var m=this;this.hasListeners=!1,this.events=[],this.emitter=new O({onFirstListenerAdd:function(){return m.onFirstListenerAdd()},onLastListenerRemove:function(){return m.onLastListenerRemove()}})}return Object.defineProperty(p.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),p.prototype.add=function(m){var g=this,a={event:m,listener:null};this.events.push(a),this.hasListeners&&this.hook(a);var i=function(){g.hasListeners&&g.unhook(a);var s=g.events.indexOf(a);g.events.splice(s,1)};return Object(_.h)(Object(J.a)(i))},p.prototype.onFirstListenerAdd=function(){var m=this;this.hasListeners=!0,this.events.forEach(function(g){return m.hook(g)})},p.prototype.onLastListenerRemove=function(){var m=this;this.hasListeners=!1,this.events.forEach(function(g){return m.unhook(g)})},p.prototype.hook=function(m){var g=this;m.listener=m.event(function(a){return g.emitter.fire(a)})},p.prototype.unhook=function(m){m.listener&&m.listener.dispose(),m.listener=null},p.prototype.dispose=function(){this.emitter.dispose()},p}(),f=function(){function p(){this.buffers=[]}return p.prototype.wrapEvent=function(m){var g=this;return function(a,i,s){return m(function(l){var C=g.buffers[g.buffers.length-1];C?C.push(function(){return a.call(i,l)}):a.call(i,l)},void 0,s)}},p.prototype.bufferEvents=function(m){var g=[];this.buffers.push(g);var a=m();return this.buffers.pop(),g.forEach(function(i){return i()}),a},p}(),T=function(){function p(){var m=this;this.listening=!1,this.inputEvent=P.None,this.inputEventListener=_.a.None,this.emitter=new O({onFirstListenerDidAdd:function(){m.listening=!0,m.inputEventListener=m.inputEvent(m.emitter.fire,m.emitter)},onLastListenerRemove:function(){m.listening=!1,m.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(p.prototype,"input",{set:function(m){this.inputEvent=m,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=m(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),p.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},p}()},N0LK:function(pt,Te,q){"use strict";q.d(Te,"x",function(){return ue}),q.d(Te,"F",function(){return J}),q.d(Te,"r",function(){return X}),q.d(Te,"o",function(){return F}),q.d(Te,"p",function(){return P}),q.d(Te,"Q",function(){return W}),q.d(Te,"K",function(){return O}),q.d(Te,"k",function(){return L}),q.d(Te,"N",function(){return h}),q.d(Te,"m",function(){return f}),q.d(Te,"l",function(){return T}),q.d(Te,"I",function(){return p}),q.d(Te,"H",function(){return m}),q.d(Te,"q",function(){return g}),q.d(Te,"t",function(){return a}),q.d(Te,"D",function(){return i}),q.d(Te,"e",function(){return s}),q.d(Te,"f",function(){return l}),q.d(Te,"B",function(){return C}),q.d(Te,"C",function(){return v}),q.d(Te,"n",function(){return R}),q.d(Te,"O",function(){return x}),q.d(Te,"c",function(){return b}),q.d(Te,"d",function(){return d}),q.d(Te,"z",function(){return u}),q.d(Te,"A",function(){return A}),q.d(Te,"u",function(){return S}),q.d(Te,"E",function(){return I}),q.d(Te,"G",function(){return B}),q.d(Te,"i",function(){return z}),q.d(Te,"g",function(){return N}),q.d(Te,"v",function(){return ee}),q.d(Te,"h",function(){return le}),q.d(Te,"y",function(){return fe}),q.d(Te,"w",function(){return Oe}),q.d(Te,"a",function(){return Se}),q.d(Te,"P",function(){return ke}),q.d(Te,"L",function(){return Le}),q.d(Te,"J",function(){return Ae}),q.d(Te,"j",function(){return ge}),q.d(Te,"M",function(){return he}),q.d(Te,"s",function(){return re}),q.d(Te,"b",function(){return de});function ue(ie){return!ie||typeof ie!="string"?!0:ie.trim().length===0}function J(ie,ae,me){me===void 0&&(me="0");for(var we=""+ie,Me=[we],Fe=we.length;Fe=ae.length?we:ae[Fe]})}function F(ie){return ie.replace(/[<>&]/g,function(ae){switch(ae){case"<":return"<";case">":return">";case"&":return"&";default:return ae}})}function P(ie){return ie.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function W(ie,ae){ae===void 0&&(ae=" ");var me=U(ie,ae);return O(me,ae)}function U(ie,ae){if(!ie||!ae)return ie;var me=ae.length;if(me===0||ie.length===0)return ie;for(var we=0;ie.indexOf(ae,we)===we;)we=we+me;return ie.substring(we)}function O(ie,ae){if(!ie||!ae)return ie;var me=ae.length,we=ie.length;if(me===0||we===0)return ie;for(var Me=we,Fe=-1;!(Fe=ie.lastIndexOf(ae,Me-1),Fe===-1||Fe+me!==Me);){if(Fe===0)return"";Me=Fe}return ie.substring(0,Me)}function L(ie){return ie.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function h(ie,ae){if(ie.length0?ie.indexOf(ae,me)===me:me===0?ie===ae:!1}function T(ie,ae,me){if(me===void 0&&(me={}),!ie)throw new Error("Cannot create regex from empty string");ae||(ie=P(ie)),me.wholeWord&&(/\B/.test(ie.charAt(0))||(ie="\\b"+ie),/\B/.test(ie.charAt(ie.length-1))||(ie=ie+"\\b"));var we="";return me.global&&(we+="g"),me.matchCase||(we+="i"),me.multiline&&(we+="m"),me.unicode&&(we+="u"),new RegExp(ie,we)}function p(ie){if(ie.source==="^"||ie.source==="^$"||ie.source==="$"||ie.source==="^\\s*$")return!1;var ae=ie.exec("");return!!(ae&&ie.lastIndex===0)}function m(ie){return(ie.global?"g":"")+(ie.ignoreCase?"i":"")+(ie.multiline?"m":"")+(ie.unicode?"u":"")}function g(ie){for(var ae=0,me=ie.length;ae=0;me--){var we=ie.charCodeAt(me);if(we!==32&&we!==9)return me}return-1}function s(ie,ae){return ieae?1:0}function l(ie,ae){for(var me=Math.min(ie.length,ae.length),we=0;weae.length?1:0}function C(ie){return ie>=97&&ie<=122}function v(ie){return ie>=65&&ie<=90}function y(ie){return C(ie)||v(ie)}function R(ie,ae){return ie.length===ae.length&&w(ie,ae)}function w(ie,ae,me){me===void 0&&(me=ie.length);for(var we=0;weie.length?!1:w(ie,ae,me)}function b(ie,ae){var me,we=Math.min(ie.length,ae.length);for(me=0;me1){var we=ie.charCodeAt(ae-2);if(u(we))return(we-55296<<10)+(me-56320)+65536}return me}function I(ie,ae){var me=se.getInstance(),we=ae,Me=ie.length,Fe=S(ie,Me,ae);ae+=Fe>=65536?2:1;for(var Ue=me.getGraphemeBreakType(Fe);ae=65536?2:1,Ue=et}return ae-we}function B(ie,ae){var me=se.getInstance(),we=ae,Me=D(ie,ae);ae-=Me>=65536?2:1;for(var Fe=me.getGraphemeBreakType(Me);ae>0;){var Ue=D(ie,ae),Be=me.getGraphemeBreakType(Ue);if(de(Be,Fe))break;ae-=Ue>=65536?2:1,Fe=Be}return we-ae}var j=/(?:[\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 z(ie){return j.test(ie)}var M=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function N(ie){return M.test(ie)}var Y=/^[\t\n\r\x20-\x7E]*$/;function ee(ie){return Y.test(ie)}function le(ie){for(var ae=0,me=ie.length;ae=11904&&ie<=55215||ie>=63744&&ie<=64255||ie>=65281&&ie<=65374}function Oe(ie){return ie>=127462&&ie<=127487||ie>=9728&&ie<=10175||ie>=127744&&ie<=128591||ie>=128640&&ie<=128764||ie>=128992&&ie<=129003||ie>=129280&&ie<=129535||ie>=129648&&ie<=129651||ie>=129656&&ie<=129666||ie>=129680&&ie<=129685}var Se=String.fromCharCode(65279);function ke(ie){return!!(ie&&ie.length>0&&ie.charCodeAt(0)===65279)}function Le(ie){return btoa(encodeURIComponent(ie))}function Ae(ie,ae){for(var me="",we=0;weme[3*Me+1])Me=2*Me+1;else return me[3*Me+2];return 0},ie._INSTANCE=null,ie}();function De(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},Ot1p:function(pt,Te,q){"use strict";var ue=q("2qtc"),J=q("kLXV"),_=q("rAM+"),X=q("miYZ"),F=q("tsqr"),P=q("9og8"),W=q("tJVT"),U=q("jrin"),O=q("WmNS"),L=q.n(O),h=q("q1tI"),f=q.n(h),T=q("VrN/"),p=q.n(T),m=q("bdgK"),g=q("p77/"),a=q("Bd2K"),i=q("ELLl"),s=q("19Vz"),l=q("lZu9"),C=q("+NIl"),v=q("kSUc"),y=q("9Bee"),R=function(Re){var ze=Re.value,it=ze===void 0?"":ze,ct=Re.className,dt=Re.showTextOnly,Lt=Re.showLines,wt=Re.style,ft=wt===void 0?{}:wt,zt=Object(h.useMemo)(function(){return""},[it]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:zt}}))},w=q("0Owb"),x=q("dejd"),b=q("C+DQ"),d=q("1vsH"),u=q("m3rI"),A=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function S(Re){var ze=Re.onActionCallback,it=Re.title,ct=Re.icon,dt=Re.actionName,Lt=Re.className,wt=Lt===void 0?"":Lt,ft=Re.children;function zt(){ze(dt)}return f.a.createElement("a",{title:it,className:wt,onClick:zt},f.a.createElement("i",{className:"md-iconfont ".concat(ct)}),ft)}var D=function(Re){var ze=Re.watch,it=Re.showNullButton,ct=Re.onActionCallback,dt=Re.fullScreen,Lt=Re.insertTemp,wt=Re.hidetoolBar,ft=Re.uuid,zt=Re.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(d.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(d.D)("_educoder_session"),"&key=").concat(ft,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var Ft=[].concat(A,[{title:"".concat(ze?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ze?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!wt&&Ft.map(function(Jt,Ht){return f.a.createElement("li",{key:Ht},Jt.actionName?f.a.createElement(S,Object(w.a)({},Jt,{onActionCallback:ct})):f.a.createElement("span",{className:"v-line"}))}),it?f.a.createElement("li",null,f.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ct},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Lt&&f.a.createElement("li",null,f.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Lt),onActionCallback:ct},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(S,{icon:"".concat(dt?"icon-shrink":"icon-enlarge"),title:dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ct})))},I=q("M8RZ"),B=q("+L6B"),j=q("2/Rp"),z=q("y8nQ"),M=q("Vl3Y"),N=q("5NDa"),Y=q("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},le=function(Re){var ze=Re.callback,it=Re.onCancel;function ct(dt){ze(dt)}return f.a.createElement(M.a,Object(w.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ct}),f.a.createElement(M.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(Y.a,null)),f.a.createElement(M.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(Y.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(j.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},fe=q("7ahc"),Oe=q("k1fw"),Se=q("HmJG"),ke=q("BjJ7"),Le=M.a.useForm,Ae={width:280,marginRight:10},ge={labelCol:{span:5},wrapperCol:{span:19}},he=function(Re){var ze=Re.callback,it=Re.onCancel,ct=Le(),dt=Object(W.a)(ct,1),Lt=dt[0],wt=Object(h.useRef)();function ft(Jt){ze(Object(Oe.a)(Object(Oe.a)({},Jt),{},{name:wt.current}))}function zt(Jt,Ht){Lt.setFieldsValue({src:"/api/attachments/".concat(Jt.id,"?type=").concat(Jt.content_type),type:Ht.type})}function Ft(Jt){var Ht=Jt.target.files[0];wt.current=Ht.name,de(Ht,zt)}return f.a.createElement(M.a,Object(w.a)({form:Lt},ge,{className:"upload-image-panel",onFinish:ft}),f.a.createElement(M.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(M.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},f.a.createElement(Y.a,{style:Ae})),f.a.createElement(re,{onFileChange:Ft}))),f.a.createElement(M.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},f.a.createElement(Y.a,{style:{width:264}})),f.a.createElement(M.a.Item,{style:{textAlign:"right"}},f.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(j.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))};function re(Re){var ze=Re.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:ze}))}function de(Re,ze){if(!Re)throw new String("\u6CA1\u6709\u6587\u4EF6");var it=new FormData;it.append("editormd-image-file",Re),it.append("file_param_name","editormd-image-file"),it.append("byxhr","true");var ct=new window.XMLHttpRequest;ct.withCredentials=!0,ct.addEventListener("load",function(dt){ze(JSON.parse(dt.target.responseText),Re)},!1),ct.addEventListener("error",function(dt){console.error(dt)},!1),ct.open("POST","".concat(ke.a,"/api/attachments.json")),ct.send(it)}var se=q("giR+"),De=q("fyUT"),ie=q("7Kak"),ae=q("9yH6"),me=ae.a.Group,we={margin:"0 8px"},Me=function(Re){var ze=Re.callback,it=Re.onCancel;function ct(dt){ze(dt)}return f.a.createElement(M.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ct},f.a.createElement("div",{className:"flex-container"},f.a.createElement("span",{style:we},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:we},"\u884C\u6570"),f.a.createElement(M.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(De.a,null)),f.a.createElement("span",{style:we},"\u5217\u6570"),f.a.createElement(M.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(De.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12}},f.a.createElement("span",{style:we},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(M.a.Item,{name:"align"},f.a.createElement(me,null,f.a.createElement(ae.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(ae.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(ae.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(ae.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(j.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},Fe=q("ErOA"),Ue=q("7Cbv"),Be="link",et="upload-image",Je="code-block",Ze="add-table",Ye="------------",ht={default:Ye,left:":".concat(Ye),center:":".concat(Ye,":"),right:"".concat(Ye,":")},qe=q("9VGf"),ot,Ie;function Qe(){}var st=0,je=1e4,Xe="\u2581",Ce=` **\u6A21\u677F\u6807\u9898** -\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function be(Re){return/^\d+$/.test(Re)?"".concat(Re,"px"):Re}var Ee=navigator.platform.toUpperCase().indexOf("MAC")>=0,ne=Ee?"Cmd":"Ctrl",oe=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ce=(ot={},Object(U.a)(ot,ne+"-B","bold"),Object(U.a)(ot,ne+"-I","italic"),ot),ve=(Ie={},Object(U.a)(Ie,Be,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(Ie,Je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(Ie,et,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(Ie,Ze,"\u6DFB\u52A0\u8868\u683C"),Ie),Ne=Te.a=function(Re){var ze=Re.defaultValue,it=ze===void 0?"":ze,ct=Re.onChange,ht=Re.width,Lt=ht===void 0?"100%":ht,wt=Re.height,ft=wt===void 0?400:wt,zt=Re.miniToolbar,Ft=zt===void 0?!1:zt,Jt=Re.isFocus,Ht=Jt===void 0?!1:Jt,kt=Re.watch,Ur=Re.insertTemp,Zr=Re.mode,bt=Zr===void 0?"markdown":Zr,Ct=Re.id,at=Ct===void 0?"markdown-editor-id":Ct,xt=Re.showResizeBar,Zt=xt===void 0?!1:xt,nr=Re.noStorage,rr=nr===void 0?!1:nr,Rt=Re.showNullButton,vt=Rt===void 0?!1:Rt,kr=Re.hidetoolBar,tn=kr===void 0?!1:kr,Tr=Re.fullScreen,_t=Tr===void 0?!1:Tr,Lr=Re.onBlur,zr=Re.onCMBeforeChange,rn=Re.onFullScreen,He=Re.className,lt=He===void 0?"":He,Pt=Re.disablePaste,Kt=Pt===void 0?!1:Pt,Yt=Re.placeholder,qt=Yt===void 0?"":Yt,K=Re.values,c=K===void 0?"":K,E=Object(d.useState)(null),G=Object(W.a)(E,2),$=G[0],V=G[1],xe=Object(d.useState)(it),Ge=Object(W.a)(xe,2),tt=Ge[0],mt=Ge[1],Ke=Object(d.useState)(kt),At=Object(W.a)(Ke,2),It=At[0],er=At[1],Kr=Object(d.useState)(_t),Vr=Object(W.a)(Kr,2),pr=Vr[0],Qr=Vr[1],Gn=Object(d.useState)(""),_r=Object(W.a)(Gn,2),Xr=_r[0],jr=_r[1],bn=Object(d.useState)(0),nn=Object(W.a)(bn,2),mn=nn[0],dn=nn[1],hi=Object(d.useState)(ft),zn=Object(W.a)(hi,2),an=zn[0],Yr=zn[1],kn=Object(d.useState)(!1),_n=Object(W.a)(kn,2),ci=_n[0],or=_n[1],jt=Object(d.useRef)(Object(Ue.a)()),Er=Object(d.useRef)(!1),Ut=Object(d.useRef)(),dr=Object(d.useRef)(),Vt=Object(d.useRef)(),hn=Object(d.useRef)(),lr=Object(d.useRef)(),Or=function(){var yt=Object(P.a)(L.a.mark(function Dt(){var St,Mt;return L.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(Fe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:jt.current}});case 2:Mt=$t.sent,Mt!=null&&(St=Mt.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",$,dr),Mt.attachments.map(function(Bt){Bt.content_type.indexOf("image")>-1?$.replaceSelection("![,](/api/attachments/".concat(Bt.id,"?type=").concat(Bt.content_type,")")):Bt.content_type.indexOf("video")>-1?$.replaceSelection('')):Bt.content_type.indexOf("pdf")>-1?$.replaceSelection('
      ').concat(Bt.name,"")):$.replaceSelection("[".concat(Bt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,")"))}));case 4:case"end":return $t.stop()}},Dt)}));return function(){return yt.apply(this,arguments)}}();Object(d.useEffect)(function(){mt(c),$==null||$.setValue(c)},[c]),Object(d.useEffect)(function(){rn==null||rn(pr)},[pr]),Object(d.useEffect)(function(){if(dr.current){var yt=p.a.fromTextArea(dr.current,{mode:bt,lineNumbers:!Ft,lineWrapping:!0,value:it,autoCloseTags:!0,autoCloseBrackets:!0});Ht&&yt.focus();function Dt(St,Mt){if(Kt){Mt.preventDefault();return}var Wt=Mt.clipboardData;if(Wt){var $t=Wt.types.toString(),Bt=Wt.items;if($t==="Files"||Wt.types.indexOf("Files")>-1){if(Mt.preventDefault(),bt=="stex")return;try{var hr,Pr=Bt[1];((hr=Bt[0])===null||hr===void 0?void 0:hr.kind)==="file"&&(Pr=Bt[0]);var Nt=Pr.getAsFile(),En=Nt.name.split(".").pop();he(Nt,function(Gt){if(Gt.id){var gr,qr,en;(Nt==null||((gr=Nt.type)===null||gr===void 0)?void 0:gr.indexOf("image"))>-1?yt.replaceSelection("![,](/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type,")")):(Nt==null||((qr=Nt.type)===null||qr===void 0)?void 0:qr.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((en=Nt.type)===null||en===void 0)?void 0:en.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):oe.includes(En)?yt.replaceSelection('').concat(Nt.name,"")):yt.replaceSelection("[".concat(Nt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})}catch(Gt){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",Dt),yt.on("dragleave",function(St,Mt){Vt.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(St,Mt){Vt.current.classList.add("mouse-hover-md")}),yt.on("drop",function(St,Mt){Vt.current.classList.add("mouse-hover-md");var Wt;if(Wt=Mt.dataTransfer.files,Wt.length>0){Mt.preventDefault(),Mt.stopPropagation();for(var $t=function(Pr){var Nt=Wt[Pr],En=Nt.name.split(".").pop();he(Nt,function(Gt){if(Gt.id){var gr,qr,en;(Nt==null||((gr=Nt.type)===null||gr===void 0)?void 0:gr.indexOf("image"))>-1?yt.replaceSelection("![,](/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type,")")):(Nt==null||((qr=Nt.type)===null||qr===void 0)?void 0:qr.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((en=Nt.type)===null||en===void 0)?void 0:en.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):oe.includes(En)?yt.replaceSelection('').concat(Nt.name,"")):yt.replaceSelection("[".concat(Nt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})},Bt=0;Bt0||Bt.target.offsetWidth>0)&&(Kn(),$.setSize("100%","100%"),$.refresh())}}catch(hr){Wt.e(hr)}finally{Wt.f()}});return St.observe(dr.current.parentElement),St}if($){var Dt=yt();return function(){Dt.unobserve(dr.current.parentElement)}}},[$,Kn]),Object(d.useEffect)(function(){if($){for(var yt=[],Dt=function(){var Bt=Mt[St];Wt=Object(W.a)(Bt,2);var hr=Wt[0],Pr=Wt[1],Nt=Object(U.a)({},hr,function(){Vn(Pr)});yt.push(Nt),$.addKeyMap(Nt)},St=0,Mt=Object.entries(ce);St0){var yt=new Date().getTime(),Dt=window.sessionStorage.getItem(at);yt>=mn+je&&(!Dt||Dt!==tt)&&(window.sessionStorage.setItem(at,tt),or(!0))}},je),Object(d.useEffect)(function(){er(kt)},[$,kt]),Object(d.useEffect)(function(){$&&(Ht&&$.focus())},[$,Ht]),Object(d.useEffect)(function(){if(It&&$){var yt=$.getScrollerElement();function Dt(St){var Mt=St.target;if(lr.current){var Wt=Mt.scrollTop/Mt.scrollHeight;lr.current.scrollTop=lr.current.scrollHeight*Wt}}return yt.addEventListener("scroll",Dt),function(){yt.removeEventListener("scroll",Dt)}}},[$,It]),Object(d.useEffect)(function(){if($&&zr){function yt(Dt,St){zr(Dt,St)}return $.on("beforeChange",yt),function(){$.off("beforeChange",yt)}}},[$,zr]),Object(d.useEffect)(function(){if($&&Lr){function yt(){Lr($.getValue())}return $.on("blur",yt),function(){$.off("blur",yt)}}},[$,Lr]),Object(d.useEffect)(function(){if($){function yt(Dt){var St=Dt.getValue();mt(St),dn(new Date().getTime()),Dt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ct&&ct(St)}return $.on("change",yt),function(){$.off("change",yt)}}},[$,ct]),Object(d.useEffect)(function(){$&&(it==null?($.setValue(""),mt("")):it!==$.getValue()&&($.setValue(it),mt(it),$.setCursor($.lineCount(),0)))},[$,it]);var Vn=Object(d.useCallback)(function(yt){var Dt=$.getCursor(),St=$.getSelection(),Mt=St.split(` +\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function be(Re){return/^\d+$/.test(Re)?"".concat(Re,"px"):Re}var Ee=navigator.platform.toUpperCase().indexOf("MAC")>=0,ne=Ee?"Cmd":"Ctrl",oe=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ce=(ot={},Object(U.a)(ot,ne+"-B","bold"),Object(U.a)(ot,ne+"-I","italic"),ot),ve=(Ie={},Object(U.a)(Ie,Be,"\u6DFB\u52A0\u94FE\u63A5"),Object(U.a)(Ie,Je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(U.a)(Ie,et,"\u6DFB\u52A0\u6587\u4EF6"),Object(U.a)(Ie,Ze,"\u6DFB\u52A0\u8868\u683C"),Ie),Ne=Te.a=function(Re){var ze=Re.defaultValue,it=ze===void 0?"":ze,ct=Re.onChange,dt=Re.width,Lt=dt===void 0?"100%":dt,wt=Re.height,ft=wt===void 0?400:wt,zt=Re.miniToolbar,Ft=zt===void 0?!1:zt,Jt=Re.isFocus,Ht=Jt===void 0?!1:Jt,kt=Re.watch,Ur=Re.insertTemp,Zr=Re.mode,bt=Zr===void 0?"markdown":Zr,Ct=Re.id,at=Ct===void 0?"markdown-editor-id":Ct,xt=Re.showResizeBar,Zt=xt===void 0?!1:xt,nr=Re.noStorage,rr=nr===void 0?!1:nr,Rt=Re.showNullButton,vt=Rt===void 0?!1:Rt,kr=Re.hidetoolBar,tn=kr===void 0?!1:kr,Tr=Re.fullScreen,_t=Tr===void 0?!1:Tr,Lr=Re.onBlur,zr=Re.onCMBeforeChange,rn=Re.onFullScreen,He=Re.className,lt=He===void 0?"":He,Pt=Re.disablePaste,Kt=Pt===void 0?!1:Pt,Yt=Re.placeholder,qt=Yt===void 0?"":Yt,K=Re.values,c=K===void 0?"":K,E=Object(h.useState)(null),G=Object(W.a)(E,2),$=G[0],V=G[1],xe=Object(h.useState)(it),Ge=Object(W.a)(xe,2),tt=Ge[0],mt=Ge[1],Ke=Object(h.useState)(kt),At=Object(W.a)(Ke,2),It=At[0],er=At[1],Kr=Object(h.useState)(_t),Vr=Object(W.a)(Kr,2),pr=Vr[0],Qr=Vr[1],Gn=Object(h.useState)(""),_r=Object(W.a)(Gn,2),Xr=_r[0],jr=_r[1],bn=Object(h.useState)(0),nn=Object(W.a)(bn,2),mn=nn[0],hn=nn[1],di=Object(h.useState)(ft),zn=Object(W.a)(di,2),an=zn[0],Yr=zn[1],kn=Object(h.useState)(!1),_n=Object(W.a)(kn,2),ci=_n[0],or=_n[1],jt=Object(h.useRef)(Object(Ue.a)()),Er=Object(h.useRef)(!1),Ut=Object(h.useRef)(),hr=Object(h.useRef)(),Vt=Object(h.useRef)(),dn=Object(h.useRef)(),lr=Object(h.useRef)(),Or=function(){var yt=Object(P.a)(L.a.mark(function Dt(){var St,Mt;return L.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(Fe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:jt.current}});case 2:Mt=$t.sent,Mt!=null&&(St=Mt.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",$,hr),Mt.attachments.map(function(Bt){Bt.content_type.indexOf("image")>-1?$.replaceSelection("![,](/api/attachments/".concat(Bt.id,"?type=").concat(Bt.content_type,")")):Bt.content_type.indexOf("video")>-1?$.replaceSelection('')):Bt.content_type.indexOf("pdf")>-1?$.replaceSelection('').concat(Bt.name,"")):$.replaceSelection("[".concat(Bt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,")"))}));case 4:case"end":return $t.stop()}},Dt)}));return function(){return yt.apply(this,arguments)}}();Object(h.useEffect)(function(){mt(c),$==null||$.setValue(c)},[c]),Object(h.useEffect)(function(){rn==null||rn(pr)},[pr]),Object(h.useEffect)(function(){if(hr.current){var yt=p.a.fromTextArea(hr.current,{mode:bt,lineNumbers:!Ft,lineWrapping:!0,value:it,autoCloseTags:!0,autoCloseBrackets:!0});Ht&&yt.focus();function Dt(St,Mt){if(Kt){Mt.preventDefault();return}var Wt=Mt.clipboardData;if(Wt){var $t=Wt.types.toString(),Bt=Wt.items;if($t==="Files"||Wt.types.indexOf("Files")>-1){if(Mt.preventDefault(),bt=="stex")return;try{var dr,Pr=Bt[1];((dr=Bt[0])===null||dr===void 0?void 0:dr.kind)==="file"&&(Pr=Bt[0]);var Nt=Pr.getAsFile(),En=Nt.name.split(".").pop();de(Nt,function(Gt){if(Gt.id){var gr,qr,en;(Nt==null||((gr=Nt.type)===null||gr===void 0)?void 0:gr.indexOf("image"))>-1?yt.replaceSelection("![,](/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type,")")):(Nt==null||((qr=Nt.type)===null||qr===void 0)?void 0:qr.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((en=Nt.type)===null||en===void 0)?void 0:en.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):oe.includes(En)?yt.replaceSelection('').concat(Nt.name,"")):yt.replaceSelection("[".concat(Nt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})}catch(Gt){F.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",Dt),yt.on("dragleave",function(St,Mt){Vt.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(St,Mt){Vt.current.classList.add("mouse-hover-md")}),yt.on("drop",function(St,Mt){Vt.current.classList.add("mouse-hover-md");var Wt;if(Wt=Mt.dataTransfer.files,Wt.length>0){Mt.preventDefault(),Mt.stopPropagation();for(var $t=function(Pr){var Nt=Wt[Pr],En=Nt.name.split(".").pop();de(Nt,function(Gt){if(Gt.id){var gr,qr,en;(Nt==null||((gr=Nt.type)===null||gr===void 0)?void 0:gr.indexOf("image"))>-1?yt.replaceSelection("![,](/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type,")")):(Nt==null||((qr=Nt.type)===null||qr===void 0)?void 0:qr.indexOf("video"))>-1?yt.replaceSelection('')):(Nt==null||((en=Nt.type)===null||en===void 0)?void 0:en.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Nt.name,"")):oe.includes(En)?yt.replaceSelection('').concat(Nt.name,"")):yt.replaceSelection("[".concat(Nt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})},Bt=0;Bt0||Bt.target.offsetWidth>0)&&(Kn(),$.setSize("100%","100%"),$.refresh())}}catch(dr){Wt.e(dr)}finally{Wt.f()}});return St.observe(hr.current.parentElement),St}if($){var Dt=yt();return function(){Dt.unobserve(hr.current.parentElement)}}},[$,Kn]),Object(h.useEffect)(function(){if($){for(var yt=[],Dt=function(){var Bt=Mt[St];Wt=Object(W.a)(Bt,2);var dr=Wt[0],Pr=Wt[1],Nt=Object(U.a)({},dr,function(){Vn(Pr)});yt.push(Nt),$.addKeyMap(Nt)},St=0,Mt=Object.entries(ce);St0){var yt=new Date().getTime(),Dt=window.sessionStorage.getItem(at);yt>=mn+je&&(!Dt||Dt!==tt)&&(window.sessionStorage.setItem(at,tt),or(!0))}},je),Object(h.useEffect)(function(){er(kt)},[$,kt]),Object(h.useEffect)(function(){$&&(Ht&&$.focus())},[$,Ht]),Object(h.useEffect)(function(){if(It&&$){var yt=$.getScrollerElement();function Dt(St){var Mt=St.target;if(lr.current){var Wt=Mt.scrollTop/Mt.scrollHeight;lr.current.scrollTop=lr.current.scrollHeight*Wt}}return yt.addEventListener("scroll",Dt),function(){yt.removeEventListener("scroll",Dt)}}},[$,It]),Object(h.useEffect)(function(){if($&&zr){function yt(Dt,St){zr(Dt,St)}return $.on("beforeChange",yt),function(){$.off("beforeChange",yt)}}},[$,zr]),Object(h.useEffect)(function(){if($&&Lr){function yt(){Lr($.getValue())}return $.on("blur",yt),function(){$.off("blur",yt)}}},[$,Lr]),Object(h.useEffect)(function(){if($){function yt(Dt){var St=Dt.getValue();mt(St),hn(new Date().getTime()),Dt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ct&&ct(St)}return $.on("change",yt),function(){$.off("change",yt)}}},[$,ct]),Object(h.useEffect)(function(){$&&(it==null?($.setValue(""),mt("")):it!==$.getValue()&&($.setValue(it),mt(it),$.setCursor($.lineCount(),0)))},[$,it]);var Vn=Object(h.useCallback)(function(yt){var Dt=$.getCursor(),St=$.getSelection(),Mt=St.split(` `);switch(yt){case"bold":return $.replaceSelection("**"+St+"**"),St===""&&$.setCursor(Dt.line,Dt.ch+2),$.focus();case"italic":return $.replaceSelection("*"+St+"*"),St===""&&$.setCursor(Dt.line,Dt.ch+1),$.focus();case"code":return $.replaceSelection("`"+St+"`"),St===""&&$.setCursor(Dt.line,Dt.ch+1),$.focus();case"inline-latex":return $.replaceSelection("`$$"+St+"$$`"),St===""&&$.setCursor(Dt.line,Dt.ch+3),$.focus();case"latex":return $.replaceSelection("```latex\n"+St+"\n```"),$.setCursor(Dt.line+1,St.length+1),$.focus();case"line-break":return $.replaceSelection(`
      `),$.focus();case"list-ul":return St===""?$.replaceSelection("- "+St):$.replaceSelection(Mt.map(function(Wt){return Wt===""?"":"- ".concat(Wt)}).join(` `)),$.focus();case"list-ol":return St===""?$.replaceSelection("1. "+St):$.replaceSelection(Mt.map(function(Wt,$t){return Wt===""?"":"".concat($t+1,". ").concat(Wt)}).join(` -`)),$.focus();case"add-null-ch":return St===""&&$.setCursor(Dt.line,Dt.ch+1),$.replaceSelection(Xe),$.focus();case"inster-template-1":return St===""&&$.setCursor(Dt.line,Dt.ch),$.replaceSelection(Ce),$.focus();case"eraser":return $.setValue(""),$.focus();case"trigger-watch":return er(!It),$.focus();case"trigger-full-screen":return Qr(!pr),$.focus();case Be:jr(Be);return;case Je:jr(Je);return;case et:jr(et);return;case Ze:jr(Ze);return;default:throw new Error}},[$,It,pr]),xn=Object(d.useCallback)(function(yt){jr("");switch(Xr){case Be:var Dt=yt.title,St=yt.link;return $.replaceSelection("[".concat(Dt,"](").concat(St,")")),$.focus();case Je:var Mt=yt.language,Wt=yt.content;return $.replaceSelection(["```"+Mt,Wt,"```"].join(` -`)),$.focus();case et:var $t=yt.src,Bt=yt.alt,hr=yt.name;return $t.indexOf("type=image")>-1?$.replaceSelection("![ ".concat(Bt||""," ]( ").concat($t,' "').concat(Bt||"",'" )')):$t.indexOf("type=application/pdf")>-1?$.replaceSelection('').concat(hr,"")):$.replaceSelection('').concat(hr,"")),$.focus();case Ze:for(var Pr=yt.row,Nt=yt.col,En=yt.align,Gt=` -`,gr=0;gr-1?$.replaceSelection("![ ".concat(Bt||""," ]( ").concat($t,' "').concat(Bt||"",'" )')):$t.indexOf("type=application/pdf")>-1?$.replaceSelection('').concat(dr,"")):$.replaceSelection('').concat(dr,"")),$.focus();case Ze:for(var Pr=yt.row,Nt=yt.col,En=yt.align,Gt=` +`,gr=0;gr300&&(hr=300);var Pr=ft+hr+"px";Yr(Pr)}}return yt.addEventListener("mousedown",Mt),document.addEventListener("mousemove",$t),document.addEventListener("mouseup",Wt),function(){yt.removeEventListener("mousedown",Mt),document.removeEventListener("mousemove",$t),document.removeEventListener("mouseup",Wt)}}},[$,hn]),Object(d.useEffect)(function(){Yr(ft)},[ft]);var fi=be(Lt),on=be(an),Xn={width:fi,height:on},ji=Object(d.useMemo)(function(){if(mn){var yt=new Date(mn),Dt=yt.getHours(),St=yt.getMinutes(),Mt=yt.getSeconds();return Dt=Dt<10?"0"+Dt:Dt,St=St<10?"0"+St:St,Mt=Mt<10?"0"+Mt:Mt,"".concat(Dt,":").concat(St,":").concat(Mt)}return 0},[mn]);function On(){window.sessionStorage.removeItem(at),or(!1),dn(0)}function $a(){or(!1),dn(0),$.setValue(window.sessionStorage.getItem(at))}function da(yt,Dt){var St=$.getValue();St=St.replace(yt,Dt),mt(St),$==null||$.setValue(St)}return f.a.createElement(d.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Vt},f.a.createElement("div",{className:"markdown-editor-container ".concat(lt," ").concat(It?"on-preview":""," ").concat(Ft?"mini":""," ").concat(pr?"full-screen":""),style:Xn},f.a.createElement(D,{insertTemp:Ur,watch:It,fullScreen:pr,showNullButton:vt,onActionCallback:Vn,hidetoolBar:tn,uuid:jt.current,setOpenPhones:function(){Er.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:dr,placeholder:qt})),It?f.a.createElement("div",{ref:lr,className:"preview-container"},bt==="stex"&&f.a.createElement(R,{value:tt}),bt!=="stex"&&f.a.createElement(y.a,{edit:!0,value:tt,replaces:da})):null))),Zt?f.a.createElement("a",{ref:hn,className:"editor-resize"}):null,f.a.createElement(I.a,null,ve[Xr]?f.a.createElement(J.a,{centered:!0,title:ve[Xr],visible:!0,onCancel:Wr,footer:null},Ui):null))}},QDVR:function(pt,Te,q){"use strict";q.d(Te,"e",function(){return J}),q.d(Te,"d",function(){return _}),q.d(Te,"c",function(){return W}),q.d(Te,"b",function(){return U}),q.d(Te,"a",function(){return L});var ue=function(){var d=function(f,T){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,m){p.__proto__=m}||function(p,m){for(var g in m)m.hasOwnProperty(g)&&(p[g]=m[g])},d(f,T)};return function(f,T){d(f,T);function p(){this.constructor=f}f.prototype=T===null?Object.create(T):(p.prototype=T.prototype,new p)}}();function J(d){var f=[];return d.forEach(function(T){return f.push(T)}),f}function _(d){var f=[];return d.forEach(function(T,p){return f.push(p)}),f}var X=function(){function d(){this._value="",this._pos=0}return d.prototype.reset=function(f){return this._value=f,this._pos=0,this},d.prototype.next=function(){return this._pos+=1,this},d.prototype.hasNext=function(){return this._pos0)m.left||(m.left=new P,m.left.segment=p.value()),m=m.left;else if(g<0)m.right||(m.right=new P,m.right.segment=p.value()),m=m.right;else if(p.hasNext())p.next(),m.mid||(m.mid=new P,m.mid.segment=p.value()),m=m.mid;else break}var a=m.value;return m.value=T,m.key=f,a},d.prototype.get=function(f){for(var T=this._iter.reset(f),p=this._root;p;){var m=T.cmp(p.segment);if(m>0)p=p.left;else if(m<0)p=p.right;else if(T.hasNext())T.next(),p=p.mid;else break}return p?p.value:void 0},d.prototype.findSubstr=function(f){for(var T=this._iter.reset(f),p=this._root,m=void 0;p;){var g=T.cmp(p.segment);if(g>0)p=p.left;else if(g<0)p=p.right;else if(T.hasNext())T.next(),m=p.value||m,p=p.mid;else break}return p&&p.value||m},d.prototype.forEach=function(f){this._forEach(this._root,f)},d.prototype._forEach=function(f,T){f&&(this._forEach(f.left,T),f.value&&T(f.value,f.key),this._forEach(f.mid,T),this._forEach(f.right,T))},d}(),U=function(){function d(){this.map=new Map,this.ignoreCase=!1}return d.prototype.set=function(f,T){this.map.set(this.toKey(f),T)},d.prototype.get=function(f){return this.map.get(this.toKey(f))},d.prototype.toKey=function(f){var T=f.toString();return this.ignoreCase&&(T=T.toLowerCase()),T},d}(),O=function(){function d(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return d.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(d.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),d.prototype.get=function(f,T){T===void 0&&(T=0);var p=this._map.get(f);return p?(T!==0&&this.touch(p,T),p.value):void 0},d.prototype.set=function(f,T,p){p===void 0&&(p=0);var m=this._map.get(f);if(m)m.value=T,p!==0&&this.touch(m,p);else{m={key:f,value:T,next:void 0,previous:void 0};switch(p){case 0:this.addItemLast(m);break;case 1:this.addItemFirst(m);break;case 2:this.addItemLast(m);break;default:this.addItemLast(m);break}this._map.set(f,m),this._size++}},d.prototype.delete=function(f){return!!this.remove(f)},d.prototype.remove=function(f){var T=this._map.get(f);return T?(this._map.delete(f),this.removeItem(T),this._size--,T.value):void 0},d.prototype.forEach=function(f,T){for(var p=this._head;p;)T?f.bind(T)(p.value,p.key,this):f(p.value,p.key,this),p=p.next},d.prototype.trimOld=function(f){if(f>=this.size)return;if(f===0){this.clear();return}for(var T=this._head,p=this.size;T&&p>f;)this._map.delete(T.key),T=T.next,p--;this._head=T,this._size=p,T&&(T.previous=void 0)},d.prototype.addItemFirst=function(f){if(!this._head&&!this._tail)this._tail=f;else if(this._head)f.next=this._head,this._head.previous=f;else throw new Error("Invalid list");this._head=f},d.prototype.addItemLast=function(f){if(!this._head&&!this._tail)this._head=f;else if(this._tail)f.previous=this._tail,this._tail.next=f;else throw new Error("Invalid list");this._tail=f},d.prototype.removeItem=function(f){if(f===this._head&&f===this._tail)this._head=void 0,this._tail=void 0;else if(f===this._head){if(!f.next)throw new Error("Invalid list");f.next.previous=void 0,this._head=f.next}else if(f===this._tail){if(!f.previous)throw new Error("Invalid list");f.previous.next=void 0,this._tail=f.previous}else{var T=f.next,p=f.previous;if(!T||!p)throw new Error("Invalid list");T.previous=p,p.next=T}f.next=void 0,f.previous=void 0},d.prototype.touch=function(f,T){if(!this._head||!this._tail)throw new Error("Invalid list");if(T!==1&&T!==2)return;if(T===1){if(f===this._head)return;var p=f.next,m=f.previous;f===this._tail?(m.next=void 0,this._tail=m):(p.previous=m,m.next=p),f.previous=void 0,f.next=this._head,this._head.previous=f,this._head=f}else if(T===2){if(f===this._tail)return;var p=f.next,m=f.previous;f===this._head?(p.previous=void 0,this._head=p):(p.previous=m,m.next=p),f.next=void 0,f.previous=this._tail,this._tail.next=f,this._tail=f}},d.prototype.toJSON=function(){var f=[];return this.forEach(function(T,p){f.push([p,T])}),f},d}(),L=function(d){ue(f,d);function f(T,p){p===void 0&&(p=1);var m=d.call(this)||this;return m._limit=T,m._ratio=Math.min(Math.max(0,p),1),m}return f.prototype.get=function(T){return d.prototype.get.call(this,T,2)},f.prototype.peek=function(T){return d.prototype.get.call(this,T,0)},f.prototype.set=function(T,p){d.prototype.set.call(this,T,p,2),this.checkTrim()},f.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},f}(O)},SJMd:function(pt,Te){/** +`),$.focus();default:throw new Error}},[$,Xr]),Ui=Object(h.useMemo)(function(){switch(Xr){case Be:return f.a.createElement(le,{callback:xn,onCancel:Wr});case Je:return f.a.createElement(fe.b,{callback:xn,onCancel:Wr});case et:return f.a.createElement(he,{callback:xn,onCancel:Wr});case Ze:return f.a.createElement(Me,{callback:xn,onCancel:Wr});default:return null}},[Xr]);function Wr(){jr("")}Object(h.useEffect)(function(){if(dn.current){var yt=dn.current,Dt=!1,St=0;function Mt(Bt){Dt=!0,St=Bt.pageY}function Wt(){Dt=!1}function $t(Bt){if(Dt){var dr=Bt.pageY-St;dr<0&&(dr=0),dr>300&&(dr=300);var Pr=ft+dr+"px";Yr(Pr)}}return yt.addEventListener("mousedown",Mt),document.addEventListener("mousemove",$t),document.addEventListener("mouseup",Wt),function(){yt.removeEventListener("mousedown",Mt),document.removeEventListener("mousemove",$t),document.removeEventListener("mouseup",Wt)}}},[$,dn]),Object(h.useEffect)(function(){Yr(ft)},[ft]);var fi=be(Lt),on=be(an),Xn={width:fi,height:on},ji=Object(h.useMemo)(function(){if(mn){var yt=new Date(mn),Dt=yt.getHours(),St=yt.getMinutes(),Mt=yt.getSeconds();return Dt=Dt<10?"0"+Dt:Dt,St=St<10?"0"+St:St,Mt=Mt<10?"0"+Mt:Mt,"".concat(Dt,":").concat(St,":").concat(Mt)}return 0},[mn]);function On(){window.sessionStorage.removeItem(at),or(!1),hn(0)}function $a(){or(!1),hn(0),$.setValue(window.sessionStorage.getItem(at))}function ha(yt,Dt){var St=$.getValue();St=St.replace(yt,Dt),mt(St),$==null||$.setValue(St)}return f.a.createElement(h.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Vt},f.a.createElement("div",{className:"markdown-editor-container ".concat(lt," ").concat(It?"on-preview":""," ").concat(Ft?"mini":""," ").concat(pr?"full-screen":""),style:Xn},f.a.createElement(D,{insertTemp:Ur,watch:It,fullScreen:pr,showNullButton:vt,onActionCallback:Vn,hidetoolBar:tn,uuid:jt.current,setOpenPhones:function(){Er.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:hr,placeholder:qt})),It?f.a.createElement("div",{ref:lr,className:"preview-container"},bt==="stex"&&f.a.createElement(R,{value:tt}),bt!=="stex"&&f.a.createElement(y.a,{edit:!0,value:tt,replaces:ha})):null))),Zt?f.a.createElement("a",{ref:dn,className:"editor-resize"}):null,f.a.createElement(I.a,null,ve[Xr]?f.a.createElement(J.a,{centered:!0,title:ve[Xr],visible:!0,onCancel:Wr,footer:null},Ui):null))}},QDVR:function(pt,Te,q){"use strict";q.d(Te,"e",function(){return J}),q.d(Te,"d",function(){return _}),q.d(Te,"c",function(){return W}),q.d(Te,"b",function(){return U}),q.d(Te,"a",function(){return L});var ue=function(){var h=function(f,T){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,m){p.__proto__=m}||function(p,m){for(var g in m)m.hasOwnProperty(g)&&(p[g]=m[g])},h(f,T)};return function(f,T){h(f,T);function p(){this.constructor=f}f.prototype=T===null?Object.create(T):(p.prototype=T.prototype,new p)}}();function J(h){var f=[];return h.forEach(function(T){return f.push(T)}),f}function _(h){var f=[];return h.forEach(function(T,p){return f.push(p)}),f}var X=function(){function h(){this._value="",this._pos=0}return h.prototype.reset=function(f){return this._value=f,this._pos=0,this},h.prototype.next=function(){return this._pos+=1,this},h.prototype.hasNext=function(){return this._pos0)m.left||(m.left=new P,m.left.segment=p.value()),m=m.left;else if(g<0)m.right||(m.right=new P,m.right.segment=p.value()),m=m.right;else if(p.hasNext())p.next(),m.mid||(m.mid=new P,m.mid.segment=p.value()),m=m.mid;else break}var a=m.value;return m.value=T,m.key=f,a},h.prototype.get=function(f){for(var T=this._iter.reset(f),p=this._root;p;){var m=T.cmp(p.segment);if(m>0)p=p.left;else if(m<0)p=p.right;else if(T.hasNext())T.next(),p=p.mid;else break}return p?p.value:void 0},h.prototype.findSubstr=function(f){for(var T=this._iter.reset(f),p=this._root,m=void 0;p;){var g=T.cmp(p.segment);if(g>0)p=p.left;else if(g<0)p=p.right;else if(T.hasNext())T.next(),m=p.value||m,p=p.mid;else break}return p&&p.value||m},h.prototype.forEach=function(f){this._forEach(this._root,f)},h.prototype._forEach=function(f,T){f&&(this._forEach(f.left,T),f.value&&T(f.value,f.key),this._forEach(f.mid,T),this._forEach(f.right,T))},h}(),U=function(){function h(){this.map=new Map,this.ignoreCase=!1}return h.prototype.set=function(f,T){this.map.set(this.toKey(f),T)},h.prototype.get=function(f){return this.map.get(this.toKey(f))},h.prototype.toKey=function(f){var T=f.toString();return this.ignoreCase&&(T=T.toLowerCase()),T},h}(),O=function(){function h(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return h.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(h.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),h.prototype.get=function(f,T){T===void 0&&(T=0);var p=this._map.get(f);return p?(T!==0&&this.touch(p,T),p.value):void 0},h.prototype.set=function(f,T,p){p===void 0&&(p=0);var m=this._map.get(f);if(m)m.value=T,p!==0&&this.touch(m,p);else{m={key:f,value:T,next:void 0,previous:void 0};switch(p){case 0:this.addItemLast(m);break;case 1:this.addItemFirst(m);break;case 2:this.addItemLast(m);break;default:this.addItemLast(m);break}this._map.set(f,m),this._size++}},h.prototype.delete=function(f){return!!this.remove(f)},h.prototype.remove=function(f){var T=this._map.get(f);return T?(this._map.delete(f),this.removeItem(T),this._size--,T.value):void 0},h.prototype.forEach=function(f,T){for(var p=this._head;p;)T?f.bind(T)(p.value,p.key,this):f(p.value,p.key,this),p=p.next},h.prototype.trimOld=function(f){if(f>=this.size)return;if(f===0){this.clear();return}for(var T=this._head,p=this.size;T&&p>f;)this._map.delete(T.key),T=T.next,p--;this._head=T,this._size=p,T&&(T.previous=void 0)},h.prototype.addItemFirst=function(f){if(!this._head&&!this._tail)this._tail=f;else if(this._head)f.next=this._head,this._head.previous=f;else throw new Error("Invalid list");this._head=f},h.prototype.addItemLast=function(f){if(!this._head&&!this._tail)this._head=f;else if(this._tail)f.previous=this._tail,this._tail.next=f;else throw new Error("Invalid list");this._tail=f},h.prototype.removeItem=function(f){if(f===this._head&&f===this._tail)this._head=void 0,this._tail=void 0;else if(f===this._head){if(!f.next)throw new Error("Invalid list");f.next.previous=void 0,this._head=f.next}else if(f===this._tail){if(!f.previous)throw new Error("Invalid list");f.previous.next=void 0,this._tail=f.previous}else{var T=f.next,p=f.previous;if(!T||!p)throw new Error("Invalid list");T.previous=p,p.next=T}f.next=void 0,f.previous=void 0},h.prototype.touch=function(f,T){if(!this._head||!this._tail)throw new Error("Invalid list");if(T!==1&&T!==2)return;if(T===1){if(f===this._head)return;var p=f.next,m=f.previous;f===this._tail?(m.next=void 0,this._tail=m):(p.previous=m,m.next=p),f.previous=void 0,f.next=this._head,this._head.previous=f,this._head=f}else if(T===2){if(f===this._tail)return;var p=f.next,m=f.previous;f===this._head?(p.previous=void 0,this._head=p):(p.previous=m,m.next=p),f.next=void 0,f.previous=this._tail,this._tail.next=f,this._tail=f}},h.prototype.toJSON=function(){var f=[];return this.forEach(function(T,p){f.push([p,T])}),f},h}(),L=function(h){ue(f,h);function f(T,p){p===void 0&&(p=1);var m=h.call(this)||this;return m._limit=T,m._ratio=Math.min(Math.max(0,p),1),m}return f.prototype.get=function(T){return h.prototype.get.call(this,T,2)},f.prototype.peek=function(T){return h.prototype.get.call(this,T,0)},f.prototype.set=function(T,p){h.prototype.set.call(this,T,p,2),this.checkTrim()},f.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},f}(O)},SJMd:function(pt,Te){/** * @license * Copyright (C) 2006 Google Inc. * @@ -302,35 +302,35 @@ Please report this to https://github.com/markedjs/marked.`,be.silent)return"

      A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */var q,ue,J,_=!1,X,F;window.PR_SHOULD_USE_CONTINUATION=!0;var P,W;(function(){var U=window,O=["break,continue,do,else,for,if,return,while"],L=[O,"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"],d=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[d,"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"],T=[d,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],p=[d,"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"],m="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",g=[d,"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",i=[O,"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"],s=[O,"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"],l=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[f,p,T,g,a,i,s,l],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,y="str",R="kwd",w="com",x="typ",b="lit",h="pun",u="pln",A="tag",S="dec",D="src",I="atn",B="atv",j="nocode",z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function M(ae){for(var me=0,we=!1,Me=!1,Fe=0,Ue=ae.length;Fe122||(ne<65||Ee>90||Qe.push([Math.max(65,Ee)|32,Math.min(ne,90)|32]),ne<97||Ee>122||Qe.push([Math.max(97,Ee)&~32,Math.min(ne,122)&~32]))}}Qe.sort(function(Ne,Re){return Ne[0]-Re[0]||Re[1]-Ne[1]});for(var oe=[],ce=[],Xe=0;Xeve[0]&&(ve[1]+1>ve[0]&&je.push("-"),je.push(Ze(ve[1])))}return je.push("]"),je.join("")}function dt(ot){for(var Ie=ot.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")),Qe=Ie.length,st=[],je=0,Xe=0;je=2&&Ee==="["?Ie[je]=Ye(Ce):Ee!=="\\"&&(Ie[je]=Ce.replace(/[a-zA-Z]/g,function(ce){var ve=ce.charCodeAt(0);return"["+String.fromCharCode(ve&~32,ve|32)+"]"}))}return Ie.join("")}for(var qe=[],Fe=0,Ue=ae.length;Fe|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function M(ae){for(var me=0,we=!1,Me=!1,Fe=0,Ue=ae.length;Fe122||(ne<65||Ee>90||Qe.push([Math.max(65,Ee)|32,Math.min(ne,90)|32]),ne<97||Ee>122||Qe.push([Math.max(97,Ee)&~32,Math.min(ne,122)&~32]))}}Qe.sort(function(Ne,Re){return Ne[0]-Re[0]||Re[1]-Ne[1]});for(var oe=[],ce=[],Xe=0;Xeve[0]&&(ve[1]+1>ve[0]&&je.push("-"),je.push(Ze(ve[1])))}return je.push("]"),je.join("")}function ht(ot){for(var Ie=ot.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")),Qe=Ie.length,st=[],je=0,Xe=0;je=2&&Ee==="["?Ie[je]=Ye(Ce):Ee!=="\\"&&(Ie[je]=Ce.replace(/[a-zA-Z]/g,function(ce){var ve=ce.charCodeAt(0);return"["+String.fromCharCode(ve&~32,ve|32)+"]"}))}return Ie.join("")}for(var qe=[],Fe=0,Ue=ae.length;Fe=0;)we[qe.charAt(ot)]=dt;var Ie=dt[1],Qe=""+Ie;Je.hasOwnProperty(Qe)||(et.push(Ie),Je[Qe]=null)}et.push(/[\0-\uffff]/),Me=M(et)})();var Fe=me.length,Ue=function(Be){for(var et=Be.sourceCode,Je=Be.basePos,Ze=Be.sourceNode,Ye=[Je,u],dt=0,qe=et.match(Me)||[],ot={},Ie=0,Qe=qe.length;Ie=5&&je.substring(0,5)==="lang-",Ce&&!(Xe&&typeof Xe[1]=="string")&&(Ce=!1,je=D),Ce||(ot[st]=je)}var ne=dt;if(dt+=st.length,!Ce)Ye.push(Je+ne,je);else{var oe=Xe[1],ce=st.indexOf(oe),ve=ce+oe.length;Xe[2]&&(ve=st.length-Xe[2].length,ce=ve-oe.length);var Ne=je.substring(5);Y(Ze,Je+ne,st.substring(0,ce),Ue,Ye),Y(Ze,Je+ne+ce,oe,de(Ne,oe),Ye),Y(Ze,Je+ne+ve,st.substring(ve),Ue,Ye)}}Be.decorations=Ye};return Ue}function Oe(ae){var me=[],we=[];ae.tripleQuotedStrings?me.push([y,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ae.multiLineStrings?me.push([y,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):me.push([y,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ae.verbatimStrings&&we.push([y,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Me=ae.hashComments;Me&&(ae.cStyleComments?(Me>1?me.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):me.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),we.push([y,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):me.push([w,/^#[^\r\n]*/,null,"#"])),ae.cStyleComments&&(we.push([w,/^\/\/[^\r\n]*/,null]),we.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=ae.regexLiterals;if(Fe){var Ue=Fe>1?"":` +`):qe=qe.replace(/[ \t\r\n]+/g," "),Me[Be]=qe,Ue[Be<<1]=Fe,Fe+=qe.length,Ue[Be++<<1|1]=Je)}}return et(ae),{sourceCode:Me.join("").replace(/\n$/,""),spans:Ue}}function Y(ae,me,we,Me,Fe){if(!we)return;var Ue={sourceNode:ae,pre:1,langExtension:null,numberLines:null,sourceCode:we,spans:null,basePos:me,decorations:null};Me(Ue),Fe.push.apply(Fe,Ue.decorations)}var ee=/\S/;function le(ae){for(var me=void 0,we=ae.firstChild;we;we=we.nextSibling){var Me=we.nodeType;me=Me===1?me?ae:we:Me===3&&ee.test(we.nodeValue)?ae:me}return me===ae?void 0:me}function fe(ae,me){var we={},Me;(function(){for(var Be=ae.concat(me),et=[],Je={},Ze=0,Ye=Be.length;Ze=0;)we[qe.charAt(ot)]=ht;var Ie=ht[1],Qe=""+Ie;Je.hasOwnProperty(Qe)||(et.push(Ie),Je[Qe]=null)}et.push(/[\0-\uffff]/),Me=M(et)})();var Fe=me.length,Ue=function(Be){for(var et=Be.sourceCode,Je=Be.basePos,Ze=Be.sourceNode,Ye=[Je,u],ht=0,qe=et.match(Me)||[],ot={},Ie=0,Qe=qe.length;Ie=5&&je.substring(0,5)==="lang-",Ce&&!(Xe&&typeof Xe[1]=="string")&&(Ce=!1,je=D),Ce||(ot[st]=je)}var ne=ht;if(ht+=st.length,!Ce)Ye.push(Je+ne,je);else{var oe=Xe[1],ce=st.indexOf(oe),ve=ce+oe.length;Xe[2]&&(ve=st.length-Xe[2].length,ce=ve-oe.length);var Ne=je.substring(5);Y(Ze,Je+ne,st.substring(0,ce),Ue,Ye),Y(Ze,Je+ne+ce,oe,he(Ne,oe),Ye),Y(Ze,Je+ne+ve,st.substring(ve),Ue,Ye)}}Be.decorations=Ye};return Ue}function Oe(ae){var me=[],we=[];ae.tripleQuotedStrings?me.push([y,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ae.multiLineStrings?me.push([y,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):me.push([y,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ae.verbatimStrings&&we.push([y,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Me=ae.hashComments;Me&&(ae.cStyleComments?(Me>1?me.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):me.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),we.push([y,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):me.push([w,/^#[^\r\n]*/,null,"#"])),ae.cStyleComments&&(we.push([w,/^\/\/[^\r\n]*/,null]),we.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=ae.regexLiterals;if(Fe){var Ue=Fe>1?"":` \r`,Be=Ue?".":"[\\S\\s]",et="/(?=[^/*"+Ue+"])(?:[^/\\x5B\\x5C"+Ue+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+Ue+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";we.push(["lang-regex",RegExp("^"+z+"("+et+")")])}var Je=ae.types;Je&&we.push([x,Je]);var Ze=(""+ae.keywords).replace(/^ | $/g,"");Ze.length&&we.push([R,new RegExp("^(?:"+Ze.replace(/[\s,]+/g,"|")+")\\b"),null]),me.push([u,/^\s+/,null,` \r - \xA0`]);var Ye="^.[^\\s\\w.$@'\"`/\\\\]*";return ae.regexLiterals&&(Ye+="(?!s*/)"),we.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[x,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[h,new RegExp(Ye),null]),fe(me,we)}var Se=Oe({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ke(ae,me,we){for(var Me=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,Ue=ae.ownerDocument,Be=Ue.createElement("li");ae.firstChild;)Be.appendChild(ae.firstChild);var et=[Be];function Je(Ie){var Qe=Ie.nodeType;if(Qe==1&&!Me.test(Ie.className))if(Ie.nodeName==="br")Ze(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var st=Ie.firstChild;st;st=st.nextSibling)Je(st);else if((Qe==3||Qe==4)&&we){var je=Ie.nodeValue,Xe=je.match(Fe);if(Xe){var Ce=je.substring(0,Xe.index);Ie.nodeValue=Ce;var be=je.substring(Xe.index+Xe[0].length);if(be){var Ee=Ie.parentNode;Ee.insertBefore(Ue.createTextNode(be),Ie.nextSibling)}Ze(Ie),Ce||Ie.parentNode.removeChild(Ie)}}}function Ze(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function Qe(Xe,Ce){var be=Ce?Xe.cloneNode(!1):Xe,Ee=Xe.parentNode;if(Ee){var ne=Qe(Ee,1),oe=Xe.nextSibling;ne.appendChild(be);for(var ce=oe;ce;ce=oe)oe=ce.nextSibling,ne.appendChild(ce)}return be}for(var st=Qe(Ie.nextSibling,0),je;(je=st.parentNode)&&je.nodeType===1;)st=je;et.push(st)}for(var Ye=0;Ye=Ee&&(Je+=2),Ue>=ne&&(dt+=2)}}finally{je&&(je.style.display=Xe)}}var Ae={};function ge(ae,me){for(var we=me.length;--we>=0;){var Me=me[we];Ae.hasOwnProperty(Me)?U.console&&console.warn("cannot override language handler %s",Me):Ae[Me]=ae}}function de(ae,me){return ae&&Ae.hasOwnProperty(ae)||(ae=/^\s*]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ge(fe([[u,/^[\s]+/,null,` \r -`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[A,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["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"]),ge(fe([],[[B,/^[\s\S]+/]]),["uq.val"]),ge(Oe({keywords:f,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),ge(Oe({keywords:"null,true,false"}),["json"]),ge(Oe({keywords:p,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),ge(Oe({keywords:T,cStyleComments:!0}),["java"]),ge(Oe({keywords:l,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ge(Oe({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ge(Oe({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ge(Oe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ge(Oe({keywords:g,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ge(Oe({keywords:m,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ge(fe([],[[y,/^[\s\S]+/]]),["regex"]);function re(ae){var me=ae.langExtension;try{var we=N(ae.sourceNode,ae.pre),Me=we.sourceCode;ae.sourceCode=Me,ae.spans=we.spans,ae.basePos=0,de(me,Me)(ae),Le(ae)}catch(Fe){U.console&&console.log(Fe&&Fe.stack||Fe)}}function he(ae,me,we){var Me=we||!1,Fe=me||null,Ue=document.createElement("div");Ue.innerHTML="

      "+ae+"
      ",Ue=Ue.firstChild,Me&&ke(Ue,Me,!0);var Be={langExtension:Fe,numberLines:Me,sourceNode:Ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return re(Be),Ue.innerHTML}function se(ae,me){var we=me||document.body,Me=we.ownerDocument||document;function Fe(be){return we.getElementsByTagName(be)}for(var Ue=[Fe("pre"),Fe("code"),Fe("xmp")],Be=[],et=0;et=0){var l=i.split("!=");return U.create(l[0].trim(),this._deserializeValue(l[1],s))}if(i.indexOf("==")>=0){var l=i.split("==");return W.create(l[0].trim(),this._deserializeValue(l[1],s))}if(i.indexOf("=~")>=0){var l=i.split("=~");return L.create(l[0].trim(),this._deserializeRegexValue(l[1],s))}return/^\!\s*/.test(i)?O.create(i.substr(1).trim()):P.create(i)},a._deserializeValue=function(i,s){if(i=i.trim(),i==="true")return!0;if(i==="false")return!1;var l=/^'([^']*)'$/.exec(i);return l?l[1].trim():i},a._deserializeRegexValue=function(i,s){if(Object(ue.x)(i)){if(s)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var l=i.indexOf("/"),C=i.lastIndexOf("/");if(l===C||l<0){if(s)throw new Error("bad regexp-value '"+i+"', missing /-enclosure");return console.warn("bad regexp-value '"+i+"', missing /-enclosure"),null}var v=i.slice(l+1,C),y=i[C+1]==="i"?"i":"";try{return new RegExp(v,y)}catch(R){if(s)throw new Error("bad regexp-value '"+i+"', parse error: "+R);return console.warn("bad regexp-value '"+i+"', parse error: "+R),null}},a}();function F(a,i){var s=a.getType(),l=i.getType();if(s!==l)return s-l;switch(s){case 1:return a.cmp(i);case 2:return a.cmp(i);case 3:return a.cmp(i);case 4:return a.cmp(i);case 6:return a.cmp(i);case 7:return a.cmp(i);case 5:return a.cmp(i);default:throw new Error("Unknown ContextKeyExpr!")}}var P=function(){function a(i){this.key=i}return a.create=function(i){return new a(i)},a.prototype.getType=function(){return 1},a.prototype.cmp=function(i){return this.keyi.key?1:0},a.prototype.equals=function(i){return i instanceof a?this.key===i.key:!1},a.prototype.evaluate=function(i){return!!i.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return O.create(this.key)},a}(),W=function(){function a(i,s){this.key=i,this.value=s}return a.create=function(i,s){return typeof s=="boolean"?s?P.create(i):O.create(i):new a(i,s)},a.prototype.getType=function(){return 3},a.prototype.cmp=function(i){return this.keyi.key?1:this.valuei.value?1:0},a.prototype.equals=function(i){return i instanceof a?this.key===i.key&&this.value===i.value:!1},a.prototype.evaluate=function(i){return i.getValue(this.key)==this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return U.create(this.key,this.value)},a}(),U=function(){function a(i,s){this.key=i,this.value=s}return a.create=function(i,s){return typeof s=="boolean"?s?O.create(i):P.create(i):new a(i,s)},a.prototype.getType=function(){return 4},a.prototype.cmp=function(i){return this.keyi.key?1:this.valuei.value?1:0},a.prototype.equals=function(i){return i instanceof a?this.key===i.key&&this.value===i.value:!1},a.prototype.evaluate=function(i){return i.getValue(this.key)!=this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return W.create(this.key,this.value)},a}(),O=function(){function a(i){this.key=i}return a.create=function(i){return new a(i)},a.prototype.getType=function(){return 2},a.prototype.cmp=function(i){return this.keyi.key?1:0},a.prototype.equals=function(i){return i instanceof a?this.key===i.key:!1},a.prototype.evaluate=function(i){return!i.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return P.create(this.key)},a}(),L=function(){function a(i,s){this.key=i,this.regexp=s}return a.create=function(i,s){return new a(i,s)},a.prototype.getType=function(){return 6},a.prototype.cmp=function(i){if(this.keyi.key)return 1;var s=this.regexp?this.regexp.source:"",l=i.regexp?i.regexp.source:"";return sl?1:0},a.prototype.equals=function(i){if(i instanceof a){var s=this.regexp?this.regexp.source:"",l=i.regexp?i.regexp.source:"";return this.key===i.key&&s===l}return!1},a.prototype.evaluate=function(i){var s=i.getValue(this.key);return this.regexp?this.regexp.test(s):!1},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return d.create(this)},a}(),d=function(){function a(i){this._actual=i}return a.create=function(i){return new a(i)},a.prototype.getType=function(){return 7},a.prototype.cmp=function(i){return this._actual.cmp(i._actual)},a.prototype.equals=function(i){return i instanceof a?this._actual.equals(i._actual):!1},a.prototype.evaluate=function(i){return!this._actual.evaluate(i)},a.prototype.keys=function(){return this._actual.keys()},a.prototype.negate=function(){return this._actual},a}(),f=function(){function a(i){this.expr=i}return a.create=function(i){var s=a._normalizeArr(i);return s.length===0?void 0:s.length===1?s[0]:new a(s)},a.prototype.getType=function(){return 5},a.prototype.cmp=function(i){if(this.expr.lengthi.expr.length)return 1;for(var s=0,l=this.expr.length;s1;){for(var y=i.shift(),R=i.shift(),w=[],x=0,b=v(y);x=15&&(f=!1,O=!0);var y=s&&(L||f&&(v==null||v<12.11)),R=_||W&&U>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var x=function(e,t){var n=e.className,r=w(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function h(e,t){return b(e).appendChild(t)}function u(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),typeof t=="string")o.appendChild(document.createTextNode(t));else if(t)for(var k=0;k=t)return H+(t-k);H+=Z-k,H+=n-H%n,k=Z+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(H,t-o);if(o+=k-r,o+=n-o%n,r=k+1,o>=t)return r}}var ge=[""];function de(e){for(;ge.length<=e;)ge.push(re(ge)+" ");return ge[e]}function re(e){return e[e.length-1]}function he(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ae.test(e))}function we(e,t){return t?t.source.indexOf("\\w")>-1&&me(e)?!0:t.test(e):me(e)}function Me(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Fe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ue(e){return e.charCodeAt(0)>=768&&Fe.test(e)}function Be(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var o=(t+n)/2,k=r<0?Math.ceil(o):Math.floor(o);if(k==t)return e(k)?t:n;e(k)?n=k:t=k+r}}function Je(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,k=0;kt||t==n&&H.to==t)&&(r(Math.max(H.from,t),Math.min(H.to,n),H.level==1?"rtl":"ltr",k),o=!0)}o||r(t,n,"ltr")}var Ze=null;function Ye(e,t,n){var r;Ze=null;for(var o=0;ot)return o;k.to==t&&(k.from!=k.to&&n=="before"?r=o:Ze=o),k.from==t&&(k.from!=k.to&&n!="before"?r=o:Ze=o)}return r!=null?r:Ze}var dt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,k=/[LRr]/,H=/[Lb1n]/,Z=/[1n]/;function Q(te,pe,ye){this.level=te,this.from=pe,this.to=ye}return function(te,pe){var ye=pe=="ltr"?"L":"R";if(te.length==0||pe=="ltr"&&!r.test(te))return!1;for(var Pe=te.length,_e=[],We=0;We-1&&(r[t]=o.slice(0,k).concat(o.slice(k+1)))}}}function je(e,t){var n=Qe(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),o=0;o0}function Ee(e){e.prototype.on=function(t,n){Ie(this,t,n)},e.prototype.off=function(t,n){st(this,t,n)}}function ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ce(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ve(e){ne(e),oe(e)}function Ne(e){return e.target||e.srcElement}function Re(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ze=function(){if(W&&U<9)return!1;var e=u("div");return"draggable"in e||"dragDrop"in e}(),it;function ct(e){if(it==null){var t=u("span","\u200B");h(e,u("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(it=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&U<8))}var n=it?u("span","\u200B"):u("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var ht;function Lt(e){if(ht!=null)return ht;var t=h(e,document.createTextNode("A\u062EA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return b(e),!n||n.left==n.right?!1:ht=r.right-n.right<3}var wt=` + \xA0`]);var Ye="^.[^\\s\\w.$@'\"`/\\\\]*";return ae.regexLiterals&&(Ye+="(?!s*/)"),we.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[x,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[d,new RegExp(Ye),null]),fe(me,we)}var Se=Oe({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ke(ae,me,we){for(var Me=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,Ue=ae.ownerDocument,Be=Ue.createElement("li");ae.firstChild;)Be.appendChild(ae.firstChild);var et=[Be];function Je(Ie){var Qe=Ie.nodeType;if(Qe==1&&!Me.test(Ie.className))if(Ie.nodeName==="br")Ze(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var st=Ie.firstChild;st;st=st.nextSibling)Je(st);else if((Qe==3||Qe==4)&&we){var je=Ie.nodeValue,Xe=je.match(Fe);if(Xe){var Ce=je.substring(0,Xe.index);Ie.nodeValue=Ce;var be=je.substring(Xe.index+Xe[0].length);if(be){var Ee=Ie.parentNode;Ee.insertBefore(Ue.createTextNode(be),Ie.nextSibling)}Ze(Ie),Ce||Ie.parentNode.removeChild(Ie)}}}function Ze(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function Qe(Xe,Ce){var be=Ce?Xe.cloneNode(!1):Xe,Ee=Xe.parentNode;if(Ee){var ne=Qe(Ee,1),oe=Xe.nextSibling;ne.appendChild(be);for(var ce=oe;ce;ce=oe)oe=ce.nextSibling,ne.appendChild(ce)}return be}for(var st=Qe(Ie.nextSibling,0),je;(je=st.parentNode)&&je.nodeType===1;)st=je;et.push(st)}for(var Ye=0;Ye=Ee&&(Je+=2),Ue>=ne&&(ht+=2)}}finally{je&&(je.style.display=Xe)}}var Ae={};function ge(ae,me){for(var we=me.length;--we>=0;){var Me=me[we];Ae.hasOwnProperty(Me)?U.console&&console.warn("cannot override language handler %s",Me):Ae[Me]=ae}}function he(ae,me){return ae&&Ae.hasOwnProperty(ae)||(ae=/^\s*]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[d,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ge(fe([[u,/^[\s]+/,null,` \r +`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[A,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[d,/^[=<>\/]+/],["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"]),ge(fe([],[[B,/^[\s\S]+/]]),["uq.val"]),ge(Oe({keywords:f,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),ge(Oe({keywords:"null,true,false"}),["json"]),ge(Oe({keywords:p,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),ge(Oe({keywords:T,cStyleComments:!0}),["java"]),ge(Oe({keywords:l,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ge(Oe({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ge(Oe({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ge(Oe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ge(Oe({keywords:g,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ge(Oe({keywords:m,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ge(fe([],[[y,/^[\s\S]+/]]),["regex"]);function re(ae){var me=ae.langExtension;try{var we=N(ae.sourceNode,ae.pre),Me=we.sourceCode;ae.sourceCode=Me,ae.spans=we.spans,ae.basePos=0,he(me,Me)(ae),Le(ae)}catch(Fe){U.console&&console.log(Fe&&Fe.stack||Fe)}}function de(ae,me,we){var Me=we||!1,Fe=me||null,Ue=document.createElement("div");Ue.innerHTML="
      "+ae+"
      ",Ue=Ue.firstChild,Me&&ke(Ue,Me,!0);var Be={langExtension:Fe,numberLines:Me,sourceNode:Ue,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return re(Be),Ue.innerHTML}function se(ae,me){var we=me||document.body,Me=we.ownerDocument||document;function Fe(be){return we.getElementsByTagName(be)}for(var Ue=[Fe("pre"),Fe("code"),Fe("xmp")],Be=[],et=0;et=0){var l=i.split("!=");return U.create(l[0].trim(),this._deserializeValue(l[1],s))}if(i.indexOf("==")>=0){var l=i.split("==");return W.create(l[0].trim(),this._deserializeValue(l[1],s))}if(i.indexOf("=~")>=0){var l=i.split("=~");return L.create(l[0].trim(),this._deserializeRegexValue(l[1],s))}return/^\!\s*/.test(i)?O.create(i.substr(1).trim()):P.create(i)},a._deserializeValue=function(i,s){if(i=i.trim(),i==="true")return!0;if(i==="false")return!1;var l=/^'([^']*)'$/.exec(i);return l?l[1].trim():i},a._deserializeRegexValue=function(i,s){if(Object(ue.x)(i)){if(s)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var l=i.indexOf("/"),C=i.lastIndexOf("/");if(l===C||l<0){if(s)throw new Error("bad regexp-value '"+i+"', missing /-enclosure");return console.warn("bad regexp-value '"+i+"', missing /-enclosure"),null}var v=i.slice(l+1,C),y=i[C+1]==="i"?"i":"";try{return new RegExp(v,y)}catch(R){if(s)throw new Error("bad regexp-value '"+i+"', parse error: "+R);return console.warn("bad regexp-value '"+i+"', parse error: "+R),null}},a}();function F(a,i){var s=a.getType(),l=i.getType();if(s!==l)return s-l;switch(s){case 1:return a.cmp(i);case 2:return a.cmp(i);case 3:return a.cmp(i);case 4:return a.cmp(i);case 6:return a.cmp(i);case 7:return a.cmp(i);case 5:return a.cmp(i);default:throw new Error("Unknown ContextKeyExpr!")}}var P=function(){function a(i){this.key=i}return a.create=function(i){return new a(i)},a.prototype.getType=function(){return 1},a.prototype.cmp=function(i){return this.keyi.key?1:0},a.prototype.equals=function(i){return i instanceof a?this.key===i.key:!1},a.prototype.evaluate=function(i){return!!i.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return O.create(this.key)},a}(),W=function(){function a(i,s){this.key=i,this.value=s}return a.create=function(i,s){return typeof s=="boolean"?s?P.create(i):O.create(i):new a(i,s)},a.prototype.getType=function(){return 3},a.prototype.cmp=function(i){return this.keyi.key?1:this.valuei.value?1:0},a.prototype.equals=function(i){return i instanceof a?this.key===i.key&&this.value===i.value:!1},a.prototype.evaluate=function(i){return i.getValue(this.key)==this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return U.create(this.key,this.value)},a}(),U=function(){function a(i,s){this.key=i,this.value=s}return a.create=function(i,s){return typeof s=="boolean"?s?O.create(i):P.create(i):new a(i,s)},a.prototype.getType=function(){return 4},a.prototype.cmp=function(i){return this.keyi.key?1:this.valuei.value?1:0},a.prototype.equals=function(i){return i instanceof a?this.key===i.key&&this.value===i.value:!1},a.prototype.evaluate=function(i){return i.getValue(this.key)!=this.value},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return W.create(this.key,this.value)},a}(),O=function(){function a(i){this.key=i}return a.create=function(i){return new a(i)},a.prototype.getType=function(){return 2},a.prototype.cmp=function(i){return this.keyi.key?1:0},a.prototype.equals=function(i){return i instanceof a?this.key===i.key:!1},a.prototype.evaluate=function(i){return!i.getValue(this.key)},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return P.create(this.key)},a}(),L=function(){function a(i,s){this.key=i,this.regexp=s}return a.create=function(i,s){return new a(i,s)},a.prototype.getType=function(){return 6},a.prototype.cmp=function(i){if(this.keyi.key)return 1;var s=this.regexp?this.regexp.source:"",l=i.regexp?i.regexp.source:"";return sl?1:0},a.prototype.equals=function(i){if(i instanceof a){var s=this.regexp?this.regexp.source:"",l=i.regexp?i.regexp.source:"";return this.key===i.key&&s===l}return!1},a.prototype.evaluate=function(i){var s=i.getValue(this.key);return this.regexp?this.regexp.test(s):!1},a.prototype.keys=function(){return[this.key]},a.prototype.negate=function(){return h.create(this)},a}(),h=function(){function a(i){this._actual=i}return a.create=function(i){return new a(i)},a.prototype.getType=function(){return 7},a.prototype.cmp=function(i){return this._actual.cmp(i._actual)},a.prototype.equals=function(i){return i instanceof a?this._actual.equals(i._actual):!1},a.prototype.evaluate=function(i){return!this._actual.evaluate(i)},a.prototype.keys=function(){return this._actual.keys()},a.prototype.negate=function(){return this._actual},a}(),f=function(){function a(i){this.expr=i}return a.create=function(i){var s=a._normalizeArr(i);return s.length===0?void 0:s.length===1?s[0]:new a(s)},a.prototype.getType=function(){return 5},a.prototype.cmp=function(i){if(this.expr.lengthi.expr.length)return 1;for(var s=0,l=this.expr.length;s1;){for(var y=i.shift(),R=i.shift(),w=[],x=0,b=v(y);x=15&&(f=!1,O=!0);var y=s&&(L||f&&(v==null||v<12.11)),R=_||W&&U>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var x=function(e,t){var n=e.className,r=w(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function d(e,t){return b(e).appendChild(t)}function u(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),typeof t=="string")o.appendChild(document.createTextNode(t));else if(t)for(var k=0;k=t)return H+(t-k);H+=Z-k,H+=n-H%n,k=Z+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=M(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(H,t-o);if(o+=k-r,o+=n-o%n,r=k+1,o>=t)return r}}var ge=[""];function he(e){for(;ge.length<=e;)ge.push(re(ge)+" ");return ge[e]}function re(e){return e[e.length-1]}function de(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ae.test(e))}function we(e,t){return t?t.source.indexOf("\\w")>-1&&me(e)?!0:t.test(e):me(e)}function Me(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Fe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ue(e){return e.charCodeAt(0)>=768&&Fe.test(e)}function Be(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var o=(t+n)/2,k=r<0?Math.ceil(o):Math.floor(o);if(k==t)return e(k)?t:n;e(k)?n=k:t=k+r}}function Je(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var o=!1,k=0;kt||t==n&&H.to==t)&&(r(Math.max(H.from,t),Math.min(H.to,n),H.level==1?"rtl":"ltr",k),o=!0)}o||r(t,n,"ltr")}var Ze=null;function Ye(e,t,n){var r;Ze=null;for(var o=0;ot)return o;k.to==t&&(k.from!=k.to&&n=="before"?r=o:Ze=o),k.from==t&&(k.from!=k.to&&n!="before"?r=o:Ze=o)}return r!=null?r:Ze}var ht=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(te){return te<=247?e.charAt(te):1424<=te&&te<=1524?"R":1536<=te&&te<=1785?t.charAt(te-1536):1774<=te&&te<=2220?"r":8192<=te&&te<=8203?"w":te==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,k=/[LRr]/,H=/[Lb1n]/,Z=/[1n]/;function Q(te,pe,ye){this.level=te,this.from=pe,this.to=ye}return function(te,pe){var ye=pe=="ltr"?"L":"R";if(te.length==0||pe=="ltr"&&!r.test(te))return!1;for(var Pe=te.length,_e=[],We=0;We-1&&(r[t]=o.slice(0,k).concat(o.slice(k+1)))}}}function je(e,t){var n=Qe(e,t);if(!n.length)return;for(var r=Array.prototype.slice.call(arguments,2),o=0;o0}function Ee(e){e.prototype.on=function(t,n){Ie(this,t,n)},e.prototype.off=function(t,n){st(this,t,n)}}function ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ce(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ve(e){ne(e),oe(e)}function Ne(e){return e.target||e.srcElement}function Re(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ze=function(){if(W&&U<9)return!1;var e=u("div");return"draggable"in e||"dragDrop"in e}(),it;function ct(e){if(it==null){var t=u("span","\u200B");d(e,u("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(it=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&U<8))}var n=it?u("span","\u200B"):u("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var dt;function Lt(e){if(dt!=null)return dt;var t=d(e,document.createTextNode("A\u062EA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return b(e),!n||n.left==n.right?!1:dt=r.right-n.right<3}var wt=` b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e.indexOf(` -`,t);o==-1&&(o=e.length);var k=e.slice(t,e.charAt(o-1)=="\r"?o-1:o),H=k.indexOf("\r");H!=-1?(n.push(k.slice(0,H)),t+=H+1):(n.push(k),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ft=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},zt=function(){var e=u("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ft=null;function Jt(e){if(Ft!=null)return Ft;var t=h(e,u("span","x")),n=t.getBoundingClientRect(),r=S(t,0,1).getBoundingClientRect();return Ft=Math.abs(n.left-r.left)>1}var Ht={},kt={};function Ur(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ht[e]=t}function Zr(e,t){kt[e]=t}function bt(e){if(typeof e=="string"&&kt.hasOwnProperty(e))e=kt[e];else if(e&&typeof e.name=="string"&&kt.hasOwnProperty(e.name)){var t=kt[e.name];typeof t=="string"&&(t={name:t}),e=ie(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ct(e,t){t=bt(t);var n=Ht[t.name];if(!n)return Ct(e,"text/plain");var r=n(e,t);if(at.hasOwnProperty(t.name)){var o=at[t.name];for(var k in o){if(!o.hasOwnProperty(k))continue;r.hasOwnProperty(k)&&(r["_"+k]=r[k]),r[k]=o[k]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var H in t.modeProps)r[H]=t.modeProps[H];return r}var at={};function xt(e,t){var n=at.hasOwnProperty(e)?at[e]:at[e]={};N(t,n)}function Zt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function nr(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function rr(e,t,n){return e.startState?e.startState(t,n):!0}var Rt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Rt.prototype.eol=function(){return this.pos>=this.string.length},Rt.prototype.sol=function(){return this.pos==this.lineStart},Rt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Rt.prototype.next=function(){if(this.post},Rt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Rt.prototype.skipToEnd=function(){this.pos=this.string.length},Rt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Rt.prototype.backUp=function(e){this.pos-=e},Rt.prototype.column=function(){return this.lastColumnPos0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},Rt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Rt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Rt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Rt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function vt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],k=o.chunkSize();if(t=e.first&&tn?He(n,vt(e,n).text.length):E(t,vt(e,t.line).text.length)}function E(e,t){var n=e.ch;return n==null||n>t?He(e.line,t):n<0?He(e.line,0):e}function G(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},V.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,n){return t instanceof $?new V(e,Zt(e.mode,t.state),n,t.lookAhead):new V(e,Zt(e.mode,t),n)},V.prototype.save=function(e){var t=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new $(t,this.maxLookAhead):t};function xe(e,t,n,r){var o=[e.state.modeGen],k={};Vr(e,t.text,e.doc.mode,n,function(te,pe){return o.push(te,pe)},k,r);for(var H=n.state,Z=function(te){n.baseTokens=o;var pe=e.state.overlays[te],ye=1,Pe=0;n.state=!0,Vr(e,t.text,pe.mode,n,function(_e,We){for(var Ve=ye;Pe<_e;){var $e=o[ye];$e>_e&&o.splice(ye,1,_e,o[ye+1],$e),ye+=2,Pe=Math.min(_e,$e)}if(!We)return;if(pe.opaque)o.splice(Ve,ye-Ve,_e,"overlay "+We),ye=Ve+2;else for(;Vee.options.maxHighlightLength&&Zt(e.doc.mode,r.state),k=xe(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function tt(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new V(r,!0,t);var k=pr(e,t,n),H=k>r.first&&vt(r,k-1).stateAfter,Z=H?V.fromSaved(r,H,k):new V(r,rr(r.mode),k);return r.iter(k,t,function(Q){mt(e,Q.text,Z);var te=Z.line;Q.stateAfter=te==t-1||te%5==0||te>=o.viewFrom&&tet.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var It=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function er(e,t,n,r){var o=e.doc,k=o.mode,H;t=c(o,t);var Z=vt(o,t.line),Q=tt(e,t.line,n),te=new Rt(Z.text,e.options.tabSize,Q),pe;for(r&&(pe=[]);(r||te.pose.options.maxHighlightLength?(Z=!1,H&&mt(e,t,r,pe.pos),pe.pos=t.length,ye=null):ye=Kr(At(n,pe,r.state,Pe),k),Pe){var _e=Pe[0].name;_e&&(ye="m-"+(ye?_e+" "+ye:_e))}if(!Z||te!=ye){for(;QH;--Z){if(Z<=k.first)return k.first;var Q=vt(k,Z-1),te=Q.stateAfter;if(te&&(!n||Z+(te instanceof $?te.lookAhead:0)<=k.modeFrontier))return Z;var pe=Y(Q.text,null,e.options.tabSize);(o==null||r>pe)&&(o=Z-1,r=pe)}return o}function Qr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontiern;r--){var o=vt(e,r).stateAfter;if(o&&(!(o instanceof $)||r+o.lookAhead=t:k.to>t);(r||(r=[])).push(new bn(H,k.from,Q?null:k.to))}}return r}function zn(e,t,n){var r;if(e)for(var o=0;o=t:k.to>t);if(Z||k.from==t&&H.type=="bookmark"&&(!n||k.marker.insertLeft)){var Q=k.from==null||(H.inclusiveLeft?k.from<=t:k.from0&&Z)for(var gt=0;gt0)continue;var pe=[Q,1],ye=lt(te.from,Z.from),Pe=lt(te.to,Z.to);(ye<0||!H.inclusiveLeft&&!ye)&&pe.push({from:te.from,to:Z.from}),(Pe>0||!H.inclusiveRight&&!Pe)&&pe.push({from:Z.to,to:te.to}),o.splice.apply(o,pe),Q+=pe.length-3}return o}function _n(e){var t=e.markedSpans;if(!t)return;for(var n=0;nt)&&(!r||Er(r,k.marker)<0)&&(r=k.marker)}return r}function lr(e,t,n,r,o){var k=vt(e,t),H=_r&&k.markedSpans;if(H)for(var Z=0;Z=0&&ye<=0||pe<=0&&ye>=0)continue;if(pe<=0&&(Q.marker.inclusiveRight&&o.inclusiveLeft?lt(te.to,n)>=0:lt(te.to,n)>0)||pe>=0&&(Q.marker.inclusiveRight&&o.inclusiveLeft?lt(te.from,r)<=0:lt(te.from,r)<0))return!0}}function Or(e){for(var t;t=dr(e);)e=t.find(-1,!0).line;return e}function Kn(e){for(var t;t=Vt(e);)e=t.find(1,!0).line;return e}function Vn(e){for(var t,n;t=Vt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function xn(e,t){var n=vt(e,t),r=Or(n);return n==r?t:_t(r)}function Ui(e,t){if(t>e.lastLine())return t;var n=vt(e,t),r;if(!Wr(e,n))return t;for(;r=Vt(n);)n=r.find(1,!0).line;return _t(n)+1}function Wr(e,t){var n=_r&&t.markedSpans;if(n)for(var r=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=o,t.maxLine=r)})}var On=function(e,t,n){this.text=e,ci(this,t),this.height=n?n(this):1};On.prototype.lineNo=function(){return _t(this)},Ee(On);function $a(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),_n(e),ci(e,n);var o=r?r(e):1;o!=e.height&&Tr(e,o)}function da(e){e.parent=null,_n(e)}var yt={},Dt={};function St(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Dt:yt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Mt(e,t){var n=A("span",null,null,O?"padding-right: .1px":null),r={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var k=o?t.rest[o-1]:t.line,H=void 0;r.pos=0,r.addToken=$t,Lt(e.display.measure)&&(H=qe(k,e.doc.direction))&&(r.addToken=hr(r.addToken,H)),r.map=[];var Z=t!=e.display.externalMeasured&&_t(k);Nt(k,r,Ge(e,k,Z)),k.styleClasses&&(k.styleClasses.bgClass&&(r.bgClass=j(k.styleClasses.bgClass,r.bgClass||"")),k.styleClasses.textClass&&(r.textClass=j(k.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(ct(e.display.measure))),o==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(O){var Q=r.content.lastChild;(/\bcm-tab\b/.test(Q.className)||Q.querySelector&&Q.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=j(r.pre.className,r.textClass||"")),r}function Wt(e){var t=u("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function $t(e,t,n,r,o,k,H){if(!t)return;var Z=e.splitSpaces?Bt(t,e.trailingSpace):t,Q=e.cm.state.specialChars,te=!1,pe;if(!Q.test(t))e.col+=t.length,pe=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,pe),W&&U<9&&(te=!0),e.pos+=t.length;else{pe=document.createDocumentFragment();for(var ye=0;;){Q.lastIndex=ye;var Pe=Q.exec(t),_e=Pe?Pe.index-ye:t.length-ye;if(_e){var We=document.createTextNode(Z.slice(ye,ye+_e));W&&U<9?pe.appendChild(u("span",[We])):pe.appendChild(We),e.map.push(e.pos,e.pos+_e,We),e.col+=_e,e.pos+=_e}if(!Pe)break;ye+=_e+1;var Ve=void 0;if(Pe[0]==" "){var $e=e.cm.options.tabSize,rt=$e-e.col%$e;Ve=pe.appendChild(u("span",de(rt),"cm-tab")),Ve.setAttribute("role","presentation"),Ve.setAttribute("cm-text"," "),e.col+=rt}else Pe[0]=="\r"||Pe[0]==` -`?(Ve=pe.appendChild(u("span",Pe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ve.setAttribute("cm-text",Pe[0]),e.col+=1):(Ve=e.cm.options.specialCharPlaceholder(Pe[0]),Ve.setAttribute("cm-text",Pe[0]),W&&U<9?pe.appendChild(u("span",[Ve])):pe.appendChild(Ve),e.col+=1);e.map.push(e.pos,e.pos+1,Ve),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,n||r||o||te||k||H){var ut=n||"";r&&(ut+=r),o&&(ut+=o);var nt=u("span",[pe],ut,k);if(H)for(var gt in H)H.hasOwnProperty(gt)&>!="style"&>!="class"&&nt.setAttribute(gt,H[gt]);return e.content.appendChild(nt)}e.content.appendChild(pe)}function Bt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",o=0;ote&&ye.from<=te);Pe++);if(ye.to>=pe)return e(n,r,o,k,H,Z,Q);e(n,r.slice(0,ye.to-te),o,k,null,Z,Q),k=null,r=r.slice(ye.to-te),te=ye.to}}}function Pr(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function Nt(e,t,n){var r=e.markedSpans,o=e.text,k=0;if(!r){for(var H=1;HQ||Ot.collapsed&&Et.to==Q&&Et.from==Q)){if(Et.to!=null&&Et.to!=Q&&_e>Et.to&&(_e=Et.to,Ve=""),Ot.className&&(We+=" "+Ot.className),Ot.css&&(Pe=(Pe?Pe+";":"")+Ot.css),Ot.startStyle&&Et.from==Q&&($e+=" "+Ot.startStyle),Ot.endStyle&&Et.to==_e&&(gt||(gt=[])).push(Ot.endStyle,Et.to),Ot.title&&((ut||(ut={})).title=Ot.title),Ot.attributes)for(var tr in Ot.attributes)(ut||(ut={}))[tr]=Ot.attributes[tr];Ot.collapsed&&(!rt||Er(rt.marker,Ot)<0)&&(rt=Et)}else Et.from>Q&&_e>Et.from&&(_e=Et.from)}if(gt)for(var br=0;br=Z)break;for(var Gr=Math.min(Z,_e);;){if(pe){var Nr=Q+pe.length;if(!rt){var cr=Nr>Gr?pe.slice(0,Gr-Q):pe;t.addToken(t,cr,ye?ye+We:We,$e,Q+cr.length==_e?Ve:"",Pe,ut)}if(Nr>=Gr){pe=pe.slice(Gr-Q),Q=Gr;break}Q=Nr,$e=""}pe=o.slice(k,k=n[te++]),ye=St(n[te++],t.cm.options)}}}function En(e,t,n){this.line=t,this.rest=Vn(t),this.size=this.rest?_t(re(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Wr(e,t)}function Gt(e,t,n){for(var r=[],o,k=t;k2&&k.push((Q.bottom+te.top)/2-n.top)}}k.push(n.bottom-n.top)}}function ro(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Us(e,t){t=Or(t);var n=_t(t),r=e.display.externalMeasured=new En(e.doc,t,n);r.lineN=n;var o=r.built=Mt(e,r);return r.text=o.pre,h(e.display.lineMeasure,o.pre),r}function no(e,t,n,r){return fn(e,Yn(e,t),n,r)}function pa(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(k=Q-Z,o=k-1,t>=Q&&(H="right")),o!=null){if(r=e[te+2],Z==Q&&n==(r.insertLeft?"left":"right")&&(H=n),n=="left"&&o==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)r=e[(te-=3)+2],H="left";if(n=="right"&&o==Q-Z)for(;te=0&&!((n=e[o]).left!=n.right);o--);return n}function Ws(e,t,n,r){var o=ao(t.map,n,r),k=o.node,H=o.start,Z=o.end,Q=o.collapse,te;if(k.nodeType==3){for(var pe=0;pe<4;pe++){for(;H&&Ue(t.line.text.charAt(o.coverStart+H));)--H;for(;o.coverStart+Z0&&(Q=r="right");var ye;e.options.lineWrapping&&(ye=k.getClientRects()).length>1?te=ye[r=="right"?ye.length-1:0]:te=k.getBoundingClientRect()}if(W&&U<9&&!H&&(!te||!te.left&&!te.right)){var Pe=k.parentNode.getClientRects()[0];Pe?te={left:Pe.left,right:Pe.left+Jn(e.display),top:Pe.top,bottom:Pe.bottom}:te=io}for(var _e=te.top-t.rect.top,We=te.bottom-t.rect.top,Ve=(_e+We)/2,$e=t.view.measure.heights,rt=0;rt<$e.length-1&&!(Ve<$e[rt]);rt++);var ut=rt?$e[rt-1]:0,nt=$e[rt],gt={left:(Q=="right"?te.right:te.left)-t.rect.left,right:(Q=="left"?te.left:te.right)-t.rect.left,top:ut,bottom:nt};return!te.left&&!te.right&&(gt.bogus=!0),e.options.singleCursorHeightPerLine||(gt.rtop=_e,gt.rbottom=We),gt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Jt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function oo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(Q=r.text.length,te="before"):Q<=0&&(Q=0,te="after"),!Z)return H(te=="before"?Q-1:Q,te=="before");function pe(We,Ve,$e){var rt=Z[Ve],ut=rt.level==1;return H($e?We-1:We,ut!=$e)}var ye=Ye(Z,Q,te),Pe=Ze,_e=pe(Q,ye,te=="before");return Pe!=null&&(_e.other=pe(Q,Pe,te!="before")),_e}function co(e,t){var n=0;t=c(e.doc,t),e.options.lineWrapping||(n=Jn(e.display)*t.ch);var r=vt(e.doc,t.line),o=on(r)+Hi(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function va(e,t,n,r,o){var k=He(e,t,n);return k.xRel=o,r&&(k.outside=r),k}function ya(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return va(r.first,0,null,-1,-1);var o=Lr(r,n),k=r.first+r.size-1;if(o>k)return va(r.first+r.size-1,vt(r,k).text.length,null,1,1);t<0&&(t=0);for(var H=vt(r,o);;){var Z=Gs(e,H,o,t,n),Q=hn(H,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!Q)return Z;var te=Q.find(1);if(te.line==o)return te;H=vt(r,o=te.line)}}function fo(e,t,n,r){r-=ma(t);var o=t.text.length,k=et(function(H){return fn(e,n,H-1).bottom<=r},o,0);return o=et(function(H){return fn(e,n,H).top>r},k,o),{begin:k,end:o}}function po(e,t,n,r){n||(n=Yn(e,t));var o=Gi(e,t,fn(e,n,r),"line").top;return fo(e,t,n,o)}function ba(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Gs(e,t,n,r,o){o-=on(t);var k=Yn(e,t),H=ma(t),Z=0,Q=t.text.length,te=!0,pe=qe(t,e.doc.direction);if(pe){var ye=(e.options.lineWrapping?Ks:zs)(e,t,n,k,pe,r,o);te=ye.level!=1,Z=te?ye.from:ye.to-1,Q=te?ye.to:ye.from-1}var Pe=null,_e=null,We=et(function(Tt){var Et=fn(e,k,Tt);return Et.top+=H,Et.bottom+=H,ba(Et,r,o,!1)?(Et.top<=o&&Et.left<=r&&(Pe=Tt,_e=Et),!0):!1},Z,Q),Ve,$e,rt=!1;if(_e){var ut=r-_e.left<_e.right-r,nt=ut==te;We=Pe+(nt?0:1),$e=nt?"after":"before",Ve=ut?_e.left:_e.right}else{!te&&(We==Q||We==Z)&&We++,$e=We==0?"after":We==t.text.length?"before":fn(e,k,We-(te?1:0)).bottom+H<=o==te?"after":"before";var gt=sn(e,He(n,We,$e),"line",t,k);Ve=gt.left,rt=o=gt.bottom?1:0}return We=Be(t.text,We,1),va(n,We,$e,rt,r-Ve)}function zs(e,t,n,r,o,k,H){var Z=et(function(ye){var Pe=o[ye],_e=Pe.level!=1;return ba(sn(e,He(n,_e?Pe.to:Pe.from,_e?"before":"after"),"line",t,r),k,H,!0)},0,o.length-1),Q=o[Z];if(Z>0){var te=Q.level!=1,pe=sn(e,He(n,te?Q.from:Q.to,te?"after":"before"),"line",t,r);ba(pe,k,H,!0)&&pe.top>H&&(Q=o[Z-1])}return Q}function Ks(e,t,n,r,o,k,H){var Z=fo(e,t,r,H),Q=Z.begin,te=Z.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var pe=null,ye=null,Pe=0;Pe=te||_e.to<=Q)continue;var We=_e.level!=1,Ve=fn(e,r,We?Math.min(te,_e.to)-1:Math.max(Q,_e.from)).right,$e=Ve$e)&&(pe=_e,ye=$e)}return pe||(pe=o[o.length-1]),pe.fromte&&(pe={from:pe.from,to:te,level:pe.level}),pe}var Mn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Mn==null){Mn=u("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Mn.appendChild(document.createTextNode("x")),Mn.appendChild(u("br"));Mn.appendChild(document.createTextNode("x"))}h(e.measure,Mn);var n=Mn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),b(e.measure),n||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=u("span","xxxxxxxxxx"),n=u("pre",[t],"CodeMirror-line-like");h(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function xa(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,k=t.gutters.firstChild,H=0;k;k=k.nextSibling,++H){var Z=e.display.gutterSpecs[H].className;n[Z]=k.offsetLeft+k.clientLeft+o,r[Z]=k.clientWidth}return{fixedPos:Ea(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ea(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function mo(e){var t=$n(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(o){if(Wr(e.doc,o))return 0;var k=0;if(o.widgets)for(var H=0;H0&&(te=vt(e.doc,Q.line).text).length==Q.ch){var pe=Y(te,te.length,e.options.tabSize)-te.length;Q=He(Q.line,Math.max(0,Math.round((k-to(e.display).left)/Jn(e.display))-pe))}return Q}function Nn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;rt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)_r&&xn(e.doc,t)o.viewFrom?Sn(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)Sn(e);else if(t<=o.viewFrom){var k=zi(e,n,n+r,1);k?(o.view=o.view.slice(k.index),o.viewFrom=k.lineN,o.viewTo+=r):Sn(e)}else if(n>=o.viewTo){var H=zi(e,t,t,-1);H?(o.view=o.view.slice(0,H.index),o.viewTo=H.lineN):Sn(e)}else{var Z=zi(e,t,t,-1),Q=zi(e,n,n+r,1);Z&&Q?(o.view=o.view.slice(0,Z.index).concat(Gt(e,Z.lineN,Q.lineN)).concat(o.view.slice(Q.index)),o.viewTo+=r):Sn(e)}var te=o.externalMeasured;te&&(n=o.lineN&&t=r.viewTo)return;var k=r.view[Nn(e,t)];if(k.node==null)return;var H=k.changes||(k.changes=[]);le(H,n)==-1&&H.push(n)}function Sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zi(e,t,n,r){var o=Nn(e,t),k,H=e.display.view;if(!_r||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var Z=e.display.viewFrom,Q=0;Q0){if(o==H.length-1)return null;k=Z+H[o].size-t,o++}else k=Z-t;t+=k,n+=k}for(;xn(e.doc,n)!=n;){if(o==(r<0?0:H.length-1))return null;n+=r*H[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Vs(e,t,n){var r=e.display,o=r.view;o.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Gt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Gt(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Nn(e,n)))),r.viewTo=n}function go(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||Z.to().line1}var Ht={},kt={};function Ur(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ht[e]=t}function Zr(e,t){kt[e]=t}function bt(e){if(typeof e=="string"&&kt.hasOwnProperty(e))e=kt[e];else if(e&&typeof e.name=="string"&&kt.hasOwnProperty(e.name)){var t=kt[e.name];typeof t=="string"&&(t={name:t}),e=ie(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ct(e,t){t=bt(t);var n=Ht[t.name];if(!n)return Ct(e,"text/plain");var r=n(e,t);if(at.hasOwnProperty(t.name)){var o=at[t.name];for(var k in o){if(!o.hasOwnProperty(k))continue;r.hasOwnProperty(k)&&(r["_"+k]=r[k]),r[k]=o[k]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var H in t.modeProps)r[H]=t.modeProps[H];return r}var at={};function xt(e,t){var n=at.hasOwnProperty(e)?at[e]:at[e]={};N(t,n)}function Zt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n}function nr(e,t){for(var n;e.innerMode&&!(n=e.innerMode(t),!n||n.mode==e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function rr(e,t,n){return e.startState?e.startState(t,n):!0}var Rt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Rt.prototype.eol=function(){return this.pos>=this.string.length},Rt.prototype.sol=function(){return this.pos==this.lineStart},Rt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Rt.prototype.next=function(){if(this.post},Rt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Rt.prototype.skipToEnd=function(){this.pos=this.string.length},Rt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Rt.prototype.backUp=function(e){this.pos-=e},Rt.prototype.column=function(){return this.lastColumnPos0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},Rt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Rt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Rt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Rt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function vt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var o=n.children[r],k=o.chunkSize();if(t=e.first&&tn?He(n,vt(e,n).text.length):E(t,vt(e,t.line).text.length)}function E(e,t){var n=e.ch;return n==null||n>t?He(e.line,t):n<0?He(e.line,0):e}function G(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},V.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},V.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},V.fromSaved=function(e,t,n){return t instanceof $?new V(e,Zt(e.mode,t.state),n,t.lookAhead):new V(e,Zt(e.mode,t),n)},V.prototype.save=function(e){var t=e!==!1?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new $(t,this.maxLookAhead):t};function xe(e,t,n,r){var o=[e.state.modeGen],k={};Vr(e,t.text,e.doc.mode,n,function(te,pe){return o.push(te,pe)},k,r);for(var H=n.state,Z=function(te){n.baseTokens=o;var pe=e.state.overlays[te],ye=1,Pe=0;n.state=!0,Vr(e,t.text,pe.mode,n,function(_e,We){for(var Ve=ye;Pe<_e;){var $e=o[ye];$e>_e&&o.splice(ye,1,_e,o[ye+1],$e),ye+=2,Pe=Math.min(_e,$e)}if(!We)return;if(pe.opaque)o.splice(Ve,ye-Ve,_e,"overlay "+We),ye=Ve+2;else for(;Vee.options.maxHighlightLength&&Zt(e.doc.mode,r.state),k=xe(e,t,r);o&&(r.state=o),t.stateAfter=r.save(!o),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function tt(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return new V(r,!0,t);var k=pr(e,t,n),H=k>r.first&&vt(r,k-1).stateAfter,Z=H?V.fromSaved(r,H,k):new V(r,rr(r.mode),k);return r.iter(k,t,function(Q){mt(e,Q.text,Z);var te=Z.line;Q.stateAfter=te==t-1||te%5==0||te>=o.viewFrom&&tet.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var It=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function er(e,t,n,r){var o=e.doc,k=o.mode,H;t=c(o,t);var Z=vt(o,t.line),Q=tt(e,t.line,n),te=new Rt(Z.text,e.options.tabSize,Q),pe;for(r&&(pe=[]);(r||te.pose.options.maxHighlightLength?(Z=!1,H&&mt(e,t,r,pe.pos),pe.pos=t.length,ye=null):ye=Kr(At(n,pe,r.state,Pe),k),Pe){var _e=Pe[0].name;_e&&(ye="m-"+(ye?_e+" "+ye:_e))}if(!Z||te!=ye){for(;QH;--Z){if(Z<=k.first)return k.first;var Q=vt(k,Z-1),te=Q.stateAfter;if(te&&(!n||Z+(te instanceof $?te.lookAhead:0)<=k.modeFrontier))return Z;var pe=Y(Q.text,null,e.options.tabSize);(o==null||r>pe)&&(o=Z-1,r=pe)}return o}function Qr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontiern;r--){var o=vt(e,r).stateAfter;if(o&&(!(o instanceof $)||r+o.lookAhead=t:k.to>t);(r||(r=[])).push(new bn(H,k.from,Q?null:k.to))}}return r}function zn(e,t,n){var r;if(e)for(var o=0;o=t:k.to>t);if(Z||k.from==t&&H.type=="bookmark"&&(!n||k.marker.insertLeft)){var Q=k.from==null||(H.inclusiveLeft?k.from<=t:k.from0&&Z)for(var gt=0;gt0)continue;var pe=[Q,1],ye=lt(te.from,Z.from),Pe=lt(te.to,Z.to);(ye<0||!H.inclusiveLeft&&!ye)&&pe.push({from:te.from,to:Z.from}),(Pe>0||!H.inclusiveRight&&!Pe)&&pe.push({from:Z.to,to:te.to}),o.splice.apply(o,pe),Q+=pe.length-3}return o}function _n(e){var t=e.markedSpans;if(!t)return;for(var n=0;nt)&&(!r||Er(r,k.marker)<0)&&(r=k.marker)}return r}function lr(e,t,n,r,o){var k=vt(e,t),H=_r&&k.markedSpans;if(H)for(var Z=0;Z=0&&ye<=0||pe<=0&&ye>=0)continue;if(pe<=0&&(Q.marker.inclusiveRight&&o.inclusiveLeft?lt(te.to,n)>=0:lt(te.to,n)>0)||pe>=0&&(Q.marker.inclusiveRight&&o.inclusiveLeft?lt(te.from,r)<=0:lt(te.from,r)<0))return!0}}function Or(e){for(var t;t=hr(e);)e=t.find(-1,!0).line;return e}function Kn(e){for(var t;t=Vt(e);)e=t.find(1,!0).line;return e}function Vn(e){for(var t,n;t=Vt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function xn(e,t){var n=vt(e,t),r=Or(n);return n==r?t:_t(r)}function Ui(e,t){if(t>e.lastLine())return t;var n=vt(e,t),r;if(!Wr(e,n))return t;for(;r=Vt(n);)n=r.find(1,!0).line;return _t(n)+1}function Wr(e,t){var n=_r&&t.markedSpans;if(n)for(var r=void 0,o=0;ot.maxLineLength&&(t.maxLineLength=o,t.maxLine=r)})}var On=function(e,t,n){this.text=e,ci(this,t),this.height=n?n(this):1};On.prototype.lineNo=function(){return _t(this)},Ee(On);function $a(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),_n(e),ci(e,n);var o=r?r(e):1;o!=e.height&&Tr(e,o)}function ha(e){e.parent=null,_n(e)}var yt={},Dt={};function St(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Dt:yt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Mt(e,t){var n=A("span",null,null,O?"padding-right: .1px":null),r={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var k=o?t.rest[o-1]:t.line,H=void 0;r.pos=0,r.addToken=$t,Lt(e.display.measure)&&(H=qe(k,e.doc.direction))&&(r.addToken=dr(r.addToken,H)),r.map=[];var Z=t!=e.display.externalMeasured&&_t(k);Nt(k,r,Ge(e,k,Z)),k.styleClasses&&(k.styleClasses.bgClass&&(r.bgClass=j(k.styleClasses.bgClass,r.bgClass||"")),k.styleClasses.textClass&&(r.textClass=j(k.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(ct(e.display.measure))),o==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(O){var Q=r.content.lastChild;(/\bcm-tab\b/.test(Q.className)||Q.querySelector&&Q.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=j(r.pre.className,r.textClass||"")),r}function Wt(e){var t=u("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function $t(e,t,n,r,o,k,H){if(!t)return;var Z=e.splitSpaces?Bt(t,e.trailingSpace):t,Q=e.cm.state.specialChars,te=!1,pe;if(!Q.test(t))e.col+=t.length,pe=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,pe),W&&U<9&&(te=!0),e.pos+=t.length;else{pe=document.createDocumentFragment();for(var ye=0;;){Q.lastIndex=ye;var Pe=Q.exec(t),_e=Pe?Pe.index-ye:t.length-ye;if(_e){var We=document.createTextNode(Z.slice(ye,ye+_e));W&&U<9?pe.appendChild(u("span",[We])):pe.appendChild(We),e.map.push(e.pos,e.pos+_e,We),e.col+=_e,e.pos+=_e}if(!Pe)break;ye+=_e+1;var Ve=void 0;if(Pe[0]==" "){var $e=e.cm.options.tabSize,rt=$e-e.col%$e;Ve=pe.appendChild(u("span",he(rt),"cm-tab")),Ve.setAttribute("role","presentation"),Ve.setAttribute("cm-text"," "),e.col+=rt}else Pe[0]=="\r"||Pe[0]==` +`?(Ve=pe.appendChild(u("span",Pe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ve.setAttribute("cm-text",Pe[0]),e.col+=1):(Ve=e.cm.options.specialCharPlaceholder(Pe[0]),Ve.setAttribute("cm-text",Pe[0]),W&&U<9?pe.appendChild(u("span",[Ve])):pe.appendChild(Ve),e.col+=1);e.map.push(e.pos,e.pos+1,Ve),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,n||r||o||te||k||H){var ut=n||"";r&&(ut+=r),o&&(ut+=o);var nt=u("span",[pe],ut,k);if(H)for(var gt in H)H.hasOwnProperty(gt)&>!="style"&>!="class"&&nt.setAttribute(gt,H[gt]);return e.content.appendChild(nt)}e.content.appendChild(pe)}function Bt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",o=0;ote&&ye.from<=te);Pe++);if(ye.to>=pe)return e(n,r,o,k,H,Z,Q);e(n,r.slice(0,ye.to-te),o,k,null,Z,Q),k=null,r=r.slice(ye.to-te),te=ye.to}}}function Pr(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t,e.trailingSpace=!1}function Nt(e,t,n){var r=e.markedSpans,o=e.text,k=0;if(!r){for(var H=1;HQ||Ot.collapsed&&Et.to==Q&&Et.from==Q)){if(Et.to!=null&&Et.to!=Q&&_e>Et.to&&(_e=Et.to,Ve=""),Ot.className&&(We+=" "+Ot.className),Ot.css&&(Pe=(Pe?Pe+";":"")+Ot.css),Ot.startStyle&&Et.from==Q&&($e+=" "+Ot.startStyle),Ot.endStyle&&Et.to==_e&&(gt||(gt=[])).push(Ot.endStyle,Et.to),Ot.title&&((ut||(ut={})).title=Ot.title),Ot.attributes)for(var tr in Ot.attributes)(ut||(ut={}))[tr]=Ot.attributes[tr];Ot.collapsed&&(!rt||Er(rt.marker,Ot)<0)&&(rt=Et)}else Et.from>Q&&_e>Et.from&&(_e=Et.from)}if(gt)for(var br=0;br=Z)break;for(var Gr=Math.min(Z,_e);;){if(pe){var Nr=Q+pe.length;if(!rt){var cr=Nr>Gr?pe.slice(0,Gr-Q):pe;t.addToken(t,cr,ye?ye+We:We,$e,Q+cr.length==_e?Ve:"",Pe,ut)}if(Nr>=Gr){pe=pe.slice(Gr-Q),Q=Gr;break}Q=Nr,$e=""}pe=o.slice(k,k=n[te++]),ye=St(n[te++],t.cm.options)}}}function En(e,t,n){this.line=t,this.rest=Vn(t),this.size=this.rest?_t(re(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Wr(e,t)}function Gt(e,t,n){for(var r=[],o,k=t;k2&&k.push((Q.bottom+te.top)/2-n.top)}}k.push(n.bottom-n.top)}}function ro(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function Us(e,t){t=Or(t);var n=_t(t),r=e.display.externalMeasured=new En(e.doc,t,n);r.lineN=n;var o=r.built=Mt(e,r);return r.text=o.pre,d(e.display.lineMeasure,o.pre),r}function no(e,t,n,r){return fn(e,Yn(e,t),n,r)}function pa(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(k=Q-Z,o=k-1,t>=Q&&(H="right")),o!=null){if(r=e[te+2],Z==Q&&n==(r.insertLeft?"left":"right")&&(H=n),n=="left"&&o==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)r=e[(te-=3)+2],H="left";if(n=="right"&&o==Q-Z)for(;te=0&&!((n=e[o]).left!=n.right);o--);return n}function Ws(e,t,n,r){var o=ao(t.map,n,r),k=o.node,H=o.start,Z=o.end,Q=o.collapse,te;if(k.nodeType==3){for(var pe=0;pe<4;pe++){for(;H&&Ue(t.line.text.charAt(o.coverStart+H));)--H;for(;o.coverStart+Z0&&(Q=r="right");var ye;e.options.lineWrapping&&(ye=k.getClientRects()).length>1?te=ye[r=="right"?ye.length-1:0]:te=k.getBoundingClientRect()}if(W&&U<9&&!H&&(!te||!te.left&&!te.right)){var Pe=k.parentNode.getClientRects()[0];Pe?te={left:Pe.left,right:Pe.left+Jn(e.display),top:Pe.top,bottom:Pe.bottom}:te=io}for(var _e=te.top-t.rect.top,We=te.bottom-t.rect.top,Ve=(_e+We)/2,$e=t.view.measure.heights,rt=0;rt<$e.length-1&&!(Ve<$e[rt]);rt++);var ut=rt?$e[rt-1]:0,nt=$e[rt],gt={left:(Q=="right"?te.right:te.left)-t.rect.left,right:(Q=="left"?te.left:te.right)-t.rect.left,top:ut,bottom:nt};return!te.left&&!te.right&&(gt.bogus=!0),e.options.singleCursorHeightPerLine||(gt.rtop=_e,gt.rbottom=We),gt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Jt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function oo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(Q=r.text.length,te="before"):Q<=0&&(Q=0,te="after"),!Z)return H(te=="before"?Q-1:Q,te=="before");function pe(We,Ve,$e){var rt=Z[Ve],ut=rt.level==1;return H($e?We-1:We,ut!=$e)}var ye=Ye(Z,Q,te),Pe=Ze,_e=pe(Q,ye,te=="before");return Pe!=null&&(_e.other=pe(Q,Pe,te!="before")),_e}function co(e,t){var n=0;t=c(e.doc,t),e.options.lineWrapping||(n=Jn(e.display)*t.ch);var r=vt(e.doc,t.line),o=on(r)+Hi(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function va(e,t,n,r,o){var k=He(e,t,n);return k.xRel=o,r&&(k.outside=r),k}function ya(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return va(r.first,0,null,-1,-1);var o=Lr(r,n),k=r.first+r.size-1;if(o>k)return va(r.first+r.size-1,vt(r,k).text.length,null,1,1);t<0&&(t=0);for(var H=vt(r,o);;){var Z=Gs(e,H,o,t,n),Q=dn(H,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!Q)return Z;var te=Q.find(1);if(te.line==o)return te;H=vt(r,o=te.line)}}function fo(e,t,n,r){r-=ma(t);var o=t.text.length,k=et(function(H){return fn(e,n,H-1).bottom<=r},o,0);return o=et(function(H){return fn(e,n,H).top>r},k,o),{begin:k,end:o}}function po(e,t,n,r){n||(n=Yn(e,t));var o=Gi(e,t,fn(e,n,r),"line").top;return fo(e,t,n,o)}function ba(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Gs(e,t,n,r,o){o-=on(t);var k=Yn(e,t),H=ma(t),Z=0,Q=t.text.length,te=!0,pe=qe(t,e.doc.direction);if(pe){var ye=(e.options.lineWrapping?Ks:zs)(e,t,n,k,pe,r,o);te=ye.level!=1,Z=te?ye.from:ye.to-1,Q=te?ye.to:ye.from-1}var Pe=null,_e=null,We=et(function(Tt){var Et=fn(e,k,Tt);return Et.top+=H,Et.bottom+=H,ba(Et,r,o,!1)?(Et.top<=o&&Et.left<=r&&(Pe=Tt,_e=Et),!0):!1},Z,Q),Ve,$e,rt=!1;if(_e){var ut=r-_e.left<_e.right-r,nt=ut==te;We=Pe+(nt?0:1),$e=nt?"after":"before",Ve=ut?_e.left:_e.right}else{!te&&(We==Q||We==Z)&&We++,$e=We==0?"after":We==t.text.length?"before":fn(e,k,We-(te?1:0)).bottom+H<=o==te?"after":"before";var gt=sn(e,He(n,We,$e),"line",t,k);Ve=gt.left,rt=o=gt.bottom?1:0}return We=Be(t.text,We,1),va(n,We,$e,rt,r-Ve)}function zs(e,t,n,r,o,k,H){var Z=et(function(ye){var Pe=o[ye],_e=Pe.level!=1;return ba(sn(e,He(n,_e?Pe.to:Pe.from,_e?"before":"after"),"line",t,r),k,H,!0)},0,o.length-1),Q=o[Z];if(Z>0){var te=Q.level!=1,pe=sn(e,He(n,te?Q.from:Q.to,te?"after":"before"),"line",t,r);ba(pe,k,H,!0)&&pe.top>H&&(Q=o[Z-1])}return Q}function Ks(e,t,n,r,o,k,H){var Z=fo(e,t,r,H),Q=Z.begin,te=Z.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var pe=null,ye=null,Pe=0;Pe=te||_e.to<=Q)continue;var We=_e.level!=1,Ve=fn(e,r,We?Math.min(te,_e.to)-1:Math.max(Q,_e.from)).right,$e=Ve$e)&&(pe=_e,ye=$e)}return pe||(pe=o[o.length-1]),pe.fromte&&(pe={from:pe.from,to:te,level:pe.level}),pe}var Mn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Mn==null){Mn=u("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Mn.appendChild(document.createTextNode("x")),Mn.appendChild(u("br"));Mn.appendChild(document.createTextNode("x"))}d(e.measure,Mn);var n=Mn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),b(e.measure),n||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=u("span","xxxxxxxxxx"),n=u("pre",[t],"CodeMirror-line-like");d(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function xa(e){for(var t=e.display,n={},r={},o=t.gutters.clientLeft,k=t.gutters.firstChild,H=0;k;k=k.nextSibling,++H){var Z=e.display.gutterSpecs[H].className;n[Z]=k.offsetLeft+k.clientLeft+o,r[Z]=k.clientWidth}return{fixedPos:Ea(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ea(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function mo(e){var t=$n(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(o){if(Wr(e.doc,o))return 0;var k=0;if(o.widgets)for(var H=0;H0&&(te=vt(e.doc,Q.line).text).length==Q.ch){var pe=Y(te,te.length,e.options.tabSize)-te.length;Q=He(Q.line,Math.max(0,Math.round((k-to(e.display).left)/Jn(e.display))-pe))}return Q}function Nn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;rt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)_r&&xn(e.doc,t)o.viewFrom?Sn(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)Sn(e);else if(t<=o.viewFrom){var k=zi(e,n,n+r,1);k?(o.view=o.view.slice(k.index),o.viewFrom=k.lineN,o.viewTo+=r):Sn(e)}else if(n>=o.viewTo){var H=zi(e,t,t,-1);H?(o.view=o.view.slice(0,H.index),o.viewTo=H.lineN):Sn(e)}else{var Z=zi(e,t,t,-1),Q=zi(e,n,n+r,1);Z&&Q?(o.view=o.view.slice(0,Z.index).concat(Gt(e,Z.lineN,Q.lineN)).concat(o.view.slice(Q.index)),o.viewTo+=r):Sn(e)}var te=o.externalMeasured;te&&(n=o.lineN&&t=r.viewTo)return;var k=r.view[Nn(e,t)];if(k.node==null)return;var H=k.changes||(k.changes=[]);le(H,n)==-1&&H.push(n)}function Sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zi(e,t,n,r){var o=Nn(e,t),k,H=e.display.view;if(!_r||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var Z=e.display.viewFrom,Q=0;Q0){if(o==H.length-1)return null;k=Z+H[o].size-t,o++}else k=Z-t;t+=k,n+=k}for(;xn(e.doc,n)!=n;){if(o==(r<0?0:H.length-1))return null;n+=r*H[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Vs(e,t,n){var r=e.display,o=r.view;o.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Gt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Gt(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Nn(e,n)))),r.viewTo=n}function go(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||Z.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Zn(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function bo(e){e.state.focused||(e.display.input.focus(),Ta(e))}function xo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(je(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),O&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Sa(e)}function Zn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||pe<-.005)&&(Tr(o.line,H),Eo(o.line),o.rest))for(var ye=0;yee.display.sizerWidth){var Pe=Math.ceil(Z/Jn(e.display));Pe>e.display.maxLineLength&&(e.display.maxLineLength=Pe,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}function Eo(e){if(e.widgets)for(var t=0;t=H&&(k=Lr(t,on(vt(t,Q))-e.wrapper.clientHeight),H=Q)}return{from:k,to:Math.max(H,k+1)}}function Ys(e,t){if(Xe(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),o=null;if(t.top+r.top<0?o=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),o!=null&&!m){var k=u("div","\u200B",null,`position: absolute; + height: `+(Et-gt)+"px"))}function ye(nt,gt,Tt){var Et=vt(o,nt),Ot=Et.text.length,tr,br;function ar(cr,Fr){return ga(e,He(nt,cr),"div",Et,Fr)}function Gr(cr,Fr,Sr){var mr=po(e,Et,null,cr),fr=Fr=="ltr"==(Sr=="after")?"left":"right",sr=Sr=="after"?mr.begin:mr.end-(/\s/.test(Et.text.charAt(mr.end-1))?2:1);return ar(sr,fr)[fr]}var Nr=qe(Et,o.direction);return Je(Nr,gt||0,Tt==null?Ot:Tt,function(cr,Fr,Sr,mr){var fr=Sr=="ltr",sr=ar(cr,fr?"left":"right"),Br=ar(Fr-1,fr?"right":"left"),ui=gt==null&&cr==0,Rn=Tt==null&&Fr==Ot,Ar=mr==0,pn=!Nr||mr==Nr.length-1;if(Br.top-sr.top<=3){var xr=(te?ui:Rn)&&Ar,Xa=(te?Rn:ui)&&pn,yn=xr?Z:(fr?sr:Br).left,Wn=Xa?Q:(fr?Br:sr).right;pe(yn,sr.top,Wn-yn,sr.bottom)}else{var Hn,Rr,hi,Ya;fr?(Hn=te&&ui&&Ar?Z:sr.left,Rr=te?Q:Gr(cr,Sr,"before"),hi=te?Z:Gr(Fr,Sr,"after"),Ya=te&&Rn&&pn?Q:Br.right):(Hn=te?Gr(cr,Sr,"before"):Z,Rr=!te&&ui&&Ar?Q:sr.right,hi=!te&&Rn&&pn?Z:Br.left,Ya=te?Gr(Fr,Sr,"after"):Q),pe(Hn,sr.top,Rr-Hn,sr.bottom),sr.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Zn(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function bo(e){e.state.focused||(e.display.input.focus(),Ta(e))}function xo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(je(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),O&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Sa(e)}function Zn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||pe<-.005)&&(Tr(o.line,H),Eo(o.line),o.rest))for(var ye=0;yee.display.sizerWidth){var Pe=Math.ceil(Z/Jn(e.display));Pe>e.display.maxLineLength&&(e.display.maxLineLength=Pe,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}function Eo(e){if(e.widgets)for(var t=0;t=H&&(k=Lr(t,on(vt(t,Q))-e.wrapper.clientHeight),H=Q)}return{from:k,to:Math.max(H,k+1)}}function Ys(e,t){if(Xe(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),o=null;if(t.top+r.top<0?o=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),o!=null&&!m){var k=u("div","\u200B",null,`position: absolute; top: `+(t.top-n.viewOffset-Hi(e.display))+`px; height: `+(t.bottom-t.top+cn(e)+n.barHeight)+`px; - left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(o),e.display.lineSpace.removeChild(k)}}function $s(e,t,n,r){r==null&&(r=0);var o;!e.options.lineWrapping&&t==n&&(t=t.ch?He(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?He(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var H=!1,Z=sn(e,t),Q=!n||n==t?Z:sn(e,n);o={left:Math.min(Z.left,Q.left),top:Math.min(Z.top,Q.top)-r,right:Math.max(Z.left,Q.left),bottom:Math.max(Z.bottom,Q.bottom)+r};var te=wa(e,o),pe=e.doc.scrollTop,ye=e.doc.scrollLeft;if(te.scrollTop!=null&&(xi(e,te.scrollTop),Math.abs(e.doc.scrollTop-pe)>1&&(H=!0)),te.scrollLeft!=null&&(Fn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-ye)>1&&(H=!0)),!H)break}return o}function Js(e,t){var n=wa(e,t);n.scrollTop!=null&&xi(e,n.scrollTop),n.scrollLeft!=null&&Fn(e,n.scrollLeft)}function wa(e,t){var n=e.display,r=$n(e.display);t.top<0&&(t.top=0);var o=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,k=fa(e),H={};t.bottom-t.top>k&&(t.bottom=t.top+k);var Z=e.doc.height+ca(n),Q=t.topZ-r;if(t.topo+k){var pe=Math.min(t.top,(te?Z:t.bottom)-k);pe!=o&&(H.scrollTop=pe)}var ye=e.options.fixedGutter?0:n.gutters.offsetWidth,Pe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ye,_e=Pn(e)-n.gutters.offsetWidth,We=t.right-t.left>_e;return We&&(t.right=t.left+_e),t.left<10?H.scrollLeft=0:t.left_e+Pe-3&&(H.scrollLeft=t.right+(We?0:10)-_e),H}function Aa(e,t){if(t==null)return;Yi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qn(e){Yi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function bi(e,t,n){(t!=null||n!=null)&&Yi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Zs(e,t){Yi(e),e.curOp.scrollToPos=t}function Yi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=co(e,t.from),r=co(e,t.to);Co(e,n,r,t.margin)}}function Co(e,t,n,r){var o=wa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});bi(e,o.scrollLeft,o.scrollTop)}function xi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;_||Da(e,{top:t}),So(e,t,!0),_&&Da(e),Si(e,100)}function So(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Fn(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Do(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Ei(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ca(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+cn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Bn=function(e,t,n){this.cm=n;var r=this.vert=u("div",[u("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=u("div",[u("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),Ie(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ie(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&U<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Bn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Bn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Bn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Bn.prototype.zeroWidthHack=function(){var e=s&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},Bn.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var o=e.getBoundingClientRect(),k=n=="vert"?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Bn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ci=function(){};Ci.prototype.update=function(){return{bottom:0,right:0}},Ci.prototype.setScrollLeft=function(){},Ci.prototype.setScrollTop=function(){},Ci.prototype.clear=function(){};function qn(e,t){t||(t=Ei(e));var n=e.display.barWidth,r=e.display.barHeight;To(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&Vi(e),To(e,Ei(e)),n=e.display.barWidth,r=e.display.barHeight}function To(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var wo={native:Bn,null:Ci};function Ao(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ie(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Fn(e,t):xi(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Un(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},qr(e.curOp)}function jn(e){var t=e.curOp;t&&Wi(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $i(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&La(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&Vi(t),e.barMeasure=Ei(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=no(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+cn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Pn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=tt(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(r.line>=e.display.viewFrom){var H=k.styles,Z=k.text.length>e.options.maxHighlightLength?Zt(t.mode,r.state):null,Q=xe(e,k,r,!0);Z&&(r.state=Z),k.styles=Q.styles;var te=k.styleClasses,pe=Q.classes;pe?k.styleClasses=pe:te&&(k.styleClasses=null);for(var ye=!H||H.length!=k.styles.length||te!=pe&&(!te||!pe||te.bgClass!=pe.bgClass||te.textClass!=pe.textClass),Pe=0;!ye&&Pen)return Si(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&Hr(e,function(){for(var k=0;k=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&go(e)==0)return!1;Ro(e)&&(Sn(e),t.dims=xa(e));var o=r.first+r.size,k=Math.max(t.visible.from-e.options.viewportMargin,r.first),H=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFromH&&n.viewTo-H<20&&(H=Math.min(o,n.viewTo)),_r&&(k=xn(e.doc,k),H=Ui(e.doc,H));var Z=k!=n.viewFrom||H!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vs(e,k,H),n.viewOffset=on(vt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var Q=go(e);if(!Z&&Q==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var te=sl(e);return Q>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),Q>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(te),b(n.cursorDiv),b(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,Z&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Si(e,400)),n.updateLineNumbers=null,!0}function Lo(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ca(e.display)-fa(e),n.top)}),t.visible=Xi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Xi(e.display,e.doc,n));if(!La(e,t))break;Vi(e);var o=Ei(e);yi(e),qn(e,o),ka(e,o),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Da(e,t){var n=new $i(e,t);if(La(e,n)){Vi(e),Lo(e,n);var r=Ei(e);yi(e),qn(e,r),ka(e,r),n.finish()}}function ul(e,t,n){var r=e.display,o=e.options.lineNumbers,k=r.lineDiv,H=k.firstChild;function Z(We){var Ve=We.nextSibling;return O&&s&&e.display.currentWheelTarget==We?We.style.display="none":We.parentNode.removeChild(We),Ve}for(var Q=r.view,te=r.viewFrom,pe=0;pe-1&&(_e=!1),Ja(e,ye,te,n)),_e&&(b(ye.lineNumber),ye.lineNumber.appendChild(document.createTextNode(rn(e.options,te)))),H=ye.node.nextSibling}te+=ye.size}for(;H;)H=Z(H)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ka(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+cn(e)+"px"}function Do(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ea(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,k=r+"px",H=0;HH.clientWidth,Q=H.scrollHeight>H.clientHeight;if(!(r&&Z||o&&Q))return;if(o&&s&&O){e:for(var te=t.target,pe=k.view;te!=H;te=te.parentNode)for(var ye=0;ye=0&<(e,r.to())<=0)return n}return-1};var Xt=function(e,t){this.anchor=e,this.head=t};Xt.prototype.from=function(){return qt(this.anchor,this.head)},Xt.prototype.to=function(){return Yt(this.anchor,this.head)},Xt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ln(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort(function(Pe,_e){return lt(Pe.from(),_e.from())}),n=le(t,o);for(var k=1;k0:Q>=0){var te=qt(Z.from(),H.from()),pe=Yt(Z.to(),H.to()),ye=Z.empty()?H.from()==H.head:Z.from()==Z.head;k<=n&&--n,t.splice(--k,2,new Xt(ye?pe:te,ye?te:pe))}}return new Jr(t,n)}function Tn(e,t){return new Jr([new Xt(e,t||e)],0)}function wn(e){return e.text?He(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Po(e,t){if(lt(e,t.from)<0)return e;if(lt(e,t.to)<=0)return wn(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wn(t).ch-t.to.ch),He(n,r)}function Oa(e,t){for(var n=[],r=0;r1&&e.remove(Z.line+1,We-1),e.insert(Z.line+1,rt)}Cr(e,"change",e,t)}function An(e,t,n){function r(o,k,H){if(o.linked)for(var Z=0;Z1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function Uo(e,t,n,r){var o=e.history;o.undone.length=0;var k=+new Date,H,Z;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&o.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(H=pl(o,o.lastOp==r)))Z=re(H.changes),lt(t.from,t.to)==0&<(t.from,Z.to)==0?Z.to=wn(t):H.changes.push(Ia(e,t));else{var Q=re(o.done);for((!Q||!Q.ranges)&&Qi(e.sel,o.done),H={changes:[Ia(e,t)],generation:o.generation},o.done.push(H);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=k,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,Z||je(e,"historyAdded")}function ml(e,t,n,r){var o=t.charAt(0);return o=="*"||o=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var o=e.history,k=r&&r.origin;n==o.lastSelOp||k&&o.lastSelOrigin==k&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==k||ml(e,k,re(o.done),t))?o.done[o.done.length-1]=t:Qi(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=k,o.lastSelOp=n,r&&r.clearRedo!==!1&&Bo(o.undone)}function Qi(e,t){var n=re(t);n&&n.ranges&&n.equals(e)||t.push(e)}function jo(e,t,n,r){var o=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(H){H.markedSpans&&((o||(o=t["spans_"+e.id]={}))[k]=H.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,n=0;n-1&&(re(Z)[ye]=te[ye],delete te[ye]))}}return r}function Na(e,t,n,r){if(r){var o=e.anchor;if(n){var k=lt(t,o)<0;k!=lt(n,o)<0?(o=t,t=n):k!=lt(t,n)<0&&(t=n)}return new Xt(o,t)}else return new Xt(n||t,t)}function qi(e,t,n,r,o){o==null&&(o=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Jr([Na(e.sel.primary(),t,n,o)],0),r)}function Ho(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),k=0;k=t.ch:Z.to>t.ch))){if(o&&(je(Q,"beforeCursorEnter"),Q.explicitlyCleared))if(k.markedSpans){--H;continue}else break;if(!Q.atomic)continue;if(n){var ye=Q.find(r<0?1:-1),Pe=void 0;if((r<0?pe:te)&&(ye=Yo(e,ye,-r,ye&&ye.line==t.line?k:null)),ye&&ye.line==t.line&&(Pe=lt(ye,n))&&(r<0?Pe<0:Pe>0))return ti(e,ye,t,r,o)}var _e=Q.find(r<0?-1:1);return(r<0?te:pe)&&(_e=Yo(e,_e,r,_e.line==t.line?k:null)),_e?ti(e,_e,t,r,o):null}}return t}function ta(e,t,n,r,o){var k=r||1,H=ti(e,t,n,k,o)||!o&&ti(e,t,n,k,!0)||ti(e,t,n,-k,o)||!o&&ti(e,t,n,-k,!0);return H||(e.cantEdit=!0,He(e.first,0))}function Yo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?c(e,He(t.line-1)):null:n>0&&t.ch==(r||vt(e,t.line)).text.length?t.line=0;--o)Zo(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else Zo(e,t)}function Zo(e,t){if(t.text.length==1&&t.text[0]==""&<(t.from,t.to)==0)return;var n=Oa(e,t);Uo(e,t,n,e.cm?e.cm.curOp.id:NaN),Ai(e,t,n,an(e,t));var r=[];An(e,function(o,k){!k&&le(r,o.history)==-1&&(ts(o.history,t),r.push(o.history)),Ai(o,t,null,an(o,t))})}function ra(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var o=e.history,k,H=e.sel,Z=t=="undo"?o.done:o.undone,Q=t=="undo"?o.undone:o.done,te=0;te=0;--_e){var We=Pe(_e);if(We)return We.v}}function Qo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Jr(he(e.sel.ranges,function(o){return new Xt(He(o.anchor.line+t,o.anchor.ch),He(o.head.line+t,o.head.ch))}),e.sel.primIndex),e.cm){Mr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())return;if(t.from.linek&&(t={from:t.from,to:He(k,vt(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=kr(e,t.from,t.to),n||(n=Oa(e,t)),e.cm?xl(e.cm,t,r):Ma(e,t,r),ea(e,n,Se),e.cantEdit&&ta(e,He(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,n){var r=e.doc,o=e.display,k=t.from,H=t.to,Z=!1,Q=k.line;e.options.lineWrapping||(Q=_t(Or(vt(r,k.line))),r.iter(Q,H.line+1,function(_e){if(_e==o.maxLine)return Z=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ce(e),Ma(r,t,n,mo(e)),e.options.lineWrapping||(r.iter(Q,k.line+t.text.length,function(_e){var We=Xn(_e);We>o.maxLineLength&&(o.maxLine=_e,o.maxLineLength=We,o.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),Qr(r,k.line),Si(e,400);var te=t.text.length-(H.line-k.line)-1;t.full?Mr(e):k.line==H.line&&t.text.length==1&&!Io(e.doc,t)?Cn(e,k.line,"text"):Mr(e,k.line,H.line+1,te);var pe=be(e,"changes"),ye=be(e,"change");if(ye||pe){var Pe={from:k,to:H,text:t.text,removed:t.removed,origin:t.origin};ye&&Cr(e,"change",e,Pe),pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Pe)}e.display.selForContextMenu=null}function ni(e,t,n,r,o){var k;r||(r=n),lt(r,n)<0&&(k=[r,n],n=k[0],r=k[1]),typeof t=="string"&&(t=e.splitLines(t)),ri(e,{from:n,to:r,text:t,origin:o})}function qo(e,t,n,r){n1||!(this.children[0]instanceof Di))){var Z=[];this.collapse(Z),this.children=[new Di(Z)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var H=o.lines.length%25+25,Z=H;Z10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=pe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Mr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Vo(e.doc)),e&&Cr(e,"markerCleared",e,this,r,o),t&&jn(e),this.parent&&this.parent.clear()},Ln.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,o=0;o0||H==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=A("span",[k.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(lr(e,t.line,t,n,k)||t.line!=n.line&&lr(e,n.line,t,n,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");jr()}k.addToHistory&&Uo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var Z=t.line,Q=e.cm,te;if(e.iter(Z,n.line+1,function(ye){Q&&k.collapsed&&!Q.options.lineWrapping&&Or(ye)==Q.display.maxLine&&(te=!0),k.collapsed&&Z!=t.line&&Tr(ye,0),dn(ye,new bn(k,Z==t.line?t.ch:null,Z==n.line?n.ch:null)),++Z}),k.collapsed&&e.iter(t.line,n.line+1,function(ye){Wr(e,ye)&&Tr(ye,0)}),k.clearOnEnter&&Ie(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(Xr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++ns,k.atomic=!0),Q){if(te&&(Q.curOp.updateMaxLine=!0),k.collapsed)Mr(Q,t.line,n.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var pe=t.line;pe<=n.line;pe++)Cn(Q,pe,"text");k.atomic&&Vo(Q.doc),Cr(Q,"markerAdded",Q,k)}return k}var _i=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;Q--)ri(this,r[Q]);Z?zo(this,Z):this.cm&&Qn(this.cm)}),undo:yr(function(){ra(this,"undo")}),redo:yr(function(){ra(this,"redo")}),undoSelection:yr(function(){ra(this,"undo",!0)}),redoSelection:yr(function(){ra(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=c(this,e),t=c(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,function(k){var H=k.markedSpans;if(H)for(var Z=0;Z=Q.to||Q.from==null&&o!=e.line||Q.from!=null&&o==t.line&&Q.from>=t.ch)&&(!n||n(Q.marker))&&r.push(Q.marker.parent||Q.marker)}++o}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=k,++n}),c(this,He(n,t))},indexFromPos:function(e){e=c(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var pe=e.dataTransfer.getData("Text");if(pe){var ye;if(t.state.draggingText&&!t.state.draggingText.copy&&(ye=t.listSelections()),ea(t.doc,Tn(n,n)),ye)for(var Pe=0;Pe=0;Z--)ni(e.doc,"",r[Z].from,r[Z].to,"+delete");Qn(e)})}function Ba(e,t,n){var r=Be(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ua(e,t,n){var r=Ba(e,t.ch,n);return r==null?null:new He(t.line,r,n<0?"after":"before")}function ja(e,t,n,r,o){if(e){t.doc.direction=="rtl"&&(o=-o);var k=qe(n,t.doc.direction);if(k){var H=o<0?re(k):k[0],Z=o<0==(H.level==1),Q=Z?"after":"before",te;if(H.level>0||t.doc.direction=="rtl"){var pe=Yn(t,n);te=o<0?n.text.length-1:0;var ye=fn(t,pe,te).top;te=et(function(Pe){return fn(t,pe,Pe).top==ye},o<0==(H.level==1)?H.from:H.to-1,te),Q=="before"&&(te=Ba(n,te,1))}else te=o<0?H.to:H.from;return new He(r,te,Q)}}return new He(r,o<0?n.text.length:0,o<0?"before":"after")}function Ml(e,t,n,r){var o=qe(t,e.doc.direction);if(!o)return Ua(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var k=Ye(o,n.ch,n.sticky),H=o[k];if(e.doc.direction=="ltr"&&H.level%2==0&&(r>0?H.to>n.ch:H.from=H.from&&Pe>=pe.begin)){var _e=ye?"before":"after";return new He(n.line,Pe,_e)}}var We=function(rt,ut,nt){for(var gt=function(tr,br){return br?new He(n.line,Z(tr,1),"before"):new He(n.line,tr,"after")};rt>=0&&rt0==(Tt.level!=1),Ot=Et?nt.begin:Z(nt.end,-1);if(Tt.from<=Ot&&Ot0?pe.end:Z(pe.begin,-1);return $e!=null&&!(r>0&&$e==t.text.length)&&(Ve=We(r>0?0:o.length-1,r,te($e)),Ve)?Ve:null}var Mi={selectAll:$o,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Se)},killLine:function(e){return oi(e,function(t){if(t.empty()){var n=vt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)o=new He(o.line,o.ch+1),e.replaceRange(k.charAt(o.ch-1)+k.charAt(o.ch-2),He(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var H=vt(e.doc,o.line-1).text;H&&(o=new He(o.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+H.charAt(H.length-1),He(o.line-1,H.length-1),o,"+transpose"))}}n.push(new Xt(o,o))}e.setSelections(n)})},newlineAndIndent:function(e){return Hr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&<(t,this.pos)==0&&n==this.button};var Ni,Fi;function Wl(e,t){var n=+new Date;return Fi&&Fi.compare(n,e,t)?(Ni=Fi=null,"triple"):Ni&&Ni.compare(n,e,t)?(Fi=new Ha(n,e,t),Ni=null,"double"):(Ni=new Ha(n,e,t),Fi=null,"single")}function bs(e){var t=this,n=t.display;if(Xe(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,gn(n,e)){O||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Ga(t,e))return;var r=In(t,e),o=Re(e),k=r?Wl(r,o):"single";if(window.focus(),o==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,o,r,k,e))return;o==1?r?zl(t,r,k,e):Ne(e)==n.scroller&&ne(e):o==2?(r&&qi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):o==3&&(R?t.display.input.onContextMenu(e):xo(t))}function Hl(e,t,n,r,o){var k="Click";return r=="double"?k="Double"+k:r=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,Ii(e,ds(k,o),o,function(H){if(typeof H=="string"&&(H=Mi[H]),!H)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=H(e,n)!=Oe}finally{e.state.suppressEdits=!1}return Z})}function Gl(e,t,n){var r=e.getOption("configureMouse"),o=r?r(e,t,n):{};if(o.unit==null){var k=l?n.shiftKey&&n.metaKey:n.altKey;o.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(o.extend==null||e.doc.extend)&&(o.extend=e.doc.extend||n.shiftKey),o.addNew==null&&(o.addNew=s?n.metaKey:n.ctrlKey),o.moveOnDrag==null&&(o.moveOnDrag=!(s?n.altKey:n.ctrlKey)),o}function zl(e,t,n,r){W?setTimeout(M(bo,e),0):e.curOp.focus=I();var o=Gl(e,n,r),k=e.doc.sel,H;e.options.dragDrop&&ze&&!e.isReadOnly()&&n=="single"&&(H=k.contains(t))>-1&&(lt((H=k.ranges[H]).from(),t)<0||t.xRel>0)&&(lt(H.to(),t)>0||t.xRel<0)?Kl(e,r,t,o):Vl(e,r,t,o)}function Kl(e,t,n,r){var o=e.display,k=!1,H=vr(e,function(te){O&&(o.scroller.draggable=!1),e.state.draggingText=!1,st(o.wrapper.ownerDocument,"mouseup",H),st(o.wrapper.ownerDocument,"mousemove",Z),st(o.scroller,"dragstart",Q),st(o.scroller,"drop",H),k||(ne(te),r.addNew||qi(e.doc,n,null,null,r.extend),O&&!T||W&&U==9?setTimeout(function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()},20):o.input.focus())}),Z=function(te){k=k||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},Q=function(){return k=!0};O&&(o.scroller.draggable=!0),e.state.draggingText=H,H.copy=!r.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),Ie(o.wrapper.ownerDocument,"mouseup",H),Ie(o.wrapper.ownerDocument,"mousemove",Z),Ie(o.scroller,"dragstart",Q),Ie(o.scroller,"drop",H),xo(e),setTimeout(function(){return o.input.focus()},20)}function xs(e,t,n){if(n=="char")return new Xt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Xt(He(t.line,0),c(e.doc,He(t.line+1,0)));var r=n(e,t);return new Xt(r.from,r.to)}function Vl(e,t,n,r){var o=e.display,k=e.doc;ne(t);var H,Z,Q=k.sel,te=Q.ranges;if(r.addNew&&!r.extend?(Z=k.sel.contains(n),Z>-1?H=te[Z]:H=new Xt(n,n)):(H=k.sel.primary(),Z=k.sel.primIndex),r.unit=="rectangle")r.addNew||(H=new Xt(n,n)),n=In(e,t,!0,!0),Z=-1;else{var pe=xs(e,n,r.unit);r.extend?H=Na(H,pe.anchor,pe.head,r.extend):H=pe}r.addNew?Z==-1?(Z=te.length,wr(k,ln(e,te.concat([H]),Z),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Z].empty()&&r.unit=="char"&&!r.extend?(wr(k,ln(e,te.slice(0,Z).concat(te.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),Q=k.sel):Fa(k,Z,H,ke):(Z=0,wr(k,new Jr([H],0),ke),Q=k.sel);var ye=n;function Pe(nt){if(lt(ye,nt)==0)return;if(ye=nt,r.unit=="rectangle"){for(var gt=[],Tt=e.options.tabSize,Et=Y(vt(k,n.line).text,n.ch,Tt),Ot=Y(vt(k,nt.line).text,nt.ch,Tt),tr=Math.min(Et,Ot),br=Math.max(Et,Ot),ar=Math.min(n.line,nt.line),Gr=Math.min(e.lastLine(),Math.max(n.line,nt.line));ar<=Gr;ar++){var Nr=vt(k,ar).text,cr=Ae(Nr,tr,Tt);tr==br?gt.push(new Xt(He(ar,cr),He(ar,cr))):Nr.length>cr&>.push(new Xt(He(ar,cr),He(ar,Ae(Nr,br,Tt))))}gt.length||gt.push(new Xt(n,n)),wr(k,ln(e,Q.ranges.slice(0,Z).concat(gt),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(nt)}else{var Fr=H,Sr=xs(e,nt,r.unit),mr=Fr.anchor,fr;lt(Sr.anchor,mr)>0?(fr=Sr.head,mr=qt(Fr.from(),Sr.anchor)):(fr=Sr.anchor,mr=Yt(Fr.to(),Sr.head));var sr=Q.ranges.slice(0);sr[Z]=Xl(e,new Xt(c(k,mr),fr)),wr(k,ln(e,sr,Z),ke)}}var _e=o.wrapper.getBoundingClientRect(),We=0;function Ve(nt){var gt=++We,Tt=In(e,nt,!0,r.unit=="rectangle");if(!Tt)return;if(lt(Tt,ye)!=0){e.curOp.focus=I(),Pe(Tt);var Et=Xi(o,k);(Tt.line>=Et.to||Tt.line_e.bottom?20:0;Ot&&setTimeout(vr(e,function(){if(We!=gt)return;o.scroller.scrollTop+=Ot,Ve(nt)}),50)}}function $e(nt){e.state.selectingText=!1,We=Infinity,nt&&(ne(nt),o.input.focus()),st(o.wrapper.ownerDocument,"mousemove",rt),st(o.wrapper.ownerDocument,"mouseup",ut),k.history.lastSelOrigin=null}var rt=vr(e,function(nt){nt.buttons===0||!Re(nt)?$e(nt):Ve(nt)}),ut=vr(e,$e);e.state.selectingText=ut,Ie(o.wrapper.ownerDocument,"mousemove",rt),Ie(o.wrapper.ownerDocument,"mouseup",ut)}function Xl(e,t){var n=t.anchor,r=t.head,o=vt(e.doc,n.line);if(lt(n,r)==0&&n.sticky==r.sticky)return t;var k=qe(o);if(!k)return t;var H=Ye(k,n.ch,n.sticky),Z=k[H];if(Z.from!=n.ch&&Z.to!=n.ch)return t;var Q=H+(Z.from==n.ch==(Z.level!=1)?0:1);if(Q==0||Q==k.length)return t;var te;if(r.line!=n.line)te=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var pe=Ye(k,r.ch,r.sticky),ye=pe-H||(r.ch-n.ch)*(Z.level==1?-1:1);pe==Q-1||pe==Q?te=ye<0:te=ye>0}var Pe=k[Q+(te?-1:0)],_e=te==(Pe.level==1),We=_e?Pe.from:Pe.to,Ve=_e?"after":"before";return n.ch==We&&n.sticky==Ve?t:new Xt(new He(n.line,We,Ve),r)}function Es(e,t,n,r){var o,k;if(t.touches)o=t.touches[0].clientX,k=t.touches[0].clientY;else try{o=t.clientX,k=t.clientY}catch(Pe){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ne(t);var H=e.display,Z=H.lineDiv.getBoundingClientRect();if(k>Z.bottom||!be(e,n))return ce(t);k-=Z.top-H.viewOffset;for(var Q=0;Q=o){var pe=Lr(e.doc,k),ye=e.display.gutterSpecs[Q];return je(e,n,e,pe,ye.className,t),ce(t)}}}function Ga(e,t){return Es(e,t,"gutterClick",!0)}function Cs(e,t){if(gn(e.display,t)||Yl(e,t))return;if(Xe(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return be(e,"gutterContextMenu")?Es(e,t,"gutterContextMenu",!1):!1}function Ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vi(e)}var si={toString:function(){return"CodeMirror.Init"}},Ts={},oa={};function $l(e){var t=e.optionHandlers;function n(r,o,k,H){e.defaults[r]=o,k&&(t[r]=H?function(Z,Q,te){te!=si&&k(Z,Q,te)}:k)}e.defineOption=n,e.Init=si,n("value","",function(r,o){return r.setValue(o)},!0),n("mode",null,function(r,o){r.doc.modeOption=o,Pa(r)},!0),n("indentUnit",2,Pa,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){wi(r),vi(r),Mr(r)},!0),n("lineSeparator",null,function(r,o){if(r.doc.lineSep=o,!o)return;var k=[],H=r.doc.first;r.doc.iter(function(Q){for(var te=0;;){var pe=Q.text.indexOf(o,te);if(pe==-1)break;te=pe+o.length,k.push(He(H,pe))}H++});for(var Z=k.length-1;Z>=0;Z--)ni(r.doc,o,k[Z],He(k[Z].line,k[Z].ch+o.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,o,k){r.state.specialChars=new RegExp(o.source+(o.test(" ")?"":"| "),"g"),k!=si&&r.refresh()}),n("specialCharPlaceholder",Wt,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",i?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,o){return r.getInputField().spellcheck=o},!0),n("autocorrect",!1,function(r,o){return r.getInputField().autocorrect=o},!0),n("autocapitalize",!1,function(r,o){return r.getInputField().autocapitalize=o},!0),n("rtlMoveVisually",!C),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Ss(r),Ti(r)},!0),n("keyMap","default",function(r,o,k){var H=ia(o),Z=k!=si&&ia(k);Z&&Z.detach&&Z.detach(r,H),H.attach&&H.attach(r,Z||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(r,o){r.display.gutterSpecs=_a(o,r.options.lineNumbers),Ti(r)},!0),n("fixedGutter",!0,function(r,o){r.display.gutters.style.left=o?Ea(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return qn(r)},!0),n("scrollbarStyle","native",function(r){Ao(r),qn(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,o){r.display.gutterSpecs=_a(r.options.gutters,o),Ti(r)},!0),n("firstLineNumber",1,Ti,!0),n("lineNumberFormatter",function(r){return r},Ti,!0),n("showCursorWhenSelecting",!1,yi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,o){o=="nocursor"&&(Zn(r),r.display.input.blur()),r.display.input.readOnlyChanged(o)}),n("screenReaderLabel",null,function(r,o){o=o===""?null:o,r.display.input.screenReaderLabelChanged(o)}),n("disableInput",!1,function(r,o){o||r.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,yi,!0),n("singleCursorHeightPerLine",!0,yi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,wi,!0),n("addModeClass",!1,wi,!0),n("pollInterval",100),n("undoDepth",200,function(r,o){return r.doc.history.undoDepth=o}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,wi,!0),n("moveInputWithCursor",!0,function(r,o){o||r.display.input.resetPosition()}),n("tabindex",null,function(r,o){return r.display.input.getField().tabIndex=o||""}),n("autofocus",null),n("direction","ltr",function(r,o){return r.doc.setDirection(o)},!0),n("phrases",null)}function Jl(e,t,n){var r=n&&n!=si;if(!t!=!r){var o=e.display.dragFunctions,k=t?Ie:st;k(e.display.scroller,"dragstart",o.start),k(e.display.scroller,"dragenter",o.enter),k(e.display.scroller,"dragover",o.over),k(e.display.scroller,"dragleave",o.leave),k(e.display.scroller,"drop",o.drop)}}function Zl(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),ji(e)),Ca(e),Mr(e),vi(e),setTimeout(function(){return qn(e)},100)}function ir(e,t){var n=this;if(!(this instanceof ir))return new ir(e,t);this.options=t=t?N(t):{},N(Ts,t,!1);var r=t.value;typeof r=="string"?r=new Ir(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new ir.inputStyles[t.inputStyle](this),k=this.display=new dl(e,r,o,t);k.wrapper.CodeMirror=this,Ss(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ao(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ee,keySeq:null,specialChars:null},t.autofocus&&!i&&k.input.focus(),W&&U<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ql(this),Rl(),Un(this),this.curOp.forceUpdate=!0,No(this,r),t.autofocus&&!i||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ta(n)},20):Zn(this);for(var H in oa)oa.hasOwnProperty(H)&&oa[H](this,t[H],si);Ro(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z20*20}Ie(t.scroller,"touchstart",function(Q){if(!Xe(e,Q)&&!k(Q)&&!Ga(e,Q)){t.input.ensurePolled(),clearTimeout(n);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-r.end<=300?r:null},Q.touches.length==1&&(t.activeTouch.left=Q.touches[0].pageX,t.activeTouch.top=Q.touches[0].pageY)}}),Ie(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ie(t.scroller,"touchend",function(Q){var te=t.activeTouch;if(te&&!gn(t,Q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var pe=e.coordsChar(t.activeTouch,"page"),ye;!te.prev||H(te,te.prev)?ye=new Xt(pe,pe):!te.prev.prev||H(te,te.prev.prev)?ye=e.findWordAt(pe):ye=new Xt(He(pe.line,0),c(e.doc,He(pe.line+1,0))),e.setSelection(ye.anchor,ye.head),e.focus(),ne(Q)}o()}),Ie(t.scroller,"touchcancel",o),Ie(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xi(e,t.scroller.scrollTop),Fn(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),Ie(t.scroller,"mousewheel",function(Q){return Oo(e,Q)}),Ie(t.scroller,"DOMMouseScroll",function(Q){return Oo(e,Q)}),Ie(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Q){Xe(e,Q)||ve(Q)},over:function(Q){Xe(e,Q)||(Dl(e,Q),ve(Q))},start:function(Q){return Ll(e,Q)},drop:vr(e,Al),leave:function(Q){Xe(e,Q)||os(e)}};var Z=t.input.getField();Ie(Z,"keyup",function(Q){return vs.call(e,Q)}),Ie(Z,"keydown",vr(e,gs)),Ie(Z,"keypress",vr(e,ys)),Ie(Z,"focus",function(Q){return Ta(e,Q)}),Ie(Z,"blur",function(Q){return Zn(e,Q)})}var za=[];ir.defineInitHook=function(e){return za.push(e)};function Bi(e,t,n,r){var o=e.doc,k;n==null&&(n="add"),n=="smart"&&(o.mode.indent?k=tt(e,t).state:n="prev");var H=e.options.tabSize,Z=vt(o,t),Q=Y(Z.text,null,H);Z.stateAfter&&(Z.stateAfter=null);var te=Z.text.match(/^\s*/)[0],pe;if(!r&&!/\S/.test(Z.text))pe=0,n="not";else if(n=="smart"&&(pe=o.mode.indent(k,Z.text.slice(te.length),Z.text),pe==Oe||pe>150)){if(!r)return;n="prev"}n=="prev"?t>o.first?pe=Y(vt(o,t-1).text,null,H):pe=0:n=="add"?pe=Q+e.options.indentUnit:n=="subtract"?pe=Q-e.options.indentUnit:typeof n=="number"&&(pe=Q+n),pe=Math.max(0,pe);var ye="",Pe=0;if(e.options.indentWithTabs)for(var _e=Math.floor(pe/H);_e;--_e)Pe+=H,ye+=" ";if(PeH,Q=wt(t),te=null;if(Z&&r.ranges.length>1)if(un&&un.text.join(` -`)==t){if(r.ranges.length%un.text.length==0){te=[];for(var pe=0;pe=0;Pe--){var _e=r.ranges[Pe],We=_e.from(),Ve=_e.to();_e.empty()&&(n&&n>0?We=He(We.line,We.ch-n):e.state.overwrite&&!Z?Ve=He(Ve.line,Math.min(vt(k,Ve.line).text.length,Ve.ch+re(Q).length)):Z&&un&&un.lineWise&&un.text.join(` + left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(o),e.display.lineSpace.removeChild(k)}}function $s(e,t,n,r){r==null&&(r=0);var o;!e.options.lineWrapping&&t==n&&(t=t.ch?He(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?He(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var H=!1,Z=sn(e,t),Q=!n||n==t?Z:sn(e,n);o={left:Math.min(Z.left,Q.left),top:Math.min(Z.top,Q.top)-r,right:Math.max(Z.left,Q.left),bottom:Math.max(Z.bottom,Q.bottom)+r};var te=wa(e,o),pe=e.doc.scrollTop,ye=e.doc.scrollLeft;if(te.scrollTop!=null&&(xi(e,te.scrollTop),Math.abs(e.doc.scrollTop-pe)>1&&(H=!0)),te.scrollLeft!=null&&(Fn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-ye)>1&&(H=!0)),!H)break}return o}function Js(e,t){var n=wa(e,t);n.scrollTop!=null&&xi(e,n.scrollTop),n.scrollLeft!=null&&Fn(e,n.scrollLeft)}function wa(e,t){var n=e.display,r=$n(e.display);t.top<0&&(t.top=0);var o=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,k=fa(e),H={};t.bottom-t.top>k&&(t.bottom=t.top+k);var Z=e.doc.height+ca(n),Q=t.topZ-r;if(t.topo+k){var pe=Math.min(t.top,(te?Z:t.bottom)-k);pe!=o&&(H.scrollTop=pe)}var ye=e.options.fixedGutter?0:n.gutters.offsetWidth,Pe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-ye,_e=Pn(e)-n.gutters.offsetWidth,We=t.right-t.left>_e;return We&&(t.right=t.left+_e),t.left<10?H.scrollLeft=0:t.left_e+Pe-3&&(H.scrollLeft=t.right+(We?0:10)-_e),H}function Aa(e,t){if(t==null)return;Yi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qn(e){Yi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function bi(e,t,n){(t!=null||n!=null)&&Yi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Zs(e,t){Yi(e),e.curOp.scrollToPos=t}function Yi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=co(e,t.from),r=co(e,t.to);Co(e,n,r,t.margin)}}function Co(e,t,n,r){var o=wa(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});bi(e,o.scrollLeft,o.scrollTop)}function xi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;_||Da(e,{top:t}),So(e,t,!0),_&&Da(e),Si(e,100)}function So(e,t,n){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!n)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Fn(e,t,n,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,Do(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Ei(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ca(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+cn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Bn=function(e,t,n){this.cm=n;var r=this.vert=u("div",[u("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=u("div",[u("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,e(r),e(o),Ie(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ie(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&U<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Bn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Bn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Bn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Bn.prototype.zeroWidthHack=function(){var e=s&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},Bn.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var o=e.getBoundingClientRect(),k=n=="vert"?document.elementFromPoint(o.right-1,(o.top+o.bottom)/2):document.elementFromPoint((o.right+o.left)/2,o.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Bn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ci=function(){};Ci.prototype.update=function(){return{bottom:0,right:0}},Ci.prototype.setScrollLeft=function(){},Ci.prototype.setScrollTop=function(){},Ci.prototype.clear=function(){};function qn(e,t){t||(t=Ei(e));var n=e.display.barWidth,r=e.display.barHeight;To(e,t);for(var o=0;o<4&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&Vi(e),To(e,Ei(e)),n=e.display.barWidth,r=e.display.barHeight}function To(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var wo={native:Bn,null:Ci};function Ao(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new wo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ie(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Fn(e,t):xi(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Un(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},qr(e.curOp)}function jn(e){var t=e.curOp;t&&Wi(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $i(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&La(e.cm,e.update)}function rl(e){var t=e.cm,n=t.display;e.updatedDisplay&&Vi(t),e.barMeasure=Ei(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=no(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+cn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Pn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var n=+new Date+e.options.workTime,r=tt(e,t.highlightFrontier),o=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(r.line>=e.display.viewFrom){var H=k.styles,Z=k.text.length>e.options.maxHighlightLength?Zt(t.mode,r.state):null,Q=xe(e,k,r,!0);Z&&(r.state=Z),k.styles=Q.styles;var te=k.styleClasses,pe=Q.classes;pe?k.styleClasses=pe:te&&(k.styleClasses=null);for(var ye=!H||H.length!=k.styles.length||te!=pe&&(!te||!pe||te.bgClass!=pe.bgClass||te.textClass!=pe.textClass),Pe=0;!ye&&Pen)return Si(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),o.length&&Hr(e,function(){for(var k=0;k=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&go(e)==0)return!1;Ro(e)&&(Sn(e),t.dims=xa(e));var o=r.first+r.size,k=Math.max(t.visible.from-e.options.viewportMargin,r.first),H=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFromH&&n.viewTo-H<20&&(H=Math.min(o,n.viewTo)),_r&&(k=xn(e.doc,k),H=Ui(e.doc,H));var Z=k!=n.viewFrom||H!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Vs(e,k,H),n.viewOffset=on(vt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var Q=go(e);if(!Z&&Q==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var te=sl(e);return Q>4&&(n.lineDiv.style.display="none"),ul(e,n.updateLineNumbers,t.dims),Q>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ll(te),b(n.cursorDiv),b(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,Z&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Si(e,400)),n.updateLineNumbers=null,!0}function Lo(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ca(e.display)-fa(e),n.top)}),t.visible=Xi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Xi(e.display,e.doc,n));if(!La(e,t))break;Vi(e);var o=Ei(e);yi(e),qn(e,o),ka(e,o),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Da(e,t){var n=new $i(e,t);if(La(e,n)){Vi(e),Lo(e,n);var r=Ei(e);yi(e),qn(e,r),ka(e,r),n.finish()}}function ul(e,t,n){var r=e.display,o=e.options.lineNumbers,k=r.lineDiv,H=k.firstChild;function Z(We){var Ve=We.nextSibling;return O&&s&&e.display.currentWheelTarget==We?We.style.display="none":We.parentNode.removeChild(We),Ve}for(var Q=r.view,te=r.viewFrom,pe=0;pe-1&&(_e=!1),Ja(e,ye,te,n)),_e&&(b(ye.lineNumber),ye.lineNumber.appendChild(document.createTextNode(rn(e.options,te)))),H=ye.node.nextSibling}te+=ye.size}for(;H;)H=Z(H)}function Ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ka(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+cn(e)+"px"}function Do(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=Ea(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,k=r+"px",H=0;HH.clientWidth,Q=H.scrollHeight>H.clientHeight;if(!(r&&Z||o&&Q))return;if(o&&s&&O){e:for(var te=t.target,pe=k.view;te!=H;te=te.parentNode)for(var ye=0;ye=0&<(e,r.to())<=0)return n}return-1};var Xt=function(e,t){this.anchor=e,this.head=t};Xt.prototype.from=function(){return qt(this.anchor,this.head)},Xt.prototype.to=function(){return Yt(this.anchor,this.head)},Xt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ln(e,t,n){var r=e&&e.options.selectionsMayTouch,o=t[n];t.sort(function(Pe,_e){return lt(Pe.from(),_e.from())}),n=le(t,o);for(var k=1;k0:Q>=0){var te=qt(Z.from(),H.from()),pe=Yt(Z.to(),H.to()),ye=Z.empty()?H.from()==H.head:Z.from()==Z.head;k<=n&&--n,t.splice(--k,2,new Xt(ye?pe:te,ye?te:pe))}}return new Jr(t,n)}function Tn(e,t){return new Jr([new Xt(e,t||e)],0)}function wn(e){return e.text?He(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Po(e,t){if(lt(e,t.from)<0)return e;if(lt(e,t.to)<=0)return wn(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=wn(t).ch-t.to.ch),He(n,r)}function Oa(e,t){for(var n=[],r=0;r1&&e.remove(Z.line+1,We-1),e.insert(Z.line+1,rt)}Cr(e,"change",e,t)}function An(e,t,n){function r(o,k,H){if(o.linked)for(var Z=0;Z1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function Uo(e,t,n,r){var o=e.history;o.undone.length=0;var k=+new Date,H,Z;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&o.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(H=pl(o,o.lastOp==r)))Z=re(H.changes),lt(t.from,t.to)==0&<(t.from,Z.to)==0?Z.to=wn(t):H.changes.push(Ia(e,t));else{var Q=re(o.done);for((!Q||!Q.ranges)&&Qi(e.sel,o.done),H={changes:[Ia(e,t)],generation:o.generation},o.done.push(H);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=k,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,Z||je(e,"historyAdded")}function ml(e,t,n,r){var o=t.charAt(0);return o=="*"||o=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,n,r){var o=e.history,k=r&&r.origin;n==o.lastSelOp||k&&o.lastSelOrigin==k&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==k||ml(e,k,re(o.done),t))?o.done[o.done.length-1]=t:Qi(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=k,o.lastSelOp=n,r&&r.clearRedo!==!1&&Bo(o.undone)}function Qi(e,t){var n=re(t);n&&n.ranges&&n.equals(e)||t.push(e)}function jo(e,t,n,r){var o=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(H){H.markedSpans&&((o||(o=t["spans_"+e.id]={}))[k]=H.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,n=0;n-1&&(re(Z)[ye]=te[ye],delete te[ye]))}}return r}function Na(e,t,n,r){if(r){var o=e.anchor;if(n){var k=lt(t,o)<0;k!=lt(n,o)<0?(o=t,t=n):k!=lt(t,n)<0&&(t=n)}return new Xt(o,t)}else return new Xt(n||t,t)}function qi(e,t,n,r,o){o==null&&(o=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Jr([Na(e.sel.primary(),t,n,o)],0),r)}function Ho(e,t,n){for(var r=[],o=e.cm&&(e.cm.display.shift||e.extend),k=0;k=t.ch:Z.to>t.ch))){if(o&&(je(Q,"beforeCursorEnter"),Q.explicitlyCleared))if(k.markedSpans){--H;continue}else break;if(!Q.atomic)continue;if(n){var ye=Q.find(r<0?1:-1),Pe=void 0;if((r<0?pe:te)&&(ye=Yo(e,ye,-r,ye&&ye.line==t.line?k:null)),ye&&ye.line==t.line&&(Pe=lt(ye,n))&&(r<0?Pe<0:Pe>0))return ti(e,ye,t,r,o)}var _e=Q.find(r<0?-1:1);return(r<0?te:pe)&&(_e=Yo(e,_e,r,_e.line==t.line?k:null)),_e?ti(e,_e,t,r,o):null}}return t}function ta(e,t,n,r,o){var k=r||1,H=ti(e,t,n,k,o)||!o&&ti(e,t,n,k,!0)||ti(e,t,n,-k,o)||!o&&ti(e,t,n,-k,!0);return H||(e.cantEdit=!0,He(e.first,0))}function Yo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?c(e,He(t.line-1)):null:n>0&&t.ch==(r||vt(e,t.line)).text.length?t.line=0;--o)Zo(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text,origin:t.origin});else Zo(e,t)}function Zo(e,t){if(t.text.length==1&&t.text[0]==""&<(t.from,t.to)==0)return;var n=Oa(e,t);Uo(e,t,n,e.cm?e.cm.curOp.id:NaN),Ai(e,t,n,an(e,t));var r=[];An(e,function(o,k){!k&&le(r,o.history)==-1&&(ts(o.history,t),r.push(o.history)),Ai(o,t,null,an(o,t))})}function ra(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!n)return;for(var o=e.history,k,H=e.sel,Z=t=="undo"?o.done:o.undone,Q=t=="undo"?o.undone:o.done,te=0;te=0;--_e){var We=Pe(_e);if(We)return We.v}}function Qo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Jr(de(e.sel.ranges,function(o){return new Xt(He(o.anchor.line+t,o.anchor.ch),He(o.head.line+t,o.head.ch))}),e.sel.primIndex),e.cm){Mr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())return;if(t.from.linek&&(t={from:t.from,to:He(k,vt(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=kr(e,t.from,t.to),n||(n=Oa(e,t)),e.cm?xl(e.cm,t,r):Ma(e,t,r),ea(e,n,Se),e.cantEdit&&ta(e,He(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,n){var r=e.doc,o=e.display,k=t.from,H=t.to,Z=!1,Q=k.line;e.options.lineWrapping||(Q=_t(Or(vt(r,k.line))),r.iter(Q,H.line+1,function(_e){if(_e==o.maxLine)return Z=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ce(e),Ma(r,t,n,mo(e)),e.options.lineWrapping||(r.iter(Q,k.line+t.text.length,function(_e){var We=Xn(_e);We>o.maxLineLength&&(o.maxLine=_e,o.maxLineLength=We,o.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),Qr(r,k.line),Si(e,400);var te=t.text.length-(H.line-k.line)-1;t.full?Mr(e):k.line==H.line&&t.text.length==1&&!Io(e.doc,t)?Cn(e,k.line,"text"):Mr(e,k.line,H.line+1,te);var pe=be(e,"changes"),ye=be(e,"change");if(ye||pe){var Pe={from:k,to:H,text:t.text,removed:t.removed,origin:t.origin};ye&&Cr(e,"change",e,Pe),pe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Pe)}e.display.selForContextMenu=null}function ni(e,t,n,r,o){var k;r||(r=n),lt(r,n)<0&&(k=[r,n],n=k[0],r=k[1]),typeof t=="string"&&(t=e.splitLines(t)),ri(e,{from:n,to:r,text:t,origin:o})}function qo(e,t,n,r){n1||!(this.children[0]instanceof Di))){var Z=[];this.collapse(Z),this.children=[new Di(Z)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var H=o.lines.length%25+25,Z=H;Z10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=pe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Mr(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Vo(e.doc)),e&&Cr(e,"markerCleared",e,this,r,o),t&&jn(e),this.parent&&this.parent.clear()},Ln.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,o=0;o0||H==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=A("span",[k.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(lr(e,t.line,t,n,k)||t.line!=n.line&&lr(e,n.line,t,n,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");jr()}k.addToHistory&&Uo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var Z=t.line,Q=e.cm,te;if(e.iter(Z,n.line+1,function(ye){Q&&k.collapsed&&!Q.options.lineWrapping&&Or(ye)==Q.display.maxLine&&(te=!0),k.collapsed&&Z!=t.line&&Tr(ye,0),hn(ye,new bn(k,Z==t.line?t.ch:null,Z==n.line?n.ch:null)),++Z}),k.collapsed&&e.iter(t.line,n.line+1,function(ye){Wr(e,ye)&&Tr(ye,0)}),k.clearOnEnter&&Ie(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(Xr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++ns,k.atomic=!0),Q){if(te&&(Q.curOp.updateMaxLine=!0),k.collapsed)Mr(Q,t.line,n.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var pe=t.line;pe<=n.line;pe++)Cn(Q,pe,"text");k.atomic&&Vo(Q.doc),Cr(Q,"markerAdded",Q,k)}return k}var _i=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;Q--)ri(this,r[Q]);Z?zo(this,Z):this.cm&&Qn(this.cm)}),undo:yr(function(){ra(this,"undo")}),redo:yr(function(){ra(this,"redo")}),undoSelection:yr(function(){ra(this,"undo",!0)}),redoSelection:yr(function(){ra(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=c(this,e),t=c(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,function(k){var H=k.markedSpans;if(H)for(var Z=0;Z=Q.to||Q.from==null&&o!=e.line||Q.from!=null&&o==t.line&&Q.from>=t.ch)&&(!n||n(Q.marker))&&r.push(Q.marker.parent||Q.marker)}++o}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=k,++n}),c(this,He(n,t))},indexFromPos:function(e){e=c(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var pe=e.dataTransfer.getData("Text");if(pe){var ye;if(t.state.draggingText&&!t.state.draggingText.copy&&(ye=t.listSelections()),ea(t.doc,Tn(n,n)),ye)for(var Pe=0;Pe=0;Z--)ni(e.doc,"",r[Z].from,r[Z].to,"+delete");Qn(e)})}function Ba(e,t,n){var r=Be(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ua(e,t,n){var r=Ba(e,t.ch,n);return r==null?null:new He(t.line,r,n<0?"after":"before")}function ja(e,t,n,r,o){if(e){t.doc.direction=="rtl"&&(o=-o);var k=qe(n,t.doc.direction);if(k){var H=o<0?re(k):k[0],Z=o<0==(H.level==1),Q=Z?"after":"before",te;if(H.level>0||t.doc.direction=="rtl"){var pe=Yn(t,n);te=o<0?n.text.length-1:0;var ye=fn(t,pe,te).top;te=et(function(Pe){return fn(t,pe,Pe).top==ye},o<0==(H.level==1)?H.from:H.to-1,te),Q=="before"&&(te=Ba(n,te,1))}else te=o<0?H.to:H.from;return new He(r,te,Q)}}return new He(r,o<0?n.text.length:0,o<0?"before":"after")}function Ml(e,t,n,r){var o=qe(t,e.doc.direction);if(!o)return Ua(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var k=Ye(o,n.ch,n.sticky),H=o[k];if(e.doc.direction=="ltr"&&H.level%2==0&&(r>0?H.to>n.ch:H.from=H.from&&Pe>=pe.begin)){var _e=ye?"before":"after";return new He(n.line,Pe,_e)}}var We=function(rt,ut,nt){for(var gt=function(tr,br){return br?new He(n.line,Z(tr,1),"before"):new He(n.line,tr,"after")};rt>=0&&rt0==(Tt.level!=1),Ot=Et?nt.begin:Z(nt.end,-1);if(Tt.from<=Ot&&Ot0?pe.end:Z(pe.begin,-1);return $e!=null&&!(r>0&&$e==t.text.length)&&(Ve=We(r>0?0:o.length-1,r,te($e)),Ve)?Ve:null}var Mi={selectAll:$o,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Se)},killLine:function(e){return oi(e,function(t){if(t.empty()){var n=vt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)o=new He(o.line,o.ch+1),e.replaceRange(k.charAt(o.ch-1)+k.charAt(o.ch-2),He(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var H=vt(e.doc,o.line-1).text;H&&(o=new He(o.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+H.charAt(H.length-1),He(o.line-1,H.length-1),o,"+transpose"))}}n.push(new Xt(o,o))}e.setSelections(n)})},newlineAndIndent:function(e){return Hr(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&<(t,this.pos)==0&&n==this.button};var Ni,Fi;function Wl(e,t){var n=+new Date;return Fi&&Fi.compare(n,e,t)?(Ni=Fi=null,"triple"):Ni&&Ni.compare(n,e,t)?(Fi=new Ha(n,e,t),Ni=null,"double"):(Ni=new Ha(n,e,t),Fi=null,"single")}function bs(e){var t=this,n=t.display;if(Xe(t,e)||n.activeTouch&&n.input.supportsTouch())return;if(n.input.ensurePolled(),n.shift=e.shiftKey,gn(n,e)){O||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(Ga(t,e))return;var r=In(t,e),o=Re(e),k=r?Wl(r,o):"single";if(window.focus(),o==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,o,r,k,e))return;o==1?r?zl(t,r,k,e):Ne(e)==n.scroller&&ne(e):o==2?(r&&qi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):o==3&&(R?t.display.input.onContextMenu(e):xo(t))}function Hl(e,t,n,r,o){var k="Click";return r=="double"?k="Double"+k:r=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,Ii(e,hs(k,o),o,function(H){if(typeof H=="string"&&(H=Mi[H]),!H)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=H(e,n)!=Oe}finally{e.state.suppressEdits=!1}return Z})}function Gl(e,t,n){var r=e.getOption("configureMouse"),o=r?r(e,t,n):{};if(o.unit==null){var k=l?n.shiftKey&&n.metaKey:n.altKey;o.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(o.extend==null||e.doc.extend)&&(o.extend=e.doc.extend||n.shiftKey),o.addNew==null&&(o.addNew=s?n.metaKey:n.ctrlKey),o.moveOnDrag==null&&(o.moveOnDrag=!(s?n.altKey:n.ctrlKey)),o}function zl(e,t,n,r){W?setTimeout(M(bo,e),0):e.curOp.focus=I();var o=Gl(e,n,r),k=e.doc.sel,H;e.options.dragDrop&&ze&&!e.isReadOnly()&&n=="single"&&(H=k.contains(t))>-1&&(lt((H=k.ranges[H]).from(),t)<0||t.xRel>0)&&(lt(H.to(),t)>0||t.xRel<0)?Kl(e,r,t,o):Vl(e,r,t,o)}function Kl(e,t,n,r){var o=e.display,k=!1,H=vr(e,function(te){O&&(o.scroller.draggable=!1),e.state.draggingText=!1,st(o.wrapper.ownerDocument,"mouseup",H),st(o.wrapper.ownerDocument,"mousemove",Z),st(o.scroller,"dragstart",Q),st(o.scroller,"drop",H),k||(ne(te),r.addNew||qi(e.doc,n,null,null,r.extend),O&&!T||W&&U==9?setTimeout(function(){o.wrapper.ownerDocument.body.focus({preventScroll:!0}),o.input.focus()},20):o.input.focus())}),Z=function(te){k=k||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},Q=function(){return k=!0};O&&(o.scroller.draggable=!0),e.state.draggingText=H,H.copy=!r.moveOnDrag,o.scroller.dragDrop&&o.scroller.dragDrop(),Ie(o.wrapper.ownerDocument,"mouseup",H),Ie(o.wrapper.ownerDocument,"mousemove",Z),Ie(o.scroller,"dragstart",Q),Ie(o.scroller,"drop",H),xo(e),setTimeout(function(){return o.input.focus()},20)}function xs(e,t,n){if(n=="char")return new Xt(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Xt(He(t.line,0),c(e.doc,He(t.line+1,0)));var r=n(e,t);return new Xt(r.from,r.to)}function Vl(e,t,n,r){var o=e.display,k=e.doc;ne(t);var H,Z,Q=k.sel,te=Q.ranges;if(r.addNew&&!r.extend?(Z=k.sel.contains(n),Z>-1?H=te[Z]:H=new Xt(n,n)):(H=k.sel.primary(),Z=k.sel.primIndex),r.unit=="rectangle")r.addNew||(H=new Xt(n,n)),n=In(e,t,!0,!0),Z=-1;else{var pe=xs(e,n,r.unit);r.extend?H=Na(H,pe.anchor,pe.head,r.extend):H=pe}r.addNew?Z==-1?(Z=te.length,wr(k,ln(e,te.concat([H]),Z),{scroll:!1,origin:"*mouse"})):te.length>1&&te[Z].empty()&&r.unit=="char"&&!r.extend?(wr(k,ln(e,te.slice(0,Z).concat(te.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),Q=k.sel):Fa(k,Z,H,ke):(Z=0,wr(k,new Jr([H],0),ke),Q=k.sel);var ye=n;function Pe(nt){if(lt(ye,nt)==0)return;if(ye=nt,r.unit=="rectangle"){for(var gt=[],Tt=e.options.tabSize,Et=Y(vt(k,n.line).text,n.ch,Tt),Ot=Y(vt(k,nt.line).text,nt.ch,Tt),tr=Math.min(Et,Ot),br=Math.max(Et,Ot),ar=Math.min(n.line,nt.line),Gr=Math.min(e.lastLine(),Math.max(n.line,nt.line));ar<=Gr;ar++){var Nr=vt(k,ar).text,cr=Ae(Nr,tr,Tt);tr==br?gt.push(new Xt(He(ar,cr),He(ar,cr))):Nr.length>cr&>.push(new Xt(He(ar,cr),He(ar,Ae(Nr,br,Tt))))}gt.length||gt.push(new Xt(n,n)),wr(k,ln(e,Q.ranges.slice(0,Z).concat(gt),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(nt)}else{var Fr=H,Sr=xs(e,nt,r.unit),mr=Fr.anchor,fr;lt(Sr.anchor,mr)>0?(fr=Sr.head,mr=qt(Fr.from(),Sr.anchor)):(fr=Sr.anchor,mr=Yt(Fr.to(),Sr.head));var sr=Q.ranges.slice(0);sr[Z]=Xl(e,new Xt(c(k,mr),fr)),wr(k,ln(e,sr,Z),ke)}}var _e=o.wrapper.getBoundingClientRect(),We=0;function Ve(nt){var gt=++We,Tt=In(e,nt,!0,r.unit=="rectangle");if(!Tt)return;if(lt(Tt,ye)!=0){e.curOp.focus=I(),Pe(Tt);var Et=Xi(o,k);(Tt.line>=Et.to||Tt.line_e.bottom?20:0;Ot&&setTimeout(vr(e,function(){if(We!=gt)return;o.scroller.scrollTop+=Ot,Ve(nt)}),50)}}function $e(nt){e.state.selectingText=!1,We=Infinity,nt&&(ne(nt),o.input.focus()),st(o.wrapper.ownerDocument,"mousemove",rt),st(o.wrapper.ownerDocument,"mouseup",ut),k.history.lastSelOrigin=null}var rt=vr(e,function(nt){nt.buttons===0||!Re(nt)?$e(nt):Ve(nt)}),ut=vr(e,$e);e.state.selectingText=ut,Ie(o.wrapper.ownerDocument,"mousemove",rt),Ie(o.wrapper.ownerDocument,"mouseup",ut)}function Xl(e,t){var n=t.anchor,r=t.head,o=vt(e.doc,n.line);if(lt(n,r)==0&&n.sticky==r.sticky)return t;var k=qe(o);if(!k)return t;var H=Ye(k,n.ch,n.sticky),Z=k[H];if(Z.from!=n.ch&&Z.to!=n.ch)return t;var Q=H+(Z.from==n.ch==(Z.level!=1)?0:1);if(Q==0||Q==k.length)return t;var te;if(r.line!=n.line)te=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var pe=Ye(k,r.ch,r.sticky),ye=pe-H||(r.ch-n.ch)*(Z.level==1?-1:1);pe==Q-1||pe==Q?te=ye<0:te=ye>0}var Pe=k[Q+(te?-1:0)],_e=te==(Pe.level==1),We=_e?Pe.from:Pe.to,Ve=_e?"after":"before";return n.ch==We&&n.sticky==Ve?t:new Xt(new He(n.line,We,Ve),r)}function Es(e,t,n,r){var o,k;if(t.touches)o=t.touches[0].clientX,k=t.touches[0].clientY;else try{o=t.clientX,k=t.clientY}catch(Pe){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ne(t);var H=e.display,Z=H.lineDiv.getBoundingClientRect();if(k>Z.bottom||!be(e,n))return ce(t);k-=Z.top-H.viewOffset;for(var Q=0;Q=o){var pe=Lr(e.doc,k),ye=e.display.gutterSpecs[Q];return je(e,n,e,pe,ye.className,t),ce(t)}}}function Ga(e,t){return Es(e,t,"gutterClick",!0)}function Cs(e,t){if(gn(e.display,t)||Yl(e,t))return;if(Xe(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return be(e,"gutterContextMenu")?Es(e,t,"gutterContextMenu",!1):!1}function Ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vi(e)}var si={toString:function(){return"CodeMirror.Init"}},Ts={},oa={};function $l(e){var t=e.optionHandlers;function n(r,o,k,H){e.defaults[r]=o,k&&(t[r]=H?function(Z,Q,te){te!=si&&k(Z,Q,te)}:k)}e.defineOption=n,e.Init=si,n("value","",function(r,o){return r.setValue(o)},!0),n("mode",null,function(r,o){r.doc.modeOption=o,Pa(r)},!0),n("indentUnit",2,Pa,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){wi(r),vi(r),Mr(r)},!0),n("lineSeparator",null,function(r,o){if(r.doc.lineSep=o,!o)return;var k=[],H=r.doc.first;r.doc.iter(function(Q){for(var te=0;;){var pe=Q.text.indexOf(o,te);if(pe==-1)break;te=pe+o.length,k.push(He(H,pe))}H++});for(var Z=k.length-1;Z>=0;Z--)ni(r.doc,o,k[Z],He(k[Z].line,k[Z].ch+o.length))}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,o,k){r.state.specialChars=new RegExp(o.source+(o.test(" ")?"":"| "),"g"),k!=si&&r.refresh()}),n("specialCharPlaceholder",Wt,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",i?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,o){return r.getInputField().spellcheck=o},!0),n("autocorrect",!1,function(r,o){return r.getInputField().autocorrect=o},!0),n("autocapitalize",!1,function(r,o){return r.getInputField().autocapitalize=o},!0),n("rtlMoveVisually",!C),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Ss(r),Ti(r)},!0),n("keyMap","default",function(r,o,k){var H=ia(o),Z=k!=si&&ia(k);Z&&Z.detach&&Z.detach(r,H),H.attach&&H.attach(r,Z||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Zl,!0),n("gutters",[],function(r,o){r.display.gutterSpecs=_a(o,r.options.lineNumbers),Ti(r)},!0),n("fixedGutter",!0,function(r,o){r.display.gutters.style.left=o?Ea(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return qn(r)},!0),n("scrollbarStyle","native",function(r){Ao(r),qn(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,o){r.display.gutterSpecs=_a(r.options.gutters,o),Ti(r)},!0),n("firstLineNumber",1,Ti,!0),n("lineNumberFormatter",function(r){return r},Ti,!0),n("showCursorWhenSelecting",!1,yi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,o){o=="nocursor"&&(Zn(r),r.display.input.blur()),r.display.input.readOnlyChanged(o)}),n("screenReaderLabel",null,function(r,o){o=o===""?null:o,r.display.input.screenReaderLabelChanged(o)}),n("disableInput",!1,function(r,o){o||r.display.input.reset()},!0),n("dragDrop",!0,Jl),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,yi,!0),n("singleCursorHeightPerLine",!0,yi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,wi,!0),n("addModeClass",!1,wi,!0),n("pollInterval",100),n("undoDepth",200,function(r,o){return r.doc.history.undoDepth=o}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,wi,!0),n("moveInputWithCursor",!0,function(r,o){o||r.display.input.resetPosition()}),n("tabindex",null,function(r,o){return r.display.input.getField().tabIndex=o||""}),n("autofocus",null),n("direction","ltr",function(r,o){return r.doc.setDirection(o)},!0),n("phrases",null)}function Jl(e,t,n){var r=n&&n!=si;if(!t!=!r){var o=e.display.dragFunctions,k=t?Ie:st;k(e.display.scroller,"dragstart",o.start),k(e.display.scroller,"dragenter",o.enter),k(e.display.scroller,"dragover",o.over),k(e.display.scroller,"dragleave",o.leave),k(e.display.scroller,"drop",o.drop)}}function Zl(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),ji(e)),Ca(e),Mr(e),vi(e),setTimeout(function(){return qn(e)},100)}function ir(e,t){var n=this;if(!(this instanceof ir))return new ir(e,t);this.options=t=t?N(t):{},N(Ts,t,!1);var r=t.value;typeof r=="string"?r=new Ir(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var o=new ir.inputStyles[t.inputStyle](this),k=this.display=new hl(e,r,o,t);k.wrapper.CodeMirror=this,Ss(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ao(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ee,keySeq:null,specialChars:null},t.autofocus&&!i&&k.input.focus(),W&&U<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ql(this),Rl(),Un(this),this.curOp.forceUpdate=!0,No(this,r),t.autofocus&&!i||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ta(n)},20):Zn(this);for(var H in oa)oa.hasOwnProperty(H)&&oa[H](this,t[H],si);Ro(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z20*20}Ie(t.scroller,"touchstart",function(Q){if(!Xe(e,Q)&&!k(Q)&&!Ga(e,Q)){t.input.ensurePolled(),clearTimeout(n);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-r.end<=300?r:null},Q.touches.length==1&&(t.activeTouch.left=Q.touches[0].pageX,t.activeTouch.top=Q.touches[0].pageY)}}),Ie(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ie(t.scroller,"touchend",function(Q){var te=t.activeTouch;if(te&&!gn(t,Q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var pe=e.coordsChar(t.activeTouch,"page"),ye;!te.prev||H(te,te.prev)?ye=new Xt(pe,pe):!te.prev.prev||H(te,te.prev.prev)?ye=e.findWordAt(pe):ye=new Xt(He(pe.line,0),c(e.doc,He(pe.line+1,0))),e.setSelection(ye.anchor,ye.head),e.focus(),ne(Q)}o()}),Ie(t.scroller,"touchcancel",o),Ie(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xi(e,t.scroller.scrollTop),Fn(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),Ie(t.scroller,"mousewheel",function(Q){return Oo(e,Q)}),Ie(t.scroller,"DOMMouseScroll",function(Q){return Oo(e,Q)}),Ie(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Q){Xe(e,Q)||ve(Q)},over:function(Q){Xe(e,Q)||(Dl(e,Q),ve(Q))},start:function(Q){return Ll(e,Q)},drop:vr(e,Al),leave:function(Q){Xe(e,Q)||os(e)}};var Z=t.input.getField();Ie(Z,"keyup",function(Q){return vs.call(e,Q)}),Ie(Z,"keydown",vr(e,gs)),Ie(Z,"keypress",vr(e,ys)),Ie(Z,"focus",function(Q){return Ta(e,Q)}),Ie(Z,"blur",function(Q){return Zn(e,Q)})}var za=[];ir.defineInitHook=function(e){return za.push(e)};function Bi(e,t,n,r){var o=e.doc,k;n==null&&(n="add"),n=="smart"&&(o.mode.indent?k=tt(e,t).state:n="prev");var H=e.options.tabSize,Z=vt(o,t),Q=Y(Z.text,null,H);Z.stateAfter&&(Z.stateAfter=null);var te=Z.text.match(/^\s*/)[0],pe;if(!r&&!/\S/.test(Z.text))pe=0,n="not";else if(n=="smart"&&(pe=o.mode.indent(k,Z.text.slice(te.length),Z.text),pe==Oe||pe>150)){if(!r)return;n="prev"}n=="prev"?t>o.first?pe=Y(vt(o,t-1).text,null,H):pe=0:n=="add"?pe=Q+e.options.indentUnit:n=="subtract"?pe=Q-e.options.indentUnit:typeof n=="number"&&(pe=Q+n),pe=Math.max(0,pe);var ye="",Pe=0;if(e.options.indentWithTabs)for(var _e=Math.floor(pe/H);_e;--_e)Pe+=H,ye+=" ";if(PeH,Q=wt(t),te=null;if(Z&&r.ranges.length>1)if(un&&un.text.join(` +`)==t){if(r.ranges.length%un.text.length==0){te=[];for(var pe=0;pe=0;Pe--){var _e=r.ranges[Pe],We=_e.from(),Ve=_e.to();_e.empty()&&(n&&n>0?We=He(We.line,We.ch-n):e.state.overwrite&&!Z?Ve=He(Ve.line,Math.min(vt(k,Ve.line).text.length,Ve.ch+re(Q).length)):Z&&un&&un.lineWise&&un.text.join(` `)==Q.join(` `)&&(We=Ve=He(We.line,0)));var $e={from:We,to:Ve,text:te?te[Pe%te.length]:Q,origin:o||(Z?"paste":e.state.cutIncoming>H?"cut":"+input")};ri(e.doc,$e),Cr(e,"inputRead",e,$e)}t&&!Z&&As(e,t),Qn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ye),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ws(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Hr(t,function(){return Ka(t,n,0,null,"paste")}),!0}function As(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)continue;var k=e.getModeAt(o.head),H=!1;if(k.electricChars){for(var Z=0;Z-1){H=Bi(e,o.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(vt(e.doc,o.head.line).text.slice(0,o.head.ch))&&(H=Bi(e,o.head.line,"smart")));H&&Cr(e,"electricInput",e,o.head.line)}}function Ls(e){for(var t=[],n=[],r=0;rk&&(Bi(this,Z.head.line,r,!0),k=Z.head.line,H==this.doc.sel.primIndex&&Qn(this));else{var Q=Z.from(),te=Z.to(),pe=Math.max(k,Q.line);k=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var ye=pe;ye0&&Fa(this.doc,H,new Xt(Q,Pe[H].to()),Se)}}}),getTokenAt:function(r,o){return er(this,r,o)},getLineTokens:function(r,o){return er(this,He(r),o,!0)},getTokenTypeAt:function(r){r=c(this.doc,r);var o=Ge(this,vt(this.doc,r.line)),k=0,H=(o.length-1)/2,Z=r.ch,Q;if(Z==0)Q=o[2];else for(;;){var te=k+H>>1;if((te?o[te*2-1]:0)>=Z)H=te;else if(o[te*2+1]Q&&(r=Q,H=!0),Z=vt(this.doc,r)}else Z=r;return Gi(this,Z,{top:0,left:0},o||"page",k||H).top+(H?this.doc.height-on(Z):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,o,k,H,Z){var Q=this.display;r=sn(this,c(this.doc,r));var te=r.bottom,pe=r.left;if(o.style.position="absolute",o.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(o),Q.sizer.appendChild(o),H=="over")te=r.top;else if(H=="above"||H=="near"){var ye=Math.max(Q.wrapper.clientHeight,this.doc.height),Pe=Math.max(Q.sizer.clientWidth,Q.lineSpace.clientWidth);(H=="above"||r.bottom+o.offsetHeight>ye)&&r.top>o.offsetHeight?te=r.top-o.offsetHeight:r.bottom+o.offsetHeight<=ye&&(te=r.bottom),pe+o.offsetWidth>Pe&&(pe=Pe-o.offsetWidth)}o.style.top=te+"px",o.style.left=o.style.right="",Z=="right"?(pe=Q.sizer.clientWidth-o.offsetWidth,o.style.right="0px"):(Z=="left"?pe=0:Z=="middle"&&(pe=(Q.sizer.clientWidth-o.offsetWidth)/2),o.style.left=pe+"px"),k&&Js(this,{left:pe,top:te,right:pe+o.offsetWidth,bottom:te+o.offsetHeight})},triggerOnKeyDown:Dr(gs),triggerOnKeyPress:Dr(ys),triggerOnKeyUp:vs,triggerOnMouseDown:Dr(bs),execCommand:function(r){if(Mi.hasOwnProperty(r))return Mi[r].call(null,this)},triggerElectric:Dr(function(r){As(this,r)}),findPosH:function(r,o,k,H){var Z=1;o<0&&(Z=-1,o=-o);for(var Q=c(this.doc,r),te=0;te0&&pe(k.charAt(H-1));)--H;for(;Z.5||this.options.lineWrapping)&&Ca(this),je(this,"refresh",this)}),swapDoc:Dr(function(r){var o=this.doc;return o.cm=null,this.state.selectingText&&this.state.selectingText(),No(this,r),vi(this),this.display.input.reset(),bi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Cr(this,"swapDoc",this,o),o}),phrase:function(r){var o=this.options.phrases;return o&&Object.prototype.hasOwnProperty.call(o,r)?o[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ee(e),e.registerHelper=function(r,o,k){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][o]=k},e.registerGlobalHelper=function(r,o,k,H){e.registerHelper(r,o,H),n[r]._global.push({pred:k,val:H})}}function Va(e,t,n,r,o){var k=t,H=n,Z=vt(e,t.line),Q=o&&e.direction=="rtl"?-n:n;function te(){var ut=t.line+Q;return ut=e.first+e.size?!1:(t=new He(ut,t.ch,t.sticky),Z=vt(e,ut))}function pe(ut){var nt;if(r=="codepoint"){var gt=Z.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(gt)?nt=null:nt=new He(t.line,Math.max(0,Math.min(Z.text.length,t.ch+n*(gt>=55296&><56320?2:1))),-n)}else o?nt=Ml(e.cm,Z,t,n):nt=Ua(Z,t,n);if(nt==null)if(!ut&&te())t=ja(o,e.cm,Z,t.line,Q);else return!1;else t=nt;return!0}if(r=="char"||r=="codepoint")pe();else if(r=="column")pe(!0);else if(r=="word"||r=="group")for(var ye=null,Pe=r=="group",_e=e.cm&&e.cm.getHelper(t,"wordChars"),We=!0;!(n<0&&!pe(!We));We=!1){var Ve=Z.text.charAt(t.ch)||` `,$e=we(Ve,_e)?"w":Pe&&Ve==` `?"n":!Pe||/\s/.test(Ve)?null:"p";if(Pe&&!We&&!$e&&($e="s"),ye&&ye!=$e){n<0&&(n=1,pe(),t.sticky="after");break}if($e&&(ye=$e),n>0&&!pe(!We))break}var rt=ta(e,t,k,H,!0);return Pt(k,rt)&&(rt.hitSide=!0),rt}function ks(e,t,n,r){var o=e.doc,k=t.left,H;if(r=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Q=Math.max(Z-.5*$n(e.display),3);H=(n>0?t.bottom:t.top)+n*Q}else r=="line"&&(H=n>0?t.bottom+3:t.top-3);for(var te;!(te=ya(e,k,H),!te.outside);){if(n<0?H<=0:H>=o.height){te.hitSide=!0;break}H+=n*5}return te}var Qt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Qt.prototype.init=function(e){var t=this,n=this,r=n.cm,o=n.div=e.lineDiv;Ds(o,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function k(Z){for(var Q=Z.target;Q;Q=Q.parentNode){if(Q==o)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Q.className))break}return!1}Ie(o,"paste",function(Z){if(!k(Z)||Xe(r,Z)||ws(Z,r))return;U<=11&&setTimeout(vr(r,function(){return t.updateFromDOM()}),20)}),Ie(o,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),Ie(o,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),Ie(o,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ie(o,"touchstart",function(){return n.forceCompositionEnd()}),Ie(o,"input",function(){t.composing||t.readFromDOMSoon()});function H(Z){if(!k(Z)||Xe(r,Z))return;if(r.somethingSelected())sa({lineWise:!1,text:r.getSelections()}),Z.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var Q=Ls(r);sa({lineWise:!0,text:Q.text}),Z.type=="cut"&&r.operation(function(){r.setSelections(Q.ranges,0,Se),r.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var te=un.text.join(` `);if(Z.clipboardData.setData("Text",te),Z.clipboardData.getData("Text")==te){Z.preventDefault();return}}var pe=Rs(),ye=pe.firstChild;r.display.lineSpace.insertBefore(pe,r.display.lineSpace.firstChild),ye.value=un.text.join(` -`);var Pe=document.activeElement;z(ye),setTimeout(function(){r.display.lineSpace.removeChild(pe),Pe.focus(),Pe==o&&n.showPrimarySelection()},50)}Ie(o,"copy",H),Ie(o,"cut",H)},Qt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qt.prototype.prepareSelection=function(){var e=vo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Qt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Qt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||o.line=t.display.viewFrom&&_s(t,r)||{node:Z[0].measure.map[2],offset:0},te=o.linee.firstLine()&&(r=He(r.line-1,vt(e.doc,r.line-1).length)),o.ch==vt(e.doc,o.line).text.length&&o.linet.viewTo-1)return!1;var k,H,Z;r.line==t.viewFrom||(k=Nn(e,r.line))==0?(H=_t(t.view[0].line),Z=t.view[0].node):(H=_t(t.view[k].line),Z=t.view[k-1].node.nextSibling);var Q=Nn(e,o.line),te,pe;if(Q==t.view.length-1?(te=t.viewTo-1,pe=t.lineDiv.lastChild):(te=_t(t.view[Q+1].line)-1,pe=t.view[Q+1].node.previousSibling),!Z)return!1;for(var ye=e.doc.splitLines(tu(e,Z,pe,H,te)),Pe=kr(e.doc,He(H,0),He(te,vt(e.doc,te).text.length));ye.length>1&&Pe.length>1;)if(re(ye)==re(Pe))ye.pop(),Pe.pop(),te--;else if(ye[0]==Pe[0])ye.shift(),Pe.shift(),H++;else break;for(var _e=0,We=0,Ve=ye[0],$e=Pe[0],rt=Math.min(Ve.length,$e.length);_er.ch&&ut.charCodeAt(ut.length-We-1)==nt.charCodeAt(nt.length-We-1);)_e--,We++;ye[ye.length-1]=ut.slice(0,ut.length-We).replace(/^\u200b+/,""),ye[0]=ye[0].slice(_e).replace(/\u200b+$/,"");var Tt=He(H,_e),Et=He(te,Pe.length?re(Pe).length-We:0);if(ye.length>1||ye[0]||lt(Tt,Et))return ni(e.doc,ye,Tt,Et,"+input"),!0},Qt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qt.prototype.reset=function(){this.forceCompositionEnd()},Qt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Qt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Qt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Hr(this.cm,function(){return Mr(e.cm)})},Qt.prototype.setUneditable=function(e){e.contentEditable="false"},Qt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||vr(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Qt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Qt.prototype.onContextMenu=function(){},Qt.prototype.resetPosition=function(){},Qt.prototype.needsContentAttribute=!0;function _s(e,t){var n=pa(e,t.line);if(!n||n.hidden)return null;var r=vt(e.doc,t.line),o=ro(n,r,t.line),k=qe(r,e.doc.direction),H="left";if(k){var Z=Ye(k,t.ch);H=Z%2?"right":"left"}var Q=ao(o.map,t.ch,H);return Q.offset=Q.collapse=="right"?Q.end:Q.start,Q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function li(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,o){var k="",H=!1,Z=e.doc.lineSeparator(),Q=!1;function te(_e){return function(We){return We.id==_e}}function pe(){H&&(k+=Z,Q&&(k+=Z),H=Q=!1)}function ye(_e){_e&&(pe(),k+=_e)}function Pe(_e){if(_e.nodeType==1){var We=_e.getAttribute("cm-text");if(We){ye(We);return}var Ve=_e.getAttribute("cm-marker"),$e;if(Ve){var rt=e.findMarks(He(r,0),He(o+1,0),te(+Ve));rt.length&&($e=rt[0].find(0))&&ye(kr(e.doc,$e.from,$e.to).join(Z));return}if(_e.getAttribute("contenteditable")=="false")return;var ut=/^(pre|div|p|li|table|br)$/i.test(_e.nodeName);if(!/^br$/i.test(_e.nodeName)&&_e.textContent.length==0)return;ut&&pe();for(var nt=0;nt<_e.childNodes.length;nt++)Pe(_e.childNodes[nt]);/^(pre|p)$/i.test(_e.nodeName)&&(Q=!0),ut&&(H=!0)}else _e.nodeType==3&&ye(_e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Pe(t),t==n);)t=t.nextSibling,Q=!1;return k}function la(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return li(e.clipPos(He(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var o=0;o=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Ie(o,"paste",function(H){if(Xe(r,H)||ws(H,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function k(H){if(Xe(r,H))return;if(r.somethingSelected())sa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var Z=Ls(r);sa({lineWise:!0,text:Z.text}),H.type=="cut"?r.setSelections(Z.ranges,null,Se):(n.prevInput="",o.value=Z.text.join(` -`),z(o))}else return;H.type=="cut"&&(r.state.cutIncoming=+new Date)}Ie(o,"cut",k),Ie(o,"copy",k),Ie(e.scroller,"paste",function(H){if(gn(e,H)||Xe(r,H))return;if(!o.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var Z=new Event("paste");Z.clipboardData=H.clipboardData,o.dispatchEvent(Z)}),Ie(e.lineSpace,"selectstart",function(H){gn(e,H)||ne(H)}),Ie(o,"compositionstart",function(){var H=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:H,range:r.markText(H,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},ur.prototype.createField=function(e){this.wrapper=Rs(),this.textarea=this.wrapper.firstChild},ur.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ur.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vo(e);if(e.options.moveInputWithCursor){var o=sn(e,n.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),H=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+H.top-k.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+H.left-k.left))}return r},ur.prototype.showSelection=function(e){var t=this.cm,n=t.display;h(n.cursorDiv,e.cursors),h(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ur.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&z(this.textarea),W&&U>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",W&&U>=9&&(this.hasSelection=null))},ur.prototype.getField=function(){return this.textarea},ur.prototype.supportsTouch=function(){return!1},ur.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!i||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},ur.prototype.blur=function(){this.textarea.blur()},ur.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ur.prototype.receivedFocus=function(){this.slowPoll()},ur.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ur.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},ur.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||ft(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(W&&U>=9&&this.hasSelection===o||s&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=o.charCodeAt(0);if(k==8203&&!r&&(r="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var H=0,Z=Math.min(r.length,o.length);H1e3||o.indexOf(` +`);var Pe=document.activeElement;z(ye),setTimeout(function(){r.display.lineSpace.removeChild(pe),Pe.focus(),Pe==o&&n.showPrimarySelection()},50)}Ie(o,"copy",H),Ie(o,"cut",H)},Qt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qt.prototype.prepareSelection=function(){var e=vo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Qt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Qt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||o.line=t.display.viewFrom&&_s(t,r)||{node:Z[0].measure.map[2],offset:0},te=o.linee.firstLine()&&(r=He(r.line-1,vt(e.doc,r.line-1).length)),o.ch==vt(e.doc,o.line).text.length&&o.linet.viewTo-1)return!1;var k,H,Z;r.line==t.viewFrom||(k=Nn(e,r.line))==0?(H=_t(t.view[0].line),Z=t.view[0].node):(H=_t(t.view[k].line),Z=t.view[k-1].node.nextSibling);var Q=Nn(e,o.line),te,pe;if(Q==t.view.length-1?(te=t.viewTo-1,pe=t.lineDiv.lastChild):(te=_t(t.view[Q+1].line)-1,pe=t.view[Q+1].node.previousSibling),!Z)return!1;for(var ye=e.doc.splitLines(tu(e,Z,pe,H,te)),Pe=kr(e.doc,He(H,0),He(te,vt(e.doc,te).text.length));ye.length>1&&Pe.length>1;)if(re(ye)==re(Pe))ye.pop(),Pe.pop(),te--;else if(ye[0]==Pe[0])ye.shift(),Pe.shift(),H++;else break;for(var _e=0,We=0,Ve=ye[0],$e=Pe[0],rt=Math.min(Ve.length,$e.length);_er.ch&&ut.charCodeAt(ut.length-We-1)==nt.charCodeAt(nt.length-We-1);)_e--,We++;ye[ye.length-1]=ut.slice(0,ut.length-We).replace(/^\u200b+/,""),ye[0]=ye[0].slice(_e).replace(/\u200b+$/,"");var Tt=He(H,_e),Et=He(te,Pe.length?re(Pe).length-We:0);if(ye.length>1||ye[0]||lt(Tt,Et))return ni(e.doc,ye,Tt,Et,"+input"),!0},Qt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qt.prototype.reset=function(){this.forceCompositionEnd()},Qt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Qt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Qt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Hr(this.cm,function(){return Mr(e.cm)})},Qt.prototype.setUneditable=function(e){e.contentEditable="false"},Qt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||vr(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Qt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Qt.prototype.onContextMenu=function(){},Qt.prototype.resetPosition=function(){},Qt.prototype.needsContentAttribute=!0;function _s(e,t){var n=pa(e,t.line);if(!n||n.hidden)return null;var r=vt(e.doc,t.line),o=ro(n,r,t.line),k=qe(r,e.doc.direction),H="left";if(k){var Z=Ye(k,t.ch);H=Z%2?"right":"left"}var Q=ao(o.map,t.ch,H);return Q.offset=Q.collapse=="right"?Q.end:Q.start,Q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function li(e,t){return t&&(e.bad=!0),e}function tu(e,t,n,r,o){var k="",H=!1,Z=e.doc.lineSeparator(),Q=!1;function te(_e){return function(We){return We.id==_e}}function pe(){H&&(k+=Z,Q&&(k+=Z),H=Q=!1)}function ye(_e){_e&&(pe(),k+=_e)}function Pe(_e){if(_e.nodeType==1){var We=_e.getAttribute("cm-text");if(We){ye(We);return}var Ve=_e.getAttribute("cm-marker"),$e;if(Ve){var rt=e.findMarks(He(r,0),He(o+1,0),te(+Ve));rt.length&&($e=rt[0].find(0))&&ye(kr(e.doc,$e.from,$e.to).join(Z));return}if(_e.getAttribute("contenteditable")=="false")return;var ut=/^(pre|div|p|li|table|br)$/i.test(_e.nodeName);if(!/^br$/i.test(_e.nodeName)&&_e.textContent.length==0)return;ut&&pe();for(var nt=0;nt<_e.childNodes.length;nt++)Pe(_e.childNodes[nt]);/^(pre|p)$/i.test(_e.nodeName)&&(Q=!0),ut&&(H=!0)}else _e.nodeType==3&&ye(_e.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Pe(t),t==n);)t=t.nextSibling,Q=!1;return k}function la(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return li(e.clipPos(He(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var o=0;o=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Ie(o,"paste",function(H){if(Xe(r,H)||ws(H,r))return;r.state.pasteIncoming=+new Date,n.fastPoll()});function k(H){if(Xe(r,H))return;if(r.somethingSelected())sa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var Z=Ls(r);sa({lineWise:!0,text:Z.text}),H.type=="cut"?r.setSelections(Z.ranges,null,Se):(n.prevInput="",o.value=Z.text.join(` +`),z(o))}else return;H.type=="cut"&&(r.state.cutIncoming=+new Date)}Ie(o,"cut",k),Ie(o,"copy",k),Ie(e.scroller,"paste",function(H){if(gn(e,H)||Xe(r,H))return;if(!o.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var Z=new Event("paste");Z.clipboardData=H.clipboardData,o.dispatchEvent(Z)}),Ie(e.lineSpace,"selectstart",function(H){gn(e,H)||ne(H)}),Ie(o,"compositionstart",function(){var H=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:H,range:r.markText(H,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},ur.prototype.createField=function(e){this.wrapper=Rs(),this.textarea=this.wrapper.firstChild},ur.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ur.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=vo(e);if(e.options.moveInputWithCursor){var o=sn(e,n.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),H=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+H.top-k.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+H.left-k.left))}return r},ur.prototype.showSelection=function(e){var t=this.cm,n=t.display;d(n.cursorDiv,e.cursors),d(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ur.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&z(this.textarea),W&&U>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",W&&U>=9&&(this.hasSelection=null))},ur.prototype.getField=function(){return this.textarea},ur.prototype.supportsTouch=function(){return!1},ur.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!i||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},ur.prototype.blur=function(){this.textarea.blur()},ur.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ur.prototype.receivedFocus=function(){this.slowPoll()},ur.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ur.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},ur.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||ft(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var o=n.value;if(o==r&&!t.somethingSelected())return!1;if(W&&U>=9&&this.hasSelection===o||s&&/[\uf700-\uf7ff]/.test(o))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=o.charCodeAt(0);if(k==8203&&!r&&(r="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var H=0,Z=Math.min(r.length,o.length);H1e3||o.indexOf(` `)>-1?n.value=e.prevInput="":e.prevInput=o,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ur.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ur.prototype.onKeyPress=function(){W&&U>=9&&(this.hasSelection=null),this.fastPoll()},ur.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,o=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=In(n,e),H=r.scroller.scrollTop;if(!k||f)return;var Z=n.options.resetSelectionOnContextMenu;Z&&n.doc.sel.contains(k)==-1&&vr(n,wr)(n.doc,Tn(k),Se);var Q=o.style.cssText,te=t.wrapper.style.cssText,pe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",o.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-pe.top-5)+"px; left: "+(e.clientX-pe.left-5)+`px; z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ye;O&&(ye=window.scrollY),r.input.focus(),O&&window.scrollTo(null,ye),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=_e,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function Pe(){if(o.selectionStart!=null){var Ve=n.somethingSelected(),$e="\u200B"+(Ve?o.value:"");o.value="\u21DA",o.value=$e,t.prevInput=Ve?"":"\u200B",o.selectionStart=1,o.selectionEnd=$e.length,r.selForContextMenu=n.doc.sel}}function _e(){if(t.contextMenuPending!=_e)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,o.style.cssText=Q,W&&U<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=H),o.selectionStart!=null){(!W||W&&U<9)&&Pe();var Ve=0,$e=function(){r.selForContextMenu==n.doc.sel&&o.selectionStart==0&&o.selectionEnd>0&&t.prevInput=="\u200B"?vr(n,$o)(n):Ve++<10?r.detectingSelectAll=setTimeout($e,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout($e,200)}}if(W&&U>=9&&Pe(),R){ve(e);var We=function(){st(window,"mouseup",We),setTimeout(_e,20)};Ie(window,"mouseup",We)}else setTimeout(_e,50)},ur.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ur.prototype.setUneditable=function(){},ur.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?N(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=I();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=Z.getValue()}var o;if(e.form&&(Ie(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var k=e.form;o=k.submit;try{var H=k.submit=function(){r(),k.submit=o,k.submit(),k.submit=H}}catch(Q){}}t.finishInit=function(Q){Q.save=r,Q.getTextArea=function(){return e},Q.toTextArea=function(){Q.toTextArea=isNaN,r(),e.parentNode.removeChild(Q.getWrapperElement()),e.style.display="",e.form&&(st(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=o))}},e.style.display="none";var Z=ir(function(Q){return e.parentNode.insertBefore(Q,e.nextSibling)},t);return Z}function iu(e){e.off=st,e.on=Ie,e.wheelEventPixels=hl,e.Doc=Ir,e.splitLines=wt,e.countColumn=Y,e.findColumn=Ae,e.isWordChar=me,e.Pass=Oe,e.signal=je,e.Line=On,e.changeEnd=wn,e.scrollbarModel=wo,e.Pos=He,e.cmpPos=lt,e.modes=Ht,e.mimeModes=kt,e.resolveMode=bt,e.getMode=Ct,e.modeExtensions=at,e.extendMode=xt,e.copyState=Zt,e.startState=rr,e.innerMode=nr,e.commands=Mi,e.keyMap=vn,e.keyName=hs,e.isModifierKey=us,e.lookupKey=ai,e.normalizeKeyMap=Pl,e.StringStream=Rt,e.SharedTextMarker=_i,e.TextMarker=Ln,e.LineWidget=ki,e.e_preventDefault=ne,e.e_stopPropagation=oe,e.e_stop=ve,e.addClass=B,e.contains=D,e.rmClass=x,e.keyNames=Dn}$l(ir),ql(ir);var au="iter insert remove copy getEditor constructor".split(" ");for(var ua in Ir.prototype)Ir.prototype.hasOwnProperty(ua)&&le(au,ua)<0&&(ir.prototype[ua]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ir.prototype[ua]));return Ee(Ir),ir.inputStyles={textarea:ur,contenteditable:Qt},ir.defineMode=function(e){!ir.defaults.mode&&e!="null"&&(ir.defaults.mode=e),Ur.apply(this,arguments)},ir.defineMIME=Zr,ir.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ir.defineMIME("text/plain","null"),ir.defineExtension=function(e,t){ir.prototype[e]=t},ir.defineDocExtension=function(e,t){Ir.prototype[e]=t},ir.fromTextArea=nu,iu(ir),ir.version="5.58.2",ir})},Y1PL:function(pt,Te,q){"use strict";q.r(Te),q.d(Te,"ResizableTextArea",function(){return le});var ue=q("wx14"),J=q("1OyB"),_=q("vuIU"),X=q("Ji7U"),F=q("LK+K"),P=q("q1tI"),W=q("VTBJ"),U=q("rePB"),O=q("Zm9Q"),L=q("Kwbf"),d=q("c+Xe"),f=q("m+aA"),T=q("bdgK"),p=new Map;function m(Se){Se.forEach(function(ke){var Le,Ae=ke.target;(Le=p.get(Ae))===null||Le===void 0||Le.forEach(function(ge){return ge(Ae)})})}var g=new T.default(m),a=null,i=null;function s(Se,ke){p.has(Se)||(p.set(Se,new Set),g.observe(Se)),p.get(Se).add(ke)}function l(Se,ke){p.has(Se)&&(p.get(Se).delete(ke),p.get(Se).size||(g.unobserve(Se),p.delete(Se)))}var C=function(Se){Object(X.a)(Le,Se);var ke=Object(F.a)(Le);function Le(){return Object(J.a)(this,Le),ke.apply(this,arguments)}return Object(_.a)(Le,[{key:"render",value:function(){return this.props.children}}]),Le}(P.Component),v=P.createContext(null);function y(Se){var ke=Se.children,Le=Se.onBatchResize,Ae=P.useRef(0),ge=P.useRef([]),de=P.useContext(v),re=P.useCallback(function(he,se,De){Ae.current+=1;var ie=Ae.current;ge.current.push({size:he,element:se,data:De}),Promise.resolve().then(function(){ie===Ae.current&&(Le==null||Le(ge.current),ge.current=[])}),de==null||de(he,se,De)},[Le,de]);return P.createElement(v.Provider,{value:re},ke)}function R(Se){var ke=Se.children,Le=Se.disabled,Ae=P.useRef(null),ge=P.useRef(null),de=P.useContext(v),re=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),he=P.isValidElement(ke)&&Object(d.c)(ke),se=he?ke.ref:null,De=P.useMemo(function(){return Object(d.a)(se,Ae)},[se,Ae]),ie=P.useRef(Se);ie.current=Se;var ae=P.useCallback(function(me){var we=ie.current,Me=we.onResize,Fe=we.data,Ue=me.getBoundingClientRect(),Be=Ue.width,et=Ue.height,Je=me.offsetWidth,Ze=me.offsetHeight,Ye=Math.floor(Be),dt=Math.floor(et);if(re.current.width!==Ye||re.current.height!==dt||re.current.offsetWidth!==Je||re.current.offsetHeight!==Ze){var qe={width:Ye,height:dt,offsetWidth:Je,offsetHeight:Ze};re.current=qe;var ot=Je===Math.round(Be)?Be:Je,Ie=Ze===Math.round(et)?et:Ze,Qe=Object(W.a)(Object(W.a)({},qe),{},{offsetWidth:ot,offsetHeight:Ie});de==null||de(Qe,me,Fe),Me&&Promise.resolve().then(function(){Me(Qe,me)})}},[]);return P.useEffect(function(){var me=Object(f.a)(Ae.current)||Object(f.a)(ge.current);return me&&!Le&&s(me,ae),function(){return l(me,ae)}},[Ae.current,Le]),P.createElement(C,{ref:ge},he?P.cloneElement(ke,{ref:De}):ke)}var w="rc-observer-key";function x(Se){var ke=Se.children,Le=Object(O.a)(ke);return Le.map(function(Ae,ge){var de=(Ae==null?void 0:Ae.key)||"".concat(w,"-").concat(ge);return P.createElement(R,Object(ue.a)({},Se,{key:de}),Ae)})}x.Collection=y;var b=x,h=q("bT9E"),u=q("TSYQ"),A=q.n(u),S=` + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ye;O&&(ye=window.scrollY),r.input.focus(),O&&window.scrollTo(null,ye),r.input.reset(),n.somethingSelected()||(o.value=t.prevInput=" "),t.contextMenuPending=_e,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function Pe(){if(o.selectionStart!=null){var Ve=n.somethingSelected(),$e="\u200B"+(Ve?o.value:"");o.value="\u21DA",o.value=$e,t.prevInput=Ve?"":"\u200B",o.selectionStart=1,o.selectionEnd=$e.length,r.selForContextMenu=n.doc.sel}}function _e(){if(t.contextMenuPending!=_e)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,o.style.cssText=Q,W&&U<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=H),o.selectionStart!=null){(!W||W&&U<9)&&Pe();var Ve=0,$e=function(){r.selForContextMenu==n.doc.sel&&o.selectionStart==0&&o.selectionEnd>0&&t.prevInput=="\u200B"?vr(n,$o)(n):Ve++<10?r.detectingSelectAll=setTimeout($e,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout($e,200)}}if(W&&U>=9&&Pe(),R){ve(e);var We=function(){st(window,"mouseup",We),setTimeout(_e,20)};Ie(window,"mouseup",We)}else setTimeout(_e,50)},ur.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ur.prototype.setUneditable=function(){},ur.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?N(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=I();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=Z.getValue()}var o;if(e.form&&(Ie(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var k=e.form;o=k.submit;try{var H=k.submit=function(){r(),k.submit=o,k.submit(),k.submit=H}}catch(Q){}}t.finishInit=function(Q){Q.save=r,Q.getTextArea=function(){return e},Q.toTextArea=function(){Q.toTextArea=isNaN,r(),e.parentNode.removeChild(Q.getWrapperElement()),e.style.display="",e.form&&(st(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=o))}},e.style.display="none";var Z=ir(function(Q){return e.parentNode.insertBefore(Q,e.nextSibling)},t);return Z}function iu(e){e.off=st,e.on=Ie,e.wheelEventPixels=dl,e.Doc=Ir,e.splitLines=wt,e.countColumn=Y,e.findColumn=Ae,e.isWordChar=me,e.Pass=Oe,e.signal=je,e.Line=On,e.changeEnd=wn,e.scrollbarModel=wo,e.Pos=He,e.cmpPos=lt,e.modes=Ht,e.mimeModes=kt,e.resolveMode=bt,e.getMode=Ct,e.modeExtensions=at,e.extendMode=xt,e.copyState=Zt,e.startState=rr,e.innerMode=nr,e.commands=Mi,e.keyMap=vn,e.keyName=ds,e.isModifierKey=us,e.lookupKey=ai,e.normalizeKeyMap=Pl,e.StringStream=Rt,e.SharedTextMarker=_i,e.TextMarker=Ln,e.LineWidget=ki,e.e_preventDefault=ne,e.e_stopPropagation=oe,e.e_stop=ve,e.addClass=B,e.contains=D,e.rmClass=x,e.keyNames=Dn}$l(ir),ql(ir);var au="iter insert remove copy getEditor constructor".split(" ");for(var ua in Ir.prototype)Ir.prototype.hasOwnProperty(ua)&&le(au,ua)<0&&(ir.prototype[ua]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ir.prototype[ua]));return Ee(Ir),ir.inputStyles={textarea:ur,contenteditable:Qt},ir.defineMode=function(e){!ir.defaults.mode&&e!="null"&&(ir.defaults.mode=e),Ur.apply(this,arguments)},ir.defineMIME=Zr,ir.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ir.defineMIME("text/plain","null"),ir.defineExtension=function(e,t){ir.prototype[e]=t},ir.defineDocExtension=function(e,t){Ir.prototype[e]=t},ir.fromTextArea=nu,iu(ir),ir.version="5.58.2",ir})},Y1PL:function(pt,Te,q){"use strict";q.r(Te),q.d(Te,"ResizableTextArea",function(){return le});var ue=q("wx14"),J=q("1OyB"),_=q("vuIU"),X=q("Ji7U"),F=q("LK+K"),P=q("q1tI"),W=q("VTBJ"),U=q("rePB"),O=q("Zm9Q"),L=q("Kwbf"),h=q("c+Xe"),f=q("m+aA"),T=q("bdgK"),p=new Map;function m(Se){Se.forEach(function(ke){var Le,Ae=ke.target;(Le=p.get(Ae))===null||Le===void 0||Le.forEach(function(ge){return ge(Ae)})})}var g=new T.default(m),a=null,i=null;function s(Se,ke){p.has(Se)||(p.set(Se,new Set),g.observe(Se)),p.get(Se).add(ke)}function l(Se,ke){p.has(Se)&&(p.get(Se).delete(ke),p.get(Se).size||(g.unobserve(Se),p.delete(Se)))}var C=function(Se){Object(X.a)(Le,Se);var ke=Object(F.a)(Le);function Le(){return Object(J.a)(this,Le),ke.apply(this,arguments)}return Object(_.a)(Le,[{key:"render",value:function(){return this.props.children}}]),Le}(P.Component),v=P.createContext(null);function y(Se){var ke=Se.children,Le=Se.onBatchResize,Ae=P.useRef(0),ge=P.useRef([]),he=P.useContext(v),re=P.useCallback(function(de,se,De){Ae.current+=1;var ie=Ae.current;ge.current.push({size:de,element:se,data:De}),Promise.resolve().then(function(){ie===Ae.current&&(Le==null||Le(ge.current),ge.current=[])}),he==null||he(de,se,De)},[Le,he]);return P.createElement(v.Provider,{value:re},ke)}function R(Se){var ke=Se.children,Le=Se.disabled,Ae=P.useRef(null),ge=P.useRef(null),he=P.useContext(v),re=P.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),de=P.isValidElement(ke)&&Object(h.c)(ke),se=de?ke.ref:null,De=P.useMemo(function(){return Object(h.a)(se,Ae)},[se,Ae]),ie=P.useRef(Se);ie.current=Se;var ae=P.useCallback(function(me){var we=ie.current,Me=we.onResize,Fe=we.data,Ue=me.getBoundingClientRect(),Be=Ue.width,et=Ue.height,Je=me.offsetWidth,Ze=me.offsetHeight,Ye=Math.floor(Be),ht=Math.floor(et);if(re.current.width!==Ye||re.current.height!==ht||re.current.offsetWidth!==Je||re.current.offsetHeight!==Ze){var qe={width:Ye,height:ht,offsetWidth:Je,offsetHeight:Ze};re.current=qe;var ot=Je===Math.round(Be)?Be:Je,Ie=Ze===Math.round(et)?et:Ze,Qe=Object(W.a)(Object(W.a)({},qe),{},{offsetWidth:ot,offsetHeight:Ie});he==null||he(Qe,me,Fe),Me&&Promise.resolve().then(function(){Me(Qe,me)})}},[]);return P.useEffect(function(){var me=Object(f.a)(Ae.current)||Object(f.a)(ge.current);return me&&!Le&&s(me,ae),function(){return l(me,ae)}},[Ae.current,Le]),P.createElement(C,{ref:ge},de?P.cloneElement(ke,{ref:De}):ke)}var w="rc-observer-key";function x(Se){var ke=Se.children,Le=Object(O.a)(ke);return Le.map(function(Ae,ge){var he=(Ae==null?void 0:Ae.key)||"".concat(w,"-").concat(ge);return P.createElement(R,Object(ue.a)({},Se,{key:he}),Ae)})}x.Collection=y;var b=x,d=q("bT9E"),u=q("TSYQ"),A=q.n(u),S=` min-height:0 !important; max-height:none !important; height:0 !important; @@ -340,36 +340,36 @@ b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var o=e. z-index:-1000 !important; top:0 !important; right:0 !important -`,D=["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"],I={},B;function j(Se){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if(ke&&I[Le])return I[Le];var Ae=window.getComputedStyle(Se),ge=Ae.getPropertyValue("box-sizing")||Ae.getPropertyValue("-moz-box-sizing")||Ae.getPropertyValue("-webkit-box-sizing"),de=parseFloat(Ae.getPropertyValue("padding-bottom"))+parseFloat(Ae.getPropertyValue("padding-top")),re=parseFloat(Ae.getPropertyValue("border-bottom-width"))+parseFloat(Ae.getPropertyValue("border-top-width")),he=D.map(function(De){return"".concat(De,":").concat(Ae.getPropertyValue(De))}).join(";"),se={sizingStyle:he,paddingSize:de,borderSize:re,boxSizing:ge};return ke&&Le&&(I[Le]=se),se}function z(Se){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),Se.getAttribute("wrap")?B.setAttribute("wrap",Se.getAttribute("wrap")):B.removeAttribute("wrap");var ge=j(Se,ke),de=ge.paddingSize,re=ge.borderSize,he=ge.boxSizing,se=ge.sizingStyle;B.setAttribute("style","".concat(se,";").concat(S)),B.value=Se.value||Se.placeholder||"";var De=Number.MIN_SAFE_INTEGER,ie=Number.MAX_SAFE_INTEGER,ae=B.scrollHeight,me;if(he==="border-box"?ae+=re:he==="content-box"&&(ae-=de),Le!==null||Ae!==null){B.value=" ";var we=B.scrollHeight-de;Le!==null&&(De=we*Le,he==="border-box"&&(De=De+de+re),ae=Math.max(De,ae)),Ae!==null&&(ie=we*Ae,he==="border-box"&&(ie=ie+de+re),me=ae>ie?"":"hidden",ae=Math.min(ie,ae))}return{height:ae,minHeight:De,maxHeight:ie,overflowY:me,resize:"none"}}var M=q("Gytx"),N=q.n(M),Y;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})(Y||(Y={}));var ee=function(Se){Object(X.a)(Le,Se);var ke=Object(F.a)(Le);function Le(Ae){var ge;return Object(J.a)(this,Le),ge=ke.call(this,Ae),ge.nextFrameActionId=void 0,ge.resizeFrameId=void 0,ge.textArea=void 0,ge.saveTextArea=function(de){ge.textArea=de},ge.handleResize=function(de){var re=ge.state.resizeStatus,he=ge.props,se=he.autoSize,De=he.onResize;if(re!==Y.NONE)return;typeof De=="function"&&De(de),se&&ge.resizeOnNextFrame()},ge.resizeOnNextFrame=function(){cancelAnimationFrame(ge.nextFrameActionId),ge.nextFrameActionId=requestAnimationFrame(ge.resizeTextarea)},ge.resizeTextarea=function(){var de=ge.props.autoSize;if(!de||!ge.textArea)return;var re=de.minRows,he=de.maxRows,se=z(ge.textArea,!1,re,he);ge.setState({textareaStyles:se,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(ge.resizeFrameId),ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:Y.RESIZED},function(){ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:Y.NONE}),ge.fixFirefoxAutoScroll()})})})})},ge.renderTextArea=function(){var de=ge.props,re=de.prefixCls,he=re===void 0?"rc-textarea":re,se=de.autoSize,De=de.onResize,ie=de.className,ae=de.disabled,me=ge.state,we=me.textareaStyles,Me=me.resizeStatus,Fe=Object(h.a)(ge.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ue=A()(he,ie,Object(U.a)({},"".concat(he,"-disabled"),ae));"value"in Fe&&(Fe.value=Fe.value||"");var Be=Object(W.a)(Object(W.a)(Object(W.a)({},ge.props.style),we),Me===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(b,{onResize:ge.handleResize,disabled:!(se||De)},P.createElement("textarea",Object(ue.a)({},Fe,{className:Ue,style:Be,ref:ge.saveTextArea})))},ge.state={textareaStyles:{},resizeStatus:Y.NONE},ge}return Object(_.a)(Le,[{key:"componentDidUpdate",value:function(ge){(ge.value!==this.props.value||!N()(ge.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 ge=this.textArea.selectionStart,de=this.textArea.selectionEnd;this.textArea.setSelectionRange(ge,de)}}catch(re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Le}(P.Component),le=ee,fe=function(Se){Object(X.a)(Le,Se);var ke=Object(F.a)(Le);function Le(Ae){var ge;Object(J.a)(this,Le),ge=ke.call(this,Ae),ge.resizableTextArea=void 0,ge.focus=function(){ge.resizableTextArea.textArea.focus()},ge.saveTextArea=function(re){ge.resizableTextArea=re},ge.handleChange=function(re){var he=ge.props.onChange;ge.setValue(re.target.value,function(){ge.resizableTextArea.resizeTextarea()}),he&&he(re)},ge.handleKeyDown=function(re){var he=ge.props,se=he.onPressEnter,De=he.onKeyDown;re.keyCode===13&&se&&se(re),De&&De(re)};var de=typeof Ae.value=="undefined"||Ae.value===null?Ae.defaultValue:Ae.value;return ge.state={value:de},ge}return Object(_.a)(Le,[{key:"setValue",value:function(ge,de){"value"in this.props||this.setState({value:ge},de)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(le,Object(ue.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ge){return"value"in ge?{value:ge.value}:null}}]),Le}(P.Component),Oe=Te.default=fe},YljZ:function(pt,Te,q){pt.exports={bg:"bg___1g3ya",flexRow:"flexRow___4tT9z",flexJustifyCenter:"flexJustifyCenter___aoTqw",flexAlignEnd:"flexAlignEnd___JLvk5",flexAlignCenter:"flexAlignCenter___2PiI-",flexColumn:"flexColumn___1y_Ck",formWrap:"formWrap___1U6CK",titleWrap:"titleWrap___1FTIl",fieldWrap:"fieldWrap___dBmKO",mdWrap:"mdWrap___3ebJh",backgroundFa:"backgroundFa___1JRN3",button:"button___117XW"}},ZW9T:function(pt,Te,q){"use strict";q.d(Te,"a",function(){return b});var ue=q("k1fw"),J=q("oBTY"),_=q("9og8"),X=q("miYZ"),F=q("tsqr"),P=q("rAM+"),W=q("tJVT"),U=q("PpiC"),O=q("WmNS"),L=q.n(O),d=q("q1tI"),f=q.n(d),T=q("bdgK");function p(h,u,A,S,D){var I=u.getWordUntilPosition(A),B={startLineNumber:A.lineNumber,endLineNumber:A.lineNumber,startColumn:I.startColumn,endColumn:I.endColumn},j=S.map(function(z){return{label:z,kind:h.languages.CompletionItemKind.Keyword,insertText:z,insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:B}});return D.map(function(z){j.push(Object(ue.a)(Object(ue.a)({},z),{},{range:B}))}),j}var m=function(h){var u={label:"ifelse",kind:h.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` -`),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet},A=["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"];h.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(B,j){var z=p(h,B,j,A,[u]);return{suggestions:z}}});var S=["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"];h.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(B,j){var z=[{label:"print",kind:h.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` -`),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet}],M=p(h,B,j,S,z);return{suggestions:M}}});var D=["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"];h.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(B,j){var z=[u,{label:"main",kind:h.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` -`),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:h.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` -`),insertTextRules:h.languages.CompletionItemInsertTextRule.InsertAsSnippet}],M=p(h,B,j,D,z);return{suggestions:M}}})},g="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",a=q("fjLI"),i=q("LvDl"),s=q("+ua5");function l(h){return/^\d+$/.test(h)?"".concat(h,"px"):h}function C(){}var v=!1,y={"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 R(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=h;if(Array.isArray(h)){for(var A=0;A0||nr.target.offsetWidth>0)&&Qe.current.instance.layout()}}catch(rr){xt.e(rr)}finally{xt.f()}}),Ct.observe(Ie.current)),Ct}function Ne(){F.b.warn({content:decodeURIComponent(g),key:"monaco-editor-tip"})}var Re=function(){var at=Qe.current.instance;if(I!=null&&at&&oe){var xt=at.getModel();xt&&I!==xt.getValue()&&(v=!0,xt.setValue(I),at.layout(),v=!1)}};Object(d.useEffect)(function(){try{var Ct,at=Qe.current.instance;je.current&&clearTimeout(je.current),je.current=setTimeout(function(){Re()},500),at==null||((Ct=at.updateOptions)===null||Ct===void 0)||Ct.call(at,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(I.split(/\r\n|\r|\n/g).length))+3,5)})}catch(xt){debugger}},[I,oe,Qe.current]),Object(d.useEffect)(function(){try{if(et&&Qe.current&&Qe.current.instance){var Ct=Qe.current.instance;Ct.changeViewZones(function(xt){var Zt=document.createElement("div");Zt.style.padding="10px 20px",Zt.style.width="calc(100% - 20px)",Zt.className="my-error-line-wrp",Zt.innerHTML=Ze,xt.addZone({afterLineNumber:et||11,heightInLines:3,domNode:Zt})});var at={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}};Ct.addOverlayWidget(at),Ct.revealPositionInCenter({lineNumber:20,column:1})}}catch(xt){debugger}},[et,Qe.current,oe]),Object(d.useEffect)(function(){var Ct;if((Ct=Qe.current)!==null&&Ct!==void 0&&Ct.instance&&oe&&qe){var at=Qe.current.instance,xt=at.getModel();if(!xt)return;var Zt=function(){var lt=[],Pt=[],Kt=xt.getAllDecorations(),Yt=Object(P.a)(Kt),qt;try{for(Yt.s();!(qt=Yt.n()).done;){var K=qt.value;if(K.options.className==="highlighted-line"){var c;lt.push(K==null||((c=K.range)===null||c===void 0)?void 0:c.startLineNumber),Pt.push(K==null?void 0:K.id)}}}catch(G){Yt.e(G)}finally{Yt.f()}xt.deltaDecorations(Pt,[]);var E=xt.getLineCount();!!Ye&&Ye<=E&&(at.deltaDecorations([],[{range:new w.Range(Ye,1,Ye,xt.getLineMaxColumn(Ye)),options:{isWholeLine:!0,className:"highlighted-line"}}]),at.revealLineInCenter(Ye))};Zt();var nr=function(){var lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Pt=[],Kt=[],Yt=xt.getAllDecorations(),qt=Object(P.a)(Yt),K;try{for(qt.s();!(K=qt.n()).done;){var c=K.value;if(c.options.linesDecorationsClassName==="breakpoints"){var E;Pt.push(c==null||((E=c.range)===null||E===void 0)?void 0:E.startLineNumber),Kt.push(c==null?void 0:c.id)}}}catch(G){qt.e(G)}finally{qt.f()}if(lt)return{lines:Pt,ids:Kt};we(Pt)},rr=function(){var He=Object(_.a)(L.a.mark(function lt(Pt){var Kt;return L.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return Kt={range:new w.Range(Pt,1,Pt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},qt.next=3,xt.deltaDecorations([],[Kt]);case 3:nr();case 4:case"end":return qt.stop()}},lt)}));return function(Pt){return He.apply(this,arguments)}}(),Rt=function(){var He=Object(_.a)(L.a.mark(function lt(Pt){var Kt,Yt,qt,K,c;return L.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:Kt=[],Yt=at.getLineDecorations(Pt),qt=Object(P.a)(Yt);try{for(qt.s();!(K=qt.n()).done;)c=K.value,c.options.linesDecorationsClassName==="breakpoints"&&Kt.push(c.id)}catch($){qt.e($)}finally{qt.f()}return G.next=6,xt.deltaDecorations(Kt,[]);case 6:nr();case 7:case"end":return G.stop()}},lt)}));return function(Pt){return He.apply(this,arguments)}}(),vt=function(lt){var Pt=at.getLineDecorations(lt),Kt=Object(P.a)(Pt),Yt;try{for(Kt.s();!(Yt=Kt.n()).done;){var qt=Yt.value;if(qt.options.linesDecorationsClassName==="breakpoints")return!0}}catch(K){Kt.e(K)}finally{Kt.f()}return!1};if(!Object(i.isEqual)(Fe,nr(!0).lines)){xt.deltaDecorations(nr(!0).ids,[]);var kr=Fe.map(function(He){return{range:new w.Range(He,1,He,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});xt.deltaDecorations([],kr)}var tn=at.onDidChangeModelContent(function(He){var lt=at.getPosition();if(lt){var Pt=lt.lineNumber;xt.getLineContent(Pt).trim()===""?Rt(Pt):vt(Pt)&&(Rt(Pt),rr(Pt))}}),Tr=at.onMouseDown(function(He){var lt,Pt,Kt;if(He.target.detail&&(lt=He.target)!==null&<!==void 0&&(Pt=lt.element)!==null&&Pt!==void 0&&(Kt=Pt.className)!==null&&Kt!==void 0&&Kt.includes("line-numbers")){var Yt=He.target.position.lineNumber;if(xt.getLineContent(Yt).trim()==="")return;vt(Yt)?Rt(Yt):rr(Yt)}}),_t=function(lt){var Pt={range:new w.Range(lt,1,lt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Xe.current=at.deltaDecorations(Xe.current,[Pt])},Lr=function(){Xe.current=at.deltaDecorations(Xe.current,[])},zr=at.onMouseMove(function(He){var lt,Pt,Kt;if(Lr(),He.target.detail&&(lt=He.target)!==null&<!==void 0&&(Pt=lt.element)!==null&&Pt!==void 0&&(Kt=Pt.className)!==null&&Kt!==void 0&&Kt.includes("line-numbers")){var Yt=He.target.position.lineNumber;if(xt.getLineContent(Yt).trim()==="")return;_t(Yt)}}),rn=at.onMouseLeave(function(){Lr()});return function(){tn.dispose(),Tr.dispose(),zr.dispose(),rn.dispose()}}},[Qe.current,oe,Fe,Ye,qe]);function ze(){var Ct=Qe.current.instance;if(Ct){var at=Ct.getSelection(),xt=Qe.current.pastePos||{},Zt=new w.Range(xt.startLineNumber||at.endLineNumber,xt.startColumn||at.endColumn,xt.endLineNumber||at.endLineNumber,xt.endColumn||at.endColumn);setTimeout(function(){Ct.executeEdits("",[{range:Zt,text:""}])},300)}}function it(Ct){(window.navigator.platform.match("Mac")?Ct.metaKey:Ct.ctrlKey)&&Ct.keyCode==83&&(Ct.preventDefault(),ke())}var ct=function(){if(Ae&&Qe.current.instance){var at=Qe.current.instance.getContentHeight();Zr(at0||se.target.offsetWidth>0)&&Ae.layout()}}catch(De){re.e(De)}finally{re.f()}}),ge.observe(N.current)),ge}Object(d.useEffect)(function(){return N.current&&q.e(27).then(q.t.bind(null,"M/lh",7)).then(function(Ae){w=Ae;var ge=w.editor.createDiffEditor(N.current,Object(ue.a)(Object(ue.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},M),{},{wordWrap:!0}));fe(ge);var de=Oe(ge);return function(){ge.dispose();var re=ge.getModel();re&&re.dispose(),de.unobserve(N.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(d.useEffect)(function(){le&&le.setModel({original:w.editor.createModel(I,j),modified:w.editor.createModel(B,j)})},[I,B,j,le]);var Se=l(A),ke=l(D),Le={width:Se,height:ke};return f.a.createElement("div",{className:"my-diff-editor",ref:N,style:Le})}},ZpRC:function(pt,Te,q){"use strict";function ue(d){return typeof d=="object"&&d!=null&&d.nodeType===1}function J(d,f){return(!f||d!=="hidden")&&d!=="visible"&&d!=="clip"}function _(d,f){if(d.clientHeightf||g>d&&a=f&&i>=T?g-d-p:a>f&&iT?a-f+m:0}var F=function(d,f){var T=window,p=f.scrollMode,m=f.block,g=f.inline,a=f.boundary,i=f.skipOverflowHiddenElements,s=typeof a=="function"?a:function(we){return we!==a};if(!ue(d))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,C=[],v=d;ue(v)&&s(v);){if((v=v.parentElement)===l){C.push(v);break}v!=null&&v===document.body&&_(v)&&!_(document.documentElement)||v!=null&&_(v,i)&&C.push(v)}for(var y=T.visualViewport?T.visualViewport.width:innerWidth,R=T.visualViewport?T.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,x=window.scrollY||pageYOffset,b=d.getBoundingClientRect(),h=b.height,u=b.width,A=b.top,S=b.right,D=b.bottom,I=b.left,B=m==="start"||m==="nearest"?A:m==="end"?D:A+h/2,j=g==="center"?I+u/2:g==="end"?S:I,z=[],M=0;M=0&&I>=0&&D<=R&&S<=y&&A>=fe&&D<=Se&&I>=ke&&S<=Oe)return z;var Le=getComputedStyle(N),Ae=parseInt(Le.borderLeftWidth,10),ge=parseInt(Le.borderTopWidth,10),de=parseInt(Le.borderRightWidth,10),re=parseInt(Le.borderBottomWidth,10),he=0,se=0,De="offsetWidth"in N?N.offsetWidth-N.clientWidth-Ae-de:0,ie="offsetHeight"in N?N.offsetHeight-N.clientHeight-ge-re:0;if(l===N)he=m==="start"?B:m==="end"?B-R:m==="nearest"?X(x,x+R,R,ge,re,x+B,x+B+h,h):B-R/2,se=g==="start"?j:g==="center"?j-y/2:g==="end"?j-y:X(w,w+y,y,Ae,de,w+j,w+j+u,u),he=Math.max(0,he+x),se=Math.max(0,se+w);else{he=m==="start"?B-fe-ge:m==="end"?B-Se+re+ie:m==="nearest"?X(fe,Se,ee,ge,re+ie,B,B+h,h):B-(fe+ee/2)+ie/2,se=g==="start"?j-ke-Ae:g==="center"?j-(ke+le/2)+De/2:g==="end"?j-Oe+de+De:X(ke,Oe,le,Ae,de+De,j,j+u,u);var ae=N.scrollLeft,me=N.scrollTop;B+=me-(he=Math.max(0,Math.min(me+he,N.scrollHeight-ee+ie))),j+=ae-(se=Math.max(0,Math.min(ae+se,N.scrollWidth-le+De)))}z.push({el:N,top:he,left:se})}return z};function P(d){return d===Object(d)&&Object.keys(d).length!==0}function W(d,f){f===void 0&&(f="auto");var T="scrollBehavior"in document.body.style;d.forEach(function(p){var m=p.el,g=p.top,a=p.left;m.scroll&&T?m.scroll({top:g,left:a,behavior:f}):(m.scrollTop=g,m.scrollLeft=a)})}function U(d){return d===!1?{block:"end",inline:"nearest"}:P(d)?d:{block:"start",inline:"nearest"}}function O(d,f){var T=!d.ownerDocument.documentElement.contains(d);if(P(f)&&typeof f.behavior=="function")return f.behavior(T?[]:F(d,f));if(T)return;var p=U(f);return W(F(d,p),p.behavior)}var L=Te.a=O},Zss7:function(pt,Te,q){var ue;(function(J){var _=/^\s+/,X=/\s+$/,F=0,P=J.round,W=J.min,U=J.max,O=J.random;function L(re,he){if(re=re||"",he=he||{},re instanceof L)return re;if(!(this instanceof L))return new L(re,he);var se=d(re);this._originalInput=re,this._r=se.r,this._g=se.g,this._b=se.b,this._a=se.a,this._roundA=P(100*this._a)/100,this._format=he.format||se.format,this._gradientType=he.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=se.ok,this._tc_id=F++}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var re=this.toRgb();return(re.r*299+re.g*587+re.b*114)/1e3},getLuminance:function(){var re=this.toRgb(),he,se,De,ie,ae,me;return he=re.r/255,se=re.g/255,De=re.b/255,he<=.03928?ie=he/12.92:ie=J.pow((he+.055)/1.055,2.4),se<=.03928?ae=se/12.92:ae=J.pow((se+.055)/1.055,2.4),De<=.03928?me=De/12.92:me=J.pow((De+.055)/1.055,2.4),.2126*ie+.7152*ae+.0722*me},setAlpha:function(re){return this._a=z(re),this._roundA=P(100*this._a)/100,this},toHsv:function(){var re=m(this._r,this._g,this._b);return{h:re.h*360,s:re.s,v:re.v,a:this._a}},toHsvString:function(){var re=m(this._r,this._g,this._b),he=P(re.h*360),se=P(re.s*100),De=P(re.v*100);return this._a==1?"hsv("+he+", "+se+"%, "+De+"%)":"hsva("+he+", "+se+"%, "+De+"%, "+this._roundA+")"},toHsl:function(){var re=T(this._r,this._g,this._b);return{h:re.h*360,s:re.s,l:re.l,a:this._a}},toHslString:function(){var re=T(this._r,this._g,this._b),he=P(re.h*360),se=P(re.s*100),De=P(re.l*100);return this._a==1?"hsl("+he+", "+se+"%, "+De+"%)":"hsla("+he+", "+se+"%, "+De+"%, "+this._roundA+")"},toHex:function(re){return a(this._r,this._g,this._b,re)},toHexString:function(re){return"#"+this.toHex(re)},toHex8:function(re){return i(this._r,this._g,this._b,this._a,re)},toHex8String:function(re){return"#"+this.toHex8(re)},toRgb:function(){return{r:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(M(this._r,255)*100)+"%",g:P(M(this._g,255)*100)+"%",b:P(M(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+P(M(this._r,255)*100)+"%, "+P(M(this._g,255)*100)+"%, "+P(M(this._b,255)*100)+"%)":"rgba("+P(M(this._r,255)*100)+"%, "+P(M(this._g,255)*100)+"%, "+P(M(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:B[a(this._r,this._g,this._b,!0)]||!1},toFilter:function(re){var he="#"+s(this._r,this._g,this._b,this._a),se=he,De=this._gradientType?"GradientType = 1, ":"";if(re){var ie=L(re);se="#"+s(ie._r,ie._g,ie._b,ie._a)}return"progid:DXImageTransform.Microsoft.gradient("+De+"startColorstr="+he+",endColorstr="+se+")"},toString:function(re){var he=!!re;re=re||this._format;var se=!1,De=this._a<1&&this._a>=0,ie=!he&&De&&(re==="hex"||re==="hex6"||re==="hex3"||re==="hex4"||re==="hex8"||re==="name");return ie?re==="name"&&this._a===0?this.toName():this.toRgbString():(re==="rgb"&&(se=this.toRgbString()),re==="prgb"&&(se=this.toPercentageRgbString()),(re==="hex"||re==="hex6")&&(se=this.toHexString()),re==="hex3"&&(se=this.toHexString(!0)),re==="hex4"&&(se=this.toHex8String(!0)),re==="hex8"&&(se=this.toHex8String()),re==="name"&&(se=this.toName()),re==="hsl"&&(se=this.toHslString()),re==="hsv"&&(se=this.toHsvString()),se||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(re,he){var se=re.apply(null,[this].concat([].slice.call(he)));return this._r=se._r,this._g=se._g,this._b=se._b,this.setAlpha(se._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(R,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(C,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(re,he){return re.apply(null,[this].concat([].slice.call(he)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(D,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(h,arguments)},tetrad:function(){return this._applyCombination(u,arguments)}},L.fromRatio=function(re,he){if(typeof re=="object"){var se={};for(var De in re)re.hasOwnProperty(De)&&(De==="a"?se[De]=re[De]:se[De]=Oe(re[De]));re=se}return L(re,he)};function d(re){var he={r:0,g:0,b:0},se=1,De=null,ie=null,ae=null,me=!1,we=!1;return typeof re=="string"&&(re=ge(re)),typeof re=="object"&&(Ae(re.r)&&Ae(re.g)&&Ae(re.b)?(he=f(re.r,re.g,re.b),me=!0,we=String(re.r).substr(-1)==="%"?"prgb":"rgb"):Ae(re.h)&&Ae(re.s)&&Ae(re.v)?(De=Oe(re.s),ie=Oe(re.v),he=g(re.h,De,ie),me=!0,we="hsv"):Ae(re.h)&&Ae(re.s)&&Ae(re.l)&&(De=Oe(re.s),ae=Oe(re.l),he=p(re.h,De,ae),me=!0,we="hsl"),re.hasOwnProperty("a")&&(se=re.a)),se=z(se),{ok:me,format:re.format||we,r:W(255,U(he.r,0)),g:W(255,U(he.g,0)),b:W(255,U(he.b,0)),a:se}}function f(re,he,se){return{r:M(re,255)*255,g:M(he,255)*255,b:M(se,255)*255}}function T(re,he,se){re=M(re,255),he=M(he,255),se=M(se,255);var De=U(re,he,se),ie=W(re,he,se),ae,me,we=(De+ie)/2;if(De==ie)ae=me=0;else{var Me=De-ie;me=we>.5?Me/(2-De-ie):Me/(De+ie);switch(De){case re:ae=(he-se)/Me+(he1&&(Be-=1),Be<1/6?Fe+(Ue-Fe)*6*Be:Be<1/2?Ue:Be<2/3?Fe+(Ue-Fe)*(2/3-Be)*6:Fe}if(he===0)De=ie=ae=se;else{var we=se<.5?se*(1+he):se+he-se*he,Me=2*se-we;De=me(Me,we,re+1/3),ie=me(Me,we,re),ae=me(Me,we,re-1/3)}return{r:De*255,g:ie*255,b:ae*255}}function m(re,he,se){re=M(re,255),he=M(he,255),se=M(se,255);var De=U(re,he,se),ie=W(re,he,se),ae,me,we=De,Me=De-ie;if(me=De===0?0:Me/De,De==ie)ae=0;else{switch(De){case re:ae=(he-se)/Me+(he>1)+720)%360;--he;)De.h=(De.h+ie)%360,ae.push(L(De));return ae}function D(re,he){he=he||6;for(var se=L(re).toHsv(),De=se.h,ie=se.s,ae=se.v,me=[],we=1/he;he--;)me.push(L({h:De,s:ie,v:ae})),ae=(ae+we)%1;return me}L.mix=function(re,he,se){se=se===0?0:se||50;var De=L(re).toRgb(),ie=L(he).toRgb(),ae=se/100,me={r:(ie.r-De.r)*ae+De.r,g:(ie.g-De.g)*ae+De.g,b:(ie.b-De.b)*ae+De.b,a:(ie.a-De.a)*ae+De.a};return L(me)},L.readability=function(re,he){var se=L(re),De=L(he);return(J.max(se.getLuminance(),De.getLuminance())+.05)/(J.min(se.getLuminance(),De.getLuminance())+.05)},L.isReadable=function(re,he,se){var De=L.readability(re,he),ie,ae;ae=!1,ie=de(se);switch(ie.level+ie.size){case"AAsmall":case"AAAlarge":ae=De>=4.5;break;case"AAlarge":ae=De>=3;break;case"AAAsmall":ae=De>=7;break}return ae},L.mostReadable=function(re,he,se){var De=null,ie=0,ae,me,we,Me;se=se||{},me=se.includeFallbackColors,we=se.level,Me=se.size;for(var Fe=0;Feie&&(ie=ae,De=L(he[Fe]));return L.isReadable(re,De,{level:we,size:Me})||!me?De:(se.includeFallbackColors=!1,L.mostReadable(re,["#fff","#000"],se))};var I=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},B=L.hexNames=j(I);function j(re){var he={};for(var se in re)re.hasOwnProperty(se)&&(he[re[se]]=se);return he}function z(re){return re=parseFloat(re),(isNaN(re)||re<0||re>1)&&(re=1),re}function M(re,he){ee(re)&&(re="100%");var se=le(re);return re=W(he,U(0,parseFloat(re))),se&&(re=parseInt(re*he,10)/100),J.abs(re-he)<1e-6?1:re%he/parseFloat(he)}function N(re){return W(1,U(0,re))}function Y(re){return parseInt(re,16)}function ee(re){return typeof re=="string"&&re.indexOf(".")!=-1&&parseFloat(re)===1}function le(re){return typeof re=="string"&&re.indexOf("%")!=-1}function fe(re){return re.length==1?"0"+re:""+re}function Oe(re){return re<=1&&(re=re*100+"%"),re}function Se(re){return J.round(parseFloat(re)*255).toString(16)}function ke(re){return Y(re)/255}var Le=function(){var re="[-\\+]?\\d+%?",he="[-\\+]?\\d*\\.\\d+%?",se="(?:"+he+")|(?:"+re+")",De="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",ie="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?";return{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+De),rgba:new RegExp("rgba"+ie),hsl:new RegExp("hsl"+De),hsla:new RegExp("hsla"+ie),hsv:new RegExp("hsv"+De),hsva:new RegExp("hsva"+ie),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ae(re){return!!Le.CSS_UNIT.exec(re)}function ge(re){re=re.replace(_,"").replace(X,"").toLowerCase();var he=!1;if(I[re])re=I[re],he=!0;else if(re=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var se;return(se=Le.rgb.exec(re))?{r:se[1],g:se[2],b:se[3]}:(se=Le.rgba.exec(re))?{r:se[1],g:se[2],b:se[3],a:se[4]}:(se=Le.hsl.exec(re))?{h:se[1],s:se[2],l:se[3]}:(se=Le.hsla.exec(re))?{h:se[1],s:se[2],l:se[3],a:se[4]}:(se=Le.hsv.exec(re))?{h:se[1],s:se[2],v:se[3]}:(se=Le.hsva.exec(re))?{h:se[1],s:se[2],v:se[3],a:se[4]}:(se=Le.hex8.exec(re))?{r:Y(se[1]),g:Y(se[2]),b:Y(se[3]),a:ke(se[4]),format:he?"name":"hex8"}:(se=Le.hex6.exec(re))?{r:Y(se[1]),g:Y(se[2]),b:Y(se[3]),format:he?"name":"hex"}:(se=Le.hex4.exec(re))?{r:Y(se[1]+""+se[1]),g:Y(se[2]+""+se[2]),b:Y(se[3]+""+se[3]),a:ke(se[4]+""+se[4]),format:he?"name":"hex8"}:(se=Le.hex3.exec(re))?{r:Y(se[1]+""+se[1]),g:Y(se[2]+""+se[2]),b:Y(se[3]+""+se[3]),format:he?"name":"hex"}:!1}function de(re){var he,se;return re=re||{level:"AA",size:"small"},he=(re.level||"AA").toUpperCase(),se=(re.size||"small").toLowerCase(),he!=="AA"&&he!=="AAA"&&(he="AA"),se!=="small"&&se!=="large"&&(se="small"),{level:he,size:se}}pt.exports?pt.exports=L:!(ue=function(){return L}.call(Te,q,Te,pt),ue!==void 0&&(pt.exports=ue))})(Math)},bT9E:function(pt,Te,q){"use strict";q.d(Te,"a",function(){return J});var ue=q("VTBJ");function J(_,X){var F=Object(ue.a)({},_);return Array.isArray(X)&&X.forEach(function(P){delete F[P]}),F}},c5Ni:function(pt,Te,q){},dejd:function(pt,Te,q){},dmUQ:function(pt,Te,q){"use strict";var ue=q("Ff2n"),J=q("rePB"),_=q("1OyB"),X=q("vuIU"),F=q("Ji7U"),P=q("md7G"),W=q("foSv"),U=q("q1tI"),O=q.n(U),L=q("TSYQ"),d=q.n(L),f=q("4IlW");function T(h,u){var A=Object.keys(h);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(h);u&&(S=S.filter(function(D){return Object.getOwnPropertyDescriptor(h,D).enumerable})),A.push.apply(A,S)}return A}function p(h){for(var u=1;u1?le-1:0),Oe=1;Oe1?M-1:0),Y=1;Y=0)return parseInt(z.slice(z.indexOf("e-")+2),10);var M=0;return z.indexOf(".")>=0&&(M=z.length-z.indexOf(".")-1),M},D.getInputDisplayValue=function(j){var z=j||D.state,M=z.focused,N=z.inputValue,Y=z.value,ee;M?ee=N:ee=D.toPrecisionAsStep(Y),ee==null&&(ee="");var le=D.formatWrapper(ee);return y(D.props.decimalSeparator)&&(le=le.toString().replace(".",D.props.decimalSeparator)),le},D.recordCursorPosition=function(){try{D.cursorStart=D.input.selectionStart,D.cursorEnd=D.input.selectionEnd,D.currentValue=D.input.value,D.cursorBefore=D.input.value.substring(0,D.cursorStart),D.cursorAfter=D.input.value.substring(D.cursorEnd)}catch(j){}},D.restoreByAfter=function(j){if(j===void 0)return!1;var z=D.input.value,M=z.lastIndexOf(j);if(M===-1)return!1;var N=D.cursorBefore.length;return D.lastKeyCode===f.a.DELETE&&D.cursorBefore.charAt(N-1)===j[0]?(D.fixCaret(N,N),!0):M+j.length===z.length?(D.fixCaret(M,M),!0):!1},D.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(z,M){var N=j.substring(M);return D.restoreByAfter(N)})},D.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},D.stop=function(){D.autoStepTimer&&clearTimeout(D.autoStepTimer)},D.down=function(j,z,M){D.pressingUpOrDown=!0,D.step("down",j,z,M)},D.up=function(j,z,M){D.pressingUpOrDown=!0,D.step("up",j,z,M)},D.saveInput=function(j){D.input=j};var I=S.value;I===void 0&&(I=S.defaultValue),D.state={focused:S.autoFocus};var B=D.getValidValue(D.toNumber(I));return D.state=p(p({},D.state),{},{inputValue:D.toPrecisionAsStep(B),value:B}),D}return Object(X.a)(A,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(D){var I=this.props,B=I.value,j=I.onChange,z=I.max,M=I.min,N=this.state.focused;if(D){if(!R(D.value,B)||!R(D.max,z)||!R(D.min,M)){var Y=N?B:this.getValidValue(B),ee;this.pressingUpOrDown?ee=Y:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:ee})}var le="value"in this.props?B:this.state.value;"max"in this.props&&D.max!==z&&typeof le=="number"&&le>z&&j&&j(z),"min"in this.props&&D.min!==M&&typeof le=="number"&&le1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,j=parseFloat(D);return isNaN(j)?D:(jB&&(j=B),j)}},{key:"setValue",value:function(D,I){var B=this.props.precision,j=this.isNotCompleteNumber(parseFloat(D))?null:parseFloat(D),z=this.state.value,M=z===void 0?null:z,N=this.state.inputValue,Y=N===void 0?null:N,ee=typeof j=="number"?j.toFixed(B):"".concat(j),le=j!==M||ee!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},I)):this.setState({value:j,inputValue:this.toPrecisionAsStep(D)},I),le&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,j=B.precision,z=B.step;if(y(j))return j;var M=this.getPrecision(I),N=this.getPrecision(z),Y=this.getPrecision(D);return D?Math.max(Y,M+N):M+N}},{key:"getPrecisionFactor",value:function(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(D,I);return Math.pow(10,B)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(D){return this.props.formatter?this.props.formatter(D):D}},{key:"toPrecisionAsStep",value:function(D){if(this.isNotCompleteNumber(D)||D==="")return D;var I=Math.abs(this.getMaxPrecision(D));return isNaN(I)?D.toString():Number(D).toFixed(I)}},{key:"toNumber",value:function(D){var I=this.props.precision,B=this.state.focused,j=D&&D.length>16&&B;return this.isNotCompleteNumber(D)||j?D:y(I)?Math.round(D*Math.pow(10,I))/Math.pow(10,I):Number(D)}},{key:"upStep",value:function(D,I){var B=this.props.step,j=this.getPrecisionFactor(D,I),z=Math.abs(this.getMaxPrecision(D,I)),M=((j*D+j*B*I)/j).toFixed(z);return this.toNumber(M)}},{key:"downStep",value:function(D,I){var B=this.props.step,j=this.getPrecisionFactor(D,I),z=Math.abs(this.getMaxPrecision(D,I)),M=((j*D-j*B*I)/j).toFixed(z);return this.toNumber(M)}},{key:"step",value:function(D,I){var B=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,z=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var M=this.props;if(M.disabled)return;var N=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(N))return;var Y=this["".concat(D,"Step")](N,j),ee=Y>M.max||YM.max?Y=M.max:Y=fe),Xe=(dt||dt===0)&&(isNaN(dt)||Number(dt)<=Oe),Ce=je||j||z,be=Xe||j||z,Ee=d()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(J.a)({},"".concat(B,"-handler-up-disabled"),Ce)),ne=d()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(J.a)({},"".concat(B,"-handler-down-disabled"),be)),oe=M?{onTouchStart:Ce?a:this.up,onTouchEnd:this.stop}:{onMouseDown:Ce?a:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ce=M?{onTouchStart:be?a:this.down,onTouchEnd:this.stop}:{onMouseDown:be?a:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:ot,style:Se,title:ke,onMouseEnter:Le,onMouseLeave:Ae,onMouseOver:ge,onMouseOut:de,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(B,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":Ce,className:Ee}),Y||O.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:i})),O.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Decrease Value","aria-disabled":be,className:ne}),ee||O.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:i}))),O.a.createElement("div",{className:"".concat(B,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Oe,"aria-valuemax":fe,"aria-valuenow":dt,required:re,type:De,placeholder:ie,onPaste:et,onClick:he,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:se,autoComplete:N,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Qe?this.onKeyDown:a,onKeyUp:Qe?this.onKeyUp:a,autoFocus:Ue,maxLength:Fe,readOnly:z,disabled:j,max:fe,min:Oe,step:Me,name:Be,title:ke,id:ae,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:we,inputMode:me,onInput:Je},Ie))))}}]),A}(O.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:a,onKeyDown:a,onPressEnter:a,onFocus:a,onBlur:a,parser:s,required:!1,autoComplete:"off"};var x=w,b=Te.a=x},fjLI:function(pt,Te,q){"use strict";q.d(Te,"e",function(){return L}),q.d(Te,"a",function(){return d}),q.d(Te,"c",function(){return f}),q.d(Te,"d",function(){return p}),q.d(Te,"b",function(){return m});var ue=q("8HAY"),J=q("Cg/j"),_=q("T8No"),X=q("nnTU"),F=q("MI8n"),P=function(){var g=function(a,i){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var C in l)l.hasOwnProperty(C)&&(s[C]=l[C])},g(a,i)};return function(a,i){g(a,i);function s(){this.constructor=a}a.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)}}(),W=function(g,a,i,s){var l=arguments.length,C=l<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,i):s,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(g,a,i,s);else for(var y=g.length-1;y>=0;y--)(v=g[y])&&(C=(l<3?v(C):l>3?v(a,i,C):v(a,i))||C);return l>3&&C&&Object.defineProperty(a,i,C),C},U=function(g,a){return function(i,s){a(i,s,g)}},O=function(){for(var g=0,a=0,i=arguments.length;a=0&&(l.splice(C,1),s._onDidChangeMenu.fire(a))}}},g.prototype.getMenuItems=function(a){var i=(this._menuItems.get(a)||[]).slice(0);return a===0&&this._appendImplicitItems(i),i},g.prototype._appendImplicitItems=function(a){for(var i=new Set,s=a.filter(function(w){return L(w)}),l=0,C=s;lB.length)&&(j=B.length);for(var z=0,M=new Array(j);z=0)continue;if(!Object.prototype.propertyIsEnumerable.call(B,M))continue;z[M]=B[M]}}return z}function m(B,j){if(B==null)return{};var z={},M=Object.keys(B),N,Y;for(Y=0;Y=0)continue;z[N]=B[N]}return z}var g=function(j){var z=j.className,M=j.percent,N=j.prefixCls,Y=j.strokeColor,ee=j.strokeLinecap,le=j.strokeWidth,fe=j.style,Oe=j.trailColor,Se=j.trailWidth,ke=j.transition,Le=p(j,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Le.gapPosition;var Ae=Array.isArray(M)?M:[M],ge=Array.isArray(Y)?Y:[Y],de=P(Ae),re=U(de,1),he=re[0],se=le/2,De=100-le/2,ie="M ".concat(ee==="round"?se:0,",").concat(se,` - L `).concat(ee==="round"?De:100,",").concat(se),ae="0 0 100 ".concat(le),me=0;return J.a.createElement("svg",W({className:X()("".concat(N,"-line"),z),viewBox:ae,preserveAspectRatio:"none",style:fe},Le),J.a.createElement("path",{className:"".concat(N,"-line-trail"),d:ie,strokeLinecap:ee,stroke:Oe,strokeWidth:Se||le,fillOpacity:"0"}),Ae.map(function(we,Me){var Fe={strokeDasharray:"".concat(we,"px, 100px"),strokeDashoffset:"-".concat(me,"px"),transition:ke||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ue=ge[Me]||ge[ge.length-1];return me+=we,J.a.createElement("path",{key:Me,className:"".concat(N,"-line-path"),d:ie,strokeLinecap:ee,stroke:Ue,strokeWidth:le,fillOpacity:"0",ref:he[Me],style:Fe})}))};g.defaultProps=F;var a=g;function i(){return i=Object.assign||function(B){for(var j=1;jB.length)&&(j=B.length);for(var z=0,M=new Array(j);z=0)continue;if(!Object.prototype.propertyIsEnumerable.call(B,M))continue;z[M]=B[M]}}return z}function x(B,j){if(B==null)return{};var z={},M=Object.keys(B),N,Y;for(Y=0;Y=0)continue;z[N]=B[N]}return z}var b=0;function h(B){return+B.replace("%","")}function u(B){return Array.isArray(B)?B:[B]}function A(B,j,z,M){var N=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,Y=arguments.length>5?arguments[5]:void 0,ee=50-M/2,le=0,fe=-ee,Oe=0,Se=-2*ee;switch(Y){case"left":le=-ee,fe=0,Oe=2*ee,Se=0;break;case"right":le=ee,fe=0,Oe=-2*ee,Se=0;break;case"bottom":fe=ee,Se=2*ee;break;default:}var ke="M 50,50 m ".concat(le,",").concat(fe,` +`,D=["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"],I={},B;function j(Se){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if(ke&&I[Le])return I[Le];var Ae=window.getComputedStyle(Se),ge=Ae.getPropertyValue("box-sizing")||Ae.getPropertyValue("-moz-box-sizing")||Ae.getPropertyValue("-webkit-box-sizing"),he=parseFloat(Ae.getPropertyValue("padding-bottom"))+parseFloat(Ae.getPropertyValue("padding-top")),re=parseFloat(Ae.getPropertyValue("border-bottom-width"))+parseFloat(Ae.getPropertyValue("border-top-width")),de=D.map(function(De){return"".concat(De,":").concat(Ae.getPropertyValue(De))}).join(";"),se={sizingStyle:de,paddingSize:he,borderSize:re,boxSizing:ge};return ke&&Le&&(I[Le]=se),se}function z(Se){var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),Se.getAttribute("wrap")?B.setAttribute("wrap",Se.getAttribute("wrap")):B.removeAttribute("wrap");var ge=j(Se,ke),he=ge.paddingSize,re=ge.borderSize,de=ge.boxSizing,se=ge.sizingStyle;B.setAttribute("style","".concat(se,";").concat(S)),B.value=Se.value||Se.placeholder||"";var De=Number.MIN_SAFE_INTEGER,ie=Number.MAX_SAFE_INTEGER,ae=B.scrollHeight,me;if(de==="border-box"?ae+=re:de==="content-box"&&(ae-=he),Le!==null||Ae!==null){B.value=" ";var we=B.scrollHeight-he;Le!==null&&(De=we*Le,de==="border-box"&&(De=De+he+re),ae=Math.max(De,ae)),Ae!==null&&(ie=we*Ae,de==="border-box"&&(ie=ie+he+re),me=ae>ie?"":"hidden",ae=Math.min(ie,ae))}return{height:ae,minHeight:De,maxHeight:ie,overflowY:me,resize:"none"}}var M=q("Gytx"),N=q.n(M),Y;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})(Y||(Y={}));var ee=function(Se){Object(X.a)(Le,Se);var ke=Object(F.a)(Le);function Le(Ae){var ge;return Object(J.a)(this,Le),ge=ke.call(this,Ae),ge.nextFrameActionId=void 0,ge.resizeFrameId=void 0,ge.textArea=void 0,ge.saveTextArea=function(he){ge.textArea=he},ge.handleResize=function(he){var re=ge.state.resizeStatus,de=ge.props,se=de.autoSize,De=de.onResize;if(re!==Y.NONE)return;typeof De=="function"&&De(he),se&&ge.resizeOnNextFrame()},ge.resizeOnNextFrame=function(){cancelAnimationFrame(ge.nextFrameActionId),ge.nextFrameActionId=requestAnimationFrame(ge.resizeTextarea)},ge.resizeTextarea=function(){var he=ge.props.autoSize;if(!he||!ge.textArea)return;var re=he.minRows,de=he.maxRows,se=z(ge.textArea,!1,re,de);ge.setState({textareaStyles:se,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(ge.resizeFrameId),ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:Y.RESIZED},function(){ge.resizeFrameId=requestAnimationFrame(function(){ge.setState({resizeStatus:Y.NONE}),ge.fixFirefoxAutoScroll()})})})})},ge.renderTextArea=function(){var he=ge.props,re=he.prefixCls,de=re===void 0?"rc-textarea":re,se=he.autoSize,De=he.onResize,ie=he.className,ae=he.disabled,me=ge.state,we=me.textareaStyles,Me=me.resizeStatus,Fe=Object(d.a)(ge.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ue=A()(de,ie,Object(U.a)({},"".concat(de,"-disabled"),ae));"value"in Fe&&(Fe.value=Fe.value||"");var Be=Object(W.a)(Object(W.a)(Object(W.a)({},ge.props.style),we),Me===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return P.createElement(b,{onResize:ge.handleResize,disabled:!(se||De)},P.createElement("textarea",Object(ue.a)({},Fe,{className:Ue,style:Be,ref:ge.saveTextArea})))},ge.state={textareaStyles:{},resizeStatus:Y.NONE},ge}return Object(_.a)(Le,[{key:"componentDidUpdate",value:function(ge){(ge.value!==this.props.value||!N()(ge.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 ge=this.textArea.selectionStart,he=this.textArea.selectionEnd;this.textArea.setSelectionRange(ge,he)}}catch(re){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Le}(P.Component),le=ee,fe=function(Se){Object(X.a)(Le,Se);var ke=Object(F.a)(Le);function Le(Ae){var ge;Object(J.a)(this,Le),ge=ke.call(this,Ae),ge.resizableTextArea=void 0,ge.focus=function(){ge.resizableTextArea.textArea.focus()},ge.saveTextArea=function(re){ge.resizableTextArea=re},ge.handleChange=function(re){var de=ge.props.onChange;ge.setValue(re.target.value,function(){ge.resizableTextArea.resizeTextarea()}),de&&de(re)},ge.handleKeyDown=function(re){var de=ge.props,se=de.onPressEnter,De=de.onKeyDown;re.keyCode===13&&se&&se(re),De&&De(re)};var he=typeof Ae.value=="undefined"||Ae.value===null?Ae.defaultValue:Ae.value;return ge.state={value:he},ge}return Object(_.a)(Le,[{key:"setValue",value:function(ge,he){"value"in this.props||this.setState({value:ge},he)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return P.createElement(le,Object(ue.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ge){return"value"in ge?{value:ge.value}:null}}]),Le}(P.Component),Oe=Te.default=fe},YljZ:function(pt,Te,q){pt.exports={bg:"bg___1g3ya",flexRow:"flexRow___4tT9z",flexJustifyCenter:"flexJustifyCenter___aoTqw",flexAlignEnd:"flexAlignEnd___JLvk5",flexAlignCenter:"flexAlignCenter___2PiI-",flexColumn:"flexColumn___1y_Ck",formWrap:"formWrap___1U6CK",titleWrap:"titleWrap___1FTIl",fieldWrap:"fieldWrap___dBmKO",mdWrap:"mdWrap___3ebJh",backgroundFa:"backgroundFa___1JRN3",button:"button___117XW"}},ZW9T:function(pt,Te,q){"use strict";q.d(Te,"a",function(){return b});var ue=q("k1fw"),J=q("oBTY"),_=q("9og8"),X=q("miYZ"),F=q("tsqr"),P=q("rAM+"),W=q("tJVT"),U=q("PpiC"),O=q("WmNS"),L=q.n(O),h=q("q1tI"),f=q.n(h),T=q("bdgK");function p(d,u,A,S,D){var I=u.getWordUntilPosition(A),B={startLineNumber:A.lineNumber,endLineNumber:A.lineNumber,startColumn:I.startColumn,endColumn:I.endColumn},j=S.map(function(z){return{label:z,kind:d.languages.CompletionItemKind.Keyword,insertText:z,insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:B}});return D.map(function(z){j.push(Object(ue.a)(Object(ue.a)({},z),{},{range:B}))}),j}var m=function(d){var u={label:"ifelse",kind:d.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` +`),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet},A=["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"];d.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(B,j){var z=p(d,B,j,A,[u]);return{suggestions:z}}});var S=["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"];d.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(B,j){var z=[{label:"print",kind:d.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(` +`),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet}],M=p(d,B,j,S,z);return{suggestions:M}}});var D=["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"];d.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(B,j){var z=[u,{label:"main",kind:d.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(` +`),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:d.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(` +`),insertTextRules:d.languages.CompletionItemInsertTextRule.InsertAsSnippet}],M=p(d,B,j,D,z);return{suggestions:M}}})},g="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",a=q("fjLI"),i=q("LvDl"),s=q("+ua5");function l(d){return/^\d+$/.test(d)?"".concat(d,"px"):d}function C(){}var v=!1,y={"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 R(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=d;if(Array.isArray(d)){for(var A=0;A0||nr.target.offsetWidth>0)&&Qe.current.instance.layout()}}catch(rr){xt.e(rr)}finally{xt.f()}}),Ct.observe(Ie.current)),Ct}function Ne(){F.b.warn({content:decodeURIComponent(g),key:"monaco-editor-tip"})}var Re=function(){var at=Qe.current.instance;if(I!=null&&at&&oe){var xt=at.getModel();xt&&I!==xt.getValue()&&(v=!0,xt.setValue(I),at.layout(),v=!1)}};Object(h.useEffect)(function(){try{var Ct,at=Qe.current.instance;je.current&&clearTimeout(je.current),je.current=setTimeout(function(){Re()},500),at==null||((Ct=at.updateOptions)===null||Ct===void 0)||Ct.call(at,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(I.split(/\r\n|\r|\n/g).length))+3,5)})}catch(xt){debugger}},[I,oe,Qe.current]),Object(h.useEffect)(function(){try{if(et&&Qe.current&&Qe.current.instance){var Ct=Qe.current.instance;Ct.changeViewZones(function(xt){var Zt=document.createElement("div");Zt.style.padding="10px 20px",Zt.style.width="calc(100% - 20px)",Zt.className="my-error-line-wrp",Zt.innerHTML=Ze,xt.addZone({afterLineNumber:et||11,heightInLines:3,domNode:Zt})});var at={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}};Ct.addOverlayWidget(at),Ct.revealPositionInCenter({lineNumber:20,column:1})}}catch(xt){debugger}},[et,Qe.current,oe]),Object(h.useEffect)(function(){var Ct;if((Ct=Qe.current)!==null&&Ct!==void 0&&Ct.instance&&oe&&qe){var at=Qe.current.instance,xt=at.getModel();if(!xt)return;var Zt=function(){var lt=[],Pt=[],Kt=xt.getAllDecorations(),Yt=Object(P.a)(Kt),qt;try{for(Yt.s();!(qt=Yt.n()).done;){var K=qt.value;if(K.options.className==="highlighted-line"){var c;lt.push(K==null||((c=K.range)===null||c===void 0)?void 0:c.startLineNumber),Pt.push(K==null?void 0:K.id)}}}catch(G){Yt.e(G)}finally{Yt.f()}xt.deltaDecorations(Pt,[]);var E=xt.getLineCount();!!Ye&&Ye<=E&&(at.deltaDecorations([],[{range:new w.Range(Ye,1,Ye,xt.getLineMaxColumn(Ye)),options:{isWholeLine:!0,className:"highlighted-line"}}]),at.revealLineInCenter(Ye))};Zt();var nr=function(){var lt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Pt=[],Kt=[],Yt=xt.getAllDecorations(),qt=Object(P.a)(Yt),K;try{for(qt.s();!(K=qt.n()).done;){var c=K.value;if(c.options.linesDecorationsClassName==="breakpoints"){var E;Pt.push(c==null||((E=c.range)===null||E===void 0)?void 0:E.startLineNumber),Kt.push(c==null?void 0:c.id)}}}catch(G){qt.e(G)}finally{qt.f()}if(lt)return{lines:Pt,ids:Kt};we(Pt)},rr=function(){var He=Object(_.a)(L.a.mark(function lt(Pt){var Kt;return L.a.wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return Kt={range:new w.Range(Pt,1,Pt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},qt.next=3,xt.deltaDecorations([],[Kt]);case 3:nr();case 4:case"end":return qt.stop()}},lt)}));return function(Pt){return He.apply(this,arguments)}}(),Rt=function(){var He=Object(_.a)(L.a.mark(function lt(Pt){var Kt,Yt,qt,K,c;return L.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:Kt=[],Yt=at.getLineDecorations(Pt),qt=Object(P.a)(Yt);try{for(qt.s();!(K=qt.n()).done;)c=K.value,c.options.linesDecorationsClassName==="breakpoints"&&Kt.push(c.id)}catch($){qt.e($)}finally{qt.f()}return G.next=6,xt.deltaDecorations(Kt,[]);case 6:nr();case 7:case"end":return G.stop()}},lt)}));return function(Pt){return He.apply(this,arguments)}}(),vt=function(lt){var Pt=at.getLineDecorations(lt),Kt=Object(P.a)(Pt),Yt;try{for(Kt.s();!(Yt=Kt.n()).done;){var qt=Yt.value;if(qt.options.linesDecorationsClassName==="breakpoints")return!0}}catch(K){Kt.e(K)}finally{Kt.f()}return!1};if(!Object(i.isEqual)(Fe,nr(!0).lines)){xt.deltaDecorations(nr(!0).ids,[]);var kr=Fe.map(function(He){return{range:new w.Range(He,1,He,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});xt.deltaDecorations([],kr)}var tn=at.onDidChangeModelContent(function(He){var lt=at.getPosition();if(lt){var Pt=lt.lineNumber;xt.getLineContent(Pt).trim()===""?Rt(Pt):vt(Pt)&&(Rt(Pt),rr(Pt))}}),Tr=at.onMouseDown(function(He){var lt,Pt,Kt;if(He.target.detail&&(lt=He.target)!==null&<!==void 0&&(Pt=lt.element)!==null&&Pt!==void 0&&(Kt=Pt.className)!==null&&Kt!==void 0&&Kt.includes("line-numbers")){var Yt=He.target.position.lineNumber;if(xt.getLineContent(Yt).trim()==="")return;vt(Yt)?Rt(Yt):rr(Yt)}}),_t=function(lt){var Pt={range:new w.Range(lt,1,lt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Xe.current=at.deltaDecorations(Xe.current,[Pt])},Lr=function(){Xe.current=at.deltaDecorations(Xe.current,[])},zr=at.onMouseMove(function(He){var lt,Pt,Kt;if(Lr(),He.target.detail&&(lt=He.target)!==null&<!==void 0&&(Pt=lt.element)!==null&&Pt!==void 0&&(Kt=Pt.className)!==null&&Kt!==void 0&&Kt.includes("line-numbers")){var Yt=He.target.position.lineNumber;if(xt.getLineContent(Yt).trim()==="")return;_t(Yt)}}),rn=at.onMouseLeave(function(){Lr()});return function(){tn.dispose(),Tr.dispose(),zr.dispose(),rn.dispose()}}},[Qe.current,oe,Fe,Ye,qe]);function ze(){var Ct=Qe.current.instance;if(Ct){var at=Ct.getSelection(),xt=Qe.current.pastePos||{},Zt=new w.Range(xt.startLineNumber||at.endLineNumber,xt.startColumn||at.endColumn,xt.endLineNumber||at.endLineNumber,xt.endColumn||at.endColumn);setTimeout(function(){Ct.executeEdits("",[{range:Zt,text:""}])},300)}}function it(Ct){(window.navigator.platform.match("Mac")?Ct.metaKey:Ct.ctrlKey)&&Ct.keyCode==83&&(Ct.preventDefault(),ke())}var ct=function(){if(Ae&&Qe.current.instance){var at=Qe.current.instance.getContentHeight();Zr(at0||se.target.offsetWidth>0)&&Ae.layout()}}catch(De){re.e(De)}finally{re.f()}}),ge.observe(N.current)),ge}Object(h.useEffect)(function(){return N.current&&q.e(27).then(q.t.bind(null,"M/lh",7)).then(function(Ae){w=Ae;var ge=w.editor.createDiffEditor(N.current,Object(ue.a)(Object(ue.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},M),{},{wordWrap:!0}));fe(ge);var he=Oe(ge);return function(){ge.dispose();var re=ge.getModel();re&&re.dispose(),he.unobserve(N.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(h.useEffect)(function(){le&&le.setModel({original:w.editor.createModel(I,j),modified:w.editor.createModel(B,j)})},[I,B,j,le]);var Se=l(A),ke=l(D),Le={width:Se,height:ke};return f.a.createElement("div",{className:"my-diff-editor",ref:N,style:Le})}},ZpRC:function(pt,Te,q){"use strict";function ue(h){return typeof h=="object"&&h!=null&&h.nodeType===1}function J(h,f){return(!f||h!=="hidden")&&h!=="visible"&&h!=="clip"}function _(h,f){if(h.clientHeightf||g>h&&a=f&&i>=T?g-h-p:a>f&&iT?a-f+m:0}var F=function(h,f){var T=window,p=f.scrollMode,m=f.block,g=f.inline,a=f.boundary,i=f.skipOverflowHiddenElements,s=typeof a=="function"?a:function(we){return we!==a};if(!ue(h))throw new TypeError("Invalid target");for(var l=document.scrollingElement||document.documentElement,C=[],v=h;ue(v)&&s(v);){if((v=v.parentElement)===l){C.push(v);break}v!=null&&v===document.body&&_(v)&&!_(document.documentElement)||v!=null&&_(v,i)&&C.push(v)}for(var y=T.visualViewport?T.visualViewport.width:innerWidth,R=T.visualViewport?T.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,x=window.scrollY||pageYOffset,b=h.getBoundingClientRect(),d=b.height,u=b.width,A=b.top,S=b.right,D=b.bottom,I=b.left,B=m==="start"||m==="nearest"?A:m==="end"?D:A+d/2,j=g==="center"?I+u/2:g==="end"?S:I,z=[],M=0;M=0&&I>=0&&D<=R&&S<=y&&A>=fe&&D<=Se&&I>=ke&&S<=Oe)return z;var Le=getComputedStyle(N),Ae=parseInt(Le.borderLeftWidth,10),ge=parseInt(Le.borderTopWidth,10),he=parseInt(Le.borderRightWidth,10),re=parseInt(Le.borderBottomWidth,10),de=0,se=0,De="offsetWidth"in N?N.offsetWidth-N.clientWidth-Ae-he:0,ie="offsetHeight"in N?N.offsetHeight-N.clientHeight-ge-re:0;if(l===N)de=m==="start"?B:m==="end"?B-R:m==="nearest"?X(x,x+R,R,ge,re,x+B,x+B+d,d):B-R/2,se=g==="start"?j:g==="center"?j-y/2:g==="end"?j-y:X(w,w+y,y,Ae,he,w+j,w+j+u,u),de=Math.max(0,de+x),se=Math.max(0,se+w);else{de=m==="start"?B-fe-ge:m==="end"?B-Se+re+ie:m==="nearest"?X(fe,Se,ee,ge,re+ie,B,B+d,d):B-(fe+ee/2)+ie/2,se=g==="start"?j-ke-Ae:g==="center"?j-(ke+le/2)+De/2:g==="end"?j-Oe+he+De:X(ke,Oe,le,Ae,he+De,j,j+u,u);var ae=N.scrollLeft,me=N.scrollTop;B+=me-(de=Math.max(0,Math.min(me+de,N.scrollHeight-ee+ie))),j+=ae-(se=Math.max(0,Math.min(ae+se,N.scrollWidth-le+De)))}z.push({el:N,top:de,left:se})}return z};function P(h){return h===Object(h)&&Object.keys(h).length!==0}function W(h,f){f===void 0&&(f="auto");var T="scrollBehavior"in document.body.style;h.forEach(function(p){var m=p.el,g=p.top,a=p.left;m.scroll&&T?m.scroll({top:g,left:a,behavior:f}):(m.scrollTop=g,m.scrollLeft=a)})}function U(h){return h===!1?{block:"end",inline:"nearest"}:P(h)?h:{block:"start",inline:"nearest"}}function O(h,f){var T=!h.ownerDocument.documentElement.contains(h);if(P(f)&&typeof f.behavior=="function")return f.behavior(T?[]:F(h,f));if(T)return;var p=U(f);return W(F(h,p),p.behavior)}var L=Te.a=O},Zss7:function(pt,Te,q){var ue;(function(J){var _=/^\s+/,X=/\s+$/,F=0,P=J.round,W=J.min,U=J.max,O=J.random;function L(re,de){if(re=re||"",de=de||{},re instanceof L)return re;if(!(this instanceof L))return new L(re,de);var se=h(re);this._originalInput=re,this._r=se.r,this._g=se.g,this._b=se.b,this._a=se.a,this._roundA=P(100*this._a)/100,this._format=de.format||se.format,this._gradientType=de.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=se.ok,this._tc_id=F++}L.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var re=this.toRgb();return(re.r*299+re.g*587+re.b*114)/1e3},getLuminance:function(){var re=this.toRgb(),de,se,De,ie,ae,me;return de=re.r/255,se=re.g/255,De=re.b/255,de<=.03928?ie=de/12.92:ie=J.pow((de+.055)/1.055,2.4),se<=.03928?ae=se/12.92:ae=J.pow((se+.055)/1.055,2.4),De<=.03928?me=De/12.92:me=J.pow((De+.055)/1.055,2.4),.2126*ie+.7152*ae+.0722*me},setAlpha:function(re){return this._a=z(re),this._roundA=P(100*this._a)/100,this},toHsv:function(){var re=m(this._r,this._g,this._b);return{h:re.h*360,s:re.s,v:re.v,a:this._a}},toHsvString:function(){var re=m(this._r,this._g,this._b),de=P(re.h*360),se=P(re.s*100),De=P(re.v*100);return this._a==1?"hsv("+de+", "+se+"%, "+De+"%)":"hsva("+de+", "+se+"%, "+De+"%, "+this._roundA+")"},toHsl:function(){var re=T(this._r,this._g,this._b);return{h:re.h*360,s:re.s,l:re.l,a:this._a}},toHslString:function(){var re=T(this._r,this._g,this._b),de=P(re.h*360),se=P(re.s*100),De=P(re.l*100);return this._a==1?"hsl("+de+", "+se+"%, "+De+"%)":"hsla("+de+", "+se+"%, "+De+"%, "+this._roundA+")"},toHex:function(re){return a(this._r,this._g,this._b,re)},toHexString:function(re){return"#"+this.toHex(re)},toHex8:function(re){return i(this._r,this._g,this._b,this._a,re)},toHex8String:function(re){return"#"+this.toHex8(re)},toRgb:function(){return{r:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(M(this._r,255)*100)+"%",g:P(M(this._g,255)*100)+"%",b:P(M(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+P(M(this._r,255)*100)+"%, "+P(M(this._g,255)*100)+"%, "+P(M(this._b,255)*100)+"%)":"rgba("+P(M(this._r,255)*100)+"%, "+P(M(this._g,255)*100)+"%, "+P(M(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:B[a(this._r,this._g,this._b,!0)]||!1},toFilter:function(re){var de="#"+s(this._r,this._g,this._b,this._a),se=de,De=this._gradientType?"GradientType = 1, ":"";if(re){var ie=L(re);se="#"+s(ie._r,ie._g,ie._b,ie._a)}return"progid:DXImageTransform.Microsoft.gradient("+De+"startColorstr="+de+",endColorstr="+se+")"},toString:function(re){var de=!!re;re=re||this._format;var se=!1,De=this._a<1&&this._a>=0,ie=!de&&De&&(re==="hex"||re==="hex6"||re==="hex3"||re==="hex4"||re==="hex8"||re==="name");return ie?re==="name"&&this._a===0?this.toName():this.toRgbString():(re==="rgb"&&(se=this.toRgbString()),re==="prgb"&&(se=this.toPercentageRgbString()),(re==="hex"||re==="hex6")&&(se=this.toHexString()),re==="hex3"&&(se=this.toHexString(!0)),re==="hex4"&&(se=this.toHex8String(!0)),re==="hex8"&&(se=this.toHex8String()),re==="name"&&(se=this.toName()),re==="hsl"&&(se=this.toHslString()),re==="hsv"&&(se=this.toHsvString()),se||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(re,de){var se=re.apply(null,[this].concat([].slice.call(de)));return this._r=se._r,this._g=se._g,this._b=se._b,this.setAlpha(se._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(R,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(l,arguments)},saturate:function(){return this._applyModification(C,arguments)},greyscale:function(){return this._applyModification(v,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(re,de){return re.apply(null,[this].concat([].slice.call(de)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(D,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(d,arguments)},tetrad:function(){return this._applyCombination(u,arguments)}},L.fromRatio=function(re,de){if(typeof re=="object"){var se={};for(var De in re)re.hasOwnProperty(De)&&(De==="a"?se[De]=re[De]:se[De]=Oe(re[De]));re=se}return L(re,de)};function h(re){var de={r:0,g:0,b:0},se=1,De=null,ie=null,ae=null,me=!1,we=!1;return typeof re=="string"&&(re=ge(re)),typeof re=="object"&&(Ae(re.r)&&Ae(re.g)&&Ae(re.b)?(de=f(re.r,re.g,re.b),me=!0,we=String(re.r).substr(-1)==="%"?"prgb":"rgb"):Ae(re.h)&&Ae(re.s)&&Ae(re.v)?(De=Oe(re.s),ie=Oe(re.v),de=g(re.h,De,ie),me=!0,we="hsv"):Ae(re.h)&&Ae(re.s)&&Ae(re.l)&&(De=Oe(re.s),ae=Oe(re.l),de=p(re.h,De,ae),me=!0,we="hsl"),re.hasOwnProperty("a")&&(se=re.a)),se=z(se),{ok:me,format:re.format||we,r:W(255,U(de.r,0)),g:W(255,U(de.g,0)),b:W(255,U(de.b,0)),a:se}}function f(re,de,se){return{r:M(re,255)*255,g:M(de,255)*255,b:M(se,255)*255}}function T(re,de,se){re=M(re,255),de=M(de,255),se=M(se,255);var De=U(re,de,se),ie=W(re,de,se),ae,me,we=(De+ie)/2;if(De==ie)ae=me=0;else{var Me=De-ie;me=we>.5?Me/(2-De-ie):Me/(De+ie);switch(De){case re:ae=(de-se)/Me+(de1&&(Be-=1),Be<1/6?Fe+(Ue-Fe)*6*Be:Be<1/2?Ue:Be<2/3?Fe+(Ue-Fe)*(2/3-Be)*6:Fe}if(de===0)De=ie=ae=se;else{var we=se<.5?se*(1+de):se+de-se*de,Me=2*se-we;De=me(Me,we,re+1/3),ie=me(Me,we,re),ae=me(Me,we,re-1/3)}return{r:De*255,g:ie*255,b:ae*255}}function m(re,de,se){re=M(re,255),de=M(de,255),se=M(se,255);var De=U(re,de,se),ie=W(re,de,se),ae,me,we=De,Me=De-ie;if(me=De===0?0:Me/De,De==ie)ae=0;else{switch(De){case re:ae=(de-se)/Me+(de>1)+720)%360;--de;)De.h=(De.h+ie)%360,ae.push(L(De));return ae}function D(re,de){de=de||6;for(var se=L(re).toHsv(),De=se.h,ie=se.s,ae=se.v,me=[],we=1/de;de--;)me.push(L({h:De,s:ie,v:ae})),ae=(ae+we)%1;return me}L.mix=function(re,de,se){se=se===0?0:se||50;var De=L(re).toRgb(),ie=L(de).toRgb(),ae=se/100,me={r:(ie.r-De.r)*ae+De.r,g:(ie.g-De.g)*ae+De.g,b:(ie.b-De.b)*ae+De.b,a:(ie.a-De.a)*ae+De.a};return L(me)},L.readability=function(re,de){var se=L(re),De=L(de);return(J.max(se.getLuminance(),De.getLuminance())+.05)/(J.min(se.getLuminance(),De.getLuminance())+.05)},L.isReadable=function(re,de,se){var De=L.readability(re,de),ie,ae;ae=!1,ie=he(se);switch(ie.level+ie.size){case"AAsmall":case"AAAlarge":ae=De>=4.5;break;case"AAlarge":ae=De>=3;break;case"AAAsmall":ae=De>=7;break}return ae},L.mostReadable=function(re,de,se){var De=null,ie=0,ae,me,we,Me;se=se||{},me=se.includeFallbackColors,we=se.level,Me=se.size;for(var Fe=0;Feie&&(ie=ae,De=L(de[Fe]));return L.isReadable(re,De,{level:we,size:Me})||!me?De:(se.includeFallbackColors=!1,L.mostReadable(re,["#fff","#000"],se))};var I=L.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},B=L.hexNames=j(I);function j(re){var de={};for(var se in re)re.hasOwnProperty(se)&&(de[re[se]]=se);return de}function z(re){return re=parseFloat(re),(isNaN(re)||re<0||re>1)&&(re=1),re}function M(re,de){ee(re)&&(re="100%");var se=le(re);return re=W(de,U(0,parseFloat(re))),se&&(re=parseInt(re*de,10)/100),J.abs(re-de)<1e-6?1:re%de/parseFloat(de)}function N(re){return W(1,U(0,re))}function Y(re){return parseInt(re,16)}function ee(re){return typeof re=="string"&&re.indexOf(".")!=-1&&parseFloat(re)===1}function le(re){return typeof re=="string"&&re.indexOf("%")!=-1}function fe(re){return re.length==1?"0"+re:""+re}function Oe(re){return re<=1&&(re=re*100+"%"),re}function Se(re){return J.round(parseFloat(re)*255).toString(16)}function ke(re){return Y(re)/255}var Le=function(){var re="[-\\+]?\\d+%?",de="[-\\+]?\\d*\\.\\d+%?",se="(?:"+de+")|(?:"+re+")",De="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",ie="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?";return{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+De),rgba:new RegExp("rgba"+ie),hsl:new RegExp("hsl"+De),hsla:new RegExp("hsla"+ie),hsv:new RegExp("hsv"+De),hsva:new RegExp("hsva"+ie),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ae(re){return!!Le.CSS_UNIT.exec(re)}function ge(re){re=re.replace(_,"").replace(X,"").toLowerCase();var de=!1;if(I[re])re=I[re],de=!0;else if(re=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var se;return(se=Le.rgb.exec(re))?{r:se[1],g:se[2],b:se[3]}:(se=Le.rgba.exec(re))?{r:se[1],g:se[2],b:se[3],a:se[4]}:(se=Le.hsl.exec(re))?{h:se[1],s:se[2],l:se[3]}:(se=Le.hsla.exec(re))?{h:se[1],s:se[2],l:se[3],a:se[4]}:(se=Le.hsv.exec(re))?{h:se[1],s:se[2],v:se[3]}:(se=Le.hsva.exec(re))?{h:se[1],s:se[2],v:se[3],a:se[4]}:(se=Le.hex8.exec(re))?{r:Y(se[1]),g:Y(se[2]),b:Y(se[3]),a:ke(se[4]),format:de?"name":"hex8"}:(se=Le.hex6.exec(re))?{r:Y(se[1]),g:Y(se[2]),b:Y(se[3]),format:de?"name":"hex"}:(se=Le.hex4.exec(re))?{r:Y(se[1]+""+se[1]),g:Y(se[2]+""+se[2]),b:Y(se[3]+""+se[3]),a:ke(se[4]+""+se[4]),format:de?"name":"hex8"}:(se=Le.hex3.exec(re))?{r:Y(se[1]+""+se[1]),g:Y(se[2]+""+se[2]),b:Y(se[3]+""+se[3]),format:de?"name":"hex"}:!1}function he(re){var de,se;return re=re||{level:"AA",size:"small"},de=(re.level||"AA").toUpperCase(),se=(re.size||"small").toLowerCase(),de!=="AA"&&de!=="AAA"&&(de="AA"),se!=="small"&&se!=="large"&&(se="small"),{level:de,size:se}}pt.exports?pt.exports=L:!(ue=function(){return L}.call(Te,q,Te,pt),ue!==void 0&&(pt.exports=ue))})(Math)},bT9E:function(pt,Te,q){"use strict";q.d(Te,"a",function(){return J});var ue=q("VTBJ");function J(_,X){var F=Object(ue.a)({},_);return Array.isArray(X)&&X.forEach(function(P){delete F[P]}),F}},c5Ni:function(pt,Te,q){},dejd:function(pt,Te,q){},dmUQ:function(pt,Te,q){"use strict";var ue=q("Ff2n"),J=q("rePB"),_=q("1OyB"),X=q("vuIU"),F=q("Ji7U"),P=q("md7G"),W=q("foSv"),U=q("q1tI"),O=q.n(U),L=q("TSYQ"),h=q.n(L),f=q("4IlW");function T(d,u){var A=Object.keys(d);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(d);u&&(S=S.filter(function(D){return Object.getOwnPropertyDescriptor(d,D).enumerable})),A.push.apply(A,S)}return A}function p(d){for(var u=1;u1?le-1:0),Oe=1;Oe1?M-1:0),Y=1;Y=0)return parseInt(z.slice(z.indexOf("e-")+2),10);var M=0;return z.indexOf(".")>=0&&(M=z.length-z.indexOf(".")-1),M},D.getInputDisplayValue=function(j){var z=j||D.state,M=z.focused,N=z.inputValue,Y=z.value,ee;M?ee=N:ee=D.toPrecisionAsStep(Y),ee==null&&(ee="");var le=D.formatWrapper(ee);return y(D.props.decimalSeparator)&&(le=le.toString().replace(".",D.props.decimalSeparator)),le},D.recordCursorPosition=function(){try{D.cursorStart=D.input.selectionStart,D.cursorEnd=D.input.selectionEnd,D.currentValue=D.input.value,D.cursorBefore=D.input.value.substring(0,D.cursorStart),D.cursorAfter=D.input.value.substring(D.cursorEnd)}catch(j){}},D.restoreByAfter=function(j){if(j===void 0)return!1;var z=D.input.value,M=z.lastIndexOf(j);if(M===-1)return!1;var N=D.cursorBefore.length;return D.lastKeyCode===f.a.DELETE&&D.cursorBefore.charAt(N-1)===j[0]?(D.fixCaret(N,N),!0):M+j.length===z.length?(D.fixCaret(M,M),!0):!1},D.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(z,M){var N=j.substring(M);return D.restoreByAfter(N)})},D.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},D.stop=function(){D.autoStepTimer&&clearTimeout(D.autoStepTimer)},D.down=function(j,z,M){D.pressingUpOrDown=!0,D.step("down",j,z,M)},D.up=function(j,z,M){D.pressingUpOrDown=!0,D.step("up",j,z,M)},D.saveInput=function(j){D.input=j};var I=S.value;I===void 0&&(I=S.defaultValue),D.state={focused:S.autoFocus};var B=D.getValidValue(D.toNumber(I));return D.state=p(p({},D.state),{},{inputValue:D.toPrecisionAsStep(B),value:B}),D}return Object(X.a)(A,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(D){var I=this.props,B=I.value,j=I.onChange,z=I.max,M=I.min,N=this.state.focused;if(D){if(!R(D.value,B)||!R(D.max,z)||!R(D.min,M)){var Y=N?B:this.getValidValue(B),ee;this.pressingUpOrDown?ee=Y:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:ee})}var le="value"in this.props?B:this.state.value;"max"in this.props&&D.max!==z&&typeof le=="number"&&le>z&&j&&j(z),"min"in this.props&&D.min!==M&&typeof le=="number"&&le1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,j=parseFloat(D);return isNaN(j)?D:(jB&&(j=B),j)}},{key:"setValue",value:function(D,I){var B=this.props.precision,j=this.isNotCompleteNumber(parseFloat(D))?null:parseFloat(D),z=this.state.value,M=z===void 0?null:z,N=this.state.inputValue,Y=N===void 0?null:N,ee=typeof j=="number"?j.toFixed(B):"".concat(j),le=j!==M||ee!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},I)):this.setState({value:j,inputValue:this.toPrecisionAsStep(D)},I),le&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,j=B.precision,z=B.step;if(y(j))return j;var M=this.getPrecision(I),N=this.getPrecision(z),Y=this.getPrecision(D);return D?Math.max(Y,M+N):M+N}},{key:"getPrecisionFactor",value:function(D){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(D,I);return Math.pow(10,B)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(D){return this.props.formatter?this.props.formatter(D):D}},{key:"toPrecisionAsStep",value:function(D){if(this.isNotCompleteNumber(D)||D==="")return D;var I=Math.abs(this.getMaxPrecision(D));return isNaN(I)?D.toString():Number(D).toFixed(I)}},{key:"toNumber",value:function(D){var I=this.props.precision,B=this.state.focused,j=D&&D.length>16&&B;return this.isNotCompleteNumber(D)||j?D:y(I)?Math.round(D*Math.pow(10,I))/Math.pow(10,I):Number(D)}},{key:"upStep",value:function(D,I){var B=this.props.step,j=this.getPrecisionFactor(D,I),z=Math.abs(this.getMaxPrecision(D,I)),M=((j*D+j*B*I)/j).toFixed(z);return this.toNumber(M)}},{key:"downStep",value:function(D,I){var B=this.props.step,j=this.getPrecisionFactor(D,I),z=Math.abs(this.getMaxPrecision(D,I)),M=((j*D-j*B*I)/j).toFixed(z);return this.toNumber(M)}},{key:"step",value:function(D,I){var B=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,z=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var M=this.props;if(M.disabled)return;var N=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(N))return;var Y=this["".concat(D,"Step")](N,j),ee=Y>M.max||YM.max?Y=M.max:Y=fe),Xe=(ht||ht===0)&&(isNaN(ht)||Number(ht)<=Oe),Ce=je||j||z,be=Xe||j||z,Ee=h()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(J.a)({},"".concat(B,"-handler-up-disabled"),Ce)),ne=h()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(J.a)({},"".concat(B,"-handler-down-disabled"),be)),oe=M?{onTouchStart:Ce?a:this.up,onTouchEnd:this.stop}:{onMouseDown:Ce?a:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ce=M?{onTouchStart:be?a:this.down,onTouchEnd:this.stop}:{onMouseDown:be?a:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return O.a.createElement("div",{className:ot,style:Se,title:ke,onMouseEnter:Le,onMouseLeave:Ae,onMouseOver:ge,onMouseOut:he,onFocus:function(){return null},onBlur:function(){return null}},O.a.createElement("div",{className:"".concat(B,"-handler-wrap")},O.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":Ce,className:Ee}),Y||O.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:i})),O.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Decrease Value","aria-disabled":be,className:ne}),ee||O.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:i}))),O.a.createElement("div",{className:"".concat(B,"-input-wrap")},O.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Oe,"aria-valuemax":fe,"aria-valuenow":ht,required:re,type:De,placeholder:ie,onPaste:et,onClick:de,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:se,autoComplete:N,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Qe?this.onKeyDown:a,onKeyUp:Qe?this.onKeyUp:a,autoFocus:Ue,maxLength:Fe,readOnly:z,disabled:j,max:fe,min:Oe,step:Me,name:Be,title:ke,id:ae,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:we,inputMode:me,onInput:Je},Ie))))}}]),A}(O.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:v,min:-v,step:1,style:{},onChange:a,onKeyDown:a,onPressEnter:a,onFocus:a,onBlur:a,parser:s,required:!1,autoComplete:"off"};var x=w,b=Te.a=x},fjLI:function(pt,Te,q){"use strict";q.d(Te,"e",function(){return L}),q.d(Te,"a",function(){return h}),q.d(Te,"c",function(){return f}),q.d(Te,"d",function(){return p}),q.d(Te,"b",function(){return m});var ue=q("8HAY"),J=q("Cg/j"),_=q("T8No"),X=q("nnTU"),F=q("MI8n"),P=function(){var g=function(a,i){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var C in l)l.hasOwnProperty(C)&&(s[C]=l[C])},g(a,i)};return function(a,i){g(a,i);function s(){this.constructor=a}a.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)}}(),W=function(g,a,i,s){var l=arguments.length,C=l<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,i):s,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(g,a,i,s);else for(var y=g.length-1;y>=0;y--)(v=g[y])&&(C=(l<3?v(C):l>3?v(a,i,C):v(a,i))||C);return l>3&&C&&Object.defineProperty(a,i,C),C},U=function(g,a){return function(i,s){a(i,s,g)}},O=function(){for(var g=0,a=0,i=arguments.length;a=0&&(l.splice(C,1),s._onDidChangeMenu.fire(a))}}},g.prototype.getMenuItems=function(a){var i=(this._menuItems.get(a)||[]).slice(0);return a===0&&this._appendImplicitItems(i),i},g.prototype._appendImplicitItems=function(a){for(var i=new Set,s=a.filter(function(w){return L(w)}),l=0,C=s;lB.length)&&(j=B.length);for(var z=0,M=new Array(j);z=0)continue;if(!Object.prototype.propertyIsEnumerable.call(B,M))continue;z[M]=B[M]}}return z}function m(B,j){if(B==null)return{};var z={},M=Object.keys(B),N,Y;for(Y=0;Y=0)continue;z[N]=B[N]}return z}var g=function(j){var z=j.className,M=j.percent,N=j.prefixCls,Y=j.strokeColor,ee=j.strokeLinecap,le=j.strokeWidth,fe=j.style,Oe=j.trailColor,Se=j.trailWidth,ke=j.transition,Le=p(j,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Le.gapPosition;var Ae=Array.isArray(M)?M:[M],ge=Array.isArray(Y)?Y:[Y],he=P(Ae),re=U(he,1),de=re[0],se=le/2,De=100-le/2,ie="M ".concat(ee==="round"?se:0,",").concat(se,` + L `).concat(ee==="round"?De:100,",").concat(se),ae="0 0 100 ".concat(le),me=0;return J.a.createElement("svg",W({className:X()("".concat(N,"-line"),z),viewBox:ae,preserveAspectRatio:"none",style:fe},Le),J.a.createElement("path",{className:"".concat(N,"-line-trail"),d:ie,strokeLinecap:ee,stroke:Oe,strokeWidth:Se||le,fillOpacity:"0"}),Ae.map(function(we,Me){var Fe={strokeDasharray:"".concat(we,"px, 100px"),strokeDashoffset:"-".concat(me,"px"),transition:ke||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ue=ge[Me]||ge[ge.length-1];return me+=we,J.a.createElement("path",{key:Me,className:"".concat(N,"-line-path"),d:ie,strokeLinecap:ee,stroke:Ue,strokeWidth:le,fillOpacity:"0",ref:de[Me],style:Fe})}))};g.defaultProps=F;var a=g;function i(){return i=Object.assign||function(B){for(var j=1;jB.length)&&(j=B.length);for(var z=0,M=new Array(j);z=0)continue;if(!Object.prototype.propertyIsEnumerable.call(B,M))continue;z[M]=B[M]}}return z}function x(B,j){if(B==null)return{};var z={},M=Object.keys(B),N,Y;for(Y=0;Y=0)continue;z[N]=B[N]}return z}var b=0;function d(B){return+B.replace("%","")}function u(B){return Array.isArray(B)?B:[B]}function A(B,j,z,M){var N=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,Y=arguments.length>5?arguments[5]:void 0,ee=50-M/2,le=0,fe=-ee,Oe=0,Se=-2*ee;switch(Y){case"left":le=-ee,fe=0,Oe=2*ee,Se=0;break;case"right":le=ee,fe=0,Oe=-2*ee,Se=0;break;case"bottom":fe=ee,Se=2*ee;break;default:}var ke="M 50,50 m ".concat(le,",").concat(fe,` a `).concat(ee,",").concat(ee," 0 1 1 ").concat(Oe,",").concat(-Se,` - a `).concat(ee,",").concat(ee," 0 1 1 ").concat(-Oe,",").concat(Se),Le=Math.PI*2*ee,Ae={stroke:z,strokeDasharray:"".concat(j/100*(Le-N),"px ").concat(Le,"px"),strokeDashoffset:"-".concat(N/2+B/100*(Le-N),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ke,pathStyle:Ae}}var S=function(j){var z=j.prefixCls,M=j.strokeWidth,N=j.trailWidth,Y=j.gapDegree,ee=j.gapPosition,le=j.trailColor,fe=j.strokeLinecap,Oe=j.style,Se=j.className,ke=j.strokeColor,Le=j.percent,Ae=w(j,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ge=Object(ue.useMemo)(function(){return b+=1,b},[]),de=A(0,100,le,M,Y,ee),re=de.pathString,he=de.pathStyle,se=u(Le),De=u(ke),ie=De.find(function(Fe){return Object.prototype.toString.call(Fe)==="[object Object]"}),ae=P(se),me=s(ae,1),we=me[0],Me=function(){var Ue=0;return se.map(function(Be,et){var Je=De[et]||De[De.length-1],Ze=Object.prototype.toString.call(Je)==="[object Object]"?"url(#".concat(z,"-gradient-").concat(ge,")"):"",Ye=A(Ue,Be,Je,M,Y,ee);return Ue+=Be,J.a.createElement("path",{key:et,className:"".concat(z,"-circle-path"),d:Ye.pathString,stroke:Ze,strokeLinecap:fe,strokeWidth:M,opacity:Be===0?0:1,fillOpacity:"0",style:Ye.pathStyle,ref:we[et]})})};return J.a.createElement("svg",i({className:X()("".concat(z,"-circle"),Se),viewBox:"0 0 100 100",style:Oe},Ae),ie&&J.a.createElement("defs",null,J.a.createElement("linearGradient",{id:"".concat(z,"-gradient-").concat(ge),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(ie).sort(function(Fe,Ue){return h(Fe)-h(Ue)}).map(function(Fe,Ue){return J.a.createElement("stop",{key:Ue,offset:Fe,stopColor:ie[Fe]})}))),J.a.createElement("path",{className:"".concat(z,"-circle-trail"),d:re,stroke:le,strokeLinecap:fe,strokeWidth:N||M,fillOpacity:"0",style:he}),Me().reverse())};S.defaultProps=F;var D=S,I={Line:a,Circle:D}},kSUc:function(pt,Te,q){},lZu9:function(pt,Te,q){(function(ue){ue(q("VrN/"),q("1eCo"),q("8EBN"))})(function(ue){"use strict";ue.defineMode("markdown",function(J,_){var X=ue.getMode(J,"text/html"),F=X.name=="null";function P(M){if(ue.findModeByName){var N=ue.findModeByName(M);N&&(M=N.mime||N.mimes[0])}var Y=ue.getMode(J,M);return Y.name=="null"?null:Y}_.highlightFormatting===void 0&&(_.highlightFormatting=!1),_.maxBlockquoteDepth===void 0&&(_.maxBlockquoteDepth=0),_.taskLists===void 0&&(_.taskLists=!1),_.strikethrough===void 0&&(_.strikethrough=!1),_.emoji===void 0&&(_.emoji=!1),_.fencedCodeBlockHighlighting===void 0&&(_.fencedCodeBlockHighlighting=!0),_.fencedCodeBlockDefaultMode===void 0&&(_.fencedCodeBlockDefaultMode="text/plain"),_.xml===void 0&&(_.xml=!0),_.tokenTypeOverrides===void 0&&(_.tokenTypeOverrides={});var W={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var U in W)W.hasOwnProperty(U)&&_.tokenTypeOverrides[U]&&(W[U]=_.tokenTypeOverrides[U]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,d=/^\[(x| )\](?=\s)/i,f=_.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,T=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,m=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,g=/^\s*\[[^\]]+?\]:.*$/,a=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,i=" ";function s(M,N,Y){return N.f=N.inline=Y,Y(M,N)}function l(M,N,Y){return N.f=N.block=Y,Y(M,N)}function C(M){return!M||!/\S/.test(M.string)}function v(M){if(M.linkTitle=!1,M.linkHref=!1,M.linkText=!1,M.em=!1,M.strong=!1,M.strikethrough=!1,M.quote=0,M.indentedCode=!1,M.f==R){var N=F;if(!N){var Y=ue.innerMode(X,M.htmlState);N=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}N&&(M.f=h,M.block=y,M.htmlState=null)}return M.trailingSpace=0,M.trailingSpaceNewLine=!1,M.prevLine=M.thisLine,M.thisLine={stream:null},null}function y(M,N){var Y=M.column()===N.indentation,ee=C(N.prevLine.stream),le=N.indentedCode,fe=N.prevLine.hr,Oe=N.list!==!1,Se=(N.listStack[N.listStack.length-1]||0)+3;N.indentedCode=!1;var ke=N.indentation;if(N.indentationDiff===null&&(N.indentationDiff=N.indentation,Oe)){for(N.list=null;ke=4&&(le||N.prevLine.fencedCodeEnd||N.prevLine.header||ee))return M.skipToEnd(),N.indentedCode=!0,W.code;if(M.eatSpace())return null;if(Y&&N.indentation<=Se&&(ge=M.match(f))&&ge[1].length<=6)return N.quote=0,N.header=ge[1].length,N.thisLine.header=!0,_.highlightFormatting&&(N.formatting="header"),N.f=N.inline,x(N);if(N.indentation<=Se&&M.eat(">"))return N.quote=Y?1:N.quote+1,_.highlightFormatting&&(N.formatting="quote"),M.eatSpace(),x(N);if(!Ae&&!N.setext&&Y&&N.indentation<=Se&&(ge=M.match(L))){var de=ge[1]?"ol":"ul";return N.indentation=ke+M.current().length,N.list=!0,N.quote=0,N.listStack.push(N.indentation),N.em=!1,N.strong=!1,N.code=!1,N.strikethrough=!1,_.taskLists&&M.match(d,!1)&&(N.taskList=!0),N.f=N.inline,_.highlightFormatting&&(N.formatting=["list","list-"+de]),x(N)}else{if(Y&&N.indentation<=Se&&(ge=M.match(m,!0)))return N.quote=0,N.fencedEndRE=new RegExp(ge[1]+"+ *$"),N.localMode=_.fencedCodeBlockHighlighting&&P(ge[2]||_.fencedCodeBlockDefaultMode),N.localMode&&(N.localState=ue.startState(N.localMode)),N.f=N.block=w,_.highlightFormatting&&(N.formatting="code-block"),N.code=-1,x(N);if(N.setext||(!Le||!Oe)&&!N.quote&&N.list===!1&&!N.code&&!Ae&&!g.test(M.string)&&(ge=M.lookAhead(1))&&(ge=ge.match(T)))return N.setext?(N.header=N.setext,N.setext=0,M.skipToEnd(),_.highlightFormatting&&(N.formatting="header")):(N.header=ge[0].charAt(0)=="="?1:2,N.setext=N.header),N.thisLine.header=!0,N.f=N.inline,x(N);if(Ae)return M.skipToEnd(),N.hr=!0,N.thisLine.hr=!0,W.hr;if(M.peek()==="[")return s(M,N,I)}return s(M,N,N.inline)}function R(M,N){var Y=X.token(M,N.htmlState);if(!F){var ee=ue.innerMode(X,N.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||N.md_inside&&M.current().indexOf(">")>-1)&&(N.f=h,N.block=y,N.htmlState=null)}return Y}function w(M,N){var Y=N.listStack[N.listStack.length-1]||0,ee=N.indentation=M.quote?N.push(W.formatting+"-"+M.formatting[Y]+"-"+M.quote):N.push("error"))}if(M.taskOpen)return N.push("meta"),N.length?N.join(" "):null;if(M.taskClosed)return N.push("property"),N.length?N.join(" "):null;if(M.linkHref?N.push(W.linkHref,"url"):(M.strong&&N.push(W.strong),M.em&&N.push(W.em),M.strikethrough&&N.push(W.strikethrough),M.emoji&&N.push(W.emoji),M.linkText&&N.push(W.linkText),M.code&&N.push(W.code),M.image&&N.push(W.image),M.imageAltText&&N.push(W.imageAltText,"link"),M.imageMarker&&N.push(W.imageMarker)),M.header&&N.push(W.header,W.header+"-"+M.header),M.quote&&(N.push(W.quote),!_.maxBlockquoteDepth||_.maxBlockquoteDepth>=M.quote?N.push(W.quote+"-"+M.quote):N.push(W.quote+"-"+_.maxBlockquoteDepth)),M.list!==!1){var ee=(M.listStack.length-1)%3;ee?ee===1?N.push(W.list2):N.push(W.list3):N.push(W.list1)}return M.trailingSpaceNewLine?N.push("trailing-space-new-line"):M.trailingSpace&&N.push("trailing-space-"+(M.trailingSpace%2?"a":"b")),N.length?N.join(" "):null}function b(M,N){return M.match(p,!0)?x(N):void 0}function h(M,N){var Y=N.text(M,N);if(typeof Y!="undefined")return Y;if(N.list)return N.list=null,x(N);if(N.taskList){var ee=M.match(d,!0)[1]===" ";return ee?N.taskOpen=!0:N.taskClosed=!0,_.highlightFormatting&&(N.formatting="task"),N.taskList=!1,x(N)}if(N.taskOpen=!1,N.taskClosed=!1,N.header&&M.match(/^#+$/,!0))return _.highlightFormatting&&(N.formatting="header"),x(N);var le=M.next();if(N.linkTitle){N.linkTitle=!1;var fe=le;le==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Oe="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(M.match(new RegExp(Oe),!0))return W.linkHref}if(le==="`"){var Se=N.formatting;_.highlightFormatting&&(N.formatting="code"),M.eatWhile("`");var ke=M.current().length;if(N.code==0&&(!N.quote||ke==1))return N.code=ke,x(N);if(ke==N.code){var Le=x(N);return N.code=0,Le}else return N.formatting=Se,x(N)}else if(N.code)return x(N);if(le==="\\"&&(M.next(),_.highlightFormatting)){var Ae=x(N),ge=W.formatting+"-escape";return Ae?Ae+" "+ge:ge}if(le==="!"&&M.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return N.imageMarker=!0,N.image=!0,_.highlightFormatting&&(N.formatting="image"),x(N);if(le==="["&&N.imageMarker&&M.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return N.imageMarker=!1,N.imageAltText=!0,_.highlightFormatting&&(N.formatting="image"),x(N);if(le==="]"&&N.imageAltText){_.highlightFormatting&&(N.formatting="image");var Ae=x(N);return N.imageAltText=!1,N.image=!1,N.inline=N.f=A,Ae}if(le==="["&&!N.image)return N.linkText&&M.match(/^.*?\]/)||(N.linkText=!0,_.highlightFormatting&&(N.formatting="link")),x(N);if(le==="]"&&N.linkText){_.highlightFormatting&&(N.formatting="link");var Ae=x(N);return N.linkText=!1,N.inline=N.f=M.match(/\(.*?\)| ?\[.*?\]/,!1)?A:h,Ae}if(le==="<"&&M.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=u,_.highlightFormatting&&(N.formatting="link");var Ae=x(N);return Ae?Ae+=" ":Ae="",Ae+W.linkInline}if(le==="<"&&M.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=u,_.highlightFormatting&&(N.formatting="link");var Ae=x(N);return Ae?Ae+=" ":Ae="",Ae+W.linkEmail}if(_.xml&&le==="<"&&M.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var de=M.string.indexOf(">",M.pos);if(de!=-1){var re=M.string.substring(M.start,de);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(re)&&(N.md_inside=!0)}return M.backUp(1),N.htmlState=ue.startState(X),l(M,N,R)}if(_.xml&&le==="<"&&M.match(/^\/\w*?>/))return N.md_inside=!1,"tag";if(le==="*"||le==="_"){for(var he=1,se=M.pos==1?" ":M.string.charAt(M.pos-2);he<3&&M.eat(le);)he++;var De=M.peek()||" ",ie=!/\s/.test(De)&&(!a.test(De)||/\s/.test(se)||a.test(se)),ae=!/\s/.test(se)&&(!a.test(se)||/\s/.test(De)||a.test(De)),me=null,we=null;if(he%2&&(!N.em&&ie&&(le==="*"||!ae||a.test(se))?me=!0:N.em==le&&ae&&(le==="*"||!ie||a.test(De))&&(me=!1)),he>1&&(!N.strong&&ie&&(le==="*"||!ae||a.test(se))?we=!0:N.strong==le&&ae&&(le==="*"||!ie||a.test(De))&&(we=!1)),we!=null||me!=null){_.highlightFormatting&&(N.formatting=me==null?"strong":we==null?"em":"strong em"),me===!0&&(N.em=le),we===!0&&(N.strong=le);var Le=x(N);return me===!1&&(N.em=!1),we===!1&&(N.strong=!1),Le}}else if(le===" "&&(M.eat("*")||M.eat("_"))){if(M.peek()===" ")return x(N);M.backUp(1)}if(_.strikethrough){if(le==="~"&&M.eatWhile(le)){if(N.strikethrough){_.highlightFormatting&&(N.formatting="strikethrough");var Le=x(N);return N.strikethrough=!1,Le}else if(M.match(/^[^\s]/,!1))return N.strikethrough=!0,_.highlightFormatting&&(N.formatting="strikethrough"),x(N)}else if(le===" "&&M.match(/^~~/,!0)){if(M.peek()===" ")return x(N);M.backUp(2)}}if(_.emoji&&le===":"&&M.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){N.emoji=!0,_.highlightFormatting&&(N.formatting="emoji");var Me=x(N);return N.emoji=!1,Me}return le===" "&&(M.match(/^ +$/,!1)?N.trailingSpace++:N.trailingSpace&&(N.trailingSpaceNewLine=!0)),x(N)}function u(M,N){var Y=M.next();if(Y===">"){N.f=N.inline=h,_.highlightFormatting&&(N.formatting="link");var ee=x(N);return ee?ee+=" ":ee="",ee+W.linkInline}return M.match(/^[^>]+/,!0),W.linkInline}function A(M,N){if(M.eatSpace())return null;var Y=M.next();return Y==="("||Y==="["?(N.f=N.inline=D(Y==="("?")":"]"),_.highlightFormatting&&(N.formatting="link-string"),N.linkHref=!0,x(N)):"error"}var S={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function D(M){return function(N,Y){var ee=N.next();if(ee===M){Y.f=Y.inline=h,_.highlightFormatting&&(Y.formatting="link-string");var le=x(Y);return Y.linkHref=!1,le}return N.match(S[M]),Y.linkHref=!0,x(Y)}}function I(M,N){return M.match(/^([^\]\\]|\\.)*\]:/,!1)?(N.f=B,M.next(),_.highlightFormatting&&(N.formatting="link"),N.linkText=!0,x(N)):s(M,N,h)}function B(M,N){if(M.match(/^\]:/,!0)){N.f=N.inline=j,_.highlightFormatting&&(N.formatting="link");var Y=x(N);return N.linkText=!1,Y}return M.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function j(M,N){return M.eatSpace()?null:(M.match(/^[^\s]+/,!0),M.peek()===void 0?N.linkTitle=!0:M.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),N.f=N.inline=h,W.linkHref+" url")}var z={startState:function(){return{f:y,prevLine:{stream:null},thisLine:{stream:null},block:y,htmlState:null,indentation:0,inline:h,text:b,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(M){return{f:M.f,prevLine:M.prevLine,thisLine:M.thisLine,block:M.block,htmlState:M.htmlState&&ue.copyState(X,M.htmlState),indentation:M.indentation,localMode:M.localMode,localState:M.localMode?ue.copyState(M.localMode,M.localState):null,inline:M.inline,text:M.text,formatting:!1,linkText:M.linkText,linkTitle:M.linkTitle,linkHref:M.linkHref,code:M.code,em:M.em,strong:M.strong,strikethrough:M.strikethrough,emoji:M.emoji,header:M.header,setext:M.setext,hr:M.hr,taskList:M.taskList,list:M.list,listStack:M.listStack.slice(0),quote:M.quote,indentedCode:M.indentedCode,trailingSpace:M.trailingSpace,trailingSpaceNewLine:M.trailingSpaceNewLine,md_inside:M.md_inside,fencedEndRE:M.fencedEndRE}},token:function(M,N){if(N.formatting=!1,M!=N.thisLine.stream){if(N.header=0,N.hr=!1,M.match(/^\s*$/,!0))return v(N),null;if(N.prevLine=N.thisLine,N.thisLine={stream:M},N.taskList=!1,N.trailingSpace=0,N.trailingSpaceNewLine=!1,!N.localState&&(N.f=N.block,N.f!=R)){var Y=M.match(/^\s*/,!0)[0].replace(/\t/g,i).length;if(N.indentation=Y,N.indentationDiff=null,Y>0)return null}}return N.f(M,N)},innerMode:function(M){return M.block==R?{state:M.htmlState,mode:X}:M.localState?{state:M.localState,mode:M.localMode}:{state:M,mode:z}},indent:function(M,N,Y){return M.block==R&&X.indent?X.indent(M.htmlState,N,Y):M.localState&&M.localMode.indent?M.localMode.indent(M.localState,N,Y):ue.Pass},blankLine:v,getType:x,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return z},"xml"),ue.defineMIME("text/markdown","markdown"),ue.defineMIME("text/x-markdown","markdown")})},nnTU:function(pt,Te,q){"use strict";q.d(Te,"b",function(){return U}),q.d(Te,"a",function(){return O});var ue=q("pmY6"),J=q("746U"),_=q("Cg/j"),X=q("MI8n"),F=q("24hK"),P=q("QDVR"),W=function(){for(var L=0,d=0,f=arguments.length;d=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function L(a){return a.line<=a.min?void 0:(a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0)}function d(a){for(;;){var i=a.text.indexOf(">",a.ch);if(i==-1){if(O(a))continue;return}if(!U(a,i+1)){a.ch=i+1;continue}var s=a.text.lastIndexOf("/",i),l=s>-1&&!/\S/.test(a.text.slice(s+1,i));return a.ch=i+1,l?"selfClose":"regular"}}function f(a){for(;;){var i=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(i==-1){if(L(a))continue;return}if(!U(a,i+1)){a.ch=i;continue}P.lastIndex=i,a.ch=i;var s=P.exec(a.text);if(s&&s.index==i)return s}}function T(a){for(;;){P.lastIndex=a.ch;var i=P.exec(a.text);if(!i){if(O(a))continue;return}if(!U(a,i.index+1)){a.ch=i.index+1;continue}return a.ch=i.index+i[0].length,i}}function p(a){for(;;){var i=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(i==-1){if(L(a))continue;return}if(!U(a,i+1)){a.ch=i;continue}var s=a.text.lastIndexOf("/",i),l=s>-1&&!/\S/.test(a.text.slice(s+1,i));return a.ch=i+1,l?"selfClose":"regular"}}function m(a,i){for(var s=[];;){var l=T(a),C,v=a.line,y=a.ch-(l?l[0].length:0);if(!l||!(C=d(a)))return;if(C=="selfClose")continue;if(l[1]){for(var R=s.length-1;R>=0;--R)if(s[R]==l[2]){s.length=R;break}if(R<0&&(!i||i==l[2]))return{tag:l[2],from:J(v,y),to:J(a.line,a.ch)}}else s.push(l[2])}}function g(a,i){for(var s=[];;){var l=p(a);if(!l)return;if(l=="selfClose"){f(a);continue}var C=a.line,v=a.ch,y=f(a);if(!y)return;if(y[1])s.push(y[2]);else{for(var R=s.length-1;R>=0;--R)if(s[R]==y[2]){s.length=R;break}if(R<0&&(!i||i==y[2]))return{tag:y[2],from:J(a.line,a.ch),to:J(C,v)}}}}ue.registerHelper("fold","xml",function(a,i){for(var s=new W(a,i.line,0);;){var l=T(s);if(!l||s.line!=i.line)return;var C=d(s);if(!C)return;if(!l[1]&&C!="selfClose"){var v=J(s.line,s.ch),y=m(s,l[2]);return y&&_(y.from,v)>0?{from:v,to:y.from}:null}}}),ue.findMatchingTag=function(a,i,s){var l=new W(a,i.line,i.ch,s);if(l.text.indexOf(">")==-1&&l.text.indexOf("<")==-1)return;var C=d(l),v=C&&J(l.line,l.ch),y=C&&f(l);if(!C||!y||_(l,i)>0)return;var R={from:J(l.line,l.ch),to:v,tag:y[2]};return C=="selfClose"?{open:R,close:null,at:"open"}:y[1]?{open:g(l,y[2]),close:R,at:"close"}:(l=new W(a,v.line,v.ch,s),{open:R,close:m(l,y[2]),at:"open"})},ue.findEnclosingTag=function(a,i,s,l){for(var C=new W(a,i.line,i.ch,s);;){var v=g(C,l);if(!v)break;var y=new W(a,i.line,i.ch,s),R=m(y,v.tag);if(R)return{open:v,close:R}}},ue.scanForClosingTag=function(a,i,s,l){var C=new W(a,i.line,i.ch,l?{from:0,to:l}:null);return m(C,s)}})},p5ED:function(pt,Te,q){"use strict";var ue=q("+L6B"),J=q("2/Rp"),_=q("5Dmo"),X=q("3S7+"),F=q("k1fw"),P=q("9og8"),W=q("tJVT"),U=q("WmNS"),O=q.n(U),L=q("q1tI"),d=q.n(L),f=q("vHTk"),T=q.n(f),p=q("yEEn"),m=q("ZW9T"),g=q("1vsH"),a=q("V0Rq"),i=q("m3rI");Te.a=function(s){var l,C,v,y,R,w,x=s.editOffice,b=x===void 0?"view":x,h=s.name,u=s.data,A=s.theme,S=s.type,D=s.filename,I=s.monacoEditor,B=s.className,j=s.style,z=s.close,M=s.onClose,N=s.hasMask,Y=s.disabledDownload,ee=s.onImgDimensions,le=s.otherData,fe=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Oe=Object(W.a)(fe,2),Se=Oe[0],ke=Oe[1],Le=Object(L.useState)(""),Ae=Object(W.a)(Le,2),ge=Ae[0],de=Ae[1],re=Object(L.useState)(),he=Object(W.a)(re,2),se=he[0],De=he[1],ie=window.ENV==="build"?"/react/build":"",ae=location.host.startsWith("localhost")?i.a.PROXY_SERVER:i.a.API_SERVER,me,we=1024*1024,Me=10*we,Fe=Object(L.useRef)();(l=u)!==null&&l!==void 0&&l.startsWith("/api")&&S!=="txt"&&(u=i.a.API_SERVER+u),S==="office"&&(me=Object(g.P)(u).filesize,me>Me&&(S="other")),D&&(I.filename=D),Object(L.useEffect)(function(){var Je,Ze,Ye=(Je=document.cookie)===null||Je===void 0||((Ze=Je.replace(/\s/g,""))===null||Ze===void 0)?void 0:Ze.split(";");Ye==null||Ye.map(function(dt){var qe=dt.split("=");qe[0]==="_educoder_session"&&de(qe[1])})},[]),Object(L.useEffect)(function(){S==="office"&&Ue()},[S,u]);var Ue=function(){var Je=Object(P.a)(O.a.mark(function Ze(){var Ye,dt,qe;return O.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return console.log("data:",u),Ye=u,u.startsWith("http")||(Ye=location.origin+Ye),dt=new URL(Ye).pathname.split("/").pop(),Ie.next=6,Object(a.U)({attachment_id:dt});case 6:qe=Ie.sent,De(qe);case 8:case"end":return Ie.stop()}},Ze)}));return function(){return Je.apply(this,arguments)}}(),Be=function(){if(u.startsWith("http")||u.startsWith("blob:")){et();return}Object(g.x)(D||"educoder",u,D)},et=function(){Object(g.v)(D||"educoder",decodeURIComponent(u))};return d.a.createElement("div",{style:Object(F.a)({},j||{}),className:"".concat(N&&T.a.bgBlack," ").concat(S?T.a.wrp:"hide")},z&&d.a.createElement("div",{className:T.a.close,ref:Fe},!!ee&&d.a.createElement(X.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return Fe.current}},d.a.createElement("span",{onClick:function(){M(),ee()}},d.a.createElement("i",{className:"icon-yulanpizhu"}))),!Y&&d.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Fe.current}},d.a.createElement("span",{onClick:et},d.a.createElement("i",{className:"icon-quxiaozhiding"}))),d.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Fe.current}},d.a.createElement("span",{className:"",onClick:M},d.a.createElement("i",{className:"icon-guanbi1"})))),d.a.createElement("div",{className:"".concat(T.a[B]," ").concat(B," ").concat(T.a.monaco," ").concat(S==="txt"?"show":"hide")},S==="txt"&&d.a.createElement(m.b,I)),S==="audio"&&d.a.createElement("audio",{src:"".concat(((C=u)===null||C===void 0?void 0:C.indexOf("http://"))>-1||((v=u)===null||v===void 0?void 0:v.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(u),autoPlay:!0}),S==="video"&&d.a.createElement(d.a.Fragment,null,((y=u)===null||y===void 0?void 0:y.indexOf("http"))>-1?d.a.createElement("video",{controls:!0,src:"".concat(u),autoPlay:!0}):d.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(u),autoPlay:!0})),S==="office"&&se&&d.a.createElement("iframe",{src:"".concat(ie,"/office.html?key=").concat(se.key,"&url=").concat(ae+se.url,"&callbackUrl=").concat(ae+se.callbackUrl,"&fileType=").concat(se.fileType,"&title=").concat(se.title,"&model=").concat(b,"&officeServer=").concat(i.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),(S==="xlsx"||S==="doc"||S==="pptx"||S==="docx")&&d.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(le.key,"&url=").concat(i.a.API_SERVER+le.url,"&callbackUrl=").concat(i.a.API_SERVER+le.callbackUrl,"&fileType=").concat(le.fileType,"&title=").concat(le.title,"&model=").concat(le.model)}),S==="html"&&d.a.createElement("iframe",{src:u+"&disposition=inline"}),S==="pdf"&&d.a.createElement("embed",{className:T.a.embed,src:u}),S==="image"&&d.a.createElement("img",{src:"".concat(((R=u)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((w=u)===null||w===void 0?void 0:w.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(u)}),S==="other"&&d.a.createElement("div",null,d.a.createElement(J.a,{type:"primary",size:"large",onClick:Be},d.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),S==="download"&&d.a.createElement(J.a,{type:"primary",size:"large",onClick:Be},d.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(pt,Te,q){},pmY6:function(pt,Te,q){"use strict";q.d(Te,"g",function(){return F}),q.d(Te,"f",function(){return P}),q.d(Te,"e",function(){return W}),q.d(Te,"h",function(){return U}),q.d(Te,"b",function(){return O}),q.d(Te,"a",function(){return L}),q.d(Te,"d",function(){return d}),q.d(Te,"c",function(){return f});var ue=!1,J="__is_disposable_tracked__";function _(T){if(!ue)return;if(T&&T!==L.None)try{T[J]=!0}catch(p){}}function X(T){if(!ue)return T;var p=new Error("Potentially leaked disposable").stack;return setTimeout(function(){T[J]||console.log(p)},3e3),T}function F(T){return typeof T.dispose=="function"&&T.dispose.length===0}function P(T){return Array.isArray(T)?(T.forEach(function(p){p&&(_(p),p.dispose())}),[]):T?(_(T),T.dispose(),T):void 0}function W(){for(var T=[],p=0;p=_.length?{done:!0}:{done:!1,value:_[P++]}},e:function(f){throw f},f:W}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U=!0,O=!1,L;return{s:function(){F=_[Symbol.iterator]()},n:function(){var f=F.next();return U=f.done,f},e:function(f){O=!0,L=f},f:function(){try{!U&&F.return!=null&&F.return()}finally{if(O)throw L}}}}},rUJ1:function(pt,Te){const q=/[&<>"']/,ue=/[&<>"']/g,J=/[<>"']|&(?!#?\w+;)/,_=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},F=w=>X[w];function P(w,x){if(x){if(q.test(w))return w.replace(ue,F)}else if(J.test(w))return w.replace(_,F);return w}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(w){return w.replace(W,(x,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const O=/(^|[^\[])\^/g;function L(w,x){w=w.source||w,x=x||"";const b={replace:(h,u)=>(u=u.source||u,u=u.replace(O,"$1"),w=w.replace(h,u),b),getRegex:()=>new RegExp(w,x)};return b}const d=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(w,x,b){if(w){let h;try{h=decodeURIComponent(U(b)).replace(d,"").toLowerCase()}catch(u){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}x&&!f.test(b)&&(b=i(x,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(h){return null}return b}const p={},m=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(w,x){p[" "+w]||(m.test(w)?p[" "+w]=w+"/":p[" "+w]=v(w,"/",!0)),w=p[" "+w];const b=w.indexOf(":")===-1;return x.substring(0,2)==="//"?b?x:w.replace(g,"$1")+x:x.charAt(0)==="/"?b?x:w.replace(a,"$1")+x:w+x}const s={exec:function(){}};function l(w){let x=1,b,h;for(;x{let I=!1,B=S;for(;--B>=0&&D[B]==="\\";)I=!I;return I?"|":" |"}),h=b.split(/ \|/);let u=0;if(h.length>x)h.splice(x);else for(;h.length"},g.a.createElement(W.a.Item,null,g.a.createElement(s.a,{to:"/classrooms/".concat(j.coursesId,"/common_homework")},ge.course_name)),g.a.createElement(W.a.Item,null,g.a.createElement(s.a,{to:"/classrooms/".concat(j.coursesId,"/common_homework")},ge.category.category_name)),g.a.createElement(W.a.Item,null,"\u7F16\u8F91")))),g.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u7F16\u8F91\u56FE\u6587\u4F5C\u4E1A"),g.a.createElement(d.a,{form:N,className:y.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){fe(Object(U.a)({},N.getFieldsValue()))},onFinish:re},g.a.createElement("div",{className:y.a.fieldWrap},g.a.createElement(d.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},g.a.createElement(F.a,{maxLength:60,suffix:"".concat(((h=le.name)===null||h===void 0?void 0:h.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),g.a.createElement("div",{className:y.a.mdWrap},g.a.createElement(d.a.Item,{name:"description",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},g.a.createElement(l.a,{watch:!0,defaultValue:ge.description})),g.a.createElement("div",null,g.a.createElement(d.a.Item,{name:"attachment_ids"},ke&&g.a.createElement(R.b,null)))),g.a.createElement("div",{className:y.a.mdWrap},g.a.createElement(d.a.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},g.a.createElement(l.a,Object(_.a)({defaultValue:ge.reference_answer,watch:!0},"defaultValue",le.reference_answer))),g.a.createElement("div",null,g.a.createElement(d.a.Item,{name:"reference_attachment_ids"},ke&&g.a.createElement(R.b,null)))),g.a.createElement("div",{className:y.a.backgroundFa},g.a.createElement("div",{className:"pt40 mb30"},g.a.createElement(d.a.Item,null,g.a.createElement(J.a,{size:"large",type:"primary",className:"".concat(y.a.button," mr20"),htmlType:"submit",loading:D["newCourse/editCourse"]||D["newCourse/submitCourse"]},"\u63D0\u4EA4"),g.a.createElement(J.a,{size:"large",type:"primary",ghost:!0,className:y.a.button,onClick:function(){return i.d.push("/classrooms/".concat(B.params.coursesId,"/common_homework"))}},"\u53D6\u6D88"))))))};Te.default=Object(i.a)(function(x){var b=x.shixunHomeworks,h=x.newCourse,u=x.loading,A=x.globalSetting;return{shixunHomeworks:b,newCourse:h,globalSetting:A,loading:u.effects}})(w)},ulZh:function(pt,Te,q){typeof window!="undefined"&&function(J,_){pt.exports=_()}(this,function(){return function(ue){var J={};function _(X){if(J[X])return J[X].exports;var F=J[X]={i:X,l:!1,exports:{}};return ue[X].call(F.exports,F,F.exports,_),F.l=!0,F.exports}return _.m=ue,_.c=J,_.d=function(X,F,P){_.o(X,F)||Object.defineProperty(X,F,{enumerable:!0,get:P})},_.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},_.t=function(X,F){if(F&1&&(X=_(X)),F&8)return X;if(F&4&&typeof X=="object"&&X&&X.__esModule)return X;var P=Object.create(null);if(_.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:X}),F&2&&typeof X!="string")for(var W in X)_.d(P,W,function(U){return X[U]}.bind(null,W));return P},_.n=function(X){var F=X&&X.__esModule?function(){return X.default}:function(){return X};return _.d(F,"a",F),F},_.o=function(X,F){return Object.prototype.hasOwnProperty.call(X,F)},_.p="/dist/",_(_.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ue,J,_){"use strict";var X=Object.prototype.hasOwnProperty,F="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(F=!1));function W(d,f,T){this.fn=d,this.context=f,this.once=T||!1}function U(d,f,T,p,m){if(typeof T!="function")throw new TypeError("The listener must be a function");var g=new W(T,p||d,m),a=F?F+f:f;return d._events[a]?d._events[a].fn?d._events[a]=[d._events[a],g]:d._events[a].push(g):(d._events[a]=g,d._eventsCount++),d}function O(d,f){--d._eventsCount===0?d._events=new P:delete d._events[f]}function L(){this._events=new P,this._eventsCount=0}L.prototype.eventNames=function(){var f=[],T,p;if(this._eventsCount===0)return f;for(p in T=this._events)X.call(T,p)&&f.push(F?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(T)):f},L.prototype.listeners=function(f){var T=F?F+f:f,p=this._events[T];if(!p)return[];if(p.fn)return[p.fn];for(var m=0,g=p.length,a=new Array(g);m0},!1)}function d(f,T){for(var p={main:[T]},m={main:[]},g={main:{}};L(p);)for(var a=Object.keys(p),i=0;i=2*R/x||D<=B)return;var j=Number.POSITIVE_INFINITY,z;for(z=a.level-1;z>h;z--){var M=b[z].maxBitrate;if(j=R*M/(8*.8*S),j=D)return;var N=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+a.sn+(i?" part "+i.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+z+` + a `).concat(ee,",").concat(ee," 0 1 1 ").concat(-Oe,",").concat(Se),Le=Math.PI*2*ee,Ae={stroke:z,strokeDasharray:"".concat(j/100*(Le-N),"px ").concat(Le,"px"),strokeDashoffset:"-".concat(N/2+B/100*(Le-N),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ke,pathStyle:Ae}}var S=function(j){var z=j.prefixCls,M=j.strokeWidth,N=j.trailWidth,Y=j.gapDegree,ee=j.gapPosition,le=j.trailColor,fe=j.strokeLinecap,Oe=j.style,Se=j.className,ke=j.strokeColor,Le=j.percent,Ae=w(j,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ge=Object(ue.useMemo)(function(){return b+=1,b},[]),he=A(0,100,le,M,Y,ee),re=he.pathString,de=he.pathStyle,se=u(Le),De=u(ke),ie=De.find(function(Fe){return Object.prototype.toString.call(Fe)==="[object Object]"}),ae=P(se),me=s(ae,1),we=me[0],Me=function(){var Ue=0;return se.map(function(Be,et){var Je=De[et]||De[De.length-1],Ze=Object.prototype.toString.call(Je)==="[object Object]"?"url(#".concat(z,"-gradient-").concat(ge,")"):"",Ye=A(Ue,Be,Je,M,Y,ee);return Ue+=Be,J.a.createElement("path",{key:et,className:"".concat(z,"-circle-path"),d:Ye.pathString,stroke:Ze,strokeLinecap:fe,strokeWidth:M,opacity:Be===0?0:1,fillOpacity:"0",style:Ye.pathStyle,ref:we[et]})})};return J.a.createElement("svg",i({className:X()("".concat(z,"-circle"),Se),viewBox:"0 0 100 100",style:Oe},Ae),ie&&J.a.createElement("defs",null,J.a.createElement("linearGradient",{id:"".concat(z,"-gradient-").concat(ge),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(ie).sort(function(Fe,Ue){return d(Fe)-d(Ue)}).map(function(Fe,Ue){return J.a.createElement("stop",{key:Ue,offset:Fe,stopColor:ie[Fe]})}))),J.a.createElement("path",{className:"".concat(z,"-circle-trail"),d:re,stroke:le,strokeLinecap:fe,strokeWidth:N||M,fillOpacity:"0",style:de}),Me().reverse())};S.defaultProps=F;var D=S,I={Line:a,Circle:D}},kSUc:function(pt,Te,q){},lZu9:function(pt,Te,q){(function(ue){ue(q("VrN/"),q("1eCo"),q("8EBN"))})(function(ue){"use strict";ue.defineMode("markdown",function(J,_){var X=ue.getMode(J,"text/html"),F=X.name=="null";function P(M){if(ue.findModeByName){var N=ue.findModeByName(M);N&&(M=N.mime||N.mimes[0])}var Y=ue.getMode(J,M);return Y.name=="null"?null:Y}_.highlightFormatting===void 0&&(_.highlightFormatting=!1),_.maxBlockquoteDepth===void 0&&(_.maxBlockquoteDepth=0),_.taskLists===void 0&&(_.taskLists=!1),_.strikethrough===void 0&&(_.strikethrough=!1),_.emoji===void 0&&(_.emoji=!1),_.fencedCodeBlockHighlighting===void 0&&(_.fencedCodeBlockHighlighting=!0),_.fencedCodeBlockDefaultMode===void 0&&(_.fencedCodeBlockDefaultMode="text/plain"),_.xml===void 0&&(_.xml=!0),_.tokenTypeOverrides===void 0&&(_.tokenTypeOverrides={});var W={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var U in W)W.hasOwnProperty(U)&&_.tokenTypeOverrides[U]&&(W[U]=_.tokenTypeOverrides[U]);var O=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,h=/^\[(x| )\](?=\s)/i,f=_.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,T=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,m=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,g=/^\s*\[[^\]]+?\]:.*$/,a=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,i=" ";function s(M,N,Y){return N.f=N.inline=Y,Y(M,N)}function l(M,N,Y){return N.f=N.block=Y,Y(M,N)}function C(M){return!M||!/\S/.test(M.string)}function v(M){if(M.linkTitle=!1,M.linkHref=!1,M.linkText=!1,M.em=!1,M.strong=!1,M.strikethrough=!1,M.quote=0,M.indentedCode=!1,M.f==R){var N=F;if(!N){var Y=ue.innerMode(X,M.htmlState);N=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}N&&(M.f=d,M.block=y,M.htmlState=null)}return M.trailingSpace=0,M.trailingSpaceNewLine=!1,M.prevLine=M.thisLine,M.thisLine={stream:null},null}function y(M,N){var Y=M.column()===N.indentation,ee=C(N.prevLine.stream),le=N.indentedCode,fe=N.prevLine.hr,Oe=N.list!==!1,Se=(N.listStack[N.listStack.length-1]||0)+3;N.indentedCode=!1;var ke=N.indentation;if(N.indentationDiff===null&&(N.indentationDiff=N.indentation,Oe)){for(N.list=null;ke=4&&(le||N.prevLine.fencedCodeEnd||N.prevLine.header||ee))return M.skipToEnd(),N.indentedCode=!0,W.code;if(M.eatSpace())return null;if(Y&&N.indentation<=Se&&(ge=M.match(f))&&ge[1].length<=6)return N.quote=0,N.header=ge[1].length,N.thisLine.header=!0,_.highlightFormatting&&(N.formatting="header"),N.f=N.inline,x(N);if(N.indentation<=Se&&M.eat(">"))return N.quote=Y?1:N.quote+1,_.highlightFormatting&&(N.formatting="quote"),M.eatSpace(),x(N);if(!Ae&&!N.setext&&Y&&N.indentation<=Se&&(ge=M.match(L))){var he=ge[1]?"ol":"ul";return N.indentation=ke+M.current().length,N.list=!0,N.quote=0,N.listStack.push(N.indentation),N.em=!1,N.strong=!1,N.code=!1,N.strikethrough=!1,_.taskLists&&M.match(h,!1)&&(N.taskList=!0),N.f=N.inline,_.highlightFormatting&&(N.formatting=["list","list-"+he]),x(N)}else{if(Y&&N.indentation<=Se&&(ge=M.match(m,!0)))return N.quote=0,N.fencedEndRE=new RegExp(ge[1]+"+ *$"),N.localMode=_.fencedCodeBlockHighlighting&&P(ge[2]||_.fencedCodeBlockDefaultMode),N.localMode&&(N.localState=ue.startState(N.localMode)),N.f=N.block=w,_.highlightFormatting&&(N.formatting="code-block"),N.code=-1,x(N);if(N.setext||(!Le||!Oe)&&!N.quote&&N.list===!1&&!N.code&&!Ae&&!g.test(M.string)&&(ge=M.lookAhead(1))&&(ge=ge.match(T)))return N.setext?(N.header=N.setext,N.setext=0,M.skipToEnd(),_.highlightFormatting&&(N.formatting="header")):(N.header=ge[0].charAt(0)=="="?1:2,N.setext=N.header),N.thisLine.header=!0,N.f=N.inline,x(N);if(Ae)return M.skipToEnd(),N.hr=!0,N.thisLine.hr=!0,W.hr;if(M.peek()==="[")return s(M,N,I)}return s(M,N,N.inline)}function R(M,N){var Y=X.token(M,N.htmlState);if(!F){var ee=ue.innerMode(X,N.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||N.md_inside&&M.current().indexOf(">")>-1)&&(N.f=d,N.block=y,N.htmlState=null)}return Y}function w(M,N){var Y=N.listStack[N.listStack.length-1]||0,ee=N.indentation=M.quote?N.push(W.formatting+"-"+M.formatting[Y]+"-"+M.quote):N.push("error"))}if(M.taskOpen)return N.push("meta"),N.length?N.join(" "):null;if(M.taskClosed)return N.push("property"),N.length?N.join(" "):null;if(M.linkHref?N.push(W.linkHref,"url"):(M.strong&&N.push(W.strong),M.em&&N.push(W.em),M.strikethrough&&N.push(W.strikethrough),M.emoji&&N.push(W.emoji),M.linkText&&N.push(W.linkText),M.code&&N.push(W.code),M.image&&N.push(W.image),M.imageAltText&&N.push(W.imageAltText,"link"),M.imageMarker&&N.push(W.imageMarker)),M.header&&N.push(W.header,W.header+"-"+M.header),M.quote&&(N.push(W.quote),!_.maxBlockquoteDepth||_.maxBlockquoteDepth>=M.quote?N.push(W.quote+"-"+M.quote):N.push(W.quote+"-"+_.maxBlockquoteDepth)),M.list!==!1){var ee=(M.listStack.length-1)%3;ee?ee===1?N.push(W.list2):N.push(W.list3):N.push(W.list1)}return M.trailingSpaceNewLine?N.push("trailing-space-new-line"):M.trailingSpace&&N.push("trailing-space-"+(M.trailingSpace%2?"a":"b")),N.length?N.join(" "):null}function b(M,N){return M.match(p,!0)?x(N):void 0}function d(M,N){var Y=N.text(M,N);if(typeof Y!="undefined")return Y;if(N.list)return N.list=null,x(N);if(N.taskList){var ee=M.match(h,!0)[1]===" ";return ee?N.taskOpen=!0:N.taskClosed=!0,_.highlightFormatting&&(N.formatting="task"),N.taskList=!1,x(N)}if(N.taskOpen=!1,N.taskClosed=!1,N.header&&M.match(/^#+$/,!0))return _.highlightFormatting&&(N.formatting="header"),x(N);var le=M.next();if(N.linkTitle){N.linkTitle=!1;var fe=le;le==="("&&(fe=")"),fe=(fe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Oe="^\\s*(?:[^"+fe+"\\\\]+|\\\\\\\\|\\\\.)"+fe;if(M.match(new RegExp(Oe),!0))return W.linkHref}if(le==="`"){var Se=N.formatting;_.highlightFormatting&&(N.formatting="code"),M.eatWhile("`");var ke=M.current().length;if(N.code==0&&(!N.quote||ke==1))return N.code=ke,x(N);if(ke==N.code){var Le=x(N);return N.code=0,Le}else return N.formatting=Se,x(N)}else if(N.code)return x(N);if(le==="\\"&&(M.next(),_.highlightFormatting)){var Ae=x(N),ge=W.formatting+"-escape";return Ae?Ae+" "+ge:ge}if(le==="!"&&M.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return N.imageMarker=!0,N.image=!0,_.highlightFormatting&&(N.formatting="image"),x(N);if(le==="["&&N.imageMarker&&M.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return N.imageMarker=!1,N.imageAltText=!0,_.highlightFormatting&&(N.formatting="image"),x(N);if(le==="]"&&N.imageAltText){_.highlightFormatting&&(N.formatting="image");var Ae=x(N);return N.imageAltText=!1,N.image=!1,N.inline=N.f=A,Ae}if(le==="["&&!N.image)return N.linkText&&M.match(/^.*?\]/)||(N.linkText=!0,_.highlightFormatting&&(N.formatting="link")),x(N);if(le==="]"&&N.linkText){_.highlightFormatting&&(N.formatting="link");var Ae=x(N);return N.linkText=!1,N.inline=N.f=M.match(/\(.*?\)| ?\[.*?\]/,!1)?A:d,Ae}if(le==="<"&&M.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=u,_.highlightFormatting&&(N.formatting="link");var Ae=x(N);return Ae?Ae+=" ":Ae="",Ae+W.linkInline}if(le==="<"&&M.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){N.f=N.inline=u,_.highlightFormatting&&(N.formatting="link");var Ae=x(N);return Ae?Ae+=" ":Ae="",Ae+W.linkEmail}if(_.xml&&le==="<"&&M.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var he=M.string.indexOf(">",M.pos);if(he!=-1){var re=M.string.substring(M.start,he);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(re)&&(N.md_inside=!0)}return M.backUp(1),N.htmlState=ue.startState(X),l(M,N,R)}if(_.xml&&le==="<"&&M.match(/^\/\w*?>/))return N.md_inside=!1,"tag";if(le==="*"||le==="_"){for(var de=1,se=M.pos==1?" ":M.string.charAt(M.pos-2);de<3&&M.eat(le);)de++;var De=M.peek()||" ",ie=!/\s/.test(De)&&(!a.test(De)||/\s/.test(se)||a.test(se)),ae=!/\s/.test(se)&&(!a.test(se)||/\s/.test(De)||a.test(De)),me=null,we=null;if(de%2&&(!N.em&&ie&&(le==="*"||!ae||a.test(se))?me=!0:N.em==le&&ae&&(le==="*"||!ie||a.test(De))&&(me=!1)),de>1&&(!N.strong&&ie&&(le==="*"||!ae||a.test(se))?we=!0:N.strong==le&&ae&&(le==="*"||!ie||a.test(De))&&(we=!1)),we!=null||me!=null){_.highlightFormatting&&(N.formatting=me==null?"strong":we==null?"em":"strong em"),me===!0&&(N.em=le),we===!0&&(N.strong=le);var Le=x(N);return me===!1&&(N.em=!1),we===!1&&(N.strong=!1),Le}}else if(le===" "&&(M.eat("*")||M.eat("_"))){if(M.peek()===" ")return x(N);M.backUp(1)}if(_.strikethrough){if(le==="~"&&M.eatWhile(le)){if(N.strikethrough){_.highlightFormatting&&(N.formatting="strikethrough");var Le=x(N);return N.strikethrough=!1,Le}else if(M.match(/^[^\s]/,!1))return N.strikethrough=!0,_.highlightFormatting&&(N.formatting="strikethrough"),x(N)}else if(le===" "&&M.match(/^~~/,!0)){if(M.peek()===" ")return x(N);M.backUp(2)}}if(_.emoji&&le===":"&&M.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){N.emoji=!0,_.highlightFormatting&&(N.formatting="emoji");var Me=x(N);return N.emoji=!1,Me}return le===" "&&(M.match(/^ +$/,!1)?N.trailingSpace++:N.trailingSpace&&(N.trailingSpaceNewLine=!0)),x(N)}function u(M,N){var Y=M.next();if(Y===">"){N.f=N.inline=d,_.highlightFormatting&&(N.formatting="link");var ee=x(N);return ee?ee+=" ":ee="",ee+W.linkInline}return M.match(/^[^>]+/,!0),W.linkInline}function A(M,N){if(M.eatSpace())return null;var Y=M.next();return Y==="("||Y==="["?(N.f=N.inline=D(Y==="("?")":"]"),_.highlightFormatting&&(N.formatting="link-string"),N.linkHref=!0,x(N)):"error"}var S={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function D(M){return function(N,Y){var ee=N.next();if(ee===M){Y.f=Y.inline=d,_.highlightFormatting&&(Y.formatting="link-string");var le=x(Y);return Y.linkHref=!1,le}return N.match(S[M]),Y.linkHref=!0,x(Y)}}function I(M,N){return M.match(/^([^\]\\]|\\.)*\]:/,!1)?(N.f=B,M.next(),_.highlightFormatting&&(N.formatting="link"),N.linkText=!0,x(N)):s(M,N,d)}function B(M,N){if(M.match(/^\]:/,!0)){N.f=N.inline=j,_.highlightFormatting&&(N.formatting="link");var Y=x(N);return N.linkText=!1,Y}return M.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function j(M,N){return M.eatSpace()?null:(M.match(/^[^\s]+/,!0),M.peek()===void 0?N.linkTitle=!0:M.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),N.f=N.inline=d,W.linkHref+" url")}var z={startState:function(){return{f:y,prevLine:{stream:null},thisLine:{stream:null},block:y,htmlState:null,indentation:0,inline:d,text:b,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(M){return{f:M.f,prevLine:M.prevLine,thisLine:M.thisLine,block:M.block,htmlState:M.htmlState&&ue.copyState(X,M.htmlState),indentation:M.indentation,localMode:M.localMode,localState:M.localMode?ue.copyState(M.localMode,M.localState):null,inline:M.inline,text:M.text,formatting:!1,linkText:M.linkText,linkTitle:M.linkTitle,linkHref:M.linkHref,code:M.code,em:M.em,strong:M.strong,strikethrough:M.strikethrough,emoji:M.emoji,header:M.header,setext:M.setext,hr:M.hr,taskList:M.taskList,list:M.list,listStack:M.listStack.slice(0),quote:M.quote,indentedCode:M.indentedCode,trailingSpace:M.trailingSpace,trailingSpaceNewLine:M.trailingSpaceNewLine,md_inside:M.md_inside,fencedEndRE:M.fencedEndRE}},token:function(M,N){if(N.formatting=!1,M!=N.thisLine.stream){if(N.header=0,N.hr=!1,M.match(/^\s*$/,!0))return v(N),null;if(N.prevLine=N.thisLine,N.thisLine={stream:M},N.taskList=!1,N.trailingSpace=0,N.trailingSpaceNewLine=!1,!N.localState&&(N.f=N.block,N.f!=R)){var Y=M.match(/^\s*/,!0)[0].replace(/\t/g,i).length;if(N.indentation=Y,N.indentationDiff=null,Y>0)return null}}return N.f(M,N)},innerMode:function(M){return M.block==R?{state:M.htmlState,mode:X}:M.localState?{state:M.localState,mode:M.localMode}:{state:M,mode:z}},indent:function(M,N,Y){return M.block==R&&X.indent?X.indent(M.htmlState,N,Y):M.localState&&M.localMode.indent?M.localMode.indent(M.localState,N,Y):ue.Pass},blankLine:v,getType:x,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return z},"xml"),ue.defineMIME("text/markdown","markdown"),ue.defineMIME("text/x-markdown","markdown")})},nnTU:function(pt,Te,q){"use strict";q.d(Te,"b",function(){return U}),q.d(Te,"a",function(){return O});var ue=q("pmY6"),J=q("746U"),_=q("Cg/j"),X=q("MI8n"),F=q("24hK"),P=q("QDVR"),W=function(){for(var L=0,h=0,f=arguments.length;h=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function L(a){return a.line<=a.min?void 0:(a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0)}function h(a){for(;;){var i=a.text.indexOf(">",a.ch);if(i==-1){if(O(a))continue;return}if(!U(a,i+1)){a.ch=i+1;continue}var s=a.text.lastIndexOf("/",i),l=s>-1&&!/\S/.test(a.text.slice(s+1,i));return a.ch=i+1,l?"selfClose":"regular"}}function f(a){for(;;){var i=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(i==-1){if(L(a))continue;return}if(!U(a,i+1)){a.ch=i;continue}P.lastIndex=i,a.ch=i;var s=P.exec(a.text);if(s&&s.index==i)return s}}function T(a){for(;;){P.lastIndex=a.ch;var i=P.exec(a.text);if(!i){if(O(a))continue;return}if(!U(a,i.index+1)){a.ch=i.index+1;continue}return a.ch=i.index+i[0].length,i}}function p(a){for(;;){var i=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(i==-1){if(L(a))continue;return}if(!U(a,i+1)){a.ch=i;continue}var s=a.text.lastIndexOf("/",i),l=s>-1&&!/\S/.test(a.text.slice(s+1,i));return a.ch=i+1,l?"selfClose":"regular"}}function m(a,i){for(var s=[];;){var l=T(a),C,v=a.line,y=a.ch-(l?l[0].length:0);if(!l||!(C=h(a)))return;if(C=="selfClose")continue;if(l[1]){for(var R=s.length-1;R>=0;--R)if(s[R]==l[2]){s.length=R;break}if(R<0&&(!i||i==l[2]))return{tag:l[2],from:J(v,y),to:J(a.line,a.ch)}}else s.push(l[2])}}function g(a,i){for(var s=[];;){var l=p(a);if(!l)return;if(l=="selfClose"){f(a);continue}var C=a.line,v=a.ch,y=f(a);if(!y)return;if(y[1])s.push(y[2]);else{for(var R=s.length-1;R>=0;--R)if(s[R]==y[2]){s.length=R;break}if(R<0&&(!i||i==y[2]))return{tag:y[2],from:J(a.line,a.ch),to:J(C,v)}}}}ue.registerHelper("fold","xml",function(a,i){for(var s=new W(a,i.line,0);;){var l=T(s);if(!l||s.line!=i.line)return;var C=h(s);if(!C)return;if(!l[1]&&C!="selfClose"){var v=J(s.line,s.ch),y=m(s,l[2]);return y&&_(y.from,v)>0?{from:v,to:y.from}:null}}}),ue.findMatchingTag=function(a,i,s){var l=new W(a,i.line,i.ch,s);if(l.text.indexOf(">")==-1&&l.text.indexOf("<")==-1)return;var C=h(l),v=C&&J(l.line,l.ch),y=C&&f(l);if(!C||!y||_(l,i)>0)return;var R={from:J(l.line,l.ch),to:v,tag:y[2]};return C=="selfClose"?{open:R,close:null,at:"open"}:y[1]?{open:g(l,y[2]),close:R,at:"close"}:(l=new W(a,v.line,v.ch,s),{open:R,close:m(l,y[2]),at:"open"})},ue.findEnclosingTag=function(a,i,s,l){for(var C=new W(a,i.line,i.ch,s);;){var v=g(C,l);if(!v)break;var y=new W(a,i.line,i.ch,s),R=m(y,v.tag);if(R)return{open:v,close:R}}},ue.scanForClosingTag=function(a,i,s,l){var C=new W(a,i.line,i.ch,l?{from:0,to:l}:null);return m(C,s)}})},p5ED:function(pt,Te,q){"use strict";var ue=q("+L6B"),J=q("2/Rp"),_=q("5Dmo"),X=q("3S7+"),F=q("k1fw"),P=q("9og8"),W=q("tJVT"),U=q("WmNS"),O=q.n(U),L=q("q1tI"),h=q.n(L),f=q("vHTk"),T=q.n(f),p=q("yEEn"),m=q("ZW9T"),g=q("1vsH"),a=q("V0Rq"),i=q("m3rI");Te.a=function(s){var l,C,v,y,R,w,x=s.editOffice,b=x===void 0?"view":x,d=s.name,u=s.data,A=s.theme,S=s.type,D=s.filename,I=s.monacoEditor,B=s.className,j=s.style,z=s.close,M=s.onClose,N=s.hasMask,Y=s.disabledDownload,ee=s.onImgDimensions,le=s.otherData,fe=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Oe=Object(W.a)(fe,2),Se=Oe[0],ke=Oe[1],Le=Object(L.useState)(""),Ae=Object(W.a)(Le,2),ge=Ae[0],he=Ae[1],re=Object(L.useState)(),de=Object(W.a)(re,2),se=de[0],De=de[1],ie=window.ENV==="build"?"/react/build":"",ae=location.host.startsWith("localhost")?i.a.PROXY_SERVER:i.a.API_SERVER,me,we=1024*1024,Me=10*we,Fe=Object(L.useRef)();(l=u)!==null&&l!==void 0&&l.startsWith("/api")&&S!=="txt"&&(u=i.a.API_SERVER+u),S==="office"&&(me=Object(g.P)(u).filesize,me>Me&&(S="other")),D&&(I.filename=D),Object(L.useEffect)(function(){var Je,Ze,Ye=(Je=document.cookie)===null||Je===void 0||((Ze=Je.replace(/\s/g,""))===null||Ze===void 0)?void 0:Ze.split(";");Ye==null||Ye.map(function(ht){var qe=ht.split("=");qe[0]==="_educoder_session"&&he(qe[1])})},[]),Object(L.useEffect)(function(){S==="office"&&Ue()},[S,u]);var Ue=function(){var Je=Object(P.a)(O.a.mark(function Ze(){var Ye,ht,qe;return O.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return console.log("data:",u),Ye=u,u.startsWith("http")||(Ye=location.origin+Ye),ht=new URL(Ye).pathname.split("/").pop(),Ie.next=6,Object(a.U)({attachment_id:ht});case 6:qe=Ie.sent,De(qe);case 8:case"end":return Ie.stop()}},Ze)}));return function(){return Je.apply(this,arguments)}}(),Be=function(){if(u.startsWith("http")||u.startsWith("blob:")){et();return}Object(g.x)(D||"educoder",u,D)},et=function(){Object(g.v)(D||"educoder",decodeURIComponent(u))};return h.a.createElement("div",{style:Object(F.a)({},j||{}),className:"".concat(N&&T.a.bgBlack," ").concat(S?T.a.wrp:"hide")},z&&h.a.createElement("div",{className:T.a.close,ref:Fe},!!ee&&h.a.createElement(X.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return Fe.current}},h.a.createElement("span",{onClick:function(){M(),ee()}},h.a.createElement("i",{className:"icon-yulanpizhu"}))),!Y&&h.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Fe.current}},h.a.createElement("span",{onClick:et},h.a.createElement("i",{className:"icon-quxiaozhiding"}))),h.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Fe.current}},h.a.createElement("span",{className:"",onClick:M},h.a.createElement("i",{className:"icon-guanbi1"})))),h.a.createElement("div",{className:"".concat(T.a[B]," ").concat(B," ").concat(T.a.monaco," ").concat(S==="txt"?"show":"hide")},S==="txt"&&h.a.createElement(m.b,I)),S==="audio"&&h.a.createElement("audio",{src:"".concat(((C=u)===null||C===void 0?void 0:C.indexOf("http://"))>-1||((v=u)===null||v===void 0?void 0:v.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(u),autoPlay:!0}),S==="video"&&h.a.createElement(h.a.Fragment,null,((y=u)===null||y===void 0?void 0:y.indexOf("http"))>-1?h.a.createElement("video",{controls:!0,src:"".concat(u),autoPlay:!0}):h.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(u),autoPlay:!0})),S==="office"&&se&&h.a.createElement("iframe",{src:"".concat(ie,"/office.html?key=").concat(se.key,"&url=").concat(ae+se.url,"&callbackUrl=").concat(ae+se.callbackUrl,"&fileType=").concat(se.fileType,"&title=").concat(se.title,"&model=").concat(b,"&officeServer=").concat(i.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),(S==="xlsx"||S==="doc"||S==="pptx"||S==="docx")&&h.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(le.key,"&url=").concat(i.a.API_SERVER+le.url,"&callbackUrl=").concat(i.a.API_SERVER+le.callbackUrl,"&fileType=").concat(le.fileType,"&title=").concat(le.title,"&model=").concat(le.model)}),S==="html"&&h.a.createElement("iframe",{src:u+"&disposition=inline"}),S==="pdf"&&h.a.createElement("embed",{className:T.a.embed,src:u}),S==="image"&&h.a.createElement("img",{src:"".concat(((R=u)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((w=u)===null||w===void 0?void 0:w.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(u)}),S==="other"&&h.a.createElement("div",null,h.a.createElement(J.a,{type:"primary",size:"large",onClick:Be},h.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),S==="download"&&h.a.createElement(J.a,{type:"primary",size:"large",onClick:Be},h.a.createElement(p.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(pt,Te,q){},pmY6:function(pt,Te,q){"use strict";q.d(Te,"g",function(){return F}),q.d(Te,"f",function(){return P}),q.d(Te,"e",function(){return W}),q.d(Te,"h",function(){return U}),q.d(Te,"b",function(){return O}),q.d(Te,"a",function(){return L}),q.d(Te,"d",function(){return h}),q.d(Te,"c",function(){return f});var ue=!1,J="__is_disposable_tracked__";function _(T){if(!ue)return;if(T&&T!==L.None)try{T[J]=!0}catch(p){}}function X(T){if(!ue)return T;var p=new Error("Potentially leaked disposable").stack;return setTimeout(function(){T[J]||console.log(p)},3e3),T}function F(T){return typeof T.dispose=="function"&&T.dispose.length===0}function P(T){return Array.isArray(T)?(T.forEach(function(p){p&&(_(p),p.dispose())}),[]):T?(_(T),T.dispose(),T):void 0}function W(){for(var T=[],p=0;p=_.length?{done:!0}:{done:!1,value:_[P++]}},e:function(f){throw f},f:W}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U=!0,O=!1,L;return{s:function(){F=_[Symbol.iterator]()},n:function(){var f=F.next();return U=f.done,f},e:function(f){O=!0,L=f},f:function(){try{!U&&F.return!=null&&F.return()}finally{if(O)throw L}}}}},rUJ1:function(pt,Te){const q=/[&<>"']/,ue=/[&<>"']/g,J=/[<>"']|&(?!#?\w+;)/,_=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},F=w=>X[w];function P(w,x){if(x){if(q.test(w))return w.replace(ue,F)}else if(J.test(w))return w.replace(_,F);return w}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(w){return w.replace(W,(x,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const O=/(^|[^\[])\^/g;function L(w,x){w=w.source||w,x=x||"";const b={replace:(d,u)=>(u=u.source||u,u=u.replace(O,"$1"),w=w.replace(d,u),b),getRegex:()=>new RegExp(w,x)};return b}const h=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function T(w,x,b){if(w){let d;try{d=decodeURIComponent(U(b)).replace(h,"").toLowerCase()}catch(u){return null}if(d.indexOf("javascript:")===0||d.indexOf("vbscript:")===0||d.indexOf("data:")===0)return null}x&&!f.test(b)&&(b=i(x,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(d){return null}return b}const p={},m=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(w,x){p[" "+w]||(m.test(w)?p[" "+w]=w+"/":p[" "+w]=v(w,"/",!0)),w=p[" "+w];const b=w.indexOf(":")===-1;return x.substring(0,2)==="//"?b?x:w.replace(g,"$1")+x:x.charAt(0)==="/"?b?x:w.replace(a,"$1")+x:w+x}const s={exec:function(){}};function l(w){let x=1,b,d;for(;x{let I=!1,B=S;for(;--B>=0&&D[B]==="\\";)I=!I;return I?"|":" |"}),d=b.split(/ \|/);let u=0;if(d.length>x)d.splice(x);else for(;d.length"},g.a.createElement(W.a.Item,null,g.a.createElement(s.a,{to:"/classrooms/".concat(j.coursesId,"/common_homework")},ge.course_name)),g.a.createElement(W.a.Item,null,g.a.createElement(s.a,{to:"/classrooms/".concat(j.coursesId,"/common_homework")},ge.category.category_name)),g.a.createElement(W.a.Item,null,"\u7F16\u8F91")))),g.a.createElement("aside",{className:"font24 bold mt20 mb20"},"\u7F16\u8F91\u56FE\u6587\u4F5C\u4E1A"),g.a.createElement(h.a,{form:N,className:y.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(){fe(Object(U.a)({},N.getFieldsValue()))},onFinish:re},g.a.createElement("div",{className:y.a.fieldWrap},g.a.createElement(h.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},g.a.createElement(F.a,{maxLength:60,suffix:"".concat(((d=le.name)===null||d===void 0?void 0:d.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),g.a.createElement("div",{className:y.a.mdWrap},g.a.createElement(h.a.Item,{name:"description",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},g.a.createElement(l.a,{watch:!0,defaultValue:ge.description})),g.a.createElement("div",null,g.a.createElement(h.a.Item,{name:"attachment_ids"},ke&&g.a.createElement(R.b,null)))),g.a.createElement("div",{className:y.a.mdWrap},g.a.createElement(h.a.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},g.a.createElement(l.a,Object(_.a)({defaultValue:ge.reference_answer,watch:!0},"defaultValue",le.reference_answer))),g.a.createElement("div",null,g.a.createElement(h.a.Item,{name:"reference_attachment_ids"},ke&&g.a.createElement(R.b,null)))),g.a.createElement("div",{className:y.a.backgroundFa},g.a.createElement("div",{className:"pt40 mb30"},g.a.createElement(h.a.Item,null,g.a.createElement(J.a,{size:"large",type:"primary",className:"".concat(y.a.button," mr20"),htmlType:"submit",loading:D["newCourse/editCourse"]||D["newCourse/submitCourse"]},"\u63D0\u4EA4"),g.a.createElement(J.a,{size:"large",type:"primary",ghost:!0,className:y.a.button,onClick:function(){return i.d.push("/classrooms/".concat(B.params.coursesId,"/common_homework"))}},"\u53D6\u6D88"))))))};Te.default=Object(i.a)(function(x){var b=x.shixunHomeworks,d=x.newCourse,u=x.loading,A=x.globalSetting;return{shixunHomeworks:b,newCourse:d,globalSetting:A,loading:u.effects}})(w)},ulZh:function(pt,Te,q){typeof window!="undefined"&&function(J,_){pt.exports=_()}(this,function(){return function(ue){var J={};function _(X){if(J[X])return J[X].exports;var F=J[X]={i:X,l:!1,exports:{}};return ue[X].call(F.exports,F,F.exports,_),F.l=!0,F.exports}return _.m=ue,_.c=J,_.d=function(X,F,P){_.o(X,F)||Object.defineProperty(X,F,{enumerable:!0,get:P})},_.r=function(X){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(X,"__esModule",{value:!0})},_.t=function(X,F){if(F&1&&(X=_(X)),F&8)return X;if(F&4&&typeof X=="object"&&X&&X.__esModule)return X;var P=Object.create(null);if(_.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:X}),F&2&&typeof X!="string")for(var W in X)_.d(P,W,function(U){return X[U]}.bind(null,W));return P},_.n=function(X){var F=X&&X.__esModule?function(){return X.default}:function(){return X};return _.d(F,"a",F),F},_.o=function(X,F){return Object.prototype.hasOwnProperty.call(X,F)},_.p="/dist/",_(_.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ue,J,_){"use strict";var X=Object.prototype.hasOwnProperty,F="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(F=!1));function W(h,f,T){this.fn=h,this.context=f,this.once=T||!1}function U(h,f,T,p,m){if(typeof T!="function")throw new TypeError("The listener must be a function");var g=new W(T,p||h,m),a=F?F+f:f;return h._events[a]?h._events[a].fn?h._events[a]=[h._events[a],g]:h._events[a].push(g):(h._events[a]=g,h._eventsCount++),h}function O(h,f){--h._eventsCount===0?h._events=new P:delete h._events[f]}function L(){this._events=new P,this._eventsCount=0}L.prototype.eventNames=function(){var f=[],T,p;if(this._eventsCount===0)return f;for(p in T=this._events)X.call(T,p)&&f.push(F?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(T)):f},L.prototype.listeners=function(f){var T=F?F+f:f,p=this._events[T];if(!p)return[];if(p.fn)return[p.fn];for(var m=0,g=p.length,a=new Array(g);m0},!1)}function h(f,T){for(var p={main:[T]},m={main:[]},g={main:{}};L(p);)for(var a=Object.keys(p),i=0;i=2*R/x||D<=B)return;var j=Number.POSITIVE_INFINITY,z;for(z=a.level-1;z>d;z--){var M=b[z].maxBitrate;if(j=R*M/(8*.8*S),j=D)return;var N=this.bwEstimator.getEstimate();L.logger.warn("Fragment "+a.sn+(i?" part "+i.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+z+` Current BW estimate: `+(Object(X.isFiniteNumber)(N)?(N/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+D.toFixed(3)+` s Estimated load time for the next fragment: `+j.toFixed(3)+` s - Time to underbuffer: `+B.toFixed(3)+" s"),s.nextLoadLevel=z,this.bwEstimator.sample(w,y.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),s.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:i,stats:y})},m.onFragLoaded=function(a,i){var s=i.frag,l=i.part;if(s.type===O.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(s.sn)){var C=l?l.stats:s.stats,v=l?l.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var y=this.hls.levels[s.level],R=(y.loaded?y.loaded.bytes:0)+C.loaded,w=(y.loaded?y.loaded.duration:0)+v;y.loaded={bytes:R,duration:w},y.realBitrate=Math.round(8*R/w)}if(s.bitrateTest){var x={stats:C,frag:s,part:l,id:s.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,x),s.bitrateTest=!1}}},m.onFragBuffered=function(a,i){var s=i.frag,l=i.part,C=l?l.stats:s.stats;if(C.aborted)return;if(s.type!==O.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var v=C.parsing.end-C.loading.start;this.bwEstimator.sample(v,C.loaded),C.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},m.onError=function(a,i){switch(i.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},m.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},m.getNextABRAutoLevel=function(){var a=this.fragCurrent,i=this.partCurrent,s=this.hls,l=s.maxAutoLevel,C=s.config,v=s.minAutoLevel,y=s.media,R=i?i.duration:a?a.duration:0,w=y?y.currentTime:0,x=y&&y.playbackRate!==0?Math.abs(y.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():C.abrEwmaDefaultEstimate,h=(W.BufferHelper.bufferInfo(y,w,C.maxBufferHole).end-w)/x,u=this.findBestLevel(b,v,l,h,C.abrBandWidthFactor,C.abrBandWidthUpFactor);if(u>=0)return u;L.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var A=R?Math.min(R,C.maxStarvationDelay):C.maxStarvationDelay,S=C.abrBandWidthFactor,D=C.abrBandWidthUpFactor;if(!h){var I=this.bitrateTestDelay;if(I){var B=R?Math.min(R,C.maxLoadingDelay):C.maxLoadingDelay;A=B-I,L.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*A)+" ms"),S=D=1}}return u=this.findBestLevel(b,v,l,h+A,S,D),Math.max(u,0)},m.findBestLevel=function(a,i,s,l,C,v){for(var y,R=this.fragCurrent,w=this.partCurrent,x=this.lastLoadedFragLevel,b=this.hls.levels,h=b[x],u=!!(h!=null&&(y=h.details)!==null&&y!==void 0&&y.live),A=h==null?void 0:h.codecSet,S=w?w.duration:R?R.duration:0,D=s;D>=i;D--){var I=b[D];if(!I||A&&I.codecSet!==A)continue;var B=I.details,j=(w?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||S,z=void 0;D<=x?z=C*a:z=v*a;var M=b[D].maxBitrate,N=M*j/z;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+D+"/"+Math.round(z)+"/"+M+"/"+j+"/"+l+"/"+N),z>M&&(!N||u&&!this.bitrateTestDelay||N0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),this.state=F.State.IDLE):(this.loadedmetadata=!1,this.state=F.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},x.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_TRACK:{var h,u=this.levels,A=this.trackId,S=u==null||((h=u[A])===null||h===void 0)?void 0:h.details;if(S){if(this.waitForCdnTuneIn(S))break;this.state=F.State.WAITING_INIT_PTS}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var D,I=performance.now(),B=this.retryDate;(!B||I>=B||(D=this.media)!==null&&D!==void 0&&D.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=F.State.IDLE);break}case F.State.WAITING_INIT_PTS:{var j=this.waitingData;if(j){var z=j.frag,M=j.part,N=j.cache,Y=j.complete;if(this.initPTS[z.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.FRAG_LOADING;var ee=N.flush(),le={frag:z,part:M,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(le),Y&&R.prototype._handleFragmentLoadComplete.call(this,le)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+z.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),Oe=W.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Se=Object(m.fragmentWithinToleranceTest)(Oe.end,this.config.maxFragLookUpTolerance,z);Se<0&&(i.logger.log("Waiting fragment cc ("+z.cc+") @ "+z.start+" cancelled because another fragment at "+Oe.end+" is needed"),this.clearWaitingFragment())}}else this.state=F.State.IDLE}}this.onTickEnd()},x.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.IDLE)},x.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var u=this.mediaBuffer?this.mediaBuffer:h,A=u.buffered;!this.loadedmetadata&&A.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},x.doTickIdle=function(){var h,u,A=this.hls,S=this.levels,D=this.media,I=this.trackId,B=A.config;if(!S||!S[I])return;if(!D&&(this.startFragRequested||!B.startFragPrefetch))return;var j=S[I],z=j.details;if(!z||z.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(z)){this.state=F.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,d.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(M===null)return;var N=M.len,Y=this.getMaxBufferLength(),ee=this.audioSwitch;if(N>=Y&&!ee)return;if(!ee&&this._streamEnded(M,z)){A.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=F.State.ENDED;return}var le=z.fragments,fe=le[0].start,Oe=M.end;if(ee){var Se=this.getLoadPosition();Oe=Se,z.PTSKnown&&Sefe||M.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),D.currentTime=fe+.05))}var ke=this.getNextFragment(Oe,z);if(!ke){this.bufferFlushed=!0;return}((h=ke.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((u=ke.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(ke,z):this.loadFragment(ke,z,Oe)},x.getMaxBufferLength=function(){var h=R.prototype.getMaxBufferLength.call(this),u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return u===null?h:Math.max(h,u.len)},x.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},x.onAudioTracksUpdated=function(h,u){var A=u.audioTracks;this.resetTransmuxer(),this.levels=A.map(function(S){return new O.Level(S)})},x.onAudioTrackSwitching=function(h,u){var A=!!u.url;this.trackId=u.id;var S=this.fragCurrent;S!=null&&S.loader&&S.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),A?this.setInterval(v):this.resetTransmuxer(),A?(this.audioSwitch=!0,this.state=F.State.IDLE):this.state=F.State.STOPPED,this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},x.onLevelLoaded=function(h,u){this.mainDetails=u.details},x.onAudioTrackLoaded=function(h,u){var A,S=this.levels,D=u.details,I=u.id;if(!S){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+D.startSN+","+D.endSN+"],duration:"+D.totalduration);var B=S[I],j=0;if(D.live||(A=B.details)!==null&&A!==void 0&&A.live){var z=this.mainDetails;if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed||!z)return;!B.details&&D.hasProgramDateTime&&z.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(D,z),j=D.fragments[0].start):j=this.alignPlaylists(D,B.details)}B.details=D,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!D.live)&&this.setStartPosition(B.details,j),this.state===F.State.WAITING_TRACK&&!this.waitForCdnTuneIn(D)&&(this.state=F.State.IDLE),this.tick()},x._handleFragmentLoadProgress=function(h){var u,A=h.frag,S=h.part,D=h.payload,I=this.config,B=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+A.sn+" of level "+A.level+" will not be buffered");return}var z=j[B];console.assert(z,"Audio track is defined on fragment load progress");var M=z.details;console.assert(M,"Audio track details are defined on fragment load progress");var N=I.defaultAudioCodec||z.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new T.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[A.cc],le=(u=A.initSegment)===null||u===void 0?void 0:u.data;if(ee!==void 0){var fe=!1,Oe=S?S.index:-1,Se=Oe!==-1,ke=new p.ChunkMetadata(A.level,A.sn,A.stats.chunkCount,D.byteLength,Oe,Se);Y.push(D,le,N,"",A,S,M.totalduration,fe,ke,ee)}else{i.logger.log("Unknown video PTS for cc "+A.cc+", waiting for video PTS before demuxing audio frag "+A.sn+" of ["+M.startSN+" ,"+M.endSN+"],track "+B);var Le=this.waitingData=this.waitingData||{frag:A,part:S,cache:new f.default,complete:!1},Ae=Le.cache;Ae.push(new Uint8Array(D)),this.waitingVideoCC=this.videoTrackCC,this.state=F.State.WAITING_INIT_PTS}},x._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,h)},x.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},x.onBufferCreated=function(h,u){var A=u.tracks.audio;A&&(this.mediaBuffer=A.buffer),u.tracks.video&&(this.videoBuffer=u.tracks.video.buffer)},x.onFragBuffered=function(h,u){var A=u.frag,S=u.part;if(A.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(A)){this.warn("Fragment "+A.sn+(S?" p: "+S.index:"")+" of level "+A.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}A.sn!=="initSegment"&&(this.fragPrevious=A,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(A,S)},x.onError=function(h,u){switch(u.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,u);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==F.State.ERROR&&this.state!==F.State.STOPPED&&(this.state=u.fatal?F.State.ERROR:F.State.IDLE,this.warn(u.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="audio"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var A=!0,S=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);S&&S.len>.5&&(A=!this.reduceMaxBufferLength(S.len)),A&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},x.onBufferFlushed=function(h,u){var A=u.type;A===d.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},x._handleTransmuxComplete=function(h){var u,A="audio",S=this.hls,D=h.remuxResult,I=h.chunkMeta,B=this.getCurrentContext(I);if(!B){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var j=B.frag,z=B.part,M=D.audio,N=D.text,Y=D.id3,ee=D.initSegment;if(this.fragContextChanged(j))return;if(this.state=F.State.PARSING,this.audioSwitch&&M&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,j,I),S.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:A,tracks:ee.tracks})),M){var le=M.startPTS,fe=M.endPTS,Oe=M.startDTS,Se=M.endDTS;z&&(z.elementaryStreams[d.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:fe,startDTS:Oe,endDTS:Se}),j.setElementaryStreamInfo(d.ElementaryStreamTypes.AUDIO,le,fe,Oe,Se),this.bufferFragmentData(M,j,z,I)}if(Y!=null&&(u=Y.samples)!==null&&u!==void 0&&u.length){var ke=s({frag:j,id:A},Y);S.trigger(P.Events.FRAG_PARSING_METADATA,ke)}if(N){var Le=s({frag:j,id:A},N);S.trigger(P.Events.FRAG_PARSING_USERDATA,Le)}},x._bufferInitSegment=function(h,u,A){if(this.state!==F.State.PARSING)return;h.video&&delete h.video;var S=h.audio;if(!S)return;S.levelCodec=S.codec,S.id="audio",this.log("Init audio buffer, container:"+S.container+", codecs[parsed]=["+S.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,h);var D=S.initSegment;if(D!=null&&D.byteLength){var I={type:"audio",frag:u,part:null,chunkMeta:A,parent:u.type,data:D};this.hls.trigger(P.Events.BUFFER_APPENDING,I)}this.tick()},x.loadFragment=function(h,u,A){var S=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||S===U.FragmentState.NOT_LOADED||S===U.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):u.live&&!Object(X.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=F.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,h,u,A)))},x.completeAudioSwitch=function(){var h=this.hls,u=this.media,A=this.trackId;u&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:A})},w}(F.default);J.default=y},"./src/controller/audio-track-controller.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/events.ts"),F=_("./src/errors.ts"),P=_("./src/controller/base-playlist-controller.ts"),W=_("./src/types/loader.ts");function U(T,p){for(var m=0;m=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=i[this.trackId];this.log("Now switching to audio-track index "+a);var l=i[a],C=l.id,v=l.groupId,y=v===void 0?"":v,R=l.name,w=l.type,x=l.url;if(this.trackId=a,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:y,name:R,type:w,url:x}),l.details&&!l.details.live)return;var b=this.switchParams(l.url,s==null?void 0:s.details);this.loadPlaylist(b)},m.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,s=this.findTrackId(i)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},m.findTrackId=function(a){for(var i=this.tracksInGroup,s=0;sp.partTarget&&(l+=1)}if(Object(X.isFiniteNumber)(s))return new F.HlsUrlParameters(s,Object(X.isFiniteNumber)(l)?l:void 0,F.HlsSkip.No)}}},d.loadPlaylist=function(T){},d.shouldLoadTrack=function(T){return this.canLoad&&T&&!!T.url&&(!T.details||T.details.live)},d.playlistLoaded=function(T,p,m){var g=this,a=p.details,i=p.stats,s=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(a.advancedDateTime=Date.now()-s,a.live||m!=null&&m.live){if(a.reloaded(m),m&&this.log("live playlist "+T+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),m&&a.fragments.length>0&&Object(P.mergeDetails)(m,a),!this.canLoad||!a.live)return;var l,C=void 0,v=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var y=this.hls.config.lowLatencyMode,R=a.lastPartSn,w=a.endSN,x=a.lastPartIndex,b=x!==-1,h=R===w,u=y?0:x;b?(C=h?w+1:R,v=h?u:x+1):C=w+1;var A=a.age,S=A+a.ageHeader,D=Math.min(S-a.partTarget,a.targetduration*1.5);if(D>0){if(m&&D>m.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+m.tuneInGoal+" to: "+D+" with playlist age: "+a.age),D=0;else{var I=Math.floor(D/a.targetduration);if(C+=I,v!==void 0){var B=Math.round(D%a.targetduration/a.partTarget);v+=B}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+A.toFixed(2)+"s goal: "+D+" skip sn "+I+" to part "+v)}a.tuneInGoal=D}if(l=this.getDeliveryDirectives(a,p.deliveryDirectives,C,v),y||!h){this.loadPlaylist(l);return}}else l=this.getDeliveryDirectives(a,p.deliveryDirectives,C,v);var j=Object(P.computeReloadInterval)(a,i);C!==void 0&&a.canBlockReload&&(j-=a.partTarget||1),this.log("reload live playlist "+T+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return g.loadPlaylist(l)},j)}else this.clearTimer()},d.getDeliveryDirectives=function(T,p,m,g){var a=Object(F.getSkipValue)(T,m);return p!=null&&p.skip&&T.deltaUpdateFailed&&(m=p.msn,g=p.part,a=F.HlsSkip.No),new F.HlsUrlParameters(m,g,a)},d.retryLoadingOrFail=function(T){var p=this,m=this.hls.config,g=this.retryCount-1&&(a=T.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+T.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*m.levelLoadingRetryDelay,m.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return p.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+T.details+'"')}}else this.warn('cannot recover from error "'+T.details+'"'),this.clearTimer(),T.fatal=!0;return g},L}()},"./src/controller/base-stream-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"State",function(){return w}),_.d(J,"default",function(){return x});var X=_("./src/polyfills/number.ts"),F=_("./src/task-loop.ts"),P=_("./src/controller/fragment-tracker.ts"),W=_("./src/utils/buffer-helper.ts"),U=_("./src/utils/logger.ts"),O=_("./src/events.ts"),L=_("./src/errors.ts"),d=_("./src/types/transmuxer.ts"),f=_("./src/utils/mp4-tools.ts"),T=_("./src/utils/discontinuities.ts"),p=_("./src/controller/fragment-finders.ts"),m=_("./src/controller/level-helper.ts"),g=_("./src/loader/fragment-loader.ts"),a=_("./src/crypt/decrypter.ts"),i=_("./src/utils/time-ranges.ts"),s=_("./src/types/loader.ts");function l(b,h){for(var u=0;uee;(z0&&z&&z.key&&z.iv&&z.method==="AES-128"){var M=self.performance.now();return D.decrypter.webCryptoDecrypt(new Uint8Array(j),z.key.buffer,z.iv.buffer).then(function(N){var Y=self.performance.now();return B.trigger(O.Events.FRAG_DECRYPTED,{frag:S,payload:N,stats:{tstart:M,tdecrypt:Y}}),I.payload=N,I})}return I}).then(function(I){var B=D.fragCurrent,j=D.hls,z=D.levels;if(!z)throw new Error("init load aborted, missing levels");var M=z[S.level].details;console.assert(M,"Level details are defined when init segment is loaded");var N=S.stats;D.state=w.IDLE,D.fragLoadError=0,S.data=new Uint8Array(I.payload),N.parsing.start=N.buffering.start=self.performance.now(),N.parsing.end=N.buffering.end=self.performance.now(),I.frag===B&&j.trigger(O.Events.FRAG_BUFFERED,{stats:N,frag:B,part:null,id:S.type}),D.tick()}).catch(function(I){D.warn(I),D.resetFragmentLoading(S)})},u.fragContextChanged=function(S){var D=this.fragCurrent;return!S||!D||S.level!==D.level||S.sn!==D.sn||S.urlId!==D.urlId},u.fragBufferedComplete=function(S,D){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+S.type+" sn: "+S.sn+(D?" part: "+D.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+S.level+" "+i.default.toString(W.BufferHelper.getBuffered(I))),this.state=w.IDLE,this.tick()},u._handleFragmentLoadComplete=function(S){var D=this.transmuxer;if(!D)return;var I=S.frag,B=S.part,j=S.partsLoaded,z=!j||j.length===0||j.some(function(N){return!N}),M=new d.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,B?B.index:-1,!z);D.flush(M)},u._handleFragmentLoadProgress=function(S){},u._doFragLoad=function(S,D,I,B){var j=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(S.start,I||0),this.config.lowLatencyMode&&D){var z=D.partList;if(z&&B){I>S.end&&D.fragmentHint&&(S=D.fragmentHint);var M=this.getNextPart(z,S,I);if(M>-1){var N=z[M];return this.log("Loading part sn: "+S.sn+" p: "+N.index+" cc: "+S.cc+" of playlist ["+D.startSN+"-"+D.endSN+"] parts [0-"+M+"-"+(z.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+S.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=N.start+N.duration,this.state=w.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:S,part:z[M],targetBufferTime:I}),this.doFragPartsLoad(S,z,M,B).catch(function(Y){return j.handleFragLoadError(Y)})}else if(!S.url||this.loadedEndOfParts(z,I))return Promise.resolve(null)}}return this.log("Loading fragment "+S.sn+" cc: "+S.cc+" "+(D?"of ["+D.startSN+"-"+D.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+S.level+", target: "+parseFloat(I.toFixed(3))),Object(X.isFiniteNumber)(S.sn)&&!this.bitrateTest&&(this.nextLoadPosition=S.start+S.duration),this.state=w.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:S,targetBufferTime:I}),this.fragmentLoader.load(S,B).catch(function(Y){return j.handleFragLoadError(Y)})},u.doFragPartsLoad=function(S,D,I,B){var j=this;return new Promise(function(z,M){var N=[],Y=function ee(le){var fe=D[le];j.fragmentLoader.loadPart(S,fe,B).then(function(Oe){N[fe.index]=Oe;var Se=Oe.part;j.hls.trigger(O.Events.FRAG_LOADED,Oe);var ke=D[le+1];if(ke&&ke.fragment===S)ee(le+1);else return z({frag:S,part:Se,partsLoaded:N})}).catch(M)};Y(I)})},u.handleFragLoadError=function(S){var D=S.data;return D&&D.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(D.frag,D.part):this.hls.trigger(O.Events.ERROR,D),null},u._handleTransmuxerFlush=function(S){var D=this.getCurrentContext(S);if(!D||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var I=D.frag,B=D.part,j=D.level,z=self.performance.now();I.stats.parsing.end=z,B&&(B.stats.parsing.end=z),this.updateLevelTiming(I,B,j,S.partial)},u.getCurrentContext=function(S){var D=this.levels,I=S.level,B=S.sn,j=S.part;if(!D||!D[I])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+I+". The current chunk will not be buffered."),null;var z=D[I],M=j>-1?Object(m.getPartWith)(z,B,j):null,N=M?M.fragment:Object(m.getFragmentWithSN)(z,B,this.fragCurrent);return N?{frag:N,part:M,level:z}:null},u.bufferFragmentData=function(S,D,I,B){if(!S||this.state!==w.PARSING)return;var j=S.data1,z=S.data2,M=j;if(j&&z&&(M=Object(f.appendUint8Array)(j,z)),!M||!M.length)return;var N={type:S.type,frag:D,part:I,chunkMeta:B,parent:D.type,data:M};this.hls.trigger(O.Events.BUFFER_APPENDING,N),S.dropped&&S.independent&&!I&&this.flushBufferGap(D)},u.flushBufferGap=function(S){var D=this.media;if(!D)return;if(!W.BufferHelper.isBuffered(D,D.currentTime)){this.flushMainBuffer(0,S.start);return}var I=D.currentTime,B=W.BufferHelper.bufferInfo(D,I,0),j=S.duration,z=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),M=Math.max(Math.min(S.start-z,B.end-z),I+z);S.start-M>z&&this.flushMainBuffer(M,S.start)},u.getFwdBufferInfo=function(S,D){var I=this.config,B=this.getLoadPosition();if(!Object(X.isFiniteNumber)(B))return null;var j=W.BufferHelper.bufferInfo(S,B,I.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var z=this.fragmentTracker.getBufferedFrag(B,D);if(z&&j.nextStart=I?(D.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+D.maxMaxBufferLength+"s"),!0):!1},u.getNextFragment=function(S,D){var I,B,j=D.fragments,z=j.length;if(!z)return null;var M=this.config,N=j[0].start,Y;if(D.live){var ee=M.initialLiveManifestSize;if(z-1&&II.start&&I.loaded},u.getInitialLiveFragment=function(S,D){var I=this.fragPrevious,B=null;if(I){if(S.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),B=Object(p.findFragmentByPDT)(D,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var j=I.sn+1;if(j>=S.startSN&&j<=S.endSN){var z=D[j-S.startSN];I.cc===z.cc&&(B=z,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(p.findFragWithCC)(D,I.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var M=this.hls.liveSyncPosition;M!==null&&(B=this.getFragmentAtPosition(M,this.bitrateTest?S.fragmentEnd:S.edge,S))}return B},u.getFragmentAtPosition=function(S,D,I){var B=this.config,j=this.fragPrevious,z=I.fragments,M=I.endSN,N=I.fragmentHint,Y=B.maxFragLookUpTolerance,ee=!!(B.lowLatencyMode&&I.partList&&N);ee&&N&&!this.bitrateTest&&(z=z.concat(N),M=N.sn);var le;if(SD-Y?0:Y;le=Object(p.findFragmentByPTS)(j,z,S,fe)}else le=z[z.length-1];if(le){var Oe=le.sn-I.startSN,Se=j&&le.level===j.level,ke=z[Oe+1],Le=this.fragmentTracker.getState(le);if(Le===P.FragmentState.BACKTRACKED){le=null;for(var Ae=Oe;z[Ae]&&this.fragmentTracker.getState(z[Ae])===P.FragmentState.BACKTRACKED;)j?le=z[Ae--]:le=z[--Ae];le||(le=ke)}else j&&le.sn===j.sn&&!ee&&(Se&&(le.sn=z-D.maxFragLookUpTolerance&&j<=M;if(B!==null&&I.duration>B&&(j"+S.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+M),le}return N},u.waitForCdnTuneIn=function(S){var D=3;return S.live&&S.canBlockReload&&S.tuneInGoal>Math.max(S.partHoldBack,S.partTarget*D)},u.setStartPosition=function(S,D){var I=this.startPosition;if(I"+S))}}]),h}(F.default)},"./src/controller/buffer-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return p});var X=_("./src/polyfills/number.ts"),F=_("./src/events.ts"),P=_("./src/utils/logger.ts"),W=_("./src/errors.ts"),U=_("./src/utils/buffer-helper.ts"),O=_("./src/utils/mediasource-helper.ts"),L=_("./src/loader/fragment.ts"),d=_("./src/controller/buffer-operation-queue.ts"),f=Object(O.getMediaSource)(),T=/([ha]vc.)(?:\.[^.,]+)+/,p=function(){function m(a){var i=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 s=i.hls,l=i.media,C=i.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),l&&(i.updateMediaElementDuration(),s.trigger(F.Events.MEDIA_ATTACHED,{media:l})),C&&C.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var g=m.prototype;return g.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},g.destroy=function(){this.unregisterListeners(),this.details=null},g.registerListeners=function(){var i=this.hls;i.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(F.Events.BUFFER_RESET,this.onBufferReset,this),i.on(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(F.Events.BUFFER_EOS,this.onBufferEos,this),i.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(F.Events.FRAG_PARSED,this.onFragParsed,this),i.on(F.Events.FRAG_CHANGED,this.onFragChanged,this)},g.unregisterListeners=function(){var i=this.hls;i.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(F.Events.BUFFER_RESET,this.onBufferReset,this),i.off(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(F.Events.BUFFER_EOS,this.onBufferEos,this),i.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(F.Events.FRAG_PARSED,this.onFragParsed,this),i.off(F.Events.FRAG_CHANGED,this.onFragChanged,this)},g._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new d.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},g.onManifestParsed=function(i,s){var l=2;(s.audio&&!s.video||!s.altAudio)&&(l=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=l,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},g.onMediaAttaching=function(i,s){var l=this.media=s.media;if(l&&f){var C=this.mediaSource=new f;C.addEventListener("sourceopen",this._onMediaSourceOpen),C.addEventListener("sourceended",this._onMediaSourceEnded),C.addEventListener("sourceclose",this._onMediaSourceClose),l.src=self.URL.createObjectURL(C),this._objectUrl=l.src}},g.onMediaDetaching=function(){var i=this.media,s=this.mediaSource,l=this._objectUrl;if(s){if(P.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(C){P.logger.warn("[buffer-controller]: onMediaDetaching: "+C.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),i&&(l&&self.URL.revokeObjectURL(l),i.src===l?(i.removeAttribute("src"),i.load()):P.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(F.Events.MEDIA_DETACHED,void 0)},g.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(s){var l=i.sourceBuffer[s];try{l&&(i.removeBufferListeners(s),i.mediaSource&&i.mediaSource.removeSourceBuffer(l),i.sourceBuffer[s]=void 0)}catch(C){P.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",C)}}),this._initSourceBuffer()},g.onBufferCodecs=function(i,s){var l=this,C=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(v){if(C){var y=l.tracks[v];if(y&&typeof y.buffer.changeType=="function"){var R=s[v],w=R.codec,x=R.levelCodec,b=R.container,h=(y.levelCodec||y.codec).replace(T,"$1"),u=(x||w).replace(T,"$1");if(h!==u){var A=b+";codecs="+(x||w);l.appendChangeType(v,A)}}}else l.pendingTracks[v]=s[v]}),C)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},g.appendChangeType=function(i,s){var l=this,C=this.operationQueue,v={execute:function(){var R=l.sourceBuffer[i];R&&(P.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+s),R.changeType(s)),C.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(R){P.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",R)}};C.append(v,i)},g.onBufferAppending=function(i,s){var l=this,C=this.hls,v=this.operationQueue,y=this.tracks,R=s.data,w=s.type,x=s.frag,b=s.part,h=s.chunkMeta,u=h.buffering[w],A=self.performance.now();u.start=A;var S=x.stats.buffering,D=b?b.stats.buffering:null;S.start===0&&(S.start=A),D&&D.start===0&&(D.start=A);var I=y.audio,B=w==="audio"&&h.id===1&&(I==null?void 0:I.container)==="audio/mpeg",j={execute:function(){if(u.executeStart=self.performance.now(),B){var M=l.sourceBuffer[w];if(M){var N=x.start-M.timestampOffset;Math.abs(N)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+x.start+" (delta: "+N+") sn: "+x.sn+")"),M.timestampOffset=x.start)}}l.appendExecutor(R,w)},onStart:function(){},onComplete:function(){var M=self.performance.now();u.executeEnd=u.end=M,S.first===0&&(S.first=M),D&&D.first===0&&(D.first=M);var N=l.sourceBuffer,Y={};for(var ee in N)Y[ee]=U.BufferHelper.getBuffered(N[ee]);l.appendError=0,l.hls.trigger(F.Events.BUFFER_APPENDED,{type:w,frag:x,part:b,chunkMeta:h,parent:x.type,timeRanges:Y})},onError:function(M){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",M);var N={type:W.ErrorTypes.MEDIA_ERROR,parent:x.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:M,fatal:!1};M.code===DOMException.QUOTA_EXCEEDED_ERR?N.details=W.ErrorDetails.BUFFER_FULL_ERROR:(l.appendError++,N.details=W.ErrorDetails.BUFFER_APPEND_ERROR,l.appendError>C.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),N.fatal=!0)),C.trigger(F.Events.ERROR,N)}};v.append(j,w)},g.onBufferFlushing=function(i,s){var l=this,C=this.operationQueue,v=function(R){return{execute:l.removeExecutor.bind(l,R,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){l.hls.trigger(F.Events.BUFFER_FLUSHED,{type:R})},onError:function(x){P.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",x)}}};s.type?C.append(v(s.type),s.type):this.getSourceBufferTypes().forEach(function(y){C.append(v(y),y)})},g.onFragParsed=function(i,s){var l=this,C=s.frag,v=s.part,y=[],R=v?v.elementaryStreams:C.elementaryStreams;R[L.ElementaryStreamTypes.AUDIOVIDEO]?y.push("audiovideo"):(R[L.ElementaryStreamTypes.AUDIO]&&y.push("audio"),R[L.ElementaryStreamTypes.VIDEO]&&y.push("video"));var w=function(){var b=self.performance.now();C.stats.buffering.end=b,v&&(v.stats.buffering.end=b);var h=v?v.stats:C.stats;l.hls.trigger(F.Events.FRAG_BUFFERED,{frag:C,part:v,stats:h,id:C.type})};y.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+C.type+" level: "+C.level+" sn: "+C.sn),this.blockBuffers(w,y)},g.onFragChanged=function(i,s){this.flushBackBuffer()},g.onBufferEos=function(i,s){var l=this,C=this.getSourceBufferTypes().reduce(function(v,y){var R=l.sourceBuffer[y];return(!s.type||s.type===y)&&(R&&!R.ended&&(R.ended=!0,P.logger.log("[buffer-controller]: "+y+" sourceBuffer now EOS"))),v&&!!(!R||R.ended)},!0);C&&this.blockBuffers(function(){var v=l.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},g.onLevelUpdated=function(i,s){var l=s.details;if(!l.fragments.length)return;this.details=l,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},g.flushBackBuffer=function(){var i=this.hls,s=this.details,l=this.media,C=this.sourceBuffer;if(!l||s===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var y=s.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(X.isFiniteNumber)(y)||y<0)return;var R=l.currentTime,w=s.levelTargetDuration,x=Math.max(y,w),b=Math.floor(R/w)*w-x;v.forEach(function(h){var u=C[h];if(u){var A=U.BufferHelper.getBuffered(u);A.length>0&&b>A.start(0)&&(i.trigger(F.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),s.live&&i.trigger(F.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),i.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:h}))}})},g.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var i=this.details,s=this.hls,l=this.media,C=this.mediaSource,v=i.fragments[0].start+i.totalduration,y=l.duration,R=Object(X.isFiniteNumber)(C.duration)?C.duration:0;i.live&&s.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),C.duration=Infinity,this.updateSeekableRange(i)):(v>R&&v>y||!Object(X.isFiniteNumber)(y))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),C.duration=v)},g.updateSeekableRange=function(i){var s=this.mediaSource,l=i.fragments,C=l.length;if(C&&i.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var v=Math.max(0,l[0].start),y=Math.max(v,v+i.totalduration);s.setLiveSeekableRange(v,y)}},g.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,s=this.operationQueue,l=this.pendingTracks,C=Object.keys(l).length;if(C&&!i||C===2){this.createSourceBuffers(l),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(F.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(y){s.executeNext(y)})}},g.createSourceBuffers=function(i){var s=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");var C=0;for(var v in i)if(!s[v]){var y=i[v];if(!y)throw Error("source buffer exists for track "+v+", however track does not");var R=y.levelCodec||y.codec,w=y.container+";codecs="+R;P.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var x=s[v]=l.addSourceBuffer(w),b=v;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[v]={buffer:x,codec:R,container:y.container,levelCodec:y.levelCodec,id:y.id},C++}catch(h){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(F.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:w})}}C&&this.hls.trigger(F.Events.BUFFER_CREATED,{tracks:this.tracks})},g._onSBUpdateStart=function(i){var s=this.operationQueue,l=s.current(i);l.onStart()},g._onSBUpdateEnd=function(i){var s=this.operationQueue,l=s.current(i);l.onComplete(),s.shiftAndExecuteNext(i)},g._onSBUpdateError=function(i,s){P.logger.error("[buffer-controller]: "+i+" SourceBuffer error",s),this.hls.trigger(F.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var l=this.operationQueue.current(i);l&&l.onError(s)},g.removeExecutor=function(i,s,l){var C=this.media,v=this.mediaSource,y=this.operationQueue,R=this.sourceBuffer,w=R[i];if(!C||!v||!w){P.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),y.shiftAndExecuteNext(i);return}var x=Object(X.isFiniteNumber)(C.duration)?C.duration:Infinity,b=Object(X.isFiniteNumber)(v.duration)?v.duration:Infinity,h=Math.max(0,s),u=Math.min(l,x,b);u>h?(P.logger.log("[buffer-controller]: Removing ["+h+","+u+"] from the "+i+" SourceBuffer"),console.assert(!w.updating,i+" sourceBuffer must not be updating"),w.remove(h,u)):y.shiftAndExecuteNext(i)},g.appendExecutor=function(i,s){var l=this.operationQueue,C=this.sourceBuffer,v=C[s];if(!v){P.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(s);return}v.ended=!1,console.assert(!v.updating,s+" sourceBuffer must not be updating"),v.appendBuffer(i)},g.blockBuffers=function(i,s){var l=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var C=this.operationQueue,v=s.map(function(y){return C.appendBlocker(y)});Promise.all(v).then(function(){i(),s.forEach(function(y){var R=l.sourceBuffer[y];(!R||!R.updating)&&C.shiftAndExecuteNext(y)})})},g.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},g.addBufferListener=function(i,s,l){var C=this.sourceBuffer[i];if(!C)return;var v=l.bind(this,i);this.listeners[i].push({event:s,listener:v}),C.addEventListener(s,v)},g.removeBufferListeners=function(i){var s=this.sourceBuffer[i];if(!s)return;this.listeners[i].forEach(function(l){s.removeEventListener(l.event,l.listener)})},m}()},"./src/controller/buffer-operation-queue.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return F});var X=_("./src/utils/logger.ts"),F=function(){function P(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var W=P.prototype;return W.append=function(O,L){var d=this.queues[L];d.push(O),d.length===1&&this.buffers[L]&&this.executeNext(L)},W.insertAbort=function(O,L){var d=this.queues[L];d.unshift(O),this.executeNext(L)},W.appendBlocker=function(O){var L,d=new Promise(function(T){L=T}),f={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,O),d},W.executeNext=function(O){var L=this.buffers,d=this.queues,f=L[O],T=d[O];if(T.length){var p=T[0];try{p.execute()}catch(m){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),p.onError(m),(!f||!f.updating)&&(T.shift(),this.executeNext(O))}}},W.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},W.current=function(O){return this.queues[O][0]},P}()},"./src/controller/cap-level-controller.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/events.ts");function F(U,O){for(var L=0;L0&&this.mediaWidth>0){var d=this.hls.levels;if(d.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(d.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},O.getMaxLevel=function(d){var f=this,T=this.hls.levels;if(!T.length)return-1;var p=T.filter(function(m,g){return U.isLevelAllowed(g,f.restrictedLevels)&&g<=d});return this.clientRect=null,U.getMaxLevelByMediaSize(p,this.mediaWidth,this.mediaHeight)},O.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},O.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},O.getDimensions=function(){if(this.clientRect)return this.clientRect;var d=this.media,f={width:0,height:0};if(d){var T=d.getBoundingClientRect();f.width=T.width,f.height=T.height,!f.width&&!f.height&&(f.width=T.right-T.left||d.width||0,f.height=T.bottom-T.top||d.height||0)}return this.clientRect=f,f},U.isLevelAllowed=function(d,f){return f===void 0&&(f=[]),f.indexOf(d)===-1},U.getMaxLevelByMediaSize=function(d,f,T){if(!d||!d.length)return-1;for(var p=function(s,l){return l?s.width!==l.width||s.height!==l.height:!0},m=d.length-1,g=0;g=f||a.height>=T)&&p(a,d[g+1])){m=g;break}}return m},P(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var d=1;try{d=self.devicePixelRatio}catch(f){}return d}}]),U}();J.default=W},"./src/controller/cmcd-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return p});var X=_("./src/events.ts"),F=_("./src/types/cmcd.ts"),P=_("./src/utils/buffer-helper.ts"),W=_("./src/utils/logger.ts");function U(m,g){for(var a=0;a=m.length?{done:!0}:{done:!1,value:m[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(m,g){if(!m)return;if(typeof m=="string")return f(m,g);var a=Object.prototype.toString.call(m).slice(8,-1);if(a==="Object"&&m.constructor&&(a=m.constructor.name),a==="Map"||a==="Set")return Array.from(m);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return f(m,g)}function f(m,g){(g==null||g>m.length)&&(g=m.length);for(var a=0,i=new Array(g);as&&(s=y.bitrate)}return s>0?s:NaN},g.getBufferLength=function(i){var s=this.hls.media,l=i===F.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!l||!s)return NaN;var C=P.BufferHelper.bufferInfo(l,s.currentTime,this.config.maxBufferHole);return C.len*1e3},g.createPlaylistLoader=function(){var i=this.config.pLoader,s=this.applyPlaylistData,l=i||this.config.loader;return function(){function C(y){this.loader=void 0,this.loader=new l(y)}var v=C.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(R,w,x){s(R),this.loader.load(R,w,x)},O(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},g.createFragmentLoader=function(){var i=this.config.fLoader,s=this.applyFragmentData,l=i||this.config.loader;return function(){function C(y){this.loader=void 0,this.loader=new l(y)}var v=C.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(R,w,x){s(R),this.loader.load(R,w,x)},O(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},m.uuid=function(){var i=URL.createObjectURL(new Blob),s=i.toString();return URL.revokeObjectURL(i),s.substr(s.lastIndexOf("/")+1)},m.serialize=function(i){for(var s=[],l=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},C=function(B){return Math.round(B)},v=function(B){return C(B/100)*100},y=function(B){return encodeURIComponent(B)},R={br:C,d:C,bl:v,dl:v,mtp:v,nor:y,rtp:v,tb:C},w=Object.keys(i||{}).sort(),x=L(w),b;!(b=x()).done;){var h=b.value,u=i[h];if(!l(u))continue;if(h==="v"&&u===1)continue;if(h=="pr"&&u===1)continue;var A=R[h];A&&(u=A(u));var S=typeof u,D=void 0;h==="ot"||h==="sf"||h==="st"?D=h+"="+u:S==="boolean"?D=h:S==="number"?D=h+"="+u:D=h+"="+JSON.stringify(u),s.push(D)}return s.join(",")},m.toHeaders=function(i){for(var s=Object.keys(i),l={},C=["Object","Request","Session","Status"],v=[{},{},{},{}],y={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},R=0,w=s;RL){this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var y=L-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+y+" attempts left"),this._requestLicense(s,l)}break}},m._generateLicenseRequestChallenge=function(a,i){switch(a.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},m._requestLicense=function(a,i){P.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var l=this.getLicenseServerUrl(s.mediaKeySystemDomain),C=this._createLicenseXhr(l,a,i);P.logger.log("Sending license request to URL: "+l);var v=this._generateLicenseRequestChallenge(s,a);C.send(v)}catch(y){P.logger.error("Failure requesting DRM license: "+y),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},m.onMediaAttached=function(a,i){if(!this._emeEnabled)return;var s=i.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},m.onMediaDetached=function(){var a=this._media,i=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},m.onManifestParsed=function(a,i){if(!this._emeEnabled)return;var s=i.levels.map(function(C){return C.audioCodec}).filter(function(C){return!!C}),l=i.levels.map(function(C){return C.videoCodec}).filter(function(C){return!!C});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,s,l)},O(p,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),p}();J.default=T},"./src/controller/fps-controller.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/events.ts"),F=_("./src/utils/logger.ts"),P=function(){function W(O){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=O,this.registerListeners()}var U=W.prototype;return U.setStreamController=function(L){this.streamController=L},U.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(L,d){var f=this.hls.config;if(f.capLevelOnFPSDrop){var T=d.media instanceof self.HTMLVideoElement?d.media:null;this.media=T,T&&typeof T.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(L,d,f){var T=performance.now();if(d){if(this.lastTime){var p=T-this.lastTime,m=f-this.lastDroppedFrames,g=d-this.lastDecodedFrames,a=1e3*m/p,i=this.hls;if(i.trigger(X.Events.FPS_DROP,{currentDropped:m,currentDecoded:g,totalDroppedFrames:f}),a>0&&m>i.config.fpsDroppedMonitoringThreshold*g){var s=i.currentLevel;F.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=s)&&(s=s-1,i.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:i.currentLevel}),i.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=T,this.lastDroppedFrames=f,this.lastDecodedFrames=d}},U.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var d=L.getVideoPlaybackQuality();this.checkFPS(L,d.totalVideoFrames,d.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},W}();J.default=P},"./src/controller/fragment-finders.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"findFragmentByPDT",function(){return P}),_.d(J,"findFragmentByPTS",function(){return W}),_.d(J,"fragmentWithinToleranceTest",function(){return U}),_.d(J,"pdtWithinToleranceTest",function(){return O}),_.d(J,"findFragWithCC",function(){return L});var X=_("./src/polyfills/number.ts"),F=_("./src/utils/binary-search.ts");function P(d,f,T){if(f===null||!Array.isArray(d)||!d.length||!Object(X.isFiniteNumber)(f))return null;var p=d[0].programDateTime;if(f<(p||0))return null;var m=d[d.length-1].endProgramDateTime;if(f>=(m||0))return null;T=T||0;for(var g=0;gd&&T.start?-1:0}function O(d,f,T){var p=Math.min(f,T.duration+(T.deltaPTS?T.deltaPTS:0))*1e3,m=T.endProgramDateTime||0;return m-p>d}function L(d,f){return F.default.search(d,function(T){return T.ccf?-1:0})}},"./src/controller/fragment-tracker.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"FragmentState",function(){return P}),_.d(J,"FragmentTracker",function(){return W});var X=_("./src/events.ts"),F=_("./src/types/loader.ts"),P;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(P||(P={}));var W=function(){function L(f){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=f,this._registerListeners()}var d=L.prototype;return d._registerListeners=function(){var T=this.hls;T.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),T.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),T.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},d._unregisterListeners=function(){var T=this.hls;T.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),T.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),T.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},d.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},d.getAppendedFrag=function(T,p){if(p===F.PlaylistLevelType.MAIN){var m=this.activeFragment,g=this.activeParts;if(!m)return null;if(g)for(var a=g.length;a--;){var i=g[a],s=i?i.end:m.appendedPTS;if(i.start<=T&&s!==void 0&&T<=s)return a>9&&(this.activeParts=g.slice(a-9)),i}else if(m.start<=T&&m.appendedPTS!==void 0&&T<=m.appendedPTS)return m}return this.getBufferedFrag(T,p)},d.getBufferedFrag=function(T,p){for(var m=this.fragments,g=Object.keys(m),a=g.length;a--;){var i=m[g[a]];if((i==null?void 0:i.body.type)===p&&i.buffered){var s=i.body;if(s.start<=T&&T<=s.end)return s}}return null},d.detectEvictedFragments=function(T,p,m){var g=this;Object.keys(this.fragments).forEach(function(a){var i=g.fragments[a];if(!i)return;if(!i.buffered){i.body.type===m&&g.removeFragment(i.body);return}var s=i.range[T];if(!s)return;s.time.some(function(l){var C=!g.isTimeBuffered(l.startPTS,l.endPTS,p);return C&&g.removeFragment(i.body),C})})},d.detectPartialFragments=function(T){var p=this,m=this.timeRanges,g=T.frag,a=T.part;if(!m||g.sn==="initSegment")return;var i=O(g),s=this.fragments[i];if(!s)return;Object.keys(m).forEach(function(l){var C=g.elementaryStreams[l];if(!C)return;var v=m[l],y=a!==null||C.partial===!0;s.range[l]=p.getBufferedTimes(g,a,y,v)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},d.fragBuffered=function(T){var p=O(T),m=this.fragments[p];m&&(m.backtrack=m.loaded=null,m.buffered=!0)},d.getBufferedTimes=function(T,p,m,g){for(var a={time:[],partial:m},i=p?p.start:T.start,s=p?p.end:T.end,l=T.minEndPTS||s,C=T.maxStartPTS||i,v=0;v=y&&l<=R){a.time.push({startPTS:Math.max(i,g.start(v)),endPTS:Math.min(s,g.end(v))});break}else if(iy)a.partial=!0,a.time.push({startPTS:Math.max(i,g.start(v)),endPTS:Math.min(s,g.end(v))});else if(s<=y)break}return a},d.getPartialFragment=function(T){var p=null,m,g,a,i=0,s=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach(function(C){var v=l[C];if(!v)return;U(v)&&(g=v.body.start-s,a=v.body.end+s,T>=g&&T<=a&&(m=Math.min(T-g,a-T),i<=m&&(p=v.body,i=m)))}),p},d.getState=function(T){var p=O(T),m=this.fragments[p];return m?m.buffered?U(m)?P.PARTIAL:P.OK:m.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},d.backtrack=function(T,p){var m=O(T),g=this.fragments[m];if(!g||g.backtrack)return null;var a=g.backtrack=p||g.loaded;return g.loaded=null,a},d.getBacktrackData=function(T){var p=O(T),m=this.fragments[p];if(m){var g,a=m.backtrack;if(a!=null&&(g=a.payload)!==null&&g!==void 0&&g.byteLength)return a;this.removeFragment(T)}return null},d.isTimeBuffered=function(T,p,m){for(var g,a,i=0;i=g&&p<=a)return!0;if(p<=g)return!1}return!1},d.onFragLoaded=function(T,p){var m=p.frag,g=p.part;if(m.sn==="initSegment"||m.bitrateTest||g)return;var a=O(m);this.fragments[a]={body:m,loaded:p,backtrack:null,buffered:!1,range:Object.create(null)}},d.onBufferAppended=function(T,p){var m=this,g=p.frag,a=p.part,i=p.timeRanges;if(g.type===F.PlaylistLevelType.MAIN)if(this.activeFragment=g,a){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(a)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(l){var C=i[l];if(m.detectEvictedFragments(l,C),!a)for(var v=0;vT&&g.removeFragment(s)}})},d.removeFragment=function(T){var p=O(T);T.stats.loaded=0,T.clearElementaryStreamInfo(),delete this.fragments[p]},d.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function U(L){var d,f;return L.buffered&&(((d=L.range.video)===null||d===void 0?void 0:d.partial)||((f=L.range.audio)===null||f===void 0?void 0:f.partial))}function O(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"STALL_MINIMUM_DURATION_MS",function(){return U}),_.d(J,"MAX_START_GAP_JUMP",function(){return O}),_.d(J,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),_.d(J,"SKIP_BUFFER_RANGE_START",function(){return d}),_.d(J,"default",function(){return f});var X=_("./src/utils/buffer-helper.ts"),F=_("./src/errors.ts"),P=_("./src/events.ts"),W=_("./src/utils/logger.ts"),U=250,O=2,L=.1,d=.05,f=function(){function T(m,g,a,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=m,this.media=g,this.fragmentTracker=a,this.hls=i}var p=T.prototype;return p.destroy=function(){this.hls=this.fragmentTracker=this.media=null},p.poll=function(g){var a=this.config,i=this.media,s=this.stalled,l=i.currentTime,C=i.seeking,v=this.seeking&&!C,y=!this.seeking&&C;if(this.seeking=C,l!==g){if(this.moved=!0,s!==null){if(this.stallReported){var R=self.performance.now()-s;W.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((y||v)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!X.BufferHelper.getBuffered(i).length)return;var w=X.BufferHelper.bufferInfo(i,l,0),x=w.len>0,b=w.nextStart||0;if(!x&&!b)return;if(C){var h=w.len>O,u=!b||b-l>O&&!this.fragmentTracker.getPartialFragment(l);if(h||u)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var A,S=Math.max(b,w.start||0)-l,D=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=D==null||((A=D.details)===null||A===void 0)?void 0:A.live,B=I?D.details.targetduration*2:O;if(S>0&&S<=B){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(s===null){this.stalled=j;return}var z=j-s;!C&&z>=U&&this._reportStall(w.len);var M=X.BufferHelper.bufferInfo(i,l,a.maxBufferHole);this._tryFixBufferStall(M,z)},p._tryFixBufferStall=function(g,a){var i=this.config,s=this.fragmentTracker,l=this.media,C=l.currentTime,v=s.getPartialFragment(C);if(v){var y=this._trySkipBufferHole(v);if(y)return}g.len>i.maxBufferHole&&a>i.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},p._reportStall=function(g){var a=this.hls,i=this.media,s=this.stallReported;s||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+g+")"),a.trigger(P.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}))},p._trySkipBufferHole=function(g){for(var a=this.config,i=this.hls,s=this.media,l=s.currentTime,C=0,v=X.BufferHelper.getBuffered(s),y=0;y=C&&l.05&&this.forwardBufferLength>1){var y=Math.min(2,Math.max(1,i)),R=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;T.playbackRate=Math.min(y,Math.max(1,R))}else T.playbackRate!==1&&T.playbackRate!==0&&(T.playbackRate=1)},d.estimateLiveEdge=function(){var T=this.levelDetails;return T===null?null:T.edge+T.age},d.computeLatency=function(){var T=this.estimateLiveEdge();return T===null?null:T-this.currentTime},U(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var T=this.config,p=this.levelDetails;return T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:p?T.liveMaxLatencyDurationCount*p.targetduration:0}},{key:"targetLatency",get:function(){var T=this.levelDetails;if(T===null)return null;var p=T.holdBack,m=T.partHoldBack,g=T.targetduration,a=this.config,i=a.liveSyncDuration,s=a.liveSyncDurationCount,l=a.lowLatencyMode,C=this.hls.userConfig,v=l&&m||p;(C.liveSyncDuration||C.liveSyncDurationCount||v===0)&&(v=i!==void 0?i:s*g);var y=g,R=1;return v+Math.min(this.stallCount*R,y)}},{key:"liveSyncPosition",get:function(){var T=this.estimateLiveEdge(),p=this.targetLatency,m=this.levelDetails;if(T===null||p===null||m===null)return null;var g=m.edge,a=T-p-this.edgeStalled,i=g-m.totalduration,s=g-(this.config.lowLatencyMode&&m.partTarget||m.targetduration);return Math.min(Math.max(i,a),s)}},{key:"drift",get:function(){var T=this.levelDetails;return T===null?1:T.drift}},{key:"edgeStalled",get:function(){var T=this.levelDetails;if(T===null)return 0;var p=(this.config.lowLatencyMode&&T.partTarget||T.targetduration)*3;return Math.max(T.age-p,0)}},{key:"forwardBufferLength",get:function(){var T=this.media,p=this.levelDetails;if(!T||!p)return 0;var m=T.buffered.length;return m?T.buffered.end(m-1):p.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return a});var X=_("./src/types/level.ts"),F=_("./src/events.ts"),P=_("./src/errors.ts"),W=_("./src/utils/codecs.ts"),U=_("./src/controller/level-helper.ts"),O=_("./src/controller/base-playlist-controller.ts"),L=_("./src/types/loader.ts");function d(){return d=Object.assign||function(i){for(var s=1;s0){b=R[0].bitrate,R.sort(function(z,M){return z.bitrate-M.bitrate}),this._levels=R;for(var I=0;Ithis.hls.config.fragLoadingMaxRetry&&(h=y.frag.level)):h=y.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(b=!1),h=R.level),x=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:h=y.level,x=!0;break}h!==void 0&&this.recoverLevel(y,h,x,b)},l.recoverLevel=function(v,y,R,w){var x=v.details,b=this._levels[y];if(b.loadError++,R){var h=this.retryLoadingOrFail(v);if(h)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var u=b.url.length;if(u>1&&b.loadError1){var w=(y.urlId+1)%R;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(x){x.urlId=w}),this.level=v}},l.onFragLoaded=function(v,y){var R=y.frag;if(R!==void 0&&R.type===L.PlaylistLevelType.MAIN){var w=this._levels[R.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},l.onLevelLoaded=function(v,y){var R,w=y.level,x=y.details,b=this._levels[w];if(!b){var h;this.warn("Invalid level index "+w),(h=y.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(x.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(w,y,b.details)):(R=y.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(x.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(v,y){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var w=-1,x=this.hls.audioTracks[y.id].groupId,b=0;b0){var w=R.urlId,x=R.url[w];if(v)try{x=v.addDirectives(x)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+y+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+w+" "+x),this.clearTimer(),this.hls.trigger(F.Events.LEVEL_LOADING,{url:x,level:y,id:w,deliveryDirectives:v||null})}},l.removeLevel=function(v,y){var R=function(b,h){return h!==y},w=this._levels.filter(function(x,b){return b!==v?!0:x.url.length>1&&y!==void 0?(x.url=x.url.filter(R),x.audioGroupIds&&(x.audioGroupIds=x.audioGroupIds.filter(R)),x.textGroupIds&&(x.textGroupIds=x.textGroupIds.filter(R)),x.urlId=0,!0):!1}).map(function(x,b){var h=x.details;return h!=null&&h.fragments&&h.fragments.forEach(function(u){u.level=b}),x});this._levels=w,this.hls.trigger(F.Events.LEVELS_UPDATED,{levels:w})},T(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var y,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===v&&(y=R[v])!==null&&y!==void 0&&y.details)return;if(v<0||v>=R.length){var w=v<0;if(this.hls.trigger(F.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:w,reason:"invalid level idx"}),w)return;v=Math.min(v,R.length-1)}this.clearTimer();var x=this.currentLevelIndex,b=R[x],h=R[v];this.log("switching to level "+v+" from "+x),this.currentLevelIndex=v;var u=d({},h,{level:v,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete u._urlId,this.hls.trigger(F.Events.LEVEL_SWITCHING,u);var A=h.details;if(!A||A.live){var S=this.switchParams(h.uri,b==null?void 0:b.details);this.loadPlaylist(S)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),s}(O.default)},"./src/controller/level-helper.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"addGroupId",function(){return P}),_.d(J,"assignTrackIdsByGroup",function(){return W}),_.d(J,"updatePTS",function(){return U}),_.d(J,"updateFragPTSDTS",function(){return L}),_.d(J,"mergeDetails",function(){return d}),_.d(J,"mapPartIntersection",function(){return f}),_.d(J,"mapFragmentIntersection",function(){return T}),_.d(J,"adjustSliding",function(){return p}),_.d(J,"addSliding",function(){return m}),_.d(J,"computeReloadInterval",function(){return g}),_.d(J,"getFragmentWithSN",function(){return a}),_.d(J,"getPartWith",function(){return i});var X=_("./src/polyfills/number.ts"),F=_("./src/utils/logger.ts");function P(s,l,C){switch(l){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(C);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(C);break}}function W(s){var l={};s.forEach(function(C){var v=C.groupId||"";C.id=l[v]=l[v]||0,l[v]++})}function U(s,l,C){var v=s[l],y=s[C];O(v,y)}function O(s,l){var C=l.startPTS;if(Object(X.isFiniteNumber)(C)){var v=0,y;l.sn>s.sn?(v=C-s.start,y=s):(v=s.start-C,y=l),y.duration!==v&&(y.duration=v)}else if(l.sn>s.sn){var R=s.cc===l.cc;R&&s.minEndPTS?l.start=s.start+(s.minEndPTS-s.start):l.start=s.start+s.duration}else l.start=Math.max(s.start-l.duration,0)}function L(s,l,C,v,y,R){var w=v-C;w<=0&&(F.logger.warn("Fragment should have a positive duration",l),v=C+l.duration,R=y+l.duration);var x=C,b=v,h=l.startPTS,u=l.endPTS;if(Object(X.isFiniteNumber)(h)){var A=Math.abs(h-C);Object(X.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(A,l.deltaPTS):l.deltaPTS=A,x=Math.max(C,h),C=Math.min(C,h),y=Math.min(y,l.startDTS),b=Math.min(v,u),v=Math.max(v,u),R=Math.max(R,l.endDTS)}l.duration=v-C;var S=C-l.start;l.appendedPTS=v,l.start=l.startPTS=C,l.maxStartPTS=x,l.startDTS=y,l.endPTS=v,l.minEndPTS=b,l.endDTS=R;var D=l.sn;if(!s||Ds.endSN)return 0;var I,B=D-s.startSN,j=s.fragments;for(j[B]=l,I=B;I>0;I--)O(j[I],j[I-1]);for(I=B;I=0;y--){var R=v[y].initSegment;if(R){C=R;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var w=0,x;if(T(s,l,function(I,B){I.relurl&&(w=I.cc-B.cc),Object(X.isFiniteNumber)(I.startPTS)&&Object(X.isFiniteNumber)(I.endPTS)&&(B.start=B.startPTS=I.startPTS,B.startDTS=I.startDTS,B.appendedPTS=I.appendedPTS,B.maxStartPTS=I.maxStartPTS,B.endPTS=I.endPTS,B.endDTS=I.endDTS,B.minEndPTS=I.minEndPTS,B.duration=I.endPTS-I.startPTS,B.duration&&(x=B),l.PTSKnown=l.alignedSliding=!0),B.elementaryStreams=I.elementaryStreams,B.loader=I.loader,B.stats=I.stats,B.urlId=I.urlId,I.initSegment&&(B.initSegment=I.initSegment,C=I.initSegment)}),C){var b=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;b.forEach(function(I){var B;(!I.initSegment||I.initSegment.relurl===((B=C)===null||B===void 0?void 0:B.relurl))&&(I.initSegment=C)})}if(l.skippedSegments&&(l.deltaUpdateFailed=l.fragments.some(function(I){return!I}),l.deltaUpdateFailed)){F.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=l.skippedSegments;h--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}var u=l.fragments;if(w){F.logger.warn("discontinuity sliding from playlist, take drift into account");for(var A=0;A=v.length)return;m(l,v[C].start)}function m(s,l){if(l){for(var C=s.fragments,v=s.skippedSegments;v0&&y0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),b=h),this.state=F.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=F.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,y.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_LEVEL:{var b,h=this.levels,u=this.level,A=h==null||((b=h[u])===null||b===void 0)?void 0:b.details;if(A&&(!A.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(A))break;this.state=F.State.IDLE;break}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var S,D=self.performance.now(),I=this.retryDate;(!I||D>=I||(S=this.media)!==null&&S!==void 0&&S.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=F.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){y.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var b,h,u=this.hls,A=this.levelLastLoaded,S=this.levels,D=this.media,I=u.config,B=u.nextLoadLevel;if(A===null||!D&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!S||!S[B])return;var j=S[B];this.level=u.nextLoadLevel=B;var z=j.details;if(!z||this.state===F.State.WAITING_LEVEL||z.live&&this.levelLastLoaded!==B){this.state=F.State.WAITING_LEVEL;return}var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:D,L.PlaylistLevelType.MAIN);if(M===null)return;var N=M.len,Y=this.getMaxBufferLength(j.maxBitrate);if(N>=Y)return;if(this._streamEnded(M,z)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,ee),this.state=F.State.ENDED;return}var le=M.end,fe=this.getNextFragment(le,z);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var Oe=fe.sn-z.startSN;Oe>1&&(fe=z.fragments[Oe-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===O.FragmentState.OK&&this.nextLoadPosition>le){var Se=this.audioOnly&&!this.altAudio?d.ElementaryStreamTypes.AUDIO:d.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(D,Se,L.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,z)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((b=fe.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((h=fe.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(fe,z):this.loadFragment(fe,z,le)},w.loadFragment=function(b,h,u){var A,S=this.fragmentTracker.getState(b);if(this.fragCurrent=b,S===O.FragmentState.BACKTRACKED){var D=this.fragmentTracker.getBacktrackData(b);if(D){this._handleFragmentLoadProgress(D),this._handleFragmentLoadComplete(D);return}else S=O.FragmentState.NOT_LOADED}S===O.FragmentState.NOT_LOADED||S===O.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,y.prototype.loadFragment.call(this,b,h,u)):S===O.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((A=this.media)===null||A===void 0?void 0:A.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(b){var h=this.fragmentTracker.getAppendedFrag(b,L.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},w.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,L.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var b=this.levels,h=this.media;if(h!=null&&h.readyState){var u,A=this.getAppendedFrag(h.currentTime);if(A&&A.start>1&&this.flushMainBuffer(0,A.start-1),!h.paused&&b){var S=this.hls.nextLoadLevel,D=b[S],I=this.fragLastKbps;I&&this.fragCurrent?u=this.fragCurrent.duration*D.maxBitrate/(1e3*I)+1:u=0}else u=0;var B=this.getBufferedFrag(h.currentTime+u);if(B){var j=this.followingBufferedFrag(B);if(j){this.abortCurrentFrag();var z=j.maxStartPTS?j.maxStartPTS:j.start,M=j.duration,N=Math.max(B.end,z+Math.min(Math.max(M-this.config.maxFragLookUpTolerance,M*.5),M*.75));this.flushMainBuffer(N,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===F.State.KEY_LOADING&&(this.state=F.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(b,h){y.prototype.flushMainBuffer.call(this,b,h,this.altAudio?"video":null)},w.onMediaAttached=function(b,h){y.prototype.onMediaAttached.call(this,b,h);var u=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),u.addEventListener("playing",this.onvplaying),u.addEventListener("seeked",this.onvseeked),this.gapController=new p.default(this.config,u,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),y.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var b=this.media,h=b?b.currentTime:null;Object(X.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(b,h){var u=!1,A=!1,S;h.levels.forEach(function(D){S=D.audioCodec,S&&(S.indexOf("mp4a.40.2")!==-1&&(u=!0),S.indexOf("mp4a.40.5")!==-1&&(A=!0))}),this.audioCodecSwitch=u&&A&&!Object(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},w.onLevelLoading=function(b,h){var u=this.levels;if(!u||this.state!==F.State.IDLE)return;var A=u[h.level];(!A.details||A.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(A.details))&&(this.state=F.State.WAITING_LEVEL)},w.onLevelLoaded=function(b,h){var u,A=this.levels,S=h.level,D=h.details,I=D.totalduration;if(!A){this.warn("Levels were reset while loading level "+S);return}this.log("Level "+S+" loaded ["+D.startSN+","+D.endSN+"], cc ["+D.startCC+", "+D.endCC+"] duration:"+I);var B=this.fragCurrent;B&&(this.state===F.State.FRAG_LOADING||this.state===F.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==h.level&&B.loader&&(this.state=F.State.IDLE,B.loader.abort()));var j=A[S],z=0;if(D.live||(u=j.details)!==null&&u!==void 0&&u.live){if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed)return;z=this.alignPlaylists(D,j.details)}if(j.details=D,this.levelLastLoaded=S,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:D,level:S}),this.state===F.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(D))return;this.state=F.State.IDLE}this.startFragRequested?D.live&&this.synchronizeToLiveEdge(D):this.setStartPosition(D,z),this.tick()},w._handleFragmentLoadProgress=function(b){var h,u=b.frag,A=b.part,S=b.payload,D=this.levels;if(!D){this.warn("Levels were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered");return}var I=D[u.level],B=I.details;if(!B){this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset");return}var j=I.videoCodec,z=B.PTSKnown||!B.live,M=(h=u.initSegment)===null||h===void 0?void 0:h.data,N=this._getAudioCodec(I),Y=this.transmuxer=this.transmuxer||new f.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=A?A.index:-1,le=ee!==-1,fe=new T.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,S.byteLength,ee,le),Oe=this.initPTS[u.cc];Y.push(S,M,N,j,u,A,B.totalduration,z,fe,Oe)},w.onAudioTrackSwitching=function(b,h){var u=this.altAudio,A=!!h.url,S=h.id;if(!A){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var D=this.fragCurrent;D!=null&&D.loader&&(this.log("Switching to main audio track, cancel main fragment load"),D.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;u&&I.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:S})}},w.onAudioTrackSwitched=function(b,h){var u=h.id,A=!!this.hls.audioTracks[u].url;if(A){var S=this.videoBuffer;S&&this.mediaBuffer!==S&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=S)}this.altAudio=A,this.tick()},w.onBufferCreated=function(b,h){var u=h.tracks,A,S,D=!1;for(var I in u){var B=u[I];if(B.id==="main"){if(S=I,A=B,I==="video"){var j=u[I];j&&(this.videoBuffer=j.buffer)}}else D=!0}D&&A?(this.log("Alternate track found, use "+S+".buffered to schedule main fragment loading"),this.mediaBuffer=A.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(b,h){var u=h.frag,A=h.part;if(u&&u.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(u)){this.warn("Fragment "+u.sn+(A?" p: "+A.index:"")+" of level "+u.level+" finished buffering, but was aborted. state: "+this.state),this.state===F.State.PARSED&&(this.state=F.State.IDLE);return}var S=A?A.stats:u.stats;this.fragLastKbps=Math.round(8*S.total/(S.buffering.end-S.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,A)},w.onError=function(b,h){switch(h.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,h);break;case m.ErrorDetails.LEVEL_LOAD_ERROR:case m.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==F.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=F.State.ERROR):!h.levelRetry&&this.state===F.State.WAITING_LEVEL&&(this.state=F.State.IDLE));break;case m.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var u=!0,A=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);A&&A.len>.5&&(u=!this.reduceMaxBufferLength(A.len)),u&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var b=this.media,h=this.gapController;if(!b||!h||!b.readyState)return;var u=U.BufferHelper.getBuffered(b);!this.loadedmetadata&&u.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=F.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(b,h){var u=h.type;if(u!==d.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var A=(u===d.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(A,u,L.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(b,h){this.levels=h.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var b=this.media,h=b.currentTime,u=this.startPosition;if(u>=0&&h0&&(D1&&b.seeking===!1){var u=b.currentTime;if(U.BufferHelper.isBuffered(b,u)?h=this.getAppendedFrag(u):U.BufferHelper.isBuffered(b,u+.1)&&(h=this.getAppendedFrag(u+.1)),h){var A=this.fragPlaying,S=h.level;(!A||h.sn!==A.sn||A.level!==S||h.urlId!==A.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:h}),(!A||A.level!==S)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:S}),this.fragPlaying=h)}}},i(R,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var h=this.getAppendedFrag(b.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var h=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(F.default)},"./src/controller/subtitle-stream-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"SubtitleStreamController",function(){return s});var X=_("./src/events.ts"),F=_("./src/utils/logger.ts"),P=_("./src/utils/buffer-helper.ts"),W=_("./src/controller/fragment-finders.ts"),U=_("./src/utils/discontinuities.ts"),O=_("./src/controller/level-helper.ts"),L=_("./src/controller/fragment-tracker.ts"),d=_("./src/controller/base-stream-controller.ts"),f=_("./src/types/loader.ts"),T=_("./src/types/level.ts");function p(l,C){for(var v=0;v=h[S].start&&A<=h[S].end){u=h[S];break}var D=x.start+x.duration;u?u.end=D:(u={start:A,end:D},h.push(u)),this.fragmentTracker.fragBuffered(x)},v.onBufferFlushing=function(R,w){var x=w.startOffset,b=w.endOffset;if(x===0&&b!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,u=this.levels;if(!u.length||!u[h]||!u[h].details)return;var A=u[h].details,S=A.targetduration,D=b-S;if(D<=0)return;w.endOffsetSubtitles=Math.max(0,D),this.tracksBuffered.forEach(function(I){for(var B=0;B=A.length||h!==u||!S)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(x=S.details)!==null&&x!==void 0&&x.live){var D=this.mainDetails;if(b.deltaUpdateFailed||!D)return;var I=D.fragments[0];if(!S.details)b.hasProgramDateTime&&D.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(b,D):I&&Object(O.addSliding)(b,I.start);else{var B=this.alignPlaylists(b,S.details);B===0&&I&&Object(O.addSliding)(b,I.start)}}if(S.details=b,this.levelLastLoaded=h,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===d.State.IDLE){var j=Object(W.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),S.details=void 0)}},v._handleFragmentLoadComplete=function(R){var w=R.frag,x=R.payload,b=w.decryptdata,h=this.hls;if(this.fragContextChanged(w))return;if(x&&x.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var u=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(x),b.key.buffer,b.iv.buffer).then(function(A){var S=performance.now();h.trigger(X.Events.FRAG_DECRYPTED,{frag:w,payload:A,stats:{tstart:u,tdecrypt:S}})})}},v.doTick=function(){if(!this.media){this.state=d.State.IDLE;return}if(this.state===d.State.IDLE){var R,w=this.currentTrackId,x=this.levels;if(!x.length||!x[w]||!x[w].details)return;var b=x[w].details,h=b.targetduration,u=this.config,A=this.media,S=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,A.currentTime-h,u.maxBufferHole),D=S.end,I=S.len,B=this.getMaxBufferLength()+h;if(I>B)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var j=b.fragments,z=j.length,M=b.edge,N,Y=this.fragPrevious;if(D-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)},g.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},g.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var i=T(this.media.textTracks);i.forEach(function(s){Object(F.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},g.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},g.onManifestParsed=function(i,s){this.tracks=s.subtitleTracks},g.onSubtitleTrackLoaded=function(i,s){var l=s.id,C=s.details,v=this.trackId,y=this.tracksInGroup[v];if(!y){this.warn("Invalid subtitle track id "+l);return}var R=y.details;y.details=s.details,this.log("subtitle track "+l+" loaded ["+C.startSN+"-"+C.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,s,R))},g.onLevelLoading=function(i,s){this.switchLevel(s.level)},g.onLevelSwitching=function(i,s){this.switchLevel(s.level)},g.switchLevel=function(i){var s=this.hls.levels[i];if(!(s!=null&&s.textGroupIds))return;var l=s.textGroupIds[s.urlId];if(this.groupId!==l){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(w){return!l||w.groupId===l});this.tracksInGroup=v;var y=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=l;var R={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,R),y!==-1&&this.setSubtitleTrack(y,C)}},g.findTrackId=function(i){for(var s=this.tracksInGroup,l=0;l=C.length)return;this.clearTimer();var v=C[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,v){var y=v.id,R=v.groupId,w=R===void 0?"":R,x=v.name,b=v.type,h=v.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:y,groupId:w,name:x,type:b,url:h});var u=this.switchParams(v.url,s==null?void 0:s.details);this.loadPlaylist(u)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:i})},g.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,s=T(this.media.textTracks),l=0;l=0&&(b[0]=Math.min(b[0],C),b[1]=Math.max(b[1],v),w=!0,h/(v-C)>.5))return}if(w||R.push([C,v]),this.config.renderTextTracksNatively){var u=this.captionsTracks[l];this.Cues.newCue(u,C,v,y)}else{var A=this.Cues.newCue(null,C,v,y);this.hls.trigger(F.Events.CUES_PARSED,{type:"captions",cues:A,track:l})}},i.onInitPtsFound=function(l,C){var v=this,y=C.frag,R=C.id,w=C.initPTS,x=C.timescale,b=this.unparsedVttFrags;R==="main"&&(this.initPTS[y.cc]=w,this.timescale[y.cc]=x),b.length&&(this.unparsedVttFrags=[],b.forEach(function(h){v.onFragLoaded(F.Events.FRAG_LOADED,h)}))},i.getExistingTrack=function(l){var C=this.media;if(C)for(var v=0;v>>8^x&255^99,L[y]=x,d[x]=y;var b=v[y],h=v[b],u=v[h],A=v[x]*257^x*16843008;T[y]=A<<24|A>>>8,p[y]=A<<16|A>>>16,m[y]=A<<8|A>>>24,g[y]=A,A=u*16843009^h*65537^b*257^y*16843008,i[x]=A<<24|A>>>8,s[x]=A<<16|A>>>16,l[x]=A<<8|A>>>24,C[x]=A,y?(y=b^v[v[v[u^b]]],R^=v[v[R]]):y=R=1}},U.expandKey=function(L){for(var d=this.uint8ArrayToUint32Array_(L),f=!0,T=0;T>>6)+1;var A=(l[C+2]&60)>>>2;if(A>u.length-1){s.trigger(P.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+A});return}return w=(l[C+2]&1)<<2,w|=(l[C+3]&192)>>>6,X.logger.log("manifest codec:"+v+", ADTS type:"+y+", samplingIndex:"+A),/firefox/i.test(b)?A>=6?(y=5,x=new Array(4),R=A-3):(y=2,x=new Array(2),R=A):b.indexOf("android")!==-1?(y=2,x=new Array(2),R=A):(y=5,x=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&A>=6?R=A-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(A>=6&&w===1||/vivaldi/i.test(b))||!v&&w===1)&&(y=2,x=new Array(2)),R=A)),x[0]=y<<3,x[0]|=(A&14)>>1,x[1]|=(A&1)<<7,x[1]|=w<<3,y===5&&(x[1]|=(R&14)>>1,x[2]=(R&1)<<7,x[2]|=2<<2,x[3]=0),{config:x,samplerate:u[A],channelCount:w,codec:"mp4a.40."+y,manifestCodec:h}}function U(s,l){return s[l]===255&&(s[l+1]&246)===240}function O(s,l){return s[l+1]&1?7:9}function L(s,l){return(s[l+3]&3)<<11|s[l+4]<<3|(s[l+5]&224)>>>5}function d(s,l){return l+5=s.length)return!1;var v=L(s,l);if(v<=C)return!1;var y=l+v;return y===s.length||f(s,y)}return!1}function m(s,l,C,v,y){if(!s.samplerate){var R=W(l,C,v,y);if(!R)return;s.config=R.config,s.samplerate=R.samplerate,s.channelCount=R.channelCount,s.codec=R.codec,s.manifestCodec=R.manifestCodec,X.logger.log("parsed codec:"+s.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function g(s){return 1024*9e4/s}function a(s,l,C,v,y){var R=O(s,l),w=L(s,l);if(w-=R,w>0){var x=C+v*y;return{headerLength:R,frameLength:w,stamp:x}}}function i(s,l,C,v,y){var R=g(s.samplerate),w=a(l,C,v,y,R);if(w){var x=w.frameLength,b=w.headerLength,h=w.stamp,u=b+x,A=Math.max(0,C+u-l.length),S;A?(S=new Uint8Array(u-b),S.set(l.subarray(C+b,l.length),0)):S=l.subarray(C+b,C+u);var D={unit:S,pts:h};return A||s.samples.push(D),{sample:D,length:u,missing:A}}}},"./src/demux/base-audio-demuxer.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"initPTSFn",function(){return L});var X=_("./src/polyfills/number.ts"),F=_("./src/demux/id3.ts"),P=_("./src/demux/dummy-demuxed-track.ts"),W=_("./src/utils/mp4-tools.ts"),U=_("./src/utils/typed-array.ts"),O=function(){function d(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=d.prototype;return f.resetInitSegment=function(p,m,g){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(p,m){return!1},f.appendFrame=function(p,m,g){},f.demux=function(p,m){this.cachedData&&(p=Object(W.appendUint8Array)(this.cachedData,p),this.cachedData=null);var g=F.getID3Data(p,0),a=g?g.length:0,i,s,l=this._audioTrack,C=this._id3Track,v=g?F.getTimeStamp(g):void 0,y=p.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(v,m)),g&&g.length>0&&C.samples.push({pts:this.initPTS,dts:this.initPTS,data:g}),s=this.initPTS;aO?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,L=O>>3,O-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},W.readBits=function(O){var L=Math.min(this.bitsAvailable,O),d=this.word>>>32-L;return O>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=O-L,L>0&&this.bitsAvailable?d<>>O)!==0)return this.word<<=O,this.bitsAvailable-=O,O;return this.loadWord(),O+this.skipLZ()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},W.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(O){for(var L=8,d=8,f,T=0;T0?y.subarray(w,w+x):void 0},W=function(y,R){var w=0;return w=(y[R]&127)<<21,w|=(y[R+1]&127)<<14,w|=(y[R+2]&127)<<7,w|=y[R+3]&127,w},U=function(y,R){return X(y,R)&&W(y,R+6)+10<=y.length-R},O=function(y){for(var R=f(y),w=0;w>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:D+=String.fromCharCode(u);break;case 12:case 13:A=y[I++],D+=String.fromCharCode((u&31)<<6|A&63);break;case 14:A=y[I++],S=y[I++],D+=String.fromCharCode((u&15)<<12|(A&63)<<6|(S&63)<<0);break;default:}}return D},s={decodeTextFrame:m},l;function C(){return!l&&typeof self.TextDecoder!="undefined"&&(l=new self.TextDecoder("utf-8")),l}},"./src/demux/mp3demuxer.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/demux/base-audio-demuxer.ts"),F=_("./src/demux/id3.ts"),P=_("./src/utils/logger.ts"),W=_("./src/demux/mpegaudio.ts");function U(d,f){d.prototype=Object.create(f.prototype),d.prototype.constructor=d,O(d,f)}function O(d,f){return O=Object.setPrototypeOf||function(p,m){return p.__proto__=m,p},O(d,f)}var L=function(d){U(f,d);function f(){return d.apply(this,arguments)||this}var T=f.prototype;return T.resetInitSegment=function(m,g,a){d.prototype.resetInitSegment.call(this,m,g,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:m,duration:a,inputTimeScale:9e4,dropped:0}},f.probe=function(m){if(!m)return!1;for(var g=F.getID3Data(m,0)||[],a=g.length,i=m.length;a0},U.demux=function(L){var d=L,f=Object(F.dummyTrack)();if(this.config.progressive){this.remainderData&&(d=Object(X.appendUint8Array)(this.remainderData,L));var T=Object(X.segmentValidRange)(d);this.remainderData=T.remainder,f.samples=T.valid||new Uint8Array}else f.samples=d;return{audioTrack:Object(F.dummyTrack)(),avcTrack:f,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},U.flush=function(){var L=Object(F.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(F.dummyTrack)(),avcTrack:L,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},U.demuxSampleAes=function(L,d,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},W}();P.minProbeByteLength=1024,J.default=P},"./src/demux/mpegaudio.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"appendFrame",function(){return O}),_.d(J,"parseHeader",function(){return L}),_.d(J,"isHeaderPattern",function(){return d}),_.d(J,"isHeader",function(){return f}),_.d(J,"canParse",function(){return T}),_.d(J,"probe",function(){return p});var X=null,F=[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],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function O(m,g,a,i,s){if(a+24>g.length)return;var l=L(g,a);if(l&&a+l.frameLength<=g.length){var C=l.samplesPerFrame*9e4/l.sampleRate,v=i+s*C,y={unit:g.subarray(a,a+l.frameLength),pts:v,dts:v};return m.config=[],m.channelCount=l.channelCount,m.samplerate=l.sampleRate,m.samples.push(y),{sample:y,length:l.frameLength,missing:0}}}function L(m,g){var a=m[g+1]>>3&3,i=m[g+1]>>1&3,s=m[g+2]>>4&15,l=m[g+2]>>2&3;if(a!==1&&s!==0&&s!==15&&l!==3){var C=m[g+2]>>1&1,v=m[g+3]>>6,y=a===3?3-i:i===3?3:4,R=F[y*14+s-1]*1e3,w=a===3?0:a===2?1:2,x=P[w*3+l],b=v===3?1:2,h=W[a][i],u=U[i],A=h*8*u,S=Math.floor(h*R/x+C)*u;if(X===null){var D=navigator.userAgent||"",I=D.match(/Chrome\/(\d+)/i);X=I?parseInt(I[1]):0}var B=!!X&&X<=87;return B&&i===2&&R>=224e3&&v===0&&(m[g+3]=m[g+3]|128),{sampleRate:x,channelCount:b,frameLength:S,samplesPerFrame:A}}}function d(m,g){return m[g]===255&&(m[g+1]&224)===224&&(m[g+1]&6)!==0}function f(m,g){return g+1=L.length){f();return}if(L[d].unit.length<32)continue;var T=this.decrypter.isSync();if(this.decryptAacSample(L,d,f,T),!T)return}},U.getAvcEncryptedData=function(L){for(var d=Math.floor((L.length-48)/160)*16+16,f=new Int8Array(d),T=0,p=32;p<=L.length-16;p+=160,T+=16)f.set(L.subarray(p,p+16),T);return f},U.getAvcDecryptedUnit=function(L,d){for(var f=new Uint8Array(d),T=0,p=32;p<=L.length-16;p+=160,T+=16)L.set(f.subarray(T,T+16),p);return L},U.decryptAvcSample=function(L,d,f,T,p,m){var g=Object(F.discardEPB)(p.data),a=this.getAvcEncryptedData(g),i=this;this.decryptBuffer(a.buffer,function(s){p.data=i.getAvcDecryptedUnit(g,s),m||i.decryptAvcSamples(L,d,f+1,T)})},U.decryptAvcSamples=function(L,d,f,T){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;d++,f=0){if(d>=L.length){T();return}for(var p=L[d].units;!(f>=p.length);f++){var m=p[f];if(m.data.length<=48||m.type!==1&&m.type!==5)continue;var g=this.decrypter.isSync();if(this.decryptAvcSample(L,d,f,T,m,g),!g)return}}},W}();J.default=P},"./src/demux/transmuxer-interface.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return p});var X=_("./node_modules/webworkify-webpack/index.js"),F=_.n(X),P=_("./src/events.ts"),W=_("./src/demux/transmuxer.ts"),U=_("./src/utils/logger.ts"),O=_("./src/errors.ts"),L=_("./src/utils/mediasource-helper.ts"),d=_("./node_modules/eventemitter3/index.js"),f=_.n(d),T=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},p=function(){function m(a,i,s,l){var C=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=a,this.id=i,this.onTransmuxComplete=s,this.onFlush=l;var v=a.config,y=function(h,u){u=u||{},u.frag=C.frag,u.id=C.id,a.trigger(h,u)};this.observer=new d.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,y),this.observer.on(P.Events.ERROR,y);var R={mp4:T.isTypeSupported("video/mp4"),mpeg:T.isTypeSupported("audio/mpeg"),mp3:T.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var x;try{x=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),x.addEventListener("message",this.onwmsg),x.onerror=function(b){a.trigger(P.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},x.postMessage({cmd:"init",typeSupported:R,vendor:w,id:i,config:JSON.stringify(v)})}catch(b){U.logger.warn("Error in worker:",b),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),x&&self.URL.revokeObjectURL(x.objectURL),this.transmuxer=new W.default(this.observer,R,v,w,i),this.worker=null}}else this.transmuxer=new W.default(this.observer,R,v,w,i)}var g=m.prototype;return g.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var l=this.observer;l&&l.removeAllListeners(),this.observer=null},g.push=function(i,s,l,C,v,y,R,w,x,b){var h=this;x.transmuxing.start=self.performance.now();var u=this.transmuxer,A=this.worker,S=y?y.start:v.start,D=v.decryptdata,I=this.frag,B=!(I&&v.cc===I.cc),j=!(I&&x.level===I.level),z=I?x.sn-I.sn:-1,M=this.part?x.part-this.part.index:1,N=!j&&(z===1||z===0&&M===1),Y=self.performance.now();(j||z||v.stats.parsing.start===0)&&(v.stats.parsing.start=Y),y&&(M||!N)&&(y.stats.parsing.start=Y);var ee=new W.TransmuxState(B,N,w,j,S);if(!N||B){U.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+x.sn+" p: "+x.part+" level: "+x.level+" id: "+x.id+` + Time to underbuffer: `+B.toFixed(3)+" s"),s.nextLoadLevel=z,this.bwEstimator.sample(w,y.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),s.trigger(P.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:i,stats:y})},m.onFragLoaded=function(a,i){var s=i.frag,l=i.part;if(s.type===O.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(s.sn)){var C=l?l.stats:s.stats,v=l?l.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var y=this.hls.levels[s.level],R=(y.loaded?y.loaded.bytes:0)+C.loaded,w=(y.loaded?y.loaded.duration:0)+v;y.loaded={bytes:R,duration:w},y.realBitrate=Math.round(8*R/w)}if(s.bitrateTest){var x={stats:C,frag:s,part:l,id:s.type};this.onFragBuffered(P.Events.FRAG_BUFFERED,x),s.bitrateTest=!1}}},m.onFragBuffered=function(a,i){var s=i.frag,l=i.part,C=l?l.stats:s.stats;if(C.aborted)return;if(s.type!==O.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var v=C.parsing.end-C.loading.start;this.bwEstimator.sample(v,C.loaded),C.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=v/1e3:this.bitrateTestDelay=0},m.onError=function(a,i){switch(i.details){case U.ErrorDetails.FRAG_LOAD_ERROR:case U.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},m.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},m.getNextABRAutoLevel=function(){var a=this.fragCurrent,i=this.partCurrent,s=this.hls,l=s.maxAutoLevel,C=s.config,v=s.minAutoLevel,y=s.media,R=i?i.duration:a?a.duration:0,w=y?y.currentTime:0,x=y&&y.playbackRate!==0?Math.abs(y.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():C.abrEwmaDefaultEstimate,d=(W.BufferHelper.bufferInfo(y,w,C.maxBufferHole).end-w)/x,u=this.findBestLevel(b,v,l,d,C.abrBandWidthFactor,C.abrBandWidthUpFactor);if(u>=0)return u;L.logger.trace((d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var A=R?Math.min(R,C.maxStarvationDelay):C.maxStarvationDelay,S=C.abrBandWidthFactor,D=C.abrBandWidthUpFactor;if(!d){var I=this.bitrateTestDelay;if(I){var B=R?Math.min(R,C.maxLoadingDelay):C.maxLoadingDelay;A=B-I,L.logger.trace("bitrate test took "+Math.round(1e3*I)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*A)+" ms"),S=D=1}}return u=this.findBestLevel(b,v,l,d+A,S,D),Math.max(u,0)},m.findBestLevel=function(a,i,s,l,C,v){for(var y,R=this.fragCurrent,w=this.partCurrent,x=this.lastLoadedFragLevel,b=this.hls.levels,d=b[x],u=!!(d!=null&&(y=d.details)!==null&&y!==void 0&&y.live),A=d==null?void 0:d.codecSet,S=w?w.duration:R?R.duration:0,D=s;D>=i;D--){var I=b[D];if(!I||A&&I.codecSet!==A)continue;var B=I.details,j=(w?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||S,z=void 0;D<=x?z=C*a:z=v*a;var M=b[D].maxBitrate,N=M*j/z;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+D+"/"+Math.round(z)+"/"+M+"/"+j+"/"+l+"/"+N),z>M&&(!N||u&&!this.bitrateTestDelay||N0&&d===-1?(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),this.state=F.State.IDLE):(this.loadedmetadata=!1,this.state=F.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()},x.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_TRACK:{var d,u=this.levels,A=this.trackId,S=u==null||((d=u[A])===null||d===void 0)?void 0:d.details;if(S){if(this.waitForCdnTuneIn(S))break;this.state=F.State.WAITING_INIT_PTS}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var D,I=performance.now(),B=this.retryDate;(!B||I>=B||(D=this.media)!==null&&D!==void 0&&D.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=F.State.IDLE);break}case F.State.WAITING_INIT_PTS:{var j=this.waitingData;if(j){var z=j.frag,M=j.part,N=j.cache,Y=j.complete;if(this.initPTS[z.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.FRAG_LOADING;var ee=N.flush(),le={frag:z,part:M,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(le),Y&&R.prototype._handleFragmentLoadComplete.call(this,le)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+z.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var fe=this.getLoadPosition(),Oe=W.BufferHelper.bufferInfo(this.mediaBuffer,fe,this.config.maxBufferHole),Se=Object(m.fragmentWithinToleranceTest)(Oe.end,this.config.maxFragLookUpTolerance,z);Se<0&&(i.logger.log("Waiting fragment cc ("+z.cc+") @ "+z.start+" cancelled because another fragment at "+Oe.end+" is needed"),this.clearWaitingFragment())}}else this.state=F.State.IDLE}}this.onTickEnd()},x.clearWaitingFragment=function(){var d=this.waitingData;d&&(this.fragmentTracker.removeFragment(d.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=F.State.IDLE)},x.onTickEnd=function(){var d=this.media;if(!d||!d.readyState)return;var u=this.mediaBuffer?this.mediaBuffer:d,A=u.buffered;!this.loadedmetadata&&A.length&&(this.loadedmetadata=!0),this.lastCurrentTime=d.currentTime},x.doTickIdle=function(){var d,u,A=this.hls,S=this.levels,D=this.media,I=this.trackId,B=A.config;if(!S||!S[I])return;if(!D&&(this.startFragRequested||!B.startFragPrefetch))return;var j=S[I],z=j.details;if(!z||z.live&&this.levelLastLoaded!==I||this.waitForCdnTuneIn(z)){this.state=F.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,h.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(M===null)return;var N=M.len,Y=this.getMaxBufferLength(),ee=this.audioSwitch;if(N>=Y&&!ee)return;if(!ee&&this._streamEnded(M,z)){A.trigger(P.Events.BUFFER_EOS,{type:"audio"}),this.state=F.State.ENDED;return}var le=z.fragments,fe=le[0].start,Oe=M.end;if(ee){var Se=this.getLoadPosition();Oe=Se,z.PTSKnown&&Sefe||M.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),D.currentTime=fe+.05))}var ke=this.getNextFragment(Oe,z);if(!ke){this.bufferFlushed=!0;return}((d=ke.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((u=ke.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(ke,z):this.loadFragment(ke,z,Oe)},x.getMaxBufferLength=function(){var d=R.prototype.getMaxBufferLength.call(this),u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return u===null?d:Math.max(d,u.len)},x.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},x.onAudioTracksUpdated=function(d,u){var A=u.audioTracks;this.resetTransmuxer(),this.levels=A.map(function(S){return new O.Level(S)})},x.onAudioTrackSwitching=function(d,u){var A=!!u.url;this.trackId=u.id;var S=this.fragCurrent;S!=null&&S.loader&&S.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),A?this.setInterval(v):this.resetTransmuxer(),A?(this.audioSwitch=!0,this.state=F.State.IDLE):this.state=F.State.STOPPED,this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},x.onLevelLoaded=function(d,u){this.mainDetails=u.details},x.onAudioTrackLoaded=function(d,u){var A,S=this.levels,D=u.details,I=u.id;if(!S){this.warn("Audio tracks were reset while loading level "+I);return}this.log("Track "+I+" loaded ["+D.startSN+","+D.endSN+"],duration:"+D.totalduration);var B=S[I],j=0;if(D.live||(A=B.details)!==null&&A!==void 0&&A.live){var z=this.mainDetails;if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed||!z)return;!B.details&&D.hasProgramDateTime&&z.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(D,z),j=D.fragments[0].start):j=this.alignPlaylists(D,B.details)}B.details=D,this.levelLastLoaded=I,!this.startFragRequested&&(this.mainDetails||!D.live)&&this.setStartPosition(B.details,j),this.state===F.State.WAITING_TRACK&&!this.waitForCdnTuneIn(D)&&(this.state=F.State.IDLE),this.tick()},x._handleFragmentLoadProgress=function(d){var u,A=d.frag,S=d.part,D=d.payload,I=this.config,B=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+A.sn+" of level "+A.level+" will not be buffered");return}var z=j[B];console.assert(z,"Audio track is defined on fragment load progress");var M=z.details;console.assert(M,"Audio track details are defined on fragment load progress");var N=I.defaultAudioCodec||z.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new T.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[A.cc],le=(u=A.initSegment)===null||u===void 0?void 0:u.data;if(ee!==void 0){var fe=!1,Oe=S?S.index:-1,Se=Oe!==-1,ke=new p.ChunkMetadata(A.level,A.sn,A.stats.chunkCount,D.byteLength,Oe,Se);Y.push(D,le,N,"",A,S,M.totalduration,fe,ke,ee)}else{i.logger.log("Unknown video PTS for cc "+A.cc+", waiting for video PTS before demuxing audio frag "+A.sn+" of ["+M.startSN+" ,"+M.endSN+"],track "+B);var Le=this.waitingData=this.waitingData||{frag:A,part:S,cache:new f.default,complete:!1},Ae=Le.cache;Ae.push(new Uint8Array(D)),this.waitingVideoCC=this.videoTrackCC,this.state=F.State.WAITING_INIT_PTS}},x._handleFragmentLoadComplete=function(d){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,d)},x.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},x.onBufferCreated=function(d,u){var A=u.tracks.audio;A&&(this.mediaBuffer=A.buffer),u.tracks.video&&(this.videoBuffer=u.tracks.video.buffer)},x.onFragBuffered=function(d,u){var A=u.frag,S=u.part;if(A.type!==L.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(A)){this.warn("Fragment "+A.sn+(S?" p: "+S.index:"")+" of level "+A.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}A.sn!=="initSegment"&&(this.fragPrevious=A,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(A,S)},x.onError=function(d,u){switch(u.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,u);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==F.State.ERROR&&this.state!==F.State.STOPPED&&(this.state=u.fatal?F.State.ERROR:F.State.IDLE,this.warn(u.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="audio"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var A=!0,S=this.getFwdBufferInfo(this.mediaBuffer,L.PlaylistLevelType.AUDIO);S&&S.len>.5&&(A=!this.reduceMaxBufferLength(S.len)),A&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},x.onBufferFlushed=function(d,u){var A=u.type;A===h.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},x._handleTransmuxComplete=function(d){var u,A="audio",S=this.hls,D=d.remuxResult,I=d.chunkMeta,B=this.getCurrentContext(I);if(!B){this.warn("The loading context changed while buffering fragment "+I.sn+" of level "+I.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(I.level);return}var j=B.frag,z=B.part,M=D.audio,N=D.text,Y=D.id3,ee=D.initSegment;if(this.fragContextChanged(j))return;if(this.state=F.State.PARSING,this.audioSwitch&&M&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,j,I),S.trigger(P.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:A,tracks:ee.tracks})),M){var le=M.startPTS,fe=M.endPTS,Oe=M.startDTS,Se=M.endDTS;z&&(z.elementaryStreams[h.ElementaryStreamTypes.AUDIO]={startPTS:le,endPTS:fe,startDTS:Oe,endDTS:Se}),j.setElementaryStreamInfo(h.ElementaryStreamTypes.AUDIO,le,fe,Oe,Se),this.bufferFragmentData(M,j,z,I)}if(Y!=null&&(u=Y.samples)!==null&&u!==void 0&&u.length){var ke=s({frag:j,id:A},Y);S.trigger(P.Events.FRAG_PARSING_METADATA,ke)}if(N){var Le=s({frag:j,id:A},N);S.trigger(P.Events.FRAG_PARSING_USERDATA,Le)}},x._bufferInitSegment=function(d,u,A){if(this.state!==F.State.PARSING)return;d.video&&delete d.video;var S=d.audio;if(!S)return;S.levelCodec=S.codec,S.id="audio",this.log("Init audio buffer, container:"+S.container+", codecs[parsed]=["+S.codec+"]"),this.hls.trigger(P.Events.BUFFER_CODECS,d);var D=S.initSegment;if(D!=null&&D.byteLength){var I={type:"audio",frag:u,part:null,chunkMeta:A,parent:u.type,data:D};this.hls.trigger(P.Events.BUFFER_APPENDING,I)}this.tick()},x.loadFragment=function(d,u,A){var S=this.fragmentTracker.getState(d);this.fragCurrent=d,(this.audioSwitch||S===U.FragmentState.NOT_LOADED||S===U.FragmentState.PARTIAL)&&(d.sn==="initSegment"?this._loadInitSegment(d):u.live&&!Object(X.isFiniteNumber)(this.initPTS[d.cc])?(this.log("Waiting for video PTS in continuity counter "+d.cc+" of live stream before loading audio fragment "+d.sn+" of level "+this.trackId),this.state=F.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,d,u,A)))},x.completeAudioSwitch=function(){var d=this.hls,u=this.media,A=this.trackId;u&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,d.trigger(P.Events.AUDIO_TRACK_SWITCHED,{id:A})},w}(F.default);J.default=y},"./src/controller/audio-track-controller.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/events.ts"),F=_("./src/errors.ts"),P=_("./src/controller/base-playlist-controller.ts"),W=_("./src/types/loader.ts");function U(T,p){for(var m=0;m=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=i[this.trackId];this.log("Now switching to audio-track index "+a);var l=i[a],C=l.id,v=l.groupId,y=v===void 0?"":v,R=l.name,w=l.type,x=l.url;if(this.trackId=a,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:y,name:R,type:w,url:x}),l.details&&!l.details.live)return;var b=this.switchParams(l.url,s==null?void 0:s.details);this.loadPlaylist(b)},m.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,s=this.findTrackId(i)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},m.findTrackId=function(a){for(var i=this.tracksInGroup,s=0;sp.partTarget&&(l+=1)}if(Object(X.isFiniteNumber)(s))return new F.HlsUrlParameters(s,Object(X.isFiniteNumber)(l)?l:void 0,F.HlsSkip.No)}}},h.loadPlaylist=function(T){},h.shouldLoadTrack=function(T){return this.canLoad&&T&&!!T.url&&(!T.details||T.details.live)},h.playlistLoaded=function(T,p,m){var g=this,a=p.details,i=p.stats,s=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(a.advancedDateTime=Date.now()-s,a.live||m!=null&&m.live){if(a.reloaded(m),m&&this.log("live playlist "+T+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),m&&a.fragments.length>0&&Object(P.mergeDetails)(m,a),!this.canLoad||!a.live)return;var l,C=void 0,v=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var y=this.hls.config.lowLatencyMode,R=a.lastPartSn,w=a.endSN,x=a.lastPartIndex,b=x!==-1,d=R===w,u=y?0:x;b?(C=d?w+1:R,v=d?u:x+1):C=w+1;var A=a.age,S=A+a.ageHeader,D=Math.min(S-a.partTarget,a.targetduration*1.5);if(D>0){if(m&&D>m.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+m.tuneInGoal+" to: "+D+" with playlist age: "+a.age),D=0;else{var I=Math.floor(D/a.targetduration);if(C+=I,v!==void 0){var B=Math.round(D%a.targetduration/a.partTarget);v+=B}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+A.toFixed(2)+"s goal: "+D+" skip sn "+I+" to part "+v)}a.tuneInGoal=D}if(l=this.getDeliveryDirectives(a,p.deliveryDirectives,C,v),y||!d){this.loadPlaylist(l);return}}else l=this.getDeliveryDirectives(a,p.deliveryDirectives,C,v);var j=Object(P.computeReloadInterval)(a,i);C!==void 0&&a.canBlockReload&&(j-=a.partTarget||1),this.log("reload live playlist "+T+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return g.loadPlaylist(l)},j)}else this.clearTimer()},h.getDeliveryDirectives=function(T,p,m,g){var a=Object(F.getSkipValue)(T,m);return p!=null&&p.skip&&T.deltaUpdateFailed&&(m=p.msn,g=p.part,a=F.HlsSkip.No),new F.HlsUrlParameters(m,g,a)},h.retryLoadingOrFail=function(T){var p=this,m=this.hls.config,g=this.retryCount-1&&(a=T.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+T.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*m.levelLoadingRetryDelay,m.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return p.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+T.details+'"')}}else this.warn('cannot recover from error "'+T.details+'"'),this.clearTimer(),T.fatal=!0;return g},L}()},"./src/controller/base-stream-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"State",function(){return w}),_.d(J,"default",function(){return x});var X=_("./src/polyfills/number.ts"),F=_("./src/task-loop.ts"),P=_("./src/controller/fragment-tracker.ts"),W=_("./src/utils/buffer-helper.ts"),U=_("./src/utils/logger.ts"),O=_("./src/events.ts"),L=_("./src/errors.ts"),h=_("./src/types/transmuxer.ts"),f=_("./src/utils/mp4-tools.ts"),T=_("./src/utils/discontinuities.ts"),p=_("./src/controller/fragment-finders.ts"),m=_("./src/controller/level-helper.ts"),g=_("./src/loader/fragment-loader.ts"),a=_("./src/crypt/decrypter.ts"),i=_("./src/utils/time-ranges.ts"),s=_("./src/types/loader.ts");function l(b,d){for(var u=0;uee;(z0&&z&&z.key&&z.iv&&z.method==="AES-128"){var M=self.performance.now();return D.decrypter.webCryptoDecrypt(new Uint8Array(j),z.key.buffer,z.iv.buffer).then(function(N){var Y=self.performance.now();return B.trigger(O.Events.FRAG_DECRYPTED,{frag:S,payload:N,stats:{tstart:M,tdecrypt:Y}}),I.payload=N,I})}return I}).then(function(I){var B=D.fragCurrent,j=D.hls,z=D.levels;if(!z)throw new Error("init load aborted, missing levels");var M=z[S.level].details;console.assert(M,"Level details are defined when init segment is loaded");var N=S.stats;D.state=w.IDLE,D.fragLoadError=0,S.data=new Uint8Array(I.payload),N.parsing.start=N.buffering.start=self.performance.now(),N.parsing.end=N.buffering.end=self.performance.now(),I.frag===B&&j.trigger(O.Events.FRAG_BUFFERED,{stats:N,frag:B,part:null,id:S.type}),D.tick()}).catch(function(I){D.warn(I),D.resetFragmentLoading(S)})},u.fragContextChanged=function(S){var D=this.fragCurrent;return!S||!D||S.level!==D.level||S.sn!==D.sn||S.urlId!==D.urlId},u.fragBufferedComplete=function(S,D){var I=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+S.type+" sn: "+S.sn+(D?" part: "+D.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+S.level+" "+i.default.toString(W.BufferHelper.getBuffered(I))),this.state=w.IDLE,this.tick()},u._handleFragmentLoadComplete=function(S){var D=this.transmuxer;if(!D)return;var I=S.frag,B=S.part,j=S.partsLoaded,z=!j||j.length===0||j.some(function(N){return!N}),M=new h.ChunkMetadata(I.level,I.sn,I.stats.chunkCount+1,0,B?B.index:-1,!z);D.flush(M)},u._handleFragmentLoadProgress=function(S){},u._doFragLoad=function(S,D,I,B){var j=this;if(I===void 0&&(I=null),!this.levels)throw new Error("frag load aborted, missing levels");if(I=Math.max(S.start,I||0),this.config.lowLatencyMode&&D){var z=D.partList;if(z&&B){I>S.end&&D.fragmentHint&&(S=D.fragmentHint);var M=this.getNextPart(z,S,I);if(M>-1){var N=z[M];return this.log("Loading part sn: "+S.sn+" p: "+N.index+" cc: "+S.cc+" of playlist ["+D.startSN+"-"+D.endSN+"] parts [0-"+M+"-"+(z.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+S.level+", target: "+parseFloat(I.toFixed(3))),this.nextLoadPosition=N.start+N.duration,this.state=w.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:S,part:z[M],targetBufferTime:I}),this.doFragPartsLoad(S,z,M,B).catch(function(Y){return j.handleFragLoadError(Y)})}else if(!S.url||this.loadedEndOfParts(z,I))return Promise.resolve(null)}}return this.log("Loading fragment "+S.sn+" cc: "+S.cc+" "+(D?"of ["+D.startSN+"-"+D.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+S.level+", target: "+parseFloat(I.toFixed(3))),Object(X.isFiniteNumber)(S.sn)&&!this.bitrateTest&&(this.nextLoadPosition=S.start+S.duration),this.state=w.FRAG_LOADING,this.hls.trigger(O.Events.FRAG_LOADING,{frag:S,targetBufferTime:I}),this.fragmentLoader.load(S,B).catch(function(Y){return j.handleFragLoadError(Y)})},u.doFragPartsLoad=function(S,D,I,B){var j=this;return new Promise(function(z,M){var N=[],Y=function ee(le){var fe=D[le];j.fragmentLoader.loadPart(S,fe,B).then(function(Oe){N[fe.index]=Oe;var Se=Oe.part;j.hls.trigger(O.Events.FRAG_LOADED,Oe);var ke=D[le+1];if(ke&&ke.fragment===S)ee(le+1);else return z({frag:S,part:Se,partsLoaded:N})}).catch(M)};Y(I)})},u.handleFragLoadError=function(S){var D=S.data;return D&&D.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(D.frag,D.part):this.hls.trigger(O.Events.ERROR,D),null},u._handleTransmuxerFlush=function(S){var D=this.getCurrentContext(S);if(!D||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var I=D.frag,B=D.part,j=D.level,z=self.performance.now();I.stats.parsing.end=z,B&&(B.stats.parsing.end=z),this.updateLevelTiming(I,B,j,S.partial)},u.getCurrentContext=function(S){var D=this.levels,I=S.level,B=S.sn,j=S.part;if(!D||!D[I])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+I+". The current chunk will not be buffered."),null;var z=D[I],M=j>-1?Object(m.getPartWith)(z,B,j):null,N=M?M.fragment:Object(m.getFragmentWithSN)(z,B,this.fragCurrent);return N?{frag:N,part:M,level:z}:null},u.bufferFragmentData=function(S,D,I,B){if(!S||this.state!==w.PARSING)return;var j=S.data1,z=S.data2,M=j;if(j&&z&&(M=Object(f.appendUint8Array)(j,z)),!M||!M.length)return;var N={type:S.type,frag:D,part:I,chunkMeta:B,parent:D.type,data:M};this.hls.trigger(O.Events.BUFFER_APPENDING,N),S.dropped&&S.independent&&!I&&this.flushBufferGap(D)},u.flushBufferGap=function(S){var D=this.media;if(!D)return;if(!W.BufferHelper.isBuffered(D,D.currentTime)){this.flushMainBuffer(0,S.start);return}var I=D.currentTime,B=W.BufferHelper.bufferInfo(D,I,0),j=S.duration,z=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),M=Math.max(Math.min(S.start-z,B.end-z),I+z);S.start-M>z&&this.flushMainBuffer(M,S.start)},u.getFwdBufferInfo=function(S,D){var I=this.config,B=this.getLoadPosition();if(!Object(X.isFiniteNumber)(B))return null;var j=W.BufferHelper.bufferInfo(S,B,I.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var z=this.fragmentTracker.getBufferedFrag(B,D);if(z&&j.nextStart=I?(D.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+D.maxMaxBufferLength+"s"),!0):!1},u.getNextFragment=function(S,D){var I,B,j=D.fragments,z=j.length;if(!z)return null;var M=this.config,N=j[0].start,Y;if(D.live){var ee=M.initialLiveManifestSize;if(z-1&&II.start&&I.loaded},u.getInitialLiveFragment=function(S,D){var I=this.fragPrevious,B=null;if(I){if(S.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+I.programDateTime),B=Object(p.findFragmentByPDT)(D,I.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var j=I.sn+1;if(j>=S.startSN&&j<=S.endSN){var z=D[j-S.startSN];I.cc===z.cc&&(B=z,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(p.findFragWithCC)(D,I.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var M=this.hls.liveSyncPosition;M!==null&&(B=this.getFragmentAtPosition(M,this.bitrateTest?S.fragmentEnd:S.edge,S))}return B},u.getFragmentAtPosition=function(S,D,I){var B=this.config,j=this.fragPrevious,z=I.fragments,M=I.endSN,N=I.fragmentHint,Y=B.maxFragLookUpTolerance,ee=!!(B.lowLatencyMode&&I.partList&&N);ee&&N&&!this.bitrateTest&&(z=z.concat(N),M=N.sn);var le;if(SD-Y?0:Y;le=Object(p.findFragmentByPTS)(j,z,S,fe)}else le=z[z.length-1];if(le){var Oe=le.sn-I.startSN,Se=j&&le.level===j.level,ke=z[Oe+1],Le=this.fragmentTracker.getState(le);if(Le===P.FragmentState.BACKTRACKED){le=null;for(var Ae=Oe;z[Ae]&&this.fragmentTracker.getState(z[Ae])===P.FragmentState.BACKTRACKED;)j?le=z[Ae--]:le=z[--Ae];le||(le=ke)}else j&&le.sn===j.sn&&!ee&&(Se&&(le.sn=z-D.maxFragLookUpTolerance&&j<=M;if(B!==null&&I.duration>B&&(j"+S.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+M),le}return N},u.waitForCdnTuneIn=function(S){var D=3;return S.live&&S.canBlockReload&&S.tuneInGoal>Math.max(S.partHoldBack,S.partTarget*D)},u.setStartPosition=function(S,D){var I=this.startPosition;if(I"+S))}}]),d}(F.default)},"./src/controller/buffer-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return p});var X=_("./src/polyfills/number.ts"),F=_("./src/events.ts"),P=_("./src/utils/logger.ts"),W=_("./src/errors.ts"),U=_("./src/utils/buffer-helper.ts"),O=_("./src/utils/mediasource-helper.ts"),L=_("./src/loader/fragment.ts"),h=_("./src/controller/buffer-operation-queue.ts"),f=Object(O.getMediaSource)(),T=/([ha]vc.)(?:\.[^.,]+)+/,p=function(){function m(a){var i=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 s=i.hls,l=i.media,C=i.mediaSource;P.logger.log("[buffer-controller]: Media source opened"),l&&(i.updateMediaElementDuration(),s.trigger(F.Events.MEDIA_ATTACHED,{media:l})),C&&C.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){P.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){P.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var g=m.prototype;return g.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},g.destroy=function(){this.unregisterListeners(),this.details=null},g.registerListeners=function(){var i=this.hls;i.on(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(F.Events.BUFFER_RESET,this.onBufferReset,this),i.on(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(F.Events.BUFFER_EOS,this.onBufferEos,this),i.on(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(F.Events.FRAG_PARSED,this.onFragParsed,this),i.on(F.Events.FRAG_CHANGED,this.onFragChanged,this)},g.unregisterListeners=function(){var i=this.hls;i.off(F.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(F.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(F.Events.BUFFER_RESET,this.onBufferReset,this),i.off(F.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(F.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(F.Events.BUFFER_EOS,this.onBufferEos,this),i.off(F.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(F.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(F.Events.FRAG_PARSED,this.onFragParsed,this),i.off(F.Events.FRAG_CHANGED,this.onFragChanged,this)},g._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new h.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},g.onManifestParsed=function(i,s){var l=2;(s.audio&&!s.video||!s.altAudio)&&(l=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=l,this.details=null,P.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},g.onMediaAttaching=function(i,s){var l=this.media=s.media;if(l&&f){var C=this.mediaSource=new f;C.addEventListener("sourceopen",this._onMediaSourceOpen),C.addEventListener("sourceended",this._onMediaSourceEnded),C.addEventListener("sourceclose",this._onMediaSourceClose),l.src=self.URL.createObjectURL(C),this._objectUrl=l.src}},g.onMediaDetaching=function(){var i=this.media,s=this.mediaSource,l=this._objectUrl;if(s){if(P.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(C){P.logger.warn("[buffer-controller]: onMediaDetaching: "+C.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),i&&(l&&self.URL.revokeObjectURL(l),i.src===l?(i.removeAttribute("src"),i.load()):P.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(F.Events.MEDIA_DETACHED,void 0)},g.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(s){var l=i.sourceBuffer[s];try{l&&(i.removeBufferListeners(s),i.mediaSource&&i.mediaSource.removeSourceBuffer(l),i.sourceBuffer[s]=void 0)}catch(C){P.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",C)}}),this._initSourceBuffer()},g.onBufferCodecs=function(i,s){var l=this,C=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(v){if(C){var y=l.tracks[v];if(y&&typeof y.buffer.changeType=="function"){var R=s[v],w=R.codec,x=R.levelCodec,b=R.container,d=(y.levelCodec||y.codec).replace(T,"$1"),u=(x||w).replace(T,"$1");if(d!==u){var A=b+";codecs="+(x||w);l.appendChangeType(v,A)}}}else l.pendingTracks[v]=s[v]}),C)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},g.appendChangeType=function(i,s){var l=this,C=this.operationQueue,v={execute:function(){var R=l.sourceBuffer[i];R&&(P.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+s),R.changeType(s)),C.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(R){P.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",R)}};C.append(v,i)},g.onBufferAppending=function(i,s){var l=this,C=this.hls,v=this.operationQueue,y=this.tracks,R=s.data,w=s.type,x=s.frag,b=s.part,d=s.chunkMeta,u=d.buffering[w],A=self.performance.now();u.start=A;var S=x.stats.buffering,D=b?b.stats.buffering:null;S.start===0&&(S.start=A),D&&D.start===0&&(D.start=A);var I=y.audio,B=w==="audio"&&d.id===1&&(I==null?void 0:I.container)==="audio/mpeg",j={execute:function(){if(u.executeStart=self.performance.now(),B){var M=l.sourceBuffer[w];if(M){var N=x.start-M.timestampOffset;Math.abs(N)>=.1&&(P.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+x.start+" (delta: "+N+") sn: "+x.sn+")"),M.timestampOffset=x.start)}}l.appendExecutor(R,w)},onStart:function(){},onComplete:function(){var M=self.performance.now();u.executeEnd=u.end=M,S.first===0&&(S.first=M),D&&D.first===0&&(D.first=M);var N=l.sourceBuffer,Y={};for(var ee in N)Y[ee]=U.BufferHelper.getBuffered(N[ee]);l.appendError=0,l.hls.trigger(F.Events.BUFFER_APPENDED,{type:w,frag:x,part:b,chunkMeta:d,parent:x.type,timeRanges:Y})},onError:function(M){P.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",M);var N={type:W.ErrorTypes.MEDIA_ERROR,parent:x.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:M,fatal:!1};M.code===DOMException.QUOTA_EXCEEDED_ERR?N.details=W.ErrorDetails.BUFFER_FULL_ERROR:(l.appendError++,N.details=W.ErrorDetails.BUFFER_APPEND_ERROR,l.appendError>C.config.appendErrorMaxRetry&&(P.logger.error("[buffer-controller]: Failed "+C.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),N.fatal=!0)),C.trigger(F.Events.ERROR,N)}};v.append(j,w)},g.onBufferFlushing=function(i,s){var l=this,C=this.operationQueue,v=function(R){return{execute:l.removeExecutor.bind(l,R,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){l.hls.trigger(F.Events.BUFFER_FLUSHED,{type:R})},onError:function(x){P.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",x)}}};s.type?C.append(v(s.type),s.type):this.getSourceBufferTypes().forEach(function(y){C.append(v(y),y)})},g.onFragParsed=function(i,s){var l=this,C=s.frag,v=s.part,y=[],R=v?v.elementaryStreams:C.elementaryStreams;R[L.ElementaryStreamTypes.AUDIOVIDEO]?y.push("audiovideo"):(R[L.ElementaryStreamTypes.AUDIO]&&y.push("audio"),R[L.ElementaryStreamTypes.VIDEO]&&y.push("video"));var w=function(){var b=self.performance.now();C.stats.buffering.end=b,v&&(v.stats.buffering.end=b);var d=v?v.stats:C.stats;l.hls.trigger(F.Events.FRAG_BUFFERED,{frag:C,part:v,stats:d,id:C.type})};y.length===0&&P.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+C.type+" level: "+C.level+" sn: "+C.sn),this.blockBuffers(w,y)},g.onFragChanged=function(i,s){this.flushBackBuffer()},g.onBufferEos=function(i,s){var l=this,C=this.getSourceBufferTypes().reduce(function(v,y){var R=l.sourceBuffer[y];return(!s.type||s.type===y)&&(R&&!R.ended&&(R.ended=!0,P.logger.log("[buffer-controller]: "+y+" sourceBuffer now EOS"))),v&&!!(!R||R.ended)},!0);C&&this.blockBuffers(function(){var v=l.mediaSource;if(!v||v.readyState!=="open")return;v.endOfStream()})},g.onLevelUpdated=function(i,s){var l=s.details;if(!l.fragments.length)return;this.details=l,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},g.flushBackBuffer=function(){var i=this.hls,s=this.details,l=this.media,C=this.sourceBuffer;if(!l||s===null)return;var v=this.getSourceBufferTypes();if(!v.length)return;var y=s.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(X.isFiniteNumber)(y)||y<0)return;var R=l.currentTime,w=s.levelTargetDuration,x=Math.max(y,w),b=Math.floor(R/w)*w-x;v.forEach(function(d){var u=C[d];if(u){var A=U.BufferHelper.getBuffered(u);A.length>0&&b>A.start(0)&&(i.trigger(F.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),s.live&&i.trigger(F.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),i.trigger(F.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:d}))}})},g.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var i=this.details,s=this.hls,l=this.media,C=this.mediaSource,v=i.fragments[0].start+i.totalduration,y=l.duration,R=Object(X.isFiniteNumber)(C.duration)?C.duration:0;i.live&&s.config.liveDurationInfinity?(P.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),C.duration=Infinity,this.updateSeekableRange(i)):(v>R&&v>y||!Object(X.isFiniteNumber)(y))&&(P.logger.log("[buffer-controller]: Updating Media Source duration to "+v.toFixed(3)),C.duration=v)},g.updateSeekableRange=function(i){var s=this.mediaSource,l=i.fragments,C=l.length;if(C&&i.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var v=Math.max(0,l[0].start),y=Math.max(v,v+i.totalduration);s.setLiveSeekableRange(v,y)}},g.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,s=this.operationQueue,l=this.pendingTracks,C=Object.keys(l).length;if(C&&!i||C===2){this.createSourceBuffers(l),this.pendingTracks={};var v=this.getSourceBufferTypes();if(v.length===0){this.hls.trigger(F.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}v.forEach(function(y){s.executeNext(y)})}},g.createSourceBuffers=function(i){var s=this.sourceBuffer,l=this.mediaSource;if(!l)throw Error("createSourceBuffers called when mediaSource was null");var C=0;for(var v in i)if(!s[v]){var y=i[v];if(!y)throw Error("source buffer exists for track "+v+", however track does not");var R=y.levelCodec||y.codec,w=y.container+";codecs="+R;P.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var x=s[v]=l.addSourceBuffer(w),b=v;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[v]={buffer:x,codec:R,container:y.container,levelCodec:y.levelCodec,id:y.id},C++}catch(d){P.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+d.message),this.hls.trigger(F.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,mimeType:w})}}C&&this.hls.trigger(F.Events.BUFFER_CREATED,{tracks:this.tracks})},g._onSBUpdateStart=function(i){var s=this.operationQueue,l=s.current(i);l.onStart()},g._onSBUpdateEnd=function(i){var s=this.operationQueue,l=s.current(i);l.onComplete(),s.shiftAndExecuteNext(i)},g._onSBUpdateError=function(i,s){P.logger.error("[buffer-controller]: "+i+" SourceBuffer error",s),this.hls.trigger(F.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var l=this.operationQueue.current(i);l&&l.onError(s)},g.removeExecutor=function(i,s,l){var C=this.media,v=this.mediaSource,y=this.operationQueue,R=this.sourceBuffer,w=R[i];if(!C||!v||!w){P.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),y.shiftAndExecuteNext(i);return}var x=Object(X.isFiniteNumber)(C.duration)?C.duration:Infinity,b=Object(X.isFiniteNumber)(v.duration)?v.duration:Infinity,d=Math.max(0,s),u=Math.min(l,x,b);u>d?(P.logger.log("[buffer-controller]: Removing ["+d+","+u+"] from the "+i+" SourceBuffer"),console.assert(!w.updating,i+" sourceBuffer must not be updating"),w.remove(d,u)):y.shiftAndExecuteNext(i)},g.appendExecutor=function(i,s){var l=this.operationQueue,C=this.sourceBuffer,v=C[s];if(!v){P.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),l.shiftAndExecuteNext(s);return}v.ended=!1,console.assert(!v.updating,s+" sourceBuffer must not be updating"),v.appendBuffer(i)},g.blockBuffers=function(i,s){var l=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){P.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var C=this.operationQueue,v=s.map(function(y){return C.appendBlocker(y)});Promise.all(v).then(function(){i(),s.forEach(function(y){var R=l.sourceBuffer[y];(!R||!R.updating)&&C.shiftAndExecuteNext(y)})})},g.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},g.addBufferListener=function(i,s,l){var C=this.sourceBuffer[i];if(!C)return;var v=l.bind(this,i);this.listeners[i].push({event:s,listener:v}),C.addEventListener(s,v)},g.removeBufferListeners=function(i){var s=this.sourceBuffer[i];if(!s)return;this.listeners[i].forEach(function(l){s.removeEventListener(l.event,l.listener)})},m}()},"./src/controller/buffer-operation-queue.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return F});var X=_("./src/utils/logger.ts"),F=function(){function P(U){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=U}var W=P.prototype;return W.append=function(O,L){var h=this.queues[L];h.push(O),h.length===1&&this.buffers[L]&&this.executeNext(L)},W.insertAbort=function(O,L){var h=this.queues[L];h.unshift(O),this.executeNext(L)},W.appendBlocker=function(O){var L,h=new Promise(function(T){L=T}),f={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,O),h},W.executeNext=function(O){var L=this.buffers,h=this.queues,f=L[O],T=h[O];if(T.length){var p=T[0];try{p.execute()}catch(m){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),p.onError(m),(!f||!f.updating)&&(T.shift(),this.executeNext(O))}}},W.shiftAndExecuteNext=function(O){this.queues[O].shift(),this.executeNext(O)},W.current=function(O){return this.queues[O][0]},P}()},"./src/controller/cap-level-controller.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/events.ts");function F(U,O){for(var L=0;L0&&this.mediaWidth>0){var h=this.hls.levels;if(h.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(h.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},O.getMaxLevel=function(h){var f=this,T=this.hls.levels;if(!T.length)return-1;var p=T.filter(function(m,g){return U.isLevelAllowed(g,f.restrictedLevels)&&g<=h});return this.clientRect=null,U.getMaxLevelByMediaSize(p,this.mediaWidth,this.mediaHeight)},O.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},O.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},O.getDimensions=function(){if(this.clientRect)return this.clientRect;var h=this.media,f={width:0,height:0};if(h){var T=h.getBoundingClientRect();f.width=T.width,f.height=T.height,!f.width&&!f.height&&(f.width=T.right-T.left||h.width||0,f.height=T.bottom-T.top||h.height||0)}return this.clientRect=f,f},U.isLevelAllowed=function(h,f){return f===void 0&&(f=[]),f.indexOf(h)===-1},U.getMaxLevelByMediaSize=function(h,f,T){if(!h||!h.length)return-1;for(var p=function(s,l){return l?s.width!==l.width||s.height!==l.height:!0},m=h.length-1,g=0;g=f||a.height>=T)&&p(a,h[g+1])){m=g;break}}return m},P(U,[{key:"mediaWidth",get:function(){return this.getDimensions().width*U.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*U.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var h=1;try{h=self.devicePixelRatio}catch(f){}return h}}]),U}();J.default=W},"./src/controller/cmcd-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return p});var X=_("./src/events.ts"),F=_("./src/types/cmcd.ts"),P=_("./src/utils/buffer-helper.ts"),W=_("./src/utils/logger.ts");function U(m,g){for(var a=0;a=m.length?{done:!0}:{done:!1,value:m[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h(m,g){if(!m)return;if(typeof m=="string")return f(m,g);var a=Object.prototype.toString.call(m).slice(8,-1);if(a==="Object"&&m.constructor&&(a=m.constructor.name),a==="Map"||a==="Set")return Array.from(m);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return f(m,g)}function f(m,g){(g==null||g>m.length)&&(g=m.length);for(var a=0,i=new Array(g);as&&(s=y.bitrate)}return s>0?s:NaN},g.getBufferLength=function(i){var s=this.hls.media,l=i===F.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!l||!s)return NaN;var C=P.BufferHelper.bufferInfo(l,s.currentTime,this.config.maxBufferHole);return C.len*1e3},g.createPlaylistLoader=function(){var i=this.config.pLoader,s=this.applyPlaylistData,l=i||this.config.loader;return function(){function C(y){this.loader=void 0,this.loader=new l(y)}var v=C.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(R,w,x){s(R),this.loader.load(R,w,x)},O(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},g.createFragmentLoader=function(){var i=this.config.fLoader,s=this.applyFragmentData,l=i||this.config.loader;return function(){function C(y){this.loader=void 0,this.loader=new l(y)}var v=C.prototype;return v.destroy=function(){this.loader.destroy()},v.abort=function(){this.loader.abort()},v.load=function(R,w,x){s(R),this.loader.load(R,w,x)},O(C,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),C}()},m.uuid=function(){var i=URL.createObjectURL(new Blob),s=i.toString();return URL.revokeObjectURL(i),s.substr(s.lastIndexOf("/")+1)},m.serialize=function(i){for(var s=[],l=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},C=function(B){return Math.round(B)},v=function(B){return C(B/100)*100},y=function(B){return encodeURIComponent(B)},R={br:C,d:C,bl:v,dl:v,mtp:v,nor:y,rtp:v,tb:C},w=Object.keys(i||{}).sort(),x=L(w),b;!(b=x()).done;){var d=b.value,u=i[d];if(!l(u))continue;if(d==="v"&&u===1)continue;if(d=="pr"&&u===1)continue;var A=R[d];A&&(u=A(u));var S=typeof u,D=void 0;d==="ot"||d==="sf"||d==="st"?D=d+"="+u:S==="boolean"?D=d:S==="number"?D=d+"="+u:D=d+"="+JSON.stringify(u),s.push(D)}return s.join(",")},m.toHeaders=function(i){for(var s=Object.keys(i),l={},C=["Object","Request","Session","Status"],v=[{},{},{},{}],y={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},R=0,w=s;RL){this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var y=L-this._requestLicenseFailureCount+1;P.logger.warn("Retrying license request, "+y+" attempts left"),this._requestLicense(s,l)}break}},m._generateLicenseRequestChallenge=function(a,i){switch(a.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},m._requestLicense=function(a,i){P.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){P.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var l=this.getLicenseServerUrl(s.mediaKeySystemDomain),C=this._createLicenseXhr(l,a,i);P.logger.log("Sending license request to URL: "+l);var v=this._generateLicenseRequestChallenge(s,a);C.send(v)}catch(y){P.logger.error("Failure requesting DRM license: "+y),this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.KEY_SYSTEM_ERROR,details:F.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},m.onMediaAttached=function(a,i){if(!this._emeEnabled)return;var s=i.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},m.onMediaDetached=function(){var a=this._media,i=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},m.onManifestParsed=function(a,i){if(!this._emeEnabled)return;var s=i.levels.map(function(C){return C.audioCodec}).filter(function(C){return!!C}),l=i.levels.map(function(C){return C.videoCodec}).filter(function(C){return!!C});this._attemptKeySystemAccess(W.KeySystems.WIDEVINE,s,l)},O(p,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),p}();J.default=T},"./src/controller/fps-controller.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/events.ts"),F=_("./src/utils/logger.ts"),P=function(){function W(O){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=O,this.registerListeners()}var U=W.prototype;return U.setStreamController=function(L){this.streamController=L},U.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},U.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},U.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},U.onMediaAttaching=function(L,h){var f=this.hls.config;if(f.capLevelOnFPSDrop){var T=h.media instanceof self.HTMLVideoElement?h.media:null;this.media=T,T&&typeof T.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},U.checkFPS=function(L,h,f){var T=performance.now();if(h){if(this.lastTime){var p=T-this.lastTime,m=f-this.lastDroppedFrames,g=h-this.lastDecodedFrames,a=1e3*m/p,i=this.hls;if(i.trigger(X.Events.FPS_DROP,{currentDropped:m,currentDecoded:g,totalDroppedFrames:f}),a>0&&m>i.config.fpsDroppedMonitoringThreshold*g){var s=i.currentLevel;F.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=s)&&(s=s-1,i.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:i.currentLevel}),i.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=T,this.lastDroppedFrames=f,this.lastDecodedFrames=h}},U.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var h=L.getVideoPlaybackQuality();this.checkFPS(L,h.totalVideoFrames,h.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},W}();J.default=P},"./src/controller/fragment-finders.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"findFragmentByPDT",function(){return P}),_.d(J,"findFragmentByPTS",function(){return W}),_.d(J,"fragmentWithinToleranceTest",function(){return U}),_.d(J,"pdtWithinToleranceTest",function(){return O}),_.d(J,"findFragWithCC",function(){return L});var X=_("./src/polyfills/number.ts"),F=_("./src/utils/binary-search.ts");function P(h,f,T){if(f===null||!Array.isArray(h)||!h.length||!Object(X.isFiniteNumber)(f))return null;var p=h[0].programDateTime;if(f<(p||0))return null;var m=h[h.length-1].endProgramDateTime;if(f>=(m||0))return null;T=T||0;for(var g=0;gh&&T.start?-1:0}function O(h,f,T){var p=Math.min(f,T.duration+(T.deltaPTS?T.deltaPTS:0))*1e3,m=T.endProgramDateTime||0;return m-p>h}function L(h,f){return F.default.search(h,function(T){return T.ccf?-1:0})}},"./src/controller/fragment-tracker.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"FragmentState",function(){return P}),_.d(J,"FragmentTracker",function(){return W});var X=_("./src/events.ts"),F=_("./src/types/loader.ts"),P;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(P||(P={}));var W=function(){function L(f){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=f,this._registerListeners()}var h=L.prototype;return h._registerListeners=function(){var T=this.hls;T.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),T.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),T.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},h._unregisterListeners=function(){var T=this.hls;T.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),T.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),T.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},h.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},h.getAppendedFrag=function(T,p){if(p===F.PlaylistLevelType.MAIN){var m=this.activeFragment,g=this.activeParts;if(!m)return null;if(g)for(var a=g.length;a--;){var i=g[a],s=i?i.end:m.appendedPTS;if(i.start<=T&&s!==void 0&&T<=s)return a>9&&(this.activeParts=g.slice(a-9)),i}else if(m.start<=T&&m.appendedPTS!==void 0&&T<=m.appendedPTS)return m}return this.getBufferedFrag(T,p)},h.getBufferedFrag=function(T,p){for(var m=this.fragments,g=Object.keys(m),a=g.length;a--;){var i=m[g[a]];if((i==null?void 0:i.body.type)===p&&i.buffered){var s=i.body;if(s.start<=T&&T<=s.end)return s}}return null},h.detectEvictedFragments=function(T,p,m){var g=this;Object.keys(this.fragments).forEach(function(a){var i=g.fragments[a];if(!i)return;if(!i.buffered){i.body.type===m&&g.removeFragment(i.body);return}var s=i.range[T];if(!s)return;s.time.some(function(l){var C=!g.isTimeBuffered(l.startPTS,l.endPTS,p);return C&&g.removeFragment(i.body),C})})},h.detectPartialFragments=function(T){var p=this,m=this.timeRanges,g=T.frag,a=T.part;if(!m||g.sn==="initSegment")return;var i=O(g),s=this.fragments[i];if(!s)return;Object.keys(m).forEach(function(l){var C=g.elementaryStreams[l];if(!C)return;var v=m[l],y=a!==null||C.partial===!0;s.range[l]=p.getBufferedTimes(g,a,y,v)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},h.fragBuffered=function(T){var p=O(T),m=this.fragments[p];m&&(m.backtrack=m.loaded=null,m.buffered=!0)},h.getBufferedTimes=function(T,p,m,g){for(var a={time:[],partial:m},i=p?p.start:T.start,s=p?p.end:T.end,l=T.minEndPTS||s,C=T.maxStartPTS||i,v=0;v=y&&l<=R){a.time.push({startPTS:Math.max(i,g.start(v)),endPTS:Math.min(s,g.end(v))});break}else if(iy)a.partial=!0,a.time.push({startPTS:Math.max(i,g.start(v)),endPTS:Math.min(s,g.end(v))});else if(s<=y)break}return a},h.getPartialFragment=function(T){var p=null,m,g,a,i=0,s=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach(function(C){var v=l[C];if(!v)return;U(v)&&(g=v.body.start-s,a=v.body.end+s,T>=g&&T<=a&&(m=Math.min(T-g,a-T),i<=m&&(p=v.body,i=m)))}),p},h.getState=function(T){var p=O(T),m=this.fragments[p];return m?m.buffered?U(m)?P.PARTIAL:P.OK:m.backtrack?P.BACKTRACKED:P.APPENDING:P.NOT_LOADED},h.backtrack=function(T,p){var m=O(T),g=this.fragments[m];if(!g||g.backtrack)return null;var a=g.backtrack=p||g.loaded;return g.loaded=null,a},h.getBacktrackData=function(T){var p=O(T),m=this.fragments[p];if(m){var g,a=m.backtrack;if(a!=null&&(g=a.payload)!==null&&g!==void 0&&g.byteLength)return a;this.removeFragment(T)}return null},h.isTimeBuffered=function(T,p,m){for(var g,a,i=0;i=g&&p<=a)return!0;if(p<=g)return!1}return!1},h.onFragLoaded=function(T,p){var m=p.frag,g=p.part;if(m.sn==="initSegment"||m.bitrateTest||g)return;var a=O(m);this.fragments[a]={body:m,loaded:p,backtrack:null,buffered:!1,range:Object.create(null)}},h.onBufferAppended=function(T,p){var m=this,g=p.frag,a=p.part,i=p.timeRanges;if(g.type===F.PlaylistLevelType.MAIN)if(this.activeFragment=g,a){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(a)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(l){var C=i[l];if(m.detectEvictedFragments(l,C),!a)for(var v=0;vT&&g.removeFragment(s)}})},h.removeFragment=function(T){var p=O(T);T.stats.loaded=0,T.clearElementaryStreamInfo(),delete this.fragments[p]},h.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function U(L){var h,f;return L.buffered&&(((h=L.range.video)===null||h===void 0?void 0:h.partial)||((f=L.range.audio)===null||f===void 0?void 0:f.partial))}function O(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"STALL_MINIMUM_DURATION_MS",function(){return U}),_.d(J,"MAX_START_GAP_JUMP",function(){return O}),_.d(J,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),_.d(J,"SKIP_BUFFER_RANGE_START",function(){return h}),_.d(J,"default",function(){return f});var X=_("./src/utils/buffer-helper.ts"),F=_("./src/errors.ts"),P=_("./src/events.ts"),W=_("./src/utils/logger.ts"),U=250,O=2,L=.1,h=.05,f=function(){function T(m,g,a,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=m,this.media=g,this.fragmentTracker=a,this.hls=i}var p=T.prototype;return p.destroy=function(){this.hls=this.fragmentTracker=this.media=null},p.poll=function(g){var a=this.config,i=this.media,s=this.stalled,l=i.currentTime,C=i.seeking,v=this.seeking&&!C,y=!this.seeking&&C;if(this.seeking=C,l!==g){if(this.moved=!0,s!==null){if(this.stallReported){var R=self.performance.now()-s;W.logger.warn("playback not stuck anymore @"+l+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((y||v)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!X.BufferHelper.getBuffered(i).length)return;var w=X.BufferHelper.bufferInfo(i,l,0),x=w.len>0,b=w.nextStart||0;if(!x&&!b)return;if(C){var d=w.len>O,u=!b||b-l>O&&!this.fragmentTracker.getPartialFragment(l);if(d||u)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var A,S=Math.max(b,w.start||0)-l,D=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,I=D==null||((A=D.details)===null||A===void 0)?void 0:A.live,B=I?D.details.targetduration*2:O;if(S>0&&S<=B){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(s===null){this.stalled=j;return}var z=j-s;!C&&z>=U&&this._reportStall(w.len);var M=X.BufferHelper.bufferInfo(i,l,a.maxBufferHole);this._tryFixBufferStall(M,z)},p._tryFixBufferStall=function(g,a){var i=this.config,s=this.fragmentTracker,l=this.media,C=l.currentTime,v=s.getPartialFragment(C);if(v){var y=this._trySkipBufferHole(v);if(y)return}g.len>i.maxBufferHole&&a>i.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},p._reportStall=function(g){var a=this.hls,i=this.media,s=this.stallReported;s||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+g+")"),a.trigger(P.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:g}))},p._trySkipBufferHole=function(g){for(var a=this.config,i=this.hls,s=this.media,l=s.currentTime,C=0,v=X.BufferHelper.getBuffered(s),y=0;y=C&&l.05&&this.forwardBufferLength>1){var y=Math.min(2,Math.max(1,i)),R=Math.round(2/(1+Math.exp(-.75*l-this.edgeStalled))*20)/20;T.playbackRate=Math.min(y,Math.max(1,R))}else T.playbackRate!==1&&T.playbackRate!==0&&(T.playbackRate=1)},h.estimateLiveEdge=function(){var T=this.levelDetails;return T===null?null:T.edge+T.age},h.computeLatency=function(){var T=this.estimateLiveEdge();return T===null?null:T-this.currentTime},U(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var T=this.config,p=this.levelDetails;return T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:p?T.liveMaxLatencyDurationCount*p.targetduration:0}},{key:"targetLatency",get:function(){var T=this.levelDetails;if(T===null)return null;var p=T.holdBack,m=T.partHoldBack,g=T.targetduration,a=this.config,i=a.liveSyncDuration,s=a.liveSyncDurationCount,l=a.lowLatencyMode,C=this.hls.userConfig,v=l&&m||p;(C.liveSyncDuration||C.liveSyncDurationCount||v===0)&&(v=i!==void 0?i:s*g);var y=g,R=1;return v+Math.min(this.stallCount*R,y)}},{key:"liveSyncPosition",get:function(){var T=this.estimateLiveEdge(),p=this.targetLatency,m=this.levelDetails;if(T===null||p===null||m===null)return null;var g=m.edge,a=T-p-this.edgeStalled,i=g-m.totalduration,s=g-(this.config.lowLatencyMode&&m.partTarget||m.targetduration);return Math.min(Math.max(i,a),s)}},{key:"drift",get:function(){var T=this.levelDetails;return T===null?1:T.drift}},{key:"edgeStalled",get:function(){var T=this.levelDetails;if(T===null)return 0;var p=(this.config.lowLatencyMode&&T.partTarget||T.targetduration)*3;return Math.max(T.age-p,0)}},{key:"forwardBufferLength",get:function(){var T=this.media,p=this.levelDetails;if(!T||!p)return 0;var m=T.buffered.length;return m?T.buffered.end(m-1):p.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return a});var X=_("./src/types/level.ts"),F=_("./src/events.ts"),P=_("./src/errors.ts"),W=_("./src/utils/codecs.ts"),U=_("./src/controller/level-helper.ts"),O=_("./src/controller/base-playlist-controller.ts"),L=_("./src/types/loader.ts");function h(){return h=Object.assign||function(i){for(var s=1;s0){b=R[0].bitrate,R.sort(function(z,M){return z.bitrate-M.bitrate}),this._levels=R;for(var I=0;Ithis.hls.config.fragLoadingMaxRetry&&(d=y.frag.level)):d=y.frag.level}break;case P.ErrorDetails.LEVEL_LOAD_ERROR:case P.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(b=!1),d=R.level),x=!0;break;case P.ErrorDetails.REMUX_ALLOC_ERROR:d=y.level,x=!0;break}d!==void 0&&this.recoverLevel(y,d,x,b)},l.recoverLevel=function(v,y,R,w){var x=v.details,b=this._levels[y];if(b.loadError++,R){var d=this.retryLoadingOrFail(v);if(d)v.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var u=b.url.length;if(u>1&&b.loadError1){var w=(y.urlId+1)%R;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(x){x.urlId=w}),this.level=v}},l.onFragLoaded=function(v,y){var R=y.frag;if(R!==void 0&&R.type===L.PlaylistLevelType.MAIN){var w=this._levels[R.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},l.onLevelLoaded=function(v,y){var R,w=y.level,x=y.details,b=this._levels[w];if(!b){var d;this.warn("Invalid level index "+w),(d=y.deliveryDirectives)!==null&&d!==void 0&&d.skip&&(x.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(w,y,b.details)):(R=y.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(x.deltaUpdateFailed=!0)},l.onAudioTrackSwitched=function(v,y){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var w=-1,x=this.hls.audioTracks[y.id].groupId,b=0;b0){var w=R.urlId,x=R.url[w];if(v)try{x=v.addDirectives(x)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+y+(v?" at sn "+v.msn+" part "+v.part:"")+" with URL-id "+w+" "+x),this.clearTimer(),this.hls.trigger(F.Events.LEVEL_LOADING,{url:x,level:y,id:w,deliveryDirectives:v||null})}},l.removeLevel=function(v,y){var R=function(b,d){return d!==y},w=this._levels.filter(function(x,b){return b!==v?!0:x.url.length>1&&y!==void 0?(x.url=x.url.filter(R),x.audioGroupIds&&(x.audioGroupIds=x.audioGroupIds.filter(R)),x.textGroupIds&&(x.textGroupIds=x.textGroupIds.filter(R)),x.urlId=0,!0):!1}).map(function(x,b){var d=x.details;return d!=null&&d.fragments&&d.fragments.forEach(function(u){u.level=b}),x});this._levels=w,this.hls.trigger(F.Events.LEVELS_UPDATED,{levels:w})},T(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(v){var y,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===v&&(y=R[v])!==null&&y!==void 0&&y.details)return;if(v<0||v>=R.length){var w=v<0;if(this.hls.trigger(F.Events.ERROR,{type:P.ErrorTypes.OTHER_ERROR,details:P.ErrorDetails.LEVEL_SWITCH_ERROR,level:v,fatal:w,reason:"invalid level idx"}),w)return;v=Math.min(v,R.length-1)}this.clearTimer();var x=this.currentLevelIndex,b=R[x],d=R[v];this.log("switching to level "+v+" from "+x),this.currentLevelIndex=v;var u=h({},d,{level:v,maxBitrate:d.maxBitrate,uri:d.uri,urlId:d.urlId});delete u._urlId,this.hls.trigger(F.Events.LEVEL_SWITCHING,u);var A=d.details;if(!A||A.live){var S=this.switchParams(d.uri,b==null?void 0:b.details);this.loadPlaylist(S)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(v){this.manualLevelIndex=v,this._startLevel===void 0&&(this._startLevel=v),v!==-1&&(this.level=v)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(v){this._firstLevel=v}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var v=this.hls.config.startLevel;return v!==void 0?v:this._firstLevel}else return this._startLevel},set:function(v){this._startLevel=v}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(v){this.level=v,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=v)}}]),s}(O.default)},"./src/controller/level-helper.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"addGroupId",function(){return P}),_.d(J,"assignTrackIdsByGroup",function(){return W}),_.d(J,"updatePTS",function(){return U}),_.d(J,"updateFragPTSDTS",function(){return L}),_.d(J,"mergeDetails",function(){return h}),_.d(J,"mapPartIntersection",function(){return f}),_.d(J,"mapFragmentIntersection",function(){return T}),_.d(J,"adjustSliding",function(){return p}),_.d(J,"addSliding",function(){return m}),_.d(J,"computeReloadInterval",function(){return g}),_.d(J,"getFragmentWithSN",function(){return a}),_.d(J,"getPartWith",function(){return i});var X=_("./src/polyfills/number.ts"),F=_("./src/utils/logger.ts");function P(s,l,C){switch(l){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(C);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(C);break}}function W(s){var l={};s.forEach(function(C){var v=C.groupId||"";C.id=l[v]=l[v]||0,l[v]++})}function U(s,l,C){var v=s[l],y=s[C];O(v,y)}function O(s,l){var C=l.startPTS;if(Object(X.isFiniteNumber)(C)){var v=0,y;l.sn>s.sn?(v=C-s.start,y=s):(v=s.start-C,y=l),y.duration!==v&&(y.duration=v)}else if(l.sn>s.sn){var R=s.cc===l.cc;R&&s.minEndPTS?l.start=s.start+(s.minEndPTS-s.start):l.start=s.start+s.duration}else l.start=Math.max(s.start-l.duration,0)}function L(s,l,C,v,y,R){var w=v-C;w<=0&&(F.logger.warn("Fragment should have a positive duration",l),v=C+l.duration,R=y+l.duration);var x=C,b=v,d=l.startPTS,u=l.endPTS;if(Object(X.isFiniteNumber)(d)){var A=Math.abs(d-C);Object(X.isFiniteNumber)(l.deltaPTS)?l.deltaPTS=Math.max(A,l.deltaPTS):l.deltaPTS=A,x=Math.max(C,d),C=Math.min(C,d),y=Math.min(y,l.startDTS),b=Math.min(v,u),v=Math.max(v,u),R=Math.max(R,l.endDTS)}l.duration=v-C;var S=C-l.start;l.appendedPTS=v,l.start=l.startPTS=C,l.maxStartPTS=x,l.startDTS=y,l.endPTS=v,l.minEndPTS=b,l.endDTS=R;var D=l.sn;if(!s||Ds.endSN)return 0;var I,B=D-s.startSN,j=s.fragments;for(j[B]=l,I=B;I>0;I--)O(j[I],j[I-1]);for(I=B;I=0;y--){var R=v[y].initSegment;if(R){C=R;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var w=0,x;if(T(s,l,function(I,B){I.relurl&&(w=I.cc-B.cc),Object(X.isFiniteNumber)(I.startPTS)&&Object(X.isFiniteNumber)(I.endPTS)&&(B.start=B.startPTS=I.startPTS,B.startDTS=I.startDTS,B.appendedPTS=I.appendedPTS,B.maxStartPTS=I.maxStartPTS,B.endPTS=I.endPTS,B.endDTS=I.endDTS,B.minEndPTS=I.minEndPTS,B.duration=I.endPTS-I.startPTS,B.duration&&(x=B),l.PTSKnown=l.alignedSliding=!0),B.elementaryStreams=I.elementaryStreams,B.loader=I.loader,B.stats=I.stats,B.urlId=I.urlId,I.initSegment&&(B.initSegment=I.initSegment,C=I.initSegment)}),C){var b=l.fragmentHint?l.fragments.concat(l.fragmentHint):l.fragments;b.forEach(function(I){var B;(!I.initSegment||I.initSegment.relurl===((B=C)===null||B===void 0?void 0:B.relurl))&&(I.initSegment=C)})}if(l.skippedSegments&&(l.deltaUpdateFailed=l.fragments.some(function(I){return!I}),l.deltaUpdateFailed)){F.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var d=l.skippedSegments;d--;)l.fragments.shift();l.startSN=l.fragments[0].sn,l.startCC=l.fragments[0].cc}var u=l.fragments;if(w){F.logger.warn("discontinuity sliding from playlist, take drift into account");for(var A=0;A=v.length)return;m(l,v[C].start)}function m(s,l){if(l){for(var C=s.fragments,v=s.skippedSegments;v0&&y0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),b=d),this.state=F.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=F.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,y.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case F.State.IDLE:this.doTickIdle();break;case F.State.WAITING_LEVEL:{var b,d=this.levels,u=this.level,A=d==null||((b=d[u])===null||b===void 0)?void 0:b.details;if(A&&(!A.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(A))break;this.state=F.State.IDLE;break}break}case F.State.FRAG_LOADING_WAITING_RETRY:{var S,D=self.performance.now(),I=this.retryDate;(!I||D>=I||(S=this.media)!==null&&S!==void 0&&S.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=F.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){y.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var b,d,u=this.hls,A=this.levelLastLoaded,S=this.levels,D=this.media,I=u.config,B=u.nextLoadLevel;if(A===null||!D&&(this.startFragRequested||!I.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!S||!S[B])return;var j=S[B];this.level=u.nextLoadLevel=B;var z=j.details;if(!z||this.state===F.State.WAITING_LEVEL||z.live&&this.levelLastLoaded!==B){this.state=F.State.WAITING_LEVEL;return}var M=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:D,L.PlaylistLevelType.MAIN);if(M===null)return;var N=M.len,Y=this.getMaxBufferLength(j.maxBitrate);if(N>=Y)return;if(this._streamEnded(M,z)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,ee),this.state=F.State.ENDED;return}var le=M.end,fe=this.getNextFragment(le,z);if(this.couldBacktrack&&!this.fragPrevious&&fe&&fe.sn!=="initSegment"){var Oe=fe.sn-z.startSN;Oe>1&&(fe=z.fragments[Oe-1],this.fragmentTracker.removeFragment(fe))}if(fe&&this.fragmentTracker.getState(fe)===O.FragmentState.OK&&this.nextLoadPosition>le){var Se=this.audioOnly&&!this.altAudio?h.ElementaryStreamTypes.AUDIO:h.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(D,Se,L.PlaylistLevelType.MAIN),fe=this.getNextFragment(this.nextLoadPosition,z)}if(!fe)return;fe.initSegment&&!fe.initSegment.data&&!this.bitrateTest&&(fe=fe.initSegment),((b=fe.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((d=fe.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(fe,z):this.loadFragment(fe,z,le)},w.loadFragment=function(b,d,u){var A,S=this.fragmentTracker.getState(b);if(this.fragCurrent=b,S===O.FragmentState.BACKTRACKED){var D=this.fragmentTracker.getBacktrackData(b);if(D){this._handleFragmentLoadProgress(D),this._handleFragmentLoadComplete(D);return}else S=O.FragmentState.NOT_LOADED}S===O.FragmentState.NOT_LOADED||S===O.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,y.prototype.loadFragment.call(this,b,d,u)):S===O.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((A=this.media)===null||A===void 0?void 0:A.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(b){var d=this.fragmentTracker.getAppendedFrag(b,L.PlaylistLevelType.MAIN);return d&&"fragment"in d?d.fragment:d},w.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,L.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var b=this.levels,d=this.media;if(d!=null&&d.readyState){var u,A=this.getAppendedFrag(d.currentTime);if(A&&A.start>1&&this.flushMainBuffer(0,A.start-1),!d.paused&&b){var S=this.hls.nextLoadLevel,D=b[S],I=this.fragLastKbps;I&&this.fragCurrent?u=this.fragCurrent.duration*D.maxBitrate/(1e3*I)+1:u=0}else u=0;var B=this.getBufferedFrag(d.currentTime+u);if(B){var j=this.followingBufferedFrag(B);if(j){this.abortCurrentFrag();var z=j.maxStartPTS?j.maxStartPTS:j.start,M=j.duration,N=Math.max(B.end,z+Math.min(Math.max(M-this.config.maxFragLookUpTolerance,M*.5),M*.75));this.flushMainBuffer(N,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===F.State.KEY_LOADING&&(this.state=F.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(b,d){y.prototype.flushMainBuffer.call(this,b,d,this.altAudio?"video":null)},w.onMediaAttached=function(b,d){y.prototype.onMediaAttached.call(this,b,d);var u=d.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),u.addEventListener("playing",this.onvplaying),u.addEventListener("seeked",this.onvseeked),this.gapController=new p.default(this.config,u,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),y.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var b=this.media,d=b?b.currentTime:null;Object(X.isFiniteNumber)(d)&&this.log("Media seeked to "+d.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(b,d){var u=!1,A=!1,S;d.levels.forEach(function(D){S=D.audioCodec,S&&(S.indexOf("mp4a.40.2")!==-1&&(u=!0),S.indexOf("mp4a.40.5")!==-1&&(A=!0))}),this.audioCodecSwitch=u&&A&&!Object(P.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=d.levels,this.startFragRequested=!1},w.onLevelLoading=function(b,d){var u=this.levels;if(!u||this.state!==F.State.IDLE)return;var A=u[d.level];(!A.details||A.details.live&&this.levelLastLoaded!==d.level||this.waitForCdnTuneIn(A.details))&&(this.state=F.State.WAITING_LEVEL)},w.onLevelLoaded=function(b,d){var u,A=this.levels,S=d.level,D=d.details,I=D.totalduration;if(!A){this.warn("Levels were reset while loading level "+S);return}this.log("Level "+S+" loaded ["+D.startSN+","+D.endSN+"], cc ["+D.startCC+", "+D.endCC+"] duration:"+I);var B=this.fragCurrent;B&&(this.state===F.State.FRAG_LOADING||this.state===F.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==d.level&&B.loader&&(this.state=F.State.IDLE,B.loader.abort()));var j=A[S],z=0;if(D.live||(u=j.details)!==null&&u!==void 0&&u.live){if(D.fragments[0]||(D.deltaUpdateFailed=!0),D.deltaUpdateFailed)return;z=this.alignPlaylists(D,j.details)}if(j.details=D,this.levelLastLoaded=S,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:D,level:S}),this.state===F.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(D))return;this.state=F.State.IDLE}this.startFragRequested?D.live&&this.synchronizeToLiveEdge(D):this.setStartPosition(D,z),this.tick()},w._handleFragmentLoadProgress=function(b){var d,u=b.frag,A=b.part,S=b.payload,D=this.levels;if(!D){this.warn("Levels were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered");return}var I=D[u.level],B=I.details;if(!B){this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset");return}var j=I.videoCodec,z=B.PTSKnown||!B.live,M=(d=u.initSegment)===null||d===void 0?void 0:d.data,N=this._getAudioCodec(I),Y=this.transmuxer=this.transmuxer||new f.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=A?A.index:-1,le=ee!==-1,fe=new T.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,S.byteLength,ee,le),Oe=this.initPTS[u.cc];Y.push(S,M,N,j,u,A,B.totalduration,z,fe,Oe)},w.onAudioTrackSwitching=function(b,d){var u=this.altAudio,A=!!d.url,S=d.id;if(!A){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var D=this.fragCurrent;D!=null&&D.loader&&(this.log("Switching to main audio track, cancel main fragment load"),D.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var I=this.hls;u&&I.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),I.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:S})}},w.onAudioTrackSwitched=function(b,d){var u=d.id,A=!!this.hls.audioTracks[u].url;if(A){var S=this.videoBuffer;S&&this.mediaBuffer!==S&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=S)}this.altAudio=A,this.tick()},w.onBufferCreated=function(b,d){var u=d.tracks,A,S,D=!1;for(var I in u){var B=u[I];if(B.id==="main"){if(S=I,A=B,I==="video"){var j=u[I];j&&(this.videoBuffer=j.buffer)}}else D=!0}D&&A?(this.log("Alternate track found, use "+S+".buffered to schedule main fragment loading"),this.mediaBuffer=A.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(b,d){var u=d.frag,A=d.part;if(u&&u.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(u)){this.warn("Fragment "+u.sn+(A?" p: "+A.index:"")+" of level "+u.level+" finished buffering, but was aborted. state: "+this.state),this.state===F.State.PARSED&&(this.state=F.State.IDLE);return}var S=A?A.stats:u.stats;this.fragLastKbps=Math.round(8*S.total/(S.buffering.end-S.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,A)},w.onError=function(b,d){switch(d.details){case m.ErrorDetails.FRAG_LOAD_ERROR:case m.ErrorDetails.FRAG_LOAD_TIMEOUT:case m.ErrorDetails.KEY_LOAD_ERROR:case m.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,d);break;case m.ErrorDetails.LEVEL_LOAD_ERROR:case m.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==F.State.ERROR&&(d.fatal?(this.warn(""+d.details),this.state=F.State.ERROR):!d.levelRetry&&this.state===F.State.WAITING_LEVEL&&(this.state=F.State.IDLE));break;case m.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="main"&&(this.state===F.State.PARSING||this.state===F.State.PARSED)){var u=!0,A=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);A&&A.len>.5&&(u=!this.reduceMaxBufferLength(A.len)),u&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var b=this.media,d=this.gapController;if(!b||!d||!b.readyState)return;var u=U.BufferHelper.getBuffered(b);!this.loadedmetadata&&u.length?(this.loadedmetadata=!0,this.seekToStartPos()):d.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=F.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(b,d){var u=d.type;if(u!==h.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var A=(u===h.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(A,u,L.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(b,d){this.levels=d.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var b=this.media,d=b.currentTime,u=this.startPosition;if(u>=0&&d0&&(D1&&b.seeking===!1){var u=b.currentTime;if(U.BufferHelper.isBuffered(b,u)?d=this.getAppendedFrag(u):U.BufferHelper.isBuffered(b,u+.1)&&(d=this.getAppendedFrag(u+.1)),d){var A=this.fragPlaying,S=d.level;(!A||d.sn!==A.sn||A.level!==S||d.urlId!==A.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:d}),(!A||A.level!==S)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:S}),this.fragPlaying=d)}}},i(R,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var d=this.getAppendedFrag(b.currentTime);if(d)return d.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var d=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(d)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(F.default)},"./src/controller/subtitle-stream-controller.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"SubtitleStreamController",function(){return s});var X=_("./src/events.ts"),F=_("./src/utils/logger.ts"),P=_("./src/utils/buffer-helper.ts"),W=_("./src/controller/fragment-finders.ts"),U=_("./src/utils/discontinuities.ts"),O=_("./src/controller/level-helper.ts"),L=_("./src/controller/fragment-tracker.ts"),h=_("./src/controller/base-stream-controller.ts"),f=_("./src/types/loader.ts"),T=_("./src/types/level.ts");function p(l,C){for(var v=0;v=d[S].start&&A<=d[S].end){u=d[S];break}var D=x.start+x.duration;u?u.end=D:(u={start:A,end:D},d.push(u)),this.fragmentTracker.fragBuffered(x)},v.onBufferFlushing=function(R,w){var x=w.startOffset,b=w.endOffset;if(x===0&&b!==Number.POSITIVE_INFINITY){var d=this.currentTrackId,u=this.levels;if(!u.length||!u[d]||!u[d].details)return;var A=u[d].details,S=A.targetduration,D=b-S;if(D<=0)return;w.endOffsetSubtitles=Math.max(0,D),this.tracksBuffered.forEach(function(I){for(var B=0;B=A.length||d!==u||!S)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(x=S.details)!==null&&x!==void 0&&x.live){var D=this.mainDetails;if(b.deltaUpdateFailed||!D)return;var I=D.fragments[0];if(!S.details)b.hasProgramDateTime&&D.hasProgramDateTime?Object(U.alignMediaPlaylistByPDT)(b,D):I&&Object(O.addSliding)(b,I.start);else{var B=this.alignPlaylists(b,S.details);B===0&&I&&Object(O.addSliding)(b,I.start)}}if(S.details=b,this.levelLastLoaded=d,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===h.State.IDLE){var j=Object(W.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),S.details=void 0)}},v._handleFragmentLoadComplete=function(R){var w=R.frag,x=R.payload,b=w.decryptdata,d=this.hls;if(this.fragContextChanged(w))return;if(x&&x.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var u=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(x),b.key.buffer,b.iv.buffer).then(function(A){var S=performance.now();d.trigger(X.Events.FRAG_DECRYPTED,{frag:w,payload:A,stats:{tstart:u,tdecrypt:S}})})}},v.doTick=function(){if(!this.media){this.state=h.State.IDLE;return}if(this.state===h.State.IDLE){var R,w=this.currentTrackId,x=this.levels;if(!x.length||!x[w]||!x[w].details)return;var b=x[w].details,d=b.targetduration,u=this.config,A=this.media,S=P.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,A.currentTime-d,u.maxBufferHole),D=S.end,I=S.len,B=this.getMaxBufferLength()+d;if(I>B)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var j=b.fragments,z=j.length,M=b.edge,N,Y=this.fragPrevious;if(D-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)},g.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},g.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var i=T(this.media.textTracks);i.forEach(function(s){Object(F.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},g.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},g.onManifestParsed=function(i,s){this.tracks=s.subtitleTracks},g.onSubtitleTrackLoaded=function(i,s){var l=s.id,C=s.details,v=this.trackId,y=this.tracksInGroup[v];if(!y){this.warn("Invalid subtitle track id "+l);return}var R=y.details;y.details=s.details,this.log("subtitle track "+l+" loaded ["+C.startSN+"-"+C.endSN+"]"),l===this.trackId&&(this.retryCount=0,this.playlistLoaded(l,s,R))},g.onLevelLoading=function(i,s){this.switchLevel(s.level)},g.onLevelSwitching=function(i,s){this.switchLevel(s.level)},g.switchLevel=function(i){var s=this.hls.levels[i];if(!(s!=null&&s.textGroupIds))return;var l=s.textGroupIds[s.urlId];if(this.groupId!==l){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,v=this.tracks.filter(function(w){return!l||w.groupId===l});this.tracksInGroup=v;var y=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=l;var R={subtitleTracks:v};this.log("Updating subtitle tracks, "+v.length+' track(s) found in "'+l+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,R),y!==-1&&this.setSubtitleTrack(y,C)}},g.findTrackId=function(i){for(var s=this.tracksInGroup,l=0;l=C.length)return;this.clearTimer();var v=C[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,v){var y=v.id,R=v.groupId,w=R===void 0?"":R,x=v.name,b=v.type,d=v.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:y,groupId:w,name:x,type:b,url:d});var u=this.switchParams(v.url,s==null?void 0:s.details);this.loadPlaylist(u)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:i})},g.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,s=T(this.media.textTracks),l=0;l=0&&(b[0]=Math.min(b[0],C),b[1]=Math.max(b[1],v),w=!0,d/(v-C)>.5))return}if(w||R.push([C,v]),this.config.renderTextTracksNatively){var u=this.captionsTracks[l];this.Cues.newCue(u,C,v,y)}else{var A=this.Cues.newCue(null,C,v,y);this.hls.trigger(F.Events.CUES_PARSED,{type:"captions",cues:A,track:l})}},i.onInitPtsFound=function(l,C){var v=this,y=C.frag,R=C.id,w=C.initPTS,x=C.timescale,b=this.unparsedVttFrags;R==="main"&&(this.initPTS[y.cc]=w,this.timescale[y.cc]=x),b.length&&(this.unparsedVttFrags=[],b.forEach(function(d){v.onFragLoaded(F.Events.FRAG_LOADED,d)}))},i.getExistingTrack=function(l){var C=this.media;if(C)for(var v=0;v>>8^x&255^99,L[y]=x,h[x]=y;var b=v[y],d=v[b],u=v[d],A=v[x]*257^x*16843008;T[y]=A<<24|A>>>8,p[y]=A<<16|A>>>16,m[y]=A<<8|A>>>24,g[y]=A,A=u*16843009^d*65537^b*257^y*16843008,i[x]=A<<24|A>>>8,s[x]=A<<16|A>>>16,l[x]=A<<8|A>>>24,C[x]=A,y?(y=b^v[v[v[u^b]]],R^=v[v[R]]):y=R=1}},U.expandKey=function(L){for(var h=this.uint8ArrayToUint32Array_(L),f=!0,T=0;T>>6)+1;var A=(l[C+2]&60)>>>2;if(A>u.length-1){s.trigger(P.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+A});return}return w=(l[C+2]&1)<<2,w|=(l[C+3]&192)>>>6,X.logger.log("manifest codec:"+v+", ADTS type:"+y+", samplingIndex:"+A),/firefox/i.test(b)?A>=6?(y=5,x=new Array(4),R=A-3):(y=2,x=new Array(2),R=A):b.indexOf("android")!==-1?(y=2,x=new Array(2),R=A):(y=5,x=new Array(4),v&&(v.indexOf("mp4a.40.29")!==-1||v.indexOf("mp4a.40.5")!==-1)||!v&&A>=6?R=A-3:((v&&v.indexOf("mp4a.40.2")!==-1&&(A>=6&&w===1||/vivaldi/i.test(b))||!v&&w===1)&&(y=2,x=new Array(2)),R=A)),x[0]=y<<3,x[0]|=(A&14)>>1,x[1]|=(A&1)<<7,x[1]|=w<<3,y===5&&(x[1]|=(R&14)>>1,x[2]=(R&1)<<7,x[2]|=2<<2,x[3]=0),{config:x,samplerate:u[A],channelCount:w,codec:"mp4a.40."+y,manifestCodec:d}}function U(s,l){return s[l]===255&&(s[l+1]&246)===240}function O(s,l){return s[l+1]&1?7:9}function L(s,l){return(s[l+3]&3)<<11|s[l+4]<<3|(s[l+5]&224)>>>5}function h(s,l){return l+5=s.length)return!1;var v=L(s,l);if(v<=C)return!1;var y=l+v;return y===s.length||f(s,y)}return!1}function m(s,l,C,v,y){if(!s.samplerate){var R=W(l,C,v,y);if(!R)return;s.config=R.config,s.samplerate=R.samplerate,s.channelCount=R.channelCount,s.codec=R.codec,s.manifestCodec=R.manifestCodec,X.logger.log("parsed codec:"+s.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function g(s){return 1024*9e4/s}function a(s,l,C,v,y){var R=O(s,l),w=L(s,l);if(w-=R,w>0){var x=C+v*y;return{headerLength:R,frameLength:w,stamp:x}}}function i(s,l,C,v,y){var R=g(s.samplerate),w=a(l,C,v,y,R);if(w){var x=w.frameLength,b=w.headerLength,d=w.stamp,u=b+x,A=Math.max(0,C+u-l.length),S;A?(S=new Uint8Array(u-b),S.set(l.subarray(C+b,l.length),0)):S=l.subarray(C+b,C+u);var D={unit:S,pts:d};return A||s.samples.push(D),{sample:D,length:u,missing:A}}}},"./src/demux/base-audio-demuxer.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"initPTSFn",function(){return L});var X=_("./src/polyfills/number.ts"),F=_("./src/demux/id3.ts"),P=_("./src/demux/dummy-demuxed-track.ts"),W=_("./src/utils/mp4-tools.ts"),U=_("./src/utils/typed-array.ts"),O=function(){function h(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=h.prototype;return f.resetInitSegment=function(p,m,g){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(p,m){return!1},f.appendFrame=function(p,m,g){},f.demux=function(p,m){this.cachedData&&(p=Object(W.appendUint8Array)(this.cachedData,p),this.cachedData=null);var g=F.getID3Data(p,0),a=g?g.length:0,i,s,l=this._audioTrack,C=this._id3Track,v=g?F.getTimeStamp(g):void 0,y=p.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(v,m)),g&&g.length>0&&C.samples.push({pts:this.initPTS,dts:this.initPTS,data:g}),s=this.initPTS;aO?(this.word<<=O,this.bitsAvailable-=O):(O-=this.bitsAvailable,L=O>>3,O-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=O,this.bitsAvailable-=O)},W.readBits=function(O){var L=Math.min(this.bitsAvailable,O),h=this.word>>>32-L;return O>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=O-L,L>0&&this.bitsAvailable?h<>>O)!==0)return this.word<<=O,this.bitsAvailable-=O,O;return this.loadWord(),O+this.skipLZ()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var O=this.skipLZ();return this.readBits(O+1)-1},W.readEG=function(){var O=this.readUEG();return 1&O?1+O>>>1:-1*(O>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(O){for(var L=8,h=8,f,T=0;T0?y.subarray(w,w+x):void 0},W=function(y,R){var w=0;return w=(y[R]&127)<<21,w|=(y[R+1]&127)<<14,w|=(y[R+2]&127)<<7,w|=y[R+3]&127,w},U=function(y,R){return X(y,R)&&W(y,R+6)+10<=y.length-R},O=function(y){for(var R=f(y),w=0;w>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:D+=String.fromCharCode(u);break;case 12:case 13:A=y[I++],D+=String.fromCharCode((u&31)<<6|A&63);break;case 14:A=y[I++],S=y[I++],D+=String.fromCharCode((u&15)<<12|(A&63)<<6|(S&63)<<0);break;default:}}return D},s={decodeTextFrame:m},l;function C(){return!l&&typeof self.TextDecoder!="undefined"&&(l=new self.TextDecoder("utf-8")),l}},"./src/demux/mp3demuxer.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/demux/base-audio-demuxer.ts"),F=_("./src/demux/id3.ts"),P=_("./src/utils/logger.ts"),W=_("./src/demux/mpegaudio.ts");function U(h,f){h.prototype=Object.create(f.prototype),h.prototype.constructor=h,O(h,f)}function O(h,f){return O=Object.setPrototypeOf||function(p,m){return p.__proto__=m,p},O(h,f)}var L=function(h){U(f,h);function f(){return h.apply(this,arguments)||this}var T=f.prototype;return T.resetInitSegment=function(m,g,a){h.prototype.resetInitSegment.call(this,m,g,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:m,duration:a,inputTimeScale:9e4,dropped:0}},f.probe=function(m){if(!m)return!1;for(var g=F.getID3Data(m,0)||[],a=g.length,i=m.length;a0},U.demux=function(L){var h=L,f=Object(F.dummyTrack)();if(this.config.progressive){this.remainderData&&(h=Object(X.appendUint8Array)(this.remainderData,L));var T=Object(X.segmentValidRange)(h);this.remainderData=T.remainder,f.samples=T.valid||new Uint8Array}else f.samples=h;return{audioTrack:Object(F.dummyTrack)(),avcTrack:f,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},U.flush=function(){var L=Object(F.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(F.dummyTrack)(),avcTrack:L,id3Track:Object(F.dummyTrack)(),textTrack:Object(F.dummyTrack)()}},U.demuxSampleAes=function(L,h,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},U.destroy=function(){},W}();P.minProbeByteLength=1024,J.default=P},"./src/demux/mpegaudio.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"appendFrame",function(){return O}),_.d(J,"parseHeader",function(){return L}),_.d(J,"isHeaderPattern",function(){return h}),_.d(J,"isHeader",function(){return f}),_.d(J,"canParse",function(){return T}),_.d(J,"probe",function(){return p});var X=null,F=[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],P=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],U=[0,1,1,4];function O(m,g,a,i,s){if(a+24>g.length)return;var l=L(g,a);if(l&&a+l.frameLength<=g.length){var C=l.samplesPerFrame*9e4/l.sampleRate,v=i+s*C,y={unit:g.subarray(a,a+l.frameLength),pts:v,dts:v};return m.config=[],m.channelCount=l.channelCount,m.samplerate=l.sampleRate,m.samples.push(y),{sample:y,length:l.frameLength,missing:0}}}function L(m,g){var a=m[g+1]>>3&3,i=m[g+1]>>1&3,s=m[g+2]>>4&15,l=m[g+2]>>2&3;if(a!==1&&s!==0&&s!==15&&l!==3){var C=m[g+2]>>1&1,v=m[g+3]>>6,y=a===3?3-i:i===3?3:4,R=F[y*14+s-1]*1e3,w=a===3?0:a===2?1:2,x=P[w*3+l],b=v===3?1:2,d=W[a][i],u=U[i],A=d*8*u,S=Math.floor(d*R/x+C)*u;if(X===null){var D=navigator.userAgent||"",I=D.match(/Chrome\/(\d+)/i);X=I?parseInt(I[1]):0}var B=!!X&&X<=87;return B&&i===2&&R>=224e3&&v===0&&(m[g+3]=m[g+3]|128),{sampleRate:x,channelCount:b,frameLength:S,samplesPerFrame:A}}}function h(m,g){return m[g]===255&&(m[g+1]&224)===224&&(m[g+1]&6)!==0}function f(m,g){return g+1=L.length){f();return}if(L[h].unit.length<32)continue;var T=this.decrypter.isSync();if(this.decryptAacSample(L,h,f,T),!T)return}},U.getAvcEncryptedData=function(L){for(var h=Math.floor((L.length-48)/160)*16+16,f=new Int8Array(h),T=0,p=32;p<=L.length-16;p+=160,T+=16)f.set(L.subarray(p,p+16),T);return f},U.getAvcDecryptedUnit=function(L,h){for(var f=new Uint8Array(h),T=0,p=32;p<=L.length-16;p+=160,T+=16)L.set(f.subarray(T,T+16),p);return L},U.decryptAvcSample=function(L,h,f,T,p,m){var g=Object(F.discardEPB)(p.data),a=this.getAvcEncryptedData(g),i=this;this.decryptBuffer(a.buffer,function(s){p.data=i.getAvcDecryptedUnit(g,s),m||i.decryptAvcSamples(L,h,f+1,T)})},U.decryptAvcSamples=function(L,h,f,T){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;h++,f=0){if(h>=L.length){T();return}for(var p=L[h].units;!(f>=p.length);f++){var m=p[f];if(m.data.length<=48||m.type!==1&&m.type!==5)continue;var g=this.decrypter.isSync();if(this.decryptAvcSample(L,h,f,T,m,g),!g)return}}},W}();J.default=P},"./src/demux/transmuxer-interface.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return p});var X=_("./node_modules/webworkify-webpack/index.js"),F=_.n(X),P=_("./src/events.ts"),W=_("./src/demux/transmuxer.ts"),U=_("./src/utils/logger.ts"),O=_("./src/errors.ts"),L=_("./src/utils/mediasource-helper.ts"),h=_("./node_modules/eventemitter3/index.js"),f=_.n(h),T=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},p=function(){function m(a,i,s,l){var C=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=a,this.id=i,this.onTransmuxComplete=s,this.onFlush=l;var v=a.config,y=function(d,u){u=u||{},u.frag=C.frag,u.id=C.id,a.trigger(d,u)};this.observer=new h.EventEmitter,this.observer.on(P.Events.FRAG_DECRYPTED,y),this.observer.on(P.Events.ERROR,y);var R={mp4:T.isTypeSupported("video/mp4"),mpeg:T.isTypeSupported("audio/mpeg"),mp3:T.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(v.enableWorker&&typeof Worker!="undefined"){U.logger.log("demuxing in webworker");var x;try{x=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),x.addEventListener("message",this.onwmsg),x.onerror=function(b){a.trigger(P.Events.ERROR,{type:O.ErrorTypes.OTHER_ERROR,details:O.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},x.postMessage({cmd:"init",typeSupported:R,vendor:w,id:i,config:JSON.stringify(v)})}catch(b){U.logger.warn("Error in worker:",b),U.logger.error("Error while initializing DemuxerWorker, fallback to inline"),x&&self.URL.revokeObjectURL(x.objectURL),this.transmuxer=new W.default(this.observer,R,v,w,i),this.worker=null}}else this.transmuxer=new W.default(this.observer,R,v,w,i)}var g=m.prototype;return g.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var l=this.observer;l&&l.removeAllListeners(),this.observer=null},g.push=function(i,s,l,C,v,y,R,w,x,b){var d=this;x.transmuxing.start=self.performance.now();var u=this.transmuxer,A=this.worker,S=y?y.start:v.start,D=v.decryptdata,I=this.frag,B=!(I&&v.cc===I.cc),j=!(I&&x.level===I.level),z=I?x.sn-I.sn:-1,M=this.part?x.part-this.part.index:1,N=!j&&(z===1||z===0&&M===1),Y=self.performance.now();(j||z||v.stats.parsing.start===0)&&(v.stats.parsing.start=Y),y&&(M||!N)&&(y.stats.parsing.start=Y);var ee=new W.TransmuxState(B,N,w,j,S);if(!N||B){U.logger.log("[transmuxer-interface, "+v.type+"]: Starting new transmux session for sn: "+x.sn+" p: "+x.part+" level: "+x.level+" id: "+x.id+` discontinuity: `+B+` trackSwitch: `+j+` contiguous: `+N+` accurateTimeOffset: `+w+` - timeOffset: `+S);var le=new W.TransmuxConfig(l,C,s,R,b);this.configureTransmuxer(le)}if(this.frag=v,this.part=y,A)A.postMessage({cmd:"demux",data:i,decryptdata:D,chunkMeta:x,state:ee},i instanceof ArrayBuffer?[i]:[]);else if(u){var fe=u.push(i,D,x,ee);Object(W.isPromise)(fe)?fe.then(function(Oe){h.handleTransmuxComplete(Oe)}):this.handleTransmuxComplete(fe)}},g.flush=function(i){var s=this;i.transmuxing.start=self.performance.now();var l=this.transmuxer,C=this.worker;if(C)C.postMessage({cmd:"flush",chunkMeta:i});else if(l){var v=l.flush(i);Object(W.isPromise)(v)?v.then(function(y){s.handleFlushResult(y,i)}):this.handleFlushResult(v,i)}},g.handleFlushResult=function(i,s){var l=this;i.forEach(function(C){l.handleTransmuxComplete(C)}),this.onFlush(s)},g.onWorkerMessage=function(i){var s=i.data,l=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,l.trigger(s.event,s.data);break}}},g.configureTransmuxer=function(i){var s=this.worker,l=this.transmuxer;s?s.postMessage({cmd:"configure",config:i}):l&&l.configure(i)},g.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},m}()},"./src/demux/transmuxer-worker.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return O});var X=_("./src/demux/transmuxer.ts"),F=_("./src/events.ts"),P=_("./src/utils/logger.ts"),W=_("./node_modules/eventemitter3/index.js"),U=_.n(W);function O(p){var m=new W.EventEmitter,g=function(i,s){p.postMessage({event:i,data:s})};m.on(F.Events.FRAG_DECRYPTED,g),m.on(F.Events.ERROR,g),p.addEventListener("message",function(a){var i=a.data;switch(i.cmd){case"init":{var s=JSON.parse(i.config);p.transmuxer=new X.default(m,i.typeSupported,s,i.vendor,i.id),Object(P.enableLogs)(s.debug),g("init",null);break}case"configure":{p.transmuxer.configure(i.config);break}case"demux":{var l=p.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(X.isPromise)(l)?l.then(function(y){L(p,y)}):L(p,l);break}case"flush":{var C=i.chunkMeta,v=p.transmuxer.flush(C);Object(X.isPromise)(v)?v.then(function(y){f(p,y,C)}):f(p,v,C);break}default:break}})}function L(p,m){if(T(m.remuxResult))return;var g=[],a=m.remuxResult,i=a.audio,s=a.video;i&&d(g,i),s&&d(g,s),p.postMessage({event:"transmuxComplete",data:m},g)}function d(p,m){m.data1&&p.push(m.data1.buffer),m.data2&&p.push(m.data2.buffer)}function f(p,m,g){m.forEach(function(a){L(p,a)}),p.postMessage({event:"flush",data:g})}function T(p){return!p.audio&&!p.video&&!p.text&&!p.id3&&!p.initSegment}},"./src/demux/transmuxer.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return s}),_.d(J,"isPromise",function(){return v}),_.d(J,"TransmuxConfig",function(){return y}),_.d(J,"TransmuxState",function(){return R});var X=_("./src/events.ts"),F=_("./src/errors.ts"),P=_("./src/crypt/decrypter.ts"),W=_("./src/demux/aacdemuxer.ts"),U=_("./src/demux/mp4demuxer.ts"),O=_("./src/demux/tsdemuxer.ts"),L=_("./src/demux/mp3demuxer.ts"),d=_("./src/remux/mp4-remuxer.ts"),f=_("./src/remux/passthrough-remuxer.ts"),T=_("./src/demux/chunk-cache.ts"),p=_("./src/utils/mp4-tools.ts"),m=_("./src/utils/logger.ts"),g;try{g=self.performance.now.bind(self.performance)}catch(w){m.logger.debug("Unable to use Performance API on this environment"),g=self.Date.now}var a=[{demux:O.default,remux:d.default},{demux:U.default,remux:f.default},{demux:W.default,remux:d.default},{demux:L.default,remux:d.default}],i=1024;a.forEach(function(w){var x=w.demux;i=Math.max(i,x.minProbeByteLength)});var s=function(){function w(b,h,u,A,S){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 T.default,this.observer=b,this.typeSupported=h,this.config=u,this.vendor=A,this.id=S}var x=w.prototype;return x.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},x.push=function(h,u,A,S){var D=this,I=A.transmuxing;I.executeStart=g();var B=new Uint8Array(h),j=this.cache,z=this.config,M=this.currentTransmuxState,N=this.transmuxConfig;S&&(this.currentTransmuxState=S);var Y=l(B,u);if(Y&&Y.method==="AES-128"){var ee=this.getDecrypter();if(z.enableSoftwareAES){var le=ee.softwareDecrypt(B,Y.key.buffer,Y.iv.buffer);if(!le)return I.executeEnd=g(),C(A);B=new Uint8Array(le)}else return this.decryptionPromise=ee.webCryptoDecrypt(B,Y.key.buffer,Y.iv.buffer).then(function(me){var we=D.push(me,null,A);return D.decryptionPromise=null,we}),this.decryptionPromise}var fe=S||M,Oe=fe.contiguous,Se=fe.discontinuity,ke=fe.trackSwitch,Le=fe.accurateTimeOffset,Ae=fe.timeOffset,ge=N.audioCodec,de=N.videoCodec,re=N.defaultInitPts,he=N.duration,se=N.initSegmentData;if((Se||ke)&&this.resetInitSegment(se,ge,de,he),Se&&this.resetInitialTimestamp(re),Oe||this.resetContiguity(),this.needsProbing(B,Se,ke)){if(j.dataLength){var De=j.flush();B=Object(p.appendUint8Array)(De,B)}this.configureTransmuxer(B,N)}var ie=this.transmux(B,Y,Ae,Le,A),ae=this.currentTransmuxState;return ae.contiguous=!0,ae.discontinuity=!1,ae.trackSwitch=!1,I.executeEnd=g(),ie},x.flush=function(h){var u=this,A=h.transmuxing;A.executeStart=g();var S=this.decrypter,D=this.cache,I=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return u.flush(h)});var j=[],z=I.timeOffset;if(S){var M=S.flush();M&&j.push(this.push(M,null,h))}var N=D.dataLength;D.reset();var Y=this.demuxer,ee=this.remuxer;if(!Y||!ee)return N>=i&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),A.executeEnd=g(),[C(h)];var le=Y.flush(z);return v(le)?le.then(function(fe){return u.flushRemux(j,fe,h),j}):(this.flushRemux(j,le,h),j)},x.flushRemux=function(h,u,A){var S=u.audioTrack,D=u.avcTrack,I=u.id3Track,B=u.textTrack,j=this.currentTransmuxState,z=j.accurateTimeOffset,M=j.timeOffset;m.logger.log("[transmuxer.ts]: Flushed fragment "+A.sn+(A.part>-1?" p: "+A.part:"")+" of level "+A.level);var N=this.remuxer.remux(S,D,I,B,M,z,!0,this.id);h.push({remuxResult:N,chunkMeta:A}),A.transmuxing.executeEnd=g()},x.resetInitialTimestamp=function(h){var u=this.demuxer,A=this.remuxer;if(!u||!A)return;u.resetTimeStamp(h),A.resetTimeStamp(h)},x.resetContiguity=function(){var h=this.demuxer,u=this.remuxer;if(!h||!u)return;h.resetContiguity(),u.resetNextTimestamp()},x.resetInitSegment=function(h,u,A,S){var D=this.demuxer,I=this.remuxer;if(!D||!I)return;D.resetInitSegment(u,A,S),I.resetInitSegment(h,u,A)},x.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},x.transmux=function(h,u,A,S,D){var I;return u&&u.method==="SAMPLE-AES"?I=this.transmuxSampleAes(h,u,A,S,D):I=this.transmuxUnencrypted(h,A,S,D),I},x.transmuxUnencrypted=function(h,u,A,S){var D=this.demuxer.demux(h,u,!1,!this.config.progressive),I=D.audioTrack,B=D.avcTrack,j=D.id3Track,z=D.textTrack,M=this.remuxer.remux(I,B,j,z,u,A,!1,this.id);return{remuxResult:M,chunkMeta:S}},x.transmuxSampleAes=function(h,u,A,S,D){var I=this;return this.demuxer.demuxSampleAes(h,u,A).then(function(B){var j=I.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,A,S,!1,I.id);return{remuxResult:j,chunkMeta:D}})},x.configureTransmuxer=function(h,u){for(var A=this.config,S=this.observer,D=this.typeSupported,I=this.vendor,B=u.audioCodec,j=u.defaultInitPts,z=u.duration,M=u.initSegmentData,N=u.videoCodec,Y,ee=0,le=a.length;ee0&&x!=null&&x.key!=null&&x.iv!==null&&x.method!=null&&(b=x),b}var C=function(x){return{remuxResult:{},chunkMeta:x}};function v(w){return"then"in w&&w.then instanceof Function}var y=function(x,b,h,u,A){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=x,this.videoCodec=b,this.initSegmentData=h,this.duration=u,this.defaultInitPts=A},R=function(x,b,h,u,A){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=x,this.contiguous=b,this.accurateTimeOffset=h,this.trackSwitch=u,this.timeOffset=A}},"./src/demux/tsdemuxer.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"discardEPB",function(){return C});var X=_("./src/demux/adts.ts"),F=_("./src/demux/mpegaudio.ts"),P=_("./src/demux/exp-golomb.ts"),W=_("./src/demux/id3.ts"),U=_("./src/demux/sample-aes.ts"),O=_("./src/events.ts"),L=_("./src/utils/mp4-tools.ts"),d=_("./src/utils/logger.ts"),f=_("./src/errors.ts"),T={video:1,audio:2,id3:3,text:4},p=function(){function v(R,w,x){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=R,this.config=w,this.typeSupported=x}v.probe=function(w){var x=v.syncOffset(w);return x<0?!1:(x&&d.logger.warn("MPEG2-TS detected but first sync word found @ offset "+x+", junk ahead ?"),!0)},v.syncOffset=function(w){for(var x=Math.min(1e3,w.length-3*188),b=0;b>4,ge=void 0;if(Ae>1){if(ge=Se+5+w[Se+4],ge===Se+188)continue}else ge=Se+4;switch(Le){case I:ke&&(B&&(u=i(B))&&this.parseAVCPES(u,!1),B={data:[],size:0}),B&&(B.data.push(w.subarray(ge,Se+188)),B.size+=Se+188-ge);break;case j:ke&&(M&&(u=i(M))&&(S.isAAC?this.parseAACPES(u):this.parseMPEGPES(u)),M={data:[],size:0}),M&&(M.data.push(w.subarray(ge,Se+188)),M.size+=Se+188-ge);break;case z:ke&&(N&&(u=i(N))&&this.parseID3PES(u),N={data:[],size:0}),N&&(N.data.push(w.subarray(ge,Se+188)),N.size+=Se+188-ge);break;case 0:ke&&(ge+=w[ge]+1),le=this._pmtId=g(w,ge);break;case le:{ke&&(ge+=w[ge]+1);var de=a(w,ge,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);I=de.avc,I>0&&(A.pid=I),j=de.audio,j>0&&(S.pid=j,S.isAAC=de.isAAC),z=de.id3,z>0&&(D.pid=z),Y&&!ee&&(d.logger.log("reparse from beginning"),Y=!1,Se=Oe-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});A.pesData=B,S.pesData=M,D.pesData=N;var re={audioTrack:S,avcTrack:A,id3Track:D,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(re),re},y.flush=function(){var w=this.remainderData;this.remainderData=null;var x;return w?x=this.demux(w,-1,!1,!0):x={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(x),this.sampleAes?this.decrypt(x,this.sampleAes):x},y.extractRemainingSamples=function(w){var x=w.audioTrack,b=w.avcTrack,h=w.id3Track,u=b.pesData,A=x.pesData,S=h.pesData,D;u&&(D=i(u))?(this.parseAVCPES(D,!0),b.pesData=null):b.pesData=u,A&&(D=i(A))?(x.isAAC?this.parseAACPES(D):this.parseMPEGPES(D),x.pesData=null):(A!=null&&A.size&&d.logger.log("last AAC PES packet truncated,might overlap between fragments"),x.pesData=A),S&&(D=i(S))?(this.parseID3PES(D),h.pesData=null):h.pesData=S},y.demuxSampleAes=function(w,x,b){var h=this.demux(w,b,!0,!this.config.progressive),u=this.sampleAes=new U.default(this.observer,this.config,x);return this.decrypt(h,u)},y.decrypt=function(w,x){return new Promise(function(b){var h=w.audioTrack,u=w.avcTrack;h.samples&&h.isAAC?x.decryptAacSamples(h.samples,0,function(){u.samples?x.decryptAvcSamples(u.samples,0,0,function(){b(w)}):b(w)}):u.samples&&x.decryptAvcSamples(u.samples,0,0,function(){b(w)})})},y.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},y.parseAVCPES=function(w,x){var b=this,h=this._avcTrack,u=this.parseAVCNALu(w.data),A=!1,S=this.avcSample,D,I=!1;w.data=null,S&&u.length&&!h.audFound&&(s(S,h),S=this.avcSample=m(!1,w.pts,w.dts,"")),u.forEach(function(B){switch(B.type){case 1:{D=!0,S||(S=b.avcSample=m(!0,w.pts,w.dts,"")),A&&(S.debug+="NDR "),S.frame=!0;var j=B.data;if(I&&j.length>4){var z=new P.default(j).readSliceType();(z===2||z===4||z===7||z===9)&&(S.key=!0)}break}case 5:D=!0,S||(S=b.avcSample=m(!0,w.pts,w.dts,"")),A&&(S.debug+="IDR "),S.key=!0,S.frame=!0;break;case 6:{D=!0,A&&S&&(S.debug+="SEI ");var M=new P.default(C(B.data));M.readUByte();for(var N=0,Y=0,ee=!1,le=0;!ee&&M.bytesAvailable>1;){N=0;do le=M.readUByte(),N+=le;while(le===255);Y=0;do le=M.readUByte(),Y+=le;while(le===255);if(N===4&&M.bytesAvailable!==0){ee=!0;var fe=M.readUByte();if(fe===181){var Oe=M.readUShort();if(Oe===49){var Se=M.readUInt();if(Se===1195456820){var ke=M.readUByte();if(ke===3){for(var Le=M.readUByte(),Ae=M.readUByte(),ge=31&Le,de=[Le,Ae],re=0;re16){for(var he=[],se=0;se<16;se++)he.push(M.readUByte().toString(16)),(se===3||se===5||se===7||se===9)&&he.push("-");for(var De=Y-16,ie=new Uint8Array(De),ae=0;ae=0){var M={data:w.subarray(j,S-h-1),type:z};A.push(M)}else{var N=this.getLastNalUnit();if(N&&(u&&S<=4-u&&(N.state&&(N.data=N.data.subarray(0,N.data.byteLength-u))),I=S-h-1,I>0)){var Y=new Uint8Array(N.data.byteLength+I);Y.set(N.data,0),Y.set(w.subarray(0,I),N.data.byteLength),N.data=Y,N.state=0}}S=0&&h>=0){var ee={data:w.subarray(j,x),type:z,state:h};A.push(ee)}if(A.length===0){var le=this.getLastNalUnit();if(le){var fe=new Uint8Array(le.data.byteLength+w.byteLength);fe.set(le.data,0),fe.set(w,le.data.byteLength),le.data=fe}}return b.naluState=h,A},y.parseAACPES=function(w){var x=0,b=this._audioTrack,h=this.aacOverFlow,u=w.data;if(h){this.aacOverFlow=null;var A=h.sample.unit.byteLength,S=Math.min(h.missing,A),D=A-S;h.sample.unit.set(u.subarray(0,S),D),b.samples.push(h.sample),x=h.missing}var I,B;for(I=x,B=u.length;I1;){var A=new Uint8Array(u[0].length+u[1].length);A.set(u[0]),A.set(u[1],u[0].length),u[0]=A,u.splice(1,1)}R=u[0];var S=(R[0]<<16)+(R[1]<<8)+R[2];if(S===1){if(w=(R[4]<<8)+R[5],w&&w>v.size-6)return null;var D=R[7];D&192&&(b=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,D&64?(h=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,b-h>60*9e4&&(d.logger.warn(Math.round((b-h)/9e4)+"s delta between PTS and DTS, align them"),b=h)):h=b),x=R[8];var I=x+9;if(v.size<=I)return null;v.size-=I;for(var B=new Uint8Array(v.size),j=0,z=u.length;jM){I-=M;continue}else R=R.subarray(I),M-=I,I=0;B.set(R,y),y+=M}return w&&(w-=x+3),{data:B,pts:b,dts:h,len:w}}return null}function s(v,y){if(v.units.length&&v.frame){if(v.pts===void 0){var R=y.samples,w=R.length;if(w){var x=R[w-1];v.pts=x.pts,v.dts=x.dts}else{y.dropped++;return}}y.samples.push(v)}v.debug.length&&d.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function l(v,y){var R=v.length;if(R>0){if(y.pts>=v[R-1].pts)v.push(y);else for(var w=R-1;w>=0;w--)if(y.ptsb)return u;return 0}},{key:"maxAutoLevel",get:function(){var x=this.levels,b=this.autoLevelCapping,h;return b===-1&&x&&x.length?h=x.length-1:h=b,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(x){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,x)}},{key:"audioTracks",get:function(){var x=this.audioTrackController;return x?x.audioTracks:[]}},{key:"audioTrack",get:function(){var x=this.audioTrackController;return x?x.audioTrack:-1},set:function(x){var b=this.audioTrackController;b&&(b.audioTrack=x)}},{key:"subtitleTracks",get:function(){var x=this.subtitleTrackController;return x?x.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var x=this.subtitleTrackController;return x?x.subtitleTrack:-1},set:function(x){var b=this.subtitleTrackController;b&&(b.subtitleTrack=x)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var x=this.subtitleTrackController;return x?x.subtitleDisplay:!1},set:function(x){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=x)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(x){this.config.lowLatencyMode=x}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return i.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return y.defaultConfig?y.defaultConfig:m.hlsDefaultConfig},set:function(x){y.defaultConfig=x}}]),y}();v.defaultConfig=void 0},"./src/is-supported.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"isSupported",function(){return P}),_.d(J,"changeTypeSupported",function(){return W});var X=_("./src/utils/mediasource-helper.ts");function F(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var U=Object(X.getMediaSource)();if(!U)return!1;var O=F(),L=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),d=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!L&&!!d}function W(){var U,O=F();return typeof(O==null||((U=O.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return p}),_.d(J,"LoadError",function(){return g});var X=_("./src/polyfills/number.ts"),F=_("./src/errors.ts");function P(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,d(a,i)}function W(a){var i=typeof Map=="function"?new Map:void 0;return W=function(l){if(l===null||!L(l))return l;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(l))return i.get(l);i.set(l,C)}function C(){return U(l,arguments,f(this).constructor)}return C.prototype=Object.create(l.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),d(C,l)},W(a)}function U(a,i,s){return O()?U=Reflect.construct:U=function(C,v,y){var R=[null];R.push.apply(R,v);var w=Function.bind.apply(C,R),x=new w;return y&&d(x,y.prototype),x},U.apply(null,arguments)}function O(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function L(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function d(a,i){return d=Object.setPrototypeOf||function(l,C){return l.__proto__=C,l},d(a,i)}function f(a){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},f(a)}var T=Math.pow(2,17),p=function(){function a(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var i=a.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(l,C){var v=this,y=l.url;if(!y)return Promise.reject(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,networkDetails:null},"Fragment does not have a "+(y?"part list":"url")));this.abort();var R=this.config,w=R.fLoader,x=R.loader;return new Promise(function(b,h){v.loader&&v.loader.destroy();var u=v.loader=l.loader=w?new w(R):new x(R),A=m(l),S={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:T};l.stats=u.stats,u.load(A,S,{onSuccess:function(I,B,j,z){v.resetLoader(l,u),b({frag:l,part:null,payload:I.data,networkDetails:z})},onError:function(I,B,j){v.resetLoader(l,u),h(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,response:I,networkDetails:j}))},onAbort:function(I,B,j){v.resetLoader(l,u),h(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,networkDetails:j}))},onTimeout:function(I,B,j){v.resetLoader(l,u),h(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,networkDetails:j}))},onProgress:function(I,B,j,z){C&&C({frag:l,part:null,payload:j,networkDetails:z})}})})},i.loadPart=function(l,C,v){var y=this;this.abort();var R=this.config,w=R.fLoader,x=R.loader;return new Promise(function(b,h){y.loader&&y.loader.destroy();var u=y.loader=l.loader=w?new w(R):new x(R),A=m(l,C),S={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:T};C.stats=u.stats,u.load(A,S,{onSuccess:function(I,B,j,z){y.resetLoader(l,u),y.updateStatsFromPart(l,C);var M={frag:l,part:C,payload:I.data,networkDetails:z};v(M),b(M)},onError:function(I,B,j){y.resetLoader(l,u),h(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,part:C,response:I,networkDetails:j}))},onAbort:function(I,B,j){l.stats.aborted=C.stats.aborted,y.resetLoader(l,u),h(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,part:C,networkDetails:j}))},onTimeout:function(I,B,j){y.resetLoader(l,u),h(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,part:C,networkDetails:j}))}})})},i.updateStatsFromPart=function(l,C){var v=l.stats,y=C.stats,R=y.total;if(v.loaded+=y.loaded,R){var w=Math.round(l.duration/C.duration),x=Math.min(Math.round(v.loaded/R),w),b=w-x,h=b*Math.round(v.loaded/x);v.total=v.loaded+h}else v.total=Math.max(v.loaded,v.total);var u=v.loading,A=y.loading;u.start?u.first+=A.first-A.start:(u.start=A.start,u.first=A.first),u.end=A.end},i.resetLoader=function(l,C){l.loader=null,this.loader===C&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),C.destroy()},a}();function m(a,i){i===void 0&&(i=null);var s=i||a,l={frag:a,part:i,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},C=s.byteRangeStartOffset,v=s.byteRangeEndOffset;return Object(X.isFiniteNumber)(C)&&Object(X.isFiniteNumber)(v)&&(l.rangeStart=C,l.rangeEnd=v),l}var g=function(a){P(i,a);function i(s){for(var l,C=arguments.length,v=new Array(C>1?C-1:0),y=1;y>8*(15-R)&255;return y},l.setDecryptDataFromLevelKey=function(v,y){var R=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(R=U.LevelKey.fromURI(v.uri),R.method=v.method,R.iv=this.createInitializationVector(y),R.keyFormat="identity"),R},l.setElementaryStreamInfo=function(v,y,R,w,x,b){b===void 0&&(b=!1);var h=this.elementaryStreams,u=h[v];if(!u){h[v]={startPTS:y,endPTS:R,startDTS:w,endDTS:x,partial:b};return}u.startPTS=Math.min(u.startPTS,y),u.endPTS=Math.max(u.endPTS,R),u.startDTS=Math.min(u.startDTS,w),u.endDTS=Math.max(u.endDTS,x)},l.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[p.AUDIO]=null,v[p.VIDEO]=null,v[p.AUDIOVIDEO]=null},T(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var v=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),s}(m),a=function(i){L(s,i);function s(l,C,v,y,R){var w;w=i.call(this,v)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new O.LoadStats,w.duration=l.decimalFloatingPoint("DURATION"),w.gap=l.bool("GAP"),w.independent=l.bool("INDEPENDENT"),w.relurl=l.enumeratedString("URI"),w.fragment=C,w.index=y;var x=l.enumeratedString("BYTERANGE");return x&&w.setByteRange(x,R),R&&(w.fragOffset=R.fragOffset+R.duration),w}return T(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var C=this.elementaryStreams;return!!(C.audio||C.video||C.audiovideo)}}]),s}(m)},"./src/loader/key-loader.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return W});var X=_("./src/events.ts"),F=_("./src/errors.ts"),P=_("./src/utils/logger.ts"),W=function(){function U(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var O=U.prototype;return O._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},O._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},O.destroy=function(){this._unregisterListeners();for(var d in this.loaders){var f=this.loaders[d];f&&f.destroy()}this.loaders={}},O.onKeyLoading=function(d,f){var T=f.frag,p=T.type,m=this.loaders[p];if(!T.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var g=T.decryptdata.uri;if(g!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(m&&(P.logger.warn("abort previous key loader for type:"+p),m.abort()),!g){P.logger.warn("key uri is falsy");return}var i=a.loader,s=T.loader=this.loaders[p]=new i(a);this.decrypturl=g,this.decryptkey=null;var l={url:g,frag:T,responseType:"arraybuffer"},C={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(l,C,v)}else this.decryptkey&&(T.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:T}))},O.loadsuccess=function(d,f,T){var p=T.frag;if(!p.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=p.decryptdata.key=new Uint8Array(d.data),p.loader=null,delete this.loaders[p.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:p})},O.loaderror=function(d,f){var T=f.frag,p=T.loader;p&&p.abort(),delete this.loaders[T.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:T,response:d})},O.loadtimeout=function(d,f){var T=f.frag,p=T.loader;p&&p.abort(),delete this.loaders[T.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:T})},U}()},"./src/loader/level-details.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"LevelDetails",function(){return U});var X=_("./src/polyfills/number.ts");function F(O,L){for(var d=0;df.endSN||T>0||T===0&&p>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},P(O,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var T=this.driftEnd-this.driftStart;return T*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"LevelKey",function(){return U});var X=_("./node_modules/url-toolkit/src/url-toolkit.js"),F=_.n(X);function P(O,L){for(var d=0;d2){var h=b.shift()+".";return h+=parseInt(b.shift()).toString(16),h+=("000"+parseInt(b.shift()).toString(16)).substr(-4),h}return x},R.resolve=function(x,b){return F.buildAbsoluteURL(b,x,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(x,b){var h=[],u={},A=!1;T.lastIndex=0;for(var S;(S=T.exec(x))!=null;)if(S[1]){var D=new L.AttrList(S[1]),I={attrs:D,bitrate:D.decimalInteger("AVERAGE-BANDWIDTH")||D.decimalInteger("BANDWIDTH"),name:D.NAME,url:R.resolve(S[2],b)},B=D.decimalResolution("RESOLUTION");B&&(I.width=B.width,I.height=B.height),l((D.CODECS||"").split(/[ ,]+/).filter(function(z){return z}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=R.convertAVC1ToAVCOTI(I.videoCodec)),h.push(I)}else if(S[3]){var j=new L.AttrList(S[3]);j["DATA-ID"]&&(A=!0,u[j["DATA-ID"]]=j)}return{levels:h,sessionData:A?u:null}},R.parseMasterPlaylistMedia=function(x,b,h,u){u===void 0&&(u=[]);var A,S=[],D=0;for(p.lastIndex=0;(A=p.exec(x))!==null;){var I=new L.AttrList(A[1]);if(I.TYPE===h){var B={attrs:I,bitrate:0,id:D++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:h,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?R.resolve(I.URI,b):""};if(u.length){var j=R.findGroup(u,B.groupId)||u[0];C(B,j,"audioCodec"),C(B,j,"textCodec")}S.push(B)}}return S},R.parseLevelPlaylist=function(x,b,h,u,A){var S=new U.LevelDetails(b),D=S.fragments,I=null,B=0,j=0,z=0,M=0,N=null,Y=new W.Fragment(u,b),ee,le,fe,Oe=-1,Se=!1;for(m.lastIndex=0,S.m3u8=x;(ee=m.exec(x))!==null;){Se&&(Se=!1,Y=new W.Fragment(u,b),Y.start=z,Y.sn=B,Y.cc=M,Y.level=h,I&&(Y.initSegment=I,Y.rawProgramDateTime=I.rawProgramDateTime));var ke=ee[1];if(ke){Y.duration=parseFloat(ke);var Le=(" "+ee[2]).slice(1);Y.title=Le||null,Y.tagList.push(Le?["INF",ke,Le]:["INF",ke])}else if(ee[3])Object(X.isFiniteNumber)(Y.duration)&&(Y.start=z,fe&&(Y.levelkey=fe),Y.sn=B,Y.level=h,Y.cc=M,Y.urlId=A,D.push(Y),Y.relurl=(" "+ee[3]).slice(1),y(Y,N),N=Y,z+=Y.duration,B++,j=0,Se=!0);else if(ee[4]){var Ae=(" "+ee[4]).slice(1);N?Y.setByteRange(Ae,N):Y.setByteRange(Ae)}else if(ee[5])Y.rawProgramDateTime=(" "+ee[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Oe===-1&&(Oe=D.length);else{if(ee=ee[0].match(g),!ee){d.logger.warn("No matches on slow regex match for level playlist!");continue}for(le=1;le-1){d.logger.warn("Keyformat "+et+" is not supported from the manifest");continue}else if(et!=="identity")continue;we&&(fe=O.LevelKey.fromURL(b,Me),Me&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(we)>=0&&(fe.method=we,fe.keyFormat=et,Be&&(fe.keyID=Be),Ue&&(fe.keyFormatVersions=Ue),fe.iv=Fe));break}case"START":{var Ze=new L.AttrList(de),Ye=Ze.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Ye)&&(S.startTimeOffset=Ye);break}case"MAP":{var dt=new L.AttrList(de);Y.relurl=dt.URI,dt.BYTERANGE&&Y.setByteRange(dt.BYTERANGE),Y.level=h,Y.sn="initSegment",fe&&(Y.levelkey=fe),Y.initSegment=null,I=Y,Se=!0;break}case"SERVER-CONTROL":{var qe=new L.AttrList(de);S.canBlockReload=qe.bool("CAN-BLOCK-RELOAD"),S.canSkipUntil=qe.optionalFloat("CAN-SKIP-UNTIL",0),S.canSkipDateRanges=S.canSkipUntil>0&&qe.bool("CAN-SKIP-DATERANGES"),S.partHoldBack=qe.optionalFloat("PART-HOLD-BACK",0),S.holdBack=qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ot=new L.AttrList(de);S.partTarget=ot.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ie=S.partList;Ie||(Ie=S.partList=[]);var Qe=j>0?Ie[Ie.length-1]:void 0,st=j++,je=new W.Part(new L.AttrList(de),Y,b,st,Qe);Ie.push(je),Y.duration+=je.duration;break}case"PRELOAD-HINT":{var Xe=new L.AttrList(de);S.preloadHint=Xe;break}case"RENDITION-REPORT":{var Ce=new L.AttrList(de);S.renditionReports=S.renditionReports||[],S.renditionReports.push(Ce);break}default:d.logger.warn("line parsed but not handled: "+ee);break}}}N&&!N.relurl?(D.pop(),z-=N.duration,S.partList&&(S.fragmentHint=N)):S.partList&&(y(Y,N),Y.cc=M,S.fragmentHint=Y);var be=D.length,Ee=D[0],ne=D[be-1];if(z+=S.skippedSegments*S.targetduration,z>0&&be&&ne){S.averagetargetduration=z/be;var oe=ne.sn;S.endSN=oe!=="initSegment"?oe:0,Ee&&(S.startCC=Ee.cc,Ee.initSegment||S.fragments.every(function(ce){return ce.relurl&&i(ce.relurl)})&&(d.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new W.Fragment(u,b),Y.relurl=ne.relurl,Y.level=h,Y.sn="initSegment",Ee.initSegment=Y,S.needSidxRanges=!0))}else S.endSN=0,S.startCC=0;return S.fragmentHint&&(z+=S.fragmentHint.duration),S.totalduration=z,S.endCC=M,Oe>0&&v(D,Oe),S},R}();function l(R,w){["video","audio","text"].forEach(function(x){var b=R.filter(function(u){return Object(f.isCodecType)(u,x)});if(b.length){var h=b.filter(function(u){return u.lastIndexOf("avc1",0)===0||u.lastIndexOf("mp4a",0)===0});w[x+"Codec"]=h.length>0?h[0]:b[0],R=R.filter(function(u){return b.indexOf(u)===-1})}}),w.unknownCodecs=R}function C(R,w,x){var b=w[x];b&&(R[x]=b)}function v(R,w){for(var x=R[w],b=w;b--;){var h=R[b];if(!h)return;h.programDateTime=x.programDateTime-h.duration*1e3,x=h}}function y(R,w){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):w!=null&&w.programDateTime&&(R.programDateTime=w.endProgramDateTime),Object(X.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/polyfills/number.ts"),F=_("./src/events.ts"),P=_("./src/errors.ts"),W=_("./src/utils/logger.ts"),U=_("./src/utils/mp4-tools.ts"),O=_("./src/loader/m3u8-parser.ts"),L=_("./src/types/loader.ts"),d=_("./src/utils/attr-list.ts");function f(m){var g=m.type;switch(g){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function T(m,g){var a=m.url;return(a===void 0||a.indexOf("data:")===0)&&(a=g.url),a}var p=function(){function m(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var g=m.prototype;return g.registerListeners=function(){var i=this.hls;i.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.unregisterListeners=function(){var i=this.hls;i.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.createInternalLoader=function(i){var s=this.hls.config,l=s.pLoader,C=s.loader,v=l||C,y=new v(s);return i.loader=y,this.loaders[i.type]=y,y},g.getInternalLoader=function(i){return this.loaders[i.type]},g.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},g.destroyInternalLoaders=function(){for(var i in this.loaders){var s=this.loaders[i];s&&s.destroy(),this.resetInternalLoader(i)}},g.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},g.onManifestLoading=function(i,s){var l=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:l,deliveryDirectives:null})},g.onLevelLoading=function(i,s){var l=s.id,C=s.level,v=s.url,y=s.deliveryDirectives;this.load({id:l,groupId:null,level:C,responseType:"text",type:L.PlaylistContextType.LEVEL,url:v,deliveryDirectives:y})},g.onAudioTrackLoading=function(i,s){var l=s.id,C=s.groupId,v=s.url,y=s.deliveryDirectives;this.load({id:l,groupId:C,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:y})},g.onSubtitleTrackLoading=function(i,s){var l=s.id,C=s.groupId,v=s.url,y=s.deliveryDirectives;this.load({id:l,groupId:C,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:y})},g.load=function(i){var s,l=this.hls.config,C=this.getInternalLoader(i);if(C){var v=C.context;if(v&&v.url===i.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),C.abort()}var y,R,w,x;switch(i.type){case L.PlaylistContextType.MANIFEST:y=l.manifestLoadingMaxRetry,R=l.manifestLoadingTimeOut,w=l.manifestLoadingRetryDelay,x=l.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:y=0,R=l.levelLoadingTimeOut;break;default:y=l.levelLoadingMaxRetry,R=l.levelLoadingTimeOut,w=l.levelLoadingRetryDelay,x=l.levelLoadingMaxRetryTimeout;break}if(C=this.createInternalLoader(i),(s=i.deliveryDirectives)!==null&&s!==void 0&&s.part){var b;if(i.type===L.PlaylistContextType.LEVEL&&i.level!==null?b=this.hls.levels[i.level].details:i.type===L.PlaylistContextType.AUDIO_TRACK&&i.id!==null?b=this.hls.audioTracks[i.id].details:i.type===L.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(b=this.hls.subtitleTracks[i.id].details),b){var h=b.partTarget,u=b.targetduration;h&&u&&(R=Math.min(Math.max(h*3,u*.8)*1e3,R))}}var A={timeout:R,maxRetry:y,retryDelay:w,maxRetryDelay:x,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};C.load(i,A,S)},g.loadsuccess=function(i,s,l,C){if(C===void 0&&(C=null),l.isSidxRequest){this.handleSidxRequest(i,l),this.handlePlaylistLoaded(i,s,l,C);return}this.resetInternalLoader(l.type);var v=i.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,l,"no EXTM3U delimiter",C);return}s.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,s,l,C):this.handleMasterPlaylist(i,s,l,C)},g.loaderror=function(i,s,l){l===void 0&&(l=null),this.handleNetworkError(s,l,!1,i)},g.loadtimeout=function(i,s,l){l===void 0&&(l=null),this.handleNetworkError(s,l,!0)},g.handleMasterPlaylist=function(i,s,l,C){var v=this.hls,y=i.data,R=T(i,l),w=O.default.parseMasterPlaylist(y,R),x=w.levels,b=w.sessionData;if(!x.length){this.handleManifestParsingError(i,l,"no level found in manifest",C);return}var h=x.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),u=x.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),A=O.default.parseMasterPlaylistMedia(y,R,"AUDIO",h),S=O.default.parseMasterPlaylistMedia(y,R,"SUBTITLES",u),D=O.default.parseMasterPlaylistMedia(y,R,"CLOSED-CAPTIONS");if(A.length){var I=A.some(function(B){return!B.url});!I&&x[0].audioCodec&&!x[0].attrs.AUDIO&&(W.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),A.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new d.AttrList({}),bitrate:0,url:""}))}v.trigger(F.Events.MANIFEST_LOADED,{levels:x,audioTracks:A,subtitles:S,captions:D,url:R,stats:s,networkDetails:C,sessionData:b})},g.handleTrackOrLevelPlaylist=function(i,s,l,C){var v=this.hls,y=l.id,R=l.level,w=l.type,x=T(i,l),b=Object(X.isFiniteNumber)(y)?y:0,h=Object(X.isFiniteNumber)(R)?R:b,u=f(l),A=O.default.parseLevelPlaylist(i.data,x,h,u,b);if(!A.fragments.length){v.trigger(F.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:x,reason:"no fragments found in level",level:typeof l.level=="number"?l.level:void 0});return}if(w===L.PlaylistContextType.MANIFEST){var S={attrs:new d.AttrList({}),bitrate:0,details:A,name:"",url:x};v.trigger(F.Events.MANIFEST_LOADED,{levels:[S],audioTracks:[],url:x,stats:s,networkDetails:C,sessionData:null})}if(s.parsing.end=performance.now(),A.needSidxRanges){var D,I=(D=A.fragments[0].initSegment)===null||D===void 0?void 0:D.url;this.load({url:I,isSidxRequest:!0,type:w,level:R,levelDetails:A,id:y,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}l.levelDetails=A,this.handlePlaylistLoaded(i,s,l,C)},g.handleSidxRequest=function(i,s){var l=Object(U.parseSegmentIndex)(new Uint8Array(i.data));if(!l)return;var C=l.references,v=s.levelDetails;C.forEach(function(y,R){var w=y.info,x=v.fragments[R];x.byteRange.length===0&&x.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),x.initSegment&&x.initSegment.setByteRange(String(l.moovEndOffset)+"@0")})},g.handleManifestParsingError=function(i,s,l,C){this.hls.trigger(F.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===L.PlaylistContextType.MANIFEST,url:i.url,reason:l,response:i,context:s,networkDetails:C})},g.handleNetworkError=function(i,s,l,C){l===void 0&&(l=!1),W.logger.warn("[playlist-loader]: A network "+(l?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var v=P.ErrorDetails.UNKNOWN,y=!1,R=this.getInternalLoader(i);switch(i.type){case L.PlaylistContextType.MANIFEST:v=l?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,y=!0;break;case L.PlaylistContextType.LEVEL:v=l?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,y=!1;break;case L.PlaylistContextType.AUDIO_TRACK:v=l?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,y=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:v=l?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,y=!1;break}R&&this.resetInternalLoader(i.type);var w={type:P.ErrorTypes.NETWORK_ERROR,details:v,fatal:y,url:i.url,loader:R,context:i,networkDetails:s};C&&(w.response=C),this.hls.trigger(F.Events.ERROR,w)},g.handlePlaylistLoaded=function(i,s,l,C){var v=l.type,y=l.level,R=l.id,w=l.groupId,x=l.loader,b=l.levelDetails,h=l.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(i,l,"invalid target duration",C);return}if(!x)return;b.live&&(x.getCacheAge&&(b.ageHeader=x.getCacheAge()||0),(!x.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(v){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(F.Events.LEVEL_LOADED,{details:b,level:y||0,id:R||0,stats:s,networkDetails:C,deliveryDirectives:h});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(F.Events.AUDIO_TRACK_LOADED,{details:b,id:R||0,groupId:w||"",stats:s,networkDetails:C,deliveryDirectives:h});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(F.Events.SUBTITLE_TRACK_LOADED,{details:b,id:R||0,groupId:w||"",stats:s,networkDetails:C,deliveryDirectives:h});break}},m}();J.default=p},"./src/polyfills/number.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"isFiniteNumber",function(){return X}),_.d(J,"MAX_SAFE_INTEGER",function(){return F});var X=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},F=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ue,J,_){"use strict";_.r(J);var X=function(){function F(){}return F.getSilentFrame=function(W,U){switch(W){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(U===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(U===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},F}();J.default=X},"./src/remux/mp4-generator.ts":function(ue,J,_){"use strict";_.r(J);var X=Math.pow(2,32)-1,F=function(){function P(){}return P.init=function(){P.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var U;for(U in P.types)P.types.hasOwnProperty(U)&&(P.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var O=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]),L=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]);P.HDLR_TYPES={video:O,audio:L};var d=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=f,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var T=new Uint8Array([105,115,111,109]),p=new Uint8Array([97,118,99,49]),m=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,T,m,T,p),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,d))},P.box=function(U){for(var O=8,L=arguments.length,d=new Array(L>1?L-1:0),f=1;f>24&255,m[1]=O>>16&255,m[2]=O>>8&255,m[3]=O&255,m.set(U,4),T=0,O=8;T>24&255,U>>16&255,U>>8&255,U&255,L>>24,L>>16&255,L>>8&255,L&255,d>>24,d>>16&255,d>>8&255,d&255,85,196,0,0]))},P.mdia=function(U){return P.box(P.types.mdia,P.mdhd(U.timescale,U.duration),P.hdlr(U.type),P.minf(U))},P.mfhd=function(U){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},P.minf=function(U){return U.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(U)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(U))},P.moof=function(U,O,L){return P.box(P.types.moof,P.mfhd(U),P.traf(L,O))},P.moov=function(U){for(var O=U.length,L=[];O--;)L[O]=P.trak(U[O]);return P.box.apply(null,[P.types.moov,P.mvhd(U[0].timescale,U[0].duration)].concat(L).concat(P.mvex(U)))},P.mvex=function(U){for(var O=U.length,L=[];O--;)L[O]=P.trex(U[O]);return P.box.apply(null,[P.types.mvex].concat(L))},P.mvhd=function(U,O){O*=U;var L=Math.floor(O/(X+1)),d=Math.floor(O%(X+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,L>>24,L>>16&255,L>>8&255,L&255,d>>24,d>>16&255,d>>8&255,d&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return P.box(P.types.mvhd,f)},P.sdtp=function(U){var O=U.samples||[],L=new Uint8Array(4+O.length),d,f;for(d=0;d>>8&255),O.push(T&255),O=O.concat(Array.prototype.slice.call(f));for(d=0;d>>8&255),L.push(T&255),L=L.concat(Array.prototype.slice.call(f));var p=P.box(P.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|U.sps.length].concat(O).concat([U.pps.length]).concat(L))),m=U.width,g=U.height,a=U.pixelRatio[0],i=U.pixelRatio[1];return P.box(P.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,m>>8&255,m&255,g>>8&255,g&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),p,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,i>>24,i>>16&255,i>>8&255,i&255])))},P.esds=function(U){var O=U.config.length;return new Uint8Array([0,0,0,0,3,23+O,0,1,0,4,15+O,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([O]).concat(U.config).concat([6,1,2]))},P.mp4a=function(U){var O=U.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),P.box(P.types.esds,P.esds(U)))},P.mp3=function(U){var O=U.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},P.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(U)):P.box(P.types.stsd,P.STSD,P.mp4a(U)):P.box(P.types.stsd,P.STSD,P.avc1(U))},P.tkhd=function(U){var O=U.id,L=U.duration*U.timescale,d=U.width,f=U.height,T=Math.floor(L/(X+1)),p=Math.floor(L%(X+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,0,0,0,0,T>>24,T>>16&255,T>>8&255,T&255,p>>24,p>>16&255,p>>8&255,p&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,d>>8&255,d&255,0,0,f>>8&255,f&255,0,0]))},P.traf=function(U,O){var L=P.sdtp(U),d=U.id,f=Math.floor(O/(X+1)),T=Math.floor(O%(X+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,T>>24,T>>16&255,T>>8&255,T&255])),P.trun(U,L.length+16+20+8+16+8+8),L)},P.trak=function(U){return U.duration=U.duration||4294967295,P.box(P.types.trak,P.tkhd(U),P.mdia(U))},P.trex=function(U){var O=U.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(U,O){var L=U.samples||[],d=L.length,f=12+16*d,T=new Uint8Array(f),p,m,g,a,i,s;for(O+=8+f,T.set([0,0,15,1,d>>>24&255,d>>>16&255,d>>>8&255,d&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),p=0;p>>24&255,g>>>16&255,g>>>8&255,g&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*p);return P.box(P.types.trun,T)},P.initSegment=function(U){P.types||P.init();var O=P.moov(U),L=new Uint8Array(P.FTYP.byteLength+O.byteLength);return L.set(P.FTYP),L.set(O,P.FTYP.byteLength),L},P}();F.types=void 0,F.HDLR_TYPES=void 0,F.STTS=void 0,F.STSC=void 0,F.STCO=void 0,F.STSZ=void 0,F.VMHD=void 0,F.SMHD=void 0,F.STSD=void 0,F.FTYP=void 0,F.DINF=void 0,J.default=F},"./src/remux/mp4-remuxer.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return s}),_.d(J,"normalizePts",function(){return l});var X=_("./src/polyfills/number.ts"),F=_("./src/remux/aac-helper.ts"),P=_("./src/remux/mp4-generator.ts"),W=_("./src/events.ts"),U=_("./src/errors.ts"),O=_("./src/utils/logger.ts"),L=_("./src/types/loader.ts"),d=_("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(R){for(var w=1;w0?A:S.pts},b[0].pts);return h&&O.logger.debug("PTS rollover detected"),u},w.remux=function(b,h,u,A,S,D,I,B){var j,z,M,N,Y,ee,le=S,fe=S,Oe=b.pid>-1,Se=h.pid>-1,ke=h.samples.length,Le=b.samples.length>0,Ae=ke>1,ge=(!Oe||Le)&&(!Se||Ae)||this.ISGenerated||I;if(ge){this.ISGenerated||(M=this.generateIS(b,h,S));var de=this.isVideoContiguous,re=-1;if(Ae&&(re=C(h.samples),!de&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,re>0){O.logger.warn("[mp4-remuxer]: Dropped "+re+" out of "+ke+" video samples due to a missing keyframe");var he=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(re),h.dropped+=re,fe+=(h.samples[0].pts-he)/(h.timescale||9e4)}else re===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+ke+" video samples"),ee=!1);if(this.ISGenerated){if(Le&&Ae){var se=this.getVideoStartPts(h.samples),De=l(b.samples[0].pts,se)-se,ie=De/h.inputTimeScale;le+=Math.max(0,ie),fe+=Math.max(0,-ie)}if(Le){if(b.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),M=this.generateIS(b,h,S)),z=this.remuxAudio(b,le,this.isAudioContiguous,D,Se||Ae||B===L.PlaylistLevelType.AUDIO?fe:void 0),Ae){var ae=z?z.endPTS-z.startPTS:0;h.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),M=this.generateIS(b,h,S)),j=this.remuxVideo(h,fe,de,ae)}}else Ae&&(j=this.remuxVideo(h,fe,de,0));j&&(j.firstKeyFrame=re,j.independent=re!==-1)}}return this.ISGenerated&&(u.samples.length&&(Y=this.remuxID3(u,S)),A.samples.length&&(N=this.remuxText(A,S))),{audio:z,video:j,initSegment:M,independent:ee,text:N,id3:Y}},w.generateIS=function(b,h,u){var A=b.samples,S=h.samples,D=this.typeSupported,I={},B=!Object(X.isFiniteNumber)(this._initPTS),j="audio/mp4",z,M,N;if(B&&(z=M=Infinity),b.config&&A.length&&(b.timescale=b.samplerate,b.isAAC||(D.mpeg?(j="audio/mpeg",b.codec=""):D.mp3&&(b.codec="mp3")),I.audio={id:"audio",container:j,codec:b.codec,initSegment:!b.isAAC&&D.mpeg?new Uint8Array(0):P.default.initSegment([b]),metadata:{channelCount:b.channelCount}},B&&(N=b.inputTimeScale,z=M=A[0].pts-Math.round(N*u))),h.sps&&h.pps&&S.length&&(h.timescale=h.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:P.default.initSegment([h]),metadata:{width:h.width,height:h.height}},B)){N=h.inputTimeScale;var Y=this.getVideoStartPts(S),ee=Math.round(N*u);M=Math.min(M,l(S[0].dts,Y)-ee),z=Math.min(z,Y-ee)}if(Object.keys(I).length)return this.ISGenerated=!0,B&&(this._initPTS=z,this._initDTS=M),{tracks:I,initPTS:z,timescale:N}},w.remuxVideo=function(b,h,u,A){var S=b.inputTimeScale,D=b.samples,I=[],B=D.length,j=this._initPTS,z=this.nextAvcDts,M=8,N,Y,ee,le=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,Oe=0,Se=!1;if(!u||z===null){var ke=h*S,Le=D[0].pts-l(D[0].dts,D[0].pts);z=ke-Le}for(var Ae=0;Aege.pts){var de=9e4*.2;Oe=Math.max(Math.min(Oe,ge.pts-ge.dts),-1*de)}ge.dts0?Ae-1:Ae].dts&&(Se=!0)}Se&&D.sort(function(Lt,wt){var ft=Lt.dts-wt.dts,zt=Lt.pts-wt.pts;return ft||zt}),Y=D[0].dts,ee=D[D.length-1].dts;var re=Math.round((ee-Y)/(B-1));if(Oe<0){if(Oere,me=ie<-1;if(ae||me){ae?O.logger.warn("AVC: "+Object(d.toMsFromMpegTsClock)(ie,!0)+" ms ("+ie+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(d.toMsFromMpegTsClock)(-ie,!0)+" ms ("+ie+"dts) overlapping between fragments detected"),Y=z;var we=D[0].pts-ie;D[0].dts=Y,D[0].pts=we,O.logger.log("Video: First PTS/DTS adjusted: "+Object(d.toMsFromMpegTsClock)(we,!0)+"/"+Object(d.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(d.toMsFromMpegTsClock)(ie,!0)+" ms")}}i&&(Y=Math.max(0,Y));for(var Me=0,Fe=0,Ue=0;Ue0?Ie-1:Ie].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var ve=Math.floor(oe.maxBufferHole*S),Ne=(A?le+A*S:this.nextAudioPts)-Qe.pts;Ne>ve?(N=Ne-ce,N<0&&(N=ce),O.logger.log("[mp4-remuxer]: It is approximately "+Ne/90+" ms to the next segment; using duration "+N/90+" ms for the last video frame.")):N=ce}else N=ce}var Re=Math.round(Qe.pts-Qe.dts);I.push(new v(Qe.key,N,je,Re))}if(I.length&&g&&g<70){var ze=I[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert(N!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=z=ee+N,this.isVideoContiguous=!0;var it=P.default.moof(b.sequenceNumber++,Y,f({},b,{samples:I})),ct="video",ht={data1:it,data2:qe,startPTS:le/S,endPTS:(fe+N)/S,startDTS:Y/S,endDTS:z/S,type:ct,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(qe.length,"MDAT length must not be zero"),ht},w.remuxAudio=function(b,h,u,A,S){var D=b.inputTimeScale,I=b.samplerate?b.samplerate:D,B=D/I,j=b.isAAC?p:m,z=j*B,M=this._initPTS,N=!b.isAAC&&this.typeSupported.mpeg,Y=[],ee=b.samples,le=N?0:8,fe=this.nextAudioPts||-1,Oe=h*D;if(this.isAudioContiguous=u=u||ee.length&&fe>0&&(A&&Math.abs(Oe-fe)<9e3||Math.abs(l(ee[0].pts-M,Oe)-fe)<20*z),ee.forEach(function(Ee){Ee.pts=l(Ee.pts-M,Oe)}),!u||fe<0){if(ee=ee.filter(function(Ee){return Ee.pts>=0}),!ee.length)return;S===0?fe=0:A?fe=Math.max(0,Oe):fe=ee[0].pts}if(b.isAAC)for(var Se=S!==void 0,ke=this.config.maxAudioFramesDrift,Le=0,Ae=fe;Le=ke*z&&he0){Fe+=le;try{Me=new Uint8Array(Fe)}catch(Ee){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Fe,reason:"fail allocating audio mdat "+Fe});return}if(!N){var qe=new DataView(Me.buffer);qe.setUint32(0,Fe),Me.set(P.default.types.mdat,4)}}else return;Me.set(Ze,le);var ot=Ze.byteLength;le+=ot,Y.push(new v(!0,j,ot,0)),we=Ye}var Ie=Y.length;if(!Ie)return;var Qe=Y[Y.length-1];this.nextAudioPts=fe=we+B*Qe.duration;var st=N?new Uint8Array(0):P.default.moof(b.sequenceNumber++,me/B,f({},b,{samples:Y}));b.samples=[];var je=me/D,Xe=fe/D,Ce="audio",be={data1:st,data2:Me,startPTS:je,endPTS:Xe,startDTS:je,endDTS:Xe,type:Ce,hasAudio:!0,hasVideo:!1,nb:Ie};return this.isAudioContiguous=!0,console.assert(Me.length,"MDAT length must not be zero"),be},w.remuxEmptyAudio=function(b,h,u,A){var S=b.inputTimeScale,D=b.samplerate?b.samplerate:S,I=S/D,B=this.nextAudioPts,j=(B!==null?B:A.startDTS*S)+this._initDTS,z=A.endDTS*S+this._initDTS,M=I*p,N=Math.ceil((z-j)/M),Y=F.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],le=0;le4294967296;)R+=x;return R}function C(R){for(var w=0;w0?this.lastEndDTS=b:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!R.audio,u=!!R.video,A="";h&&(A+="audio"),u&&(A+="video");var S={data1:v,startPTS:x,startDTS:x,endPTS:b,endDTS:b,type:A,hasAudio:h,hasVideo:u,nb:1,dropped:0};return C.audio=S.type==="audio"?S:void 0,C.video=S.type!=="audio"?S:void 0,C.text=a,C.id3=g,C.initSegment=y,C},d}(),O=function(f,T,p){return Object(F.getStartDTS)(f,T)-p};function L(d,f){var T=d==null?void 0:d.codec;return T&&T.length>4?T:T==="hvc1"?"hvc1.1.c.L120.90":T==="av01"?"av01.0.04M.08":T==="avc1"||f===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}J.default=U},"./src/task-loop.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return X});var X=function(){function F(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=F.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},F}()},"./src/types/cmcd.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"CMCDVersion",function(){return X}),_.d(J,"CMCDObjectType",function(){return F}),_.d(J,"CMCDStreamingFormat",function(){return P}),_.d(J,"CMCDStreamType",function(){return W});var X=1,F;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(F||(F={}));var P;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(P||(P={}));var W;(function(U){U.VOD="v",U.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"HlsSkip",function(){return P}),_.d(J,"getSkipValue",function(){return W}),_.d(J,"HlsUrlParameters",function(){return U}),_.d(J,"Level",function(){return O});function X(L,d){for(var f=0;fNumber.MAX_SAFE_INTEGER?Infinity:d},U.hexadecimalInteger=function(L){if(this[L]){var d=(this[L]||"0x").slice(2);d=(d.length&1?"0":"")+d;for(var f=new Uint8Array(d.length/2),T=0;TNumber.MAX_SAFE_INTEGER?Infinity:d},U.decimalFloatingPoint=function(L){return parseFloat(this[L])},U.optionalFloat=function(L,d){var f=this[L];return f?parseFloat(f):d},U.enumeratedString=function(L){return this[L]},U.bool=function(L){return this[L]==="YES"},U.decimalResolution=function(L){var d=X.exec(this[L]);return d===null?void 0:{width:parseInt(d[1],10),height:parseInt(d[2],10)}},W.parseAttrList=function(L){var d,f={},T='"';for(F.lastIndex=0;(d=F.exec(L))!==null;){var p=d[2];p.indexOf(T)===0&&p.lastIndexOf(T)===p.length-1&&(p=p.slice(1,-1)),f[d[1]]=p}return f},W}()},"./src/utils/binary-search.ts":function(ue,J,_){"use strict";_.r(J);var X={search:function(P,W){for(var U=0,O=P.length-1,L=null,d=null;U<=O;){L=(U+O)/2|0,d=P[L];var f=W(d);if(f>0)U=L+1;else if(f<0)O=L-1;else return d}return null}};J.default=X},"./src/utils/buffer-helper.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"BufferHelper",function(){return P});var X=_("./src/utils/logger.ts"),F={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function W(){}return W.isBuffered=function(O,L){try{if(O){for(var d=W.getBuffered(O),f=0;f=d.start(f)&&L<=d.end(f))return!0}}catch(T){}return!1},W.bufferInfo=function(O,L,d){try{if(O){var f=W.getBuffered(O),T=[],p;for(p=0;pm&&(f[p-1].end=O[T].end):f.push(O[T])}else f.push(O[T])}else f=O;for(var g=0,a,i=L,s=L,l=0;l=C&&L=u&&X.logger.log(this.time+" ["+u+"] "+A)},x}(),g=function(b){for(var h=[],u=0;uU&&(this.logger.log(p.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},b.moveCursor=function(u){var A=this.pos+u;if(u>1)for(var S=this.pos+1;S=144&&this.backSpace();var A=P(u);if(this.pos>=U){this.logger.log(p.ERROR,"Cannot insert "+u.toString(16)+" ("+A+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(A,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(u){var A;for(A=u;A0&&(u?S="["+A.join(" | ")+"]":S=A.join(` -`)),S},b.getTextAndFormat=function(){return this.rows},x}(),C=function(){function x(h,u,A){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=h,this.outputFilter=u,this.mode=null,this.verbose=0,this.displayedMemory=new l(A),this.nonDisplayedMemory=new l(A),this.lastOutputScreen=new l(A),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=A}var b=x.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(u){this.outputFilter=u},b.setPAC=function(u){this.writeScreen.setPAC(u)},b.setBkgData=function(u){this.writeScreen.setBkgData(u)},b.setMode=function(u){if(u===this.mode)return;this.mode=u,this.logger.log(p.INFO,"MODE="+u),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=u},b.insertChars=function(u){for(var A=0;A=46,A.italics)A.foreground="white";else{var S=Math.floor(u/2)-16,D=["white","green","blue","cyan","red","yellow","magenta"];A.foreground=D[S]}this.logger.log(p.INFO,"MIDROW: "+JSON.stringify(A)),this.writeScreen.setPen(A)},b.outputDataUpdate=function(u){u===void 0&&(u=!1);var A=this.logger.time;if(A===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=A:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,A,this.lastOutputScreen),u&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:A),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(u){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,u,this.displayedMemory),this.cueStartTime=u))},x}(),v=function(){function x(h,u,A){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var S=new m;this.channels=[null,new C(h,u,S),new C(h+1,A,S)],this.cmdHistory=w(),this.logger=S}var b=x.prototype;return b.getHandler=function(u){return this.channels[u].getHandler()},b.setHandler=function(u,A){this.channels[u].setHandler(A)},b.addData=function(u,A){var S,D,I,B=!1;this.logger.time=u;for(var j=0;j ("+g([D,I])+")"),S=this.parseCmd(D,I),S||(S=this.parseMidrow(D,I)),S||(S=this.parsePAC(D,I)),S||(S=this.parseBackgroundAttributes(D,I)),!S&&(B=this.parseChars(D,I),B)){var z=this.currentChannel;if(z&&z>0){var M=this.channels[z];M.insertChars(B)}else this.logger.log(p.WARNING,"No channel found yet. TEXT-MODE?")}!S&&!B&&this.logger.log(p.WARNING,"Couldn't parse cleaned data "+g([D,I])+" orig: "+g([A[j],A[j+1]]))}},b.parseCmd=function(u,A){var S=this.cmdHistory,D=(u===20||u===28||u===21||u===29)&&A>=32&&A<=47,I=(u===23||u===31)&&A>=33&&A<=35;if(!(D||I))return!1;if(R(u,A,S))return y(null,null,S),this.logger.log(p.DEBUG,"Repeated command ("+g([u,A])+") is dropped"),!0;var B=u===20||u===21||u===23?1:2,j=this.channels[B];return u===20||u===21||u===28||u===29?A===32?j.ccRCL():A===33?j.ccBS():A===34?j.ccAOF():A===35?j.ccAON():A===36?j.ccDER():A===37?j.ccRU(2):A===38?j.ccRU(3):A===39?j.ccRU(4):A===40?j.ccFON():A===41?j.ccRDC():A===42?j.ccTR():A===43?j.ccRTD():A===44?j.ccEDM():A===45?j.ccCR():A===46?j.ccENM():A===47&&j.ccEOC():j.ccTO(A-32),y(u,A,S),this.currentChannel=B,!0},b.parseMidrow=function(u,A){var S=0;if((u===17||u===25)&&A>=32&&A<=47){if(u===17?S=1:S=2,S!==this.currentChannel)return this.logger.log(p.ERROR,"Mismatch channel in midrow parsing"),!1;var D=this.channels[S];return D?(D.ccMIDROW(A),this.logger.log(p.DEBUG,"MIDROW ("+g([u,A])+")"),!0):!1}return!1},b.parsePAC=function(u,A){var S,D=this.cmdHistory,I=(u>=17&&u<=23||u>=25&&u<=31)&&A>=64&&A<=127,B=(u===16||u===24)&&A>=64&&A<=95;if(!(I||B))return!1;if(R(u,A,D))return y(null,null,D),!0;var j=u<=23?1:2;A>=64&&A<=95?S=j===1?O[u]:d[u]:S=j===1?L[u]:f[u];var z=this.channels[j];return z?(z.setPAC(this.interpretPAC(S,A)),y(u,A,D),this.currentChannel=j,!0):!1},b.interpretPAC=function(u,A){var S,D={color:null,italics:!1,indent:null,underline:!1,row:u};return A>95?S=A-96:S=A-64,D.underline=(S&1)===1,S<=13?D.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(S/2)]:S<=15?(D.italics=!0,D.color="white"):D.indent=Math.floor((S-16)/2)*4,D},b.parseChars=function(u,A){var S,D=null,I=null;if(u>=25?(S=2,I=u-8):(S=1,I=u),I>=17&&I<=19){var B;I===17?B=A+80:I===18?B=A+112:B=A+144,this.logger.log(p.INFO,"Special char '"+P(B)+"' in channel "+S),D=[B]}else u>=32&&u<=127&&(D=A===0?[u]:[u,A]);if(D){var j=g(D);this.logger.log(p.DEBUG,"Char codes = "+j.join(",")),y(u,A,this.cmdHistory)}return D},b.parseBackgroundAttributes=function(u,A){var S=(u===16||u===24)&&A>=32&&A<=47,D=(u===23||u===31)&&A>=45&&A<=47;if(!(S||D))return!1;var I,B={};u===16||u===24?(I=Math.floor((A-32)/2),B.background=T[I],A%2===1&&(B.background=B.background+"_semi")):A===45?B.background="transparent":(B.foreground="black",A===47&&(B.underline=!0));var j=u<=23?1:2,z=this.channels[j];return z.setBkgData(B),y(u,A,this.cmdHistory),!0},b.reset=function(){for(var u=0;u=16?i--:i++;var y=Object(X.fixLineBreaks)(s.trim()),R=Object(F.generateCueId)(d,f,y);(!L||!L.cues||!L.cues.getCueById(R))&&(g=new l(d,f,y),g.id=R,g.line=C+1,g.align="left",g.position=10+Math.min(80,Math.floor(i*8/32)*10),p.push(g))}return L&&p.length&&(p.sort(function(w,x){return w.line==="auto"||x.line==="auto"?0:w.line>8&&x.line>8?x.line-w.line:w.line-x.line}),p.forEach(function(w){return Object(P.addCueToTrack)(L,w)})),p}};J.default=U},"./src/utils/discontinuities.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"findFirstFragWithCC",function(){return W}),_.d(J,"shouldAlignOnDiscontinuities",function(){return U}),_.d(J,"findDiscontinuousReferenceFrag",function(){return O}),_.d(J,"adjustSlidingStart",function(){return d}),_.d(J,"alignStream",function(){return f}),_.d(J,"alignPDT",function(){return p}),_.d(J,"alignFragmentByPDTDelta",function(){return m}),_.d(J,"alignMediaPlaylistByPDT",function(){return g});var X=_("./src/polyfills/number.ts"),F=_("./src/utils/logger.ts"),P=_("./src/controller/level-helper.ts");function W(a,i){for(var s=null,l=0,C=a.length;ls.startCC||a&&a.cc=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},P}();J.default=F},"./src/utils/ewma.ts":function(ue,J,_){"use strict";_.r(J);var X=function(){function F(W,U,O){U===void 0&&(U=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=U,this.totalWeight_=O}var P=F.prototype;return P.sample=function(U,O){var L=Math.pow(this.alpha_,U);this.estimate_=O*(1-L)+L*this.estimate_,this.totalWeight_+=U},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},F}();J.default=X},"./src/utils/fetch-loader.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"fetchSupported",function(){return m});var X=_("./src/polyfills/number.ts"),F=_("./src/loader/load-stats.ts"),P=_("./src/demux/chunk-cache.ts");function W(l,C){l.prototype=Object.create(C.prototype),l.prototype.constructor=l,f(l,C)}function U(l){var C=typeof Map=="function"?new Map:void 0;return U=function(y){if(y===null||!d(y))return y;if(typeof y!="function")throw new TypeError("Super expression must either be null or a function");if(typeof C!="undefined"){if(C.has(y))return C.get(y);C.set(y,R)}function R(){return O(y,arguments,T(this).constructor)}return R.prototype=Object.create(y.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),f(R,y)},U(l)}function O(l,C,v){return L()?O=Reflect.construct:O=function(R,w,x){var b=[null];b.push.apply(b,w);var h=Function.bind.apply(R,b),u=new h;return x&&f(u,x.prototype),u},O.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function d(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function f(l,C){return f=Object.setPrototypeOf||function(y,R){return y.__proto__=R,y},f(l,C)}function T(l){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},T(l)}function p(){return p=Object.assign||function(l){for(var C=1;C=x&&b(R,w,h.flush(),y)):b(R,w,I,y),S()}).catch(function(){return Promise.reject()})};return A()},l}();function a(l,C){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(p({},l.headers))};return l.rangeEnd&&v.headers.set("Range","bytes="+l.rangeStart+"-"+String(l.rangeEnd-1)),v}function i(l,C){return new self.Request(l.url,C)}var s=function(l){W(C,l);function C(v,y,R){var w;return w=l.call(this,v)||this,w.code=void 0,w.details=void 0,w.code=y,w.details=R,w}return C}(U(Error));J.default=g},"./src/utils/imsc1-ttml-parser.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"IMSC1_CODEC",function(){return d}),_.d(J,"parseIMSC1",function(){return m});var X=_("./src/utils/mp4-tools.ts"),F=_("./src/utils/vttparser.ts"),P=_("./src/utils/vttcue.ts"),W=_("./src/demux/id3.ts"),U=_("./src/utils/timescale-conversion.ts"),O=_("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(x){for(var b=1;b"):X}function U(d){for(var f=arguments.length,T=new Array(f>1?f-1:0),p=1;p>24,C[v+1]=y>>16&255,C[v+2]=y>>8&255,C[v+3]=y&255}function f(C,v){var y=[];if(!v.length)return y;var R,w,x;"data"in C?(R=C.data,w=C.start,x=C.end):(R=C,w=0,x=R.byteLength);for(var b=w;b1?b+h:x;if(u===v[0])if(v.length===1)y.push({data:R,start:b+8,end:A});else{var S=f({data:R,start:b+8,end:A},v.slice(1));S.length&&W.apply(y,S)}b=A}return y}function T(C){var v=f(C,["moov"]),y=v[0],R=y?y.end:null,w=f(C,["sidx"]);if(!w||!w[0])return null;var x=[],b=w[0],h=b.data[0],u=h===0?8:16,A=L(b,u);u+=4;var S=0,D=0;h===0?u+=8:u+=16,u+=2;var I=b.end+D,B=O(b,u);u+=2;for(var j=0;j>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=L(b,z);z+=4,x.push({referenceSize:N,subsegmentDuration:ee,info:{duration:ee/A,start:I,end:I+N-1}}),I+=N,z+=4,u=z}return{earliestPresentationTime:S,timescale:A,version:h,referencesCount:B,references:x,moovEndOffset:R}}function p(C){for(var v=[],y=f(C,["moov","trak"]),R=0;RU)&&(this.startTime=U),this.endTime=O,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},F}()},"./src/utils/texttrack-utils.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"sendAddTrackEvent",function(){return F}),_.d(J,"addCueToTrack",function(){return P}),_.d(J,"clearCurrentCues",function(){return W}),_.d(J,"removeCuesInRange",function(){return U}),_.d(J,"getCuesInRange",function(){return L});var X=_("./src/utils/logger.ts");function F(d,f){var T;try{T=new Event("addtrack")}catch(p){T=document.createEvent("Event"),T.initEvent("addtrack",!1,!1)}T.track=d,f.dispatchEvent(T)}function P(d,f){var T=d.mode;if(T==="disabled"&&(d.mode="hidden"),d.cues&&!d.cues.getCueById(f.id))try{if(d.addCue(f),!d.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(m){X.logger.debug("[texttrack-utils]: "+m);var p=new self.TextTrackCue(f.startTime,f.endTime,f.text);p.id=f.id,d.addCue(p)}T==="disabled"&&(d.mode=T)}function W(d){var f=d.mode;if(f==="disabled"&&(d.mode="hidden"),d.cues)for(var T=d.cues.length;T--;)d.removeCue(d.cues[T]);f==="disabled"&&(d.mode=f)}function U(d,f,T){var p=d.mode;if(p==="disabled"&&(d.mode="hidden"),d.cues&&d.cues.length>0)for(var m=L(d.cues,f,T),g=0;gd[T].endTime)return-1;for(var p=0,m=T;p<=m;){var g=Math.floor((m+p)/2);if(fd[g].startTime&&p-1)for(var g=m,a=d.length;g=f&&i.endTime<=T)p.push(i);else if(i.startTime>T)return p}return p}},"./src/utils/time-ranges.ts":function(ue,J,_){"use strict";_.r(J);var X={toString:function(P){for(var W="",U=P.length,O=0;O1?f-1:0),p=1;p100)throw new Error("Position must be between 0 and 100.");x=S,this.hasBeenReset=!0}})),Object.defineProperty(p,"positionAlign",O({},m,{get:function(){return b},set:function(S){var D=U(S);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");b=D,this.hasBeenReset=!0}})),Object.defineProperty(p,"size",O({},m,{get:function(){return h},set:function(S){if(S<0||S>100)throw new Error("Size must be between 0 and 100.");h=S,this.hasBeenReset=!0}})),Object.defineProperty(p,"align",O({},m,{get:function(){return u},set:function(S){var D=U(S);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");u=D,this.hasBeenReset=!0}})),p.displayState=void 0}return L.prototype.getCueAsHTML=function(){var d=self.WebVTT;return d.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"parseTimeStamp",function(){return P}),_.d(J,"fixLineBreaks",function(){return f}),_.d(J,"VTTParser",function(){return T});var X=_("./src/utils/vttcue.ts"),F=function(){function p(){}var m=p.prototype;return m.decode=function(a,i){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},p}();function P(p){function m(a,i,s,l){return(a|0)*3600+(i|0)*60+(s|0)+parseFloat(l||0)}var g=p.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return g?parseFloat(g[2])>59?m(g[2],g[3],0,g[4]):m(g[1],g[2],g[3],g[4]):null}var W=function(){function p(){this.values=Object.create(null)}var m=p.prototype;return m.set=function(a,i){!this.get(a)&&i!==""&&(this.values[a]=i)},m.get=function(a,i,s){return s?this.has(a)?this.values[a]:i[s]:this.has(a)?this.values[a]:i},m.has=function(a){return a in this.values},m.alt=function(a,i,s){for(var l=0;l=0&&s<=100)return this.set(a,s),!0}return!1},p}();function U(p,m,g,a){var i=a?p.split(a):[p];for(var s in i){if(typeof i[s]!="string")continue;var l=i[s].split(g);if(l.length!==2)continue;var C=l[0],v=l[1];m(C,v)}}var O=new X.default(0,0,""),L=O.align==="middle"?"middle":"center";function d(p,m,g){var a=p;function i(){var C=P(p);if(C===null)throw new Error("Malformed timestamp: "+a);return p=p.replace(/^[^\sa-zA-Z-]+/,""),C}function s(C,v){var y=new W;U(C,function(x,b){var h;switch(x){case"region":for(var u=g.length-1;u>=0;u--)if(g[u].id===b){y.set(x,g[u].region);break}break;case"vertical":y.alt(x,b,["rl","lr"]);break;case"line":h=b.split(","),y.integer(x,h[0]),y.percent(x,h[0])&&y.set("snapToLines",!1),y.alt(x,h[0],["auto"]),h.length===2&&y.alt("lineAlign",h[1],["start",L,"end"]);break;case"position":h=b.split(","),y.percent(x,h[0]),h.length===2&&y.alt("positionAlign",h[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":y.percent(x,b);break;case"align":y.alt(x,b,["start",L,"end","left","right"]);break}},/:/,/\s/),v.region=y.get("region",null),v.vertical=y.get("vertical","");var R=y.get("line","auto");R==="auto"&&O.line===-1&&(R=-1),v.line=R,v.lineAlign=y.get("lineAlign","start"),v.snapToLines=y.get("snapToLines",!0),v.size=y.get("size",100),v.align=y.get("align",L);var w=y.get("position","auto");w==="auto"&&O.position===50&&(w=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=w}function l(){p=p.replace(/^\s+/,"")}if(l(),m.startTime=i(),l(),p.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);p=p.substr(3),l(),m.endTime=i(),l(),s(p,m)}function f(p){return p.replace(//gi,` + timeOffset: `+S);var le=new W.TransmuxConfig(l,C,s,R,b);this.configureTransmuxer(le)}if(this.frag=v,this.part=y,A)A.postMessage({cmd:"demux",data:i,decryptdata:D,chunkMeta:x,state:ee},i instanceof ArrayBuffer?[i]:[]);else if(u){var fe=u.push(i,D,x,ee);Object(W.isPromise)(fe)?fe.then(function(Oe){d.handleTransmuxComplete(Oe)}):this.handleTransmuxComplete(fe)}},g.flush=function(i){var s=this;i.transmuxing.start=self.performance.now();var l=this.transmuxer,C=this.worker;if(C)C.postMessage({cmd:"flush",chunkMeta:i});else if(l){var v=l.flush(i);Object(W.isPromise)(v)?v.then(function(y){s.handleFlushResult(y,i)}):this.handleFlushResult(v,i)}},g.handleFlushResult=function(i,s){var l=this;i.forEach(function(C){l.handleTransmuxComplete(C)}),this.onFlush(s)},g.onWorkerMessage=function(i){var s=i.data,l=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,l.trigger(s.event,s.data);break}}},g.configureTransmuxer=function(i){var s=this.worker,l=this.transmuxer;s?s.postMessage({cmd:"configure",config:i}):l&&l.configure(i)},g.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},m}()},"./src/demux/transmuxer-worker.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return O});var X=_("./src/demux/transmuxer.ts"),F=_("./src/events.ts"),P=_("./src/utils/logger.ts"),W=_("./node_modules/eventemitter3/index.js"),U=_.n(W);function O(p){var m=new W.EventEmitter,g=function(i,s){p.postMessage({event:i,data:s})};m.on(F.Events.FRAG_DECRYPTED,g),m.on(F.Events.ERROR,g),p.addEventListener("message",function(a){var i=a.data;switch(i.cmd){case"init":{var s=JSON.parse(i.config);p.transmuxer=new X.default(m,i.typeSupported,s,i.vendor,i.id),Object(P.enableLogs)(s.debug),g("init",null);break}case"configure":{p.transmuxer.configure(i.config);break}case"demux":{var l=p.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(X.isPromise)(l)?l.then(function(y){L(p,y)}):L(p,l);break}case"flush":{var C=i.chunkMeta,v=p.transmuxer.flush(C);Object(X.isPromise)(v)?v.then(function(y){f(p,y,C)}):f(p,v,C);break}default:break}})}function L(p,m){if(T(m.remuxResult))return;var g=[],a=m.remuxResult,i=a.audio,s=a.video;i&&h(g,i),s&&h(g,s),p.postMessage({event:"transmuxComplete",data:m},g)}function h(p,m){m.data1&&p.push(m.data1.buffer),m.data2&&p.push(m.data2.buffer)}function f(p,m,g){m.forEach(function(a){L(p,a)}),p.postMessage({event:"flush",data:g})}function T(p){return!p.audio&&!p.video&&!p.text&&!p.id3&&!p.initSegment}},"./src/demux/transmuxer.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return s}),_.d(J,"isPromise",function(){return v}),_.d(J,"TransmuxConfig",function(){return y}),_.d(J,"TransmuxState",function(){return R});var X=_("./src/events.ts"),F=_("./src/errors.ts"),P=_("./src/crypt/decrypter.ts"),W=_("./src/demux/aacdemuxer.ts"),U=_("./src/demux/mp4demuxer.ts"),O=_("./src/demux/tsdemuxer.ts"),L=_("./src/demux/mp3demuxer.ts"),h=_("./src/remux/mp4-remuxer.ts"),f=_("./src/remux/passthrough-remuxer.ts"),T=_("./src/demux/chunk-cache.ts"),p=_("./src/utils/mp4-tools.ts"),m=_("./src/utils/logger.ts"),g;try{g=self.performance.now.bind(self.performance)}catch(w){m.logger.debug("Unable to use Performance API on this environment"),g=self.Date.now}var a=[{demux:O.default,remux:h.default},{demux:U.default,remux:f.default},{demux:W.default,remux:h.default},{demux:L.default,remux:h.default}],i=1024;a.forEach(function(w){var x=w.demux;i=Math.max(i,x.minProbeByteLength)});var s=function(){function w(b,d,u,A,S){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 T.default,this.observer=b,this.typeSupported=d,this.config=u,this.vendor=A,this.id=S}var x=w.prototype;return x.configure=function(d){this.transmuxConfig=d,this.decrypter&&this.decrypter.reset()},x.push=function(d,u,A,S){var D=this,I=A.transmuxing;I.executeStart=g();var B=new Uint8Array(d),j=this.cache,z=this.config,M=this.currentTransmuxState,N=this.transmuxConfig;S&&(this.currentTransmuxState=S);var Y=l(B,u);if(Y&&Y.method==="AES-128"){var ee=this.getDecrypter();if(z.enableSoftwareAES){var le=ee.softwareDecrypt(B,Y.key.buffer,Y.iv.buffer);if(!le)return I.executeEnd=g(),C(A);B=new Uint8Array(le)}else return this.decryptionPromise=ee.webCryptoDecrypt(B,Y.key.buffer,Y.iv.buffer).then(function(me){var we=D.push(me,null,A);return D.decryptionPromise=null,we}),this.decryptionPromise}var fe=S||M,Oe=fe.contiguous,Se=fe.discontinuity,ke=fe.trackSwitch,Le=fe.accurateTimeOffset,Ae=fe.timeOffset,ge=N.audioCodec,he=N.videoCodec,re=N.defaultInitPts,de=N.duration,se=N.initSegmentData;if((Se||ke)&&this.resetInitSegment(se,ge,he,de),Se&&this.resetInitialTimestamp(re),Oe||this.resetContiguity(),this.needsProbing(B,Se,ke)){if(j.dataLength){var De=j.flush();B=Object(p.appendUint8Array)(De,B)}this.configureTransmuxer(B,N)}var ie=this.transmux(B,Y,Ae,Le,A),ae=this.currentTransmuxState;return ae.contiguous=!0,ae.discontinuity=!1,ae.trackSwitch=!1,I.executeEnd=g(),ie},x.flush=function(d){var u=this,A=d.transmuxing;A.executeStart=g();var S=this.decrypter,D=this.cache,I=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return u.flush(d)});var j=[],z=I.timeOffset;if(S){var M=S.flush();M&&j.push(this.push(M,null,d))}var N=D.dataLength;D.reset();var Y=this.demuxer,ee=this.remuxer;if(!Y||!ee)return N>=i&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),A.executeEnd=g(),[C(d)];var le=Y.flush(z);return v(le)?le.then(function(fe){return u.flushRemux(j,fe,d),j}):(this.flushRemux(j,le,d),j)},x.flushRemux=function(d,u,A){var S=u.audioTrack,D=u.avcTrack,I=u.id3Track,B=u.textTrack,j=this.currentTransmuxState,z=j.accurateTimeOffset,M=j.timeOffset;m.logger.log("[transmuxer.ts]: Flushed fragment "+A.sn+(A.part>-1?" p: "+A.part:"")+" of level "+A.level);var N=this.remuxer.remux(S,D,I,B,M,z,!0,this.id);d.push({remuxResult:N,chunkMeta:A}),A.transmuxing.executeEnd=g()},x.resetInitialTimestamp=function(d){var u=this.demuxer,A=this.remuxer;if(!u||!A)return;u.resetTimeStamp(d),A.resetTimeStamp(d)},x.resetContiguity=function(){var d=this.demuxer,u=this.remuxer;if(!d||!u)return;d.resetContiguity(),u.resetNextTimestamp()},x.resetInitSegment=function(d,u,A,S){var D=this.demuxer,I=this.remuxer;if(!D||!I)return;D.resetInitSegment(u,A,S),I.resetInitSegment(d,u,A)},x.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},x.transmux=function(d,u,A,S,D){var I;return u&&u.method==="SAMPLE-AES"?I=this.transmuxSampleAes(d,u,A,S,D):I=this.transmuxUnencrypted(d,A,S,D),I},x.transmuxUnencrypted=function(d,u,A,S){var D=this.demuxer.demux(d,u,!1,!this.config.progressive),I=D.audioTrack,B=D.avcTrack,j=D.id3Track,z=D.textTrack,M=this.remuxer.remux(I,B,j,z,u,A,!1,this.id);return{remuxResult:M,chunkMeta:S}},x.transmuxSampleAes=function(d,u,A,S,D){var I=this;return this.demuxer.demuxSampleAes(d,u,A).then(function(B){var j=I.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,A,S,!1,I.id);return{remuxResult:j,chunkMeta:D}})},x.configureTransmuxer=function(d,u){for(var A=this.config,S=this.observer,D=this.typeSupported,I=this.vendor,B=u.audioCodec,j=u.defaultInitPts,z=u.duration,M=u.initSegmentData,N=u.videoCodec,Y,ee=0,le=a.length;ee0&&x!=null&&x.key!=null&&x.iv!==null&&x.method!=null&&(b=x),b}var C=function(x){return{remuxResult:{},chunkMeta:x}};function v(w){return"then"in w&&w.then instanceof Function}var y=function(x,b,d,u,A){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=x,this.videoCodec=b,this.initSegmentData=d,this.duration=u,this.defaultInitPts=A},R=function(x,b,d,u,A){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=x,this.contiguous=b,this.accurateTimeOffset=d,this.trackSwitch=u,this.timeOffset=A}},"./src/demux/tsdemuxer.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"discardEPB",function(){return C});var X=_("./src/demux/adts.ts"),F=_("./src/demux/mpegaudio.ts"),P=_("./src/demux/exp-golomb.ts"),W=_("./src/demux/id3.ts"),U=_("./src/demux/sample-aes.ts"),O=_("./src/events.ts"),L=_("./src/utils/mp4-tools.ts"),h=_("./src/utils/logger.ts"),f=_("./src/errors.ts"),T={video:1,audio:2,id3:3,text:4},p=function(){function v(R,w,x){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=R,this.config=w,this.typeSupported=x}v.probe=function(w){var x=v.syncOffset(w);return x<0?!1:(x&&h.logger.warn("MPEG2-TS detected but first sync word found @ offset "+x+", junk ahead ?"),!0)},v.syncOffset=function(w){for(var x=Math.min(1e3,w.length-3*188),b=0;b>4,ge=void 0;if(Ae>1){if(ge=Se+5+w[Se+4],ge===Se+188)continue}else ge=Se+4;switch(Le){case I:ke&&(B&&(u=i(B))&&this.parseAVCPES(u,!1),B={data:[],size:0}),B&&(B.data.push(w.subarray(ge,Se+188)),B.size+=Se+188-ge);break;case j:ke&&(M&&(u=i(M))&&(S.isAAC?this.parseAACPES(u):this.parseMPEGPES(u)),M={data:[],size:0}),M&&(M.data.push(w.subarray(ge,Se+188)),M.size+=Se+188-ge);break;case z:ke&&(N&&(u=i(N))&&this.parseID3PES(u),N={data:[],size:0}),N&&(N.data.push(w.subarray(ge,Se+188)),N.size+=Se+188-ge);break;case 0:ke&&(ge+=w[ge]+1),le=this._pmtId=g(w,ge);break;case le:{ke&&(ge+=w[ge]+1);var he=a(w,ge,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);I=he.avc,I>0&&(A.pid=I),j=he.audio,j>0&&(S.pid=j,S.isAAC=he.isAAC),z=he.id3,z>0&&(D.pid=z),Y&&!ee&&(h.logger.log("reparse from beginning"),Y=!1,Se=Oe-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(O.Events.ERROR,O.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});A.pesData=B,S.pesData=M,D.pesData=N;var re={audioTrack:S,avcTrack:A,id3Track:D,textTrack:this._txtTrack};return d&&this.extractRemainingSamples(re),re},y.flush=function(){var w=this.remainderData;this.remainderData=null;var x;return w?x=this.demux(w,-1,!1,!0):x={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(x),this.sampleAes?this.decrypt(x,this.sampleAes):x},y.extractRemainingSamples=function(w){var x=w.audioTrack,b=w.avcTrack,d=w.id3Track,u=b.pesData,A=x.pesData,S=d.pesData,D;u&&(D=i(u))?(this.parseAVCPES(D,!0),b.pesData=null):b.pesData=u,A&&(D=i(A))?(x.isAAC?this.parseAACPES(D):this.parseMPEGPES(D),x.pesData=null):(A!=null&&A.size&&h.logger.log("last AAC PES packet truncated,might overlap between fragments"),x.pesData=A),S&&(D=i(S))?(this.parseID3PES(D),d.pesData=null):d.pesData=S},y.demuxSampleAes=function(w,x,b){var d=this.demux(w,b,!0,!this.config.progressive),u=this.sampleAes=new U.default(this.observer,this.config,x);return this.decrypt(d,u)},y.decrypt=function(w,x){return new Promise(function(b){var d=w.audioTrack,u=w.avcTrack;d.samples&&d.isAAC?x.decryptAacSamples(d.samples,0,function(){u.samples?x.decryptAvcSamples(u.samples,0,0,function(){b(w)}):b(w)}):u.samples&&x.decryptAvcSamples(u.samples,0,0,function(){b(w)})})},y.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},y.parseAVCPES=function(w,x){var b=this,d=this._avcTrack,u=this.parseAVCNALu(w.data),A=!1,S=this.avcSample,D,I=!1;w.data=null,S&&u.length&&!d.audFound&&(s(S,d),S=this.avcSample=m(!1,w.pts,w.dts,"")),u.forEach(function(B){switch(B.type){case 1:{D=!0,S||(S=b.avcSample=m(!0,w.pts,w.dts,"")),A&&(S.debug+="NDR "),S.frame=!0;var j=B.data;if(I&&j.length>4){var z=new P.default(j).readSliceType();(z===2||z===4||z===7||z===9)&&(S.key=!0)}break}case 5:D=!0,S||(S=b.avcSample=m(!0,w.pts,w.dts,"")),A&&(S.debug+="IDR "),S.key=!0,S.frame=!0;break;case 6:{D=!0,A&&S&&(S.debug+="SEI ");var M=new P.default(C(B.data));M.readUByte();for(var N=0,Y=0,ee=!1,le=0;!ee&&M.bytesAvailable>1;){N=0;do le=M.readUByte(),N+=le;while(le===255);Y=0;do le=M.readUByte(),Y+=le;while(le===255);if(N===4&&M.bytesAvailable!==0){ee=!0;var fe=M.readUByte();if(fe===181){var Oe=M.readUShort();if(Oe===49){var Se=M.readUInt();if(Se===1195456820){var ke=M.readUByte();if(ke===3){for(var Le=M.readUByte(),Ae=M.readUByte(),ge=31&Le,he=[Le,Ae],re=0;re16){for(var de=[],se=0;se<16;se++)de.push(M.readUByte().toString(16)),(se===3||se===5||se===7||se===9)&&de.push("-");for(var De=Y-16,ie=new Uint8Array(De),ae=0;ae=0){var M={data:w.subarray(j,S-d-1),type:z};A.push(M)}else{var N=this.getLastNalUnit();if(N&&(u&&S<=4-u&&(N.state&&(N.data=N.data.subarray(0,N.data.byteLength-u))),I=S-d-1,I>0)){var Y=new Uint8Array(N.data.byteLength+I);Y.set(N.data,0),Y.set(w.subarray(0,I),N.data.byteLength),N.data=Y,N.state=0}}S=0&&d>=0){var ee={data:w.subarray(j,x),type:z,state:d};A.push(ee)}if(A.length===0){var le=this.getLastNalUnit();if(le){var fe=new Uint8Array(le.data.byteLength+w.byteLength);fe.set(le.data,0),fe.set(w,le.data.byteLength),le.data=fe}}return b.naluState=d,A},y.parseAACPES=function(w){var x=0,b=this._audioTrack,d=this.aacOverFlow,u=w.data;if(d){this.aacOverFlow=null;var A=d.sample.unit.byteLength,S=Math.min(d.missing,A),D=A-S;d.sample.unit.set(u.subarray(0,S),D),b.samples.push(d.sample),x=d.missing}var I,B;for(I=x,B=u.length;I1;){var A=new Uint8Array(u[0].length+u[1].length);A.set(u[0]),A.set(u[1],u[0].length),u[0]=A,u.splice(1,1)}R=u[0];var S=(R[0]<<16)+(R[1]<<8)+R[2];if(S===1){if(w=(R[4]<<8)+R[5],w&&w>v.size-6)return null;var D=R[7];D&192&&(b=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,D&64?(d=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,b-d>60*9e4&&(h.logger.warn(Math.round((b-d)/9e4)+"s delta between PTS and DTS, align them"),b=d)):d=b),x=R[8];var I=x+9;if(v.size<=I)return null;v.size-=I;for(var B=new Uint8Array(v.size),j=0,z=u.length;jM){I-=M;continue}else R=R.subarray(I),M-=I,I=0;B.set(R,y),y+=M}return w&&(w-=x+3),{data:B,pts:b,dts:d,len:w}}return null}function s(v,y){if(v.units.length&&v.frame){if(v.pts===void 0){var R=y.samples,w=R.length;if(w){var x=R[w-1];v.pts=x.pts,v.dts=x.dts}else{y.dropped++;return}}y.samples.push(v)}v.debug.length&&h.logger.log(v.pts+"/"+v.dts+":"+v.debug)}function l(v,y){var R=v.length;if(R>0){if(y.pts>=v[R-1].pts)v.push(y);else for(var w=R-1;w>=0;w--)if(y.ptsb)return u;return 0}},{key:"maxAutoLevel",get:function(){var x=this.levels,b=this.autoLevelCapping,d;return b===-1&&x&&x.length?d=x.length-1:d=b,d}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(x){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,x)}},{key:"audioTracks",get:function(){var x=this.audioTrackController;return x?x.audioTracks:[]}},{key:"audioTrack",get:function(){var x=this.audioTrackController;return x?x.audioTrack:-1},set:function(x){var b=this.audioTrackController;b&&(b.audioTrack=x)}},{key:"subtitleTracks",get:function(){var x=this.subtitleTrackController;return x?x.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var x=this.subtitleTrackController;return x?x.subtitleTrack:-1},set:function(x){var b=this.subtitleTrackController;b&&(b.subtitleTrack=x)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var x=this.subtitleTrackController;return x?x.subtitleDisplay:!1},set:function(x){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=x)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(x){this.config.lowLatencyMode=x}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return i.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return y.defaultConfig?y.defaultConfig:m.hlsDefaultConfig},set:function(x){y.defaultConfig=x}}]),y}();v.defaultConfig=void 0},"./src/is-supported.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"isSupported",function(){return P}),_.d(J,"changeTypeSupported",function(){return W});var X=_("./src/utils/mediasource-helper.ts");function F(){return self.SourceBuffer||self.WebKitSourceBuffer}function P(){var U=Object(X.getMediaSource)();if(!U)return!1;var O=F(),L=U&&typeof U.isTypeSupported=="function"&&U.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),h=!O||O.prototype&&typeof O.prototype.appendBuffer=="function"&&typeof O.prototype.remove=="function";return!!L&&!!h}function W(){var U,O=F();return typeof(O==null||((U=O.prototype)===null||U===void 0)?void 0:U.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return p}),_.d(J,"LoadError",function(){return g});var X=_("./src/polyfills/number.ts"),F=_("./src/errors.ts");function P(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,h(a,i)}function W(a){var i=typeof Map=="function"?new Map:void 0;return W=function(l){if(l===null||!L(l))return l;if(typeof l!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(l))return i.get(l);i.set(l,C)}function C(){return U(l,arguments,f(this).constructor)}return C.prototype=Object.create(l.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),h(C,l)},W(a)}function U(a,i,s){return O()?U=Reflect.construct:U=function(C,v,y){var R=[null];R.push.apply(R,v);var w=Function.bind.apply(C,R),x=new w;return y&&h(x,y.prototype),x},U.apply(null,arguments)}function O(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function L(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function h(a,i){return h=Object.setPrototypeOf||function(l,C){return l.__proto__=C,l},h(a,i)}function f(a){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},f(a)}var T=Math.pow(2,17),p=function(){function a(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var i=a.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(l,C){var v=this,y=l.url;if(!y)return Promise.reject(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,networkDetails:null},"Fragment does not have a "+(y?"part list":"url")));this.abort();var R=this.config,w=R.fLoader,x=R.loader;return new Promise(function(b,d){v.loader&&v.loader.destroy();var u=v.loader=l.loader=w?new w(R):new x(R),A=m(l),S={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:T};l.stats=u.stats,u.load(A,S,{onSuccess:function(I,B,j,z){v.resetLoader(l,u),b({frag:l,part:null,payload:I.data,networkDetails:z})},onError:function(I,B,j){v.resetLoader(l,u),d(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,response:I,networkDetails:j}))},onAbort:function(I,B,j){v.resetLoader(l,u),d(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,networkDetails:j}))},onTimeout:function(I,B,j){v.resetLoader(l,u),d(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,networkDetails:j}))},onProgress:function(I,B,j,z){C&&C({frag:l,part:null,payload:j,networkDetails:z})}})})},i.loadPart=function(l,C,v){var y=this;this.abort();var R=this.config,w=R.fLoader,x=R.loader;return new Promise(function(b,d){y.loader&&y.loader.destroy();var u=y.loader=l.loader=w?new w(R):new x(R),A=m(l,C),S={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:T};C.stats=u.stats,u.load(A,S,{onSuccess:function(I,B,j,z){y.resetLoader(l,u),y.updateStatsFromPart(l,C);var M={frag:l,part:C,payload:I.data,networkDetails:z};v(M),b(M)},onError:function(I,B,j){y.resetLoader(l,u),d(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:l,part:C,response:I,networkDetails:j}))},onAbort:function(I,B,j){l.stats.aborted=C.stats.aborted,y.resetLoader(l,u),d(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:l,part:C,networkDetails:j}))},onTimeout:function(I,B,j){y.resetLoader(l,u),d(new g({type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:l,part:C,networkDetails:j}))}})})},i.updateStatsFromPart=function(l,C){var v=l.stats,y=C.stats,R=y.total;if(v.loaded+=y.loaded,R){var w=Math.round(l.duration/C.duration),x=Math.min(Math.round(v.loaded/R),w),b=w-x,d=b*Math.round(v.loaded/x);v.total=v.loaded+d}else v.total=Math.max(v.loaded,v.total);var u=v.loading,A=y.loading;u.start?u.first+=A.first-A.start:(u.start=A.start,u.first=A.first),u.end=A.end},i.resetLoader=function(l,C){l.loader=null,this.loader===C&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),C.destroy()},a}();function m(a,i){i===void 0&&(i=null);var s=i||a,l={frag:a,part:i,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},C=s.byteRangeStartOffset,v=s.byteRangeEndOffset;return Object(X.isFiniteNumber)(C)&&Object(X.isFiniteNumber)(v)&&(l.rangeStart=C,l.rangeEnd=v),l}var g=function(a){P(i,a);function i(s){for(var l,C=arguments.length,v=new Array(C>1?C-1:0),y=1;y>8*(15-R)&255;return y},l.setDecryptDataFromLevelKey=function(v,y){var R=v;return(v==null?void 0:v.method)==="AES-128"&&v.uri&&!v.iv&&(R=U.LevelKey.fromURI(v.uri),R.method=v.method,R.iv=this.createInitializationVector(y),R.keyFormat="identity"),R},l.setElementaryStreamInfo=function(v,y,R,w,x,b){b===void 0&&(b=!1);var d=this.elementaryStreams,u=d[v];if(!u){d[v]={startPTS:y,endPTS:R,startDTS:w,endDTS:x,partial:b};return}u.startPTS=Math.min(u.startPTS,y),u.endPTS=Math.max(u.endPTS,R),u.startDTS=Math.min(u.startDTS,w),u.endDTS=Math.max(u.endDTS,x)},l.clearElementaryStreamInfo=function(){var v=this.elementaryStreams;v[p.AUDIO]=null,v[p.VIDEO]=null,v[p.AUDIOVIDEO]=null},T(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var v=this.sn;typeof v!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),v=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,v)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(X.isFiniteNumber)(this.programDateTime))return null;var v=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+v*1e3}},{key:"encrypted",get:function(){var v;return!!((v=this.decryptdata)!==null&&v!==void 0&&v.keyFormat&&this.decryptdata.uri)}}]),s}(m),a=function(i){L(s,i);function s(l,C,v,y,R){var w;w=i.call(this,v)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new O.LoadStats,w.duration=l.decimalFloatingPoint("DURATION"),w.gap=l.bool("GAP"),w.independent=l.bool("INDEPENDENT"),w.relurl=l.enumeratedString("URI"),w.fragment=C,w.index=y;var x=l.enumeratedString("BYTERANGE");return x&&w.setByteRange(x,R),R&&(w.fragOffset=R.fragOffset+R.duration),w}return T(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var C=this.elementaryStreams;return!!(C.audio||C.video||C.audiovideo)}}]),s}(m)},"./src/loader/key-loader.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return W});var X=_("./src/events.ts"),F=_("./src/errors.ts"),P=_("./src/utils/logger.ts"),W=function(){function U(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,this._registerListeners()}var O=U.prototype;return O._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},O._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},O.destroy=function(){this._unregisterListeners();for(var h in this.loaders){var f=this.loaders[h];f&&f.destroy()}this.loaders={}},O.onKeyLoading=function(h,f){var T=f.frag,p=T.type,m=this.loaders[p];if(!T.decryptdata){P.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var g=T.decryptdata.uri;if(g!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(m&&(P.logger.warn("abort previous key loader for type:"+p),m.abort()),!g){P.logger.warn("key uri is falsy");return}var i=a.loader,s=T.loader=this.loaders[p]=new i(a);this.decrypturl=g,this.decryptkey=null;var l={url:g,frag:T,responseType:"arraybuffer"},C={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(l,C,v)}else this.decryptkey&&(T.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:T}))},O.loadsuccess=function(h,f,T){var p=T.frag;if(!p.decryptdata){P.logger.error("after key load, decryptdata unset");return}this.decryptkey=p.decryptdata.key=new Uint8Array(h.data),p.loader=null,delete this.loaders[p.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:p})},O.loaderror=function(h,f){var T=f.frag,p=T.loader;p&&p.abort(),delete this.loaders[T.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:T,response:h})},O.loadtimeout=function(h,f){var T=f.frag,p=T.loader;p&&p.abort(),delete this.loaders[T.type],this.hls.trigger(X.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:T})},U}()},"./src/loader/level-details.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"LevelDetails",function(){return U});var X=_("./src/polyfills/number.ts");function F(O,L){for(var h=0;hf.endSN||T>0||T===0&&p>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},P(O,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(X.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||W}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var T=this.driftEnd-this.driftStart;return T*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),O}()},"./src/loader/level-key.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"LevelKey",function(){return U});var X=_("./node_modules/url-toolkit/src/url-toolkit.js"),F=_.n(X);function P(O,L){for(var h=0;h2){var d=b.shift()+".";return d+=parseInt(b.shift()).toString(16),d+=("000"+parseInt(b.shift()).toString(16)).substr(-4),d}return x},R.resolve=function(x,b){return F.buildAbsoluteURL(b,x,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(x,b){var d=[],u={},A=!1;T.lastIndex=0;for(var S;(S=T.exec(x))!=null;)if(S[1]){var D=new L.AttrList(S[1]),I={attrs:D,bitrate:D.decimalInteger("AVERAGE-BANDWIDTH")||D.decimalInteger("BANDWIDTH"),name:D.NAME,url:R.resolve(S[2],b)},B=D.decimalResolution("RESOLUTION");B&&(I.width=B.width,I.height=B.height),l((D.CODECS||"").split(/[ ,]+/).filter(function(z){return z}),I),I.videoCodec&&I.videoCodec.indexOf("avc1")!==-1&&(I.videoCodec=R.convertAVC1ToAVCOTI(I.videoCodec)),d.push(I)}else if(S[3]){var j=new L.AttrList(S[3]);j["DATA-ID"]&&(A=!0,u[j["DATA-ID"]]=j)}return{levels:d,sessionData:A?u:null}},R.parseMasterPlaylistMedia=function(x,b,d,u){u===void 0&&(u=[]);var A,S=[],D=0;for(p.lastIndex=0;(A=p.exec(x))!==null;){var I=new L.AttrList(A[1]);if(I.TYPE===d){var B={attrs:I,bitrate:0,id:D++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:d,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?R.resolve(I.URI,b):""};if(u.length){var j=R.findGroup(u,B.groupId)||u[0];C(B,j,"audioCodec"),C(B,j,"textCodec")}S.push(B)}}return S},R.parseLevelPlaylist=function(x,b,d,u,A){var S=new U.LevelDetails(b),D=S.fragments,I=null,B=0,j=0,z=0,M=0,N=null,Y=new W.Fragment(u,b),ee,le,fe,Oe=-1,Se=!1;for(m.lastIndex=0,S.m3u8=x;(ee=m.exec(x))!==null;){Se&&(Se=!1,Y=new W.Fragment(u,b),Y.start=z,Y.sn=B,Y.cc=M,Y.level=d,I&&(Y.initSegment=I,Y.rawProgramDateTime=I.rawProgramDateTime));var ke=ee[1];if(ke){Y.duration=parseFloat(ke);var Le=(" "+ee[2]).slice(1);Y.title=Le||null,Y.tagList.push(Le?["INF",ke,Le]:["INF",ke])}else if(ee[3])Object(X.isFiniteNumber)(Y.duration)&&(Y.start=z,fe&&(Y.levelkey=fe),Y.sn=B,Y.level=d,Y.cc=M,Y.urlId=A,D.push(Y),Y.relurl=(" "+ee[3]).slice(1),y(Y,N),N=Y,z+=Y.duration,B++,j=0,Se=!0);else if(ee[4]){var Ae=(" "+ee[4]).slice(1);N?Y.setByteRange(Ae,N):Y.setByteRange(Ae)}else if(ee[5])Y.rawProgramDateTime=(" "+ee[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Oe===-1&&(Oe=D.length);else{if(ee=ee[0].match(g),!ee){h.logger.warn("No matches on slow regex match for level playlist!");continue}for(le=1;le-1){h.logger.warn("Keyformat "+et+" is not supported from the manifest");continue}else if(et!=="identity")continue;we&&(fe=O.LevelKey.fromURL(b,Me),Me&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(we)>=0&&(fe.method=we,fe.keyFormat=et,Be&&(fe.keyID=Be),Ue&&(fe.keyFormatVersions=Ue),fe.iv=Fe));break}case"START":{var Ze=new L.AttrList(he),Ye=Ze.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Ye)&&(S.startTimeOffset=Ye);break}case"MAP":{var ht=new L.AttrList(he);Y.relurl=ht.URI,ht.BYTERANGE&&Y.setByteRange(ht.BYTERANGE),Y.level=d,Y.sn="initSegment",fe&&(Y.levelkey=fe),Y.initSegment=null,I=Y,Se=!0;break}case"SERVER-CONTROL":{var qe=new L.AttrList(he);S.canBlockReload=qe.bool("CAN-BLOCK-RELOAD"),S.canSkipUntil=qe.optionalFloat("CAN-SKIP-UNTIL",0),S.canSkipDateRanges=S.canSkipUntil>0&&qe.bool("CAN-SKIP-DATERANGES"),S.partHoldBack=qe.optionalFloat("PART-HOLD-BACK",0),S.holdBack=qe.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ot=new L.AttrList(he);S.partTarget=ot.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ie=S.partList;Ie||(Ie=S.partList=[]);var Qe=j>0?Ie[Ie.length-1]:void 0,st=j++,je=new W.Part(new L.AttrList(he),Y,b,st,Qe);Ie.push(je),Y.duration+=je.duration;break}case"PRELOAD-HINT":{var Xe=new L.AttrList(he);S.preloadHint=Xe;break}case"RENDITION-REPORT":{var Ce=new L.AttrList(he);S.renditionReports=S.renditionReports||[],S.renditionReports.push(Ce);break}default:h.logger.warn("line parsed but not handled: "+ee);break}}}N&&!N.relurl?(D.pop(),z-=N.duration,S.partList&&(S.fragmentHint=N)):S.partList&&(y(Y,N),Y.cc=M,S.fragmentHint=Y);var be=D.length,Ee=D[0],ne=D[be-1];if(z+=S.skippedSegments*S.targetduration,z>0&&be&&ne){S.averagetargetduration=z/be;var oe=ne.sn;S.endSN=oe!=="initSegment"?oe:0,Ee&&(S.startCC=Ee.cc,Ee.initSegment||S.fragments.every(function(ce){return ce.relurl&&i(ce.relurl)})&&(h.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new W.Fragment(u,b),Y.relurl=ne.relurl,Y.level=d,Y.sn="initSegment",Ee.initSegment=Y,S.needSidxRanges=!0))}else S.endSN=0,S.startCC=0;return S.fragmentHint&&(z+=S.fragmentHint.duration),S.totalduration=z,S.endCC=M,Oe>0&&v(D,Oe),S},R}();function l(R,w){["video","audio","text"].forEach(function(x){var b=R.filter(function(u){return Object(f.isCodecType)(u,x)});if(b.length){var d=b.filter(function(u){return u.lastIndexOf("avc1",0)===0||u.lastIndexOf("mp4a",0)===0});w[x+"Codec"]=d.length>0?d[0]:b[0],R=R.filter(function(u){return b.indexOf(u)===-1})}}),w.unknownCodecs=R}function C(R,w,x){var b=w[x];b&&(R[x]=b)}function v(R,w){for(var x=R[w],b=w;b--;){var d=R[b];if(!d)return;d.programDateTime=x.programDateTime-d.duration*1e3,x=d}}function y(R,w){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):w!=null&&w.programDateTime&&(R.programDateTime=w.endProgramDateTime),Object(X.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/polyfills/number.ts"),F=_("./src/events.ts"),P=_("./src/errors.ts"),W=_("./src/utils/logger.ts"),U=_("./src/utils/mp4-tools.ts"),O=_("./src/loader/m3u8-parser.ts"),L=_("./src/types/loader.ts"),h=_("./src/utils/attr-list.ts");function f(m){var g=m.type;switch(g){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function T(m,g){var a=m.url;return(a===void 0||a.indexOf("data:")===0)&&(a=g.url),a}var p=function(){function m(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var g=m.prototype;return g.registerListeners=function(){var i=this.hls;i.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(F.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.unregisterListeners=function(){var i=this.hls;i.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(F.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(F.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(F.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},g.createInternalLoader=function(i){var s=this.hls.config,l=s.pLoader,C=s.loader,v=l||C,y=new v(s);return i.loader=y,this.loaders[i.type]=y,y},g.getInternalLoader=function(i){return this.loaders[i.type]},g.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},g.destroyInternalLoaders=function(){for(var i in this.loaders){var s=this.loaders[i];s&&s.destroy(),this.resetInternalLoader(i)}},g.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},g.onManifestLoading=function(i,s){var l=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:L.PlaylistContextType.MANIFEST,url:l,deliveryDirectives:null})},g.onLevelLoading=function(i,s){var l=s.id,C=s.level,v=s.url,y=s.deliveryDirectives;this.load({id:l,groupId:null,level:C,responseType:"text",type:L.PlaylistContextType.LEVEL,url:v,deliveryDirectives:y})},g.onAudioTrackLoading=function(i,s){var l=s.id,C=s.groupId,v=s.url,y=s.deliveryDirectives;this.load({id:l,groupId:C,level:null,responseType:"text",type:L.PlaylistContextType.AUDIO_TRACK,url:v,deliveryDirectives:y})},g.onSubtitleTrackLoading=function(i,s){var l=s.id,C=s.groupId,v=s.url,y=s.deliveryDirectives;this.load({id:l,groupId:C,level:null,responseType:"text",type:L.PlaylistContextType.SUBTITLE_TRACK,url:v,deliveryDirectives:y})},g.load=function(i){var s,l=this.hls.config,C=this.getInternalLoader(i);if(C){var v=C.context;if(v&&v.url===i.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),C.abort()}var y,R,w,x;switch(i.type){case L.PlaylistContextType.MANIFEST:y=l.manifestLoadingMaxRetry,R=l.manifestLoadingTimeOut,w=l.manifestLoadingRetryDelay,x=l.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:y=0,R=l.levelLoadingTimeOut;break;default:y=l.levelLoadingMaxRetry,R=l.levelLoadingTimeOut,w=l.levelLoadingRetryDelay,x=l.levelLoadingMaxRetryTimeout;break}if(C=this.createInternalLoader(i),(s=i.deliveryDirectives)!==null&&s!==void 0&&s.part){var b;if(i.type===L.PlaylistContextType.LEVEL&&i.level!==null?b=this.hls.levels[i.level].details:i.type===L.PlaylistContextType.AUDIO_TRACK&&i.id!==null?b=this.hls.audioTracks[i.id].details:i.type===L.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(b=this.hls.subtitleTracks[i.id].details),b){var d=b.partTarget,u=b.targetduration;d&&u&&(R=Math.min(Math.max(d*3,u*.8)*1e3,R))}}var A={timeout:R,maxRetry:y,retryDelay:w,maxRetryDelay:x,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};C.load(i,A,S)},g.loadsuccess=function(i,s,l,C){if(C===void 0&&(C=null),l.isSidxRequest){this.handleSidxRequest(i,l),this.handlePlaylistLoaded(i,s,l,C);return}this.resetInternalLoader(l.type);var v=i.data;if(v.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,l,"no EXTM3U delimiter",C);return}s.parsing.start=performance.now(),v.indexOf("#EXTINF:")>0||v.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,s,l,C):this.handleMasterPlaylist(i,s,l,C)},g.loaderror=function(i,s,l){l===void 0&&(l=null),this.handleNetworkError(s,l,!1,i)},g.loadtimeout=function(i,s,l){l===void 0&&(l=null),this.handleNetworkError(s,l,!0)},g.handleMasterPlaylist=function(i,s,l,C){var v=this.hls,y=i.data,R=T(i,l),w=O.default.parseMasterPlaylist(y,R),x=w.levels,b=w.sessionData;if(!x.length){this.handleManifestParsingError(i,l,"no level found in manifest",C);return}var d=x.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),u=x.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),A=O.default.parseMasterPlaylistMedia(y,R,"AUDIO",d),S=O.default.parseMasterPlaylistMedia(y,R,"SUBTITLES",u),D=O.default.parseMasterPlaylistMedia(y,R,"CLOSED-CAPTIONS");if(A.length){var I=A.some(function(B){return!B.url});!I&&x[0].audioCodec&&!x[0].attrs.AUDIO&&(W.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),A.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new h.AttrList({}),bitrate:0,url:""}))}v.trigger(F.Events.MANIFEST_LOADED,{levels:x,audioTracks:A,subtitles:S,captions:D,url:R,stats:s,networkDetails:C,sessionData:b})},g.handleTrackOrLevelPlaylist=function(i,s,l,C){var v=this.hls,y=l.id,R=l.level,w=l.type,x=T(i,l),b=Object(X.isFiniteNumber)(y)?y:0,d=Object(X.isFiniteNumber)(R)?R:b,u=f(l),A=O.default.parseLevelPlaylist(i.data,x,d,u,b);if(!A.fragments.length){v.trigger(F.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:x,reason:"no fragments found in level",level:typeof l.level=="number"?l.level:void 0});return}if(w===L.PlaylistContextType.MANIFEST){var S={attrs:new h.AttrList({}),bitrate:0,details:A,name:"",url:x};v.trigger(F.Events.MANIFEST_LOADED,{levels:[S],audioTracks:[],url:x,stats:s,networkDetails:C,sessionData:null})}if(s.parsing.end=performance.now(),A.needSidxRanges){var D,I=(D=A.fragments[0].initSegment)===null||D===void 0?void 0:D.url;this.load({url:I,isSidxRequest:!0,type:w,level:R,levelDetails:A,id:y,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}l.levelDetails=A,this.handlePlaylistLoaded(i,s,l,C)},g.handleSidxRequest=function(i,s){var l=Object(U.parseSegmentIndex)(new Uint8Array(i.data));if(!l)return;var C=l.references,v=s.levelDetails;C.forEach(function(y,R){var w=y.info,x=v.fragments[R];x.byteRange.length===0&&x.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),x.initSegment&&x.initSegment.setByteRange(String(l.moovEndOffset)+"@0")})},g.handleManifestParsingError=function(i,s,l,C){this.hls.trigger(F.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===L.PlaylistContextType.MANIFEST,url:i.url,reason:l,response:i,context:s,networkDetails:C})},g.handleNetworkError=function(i,s,l,C){l===void 0&&(l=!1),W.logger.warn("[playlist-loader]: A network "+(l?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var v=P.ErrorDetails.UNKNOWN,y=!1,R=this.getInternalLoader(i);switch(i.type){case L.PlaylistContextType.MANIFEST:v=l?P.ErrorDetails.MANIFEST_LOAD_TIMEOUT:P.ErrorDetails.MANIFEST_LOAD_ERROR,y=!0;break;case L.PlaylistContextType.LEVEL:v=l?P.ErrorDetails.LEVEL_LOAD_TIMEOUT:P.ErrorDetails.LEVEL_LOAD_ERROR,y=!1;break;case L.PlaylistContextType.AUDIO_TRACK:v=l?P.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,y=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:v=l?P.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:P.ErrorDetails.SUBTITLE_LOAD_ERROR,y=!1;break}R&&this.resetInternalLoader(i.type);var w={type:P.ErrorTypes.NETWORK_ERROR,details:v,fatal:y,url:i.url,loader:R,context:i,networkDetails:s};C&&(w.response=C),this.hls.trigger(F.Events.ERROR,w)},g.handlePlaylistLoaded=function(i,s,l,C){var v=l.type,y=l.level,R=l.id,w=l.groupId,x=l.loader,b=l.levelDetails,d=l.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(i,l,"invalid target duration",C);return}if(!x)return;b.live&&(x.getCacheAge&&(b.ageHeader=x.getCacheAge()||0),(!x.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(v){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(F.Events.LEVEL_LOADED,{details:b,level:y||0,id:R||0,stats:s,networkDetails:C,deliveryDirectives:d});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(F.Events.AUDIO_TRACK_LOADED,{details:b,id:R||0,groupId:w||"",stats:s,networkDetails:C,deliveryDirectives:d});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(F.Events.SUBTITLE_TRACK_LOADED,{details:b,id:R||0,groupId:w||"",stats:s,networkDetails:C,deliveryDirectives:d});break}},m}();J.default=p},"./src/polyfills/number.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"isFiniteNumber",function(){return X}),_.d(J,"MAX_SAFE_INTEGER",function(){return F});var X=Number.isFinite||function(P){return typeof P=="number"&&isFinite(P)},F=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ue,J,_){"use strict";_.r(J);var X=function(){function F(){}return F.getSilentFrame=function(W,U){switch(W){case"mp4a.40.2":if(U===1)return new Uint8Array([0,200,0,128,35,128]);if(U===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(U===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(U===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(U===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(U===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(U===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(U===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},F}();J.default=X},"./src/remux/mp4-generator.ts":function(ue,J,_){"use strict";_.r(J);var X=Math.pow(2,32)-1,F=function(){function P(){}return P.init=function(){P.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var U;for(U in P.types)P.types.hasOwnProperty(U)&&(P.types[U]=[U.charCodeAt(0),U.charCodeAt(1),U.charCodeAt(2),U.charCodeAt(3)]);var O=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]),L=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]);P.HDLR_TYPES={video:O,audio:L};var h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);P.STTS=P.STSC=P.STCO=f,P.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),P.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),P.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),P.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var T=new Uint8Array([105,115,111,109]),p=new Uint8Array([97,118,99,49]),m=new Uint8Array([0,0,0,1]);P.FTYP=P.box(P.types.ftyp,T,m,T,p),P.DINF=P.box(P.types.dinf,P.box(P.types.dref,h))},P.box=function(U){for(var O=8,L=arguments.length,h=new Array(L>1?L-1:0),f=1;f>24&255,m[1]=O>>16&255,m[2]=O>>8&255,m[3]=O&255,m.set(U,4),T=0,O=8;T>24&255,U>>16&255,U>>8&255,U&255,L>>24,L>>16&255,L>>8&255,L&255,h>>24,h>>16&255,h>>8&255,h&255,85,196,0,0]))},P.mdia=function(U){return P.box(P.types.mdia,P.mdhd(U.timescale,U.duration),P.hdlr(U.type),P.minf(U))},P.mfhd=function(U){return P.box(P.types.mfhd,new Uint8Array([0,0,0,0,U>>24,U>>16&255,U>>8&255,U&255]))},P.minf=function(U){return U.type==="audio"?P.box(P.types.minf,P.box(P.types.smhd,P.SMHD),P.DINF,P.stbl(U)):P.box(P.types.minf,P.box(P.types.vmhd,P.VMHD),P.DINF,P.stbl(U))},P.moof=function(U,O,L){return P.box(P.types.moof,P.mfhd(U),P.traf(L,O))},P.moov=function(U){for(var O=U.length,L=[];O--;)L[O]=P.trak(U[O]);return P.box.apply(null,[P.types.moov,P.mvhd(U[0].timescale,U[0].duration)].concat(L).concat(P.mvex(U)))},P.mvex=function(U){for(var O=U.length,L=[];O--;)L[O]=P.trex(U[O]);return P.box.apply(null,[P.types.mvex].concat(L))},P.mvhd=function(U,O){O*=U;var L=Math.floor(O/(X+1)),h=Math.floor(O%(X+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,U>>24&255,U>>16&255,U>>8&255,U&255,L>>24,L>>16&255,L>>8&255,L&255,h>>24,h>>16&255,h>>8&255,h&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return P.box(P.types.mvhd,f)},P.sdtp=function(U){var O=U.samples||[],L=new Uint8Array(4+O.length),h,f;for(h=0;h>>8&255),O.push(T&255),O=O.concat(Array.prototype.slice.call(f));for(h=0;h>>8&255),L.push(T&255),L=L.concat(Array.prototype.slice.call(f));var p=P.box(P.types.avcC,new Uint8Array([1,O[3],O[4],O[5],252|3,224|U.sps.length].concat(O).concat([U.pps.length]).concat(L))),m=U.width,g=U.height,a=U.pixelRatio[0],i=U.pixelRatio[1];return P.box(P.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,m>>8&255,m&255,g>>8&255,g&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),p,P.box(P.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),P.box(P.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,i>>24,i>>16&255,i>>8&255,i&255])))},P.esds=function(U){var O=U.config.length;return new Uint8Array([0,0,0,0,3,23+O,0,1,0,4,15+O,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([O]).concat(U.config).concat([6,1,2]))},P.mp4a=function(U){var O=U.samplerate;return P.box(P.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]),P.box(P.types.esds,P.esds(U)))},P.mp3=function(U){var O=U.samplerate;return P.box(P.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,U.channelCount,0,16,0,0,0,0,O>>8&255,O&255,0,0]))},P.stsd=function(U){return U.type==="audio"?!U.isAAC&&U.codec==="mp3"?P.box(P.types.stsd,P.STSD,P.mp3(U)):P.box(P.types.stsd,P.STSD,P.mp4a(U)):P.box(P.types.stsd,P.STSD,P.avc1(U))},P.tkhd=function(U){var O=U.id,L=U.duration*U.timescale,h=U.width,f=U.height,T=Math.floor(L/(X+1)),p=Math.floor(L%(X+1));return P.box(P.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,O>>24&255,O>>16&255,O>>8&255,O&255,0,0,0,0,T>>24,T>>16&255,T>>8&255,T&255,p>>24,p>>16&255,p>>8&255,p&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,h>>8&255,h&255,0,0,f>>8&255,f&255,0,0]))},P.traf=function(U,O){var L=P.sdtp(U),h=U.id,f=Math.floor(O/(X+1)),T=Math.floor(O%(X+1));return P.box(P.types.traf,P.box(P.types.tfhd,new Uint8Array([0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255])),P.box(P.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,T>>24,T>>16&255,T>>8&255,T&255])),P.trun(U,L.length+16+20+8+16+8+8),L)},P.trak=function(U){return U.duration=U.duration||4294967295,P.box(P.types.trak,P.tkhd(U),P.mdia(U))},P.trex=function(U){var O=U.id;return P.box(P.types.trex,new Uint8Array([0,0,0,0,O>>24,O>>16&255,O>>8&255,O&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},P.trun=function(U,O){var L=U.samples||[],h=L.length,f=12+16*h,T=new Uint8Array(f),p,m,g,a,i,s;for(O+=8+f,T.set([0,0,15,1,h>>>24&255,h>>>16&255,h>>>8&255,h&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255],0),p=0;p>>24&255,g>>>16&255,g>>>8&255,g&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*p);return P.box(P.types.trun,T)},P.initSegment=function(U){P.types||P.init();var O=P.moov(U),L=new Uint8Array(P.FTYP.byteLength+O.byteLength);return L.set(P.FTYP),L.set(O,P.FTYP.byteLength),L},P}();F.types=void 0,F.HDLR_TYPES=void 0,F.STTS=void 0,F.STSC=void 0,F.STCO=void 0,F.STSZ=void 0,F.VMHD=void 0,F.SMHD=void 0,F.STSD=void 0,F.FTYP=void 0,F.DINF=void 0,J.default=F},"./src/remux/mp4-remuxer.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return s}),_.d(J,"normalizePts",function(){return l});var X=_("./src/polyfills/number.ts"),F=_("./src/remux/aac-helper.ts"),P=_("./src/remux/mp4-generator.ts"),W=_("./src/events.ts"),U=_("./src/errors.ts"),O=_("./src/utils/logger.ts"),L=_("./src/types/loader.ts"),h=_("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(R){for(var w=1;w0?A:S.pts},b[0].pts);return d&&O.logger.debug("PTS rollover detected"),u},w.remux=function(b,d,u,A,S,D,I,B){var j,z,M,N,Y,ee,le=S,fe=S,Oe=b.pid>-1,Se=d.pid>-1,ke=d.samples.length,Le=b.samples.length>0,Ae=ke>1,ge=(!Oe||Le)&&(!Se||Ae)||this.ISGenerated||I;if(ge){this.ISGenerated||(M=this.generateIS(b,d,S));var he=this.isVideoContiguous,re=-1;if(Ae&&(re=C(d.samples),!he&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,re>0){O.logger.warn("[mp4-remuxer]: Dropped "+re+" out of "+ke+" video samples due to a missing keyframe");var de=this.getVideoStartPts(d.samples);d.samples=d.samples.slice(re),d.dropped+=re,fe+=(d.samples[0].pts-de)/(d.timescale||9e4)}else re===-1&&(O.logger.warn("[mp4-remuxer]: No keyframe found out of "+ke+" video samples"),ee=!1);if(this.ISGenerated){if(Le&&Ae){var se=this.getVideoStartPts(d.samples),De=l(b.samples[0].pts,se)-se,ie=De/d.inputTimeScale;le+=Math.max(0,ie),fe+=Math.max(0,-ie)}if(Le){if(b.samplerate||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),M=this.generateIS(b,d,S)),z=this.remuxAudio(b,le,this.isAudioContiguous,D,Se||Ae||B===L.PlaylistLevelType.AUDIO?fe:void 0),Ae){var ae=z?z.endPTS-z.startPTS:0;d.inputTimeScale||(O.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),M=this.generateIS(b,d,S)),j=this.remuxVideo(d,fe,he,ae)}}else Ae&&(j=this.remuxVideo(d,fe,he,0));j&&(j.firstKeyFrame=re,j.independent=re!==-1)}}return this.ISGenerated&&(u.samples.length&&(Y=this.remuxID3(u,S)),A.samples.length&&(N=this.remuxText(A,S))),{audio:z,video:j,initSegment:M,independent:ee,text:N,id3:Y}},w.generateIS=function(b,d,u){var A=b.samples,S=d.samples,D=this.typeSupported,I={},B=!Object(X.isFiniteNumber)(this._initPTS),j="audio/mp4",z,M,N;if(B&&(z=M=Infinity),b.config&&A.length&&(b.timescale=b.samplerate,b.isAAC||(D.mpeg?(j="audio/mpeg",b.codec=""):D.mp3&&(b.codec="mp3")),I.audio={id:"audio",container:j,codec:b.codec,initSegment:!b.isAAC&&D.mpeg?new Uint8Array(0):P.default.initSegment([b]),metadata:{channelCount:b.channelCount}},B&&(N=b.inputTimeScale,z=M=A[0].pts-Math.round(N*u))),d.sps&&d.pps&&S.length&&(d.timescale=d.inputTimeScale,I.video={id:"main",container:"video/mp4",codec:d.codec,initSegment:P.default.initSegment([d]),metadata:{width:d.width,height:d.height}},B)){N=d.inputTimeScale;var Y=this.getVideoStartPts(S),ee=Math.round(N*u);M=Math.min(M,l(S[0].dts,Y)-ee),z=Math.min(z,Y-ee)}if(Object.keys(I).length)return this.ISGenerated=!0,B&&(this._initPTS=z,this._initDTS=M),{tracks:I,initPTS:z,timescale:N}},w.remuxVideo=function(b,d,u,A){var S=b.inputTimeScale,D=b.samples,I=[],B=D.length,j=this._initPTS,z=this.nextAvcDts,M=8,N,Y,ee,le=Number.POSITIVE_INFINITY,fe=Number.NEGATIVE_INFINITY,Oe=0,Se=!1;if(!u||z===null){var ke=d*S,Le=D[0].pts-l(D[0].dts,D[0].pts);z=ke-Le}for(var Ae=0;Aege.pts){var he=9e4*.2;Oe=Math.max(Math.min(Oe,ge.pts-ge.dts),-1*he)}ge.dts0?Ae-1:Ae].dts&&(Se=!0)}Se&&D.sort(function(Lt,wt){var ft=Lt.dts-wt.dts,zt=Lt.pts-wt.pts;return ft||zt}),Y=D[0].dts,ee=D[D.length-1].dts;var re=Math.round((ee-Y)/(B-1));if(Oe<0){if(Oere,me=ie<-1;if(ae||me){ae?O.logger.warn("AVC: "+Object(h.toMsFromMpegTsClock)(ie,!0)+" ms ("+ie+"dts) hole between fragments detected, filling it"):O.logger.warn("AVC: "+Object(h.toMsFromMpegTsClock)(-ie,!0)+" ms ("+ie+"dts) overlapping between fragments detected"),Y=z;var we=D[0].pts-ie;D[0].dts=Y,D[0].pts=we,O.logger.log("Video: First PTS/DTS adjusted: "+Object(h.toMsFromMpegTsClock)(we,!0)+"/"+Object(h.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(h.toMsFromMpegTsClock)(ie,!0)+" ms")}}i&&(Y=Math.max(0,Y));for(var Me=0,Fe=0,Ue=0;Ue0?Ie-1:Ie].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var ve=Math.floor(oe.maxBufferHole*S),Ne=(A?le+A*S:this.nextAudioPts)-Qe.pts;Ne>ve?(N=Ne-ce,N<0&&(N=ce),O.logger.log("[mp4-remuxer]: It is approximately "+Ne/90+" ms to the next segment; using duration "+N/90+" ms for the last video frame.")):N=ce}else N=ce}var Re=Math.round(Qe.pts-Qe.dts);I.push(new v(Qe.key,N,je,Re))}if(I.length&&g&&g<70){var ze=I[0].flags;ze.dependsOn=2,ze.isNonSync=0}console.assert(N!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=z=ee+N,this.isVideoContiguous=!0;var it=P.default.moof(b.sequenceNumber++,Y,f({},b,{samples:I})),ct="video",dt={data1:it,data2:qe,startPTS:le/S,endPTS:(fe+N)/S,startDTS:Y/S,endDTS:z/S,type:ct,hasAudio:!1,hasVideo:!0,nb:I.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(qe.length,"MDAT length must not be zero"),dt},w.remuxAudio=function(b,d,u,A,S){var D=b.inputTimeScale,I=b.samplerate?b.samplerate:D,B=D/I,j=b.isAAC?p:m,z=j*B,M=this._initPTS,N=!b.isAAC&&this.typeSupported.mpeg,Y=[],ee=b.samples,le=N?0:8,fe=this.nextAudioPts||-1,Oe=d*D;if(this.isAudioContiguous=u=u||ee.length&&fe>0&&(A&&Math.abs(Oe-fe)<9e3||Math.abs(l(ee[0].pts-M,Oe)-fe)<20*z),ee.forEach(function(Ee){Ee.pts=l(Ee.pts-M,Oe)}),!u||fe<0){if(ee=ee.filter(function(Ee){return Ee.pts>=0}),!ee.length)return;S===0?fe=0:A?fe=Math.max(0,Oe):fe=ee[0].pts}if(b.isAAC)for(var Se=S!==void 0,ke=this.config.maxAudioFramesDrift,Le=0,Ae=fe;Le=ke*z&&de0){Fe+=le;try{Me=new Uint8Array(Fe)}catch(Ee){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:U.ErrorTypes.MUX_ERROR,details:U.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Fe,reason:"fail allocating audio mdat "+Fe});return}if(!N){var qe=new DataView(Me.buffer);qe.setUint32(0,Fe),Me.set(P.default.types.mdat,4)}}else return;Me.set(Ze,le);var ot=Ze.byteLength;le+=ot,Y.push(new v(!0,j,ot,0)),we=Ye}var Ie=Y.length;if(!Ie)return;var Qe=Y[Y.length-1];this.nextAudioPts=fe=we+B*Qe.duration;var st=N?new Uint8Array(0):P.default.moof(b.sequenceNumber++,me/B,f({},b,{samples:Y}));b.samples=[];var je=me/D,Xe=fe/D,Ce="audio",be={data1:st,data2:Me,startPTS:je,endPTS:Xe,startDTS:je,endDTS:Xe,type:Ce,hasAudio:!0,hasVideo:!1,nb:Ie};return this.isAudioContiguous=!0,console.assert(Me.length,"MDAT length must not be zero"),be},w.remuxEmptyAudio=function(b,d,u,A){var S=b.inputTimeScale,D=b.samplerate?b.samplerate:S,I=S/D,B=this.nextAudioPts,j=(B!==null?B:A.startDTS*S)+this._initDTS,z=A.endDTS*S+this._initDTS,M=I*p,N=Math.ceil((z-j)/M),Y=F.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(O.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){O.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],le=0;le4294967296;)R+=x;return R}function C(R){for(var w=0;w0?this.lastEndDTS=b:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var d=!!R.audio,u=!!R.video,A="";d&&(A+="audio"),u&&(A+="video");var S={data1:v,startPTS:x,startDTS:x,endPTS:b,endDTS:b,type:A,hasAudio:d,hasVideo:u,nb:1,dropped:0};return C.audio=S.type==="audio"?S:void 0,C.video=S.type!=="audio"?S:void 0,C.text=a,C.id3=g,C.initSegment=y,C},h}(),O=function(f,T,p){return Object(F.getStartDTS)(f,T)-p};function L(h,f){var T=h==null?void 0:h.codec;return T&&T.length>4?T:T==="hvc1"?"hvc1.1.c.L120.90":T==="av01"?"av01.0.04M.08":T==="avc1"||f===P.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}J.default=U},"./src/task-loop.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"default",function(){return X});var X=function(){function F(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var P=F.prototype;return P.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},P.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},P.onHandlerDestroyed=function(){},P.hasInterval=function(){return!!this._tickInterval},P.hasNextTick=function(){return!!this._tickTimer},P.setInterval=function(U){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,U),!0)},P.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},P.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},P.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},P.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},P.doTick=function(){},F}()},"./src/types/cmcd.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"CMCDVersion",function(){return X}),_.d(J,"CMCDObjectType",function(){return F}),_.d(J,"CMCDStreamingFormat",function(){return P}),_.d(J,"CMCDStreamType",function(){return W});var X=1,F;(function(U){U.MANIFEST="m",U.AUDIO="a",U.VIDEO="v",U.MUXED="av",U.INIT="i",U.CAPTION="c",U.TIMED_TEXT="tt",U.KEY="k",U.OTHER="o"})(F||(F={}));var P;(function(U){U.DASH="d",U.HLS="h",U.SMOOTH="s",U.OTHER="o"})(P||(P={}));var W;(function(U){U.VOD="v",U.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"HlsSkip",function(){return P}),_.d(J,"getSkipValue",function(){return W}),_.d(J,"HlsUrlParameters",function(){return U}),_.d(J,"Level",function(){return O});function X(L,h){for(var f=0;fNumber.MAX_SAFE_INTEGER?Infinity:h},U.hexadecimalInteger=function(L){if(this[L]){var h=(this[L]||"0x").slice(2);h=(h.length&1?"0":"")+h;for(var f=new Uint8Array(h.length/2),T=0;TNumber.MAX_SAFE_INTEGER?Infinity:h},U.decimalFloatingPoint=function(L){return parseFloat(this[L])},U.optionalFloat=function(L,h){var f=this[L];return f?parseFloat(f):h},U.enumeratedString=function(L){return this[L]},U.bool=function(L){return this[L]==="YES"},U.decimalResolution=function(L){var h=X.exec(this[L]);return h===null?void 0:{width:parseInt(h[1],10),height:parseInt(h[2],10)}},W.parseAttrList=function(L){var h,f={},T='"';for(F.lastIndex=0;(h=F.exec(L))!==null;){var p=h[2];p.indexOf(T)===0&&p.lastIndexOf(T)===p.length-1&&(p=p.slice(1,-1)),f[h[1]]=p}return f},W}()},"./src/utils/binary-search.ts":function(ue,J,_){"use strict";_.r(J);var X={search:function(P,W){for(var U=0,O=P.length-1,L=null,h=null;U<=O;){L=(U+O)/2|0,h=P[L];var f=W(h);if(f>0)U=L+1;else if(f<0)O=L-1;else return h}return null}};J.default=X},"./src/utils/buffer-helper.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"BufferHelper",function(){return P});var X=_("./src/utils/logger.ts"),F={length:0,start:function(){return 0},end:function(){return 0}},P=function(){function W(){}return W.isBuffered=function(O,L){try{if(O){for(var h=W.getBuffered(O),f=0;f=h.start(f)&&L<=h.end(f))return!0}}catch(T){}return!1},W.bufferInfo=function(O,L,h){try{if(O){var f=W.getBuffered(O),T=[],p;for(p=0;pm&&(f[p-1].end=O[T].end):f.push(O[T])}else f.push(O[T])}else f=O;for(var g=0,a,i=L,s=L,l=0;l=C&&L=u&&X.logger.log(this.time+" ["+u+"] "+A)},x}(),g=function(b){for(var d=[],u=0;uU&&(this.logger.log(p.DEBUG,"Too large cursor position "+this.pos),this.pos=U)},b.moveCursor=function(u){var A=this.pos+u;if(u>1)for(var S=this.pos+1;S=144&&this.backSpace();var A=P(u);if(this.pos>=U){this.logger.log(p.ERROR,"Cannot insert "+u.toString(16)+" ("+A+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(A,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(u){var A;for(A=u;A0&&(u?S="["+A.join(" | ")+"]":S=A.join(` +`)),S},b.getTextAndFormat=function(){return this.rows},x}(),C=function(){function x(d,u,A){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=d,this.outputFilter=u,this.mode=null,this.verbose=0,this.displayedMemory=new l(A),this.nonDisplayedMemory=new l(A),this.lastOutputScreen=new l(A),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=A}var b=x.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(u){this.outputFilter=u},b.setPAC=function(u){this.writeScreen.setPAC(u)},b.setBkgData=function(u){this.writeScreen.setBkgData(u)},b.setMode=function(u){if(u===this.mode)return;this.mode=u,this.logger.log(p.INFO,"MODE="+u),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=u},b.insertChars=function(u){for(var A=0;A=46,A.italics)A.foreground="white";else{var S=Math.floor(u/2)-16,D=["white","green","blue","cyan","red","yellow","magenta"];A.foreground=D[S]}this.logger.log(p.INFO,"MIDROW: "+JSON.stringify(A)),this.writeScreen.setPen(A)},b.outputDataUpdate=function(u){u===void 0&&(u=!1);var A=this.logger.time;if(A===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=A:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,A,this.lastOutputScreen),u&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:A),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(u){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,u,this.displayedMemory),this.cueStartTime=u))},x}(),v=function(){function x(d,u,A){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var S=new m;this.channels=[null,new C(d,u,S),new C(d+1,A,S)],this.cmdHistory=w(),this.logger=S}var b=x.prototype;return b.getHandler=function(u){return this.channels[u].getHandler()},b.setHandler=function(u,A){this.channels[u].setHandler(A)},b.addData=function(u,A){var S,D,I,B=!1;this.logger.time=u;for(var j=0;j ("+g([D,I])+")"),S=this.parseCmd(D,I),S||(S=this.parseMidrow(D,I)),S||(S=this.parsePAC(D,I)),S||(S=this.parseBackgroundAttributes(D,I)),!S&&(B=this.parseChars(D,I),B)){var z=this.currentChannel;if(z&&z>0){var M=this.channels[z];M.insertChars(B)}else this.logger.log(p.WARNING,"No channel found yet. TEXT-MODE?")}!S&&!B&&this.logger.log(p.WARNING,"Couldn't parse cleaned data "+g([D,I])+" orig: "+g([A[j],A[j+1]]))}},b.parseCmd=function(u,A){var S=this.cmdHistory,D=(u===20||u===28||u===21||u===29)&&A>=32&&A<=47,I=(u===23||u===31)&&A>=33&&A<=35;if(!(D||I))return!1;if(R(u,A,S))return y(null,null,S),this.logger.log(p.DEBUG,"Repeated command ("+g([u,A])+") is dropped"),!0;var B=u===20||u===21||u===23?1:2,j=this.channels[B];return u===20||u===21||u===28||u===29?A===32?j.ccRCL():A===33?j.ccBS():A===34?j.ccAOF():A===35?j.ccAON():A===36?j.ccDER():A===37?j.ccRU(2):A===38?j.ccRU(3):A===39?j.ccRU(4):A===40?j.ccFON():A===41?j.ccRDC():A===42?j.ccTR():A===43?j.ccRTD():A===44?j.ccEDM():A===45?j.ccCR():A===46?j.ccENM():A===47&&j.ccEOC():j.ccTO(A-32),y(u,A,S),this.currentChannel=B,!0},b.parseMidrow=function(u,A){var S=0;if((u===17||u===25)&&A>=32&&A<=47){if(u===17?S=1:S=2,S!==this.currentChannel)return this.logger.log(p.ERROR,"Mismatch channel in midrow parsing"),!1;var D=this.channels[S];return D?(D.ccMIDROW(A),this.logger.log(p.DEBUG,"MIDROW ("+g([u,A])+")"),!0):!1}return!1},b.parsePAC=function(u,A){var S,D=this.cmdHistory,I=(u>=17&&u<=23||u>=25&&u<=31)&&A>=64&&A<=127,B=(u===16||u===24)&&A>=64&&A<=95;if(!(I||B))return!1;if(R(u,A,D))return y(null,null,D),!0;var j=u<=23?1:2;A>=64&&A<=95?S=j===1?O[u]:h[u]:S=j===1?L[u]:f[u];var z=this.channels[j];return z?(z.setPAC(this.interpretPAC(S,A)),y(u,A,D),this.currentChannel=j,!0):!1},b.interpretPAC=function(u,A){var S,D={color:null,italics:!1,indent:null,underline:!1,row:u};return A>95?S=A-96:S=A-64,D.underline=(S&1)===1,S<=13?D.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(S/2)]:S<=15?(D.italics=!0,D.color="white"):D.indent=Math.floor((S-16)/2)*4,D},b.parseChars=function(u,A){var S,D=null,I=null;if(u>=25?(S=2,I=u-8):(S=1,I=u),I>=17&&I<=19){var B;I===17?B=A+80:I===18?B=A+112:B=A+144,this.logger.log(p.INFO,"Special char '"+P(B)+"' in channel "+S),D=[B]}else u>=32&&u<=127&&(D=A===0?[u]:[u,A]);if(D){var j=g(D);this.logger.log(p.DEBUG,"Char codes = "+j.join(",")),y(u,A,this.cmdHistory)}return D},b.parseBackgroundAttributes=function(u,A){var S=(u===16||u===24)&&A>=32&&A<=47,D=(u===23||u===31)&&A>=45&&A<=47;if(!(S||D))return!1;var I,B={};u===16||u===24?(I=Math.floor((A-32)/2),B.background=T[I],A%2===1&&(B.background=B.background+"_semi")):A===45?B.background="transparent":(B.foreground="black",A===47&&(B.underline=!0));var j=u<=23?1:2,z=this.channels[j];return z.setBkgData(B),y(u,A,this.cmdHistory),!0},b.reset=function(){for(var u=0;u=16?i--:i++;var y=Object(X.fixLineBreaks)(s.trim()),R=Object(F.generateCueId)(h,f,y);(!L||!L.cues||!L.cues.getCueById(R))&&(g=new l(h,f,y),g.id=R,g.line=C+1,g.align="left",g.position=10+Math.min(80,Math.floor(i*8/32)*10),p.push(g))}return L&&p.length&&(p.sort(function(w,x){return w.line==="auto"||x.line==="auto"?0:w.line>8&&x.line>8?x.line-w.line:w.line-x.line}),p.forEach(function(w){return Object(P.addCueToTrack)(L,w)})),p}};J.default=U},"./src/utils/discontinuities.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"findFirstFragWithCC",function(){return W}),_.d(J,"shouldAlignOnDiscontinuities",function(){return U}),_.d(J,"findDiscontinuousReferenceFrag",function(){return O}),_.d(J,"adjustSlidingStart",function(){return h}),_.d(J,"alignStream",function(){return f}),_.d(J,"alignPDT",function(){return p}),_.d(J,"alignFragmentByPDTDelta",function(){return m}),_.d(J,"alignMediaPlaylistByPDT",function(){return g});var X=_("./src/polyfills/number.ts"),F=_("./src/utils/logger.ts"),P=_("./src/controller/level-helper.ts");function W(a,i){for(var s=null,l=0,C=a.length;ls.startCC||a&&a.cc=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},P}();J.default=F},"./src/utils/ewma.ts":function(ue,J,_){"use strict";_.r(J);var X=function(){function F(W,U,O){U===void 0&&(U=0),O===void 0&&(O=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=U,this.totalWeight_=O}var P=F.prototype;return P.sample=function(U,O){var L=Math.pow(this.alpha_,U);this.estimate_=O*(1-L)+L*this.estimate_,this.totalWeight_+=U},P.getTotalWeight=function(){return this.totalWeight_},P.getEstimate=function(){if(this.alpha_){var U=1-Math.pow(this.alpha_,this.totalWeight_);if(U)return this.estimate_/U}return this.estimate_},F}();J.default=X},"./src/utils/fetch-loader.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"fetchSupported",function(){return m});var X=_("./src/polyfills/number.ts"),F=_("./src/loader/load-stats.ts"),P=_("./src/demux/chunk-cache.ts");function W(l,C){l.prototype=Object.create(C.prototype),l.prototype.constructor=l,f(l,C)}function U(l){var C=typeof Map=="function"?new Map:void 0;return U=function(y){if(y===null||!h(y))return y;if(typeof y!="function")throw new TypeError("Super expression must either be null or a function");if(typeof C!="undefined"){if(C.has(y))return C.get(y);C.set(y,R)}function R(){return O(y,arguments,T(this).constructor)}return R.prototype=Object.create(y.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),f(R,y)},U(l)}function O(l,C,v){return L()?O=Reflect.construct:O=function(R,w,x){var b=[null];b.push.apply(b,w);var d=Function.bind.apply(R,b),u=new d;return x&&f(u,x.prototype),u},O.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function h(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function f(l,C){return f=Object.setPrototypeOf||function(y,R){return y.__proto__=R,y},f(l,C)}function T(l){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},T(l)}function p(){return p=Object.assign||function(l){for(var C=1;C=x&&b(R,w,d.flush(),y)):b(R,w,I,y),S()}).catch(function(){return Promise.reject()})};return A()},l}();function a(l,C){var v={method:"GET",mode:"cors",credentials:"same-origin",signal:C,headers:new self.Headers(p({},l.headers))};return l.rangeEnd&&v.headers.set("Range","bytes="+l.rangeStart+"-"+String(l.rangeEnd-1)),v}function i(l,C){return new self.Request(l.url,C)}var s=function(l){W(C,l);function C(v,y,R){var w;return w=l.call(this,v)||this,w.code=void 0,w.details=void 0,w.code=y,w.details=R,w}return C}(U(Error));J.default=g},"./src/utils/imsc1-ttml-parser.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"IMSC1_CODEC",function(){return h}),_.d(J,"parseIMSC1",function(){return m});var X=_("./src/utils/mp4-tools.ts"),F=_("./src/utils/vttparser.ts"),P=_("./src/utils/vttcue.ts"),W=_("./src/demux/id3.ts"),U=_("./src/utils/timescale-conversion.ts"),O=_("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(x){for(var b=1;b"):X}function U(h){for(var f=arguments.length,T=new Array(f>1?f-1:0),p=1;p>24,C[v+1]=y>>16&255,C[v+2]=y>>8&255,C[v+3]=y&255}function f(C,v){var y=[];if(!v.length)return y;var R,w,x;"data"in C?(R=C.data,w=C.start,x=C.end):(R=C,w=0,x=R.byteLength);for(var b=w;b1?b+d:x;if(u===v[0])if(v.length===1)y.push({data:R,start:b+8,end:A});else{var S=f({data:R,start:b+8,end:A},v.slice(1));S.length&&W.apply(y,S)}b=A}return y}function T(C){var v=f(C,["moov"]),y=v[0],R=y?y.end:null,w=f(C,["sidx"]);if(!w||!w[0])return null;var x=[],b=w[0],d=b.data[0],u=d===0?8:16,A=L(b,u);u+=4;var S=0,D=0;d===0?u+=8:u+=16,u+=2;var I=b.end+D,B=O(b,u);u+=2;for(var j=0;j>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=L(b,z);z+=4,x.push({referenceSize:N,subsegmentDuration:ee,info:{duration:ee/A,start:I,end:I+N-1}}),I+=N,z+=4,u=z}return{earliestPresentationTime:S,timescale:A,version:d,referencesCount:B,references:x,moovEndOffset:R}}function p(C){for(var v=[],y=f(C,["moov","trak"]),R=0;RU)&&(this.startTime=U),this.endTime=O,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},P.reset=function(){this.cueRanges=[]},F}()},"./src/utils/texttrack-utils.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"sendAddTrackEvent",function(){return F}),_.d(J,"addCueToTrack",function(){return P}),_.d(J,"clearCurrentCues",function(){return W}),_.d(J,"removeCuesInRange",function(){return U}),_.d(J,"getCuesInRange",function(){return L});var X=_("./src/utils/logger.ts");function F(h,f){var T;try{T=new Event("addtrack")}catch(p){T=document.createEvent("Event"),T.initEvent("addtrack",!1,!1)}T.track=h,f.dispatchEvent(T)}function P(h,f){var T=h.mode;if(T==="disabled"&&(h.mode="hidden"),h.cues&&!h.cues.getCueById(f.id))try{if(h.addCue(f),!h.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(m){X.logger.debug("[texttrack-utils]: "+m);var p=new self.TextTrackCue(f.startTime,f.endTime,f.text);p.id=f.id,h.addCue(p)}T==="disabled"&&(h.mode=T)}function W(h){var f=h.mode;if(f==="disabled"&&(h.mode="hidden"),h.cues)for(var T=h.cues.length;T--;)h.removeCue(h.cues[T]);f==="disabled"&&(h.mode=f)}function U(h,f,T){var p=h.mode;if(p==="disabled"&&(h.mode="hidden"),h.cues&&h.cues.length>0)for(var m=L(h.cues,f,T),g=0;gh[T].endTime)return-1;for(var p=0,m=T;p<=m;){var g=Math.floor((m+p)/2);if(fh[g].startTime&&p-1)for(var g=m,a=h.length;g=f&&i.endTime<=T)p.push(i);else if(i.startTime>T)return p}return p}},"./src/utils/time-ranges.ts":function(ue,J,_){"use strict";_.r(J);var X={toString:function(P){for(var W="",U=P.length,O=0;O1?f-1:0),p=1;p100)throw new Error("Position must be between 0 and 100.");x=S,this.hasBeenReset=!0}})),Object.defineProperty(p,"positionAlign",O({},m,{get:function(){return b},set:function(S){var D=U(S);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");b=D,this.hasBeenReset=!0}})),Object.defineProperty(p,"size",O({},m,{get:function(){return d},set:function(S){if(S<0||S>100)throw new Error("Size must be between 0 and 100.");d=S,this.hasBeenReset=!0}})),Object.defineProperty(p,"align",O({},m,{get:function(){return u},set:function(S){var D=U(S);if(!D)throw new SyntaxError("An invalid or illegal string was specified.");u=D,this.hasBeenReset=!0}})),p.displayState=void 0}return L.prototype.getCueAsHTML=function(){var h=self.WebVTT;return h.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"parseTimeStamp",function(){return P}),_.d(J,"fixLineBreaks",function(){return f}),_.d(J,"VTTParser",function(){return T});var X=_("./src/utils/vttcue.ts"),F=function(){function p(){}var m=p.prototype;return m.decode=function(a,i){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},p}();function P(p){function m(a,i,s,l){return(a|0)*3600+(i|0)*60+(s|0)+parseFloat(l||0)}var g=p.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return g?parseFloat(g[2])>59?m(g[2],g[3],0,g[4]):m(g[1],g[2],g[3],g[4]):null}var W=function(){function p(){this.values=Object.create(null)}var m=p.prototype;return m.set=function(a,i){!this.get(a)&&i!==""&&(this.values[a]=i)},m.get=function(a,i,s){return s?this.has(a)?this.values[a]:i[s]:this.has(a)?this.values[a]:i},m.has=function(a){return a in this.values},m.alt=function(a,i,s){for(var l=0;l=0&&s<=100)return this.set(a,s),!0}return!1},p}();function U(p,m,g,a){var i=a?p.split(a):[p];for(var s in i){if(typeof i[s]!="string")continue;var l=i[s].split(g);if(l.length!==2)continue;var C=l[0],v=l[1];m(C,v)}}var O=new X.default(0,0,""),L=O.align==="middle"?"middle":"center";function h(p,m,g){var a=p;function i(){var C=P(p);if(C===null)throw new Error("Malformed timestamp: "+a);return p=p.replace(/^[^\sa-zA-Z-]+/,""),C}function s(C,v){var y=new W;U(C,function(x,b){var d;switch(x){case"region":for(var u=g.length-1;u>=0;u--)if(g[u].id===b){y.set(x,g[u].region);break}break;case"vertical":y.alt(x,b,["rl","lr"]);break;case"line":d=b.split(","),y.integer(x,d[0]),y.percent(x,d[0])&&y.set("snapToLines",!1),y.alt(x,d[0],["auto"]),d.length===2&&y.alt("lineAlign",d[1],["start",L,"end"]);break;case"position":d=b.split(","),y.percent(x,d[0]),d.length===2&&y.alt("positionAlign",d[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":y.percent(x,b);break;case"align":y.alt(x,b,["start",L,"end","left","right"]);break}},/:/,/\s/),v.region=y.get("region",null),v.vertical=y.get("vertical","");var R=y.get("line","auto");R==="auto"&&O.line===-1&&(R=-1),v.line=R,v.lineAlign=y.get("lineAlign","start"),v.snapToLines=y.get("snapToLines",!0),v.size=y.get("size",100),v.align=y.get("align",L);var w=y.get("position","auto");w==="auto"&&O.position===50&&(w=v.align==="start"||v.align==="left"?0:v.align==="end"||v.align==="right"?100:50),v.position=w}function l(){p=p.replace(/^\s+/,"")}if(l(),m.startTime=i(),l(),p.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);p=p.substr(3),l(),m.endTime=i(),l(),s(p,m)}function f(p){return p.replace(//gi,` `)}var T=function(){function p(){this.state="INITIAL",this.buffer="",this.decoder=new F,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var m=p.prototype;return m.parse=function(a){var i=this;a&&(i.buffer+=i.decoder.decode(a,{stream:!0}));function s(){var w=i.buffer,x=0;for(w=f(w);x")===-1){i.cue.id=C;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{d(C,i.cue,i.regionList)}catch(w){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var R=C.indexOf("-->")!==-1;if(!C||R&&(y=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=` +`&&++x,i.buffer=w.substr(x),b}function l(w){U(w,function(x,b){},/:/)}try{var C="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;C=s();var v=C.match(/^()?WEBVTT([ \t].*)?$/);if(!v||!v[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var y=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;y?y=!1:C=s();switch(i.state){case"HEADER":/:/.test(C)?l(C):C||(i.state="ID");continue;case"NOTE":C||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(C)){i.state="NOTE";break}if(!C)continue;if(i.cue=new X.default(0,0,""),i.state="CUE",C.indexOf("-->")===-1){i.cue.id=C;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{h(C,i.cue,i.regionList)}catch(w){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var R=C.indexOf("-->")!==-1;if(!C||R&&(y=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=` `),i.cue.text+=C}continue;case"BADCUE":C||(i.state="ID")}}}catch(w){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},m.flush=function(){var a=this;try{if((a.cue||a.state==="HEADER")&&(a.buffer+=` -`,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){a.onparsingerror&&a.onparsingerror(i)}return a.onflush&&a.onflush(),this},p}()},"./src/utils/webvtt-parser.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"generateCueId",function(){return T}),_.d(J,"parseWebVTT",function(){return m});var X=_("./src/polyfills/number.ts"),F=_("./src/utils/vttparser.ts"),P=_("./src/demux/id3.ts"),W=_("./src/utils/timescale-conversion.ts"),U=_("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,L=function(a,i,s){return s===void 0&&(s=0),a.substr(s,i.length)===i},d=function(a){var i=parseInt(a.substr(-3)),s=parseInt(a.substr(-6,2)),l=parseInt(a.substr(-9,2)),C=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(i)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(l)||!Object(X.isFiniteNumber)(C))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return i+=1e3*s,i+=60*1e3*l,i+=60*60*1e3*C,i},f=function(a){for(var i=5381,s=a.length;s;)i=i*33^a.charCodeAt(--s);return(i>>>0).toString()};function T(g,a,i){return f(g.toString())+f(a.toString())+f(i)}var p=function(a,i,s){var l=a[i],C=a[l.prevCC];if(!C||!C.new&&l.new){a.ccOffset=a.presentationOffset=l.start,l.new=!1;return}for(;(v=C)!==null&&v!==void 0&&v.new;){var v;a.ccOffset+=l.start-C.start,l.new=!1,l=C,C=a[l.prevCC]}a.presentationOffset=s};function m(g,a,i,s,l,C,v,y){var R=new F.VTTParser,w=Object(P.utf8ArrayToStr)(new Uint8Array(g)).trim().replace(O,` +`,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){a.onparsingerror&&a.onparsingerror(i)}return a.onflush&&a.onflush(),this},p}()},"./src/utils/webvtt-parser.ts":function(ue,J,_){"use strict";_.r(J),_.d(J,"generateCueId",function(){return T}),_.d(J,"parseWebVTT",function(){return m});var X=_("./src/polyfills/number.ts"),F=_("./src/utils/vttparser.ts"),P=_("./src/demux/id3.ts"),W=_("./src/utils/timescale-conversion.ts"),U=_("./src/remux/mp4-remuxer.ts"),O=/\r\n|\n\r|\n|\r/g,L=function(a,i,s){return s===void 0&&(s=0),a.substr(s,i.length)===i},h=function(a){var i=parseInt(a.substr(-3)),s=parseInt(a.substr(-6,2)),l=parseInt(a.substr(-9,2)),C=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(i)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(l)||!Object(X.isFiniteNumber)(C))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return i+=1e3*s,i+=60*1e3*l,i+=60*60*1e3*C,i},f=function(a){for(var i=5381,s=a.length;s;)i=i*33^a.charCodeAt(--s);return(i>>>0).toString()};function T(g,a,i){return f(g.toString())+f(a.toString())+f(i)}var p=function(a,i,s){var l=a[i],C=a[l.prevCC];if(!C||!C.new&&l.new){a.ccOffset=a.presentationOffset=l.start,l.new=!1;return}for(;(v=C)!==null&&v!==void 0&&v.new;){var v;a.ccOffset+=l.start-C.start,l.new=!1,l=C,C=a[l.prevCC]}a.presentationOffset=s};function m(g,a,i,s,l,C,v,y){var R=new F.VTTParser,w=Object(P.utf8ArrayToStr)(new Uint8Array(g)).trim().replace(O,` `).split(` -`),x=[],b=Object(W.toMpegTsClockFromTimescale)(a,i),h="00:00.000",u=0,A=0,S,D=!0,I=!1;R.oncue=function(B){var j=s[l],z=s.ccOffset,M=(u-b)/9e4;if(j!=null&&j.new&&(A!==void 0?z=s.ccOffset=j.start:p(s,l,M)),M&&(z=M-s.presentationOffset),I){var N=B.endTime-B.startTime,Y=Object(U.normalizePts)((B.startTime+z-A)*9e4,C*9e4)/9e4;B.startTime=Y,B.endTime=Y+N}var ee=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(ee)),B.id||(B.id=T(B.startTime,B.endTime,ee)),B.endTime>0&&x.push(B)},R.onparsingerror=function(B){S=B},R.onflush=function(){if(S){y(S);return}v(x)},w.forEach(function(B){if(D)if(L(B,"X-TIMESTAMP-MAP=")){D=!1,I=!0,B.substr(16).split(",").forEach(function(j){L(j,"LOCAL:")?h=j.substr(6):L(j,"MPEGTS:")&&(u=parseInt(j.substr(7)))});try{A=d(h)/1e3}catch(j){I=!1,S=j}return}else B===""&&(D=!1);R.parse(B+` -`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/utils/logger.ts"),F=_("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,W=function(){function U(L){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=L?L.xhrSetup:null,this.stats=new F.LoadStats,this.retryDelay=0}var O=U.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.abortInternal=function(){var d=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),d&&(d.onreadystatechange=null,d.onprogress=null,d.readyState!==4&&(this.stats.aborted=!0,d.abort()))},O.abort=function(){var d;this.abortInternal(),(d=this.callbacks)!==null&&d!==void 0&&d.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(d,f,T){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=d,this.config=f,this.callbacks=T,this.retryDelay=f.retryDelay,this.loadInternal()},O.loadInternal=function(){var d=this.config,f=this.context;if(!d)return;var T=this.loader=new self.XMLHttpRequest,p=this.stats;p.loading.first=0,p.loaded=0;var m=this.xhrSetup;try{if(m)try{m(T,f.url)}catch(i){T.open("GET",f.url,!0),m(T,f.url)}T.readyState||T.open("GET",f.url,!0);var g=this.context.headers;if(g)for(var a in g)T.setRequestHeader(a,g[a])}catch(i){this.callbacks.onError({code:T.status,text:i.message},f,T);return}f.rangeEnd&&T.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),T.onreadystatechange=this.readystatechange.bind(this),T.onprogress=this.loadprogress.bind(this),T.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),d.timeout),T.send()},O.readystatechange=function(){var d=this.context,f=this.loader,T=this.stats;if(!d||!f)return;var p=f.readyState,m=this.config;if(T.aborted)return;if(p>=2)if(self.clearTimeout(this.requestTimeout),T.loading.first===0&&(T.loading.first=Math.max(self.performance.now(),T.loading.start)),p===4){f.onreadystatechange=null,f.onprogress=null;var g=f.status;if(g>=200&&g<300){T.loading.end=Math.max(self.performance.now(),T.loading.first);var a,i;if(d.responseType==="arraybuffer"?(a=f.response,i=a.byteLength):(a=f.responseText,i=a.length),T.loaded=T.total=i,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(T,d,a,f),!this.callbacks)return;var l={url:f.responseURL,data:a};this.callbacks.onSuccess(l,T,d,f)}else T.retry>=m.maxRetry||g>=400&&g<499?(X.logger.error(g+" while loading "+d.url),this.callbacks.onError({code:g,text:f.statusText},d,f)):(X.logger.warn(g+" while loading "+d.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,m.maxRetryDelay),T.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout)},O.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var d=this.callbacks;d&&(this.abortInternal(),d.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(d){var f=this.stats;f.loaded=d.loaded,d.lengthComputable&&(f.total=d.total)},O.getCacheAge=function(){var d=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");d=f?parseFloat(f):null}return d},U}();J.default=W}}).default})},vHTk:function(pt,Te,q){pt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(pt,Te,q){"use strict";q.d(Te,"c",function(){return F}),q.d(Te,"b",function(){return P}),q.d(Te,"d",function(){return W}),q.d(Te,"a",function(){return O}),q.d(Te,"e",function(){return L});var ue=q("9og8"),J=q("WmNS"),_=q.n(J),X=q("ErOA");function F(d){return Object(X.c)("libraries/".concat(d,".json"))}function P(){return Object(X.c)("library_tags.json")}function W(d){return U.apply(this,arguments)}function U(){return U=Object(ue.a)(_.a.mark(function d(f){var T;return _.a.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,Object(X.b)("attachments/".concat(f,".json"));case 2:return T=m.sent,m.abrupt("return",T.status===0);case 4:case"end":return m.stop()}},d)})),U.apply(this,arguments)}function O(d){return Object(X.f)("libraries.json",d)}function L(d,f){return Object(X.g)("libraries/".concat(d,".json"),f)}},y5JW:function(pt,Te,q){"use strict";q.d(Te,"c",function(){return g}),q.d(Te,"a",function(){return a});var ue=q("DZo9"),J=q("8z0m"),_=q("+L6B"),X=q("2/Rp"),F=q("9og8"),P=q("k1fw"),W=q("oBTY"),U=q("miYZ"),O=q("tsqr"),L=q("WmNS"),d=q.n(L),f=q("q1tI"),T=q.n(f),p=q("m3rI"),m=q("wzkS"),g="\u3000\u3000";function a(i){var s=["Bytes","KB","MB","GB","TB"];if(i==0)return"0 Byte";var l=parseInt(""+Math.floor(Math.log(i)/Math.log(1024)),10);return(i/Math.pow(1024,l)).toFixed(1)+" "+s[l]}Te.b=function(i){var s=i.value,l=s===void 0?[]:s,C=i.action,v=i.onChange,y=i.className,R=i.maxSize,w=R===void 0?150:R,x=i.title,b=x===void 0?"\u6587\u4EF6\u4E0A\u4F20":x,h=i.accept,u=h===void 0?null:h,A={multiple:!1,fileList:l,accept:u,withCredentials:!0,beforeUpload:function(I){var B=I.size/1024/1024;return B0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:l.length>0,ghost:!0},b),T.a.createElement("span",{onClick:S,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",w,"M) ")))}}}]); +`),x=[],b=Object(W.toMpegTsClockFromTimescale)(a,i),d="00:00.000",u=0,A=0,S,D=!0,I=!1;R.oncue=function(B){var j=s[l],z=s.ccOffset,M=(u-b)/9e4;if(j!=null&&j.new&&(A!==void 0?z=s.ccOffset=j.start:p(s,l,M)),M&&(z=M-s.presentationOffset),I){var N=B.endTime-B.startTime,Y=Object(U.normalizePts)((B.startTime+z-A)*9e4,C*9e4)/9e4;B.startTime=Y,B.endTime=Y+N}var ee=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(ee)),B.id||(B.id=T(B.startTime,B.endTime,ee)),B.endTime>0&&x.push(B)},R.onparsingerror=function(B){S=B},R.onflush=function(){if(S){y(S);return}v(x)},w.forEach(function(B){if(D)if(L(B,"X-TIMESTAMP-MAP=")){D=!1,I=!0,B.substr(16).split(",").forEach(function(j){L(j,"LOCAL:")?d=j.substr(6):L(j,"MPEGTS:")&&(u=parseInt(j.substr(7)))});try{A=h(d)/1e3}catch(j){I=!1,S=j}return}else B===""&&(D=!1);R.parse(B+` +`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(ue,J,_){"use strict";_.r(J);var X=_("./src/utils/logger.ts"),F=_("./src/loader/load-stats.ts"),P=/^age:\s*[\d.]+\s*$/m,W=function(){function U(L){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=L?L.xhrSetup:null,this.stats=new F.LoadStats,this.retryDelay=0}var O=U.prototype;return O.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},O.abortInternal=function(){var h=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),h&&(h.onreadystatechange=null,h.onprogress=null,h.readyState!==4&&(this.stats.aborted=!0,h.abort()))},O.abort=function(){var h;this.abortInternal(),(h=this.callbacks)!==null&&h!==void 0&&h.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},O.load=function(h,f,T){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=h,this.config=f,this.callbacks=T,this.retryDelay=f.retryDelay,this.loadInternal()},O.loadInternal=function(){var h=this.config,f=this.context;if(!h)return;var T=this.loader=new self.XMLHttpRequest,p=this.stats;p.loading.first=0,p.loaded=0;var m=this.xhrSetup;try{if(m)try{m(T,f.url)}catch(i){T.open("GET",f.url,!0),m(T,f.url)}T.readyState||T.open("GET",f.url,!0);var g=this.context.headers;if(g)for(var a in g)T.setRequestHeader(a,g[a])}catch(i){this.callbacks.onError({code:T.status,text:i.message},f,T);return}f.rangeEnd&&T.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),T.onreadystatechange=this.readystatechange.bind(this),T.onprogress=this.loadprogress.bind(this),T.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),h.timeout),T.send()},O.readystatechange=function(){var h=this.context,f=this.loader,T=this.stats;if(!h||!f)return;var p=f.readyState,m=this.config;if(T.aborted)return;if(p>=2)if(self.clearTimeout(this.requestTimeout),T.loading.first===0&&(T.loading.first=Math.max(self.performance.now(),T.loading.start)),p===4){f.onreadystatechange=null,f.onprogress=null;var g=f.status;if(g>=200&&g<300){T.loading.end=Math.max(self.performance.now(),T.loading.first);var a,i;if(h.responseType==="arraybuffer"?(a=f.response,i=a.byteLength):(a=f.responseText,i=a.length),T.loaded=T.total=i,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(T,h,a,f),!this.callbacks)return;var l={url:f.responseURL,data:a};this.callbacks.onSuccess(l,T,h,f)}else T.retry>=m.maxRetry||g>=400&&g<499?(X.logger.error(g+" while loading "+h.url),this.callbacks.onError({code:g,text:f.statusText},h,f)):(X.logger.warn(g+" while loading "+h.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,m.maxRetryDelay),T.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout)},O.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var h=this.callbacks;h&&(this.abortInternal(),h.onTimeout(this.stats,this.context,this.loader))},O.loadprogress=function(h){var f=this.stats;f.loaded=h.loaded,h.lengthComputable&&(f.total=h.total)},O.getCacheAge=function(){var h=null;if(this.loader&&P.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");h=f?parseFloat(f):null}return h},U}();J.default=W}}).default})},vHTk:function(pt,Te,q){pt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(pt,Te,q){"use strict";q.d(Te,"c",function(){return F}),q.d(Te,"b",function(){return P}),q.d(Te,"d",function(){return W}),q.d(Te,"a",function(){return O}),q.d(Te,"e",function(){return L});var ue=q("9og8"),J=q("WmNS"),_=q.n(J),X=q("ErOA");function F(h){return Object(X.c)("libraries/".concat(h,".json"))}function P(){return Object(X.c)("library_tags.json")}function W(h){return U.apply(this,arguments)}function U(){return U=Object(ue.a)(_.a.mark(function h(f){var T;return _.a.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,Object(X.b)("attachments/".concat(f,".json"));case 2:return T=m.sent,m.abrupt("return",T.status===0);case 4:case"end":return m.stop()}},h)})),U.apply(this,arguments)}function O(h){return Object(X.f)("libraries.json",h)}function L(h,f){return Object(X.g)("libraries/".concat(h,".json"),f)}},y5JW:function(pt,Te,q){"use strict";q.d(Te,"c",function(){return g}),q.d(Te,"a",function(){return a});var ue=q("DZo9"),J=q("8z0m"),_=q("+L6B"),X=q("2/Rp"),F=q("9og8"),P=q("k1fw"),W=q("oBTY"),U=q("miYZ"),O=q("tsqr"),L=q("WmNS"),h=q.n(L),f=q("q1tI"),T=q.n(f),p=q("m3rI"),m=q("wzkS"),g="\u3000\u3000";function a(i){var s=["Bytes","KB","MB","GB","TB"];if(i==0)return"0 Byte";var l=parseInt(""+Math.floor(Math.log(i)/Math.log(1024)),10);return(i/Math.pow(1024,l)).toFixed(1)+" "+s[l]}Te.b=function(i){var s=i.value,l=s===void 0?[]:s,C=i.action,v=i.onChange,y=i.className,R=i.maxSize,w=R===void 0?150:R,x=i.title,b=x===void 0?"\u6587\u4EF6\u4E0A\u4F20":x,d=i.accept,u=d===void 0?null:d,A={multiple:!1,fileList:l,accept:u,withCredentials:!0,beforeUpload:function(I){var B=I.size/1024/1024;return B0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:l.length>0,ghost:!0},b),T.a.createElement("span",{onClick:S,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",w,"M) ")))}}}]); diff --git a/p__Classrooms__Lists__Exercise__Answer__index.792d2066.async.js b/p__Classrooms__Lists__Exercise__Answer__index.a35a4949.async.js similarity index 92% rename from p__Classrooms__Lists__Exercise__Answer__index.792d2066.async.js rename to p__Classrooms__Lists__Exercise__Answer__index.a35a4949.async.js index 6b307f292a..c85c229779 100644 --- a/p__Classrooms__Lists__Exercise__Answer__index.792d2066.async.js +++ b/p__Classrooms__Lists__Exercise__Answer__index.a35a4949.async.js @@ -1,6 +1,6 @@ (window.webpackJsonp=window.webpackJsonp||[]).push([[59,3,5,6,7,8,9,17],{"+NIl":function(Ge,de,N){(function(Z){Z(N("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(z,I){"use strict";function G(v,f){v.cmdState.push(f)}function j(v){return v.cmdState.length>0?v.cmdState[v.cmdState.length-1]:null}function w(v){var f=v.cmdState.pop();f&&f.closeBracket()}function W(v){for(var f=v.cmdState,m=f.length-1;m>=0;m--){var a=f[m];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function F(v,f,m){return function(){this.name=v,this.bracketNo=0,this.style=f,this.styles=m,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=F("importmodule","tag",["string","builtin"]),O.documentclass=F("documentclass","tag",["","atom"]),O.usepackage=F("usepackage","tag",["atom"]),O.begin=F("begin","tag",["atom"]),O.end=F("end","tag",["atom"]),O.label=F("label","tag",["atom"]),O.ref=F("ref","tag",["atom"]),O.eqref=F("eqref","tag",["atom"]),O.cite=F("cite","tag",["atom"]),O.bibitem=F("bibitem","tag",["atom"]),O.Bibitem=F("Bibitem","tag",["atom"]),O.RBibitem=F("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function b(v,f){v.f=f}function c(v,f){var m;if(v.match(/^\\[a-zA-Z@]+/)){var a=v.current().slice(1);return m=O.hasOwnProperty(a)?O[a]:O.DEFAULT,m=new m,G(f,m),b(f,S),m.style}if(v.match(/^\\[$&%#{}_]/))return"tag";if(v.match(/^\\[,;!\/\\]/))return"tag";if(v.match("\\["))return b(f,function(o,u){return p(o,u,"\\]")}),"keyword";if(v.match("\\("))return b(f,function(o,u){return p(o,u,"\\)")}),"keyword";if(v.match("$$"))return b(f,function(o,u){return p(o,u,"$$")}),"keyword";if(v.match("$"))return b(f,function(o,u){return p(o,u,"$")}),"keyword";var n=v.next();if(n=="%")return v.skipToEnd(),"comment";if(n=="}"||n=="]"){if(m=j(f),m)m.closeBracket(n),b(f,S);else return"error";return"bracket"}else return n=="{"||n=="["?(m=O.DEFAULT,m=new m,G(f,m),"bracket"):/\d/.test(n)?(v.eatWhile(/[\w.%]/),"atom"):(v.eatWhile(/[\w\-_]/),m=W(f),m.name=="begin"&&(m.argument=v.current()),m.styleIdentifier())}function p(v,f,m){if(v.eatSpace())return null;if(m&&v.match(m))return b(f,c),"keyword";if(v.match(/^\\[a-zA-Z@]+/))return"tag";if(v.match(/^[a-zA-Z]+/))return"variable-2";if(v.match(/^\\[$&%#{}_]/))return"tag";if(v.match(/^\\[,;!\/]/))return"tag";if(v.match(/^[\^_&]/))return"tag";if(v.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(v.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=v.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(v.skipToEnd(),"comment"):"error"}function S(v,f){var m=v.peek(),a;return m=="{"||m=="["?(a=j(f),a.openBracket(m),v.eat(m),b(f,c),"bracket"):/[ \t\r]/.test(m)?(v.eat(m),null):(b(f,c),w(f),c(v,f))}return{startState:function(){var v=I.inMathMode?function(f,m){return p(f,m)}:c;return{cmdState:[],f:v}},copyState:function(v){return{cmdState:v.cmdState.slice(),f:v.f}},token:function(v,f){return f.f(v,f)},blankLine:function(v){v.f=c,v.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+ua5":function(Ge,de,N){},"/GNS":function(Ge,de,N){Ge.exports=N.p+"static/search1.c4136dd4.png"},"/cxE":function(Ge,de,N){"use strict";N.d(de,"e",function(){return I}),N.d(de,"f",function(){return G}),N.d(de,"g",function(){return j}),N.d(de,"d",function(){return W}),N.d(de,"a",function(){return F}),N.d(de,"b",function(){return O}),N.d(de,"c",function(){return b});var Z=function(){function c(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(function(){throw p.stack?new Error(p.message+` -`+p.stack):p},0)}}return c.prototype.emit=function(p){this.listeners.forEach(function(S){S(p)})},c.prototype.onUnexpectedError=function(p){this.unexpectedErrorHandler(p),this.emit(p)},c.prototype.onUnexpectedExternalError=function(p){this.unexpectedErrorHandler(p)},c}(),z=new Z;function I(c){W(c)||z.onUnexpectedError(c);return}function G(c){W(c)||z.onUnexpectedExternalError(c);return}function j(c){if(c instanceof Error){var p=c.name,S=c.message,v=c.stacktrace||c.stack;return{$isError:!0,name:p,message:S,stack:v}}return c}var w="Canceled";function W(c){return c instanceof Error&&c.name===w&&c.message===w}function F(){var c=new Error(w);return c.name=c.message,c}function O(c){return c?new Error("Illegal argument: "+c):new Error("Illegal argument")}function b(c){return c?new Error("Illegal state: "+c):new Error("Illegal state")}},"19Vz":function(Ge,de,N){(function(Z){Z(N("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(F,O,b){var c=b&&b!=Z.Init;if(O&&!c)F.on("blur",j),F.on("change",w),F.on("swapDoc",w),Z.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){G(F)}),w(F);else if(!O&&c){F.off("blur",j),F.off("change",w),F.off("swapDoc",w),Z.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),z(F);var p=F.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}O&&!F.hasFocus()&&j(F)});function z(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function I(F){z(F);var O=F.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=F.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var b=F.getOption("placeholder");typeof b=="string"&&(b=document.createTextNode(b)),O.appendChild(b),F.display.lineSpace.insertBefore(O,F.display.lineSpace.firstChild)}function G(F){setTimeout(function(){var O=!1,b=F.getInputField();b.nodeName=="TEXTAREA"?O=!b.value:F.lineCount()==1&&(O=!/[^\u200b]/.test(b.querySelector(".CodeMirror-line").textContent)),O?I(F):z(F)},20)}function j(F){W(F)&&I(F)}function w(F){var O=F.getWrapperElement(),b=W(F);O.className=O.className.replace(" CodeMirror-empty","")+(b?" CodeMirror-empty":""),b?I(F):z(F)}function W(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(Ge,de,N){(function(Z){Z(N("VrN/"))})(function(Z){"use strict";var z={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(G,j){var w=G.indentUnit,W={},F=j.htmlMode?z:I;for(var O in F)W[O]=F[O];for(var O in j)W[O]=j[O];var b,c;function p(l,D){function T(k){return D.tokenize=k,k(l,D)}var C=l.next();if(C=="<")return l.eat("!")?l.eat("[")?l.match("CDATA[")?T(f("atom","]]>")):null:l.match("--")?T(f("comment","-->")):l.match("DOCTYPE",!0,!0)?(l.eatWhile(/[\w\._\-]/),T(m(1))):null:l.eat("?")?(l.eatWhile(/[\w\._\-]/),D.tokenize=f("meta","?>"),"meta"):(b=l.eat("/")?"closeTag":"openTag",D.tokenize=S,"tag bracket");if(C=="&"){var M;return l.eat("#")?l.eat("x")?M=l.eatWhile(/[a-fA-F\d]/)&&l.eat(";"):M=l.eatWhile(/[\d]/)&&l.eat(";"):M=l.eatWhile(/[\w\.\-:]/)&&l.eat(";"),M?"atom":"error"}else return l.eatWhile(/[^&<]/),null}p.isInText=!0;function S(l,D){var T=l.next();if(T==">"||T=="/"&&l.eat(">"))return D.tokenize=p,b=T==">"?"endTag":"selfcloseTag","tag bracket";if(T=="=")return b="equals",null;if(T=="<"){D.tokenize=p,D.state=u,D.tagName=D.tagStart=null;var C=D.tokenize(l,D);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(T)?(D.tokenize=v(T),D.stringStartCol=l.column(),D.tokenize(l,D)):(l.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function v(l){var D=function(T,C){for(;!T.eol();)if(T.next()==l){C.tokenize=S;break}return"string"};return D.isInAttribute=!0,D}function f(l,D){return function(T,C){for(;!T.eol();){if(T.match(D)){C.tokenize=p;break}T.next()}return l}}function m(l){return function(D,T){for(var C;(C=D.next())!=null;){if(C=="<")return T.tokenize=m(l+1),T.tokenize(D,T);if(C==">")if(l==1){T.tokenize=p;break}else return T.tokenize=m(l-1),T.tokenize(D,T)}return"meta"}}function a(l,D,T){this.prev=l.context,this.tagName=D,this.indent=l.indented,this.startOfLine=T,(W.doNotIndent.hasOwnProperty(D)||l.context&&l.context.noIndent)&&(this.noIndent=!0)}function n(l){l.context&&(l.context=l.context.prev)}function o(l,D){for(var T;;){if(!l.context)return;if(T=l.context.tagName,!W.contextGrabbers.hasOwnProperty(T)||!W.contextGrabbers[T].hasOwnProperty(D))return;n(l)}}function u(l,D,T){return l=="openTag"?(T.tagStart=D.column(),A):l=="closeTag"?x:u}function A(l,D,T){return l=="word"?(T.tagName=D.current(),c="tag",R):W.allowMissingTagName&&l=="endTag"?(c="tag bracket",R(l,D,T)):(c="error",A)}function x(l,D,T){if(l=="word"){var C=D.current();return T.context&&T.context.tagName!=C&&W.implicitlyClosed.hasOwnProperty(T.context.tagName)&&n(T),T.context&&T.context.tagName==C||W.matchClosing===!1?(c="tag",y):(c="tag error",_)}else return W.allowMissingTagName&&l=="endTag"?(c="tag bracket",y(l,D,T)):(c="error",_)}function y(l,D,T){return l!="endTag"?(c="error",y):(n(T),u)}function _(l,D,T){return c="error",y(l,D,T)}function R(l,D,T){if(l=="word")return c="attribute",g;if(l=="endTag"||l=="selfcloseTag"){var C=T.tagName,M=T.tagStart;return T.tagName=T.tagStart=null,l=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(C)?o(T,C):(o(T,C),T.context=new a(T,C,M==T.indented)),u}return c="error",R}function g(l,D,T){return l=="equals"?h:(W.allowMissing||(c="error"),R(l,D,T))}function h(l,D,T){return l=="string"?s:l=="word"&&W.allowUnquoted?(c="string",R):(c="error",R(l,D,T))}function s(l,D,T){return l=="string"?s:R(l,D,T)}return{startState:function(l){var D={tokenize:p,state:u,indented:l||0,tagName:null,tagStart:null,context:null};return l!=null&&(D.baseIndent=l),D},token:function(l,D){if(!D.tagName&&l.sol()&&(D.indented=l.indentation()),l.eatSpace())return null;b=null;var T=D.tokenize(l,D);return(T||b)&&T!="comment"&&(c=null,D.state=D.state(b||T,l,D),c&&(T=c=="error"?T+" error":c)),T},indent:function(l,D,T){var C=l.context;if(l.tokenize.isInAttribute)return l.tagStart==l.indented?l.stringStartCol+1:l.indented+w;if(C&&C.noIndent)return Z.Pass;if(l.tokenize!=S&&l.tokenize!=p)return T?T.match(/^(\s*)/)[0].length:0;if(l.tagName)return W.multilineTagIndentPastTag!==!1?l.tagStart+l.tagName.length+2:l.tagStart+w*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/$/,blockCommentStart:"",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(l){l.state==h&&(l.state=R)},xmlCurrentTag:function(l){return l.tagName?{name:l.tagName,close:l.type=="closeTag"}:null},xmlCurrentContext:function(l){for(var D=[],T=l.context;T;T=T.prev)T.tagName&&D.push(T.tagName);return D.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Ge,de,N){"use strict";N.d(de,"d",function(){return bt}),N.d(de,"b",function(){return Fe}),N.d(de,"c",function(){return ut}),N.d(de,"a",function(){return _t});var Z=N("VTBJ"),z=N("1OyB"),I=N("vuIU"),G=N("JX7q"),j=N("Ji7U"),w=N("LK+K"),W=N("q1tI"),F=N("I8Z2"),O=N("BGR+"),b=N("wx14"),c=N("rePB"),p=N("4IlW"),S=N("2GS6"),v=N("Gytx"),f=N.n(v),m=N("TSYQ"),a=N.n(m),n=N("U8pU"),o=N("ODXe"),u=/iPhone/i,A=/iPod/i,x=/iPad/i,y=/\bAndroid(?:.+)Mobile\b/i,_=/Android/i,R=/\bAndroid(?:.+)SD4930UR\b/i,g=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,h=/Windows Phone/i,s=/\bWindows(?:.+)ARM\b/i,l=/BlackBerry/i,D=/BB10/i,T=/Opera Mini/i,C=/\b(CriOS|Chrome)(?:.+)Mobile/i,M=/Mobile(?:.+)Firefox\b/i;function k(gt,et){return gt.test(et)}function U(gt){var et=gt||(typeof navigator!="undefined"?navigator.userAgent:""),nt=et.split("[FBAN");if(typeof nt[1]!="undefined"){var Xe=nt,ue=Object(o.a)(Xe,1);et=ue[0]}if(nt=et.split("Twitter"),typeof nt[1]!="undefined"){var Ce=nt,rt=Object(o.a)(Ce,1);et=rt[0]}var Qe={apple:{phone:k(u,et)&&!k(h,et),ipod:k(A,et),tablet:!k(u,et)&&k(x,et)&&!k(h,et),device:(k(u,et)||k(A,et)||k(x,et))&&!k(h,et)},amazon:{phone:k(R,et),tablet:!k(R,et)&&k(g,et),device:k(R,et)||k(g,et)},android:{phone:!k(h,et)&&k(R,et)||!k(h,et)&&k(y,et),tablet:!k(h,et)&&!k(R,et)&&!k(y,et)&&(k(g,et)||k(_,et)),device:!k(h,et)&&(k(R,et)||k(g,et)||k(y,et)||k(_,et))||k(/\bokhttp\b/i,et)},windows:{phone:k(h,et),tablet:k(s,et),device:k(h,et)||k(s,et)},other:{blackberry:k(l,et),blackberry10:k(D,et),opera:k(T,et),firefox:k(M,et),chrome:k(C,et),device:k(l,et)||k(D,et)||k(T,et)||k(M,et)||k(C,et)},any:null,phone:null,tablet:null};return Qe.any=Qe.apple.device||Qe.android.device||Qe.windows.device||Qe.other.device,Qe.phone=Qe.apple.phone||Qe.android.phone||Qe.windows.phone,Qe.tablet=Qe.apple.tablet||Qe.android.tablet||Qe.windows.tablet,Qe}var P=Object(Z.a)(Object(Z.a)({},U()),{},{isMobile:U}),K=P;function H(){}function $(gt,et,nt){var Xe=et||"";return gt.key||"".concat(Xe,"item_").concat(nt)}function le(gt){return"".concat(gt,"-menu-")}function pe(gt,et){var nt=-1;W.Children.forEach(gt,function(Xe){nt+=1,Xe&&Xe.type&&Xe.type.isMenuItemGroup?W.Children.forEach(Xe.props.children,function(ue){nt+=1,et(ue,nt)}):et(Xe,nt)})}function xe(gt,et,nt){if(!gt||nt.find)return;W.Children.forEach(gt,function(Xe){if(Xe){var ue=Xe.type;if(!ue||!(ue.isSubMenu||ue.isMenuItem||ue.isMenuItemGroup))return;et.indexOf(Xe.key)!==-1?nt.find=!0:Xe.props.children&&xe(Xe.props.children,et,nt)}})}var ze=["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"],Ne=function(et){var nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=et&&typeof et.getBoundingClientRect=="function"&&et.getBoundingClientRect().width;if(Xe){if(nt){var ue=getComputedStyle(et),Ce=ue.marginLeft,rt=ue.marginRight;Xe+=+Ce.replace("px","")+ +rt.replace("px","")}Xe=+Xe.toFixed(6)}return Xe||0},Ie=function(et,nt,Xe){et&&Object(n.a)(et.style)==="object"&&(et.style[nt]=Xe)},Be=function(){return K.any},ke=N("KQm4"),ge=N("Ff2n"),he=N("i8i4"),te=N("bdgK"),be=N("uciX"),se=N("8XRh"),Oe={adjustX:1,adjustY:1},ie={topLeft:{points:["bl","tl"],overflow:Oe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Oe,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Oe,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Oe,offset:[4,0]}},oe={topLeft:{points:["bl","tl"],overflow:Oe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Oe,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Oe,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Oe,offset:[4,0]}},Ae=ie,_e=0,je={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},He=function(et,nt,Xe){var ue=le(nt),Ce=et.getState();et.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},Ce.defaultActiveFirst),{},Object(c.a)({},ue,Xe))})},Ye=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(Xe){var ue;Object(z.a)(this,nt),ue=et.call(this,Xe),ue.onDestroy=function(Le){ue.props.onDestroy(Le)},ue.onKeyDown=function(Le){var Ue=Le.keyCode,$e=ue.menuInstance,at=ue.props,St=at.isOpen,it=at.store;if(Ue===p.a.ENTER)return ue.onTitleClick(Le),He(it,ue.props.eventKey,!0),!0;if(Ue===p.a.RIGHT)return St?$e.onKeyDown(Le):(ue.triggerOpenChange(!0),He(it,ue.props.eventKey,!0)),!0;if(Ue===p.a.LEFT){var It;if(St)It=$e.onKeyDown(Le);else return;return It||(ue.triggerOpenChange(!1),It=!0),It}return St&&(Ue===p.a.UP||Ue===p.a.DOWN)?$e.onKeyDown(Le):void 0},ue.onOpenChange=function(Le){ue.props.onOpenChange(Le)},ue.onPopupVisibleChange=function(Le){ue.triggerOpenChange(Le,Le?"mouseenter":"mouseleave")},ue.onMouseEnter=function(Le){var Ue=ue.props,$e=Ue.eventKey,at=Ue.onMouseEnter,St=Ue.store;He(St,ue.props.eventKey,!1),at({key:$e,domEvent:Le})},ue.onMouseLeave=function(Le){var Ue=ue.props,$e=Ue.parentMenu,at=Ue.eventKey,St=Ue.onMouseLeave;$e.subMenuInstance=Object(G.a)(ue),St({key:at,domEvent:Le})},ue.onTitleMouseEnter=function(Le){var Ue=ue.props,$e=Ue.eventKey,at=Ue.onItemHover,St=Ue.onTitleMouseEnter;at({key:$e,hover:!0}),St({key:$e,domEvent:Le})},ue.onTitleMouseLeave=function(Le){var Ue=ue.props,$e=Ue.parentMenu,at=Ue.eventKey,St=Ue.onItemHover,it=Ue.onTitleMouseLeave;$e.subMenuInstance=Object(G.a)(ue),St({key:at,hover:!1}),it({key:at,domEvent:Le})},ue.onTitleClick=function(Le){var Ue=Object(G.a)(ue),$e=Ue.props;if($e.onTitleClick({key:$e.eventKey,domEvent:Le}),$e.triggerSubMenuAction==="hover")return;ue.triggerOpenChange(!$e.isOpen,"click"),He($e.store,ue.props.eventKey,!1)},ue.onSubMenuClick=function(Le){typeof ue.props.onClick=="function"&&ue.props.onClick(ue.addKeyPath(Le))},ue.onSelect=function(Le){ue.props.onSelect(Le)},ue.onDeselect=function(Le){ue.props.onDeselect(Le)},ue.getPrefixCls=function(){return"".concat(ue.props.rootPrefixCls,"-submenu")},ue.getActiveClassName=function(){return"".concat(ue.getPrefixCls(),"-active")},ue.getDisabledClassName=function(){return"".concat(ue.getPrefixCls(),"-disabled")},ue.getSelectedClassName=function(){return"".concat(ue.getPrefixCls(),"-selected")},ue.getOpenClassName=function(){return"".concat(ue.props.rootPrefixCls,"-submenu-open")},ue.saveMenuInstance=function(Le){ue.menuInstance=Le},ue.addKeyPath=function(Le){return Object(Z.a)(Object(Z.a)({},Le),{},{keyPath:(Le.keyPath||[]).concat(ue.props.eventKey)})},ue.triggerOpenChange=function(Le,Ue){var $e=ue.props.eventKey,at=function(){ue.onOpenChange({key:$e,item:Object(G.a)(ue),trigger:Ue,open:Le})};Ue==="mouseenter"?ue.mouseenterTimeout=setTimeout(function(){at()},0):at()},ue.isChildrenSelected=function(){var Le={find:!1};return xe(ue.props.children,ue.props.selectedKeys,Le),Le.find},ue.isOpen=function(){return ue.props.openKeys.indexOf(ue.props.eventKey)!==-1},ue.adjustWidth=function(){if(!ue.subMenuTitle||!ue.menuInstance)return;var Le=he.findDOMNode(ue.menuInstance);if(Le.offsetWidth>=ue.subMenuTitle.offsetWidth)return;Le.style.minWidth="".concat(ue.subMenuTitle.offsetWidth,"px")},ue.saveSubMenuTitle=function(Le){ue.subMenuTitle=Le},ue.getBaseProps=function(){var Le=Object(G.a)(ue),Ue=Le.props;return{mode:Ue.mode==="horizontal"?"vertical":Ue.mode,visible:ue.props.isOpen,level:Ue.level+1,inlineIndent:Ue.inlineIndent,focusable:!1,onClick:ue.onSubMenuClick,onSelect:ue.onSelect,onDeselect:ue.onDeselect,onDestroy:ue.onDestroy,selectedKeys:Ue.selectedKeys,eventKey:"".concat(Ue.eventKey,"-menu-"),openKeys:Ue.openKeys,motion:Ue.motion,onOpenChange:ue.onOpenChange,subMenuOpenDelay:Ue.subMenuOpenDelay,parentMenu:Object(G.a)(ue),subMenuCloseDelay:Ue.subMenuCloseDelay,forceSubMenuRender:Ue.forceSubMenuRender,triggerSubMenuAction:Ue.triggerSubMenuAction,builtinPlacements:Ue.builtinPlacements,defaultActiveFirst:Ue.store.getState().defaultActiveFirst[le(Ue.eventKey)],multiple:Ue.multiple,prefixCls:Ue.rootPrefixCls,id:ue.internalMenuId,manualRef:ue.saveMenuInstance,itemIcon:Ue.itemIcon,expandIcon:Ue.expandIcon,direction:Ue.direction}},ue.getMotion=function(Le,Ue){var $e=Object(G.a)(ue),at=$e.haveRendered,St=ue.props,it=St.motion,It=St.rootPrefixCls,Xt=Object(Z.a)(Object(Z.a)({},it),{},{leavedClassName:"".concat(It,"-hidden"),removeOnLeave:!1,motionAppear:at||!Ue||Le!=="inline"});return Xt};var Ce=Xe.store,rt=Xe.eventKey,Qe=Ce.getState(),At=Qe.defaultActiveFirst;ue.isRootMenu=!1;var vt=!1;return At&&(vt=At[rt]),He(Ce,rt,vt),ue}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ue=this,Ce=this.props,rt=Ce.mode,Qe=Ce.parentMenu,At=Ce.manualRef;if(At&&At(this),rt!=="horizontal"||!Qe.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ue.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ue=this.props,Ce=ue.onDestroy,rt=ue.eventKey;Ce&&Ce(rt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ue){var Ce=this,rt=this.getBaseProps(),Qe=this.getMotion(rt.mode,rt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||rt.visible||rt.forceSubMenuRender,!this.haveOpened)return W.createElement("div",null);var At=rt.direction;return W.createElement(se.default,Object.assign({visible:rt.visible},Qe),function(vt){var Le=vt.className,Ue=vt.style,$e=a()("".concat(rt.prefixCls,"-sub"),Le,Object(c.a)({},"".concat(rt.prefixCls,"-rtl"),At==="rtl"));return W.createElement(Te,Object.assign({},rt,{id:Ce.internalMenuId,className:$e,style:Ue}),ue)})}},{key:"render",value:function(){var ue,Ce=Object(Z.a)({},this.props),rt=Ce.isOpen,Qe=this.getPrefixCls(),At=Ce.mode==="inline",vt=a()(Qe,"".concat(Qe,"-").concat(Ce.mode),(ue={},Object(c.a)(ue,Ce.className,!!Ce.className),Object(c.a)(ue,this.getOpenClassName(),rt),Object(c.a)(ue,this.getActiveClassName(),Ce.active||rt&&!At),Object(c.a)(ue,this.getDisabledClassName(),Ce.disabled),Object(c.a)(ue,this.getSelectedClassName(),this.isChildrenSelected()),ue));this.internalMenuId||(Ce.eventKey?this.internalMenuId="".concat(Ce.eventKey,"$Menu"):(_e+=1,this.internalMenuId="$__$".concat(_e,"$Menu")));var Le={},Ue={},$e={};Ce.disabled||(Le={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ue={onClick:this.onTitleClick},$e={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var at={},St=Ce.direction;At&&(St==="rtl"?at.paddingRight=Ce.inlineIndent*Ce.level:at.paddingLeft=Ce.inlineIndent*Ce.level);var it={};this.props.isOpen&&(it={"aria-owns":this.internalMenuId});var It=null;Ce.mode!=="horizontal"&&(It=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(It=W.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var Xt=W.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:at,className:"".concat(Qe,"-title"),role:"button"},$e,Ue,{"aria-expanded":rt},it,{"aria-haspopup":"true",title:typeof Ce.title=="string"?Ce.title:void 0}),Ce.title,It||W.createElement("i",{className:"".concat(Qe,"-arrow")})),Lt=this.renderChildren(Ce.children),sn=Ce.parentMenu.isRootMenu?Ce.parentMenu.props.getPopupContainer:function(Ht){return Ht.parentNode},hn=je[Ce.mode],nn=Ce.popupOffset?{offset:Ce.popupOffset}:{},Jt=Ce.mode==="inline"?"":Ce.popupClassName;Jt+=St==="rtl"?" ".concat(Qe,"-rtl"):"";var cn=Ce.disabled,On=Ce.triggerSubMenuAction,mn=Ce.subMenuOpenDelay,ot=Ce.forceSubMenuRender,wt=Ce.subMenuCloseDelay,Rt=Ce.builtinPlacements;ze.forEach(function(Ht){return delete Ce[Ht]}),delete Ce.onClick;var Kt=St==="rtl"?Object.assign({},oe,Rt):Object.assign({},ie,Rt);return delete Ce.direction,W.createElement("li",Object.assign({},Ce,Le,{className:vt,role:"menuitem"}),At&&Xt,At&&Lt,!At&&W.createElement(be.a,{prefixCls:Qe,popupClassName:a()("".concat(Qe,"-popup"),Jt),getPopupContainer:sn,builtinPlacements:Kt,popupPlacement:hn,popupVisible:rt,popupAlign:nn,popup:Lt,action:cn?[]:[On],mouseEnterDelay:mn,mouseLeaveDelay:wt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ot},Xt))}}]),nt}(W.Component);Ye.defaultProps={onMouseEnter:H,onMouseLeave:H,onTitleMouseEnter:H,onTitleMouseLeave:H,onTitleClick:H,manualRef:H,mode:"vertical",title:""};var qe=Object(F.b)(function(gt,et){var nt=gt.openKeys,Xe=gt.activeKey,ue=gt.selectedKeys,Ce=et.eventKey,rt=et.subMenuKey;return{isOpen:nt.indexOf(Ce)>-1,active:Xe[rt]===Ce,selectedKeys:ue}})(Ye);qe.isSubMenu=!0;var bt=qe,yt="menuitem-overflowed",ct=.5,mt=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(){var Xe;return Object(z.a)(this,nt),Xe=et.apply(this,arguments),Xe.resizeObserver=null,Xe.mutationObserver=null,Xe.originalTotalWidth=0,Xe.overflowedItems=[],Xe.menuItemSizes=[],Xe.cancelFrameId=null,Xe.state={lastVisibleIndex:void 0},Xe.getMenuItemNodes=function(){var ue=Xe.props.prefixCls,Ce=he.findDOMNode(Object(G.a)(Xe));return Ce?[].slice.call(Ce.children).filter(function(rt){return rt.className.split(" ").indexOf("".concat(ue,"-overflowed-submenu"))<0}):[]},Xe.getOverflowedSubMenuItem=function(ue,Ce,rt){var Qe=Xe.props,At=Qe.overflowedIndicator,vt=Qe.level,Le=Qe.mode,Ue=Qe.prefixCls,$e=Qe.theme;if(vt!==1||Le!=="horizontal")return null;var at=Xe.props.children[0],St=at.props,it=St.children,It=St.title,Xt=St.style,Lt=Object(ge.a)(St,["children","title","style"]),sn=Object(Z.a)({},Xt),hn="".concat(ue,"-overflowed-indicator"),nn="".concat(ue,"-overflowed-indicator");Ce.length===0&&rt!==!0?sn=Object(Z.a)(Object(Z.a)({},sn),{},{display:"none"}):rt&&(sn=Object(Z.a)(Object(Z.a)({},sn),{},{visibility:"hidden",position:"absolute"}),hn="".concat(hn,"-placeholder"),nn="".concat(nn,"-placeholder"));var Jt=$e?"".concat(Ue,"-").concat($e):"",cn={};return ze.forEach(function(On){Lt[On]!==void 0&&(cn[On]=Lt[On])}),W.createElement(bt,Object.assign({title:At,className:"".concat(Ue,"-overflowed-submenu"),popupClassName:Jt},cn,{key:hn,eventKey:nn,disabled:!1,style:sn}),Ce)},Xe.setChildrenWidthAndResize=function(){if(Xe.props.mode!=="horizontal")return;var ue=he.findDOMNode(Object(G.a)(Xe));if(!ue)return;var Ce=ue.children;if(!Ce||Ce.length===0)return;var rt=ue.children[Ce.length-1];Ie(rt,"display","inline-block");var Qe=Xe.getMenuItemNodes(),At=Qe.filter(function(vt){return vt.className.split(" ").indexOf(yt)>=0});At.forEach(function(vt){Ie(vt,"display","inline-block")}),Xe.menuItemSizes=Qe.map(function(vt){return Ne(vt,!0)}),At.forEach(function(vt){Ie(vt,"display","none")}),Xe.overflowedIndicatorWidth=Ne(ue.children[ue.children.length-1],!0),Xe.originalTotalWidth=Xe.menuItemSizes.reduce(function(vt,Le){return vt+Le},0),Xe.handleResize(),Ie(rt,"display","none")},Xe.handleResize=function(){if(Xe.props.mode!=="horizontal")return;var ue=he.findDOMNode(Object(G.a)(Xe));if(!ue)return;var Ce=Ne(ue);Xe.overflowedItems=[];var rt=0,Qe;Xe.originalTotalWidth>Ce+ct&&(Qe=-1,Xe.menuItemSizes.forEach(function(At){rt+=At,rt+Xe.overflowedIndicatorWidth<=Ce&&(Qe+=1)})),Xe.setState({lastVisibleIndex:Qe})},Xe}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){var ue=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ce=he.findDOMNode(this);if(!Ce)return;this.resizeObserver=new te.default(function(rt){rt.forEach(function(){var Qe=ue.cancelFrameId;cancelAnimationFrame(Qe),ue.cancelFrameId=requestAnimationFrame(ue.setChildrenWidthAndResize)})}),[].slice.call(Ce.children).concat(Ce).forEach(function(rt){ue.resizeObserver.observe(rt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ue.resizeObserver.disconnect(),[].slice.call(Ce.children).concat(Ce).forEach(function(rt){ue.resizeObserver.observe(rt)}),ue.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ce,{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(ue){var Ce=this,rt=this.state.lastVisibleIndex;return(ue||[]).reduce(function(Qe,At,vt){var Le=At;if(Ce.props.mode==="horizontal"){var Ue=Ce.getOverflowedSubMenuItem(At.props.eventKey,[]);rt!==void 0&&Ce.props.className.indexOf("".concat(Ce.props.prefixCls,"-root"))!==-1&&(vt>rt&&(Le=W.cloneElement(At,{style:{display:"none"},eventKey:"".concat(At.props.eventKey,"-hidden"),className:"".concat(yt)})),vt===rt+1&&(Ce.overflowedItems=ue.slice(rt+1).map(function(at){return W.cloneElement(at,{key:at.props.eventKey,mode:"vertical-left"})}),Ue=Ce.getOverflowedSubMenuItem(At.props.eventKey,Ce.overflowedItems)));var $e=[].concat(Object(ke.a)(Qe),[Ue,Le]);return vt===ue.length-1&&$e.push(Ce.getOverflowedSubMenuItem(At.props.eventKey,[],!0)),$e}return[].concat(Object(ke.a)(Qe),[Le])},[])}},{key:"render",value:function(){var ue=this.props,Ce=ue.visible,rt=ue.prefixCls,Qe=ue.overflowedIndicator,At=ue.mode,vt=ue.level,Le=ue.tag,Ue=ue.children,$e=ue.theme,at=Object(ge.a)(ue,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),St=Le;return W.createElement(St,Object.assign({},at),this.renderChildren(Ue))}}]),nt}(W.Component);mt.defaultProps={tag:"div",className:""};var Ot=mt;function Mt(gt){return gt.length?gt.every(function(et){return!!et.props.disabled}):!0}function Me(gt,et,nt){var Xe=gt.getState();gt.setState({activeKey:Object(Z.a)(Object(Z.a)({},Xe.activeKey),{},Object(c.a)({},et,nt))})}function Re(gt){return gt.eventKey||"0-menu-"}function Ze(gt,et){var nt=et,Xe=gt.children,ue=gt.eventKey;if(nt){var Ce;if(pe(Xe,function(rt,Qe){rt&&rt.props&&!rt.props.disabled&&nt===$(rt,ue,Qe)&&(Ce=!0)}),Ce)return nt}return nt=null,gt.defaultActiveFirst&&pe(Xe,function(rt,Qe){!nt&&rt&&!rt.props.disabled&&(nt=$(rt,ue,Qe))}),nt}function lt(gt){if(gt){var et=this.instanceArray.indexOf(gt);et!==-1?this.instanceArray[et]=gt:this.instanceArray.push(gt)}}var Ke=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(Xe){var ue;return Object(z.a)(this,nt),ue=et.call(this,Xe),ue.onKeyDown=function(Ce,rt){var Qe=Ce.keyCode,At;if(ue.getFlatInstanceArray().forEach(function(Le){Le&&Le.props.active&&Le.onKeyDown&&(At=Le.onKeyDown(Ce))}),At)return 1;var vt=null;return(Qe===p.a.UP||Qe===p.a.DOWN)&&(vt=ue.step(Qe===p.a.UP?-1:1)),vt?(Ce.preventDefault(),Me(ue.props.store,Re(ue.props),vt.props.eventKey),typeof rt=="function"&&rt(vt),1):void 0},ue.onItemHover=function(Ce){var rt=Ce.key,Qe=Ce.hover;Me(ue.props.store,Re(ue.props),Qe?rt:null)},ue.onDeselect=function(Ce){ue.props.onDeselect(Ce)},ue.onSelect=function(Ce){ue.props.onSelect(Ce)},ue.onClick=function(Ce){ue.props.onClick(Ce)},ue.onOpenChange=function(Ce){ue.props.onOpenChange(Ce)},ue.onDestroy=function(Ce){ue.props.onDestroy(Ce)},ue.getFlatInstanceArray=function(){return ue.instanceArray},ue.step=function(Ce){var rt=ue.getFlatInstanceArray(),Qe=ue.props.store.getState().activeKey[Re(ue.props)],At=rt.length;if(!At)return null;Ce<0&&(rt=rt.concat().reverse());var vt=-1;if(rt.every(function(at,St){return at&&at.props.eventKey===Qe?(vt=St,!1):!0}),!ue.props.defaultActiveFirst&&vt!==-1&&Mt(rt.slice(vt,At-1)))return;var Le=(vt+1)%At,Ue=Le;do{var $e=rt[Ue];if(!$e||$e.props.disabled)Ue=(Ue+1)%At;else return $e}while(Ue!==Le);return null},ue.renderCommonMenuItem=function(Ce,rt,Qe){var At=ue.props.store.getState(),vt=Object(G.a)(ue),Le=vt.props,Ue=$(Ce,Le.eventKey,rt),$e=Ce.props;if(!$e||typeof Ce.type=="string")return Ce;var at=Ue===At.activeKey,St=Object(Z.a)(Object(Z.a)({mode:$e.mode||Le.mode,level:Le.level,inlineIndent:Le.inlineIndent,renderMenuItem:ue.renderMenuItem,rootPrefixCls:Le.prefixCls,index:rt,parentMenu:Le.parentMenu,manualRef:$e.disabled?void 0:Object(S.a)(Ce.ref,lt.bind(Object(G.a)(ue))),eventKey:Ue,active:!$e.disabled&&at,multiple:Le.multiple,onClick:function(It){($e.onClick||H)(It),ue.onClick(It)},onItemHover:ue.onItemHover,motion:Le.motion,subMenuOpenDelay:Le.subMenuOpenDelay,subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,onOpenChange:ue.onOpenChange,onDeselect:ue.onDeselect,onSelect:ue.onSelect,builtinPlacements:Le.builtinPlacements,itemIcon:$e.itemIcon||ue.props.itemIcon,expandIcon:$e.expandIcon||ue.props.expandIcon},Qe),{},{direction:Le.direction});return(Le.mode==="inline"||Be())&&(St.triggerSubMenuAction="click"),W.cloneElement(Ce,St)},ue.renderMenuItem=function(Ce,rt,Qe){if(!Ce)return null;var At=ue.props.store.getState(),vt={openKeys:At.openKeys,selectedKeys:At.selectedKeys,triggerSubMenuAction:ue.props.triggerSubMenuAction,subMenuKey:Qe};return ue.renderCommonMenuItem(Ce,rt,vt)},Xe.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},Xe.store.getState().activeKey),{},Object(c.a)({},Xe.eventKey,Ze(Xe,Xe.activeKey)))}),ue.instanceArray=[],ue}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ue){return this.props.visible||ue.visible||this.props.className!==ue.className||!f()(this.props.style,ue.style)}},{key:"componentDidUpdate",value:function(ue){var Ce=this.props,rt="activeKey"in Ce?Ce.activeKey:Ce.store.getState().activeKey[Re(Ce)],Qe=Ze(Ce,rt);if(Qe!==rt)Me(Ce.store,Re(Ce),Qe);else if("activeKey"in ue){var At=Ze(ue,ue.activeKey);Qe!==At&&Me(Ce.store,Re(Ce),Qe)}}},{key:"render",value:function(){var ue=this,Ce=Object(b.a)({},this.props);this.instanceArray=[];var rt=a()(Ce.prefixCls,Ce.className,"".concat(Ce.prefixCls,"-").concat(Ce.mode)),Qe={className:rt,role:Ce.role||"menu"};Ce.id&&(Qe.id=Ce.id),Ce.focusable&&(Qe.tabIndex=0,Qe.onKeyDown=this.onKeyDown);var At=Ce.prefixCls,vt=Ce.eventKey,Le=Ce.visible,Ue=Ce.level,$e=Ce.mode,at=Ce.overflowedIndicator,St=Ce.theme;return ze.forEach(function(it){return delete Ce[it]}),delete Ce.onClick,W.createElement(Ot,Object.assign({},Ce,{prefixCls:At,mode:$e,tag:"ul",level:Ue,theme:St,visible:Le,overflowedIndicator:at},Qe),W.Children.map(Ce.children,function(it,It){return ue.renderMenuItem(it,It,vt||"0-menu-")}))}}]),nt}(W.Component);Ke.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:H};var tt=Object(F.b)()(Ke),Te=tt,me=N("Kwbf");function ve(gt,et,nt){var Xe=gt.prefixCls,ue=gt.motion,Ce=gt.defaultMotions,rt=Ce===void 0?{}:Ce,Qe=gt.openAnimation,At=gt.openTransitionName,vt=et.switchingModeFromInline;if(ue)return ue;if(Object(n.a)(Qe)==="object"&&Qe)Object(me.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Qe=="string")return{motionName:"".concat(Xe,"-open-").concat(Qe)};if(At)return{motionName:At};var Le=rt[nt];return Le||(vt?null:rt.other)}var re=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(Xe){var ue;Object(z.a)(this,nt),ue=et.call(this,Xe),ue.inlineOpenKeys=[],ue.onSelect=function(Qe){var At=Object(G.a)(ue),vt=At.props;if(vt.selectable){var Le=ue.store.getState(),Ue=Le.selectedKeys,$e=Qe.key;vt.multiple?Ue=Ue.concat([$e]):Ue=[$e],"selectedKeys"in vt||ue.store.setState({selectedKeys:Ue}),vt.onSelect(Object(Z.a)(Object(Z.a)({},Qe),{},{selectedKeys:Ue}))}},ue.onClick=function(Qe){var At=ue.getRealMenuMode(),vt=Object(G.a)(ue),Le=vt.store,Ue=vt.props.onOpenChange;At!=="inline"&&!("openKeys"in ue.props)&&(Le.setState({openKeys:[]}),Ue([])),ue.props.onClick(Qe)},ue.onKeyDown=function(Qe,At){ue.innerMenu.getWrappedInstance().onKeyDown(Qe,At)},ue.onOpenChange=function(Qe){var At=Object(G.a)(ue),vt=At.props,Le=ue.store.getState().openKeys.concat(),Ue=!1,$e=function(St){var it=!1;if(St.open)it=Le.indexOf(St.key)===-1,it&&Le.push(St.key);else{var It=Le.indexOf(St.key);it=It!==-1,it&&Le.splice(It,1)}Ue=Ue||it};Array.isArray(Qe)?Qe.forEach($e):$e(Qe),Ue&&("openKeys"in ue.props||ue.store.setState({openKeys:Le}),vt.onOpenChange(Le))},ue.onDeselect=function(Qe){var At=Object(G.a)(ue),vt=At.props;if(vt.selectable){var Le=ue.store.getState().selectedKeys.concat(),Ue=Qe.key,$e=Le.indexOf(Ue);$e!==-1&&Le.splice($e,1),"selectedKeys"in vt||ue.store.setState({selectedKeys:Le}),vt.onDeselect(Object(Z.a)(Object(Z.a)({},Qe),{},{selectedKeys:Le}))}},ue.onMouseEnter=function(Qe){ue.restoreModeVerticalFromInline();var At=ue.props.onMouseEnter;At&&At(Qe)},ue.onTransitionEnd=function(Qe){var At=Qe.propertyName==="width"&&Qe.target===Qe.currentTarget,vt=Qe.target.className,Le=Object.prototype.toString.call(vt)==="[object SVGAnimatedString]"?vt.animVal:vt,Ue=Qe.propertyName==="font-size"&&Le.indexOf("anticon")>=0;(At||Ue)&&ue.restoreModeVerticalFromInline()},ue.setInnerMenu=function(Qe){ue.innerMenu=Qe},ue.isRootMenu=!0;var Ce=Xe.defaultSelectedKeys,rt=Xe.defaultOpenKeys;return"selectedKeys"in Xe&&(Ce=Xe.selectedKeys||[]),"openKeys"in Xe&&(rt=Xe.openKeys||[]),ue.store=Object(F.c)({selectedKeys:Ce,openKeys:rt,activeKey:{"0-menu-":Ze(Xe,Xe.activeKey)}}),ue.state={switchingModeFromInline:!1},ue}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ue){this.updateOpentKeysWhenSwitchMode(ue),this.updateMiniStore();var Ce=this.props,rt=Ce.siderCollapsed,Qe=Ce.inlineCollapsed,At=Ce.onOpenChange;(!ue.inlineCollapsed&&Qe||!ue.siderCollapsed&&rt)&&At([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ue){var Ce=this.props,rt=this.store,Qe=this.inlineOpenKeys,At=rt.getState(),vt={};ue.mode==="inline"&&Ce.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ce||((Ce.inlineCollapsed&&!ue.inlineCollapsed||Ce.siderCollapsed&&!ue.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=At.openKeys.concat(),vt.openKeys=[]),(!Ce.inlineCollapsed&&ue.inlineCollapsed||!Ce.siderCollapsed&&ue.siderCollapsed)&&(vt.openKeys=Qe,this.inlineOpenKeys=[])),Object.keys(vt).length&&rt.setState(vt)}},{key:"updateMenuDisplay",value:function(){var ue=this.props.collapsedWidth,Ce=this.store,rt=this.prevOpenKeys,Qe=this.getInlineCollapsed()&&(ue===0||ue==="0"||ue==="0px");Qe?(this.prevOpenKeys=Ce.getState().openKeys.concat(),this.store.setState({openKeys:[]})):rt&&(this.store.setState({openKeys:rt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ue=this.props.mode,Ce=this.state.switchingModeFromInline,rt=this.getInlineCollapsed();return Ce&&rt?"inline":rt?"vertical":ue}},{key:"getInlineCollapsed",value:function(){var ue=this.props,Ce=ue.inlineCollapsed,rt=ue.siderCollapsed;return rt!==void 0?rt:Ce}},{key:"restoreModeVerticalFromInline",value:function(){var ue=this.state.switchingModeFromInline;ue&&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 ue=Object(Z.a)({},Object(O.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ce=this.getRealMenuMode();return ue.className+=" ".concat(ue.prefixCls,"-root"),ue.direction==="rtl"&&(ue.className+=" ".concat(ue.prefixCls,"-rtl")),ue=Object(Z.a)(Object(Z.a)({},ue),{},{mode:Ce,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ve(this.props,this.state,Ce)}),delete ue.openAnimation,delete ue.openTransitionName,W.createElement(F.a,{store:this.store},W.createElement(Te,Object.assign({},ue,{ref:this.setInnerMenu}),this.props.children))}}]),nt}(W.Component);re.defaultProps={selectable:!0,onClick:H,onSelect:H,onOpenChange:H,onDeselect:H,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:W.createElement("span",null,"\xB7\xB7\xB7")};var ae=re,ce=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(){var Xe;return Object(z.a)(this,nt),Xe=et.apply(this,arguments),Xe.onKeyDown=function(ue){var Ce=ue.keyCode;return Ce===p.a.ENTER?(Xe.onClick(ue),!0):void 0},Xe.onMouseLeave=function(ue){var Ce=Xe.props,rt=Ce.eventKey,Qe=Ce.onItemHover,At=Ce.onMouseLeave;Qe({key:rt,hover:!1}),At({key:rt,domEvent:ue})},Xe.onMouseEnter=function(ue){var Ce=Xe.props,rt=Ce.eventKey,Qe=Ce.onItemHover,At=Ce.onMouseEnter;Qe({key:rt,hover:!0}),At({key:rt,domEvent:ue})},Xe.onClick=function(ue){var Ce=Xe.props,rt=Ce.eventKey,Qe=Ce.multiple,At=Ce.onClick,vt=Ce.onSelect,Le=Ce.onDeselect,Ue=Ce.isSelected,$e={key:rt,keyPath:[rt],item:Object(G.a)(Xe),domEvent:ue};At($e),Qe?Ue?Le($e):vt($e):Ue||vt($e)},Xe.saveNode=function(ue){Xe.node=ue},Xe}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ue=this.props;ue.onDestroy&&ue.onDestroy(ue.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 ue,Ce=Object(Z.a)({},this.props),rt=a()(this.getPrefixCls(),Ce.className,(ue={},Object(c.a)(ue,this.getActiveClassName(),!Ce.disabled&&Ce.active),Object(c.a)(ue,this.getSelectedClassName(),Ce.isSelected),Object(c.a)(ue,this.getDisabledClassName(),Ce.disabled),ue)),Qe=Object(Z.a)(Object(Z.a)({},Ce.attribute),{},{title:typeof Ce.title=="string"?Ce.title:void 0,className:rt,role:Ce.role||"menuitem","aria-disabled":Ce.disabled});Ce.role==="option"?Qe=Object(Z.a)(Object(Z.a)({},Qe),{},{role:"option","aria-selected":Ce.isSelected}):(Ce.role===null||Ce.role==="none")&&(Qe.role="none");var At={onClick:Ce.disabled?null:this.onClick,onMouseLeave:Ce.disabled?null:this.onMouseLeave,onMouseEnter:Ce.disabled?null:this.onMouseEnter},vt=Object(Z.a)({},Ce.style);Ce.mode==="inline"&&(Ce.direction==="rtl"?vt.paddingRight=Ce.inlineIndent*Ce.level:vt.paddingLeft=Ce.inlineIndent*Ce.level),ze.forEach(function(Ue){return delete Ce[Ue]}),delete Ce.direction;var Le=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Le=W.createElement(this.props.itemIcon,this.props)),W.createElement("li",Object.assign({},Object(O.default)(Ce,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Qe,At,{style:vt,ref:this.saveNode}),Ce.children,Le)}}]),nt}(W.Component);ce.isMenuItem=!0,ce.defaultProps={onSelect:H,onMouseEnter:H,onMouseLeave:H,manualRef:H};var ye=Object(F.b)(function(gt,et){var nt=gt.activeKey,Xe=gt.selectedKeys,ue=et.eventKey,Ce=et.subMenuKey;return{active:nt[Ce]===ue,isSelected:Xe.indexOf(ue)!==-1}})(ce),Fe=ye,Pe=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(){var Xe;return Object(z.a)(this,nt),Xe=et.apply(this,arguments),Xe.renderInnerMenuItem=function(ue){var Ce=Xe.props,rt=Ce.renderMenuItem,Qe=Ce.index;return rt(ue,Qe,Xe.props.subMenuKey)},Xe}return Object(I.a)(nt,[{key:"render",value:function(){var ue=Object(b.a)({},this.props),Ce=ue.className,rt=Ce===void 0?"":Ce,Qe=ue.rootPrefixCls,At="".concat(Qe,"-item-group-title"),vt="".concat(Qe,"-item-group-list"),Le=ue.title,Ue=ue.children;return ze.forEach(function($e){return delete ue[$e]}),delete ue.onClick,delete ue.direction,W.createElement("li",Object.assign({},ue,{className:"".concat(rt," ").concat(Qe,"-item-group")}),W.createElement("div",{className:At,title:typeof Le=="string"?Le:void 0},Le),W.createElement("ul",{className:vt},W.Children.map(Ue,this.renderInnerMenuItem)))}}]),nt}(W.Component);Pe.isMenuItemGroup=!0,Pe.defaultProps={disabled:!0};var ut=Pe,Et=function(et){var nt=et.className,Xe=et.rootPrefixCls,ue=et.style;return W.createElement("li",{className:"".concat(nt," ").concat(Xe,"-item-divider"),style:ue})};Et.defaultProps={disabled:!0,className:"",style:{}};var _t=Et,Ct=de.e=ae},"24hK":function(Ge,de,N){"use strict";N.d(de,"a",function(){return I});var Z=N("JYp7"),z=function(){function G(j){this.element=j,this.next=G.Undefined,this.prev=G.Undefined}return G.Undefined=new G(void 0),G}(),I=function(){function G(){this._first=z.Undefined,this._last=z.Undefined,this._size=0}return Object.defineProperty(G.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),G.prototype.isEmpty=function(){return this._first===z.Undefined},G.prototype.clear=function(){this._first=z.Undefined,this._last=z.Undefined,this._size=0},G.prototype.unshift=function(j){return this._insert(j,!1)},G.prototype.push=function(j){return this._insert(j,!0)},G.prototype._insert=function(j,w){var W=this,F=new z(j);if(this._first===z.Undefined)this._first=F,this._last=F;else if(w){var O=this._last;this._last=F,F.prev=O,O.next=F}else{var b=this._first;this._first=F,F.next=b,b.prev=F}this._size+=1;var c=!1;return function(){c||(c=!0,W._remove(F))}},G.prototype.shift=function(){if(this._first===z.Undefined)return;var j=this._first.element;return this._remove(this._first),j},G.prototype.pop=function(){if(this._last===z.Undefined)return;var j=this._last.element;return this._remove(this._last),j},G.prototype._remove=function(j){if(j.prev!==z.Undefined&&j.next!==z.Undefined){var w=j.prev;w.next=j.next,j.next.prev=w}else j.prev===z.Undefined&&j.next===z.Undefined?(this._first=z.Undefined,this._last=z.Undefined):j.next===z.Undefined?(this._last=this._last.prev,this._last.next=z.Undefined):j.prev===z.Undefined&&(this._first=this._first.next,this._first.prev=z.Undefined);this._size-=1},G.prototype.iterator=function(){var j,w=this._first;return{next:function(){return w===z.Undefined?Z.c:(j?j.value=w.element:j={done:!1,value:w.element},w=w.next,j)}}},G.prototype.toArray=function(){for(var j=[],w=this._first;w!==z.Undefined;w=w.next)j.push(w.element);return j},G}()},"4qgm":function(Ge,de){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1PTckKNereENM1L6rFmaAc/PzRD3L6E9jlUabN+Swj2tfFB6o8Q7h0e/GQMPDcy9djBS7DjPJzthOJ+0lSPvzguyxonyz96E9mjwIpGHeGZ+lFYiEXMpP+ozQhcPgZmj7z95MUE1H8Ef7gIhnCszyXOPWqa5lWUDVcvsu3Mk5KrXsodEhUtOtNT6qwYj0allj2dXAIzvx+5CtvOwT9vQpEFVtTVMzuK8QJT1yY55HssbZ0sLd3N3LF+k47pZ70YcZS5WNj5UAsr0PS74cG+C/DLNrjppYTm0wKaSW7gUxvz2HL0q/Jpxs4tgeVN+rRvUWPF+Hx/qEURmOl7uh1ePweN11Iua+XjtsYLUjSP+BZLW0vlmLEvk07paK+LNWoxWwQxBXKhWm8u2n2MpA+/+S/suQDXvfxc1ti0ioIC/ybK5o5BbJbSJj1pD+HLXnu0DBlmEaIIzNjbfi6VhErydNeAmgX2MPCu8ZxMaNJptlBjSi6zv+VbKOcSHFVgwxXY/CFc6AI7Hzc14kzBni7xPJtFgZnxp/S+WJLFAsvEYWiko04vKMMKbOtK7Y9/+h/4mmchkFWkWz6VxyvkzYBm9vzKjmsFFnX9PfZkbPYl0BSVBy7CzvNwvqsfm3/WMct1WXUy65h1lyNMb9CS9iEsUouVls3w/tDsTeCZDjDxduhqKqHk5ZJpaprgQ/VZleug3KOnl/1dJ6QvjL4Z5uohbAx2+fBWG/ziY7icTFHLp4W96ug1lM3l0eCxvIhQicWIqBu/IbhyLDz7cErCiRup6qX5ej/2u4iXVaFyVdlxfUyFN0UojbJPGlozH4B5o+DAJfh1GxjR+VYs2deNFrx2vELa+qIfSqAxUtqkW61iXvY7+zJ55+/mFGHcsN0FJ8+a89Y1RoL3xWVF85TwF8ahBZY16RtSzEtRBRq5RmTogbqtn6GGh+vDThHiLWVyadYstffvl/Q1cu8LHnrc/giMxjzdOxNrCU6rsry1Qv5sflkQ1x8qjN5VJWvD2C2cQGMpwmG4t8lJUUAtobDds1l3coJcnVulox2LdU4xzyc62berWmbfG4GSKo80SVKK0gfjfIWaGDXFcoJW32dZ6yR5x4hYuEafUaixbcYaX3cT7NlVLfMGXGAmq4nPHlz2YvMjbJ41k4iSbYOSylBz6VThZ+2dbPzga3Jj4Todhcd6FZ4XAd8DJwZucqAF3q4gPgCWZ78GK2/S76nFBonxSKhzZfoc5ydpxGNpy2Q5HFCr0mew2WjZPOJmXZcMuMDgFZiPi1Dv3SRuXmTOqdWhRV28ZHkc3hGXw+VN+rAK67GYjWD1VCAYd/Q9borHZrWpaymTjoWv6igtZh0E59OAWnYbMIGljbrDGc4L3g3eRQNqB83A89bo4zb81HYodV06VKkb+S4b4/slMbFRn7JsaiTGF7JpZu5S/ARH8FjSMkUaja35cZ1lCTUBNXPwzhHLRmAywd7dcZlb2Bhs1C3EGNTlsOr0eLkyZ7kOdYawyoJXRCj2PDArbjvguRxVl1d2rZXGCa36oO2zBmWexLCD+ExwHai91M6WszOkc06Vfi5msc4QNzmrO7VsIbEiSCTYubtaXiiowNJmfcBssumVniGw2XaY6Jl3gN1W2oj0fTrUY9PIf7HB0Cxv0ifUZhF+SlxzuZy4i1ofV5NOyu5ltXiqvlL+VlCBGWNzV+vX7RgHnRj3JXPeRKZ6ZtP0fBbviacugTItoOakY60PasalLTuIx3dIsrh+rZwKIy6YR9iOmX7z6zUmbTwhQq1l82gugtk20zRvqrKJDrZeKaX9/vd42oIay7kzQ+aaS/C8x3WEtZc9tu2PS6TXPZEFZibx4w36YMKl2lRPIti9xY2haQh4LmcQbqBMSBPpcX2zPKDB91m8Oy4no8LIi2D3QRZW6Uxs6sLQtMzhNkfq724zTf2aKutH+rwej0gt217eBLONLKzWh8z/wWgImr1RCKgZ0h4N4rJk59pUIupPK4jAzAQWxPU7QJ3t8MW+YjMXNfW55ivriy+xbfv23C9ToootqEAzeEDTplqV+X3FZibbWqlE0iCwZOdr/adWcBfNtarzqvS7tkWt1QtNE2uGGrAhNpzXty8qDLV7IjBDUy3ioszHwspk2lux5tOgHkt3xaU1quuF7V9wF+2Rpk0dwjhTXypcQ9lYdD9bB4LaPSPYPdOqsAcYh8336yulOSyF/vT7P83Gv9qVBJysAAAAAElFTkSuQmCC"},"4u4S":function(Ge,de){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAASm0lEQVR4Xu2dd5QUVRbGfz3kJDkKCJJBAVFWRUUkGFBQEFRWFhUWmBlAoqCoMGKAVcC8CLKLBEEkKCZMgKjkqIIIKCKiMCAsUfLUntuvi+7pqeqq7q7pcbrrncMfTL10v/f1q/vuu/eWR0vmBaA/bnERiGMEPFoaSaTzLhrt4lhOV7QER8Aj8mtDKMJxlqJxeYLj4Yofpwh4ie4l+wAqcopVaFSJU1ldsRIYgfNE95K9L5dyjq/RuCCBMXFFj0MEMhHdS/ZUbkTjQzTyxqG8rkgJikAWonvJnkIvNCYmKCau2HGIgCHRfWQfg8awOJTZFSkBETAnuoaHFN4GOiUgLq7IcYaAKdG9u3oaBUlnCRpXxZncrjgJhkBIonvJ3o+ynGUlGhcnGDauuHGEgCXRfWbHupxjORol40h2V5QEQsAW0X1kb8FZPgHyJxA+rqhxgoBtovts7N3IYGqcyO6KkUAIhEV0H9nTyGBkAmHkihoHCIRNdJ+NfToaXeNAfleEBEEgMqKnkZ+9fAY0TxCcXDFzOQIREd27qw+kFCdZgUbtXI6BO/0EQCBiovts7DU4w0qgTAJg5YqYixGIiui+w2kzMlgEFMzFODg/9dLVISkPHN0PJw+b91+gGGSchTMnnJ9DcI9FSsNFTeHgL5C+DbRzmWt48mT9m5OzkvFLXAgHdsLJI072bNlX1ET3kf1uMpgFONKf5axzQ4Uxe6B4BXi7Pyx5yXzGveZBo9th21J4sVX0kpW6CA79DhlnsvZ1xT3QYxZoGgwsDqeO+utUuhRSFsCcgfDtgujnYdRDp/HQaqCa3/Cq2fujChrfMWJqyTwMjM4ehCx6HbgESla1P/TLN8P+7ap+gaLw6Df22r4zFDbMs1fXDtGrXw1Dl6v+5g2Bz8fZ69usVlI+GPsH5C8Mb3SDtbL3BJQOz8KND8HerfBE3czP+nwIl7RVP4J3H4FP/xXdXIJb5ysEo3+DIiXh49GwYLiz/Vv05hjRvTt7CpPR6BFTCWSwUT9B2TBccUZdAns2q2kWvACeD6FaBAoz9QFY+YY98ayIXrgUPLwaytZQ/f260Vp9WfwirJttPn6t62HQF+r5o9Xh4M7MdfsvgrotYfVMmHJv5mf5CkP3N6HxHervy6fAjH+ClmFPXqtaV90P901RtUbU9m80Vu0ceu4s0dPISzoL0Wjt0PzsdaMT/dNnYcN84zYeDwxdoZ6ZEX3BY/D7pqztH5gBBYuCEdFLVgHRbYNJFYroeQtCv4VQu4U9+fRaolYsluwkJuWOMXDTMNizBUbVz1pp7EG1o84dDIvGZ33uSQJRL1r6sp+smArTuztD9mGroNrfYPtXMD72VmlHiS7IacMozhGWodEgvFWMorZO9Jkp8NVrJkRPgn/7Dl9mRB/fArYvNSDIAShSKivRWw+BDv+CrYvhpTaZ25kR/YIKkPwuVL9S1V/4NOz+1lx4qdd6kHo+/gbY7tuxjVo8uhEqN4LPxsH8IZlryOH4qR2+fkzk1FvcOhJuS1P/+3oyvNlLVtZ4jqI21rjWevHy+CIzRTXKCDoEW7f21xhWEY7/EU4Lb13Hie4lex8uIsPr2lsh7BlF0iCniC67+Yjv1W7/SlvYvNA/eyOiN7gF7p0EJStDRgbMTIZlr5tLfEFFeGQtlKgEa96C/3Yxr1u8Eoz5TT1/oZX68QWWy+6EXnOVDj6ohLXVo/OL0PJB9XZ4rhmcOGQ89qAvodZ1kaxaZG2GlP3rEN1L9r5cwVlkeywcmURhtMopossUWw2CTuPg983wVCO/JSGQ6GtnQ9fJ0PA2JdSp4zC9B2z7Apo9oHbgYCtJ3gIgu+XFV8PJozCyDhzZYw5Ks+7wj/+ouoNLZ+2v/dNwy3BlVkyrYwNcD7R/Epa8DEfTzetXuQwKlTB/ftV9cPV96vmMXrD/Rxtjh6jy49fGFiWLXrNlR9fH1PpwOxnMRyMpOuksWutEF/1PP2QGNxEd/bre6q9OqS7Sl+jnw9dD5YZqIfUdOpDoSyfAgM+hVnPYtBBmpSj7+uPfqUO0EH5SJzh+QM2vfF11MKzaRL3mp3WHVdNCg9BzDjTpBAd/hdVvZq0rh8wKdWH/T7BuTmTL8et6WB9G28qN1bkoX0H48jUldw6VbCW6yKSlMACN57NVPqesLuHq6LpQjTpA8nw4vBdG1oJTxyBYdSlaFmrfAOslDNdXqjRR+nqpKrB/B0xoD2I5uXMs5C8EJ4/Bf+6BTR+Ghi8pLzy3HwqH2FmdWICV02Cqb3e26k+sWaJ2laulZHuqIZw+7m8lF2W9fabaN+4L/bayGsvG82wnuo/sr6DRx8Z8IquiE/3b92HnauM+ZEdvN8r5Hd3bo0ftzpUawIej4IORWYluJlmxctBzrtJzZfeW21Qp/9sNr94Gv9mw8ctBU9QnsyLPqzRW+vk370aGsbSSN0+oy6/Anv85Gy6/S51Fnm8BP36VeVwxr47zvcEerwF/+A7Kkc8uZMvYEP1t8rCEBWjcmi1y5KSOrgvU9O9K3fh5FTx3DYzebX0zWqE+NO2i/un29DOn4OtJyhoTSjcOB0iddDtWqINldpfmqdDlVTWKkQVI/h6PRPfu6qkUReNLNC5zHOe/AtFFVxdT4A7fTaeR1aVIGWU7r3MD1GmpdGa9CMGXTVa3hod91hMngCpcUr1d8hWAOYNgcfZqkV5fmsFfqfHEYvNMEzh7Mqsk8Up0L9n7UomzrAIqO7GG5/v4KxA9WCAjot/9MrTom7nmrvUgKpeQ/NBu/zOx5jRPgd0b4fXOkcMlfXT5t1JbxL8kcIzIezVuKT/e3u9AIV/qziPpcHSfcV05V1Ssp56JJejsqdCzmXA7HPg54hnHRHUJnJ3Wj0acQRS2YhHPOrihTvR3HoaVJiGtcuun25mdtLqYCWG4o5dWurxO7u8+MN+9dXOgqELPRpFWR7+RPH0CNn0UHuTiYSg3o3aKqG7dpkDe/OpHJWciJ8sT9WHvloh7dHg29uahpdKODN6zV9tGrZy2uhhN0exmVH5wdvxHnCB6xQYwwsClwQak3irH/oCHylrXbjMUOoxR5D5xGOYOUjZ9KVPvhxMGLrkFi8H9vk1pVqqyWAUXsTzJuUdKWj1I/8F6LiY1coboyYijxcCIZ222o9vtMLt3dCHzs+lQtIzfTff6vnBRGN9ZENOj2OaFbLLz60V2eDM3h2D5u89UB129rJ8LPy2zRkns8TWuUW+e0SHmLHLe9aJfHRNLkdwQy6XV0z41w+wm046OLp6lL/hciXMb0bUUuqIx3RrtMGroO/rbA2C5bycJ1fz0n/5dNdB7MVI7euBYYh8Wgum3oLo/eu/50LhDGEKZVJVbVrGtW5ULG4L4vsguK/7f4kYgRHzyUvPrfOmz+IWQ9oNya5jUGTbMNR9J9y+XGr99p0guZ4BS1RKb6FoKl6PxtePRSHYOo2bL5STRZYFT34cLL/GPphP9mp7Klm23VLtSvQGO7MtMtl3rYPl/rXtJeQ8atoPDe+CZy5Xfe+lqxi66gb31eAuuuFu5NMiPwsyZS9qIeVRcjeUtM7GjP5IqkYmuJVMOD2uz5dMxVkQXX4zrU+GTMVn1Y6eILh58smsXKwt/HgLxVREd0yzCyCpsLRodPTCgQwIwVk2Huq2hvyRuQLkUrPD5hgeS/NLb1A9VyuR7Qvu+6+1kLPnxnTvt7ylRia5NJB8bWYRG9ri5hSK66JEjNiubtRx6vpyQeTeMluhCWHGWajsCxBX1wC/wyi0wYLHxhVH+IuqGtt6NMO46czUiUqKL2e6hZcr3+6flMFZcaH0utve+DtdKMIWmfNIDbeoN2qorefFL2fwxvHqrvUOz0bslYYmewgQ0kq3ftxHWsNrRW/SDu19SO6147gXadqMhetmacP90uNhn/pPDmxDkyF5zFwAh+tCVSr3ZugReusnYGy9Sord7Eto+pq7exzQFccTSi4TadZ+hrualLHoB5g2Ghu1Bbk/FNLhjpXLzPfNnhItBYuroWio9yWBS5KjZaGlFdNl1H14DVS+DYMckK6JLiNm4g+qmT5yPAr0Iu0yA5r7fr4SnSYCC7rgUKsKoTA01H4n2kZA1I1t1JESveR0M/AKSkuCricrfPbjIG+7vE9XOLkU8PsUVWN5GopePaw5/HrQBeogqibaja6lIKowl2Z6B14rosiZNOkNPn+egLKbuZGREdLlN1O3d9W+GRu3VqqbVhfSt/hUuWwuGr4M5Yu0JOiBaxYzWvwn6fKRIKbbm4IuucIku55DHvoFSVeH4/5QXpe72a8TJwB+pPJc2cvh0wv3AKaIHBpP8Vc2L3uv+c6yLSZSRGdELFlc+2ld2Ve6v+m2dV3e9Ri2/EdEf/AzqBYW9eq0QAdYUnTzifWh0zW1FdGnfcSy0GawCMcQnZN82PyXDIbocfMXKUv9GpX9P6QprZhpvuXnyw/V9oO3j6o0SWHaugfdHwPcf58yOLq7Mkvfl7Gl1kJd5SmCKXEI9VC7zgTfMGWbLhZHWjwKc4Uvgb2HOJ7LqT+6AMtVBYkY3zlc6Z6M7lKVBVA697PkeRK8WXfSVW2HzR8ZEl2idayVO0hcN9N37IPbrUBE+wTO3Q3Qh6CPr4OAumPZAZm9Fu0QX4kpuGN1u/1Y/WPqKMY6NO6oY13I11XPxdxdLVKVLlEnx/EawTBE+OBzP7upEuqOL6jVYaBNUJEh72v12Rzeslz1ET0ZsV9HNzK5YNZurFA+ySGIzLlZeqQN6kZvFNbOUbr5rLeivbO+t3xUgV9F6uguzCyO7cwmsZ4foUt/sjdDxOWgzRNmozXxdxMIi6ph+ESX5WIS4gUXyqUjiInEmk4glvcgPVywvuqoidnvxaZcbUb3s2qAipuT8ESrbWDA+kRJdDstP71R5aaRIRjGJhhJT6OHfI1mF820cJ7qWzIPAi1HNKpzGElcZnDbi2AHY8qnahcWRKTAes0RlGPWjOnDJRYocHnOS6CKrvLJFffGmpdOU1eLBT6B8bZW+Y9KdxoiISbPdE+qZ+K+/95i/XpmLlfejvJ0kg4Fe5K02u5/5bi1B1Lc/o8bWiziESQideFgGB1AYzUwIq/vX79tunJHLjgtAODywqOso0bW+tOAcn8X0q9PNeqjI+l/WKPuv6JcSZRTKcUoCduUHcGy/seriBMB2d3QZS4I0RDcV/frMSaWf6iXUNXz5OvD4Jlj6qjoQ60VUoqd+huIV/X+ToOLPx6t0c5ZOZR5ocLPSkSVzgf6GFBVLgrSN/MvDxSy3Et2b4uIca2OeWVdezfKqC2VhCLUIVubFcBdQrx8O0SWUrknQrr3vRxX29t7joYklFz3eNBtBeVfE5UD80MWRS5IVyUYQSQl8M8gt7+oZkfSStU1uJLqWRmHSvUmLwnDmcAav6Hvx+Hc+0ecDr7Kj6bxcbRAdWi6PrOzS8mMTTz29SOxotGF0Yh4V85xTgRayocjbJpTvSzh4yd2G7vsj2dGsAi/C6dugriOqi5bCLDRsuNRFOVu3uYtAhAhETXQtlaFk4HDq1QilcZu5CJggEBXRtWRuwsNH2Z6gyF0+F4EoEYiY6FoqNdFY7X5NOsoVcJvHBIGIiO5LXSFJRGOXMTcmcLiDxCsCYRNd0/CQ6s2n6MsYH6/QuHLFEwLhEz3Z+9VoX/LseILClSWeEQiL6N7suOd4J7vyqscz0K5sOYuAbaJrqdQjw5tly7nEQzkruzt6AiFgi+jaAEpwEklTWyuBsHFFjSMELImupZFEOh+gcUscye2KkmAIWBM9ldFkeL8h6hYXgVyLQEiia324i3OE+LBlrpXbnXiCIWBKdF/WW0n2nf0f20ow0F1xY4+AIdG1PpT2+ZZXi/2U3BFdBJxHIAvRNfX150/QaOn8cG6PLgI5g0BWoicj3+D2fSM7Zybljuoi4DQCmYiupdKNDEw+GeH00G5/LgKxQ+A80bVUmpLhzcVSMHbDuyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(Ge,de,N){"use strict";N.d(de,"a",function(){return o}),N.d(de,"b",function(){return R});var Z=N("Ty5D"),z=N("dI71"),I=N("q1tI"),G=N.n(I),j=N("YS25"),w=N("17x9"),W=N.n(w),F=N("wx14"),O=N("zLVn"),b=N("9R94"),c=function(h){Object(z.a)(s,h);function s(){for(var D,T=arguments.length,C=new Array(T),M=0;M=0||T.relatedTarget.className.indexOf("".concat(U,"-next"))>=0))return;h.setState({goInputText:""}),k(h.getValidValue())},h.go=function(T){var C=h.state.goInputText;if(C==="")return;(T.keyCode===v.ENTER||T.type==="click")&&(h.setState({goInputText:""}),h.props.quickGo(h.getValidValue()))},h}return Object(j.a)(g,[{key:"getValidValue",value:function(){var s=this.state,l=s.goInputText,D=s.current;return!l||isNaN(l)?D:Number(l)}},{key:"getPageSizeOptions",value:function(){var s=this.props,l=s.pageSize,D=s.pageSizeOptions;return D.some(function(T){return T.toString()===l.toString()})?D:D.concat([l.toString()]).sort(function(T,C){var M=isNaN(Number(T))?0:Number(T),k=isNaN(Number(C))?0:Number(C);return M-k})}},{key:"render",value:function(){var s=this,l=this.props,D=l.pageSize,T=l.locale,C=l.rootPrefixCls,M=l.changeSize,k=l.quickGo,U=l.goButton,P=l.selectComponentClass,K=l.buildOptionText,H=l.selectPrefixCls,$=l.disabled,le=this.state.goInputText,pe="".concat(C,"-options"),xe=P,ze=null,Ne=null,Ie=null;if(!M&&!k)return null;var Be=this.getPageSizeOptions();if(M&&xe){var ke=Be.map(function(ge,he){return O.a.createElement(xe.Option,{key:he,value:ge.toString()},(K||s.buildOptionText)(ge))});ze=O.a.createElement(xe,{disabled:$,prefixCls:H,showSearch:!1,className:"".concat(pe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(D||Be[0]).toString(),onChange:this.changeSize,getPopupContainer:function(he){return he.parentNode}},ke)}return k&&(U&&(Ie=typeof U=="boolean"?O.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:$,className:"".concat(pe,"-quick-jumper-button")},T.jump_to_confirm):O.a.createElement("span",{onClick:this.go,onKeyUp:this.go},U)),Ne=O.a.createElement("div",{className:"".concat(pe,"-quick-jumper")},T.jump_to,O.a.createElement("input",{disabled:$,type:"text",value:le,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),T.page,Ie)),O.a.createElement("li",{className:"".concat(pe)},ze,Ne)}}]),g}(O.a.Component);f.defaultProps={pageSizeOptions:["10","20","50","100"]};var m=f,a=N("N2Kk");function n(){}function o(_){return typeof _=="number"&&isFinite(_)&&Math.floor(_)===_}function u(_,R,g){return g}function A(_,R,g){var h=typeof _=="undefined"?R.pageSize:_;return Math.floor((g.total-1)/h)+1}var x=function(_){Object(w.a)(g,_);var R=Object(W.a)(g);function g(h){var s;Object(G.a)(this,g),s=R.call(this,h),s.getJumpPrevPage=function(){return Math.max(1,s.state.current-(s.props.showLessItems?3:5))},s.getJumpNextPage=function(){return Math.min(A(void 0,s.state,s.props),s.state.current+(s.props.showLessItems?3:5))},s.getItemIcon=function(M,k){var U=s.props.prefixCls,P=M||O.a.createElement("button",{type:"button","aria-label":k,className:"".concat(U,"-item-link")});return typeof M=="function"&&(P=O.a.createElement(M,Object(I.a)({},s.props))),P},s.savePaginationNode=function(M){s.paginationNode=M},s.isValid=function(M){return o(M)&&M!==s.state.current},s.shouldDisplayQuickJumper=function(){var M=s.props,k=M.showQuickJumper,U=M.pageSize,P=M.total;return P<=U?!1:k},s.handleKeyDown=function(M){(M.keyCode===v.ARROW_UP||M.keyCode===v.ARROW_DOWN)&&M.preventDefault()},s.handleKeyUp=function(M){var k=s.getValidValue(M),U=s.state.currentInputValue;k!==U&&s.setState({currentInputValue:k}),M.keyCode===v.ENTER?s.handleChange(k):M.keyCode===v.ARROW_UP?s.handleChange(k-1):M.keyCode===v.ARROW_DOWN&&s.handleChange(k+1)},s.changePageSize=function(M){var k=s.state.current,U=A(M,s.state,s.props);k=k>U?U:k,U===0&&(k=s.state.current),typeof M=="number"&&("pageSize"in s.props||s.setState({pageSize:M}),"current"in s.props||s.setState({current:k,currentInputValue:k})),s.props.onShowSizeChange(k,M),"onChange"in s.props&&s.props.onChange&&s.props.onChange(k,M)},s.handleChange=function(M){var k=s.props.disabled,U=M;if(s.isValid(U)&&!k){var P=A(void 0,s.state,s.props);U>P?U=P:U<1&&(U=1),"current"in s.props||s.setState({current:U,currentInputValue:U});var K=s.state.pageSize;return s.props.onChange(U,K),U}return s.state.current},s.prev=function(){s.hasPrev()&&s.handleChange(s.state.current-1)},s.next=function(){s.hasNext()&&s.handleChange(s.state.current+1)},s.jumpPrev=function(){s.handleChange(s.getJumpPrevPage())},s.jumpNext=function(){s.handleChange(s.getJumpNextPage())},s.hasPrev=function(){return s.state.current>1},s.hasNext=function(){return s.state.current2?U-2:0),K=2;K=D?C=D:C=Number(l),C}},{key:"getShowSizeChanger",value:function(){var s=this.props,l=s.showSizeChanger,D=s.total,T=s.totalBoundaryShowSizeChanger;return typeof l!="undefined"?l:D>T}},{key:"renderPrev",value:function(s){var l=this.props,D=l.prevIcon,T=l.itemRender,C=T(s,"prev",this.getItemIcon(D,"prev page")),M=!this.hasPrev();return Object(F.isValidElement)(C)?Object(F.cloneElement)(C,{disabled:M}):C}},{key:"renderNext",value:function(s){var l=this.props,D=l.nextIcon,T=l.itemRender,C=T(s,"next",this.getItemIcon(D,"next page")),M=!this.hasNext();return Object(F.isValidElement)(C)?Object(F.cloneElement)(C,{disabled:M}):C}},{key:"render",value:function(){var s=this,l=this.props,D=l.prefixCls,T=l.className,C=l.style,M=l.disabled,k=l.hideOnSinglePage,U=l.total,P=l.locale,K=l.showQuickJumper,H=l.showLessItems,$=l.showTitle,le=l.showTotal,pe=l.simple,xe=l.itemRender,ze=l.showPrevNextJumpers,Ne=l.jumpPrevIcon,Ie=l.jumpNextIcon,Be=l.selectComponentClass,ke=l.selectPrefixCls,ge=l.pageSizeOptions,he=this.state,te=he.current,be=he.pageSize,se=he.currentInputValue;if(k===!0&&U<=be)return null;var Oe=A(void 0,this.state,this.props),ie=[],oe=null,Ae=null,_e=null,je=null,He=null,Ye=K&&K.goButton,qe=H?1:2,bt=te-1>0?te-1:0,yt=te+1=qe*2&&te!==1+2&&(ie[0]=Object(F.cloneElement)(ie[0],{className:"".concat(D,"-item-after-jump-prev")}),ie.unshift(oe)),Oe-te>=qe*2&&te!==Oe-2&&(ie[ie.length-1]=Object(F.cloneElement)(ie[ie.length-1],{className:"".concat(D,"-item-before-jump-next")}),ie.push(Ae)),Ze!==1&&ie.unshift(_e),lt!==Oe&&ie.push(je)}var Te=null;le&&(Te=O.a.createElement("li",{className:"".concat(D,"-total-text")},le(U,[U===0?0:(te-1)*be+1,te*be>U?U:te*be])));var me=!this.hasPrev()||!Oe,ve=!this.hasNext()||!Oe;return O.a.createElement("ul",Object(Z.a)({className:c()(D,T,Object(z.a)({},"".concat(D,"-disabled"),M)),style:C,unselectable:"unselectable",ref:this.savePaginationNode},ct),Te,O.a.createElement("li",{title:$?P.prev_page:null,onClick:this.prev,tabIndex:me?null:0,onKeyPress:this.runIfEnterPrev,className:c()("".concat(D,"-prev"),Object(z.a)({},"".concat(D,"-disabled"),me)),"aria-disabled":me},this.renderPrev(bt)),ie,O.a.createElement("li",{title:$?P.next_page:null,onClick:this.next,tabIndex:ve?null:0,onKeyPress:this.runIfEnterNext,className:c()("".concat(D,"-next"),Object(z.a)({},"".concat(D,"-disabled"),ve)),"aria-disabled":ve},this.renderNext(yt)),O.a.createElement(m,{disabled:M,locale:P,rootPrefixCls:D,selectComponentClass:Be,selectPrefixCls:ke,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:te,pageSize:be,pageSizeOptions:ge,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ye}))}}],[{key:"getDerivedStateFromProps",value:function(s,l){var D={};if("current"in s&&(D.current=s.current,s.current!==l.current&&(D.currentInputValue=D.current)),"pageSize"in s&&s.pageSize!==l.pageSize){var T=l.current,C=A(s.pageSize,l,s);T=T>C?C:T,"current"in s||(D.current=T,D.currentInputValue=T),D.pageSize=s.pageSize}return D}}]),g}(O.a.Component);x.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:a.a,style:{},itemRender:u,totalBoundaryShowSizeChanger:50};var y=x},"6RRn":function(Ge,de,N){"use strict";var Z=N("wCXF"),z=N("n6Qo");N.d(de,"b",function(){return z.a});var I=N("IBYe"),G=N("6eGT"),j=N("hW8S");N.d(de,"a",function(){return j.a}),de.c=Z.b},"6eGT":function(Ge,de,N){"use strict";function Z(z){return null}de.a=Z},"746U":function(Ge,de,N){"use strict";N.d(de,"d",function(){return z}),N.d(de,"j",function(){return I}),N.d(de,"i",function(){return G}),N.d(de,"h",function(){return j}),N.d(de,"e",function(){return w}),N.d(de,"k",function(){return W}),N.d(de,"l",function(){return F}),N.d(de,"a",function(){return O}),N.d(de,"f",function(){return c}),N.d(de,"g",function(){return p}),N.d(de,"m",function(){return S}),N.d(de,"c",function(){return m}),N.d(de,"b",function(){return a}),N.d(de,"n",function(){return n}),N.d(de,"o",function(){return o});var Z={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function z(u){return Array.isArray?Array.isArray(u):!!(u&&typeof u.length===Z.number&&u.constructor===Array)}function I(u){return typeof u===Z.string||u instanceof String}function G(u){return typeof u===Z.object&&u!==null&&!Array.isArray(u)&&!(u instanceof RegExp)&&!(u instanceof Date)}function j(u){return(typeof u===Z.number||u instanceof Number)&&!isNaN(u)}function w(u){return u===!0||u===!1}function W(u){return typeof u===Z.undefined}function F(u){return W(u)||u===null}function O(u,A){if(!u)throw new Error(A?"Unexpected type, expected '"+A+"'":"Unexpected type")}var b=Object.prototype.hasOwnProperty;function c(u){if(!G(u))return!1;for(var A in u)if(b.call(u,A))return!1;return!0}function p(u){return typeof u===Z.function}function S(u,A){for(var x=Math.min(u.length,A.length),y=0;y1&&arguments[1]!==void 0?arguments[1]:0,f=(W[S[v+0]]+W[S[v+1]]+W[S[v+2]]+W[S[v+3]]+"-"+W[S[v+4]]+W[S[v+5]]+"-"+W[S[v+6]]+W[S[v+7]]+"-"+W[S[v+8]]+W[S[v+9]]+"-"+W[S[v+10]]+W[S[v+11]]+W[S[v+12]]+W[S[v+13]]+W[S[v+14]]+W[S[v+15]]).toLowerCase();if(!w(f))throw TypeError("Stringified UUID is invalid");return f}var b=O;function c(S,v,f){S=S||{};var m=S.random||(S.rng||I)();if(m[6]=m[6]&15|64,m[8]=m[8]&63|128,v){f=f||0;for(var a=0;a<16;++a)v[f+a]=m[a];return v}return b(m)}var p=de.a=c},"7ZXX":function(Ge,de,N){Ge.exports=N.p+"static/err.6e7c5817.png"},"7ahc":function(Ge,de,N){"use strict";N.d(de,"a",function(){return A});var Z=N("k1fw"),z=N("0Owb"),I=N("+L6B"),G=N("2/Rp"),j=N("y8nQ"),w=N("Vl3Y"),W=N("tJVT"),F=N("OaEy"),O=N("2fM7"),b=N("q1tI"),c=N.n(b),p=N("VrN/"),S=N.n(p),v=N("p77/"),f=N.n(v),m=N("c5Ni"),a=N.n(m),n=O.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},u={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};de.b=function(x){var y=x.callback,_=x.onCancel,R=Object(b.useState)("python"),g=Object(W.a)(R,2),h=g[0],s=g[1];function l(T){s(u[T][1])}function D(T){y(T)}return c.a.createElement(w.a,Object(z.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:D}),c.a.createElement(w.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},c.a.createElement(O.a,{onChange:l},Object.keys(u).map(function(T){return c.a.createElement(n,{key:T,value:T},u[T][0])}))),c.a.createElement(w.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},c.a.createElement(A,{mode:h})),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(G.a,{type:"ghost",onClick:_},"\u53D6\u6D88")))};function A(x){var y=x.value,_=x.onChange,R=x.mode,g=x.options,h=g===void 0?{}:g,s=Object(b.useRef)(),l=Object(b.useState)(),D=Object(W.a)(l,2),T=D[0],C=D[1];return Object(b.useEffect)(function(){if(T){function M(k){var U=k.getValue();_&&_(U)}return T.on("change",M),function(){T.off("change",M)}}},[T,_]),Object(b.useEffect)(function(){T&&T.setOption("mode",R)},[T,R]),Object(b.useEffect)(function(){T&&((y!==T.getValue()||y==="")&&setTimeout(function(){T.setValue(y||" ")},300))},[T,y]),Object(b.useEffect)(function(){if(s.current&&!T){var M=S.a.fromTextArea(s.current,Object(Z.a)({mode:R,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},h));C(M)}},[s.current,T]),c.a.createElement("div",{className:"my-codemirror-container"},c.a.createElement("textarea",{ref:s}))}},"7ixt":function(Ge,de,N){"use strict";N.d(de,"a",function(){return I});var Z={adjustX:1,adjustY:1},z=[0,0],I={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:z},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:z},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:z},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:z},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:z},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:z},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:z},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:z},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:z},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:z},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:z},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:z}},G=I},"7v3h":function(Ge,de,N){Ge.exports=N.p+"static/empty2.dd73f390.png"},"8/bI":function(Ge,de,N){Ge.exports=N.p+"static/empty.8918e228.png"},"815F":function(Ge,de,N){"use strict";N.d(de,"e",function(){return W}),N.d(de,"c",function(){return O}),N.d(de,"d",function(){return b}),N.d(de,"a",function(){return p}),N.d(de,"f",function(){return S}),N.d(de,"b",function(){return v});var Z=N("KQm4"),z=N("VTBJ"),I=N("Ff2n"),G=N("Zm9Q"),j=N("Kwbf"),w=N("OZM5");function W(f,m){return f!=null?f:m}function F(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=new Map;function a(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(u){var A=u.key,x=u.children;Object(j.a)(A!=null,"Tree node must have a certain key: [".concat(o).concat(A,"]"));var y=String(A);Object(j.a)(!m.has(y)||A===null||A===void 0,"Same 'key' exist in the Tree: ".concat(y)),m.set(y,!0),a(x,"".concat(o).concat(y," > "))})}a(f)}function O(f){function m(a){var n=Object(G.a)(a);return n.map(function(o){if(!Object(w.i)(o))return Object(j.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var u=o.key,A=o.props,x=A.children,y=Object(I.a)(A,["children"]),_=Object(z.a)({key:u},y),R=m(x);return R.length&&(_.children=R),_}).filter(function(o){return o})}return m(f)}function b(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=new Set(m===!0?[]:m),n=[];function o(u){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(x,y){var _=Object(w.h)(A?A.pos:"0",y),R=W(x.key,_),g=Object(z.a)(Object(z.a)({},x),{},{parent:A,pos:_,children:null,data:x,isStart:[].concat(Object(Z.a)(A?A.isStart:[]),[y===0]),isEnd:[].concat(Object(Z.a)(A?A.isEnd:[]),[y===u.length-1])});return n.push(g),m===!0||a.has(R)?g.children=o(x.children||[],g):g.children=[],g})}return o(f),n}function c(f,m,a){var n;a?typeof a=="string"?n=function(A){return A[a]}:typeof a=="function"&&(n=function(A){return a(A)}):n=function(A,x){return W(A.key,x)};function o(u,A,x){var y=u?u.children:f,_=u?Object(w.h)(x.pos,A):"0";if(u){var R=n(u,_),g={node:u,index:A,pos:_,key:R,parentPos:x.node?x.pos:null,level:x.level+1};m(g)}y&&y.forEach(function(h,s){o(h,s,{node:u,pos:_,level:x?x.level+1:-1})})}o(null)}function p(f){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=m.initWrapper,n=m.processEntity,o=m.onProcessFinished,u=arguments.length>2?arguments[2]:void 0,A={},x={},y={posEntities:A,keyEntities:x};return a&&(y=a(y)||y),c(f,function(_){var R=_.node,g=_.index,h=_.pos,s=_.key,l=_.parentPos,D=_.level,T={node:R,index:g,key:s,pos:h,level:D},C=W(s,h);A[h]=T,x[C]=T,T.parent=A[l],T.parent&&(T.parent.children=T.parent.children||[],T.parent.children.push(T)),n&&n(T,y)},u),o&&o(y),y}function S(f,m){var a=m.expandedKeys,n=m.selectedKeys,o=m.loadedKeys,u=m.loadingKeys,A=m.checkedKeys,x=m.halfCheckedKeys,y=m.dragOverNodeKey,_=m.dropPosition,R=m.keyEntities,g=R[f],h={eventKey:f,expanded:a.indexOf(f)!==-1,selected:n.indexOf(f)!==-1,loaded:o.indexOf(f)!==-1,loading:u.indexOf(f)!==-1,checked:A.indexOf(f)!==-1,halfChecked:x.indexOf(f)!==-1,pos:String(g?g.pos:""),dragOver:y===f&&_===0,dragOverGapTop:y===f&&_===-1,dragOverGapBottom:y===f&&_===1};return h}function v(f){var m=f.data,a=f.expanded,n=f.selected,o=f.checked,u=f.loaded,A=f.loading,x=f.halfChecked,y=f.dragOver,_=f.dragOverGapTop,R=f.dragOverGapBottom,g=f.pos,h=f.active,s=Object(z.a)(Object(z.a)({},m),{},{expanded:a,selected:n,checked:o,loaded:u,loading:A,halfChecked:x,dragOver:y,dragOverGapTop:_,dragOverGapBottom:R,pos:g,active:h});return"props"in s||Object.defineProperty(s,"props",{get:function(){return Object(j.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),f}}),s}},"8EBN":function(Ge,de,N){(function(Z){Z(N("VrN/"))})(function(Z){"use strict";Z.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var z=0;z-1&&G.substring(W+1,G.length);if(F)return Z.findModeByExtension(F)},Z.findModeByName=function(G){G=G.toLowerCase();for(var j=0;j0&&S[S.length-1])&&(a[0]===6||a[0]===2)){b=0;continue}if(a[0]===3&&(!S||a[1]>S[0]&&a[1]")):null:l.match("--")?T(f("comment","-->")):l.match("DOCTYPE",!0,!0)?(l.eatWhile(/[\w\._\-]/),T(m(1))):null:l.eat("?")?(l.eatWhile(/[\w\._\-]/),D.tokenize=f("meta","?>"),"meta"):(b=l.eat("/")?"closeTag":"openTag",D.tokenize=S,"tag bracket");if(C=="&"){var M;return l.eat("#")?l.eat("x")?M=l.eatWhile(/[a-fA-F\d]/)&&l.eat(";"):M=l.eatWhile(/[\d]/)&&l.eat(";"):M=l.eatWhile(/[\w\.\-:]/)&&l.eat(";"),M?"atom":"error"}else return l.eatWhile(/[^&<]/),null}p.isInText=!0;function S(l,D){var T=l.next();if(T==">"||T=="/"&&l.eat(">"))return D.tokenize=p,b=T==">"?"endTag":"selfcloseTag","tag bracket";if(T=="=")return b="equals",null;if(T=="<"){D.tokenize=p,D.state=u,D.tagName=D.tagStart=null;var C=D.tokenize(l,D);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(T)?(D.tokenize=v(T),D.stringStartCol=l.column(),D.tokenize(l,D)):(l.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function v(l){var D=function(T,C){for(;!T.eol();)if(T.next()==l){C.tokenize=S;break}return"string"};return D.isInAttribute=!0,D}function f(l,D){return function(T,C){for(;!T.eol();){if(T.match(D)){C.tokenize=p;break}T.next()}return l}}function m(l){return function(D,T){for(var C;(C=D.next())!=null;){if(C=="<")return T.tokenize=m(l+1),T.tokenize(D,T);if(C==">")if(l==1){T.tokenize=p;break}else return T.tokenize=m(l-1),T.tokenize(D,T)}return"meta"}}function a(l,D,T){this.prev=l.context,this.tagName=D,this.indent=l.indented,this.startOfLine=T,(W.doNotIndent.hasOwnProperty(D)||l.context&&l.context.noIndent)&&(this.noIndent=!0)}function n(l){l.context&&(l.context=l.context.prev)}function o(l,D){for(var T;;){if(!l.context)return;if(T=l.context.tagName,!W.contextGrabbers.hasOwnProperty(T)||!W.contextGrabbers[T].hasOwnProperty(D))return;n(l)}}function u(l,D,T){return l=="openTag"?(T.tagStart=D.column(),A):l=="closeTag"?x:u}function A(l,D,T){return l=="word"?(T.tagName=D.current(),c="tag",R):W.allowMissingTagName&&l=="endTag"?(c="tag bracket",R(l,D,T)):(c="error",A)}function x(l,D,T){if(l=="word"){var C=D.current();return T.context&&T.context.tagName!=C&&W.implicitlyClosed.hasOwnProperty(T.context.tagName)&&n(T),T.context&&T.context.tagName==C||W.matchClosing===!1?(c="tag",y):(c="tag error",_)}else return W.allowMissingTagName&&l=="endTag"?(c="tag bracket",y(l,D,T)):(c="error",_)}function y(l,D,T){return l!="endTag"?(c="error",y):(n(T),u)}function _(l,D,T){return c="error",y(l,D,T)}function R(l,D,T){if(l=="word")return c="attribute",g;if(l=="endTag"||l=="selfcloseTag"){var C=T.tagName,M=T.tagStart;return T.tagName=T.tagStart=null,l=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(C)?o(T,C):(o(T,C),T.context=new a(T,C,M==T.indented)),u}return c="error",R}function g(l,D,T){return l=="equals"?h:(W.allowMissing||(c="error"),R(l,D,T))}function h(l,D,T){return l=="string"?s:l=="word"&&W.allowUnquoted?(c="string",R):(c="error",R(l,D,T))}function s(l,D,T){return l=="string"?s:R(l,D,T)}return{startState:function(l){var D={tokenize:p,state:u,indented:l||0,tagName:null,tagStart:null,context:null};return l!=null&&(D.baseIndent=l),D},token:function(l,D){if(!D.tagName&&l.sol()&&(D.indented=l.indentation()),l.eatSpace())return null;b=null;var T=D.tokenize(l,D);return(T||b)&&T!="comment"&&(c=null,D.state=D.state(b||T,l,D),c&&(T=c=="error"?T+" error":c)),T},indent:function(l,D,T){var C=l.context;if(l.tokenize.isInAttribute)return l.tagStart==l.indented?l.stringStartCol+1:l.indented+w;if(C&&C.noIndent)return Z.Pass;if(l.tokenize!=S&&l.tokenize!=p)return T?T.match(/^(\s*)/)[0].length:0;if(l.tagName)return W.multilineTagIndentPastTag!==!1?l.tagStart+l.tagName.length+2:l.tagStart+w*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/$/,blockCommentStart:"",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(l){l.state==h&&(l.state=R)},xmlCurrentTag:function(l){return l.tagName?{name:l.tagName,close:l.type=="closeTag"}:null},xmlCurrentContext:function(l){for(var D=[],T=l.context;T;T=T.prev)T.tagName&&D.push(T.tagName);return D.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Ge,de,N){"use strict";N.d(de,"d",function(){return bt}),N.d(de,"b",function(){return Fe}),N.d(de,"c",function(){return ut}),N.d(de,"a",function(){return _t});var Z=N("VTBJ"),z=N("1OyB"),I=N("vuIU"),G=N("JX7q"),j=N("Ji7U"),w=N("LK+K"),W=N("q1tI"),F=N("I8Z2"),O=N("BGR+"),b=N("wx14"),c=N("rePB"),p=N("4IlW"),S=N("2GS6"),v=N("Gytx"),f=N.n(v),m=N("TSYQ"),a=N.n(m),n=N("U8pU"),o=N("ODXe"),u=/iPhone/i,A=/iPod/i,x=/iPad/i,y=/\bAndroid(?:.+)Mobile\b/i,_=/Android/i,R=/\bAndroid(?:.+)SD4930UR\b/i,g=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,h=/Windows Phone/i,s=/\bWindows(?:.+)ARM\b/i,l=/BlackBerry/i,D=/BB10/i,T=/Opera Mini/i,C=/\b(CriOS|Chrome)(?:.+)Mobile/i,M=/Mobile(?:.+)Firefox\b/i;function k(gt,et){return gt.test(et)}function U(gt){var et=gt||(typeof navigator!="undefined"?navigator.userAgent:""),nt=et.split("[FBAN");if(typeof nt[1]!="undefined"){var Xe=nt,ue=Object(o.a)(Xe,1);et=ue[0]}if(nt=et.split("Twitter"),typeof nt[1]!="undefined"){var Ce=nt,rt=Object(o.a)(Ce,1);et=rt[0]}var Qe={apple:{phone:k(u,et)&&!k(h,et),ipod:k(A,et),tablet:!k(u,et)&&k(x,et)&&!k(h,et),device:(k(u,et)||k(A,et)||k(x,et))&&!k(h,et)},amazon:{phone:k(R,et),tablet:!k(R,et)&&k(g,et),device:k(R,et)||k(g,et)},android:{phone:!k(h,et)&&k(R,et)||!k(h,et)&&k(y,et),tablet:!k(h,et)&&!k(R,et)&&!k(y,et)&&(k(g,et)||k(_,et)),device:!k(h,et)&&(k(R,et)||k(g,et)||k(y,et)||k(_,et))||k(/\bokhttp\b/i,et)},windows:{phone:k(h,et),tablet:k(s,et),device:k(h,et)||k(s,et)},other:{blackberry:k(l,et),blackberry10:k(D,et),opera:k(T,et),firefox:k(M,et),chrome:k(C,et),device:k(l,et)||k(D,et)||k(T,et)||k(M,et)||k(C,et)},any:null,phone:null,tablet:null};return Qe.any=Qe.apple.device||Qe.android.device||Qe.windows.device||Qe.other.device,Qe.phone=Qe.apple.phone||Qe.android.phone||Qe.windows.phone,Qe.tablet=Qe.apple.tablet||Qe.android.tablet||Qe.windows.tablet,Qe}var P=Object(Z.a)(Object(Z.a)({},U()),{},{isMobile:U}),K=P;function H(){}function $(gt,et,nt){var Xe=et||"";return gt.key||"".concat(Xe,"item_").concat(nt)}function le(gt){return"".concat(gt,"-menu-")}function pe(gt,et){var nt=-1;W.Children.forEach(gt,function(Xe){nt+=1,Xe&&Xe.type&&Xe.type.isMenuItemGroup?W.Children.forEach(Xe.props.children,function(ue){nt+=1,et(ue,nt)}):et(Xe,nt)})}function xe(gt,et,nt){if(!gt||nt.find)return;W.Children.forEach(gt,function(Xe){if(Xe){var ue=Xe.type;if(!ue||!(ue.isSubMenu||ue.isMenuItem||ue.isMenuItemGroup))return;et.indexOf(Xe.key)!==-1?nt.find=!0:Xe.props.children&&xe(Xe.props.children,et,nt)}})}var ze=["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"],Ne=function(et){var nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Xe=et&&typeof et.getBoundingClientRect=="function"&&et.getBoundingClientRect().width;if(Xe){if(nt){var ue=getComputedStyle(et),Ce=ue.marginLeft,rt=ue.marginRight;Xe+=+Ce.replace("px","")+ +rt.replace("px","")}Xe=+Xe.toFixed(6)}return Xe||0},Ie=function(et,nt,Xe){et&&Object(n.a)(et.style)==="object"&&(et.style[nt]=Xe)},Be=function(){return K.any},ke=N("KQm4"),ge=N("Ff2n"),fe=N("i8i4"),te=N("bdgK"),be=N("uciX"),se=N("8XRh"),Oe={adjustX:1,adjustY:1},ie={topLeft:{points:["bl","tl"],overflow:Oe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Oe,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Oe,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Oe,offset:[4,0]}},oe={topLeft:{points:["bl","tl"],overflow:Oe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Oe,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Oe,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Oe,offset:[4,0]}},Ae=ie,_e=0,je={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},He=function(et,nt,Xe){var ue=le(nt),Ce=et.getState();et.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},Ce.defaultActiveFirst),{},Object(c.a)({},ue,Xe))})},Ye=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(Xe){var ue;Object(z.a)(this,nt),ue=et.call(this,Xe),ue.onDestroy=function(Le){ue.props.onDestroy(Le)},ue.onKeyDown=function(Le){var Ue=Le.keyCode,$e=ue.menuInstance,at=ue.props,St=at.isOpen,it=at.store;if(Ue===p.a.ENTER)return ue.onTitleClick(Le),He(it,ue.props.eventKey,!0),!0;if(Ue===p.a.RIGHT)return St?$e.onKeyDown(Le):(ue.triggerOpenChange(!0),He(it,ue.props.eventKey,!0)),!0;if(Ue===p.a.LEFT){var It;if(St)It=$e.onKeyDown(Le);else return;return It||(ue.triggerOpenChange(!1),It=!0),It}return St&&(Ue===p.a.UP||Ue===p.a.DOWN)?$e.onKeyDown(Le):void 0},ue.onOpenChange=function(Le){ue.props.onOpenChange(Le)},ue.onPopupVisibleChange=function(Le){ue.triggerOpenChange(Le,Le?"mouseenter":"mouseleave")},ue.onMouseEnter=function(Le){var Ue=ue.props,$e=Ue.eventKey,at=Ue.onMouseEnter,St=Ue.store;He(St,ue.props.eventKey,!1),at({key:$e,domEvent:Le})},ue.onMouseLeave=function(Le){var Ue=ue.props,$e=Ue.parentMenu,at=Ue.eventKey,St=Ue.onMouseLeave;$e.subMenuInstance=Object(G.a)(ue),St({key:at,domEvent:Le})},ue.onTitleMouseEnter=function(Le){var Ue=ue.props,$e=Ue.eventKey,at=Ue.onItemHover,St=Ue.onTitleMouseEnter;at({key:$e,hover:!0}),St({key:$e,domEvent:Le})},ue.onTitleMouseLeave=function(Le){var Ue=ue.props,$e=Ue.parentMenu,at=Ue.eventKey,St=Ue.onItemHover,it=Ue.onTitleMouseLeave;$e.subMenuInstance=Object(G.a)(ue),St({key:at,hover:!1}),it({key:at,domEvent:Le})},ue.onTitleClick=function(Le){var Ue=Object(G.a)(ue),$e=Ue.props;if($e.onTitleClick({key:$e.eventKey,domEvent:Le}),$e.triggerSubMenuAction==="hover")return;ue.triggerOpenChange(!$e.isOpen,"click"),He($e.store,ue.props.eventKey,!1)},ue.onSubMenuClick=function(Le){typeof ue.props.onClick=="function"&&ue.props.onClick(ue.addKeyPath(Le))},ue.onSelect=function(Le){ue.props.onSelect(Le)},ue.onDeselect=function(Le){ue.props.onDeselect(Le)},ue.getPrefixCls=function(){return"".concat(ue.props.rootPrefixCls,"-submenu")},ue.getActiveClassName=function(){return"".concat(ue.getPrefixCls(),"-active")},ue.getDisabledClassName=function(){return"".concat(ue.getPrefixCls(),"-disabled")},ue.getSelectedClassName=function(){return"".concat(ue.getPrefixCls(),"-selected")},ue.getOpenClassName=function(){return"".concat(ue.props.rootPrefixCls,"-submenu-open")},ue.saveMenuInstance=function(Le){ue.menuInstance=Le},ue.addKeyPath=function(Le){return Object(Z.a)(Object(Z.a)({},Le),{},{keyPath:(Le.keyPath||[]).concat(ue.props.eventKey)})},ue.triggerOpenChange=function(Le,Ue){var $e=ue.props.eventKey,at=function(){ue.onOpenChange({key:$e,item:Object(G.a)(ue),trigger:Ue,open:Le})};Ue==="mouseenter"?ue.mouseenterTimeout=setTimeout(function(){at()},0):at()},ue.isChildrenSelected=function(){var Le={find:!1};return xe(ue.props.children,ue.props.selectedKeys,Le),Le.find},ue.isOpen=function(){return ue.props.openKeys.indexOf(ue.props.eventKey)!==-1},ue.adjustWidth=function(){if(!ue.subMenuTitle||!ue.menuInstance)return;var Le=fe.findDOMNode(ue.menuInstance);if(Le.offsetWidth>=ue.subMenuTitle.offsetWidth)return;Le.style.minWidth="".concat(ue.subMenuTitle.offsetWidth,"px")},ue.saveSubMenuTitle=function(Le){ue.subMenuTitle=Le},ue.getBaseProps=function(){var Le=Object(G.a)(ue),Ue=Le.props;return{mode:Ue.mode==="horizontal"?"vertical":Ue.mode,visible:ue.props.isOpen,level:Ue.level+1,inlineIndent:Ue.inlineIndent,focusable:!1,onClick:ue.onSubMenuClick,onSelect:ue.onSelect,onDeselect:ue.onDeselect,onDestroy:ue.onDestroy,selectedKeys:Ue.selectedKeys,eventKey:"".concat(Ue.eventKey,"-menu-"),openKeys:Ue.openKeys,motion:Ue.motion,onOpenChange:ue.onOpenChange,subMenuOpenDelay:Ue.subMenuOpenDelay,parentMenu:Object(G.a)(ue),subMenuCloseDelay:Ue.subMenuCloseDelay,forceSubMenuRender:Ue.forceSubMenuRender,triggerSubMenuAction:Ue.triggerSubMenuAction,builtinPlacements:Ue.builtinPlacements,defaultActiveFirst:Ue.store.getState().defaultActiveFirst[le(Ue.eventKey)],multiple:Ue.multiple,prefixCls:Ue.rootPrefixCls,id:ue.internalMenuId,manualRef:ue.saveMenuInstance,itemIcon:Ue.itemIcon,expandIcon:Ue.expandIcon,direction:Ue.direction}},ue.getMotion=function(Le,Ue){var $e=Object(G.a)(ue),at=$e.haveRendered,St=ue.props,it=St.motion,It=St.rootPrefixCls,Xt=Object(Z.a)(Object(Z.a)({},it),{},{leavedClassName:"".concat(It,"-hidden"),removeOnLeave:!1,motionAppear:at||!Ue||Le!=="inline"});return Xt};var Ce=Xe.store,rt=Xe.eventKey,Qe=Ce.getState(),At=Qe.defaultActiveFirst;ue.isRootMenu=!1;var vt=!1;return At&&(vt=At[rt]),He(Ce,rt,vt),ue}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ue=this,Ce=this.props,rt=Ce.mode,Qe=Ce.parentMenu,At=Ce.manualRef;if(At&&At(this),rt!=="horizontal"||!Qe.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ue.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ue=this.props,Ce=ue.onDestroy,rt=ue.eventKey;Ce&&Ce(rt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ue){var Ce=this,rt=this.getBaseProps(),Qe=this.getMotion(rt.mode,rt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||rt.visible||rt.forceSubMenuRender,!this.haveOpened)return W.createElement("div",null);var At=rt.direction;return W.createElement(se.default,Object.assign({visible:rt.visible},Qe),function(vt){var Le=vt.className,Ue=vt.style,$e=a()("".concat(rt.prefixCls,"-sub"),Le,Object(c.a)({},"".concat(rt.prefixCls,"-rtl"),At==="rtl"));return W.createElement(Te,Object.assign({},rt,{id:Ce.internalMenuId,className:$e,style:Ue}),ue)})}},{key:"render",value:function(){var ue,Ce=Object(Z.a)({},this.props),rt=Ce.isOpen,Qe=this.getPrefixCls(),At=Ce.mode==="inline",vt=a()(Qe,"".concat(Qe,"-").concat(Ce.mode),(ue={},Object(c.a)(ue,Ce.className,!!Ce.className),Object(c.a)(ue,this.getOpenClassName(),rt),Object(c.a)(ue,this.getActiveClassName(),Ce.active||rt&&!At),Object(c.a)(ue,this.getDisabledClassName(),Ce.disabled),Object(c.a)(ue,this.getSelectedClassName(),this.isChildrenSelected()),ue));this.internalMenuId||(Ce.eventKey?this.internalMenuId="".concat(Ce.eventKey,"$Menu"):(_e+=1,this.internalMenuId="$__$".concat(_e,"$Menu")));var Le={},Ue={},$e={};Ce.disabled||(Le={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ue={onClick:this.onTitleClick},$e={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var at={},St=Ce.direction;At&&(St==="rtl"?at.paddingRight=Ce.inlineIndent*Ce.level:at.paddingLeft=Ce.inlineIndent*Ce.level);var it={};this.props.isOpen&&(it={"aria-owns":this.internalMenuId});var It=null;Ce.mode!=="horizontal"&&(It=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(It=W.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var Xt=W.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:at,className:"".concat(Qe,"-title"),role:"button"},$e,Ue,{"aria-expanded":rt},it,{"aria-haspopup":"true",title:typeof Ce.title=="string"?Ce.title:void 0}),Ce.title,It||W.createElement("i",{className:"".concat(Qe,"-arrow")})),Lt=this.renderChildren(Ce.children),sn=Ce.parentMenu.isRootMenu?Ce.parentMenu.props.getPopupContainer:function(Ht){return Ht.parentNode},hn=je[Ce.mode],nn=Ce.popupOffset?{offset:Ce.popupOffset}:{},Jt=Ce.mode==="inline"?"":Ce.popupClassName;Jt+=St==="rtl"?" ".concat(Qe,"-rtl"):"";var cn=Ce.disabled,On=Ce.triggerSubMenuAction,mn=Ce.subMenuOpenDelay,ot=Ce.forceSubMenuRender,wt=Ce.subMenuCloseDelay,Rt=Ce.builtinPlacements;ze.forEach(function(Ht){return delete Ce[Ht]}),delete Ce.onClick;var Kt=St==="rtl"?Object.assign({},oe,Rt):Object.assign({},ie,Rt);return delete Ce.direction,W.createElement("li",Object.assign({},Ce,Le,{className:vt,role:"menuitem"}),At&&Xt,At&&Lt,!At&&W.createElement(be.a,{prefixCls:Qe,popupClassName:a()("".concat(Qe,"-popup"),Jt),getPopupContainer:sn,builtinPlacements:Kt,popupPlacement:hn,popupVisible:rt,popupAlign:nn,popup:Lt,action:cn?[]:[On],mouseEnterDelay:mn,mouseLeaveDelay:wt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ot},Xt))}}]),nt}(W.Component);Ye.defaultProps={onMouseEnter:H,onMouseLeave:H,onTitleMouseEnter:H,onTitleMouseLeave:H,onTitleClick:H,manualRef:H,mode:"vertical",title:""};var qe=Object(F.b)(function(gt,et){var nt=gt.openKeys,Xe=gt.activeKey,ue=gt.selectedKeys,Ce=et.eventKey,rt=et.subMenuKey;return{isOpen:nt.indexOf(Ce)>-1,active:Xe[rt]===Ce,selectedKeys:ue}})(Ye);qe.isSubMenu=!0;var bt=qe,yt="menuitem-overflowed",ct=.5,mt=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(){var Xe;return Object(z.a)(this,nt),Xe=et.apply(this,arguments),Xe.resizeObserver=null,Xe.mutationObserver=null,Xe.originalTotalWidth=0,Xe.overflowedItems=[],Xe.menuItemSizes=[],Xe.cancelFrameId=null,Xe.state={lastVisibleIndex:void 0},Xe.getMenuItemNodes=function(){var ue=Xe.props.prefixCls,Ce=fe.findDOMNode(Object(G.a)(Xe));return Ce?[].slice.call(Ce.children).filter(function(rt){return rt.className.split(" ").indexOf("".concat(ue,"-overflowed-submenu"))<0}):[]},Xe.getOverflowedSubMenuItem=function(ue,Ce,rt){var Qe=Xe.props,At=Qe.overflowedIndicator,vt=Qe.level,Le=Qe.mode,Ue=Qe.prefixCls,$e=Qe.theme;if(vt!==1||Le!=="horizontal")return null;var at=Xe.props.children[0],St=at.props,it=St.children,It=St.title,Xt=St.style,Lt=Object(ge.a)(St,["children","title","style"]),sn=Object(Z.a)({},Xt),hn="".concat(ue,"-overflowed-indicator"),nn="".concat(ue,"-overflowed-indicator");Ce.length===0&&rt!==!0?sn=Object(Z.a)(Object(Z.a)({},sn),{},{display:"none"}):rt&&(sn=Object(Z.a)(Object(Z.a)({},sn),{},{visibility:"hidden",position:"absolute"}),hn="".concat(hn,"-placeholder"),nn="".concat(nn,"-placeholder"));var Jt=$e?"".concat(Ue,"-").concat($e):"",cn={};return ze.forEach(function(On){Lt[On]!==void 0&&(cn[On]=Lt[On])}),W.createElement(bt,Object.assign({title:At,className:"".concat(Ue,"-overflowed-submenu"),popupClassName:Jt},cn,{key:hn,eventKey:nn,disabled:!1,style:sn}),Ce)},Xe.setChildrenWidthAndResize=function(){if(Xe.props.mode!=="horizontal")return;var ue=fe.findDOMNode(Object(G.a)(Xe));if(!ue)return;var Ce=ue.children;if(!Ce||Ce.length===0)return;var rt=ue.children[Ce.length-1];Ie(rt,"display","inline-block");var Qe=Xe.getMenuItemNodes(),At=Qe.filter(function(vt){return vt.className.split(" ").indexOf(yt)>=0});At.forEach(function(vt){Ie(vt,"display","inline-block")}),Xe.menuItemSizes=Qe.map(function(vt){return Ne(vt,!0)}),At.forEach(function(vt){Ie(vt,"display","none")}),Xe.overflowedIndicatorWidth=Ne(ue.children[ue.children.length-1],!0),Xe.originalTotalWidth=Xe.menuItemSizes.reduce(function(vt,Le){return vt+Le},0),Xe.handleResize(),Ie(rt,"display","none")},Xe.handleResize=function(){if(Xe.props.mode!=="horizontal")return;var ue=fe.findDOMNode(Object(G.a)(Xe));if(!ue)return;var Ce=Ne(ue);Xe.overflowedItems=[];var rt=0,Qe;Xe.originalTotalWidth>Ce+ct&&(Qe=-1,Xe.menuItemSizes.forEach(function(At){rt+=At,rt+Xe.overflowedIndicatorWidth<=Ce&&(Qe+=1)})),Xe.setState({lastVisibleIndex:Qe})},Xe}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){var ue=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ce=fe.findDOMNode(this);if(!Ce)return;this.resizeObserver=new te.default(function(rt){rt.forEach(function(){var Qe=ue.cancelFrameId;cancelAnimationFrame(Qe),ue.cancelFrameId=requestAnimationFrame(ue.setChildrenWidthAndResize)})}),[].slice.call(Ce.children).concat(Ce).forEach(function(rt){ue.resizeObserver.observe(rt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ue.resizeObserver.disconnect(),[].slice.call(Ce.children).concat(Ce).forEach(function(rt){ue.resizeObserver.observe(rt)}),ue.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ce,{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(ue){var Ce=this,rt=this.state.lastVisibleIndex;return(ue||[]).reduce(function(Qe,At,vt){var Le=At;if(Ce.props.mode==="horizontal"){var Ue=Ce.getOverflowedSubMenuItem(At.props.eventKey,[]);rt!==void 0&&Ce.props.className.indexOf("".concat(Ce.props.prefixCls,"-root"))!==-1&&(vt>rt&&(Le=W.cloneElement(At,{style:{display:"none"},eventKey:"".concat(At.props.eventKey,"-hidden"),className:"".concat(yt)})),vt===rt+1&&(Ce.overflowedItems=ue.slice(rt+1).map(function(at){return W.cloneElement(at,{key:at.props.eventKey,mode:"vertical-left"})}),Ue=Ce.getOverflowedSubMenuItem(At.props.eventKey,Ce.overflowedItems)));var $e=[].concat(Object(ke.a)(Qe),[Ue,Le]);return vt===ue.length-1&&$e.push(Ce.getOverflowedSubMenuItem(At.props.eventKey,[],!0)),$e}return[].concat(Object(ke.a)(Qe),[Le])},[])}},{key:"render",value:function(){var ue=this.props,Ce=ue.visible,rt=ue.prefixCls,Qe=ue.overflowedIndicator,At=ue.mode,vt=ue.level,Le=ue.tag,Ue=ue.children,$e=ue.theme,at=Object(ge.a)(ue,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),St=Le;return W.createElement(St,Object.assign({},at),this.renderChildren(Ue))}}]),nt}(W.Component);mt.defaultProps={tag:"div",className:""};var Ot=mt;function Mt(gt){return gt.length?gt.every(function(et){return!!et.props.disabled}):!0}function Me(gt,et,nt){var Xe=gt.getState();gt.setState({activeKey:Object(Z.a)(Object(Z.a)({},Xe.activeKey),{},Object(c.a)({},et,nt))})}function Re(gt){return gt.eventKey||"0-menu-"}function Ze(gt,et){var nt=et,Xe=gt.children,ue=gt.eventKey;if(nt){var Ce;if(pe(Xe,function(rt,Qe){rt&&rt.props&&!rt.props.disabled&&nt===$(rt,ue,Qe)&&(Ce=!0)}),Ce)return nt}return nt=null,gt.defaultActiveFirst&&pe(Xe,function(rt,Qe){!nt&&rt&&!rt.props.disabled&&(nt=$(rt,ue,Qe))}),nt}function lt(gt){if(gt){var et=this.instanceArray.indexOf(gt);et!==-1?this.instanceArray[et]=gt:this.instanceArray.push(gt)}}var Ke=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(Xe){var ue;return Object(z.a)(this,nt),ue=et.call(this,Xe),ue.onKeyDown=function(Ce,rt){var Qe=Ce.keyCode,At;if(ue.getFlatInstanceArray().forEach(function(Le){Le&&Le.props.active&&Le.onKeyDown&&(At=Le.onKeyDown(Ce))}),At)return 1;var vt=null;return(Qe===p.a.UP||Qe===p.a.DOWN)&&(vt=ue.step(Qe===p.a.UP?-1:1)),vt?(Ce.preventDefault(),Me(ue.props.store,Re(ue.props),vt.props.eventKey),typeof rt=="function"&&rt(vt),1):void 0},ue.onItemHover=function(Ce){var rt=Ce.key,Qe=Ce.hover;Me(ue.props.store,Re(ue.props),Qe?rt:null)},ue.onDeselect=function(Ce){ue.props.onDeselect(Ce)},ue.onSelect=function(Ce){ue.props.onSelect(Ce)},ue.onClick=function(Ce){ue.props.onClick(Ce)},ue.onOpenChange=function(Ce){ue.props.onOpenChange(Ce)},ue.onDestroy=function(Ce){ue.props.onDestroy(Ce)},ue.getFlatInstanceArray=function(){return ue.instanceArray},ue.step=function(Ce){var rt=ue.getFlatInstanceArray(),Qe=ue.props.store.getState().activeKey[Re(ue.props)],At=rt.length;if(!At)return null;Ce<0&&(rt=rt.concat().reverse());var vt=-1;if(rt.every(function(at,St){return at&&at.props.eventKey===Qe?(vt=St,!1):!0}),!ue.props.defaultActiveFirst&&vt!==-1&&Mt(rt.slice(vt,At-1)))return;var Le=(vt+1)%At,Ue=Le;do{var $e=rt[Ue];if(!$e||$e.props.disabled)Ue=(Ue+1)%At;else return $e}while(Ue!==Le);return null},ue.renderCommonMenuItem=function(Ce,rt,Qe){var At=ue.props.store.getState(),vt=Object(G.a)(ue),Le=vt.props,Ue=$(Ce,Le.eventKey,rt),$e=Ce.props;if(!$e||typeof Ce.type=="string")return Ce;var at=Ue===At.activeKey,St=Object(Z.a)(Object(Z.a)({mode:$e.mode||Le.mode,level:Le.level,inlineIndent:Le.inlineIndent,renderMenuItem:ue.renderMenuItem,rootPrefixCls:Le.prefixCls,index:rt,parentMenu:Le.parentMenu,manualRef:$e.disabled?void 0:Object(S.a)(Ce.ref,lt.bind(Object(G.a)(ue))),eventKey:Ue,active:!$e.disabled&&at,multiple:Le.multiple,onClick:function(It){($e.onClick||H)(It),ue.onClick(It)},onItemHover:ue.onItemHover,motion:Le.motion,subMenuOpenDelay:Le.subMenuOpenDelay,subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,onOpenChange:ue.onOpenChange,onDeselect:ue.onDeselect,onSelect:ue.onSelect,builtinPlacements:Le.builtinPlacements,itemIcon:$e.itemIcon||ue.props.itemIcon,expandIcon:$e.expandIcon||ue.props.expandIcon},Qe),{},{direction:Le.direction});return(Le.mode==="inline"||Be())&&(St.triggerSubMenuAction="click"),W.cloneElement(Ce,St)},ue.renderMenuItem=function(Ce,rt,Qe){if(!Ce)return null;var At=ue.props.store.getState(),vt={openKeys:At.openKeys,selectedKeys:At.selectedKeys,triggerSubMenuAction:ue.props.triggerSubMenuAction,subMenuKey:Qe};return ue.renderCommonMenuItem(Ce,rt,vt)},Xe.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},Xe.store.getState().activeKey),{},Object(c.a)({},Xe.eventKey,Ze(Xe,Xe.activeKey)))}),ue.instanceArray=[],ue}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ue){return this.props.visible||ue.visible||this.props.className!==ue.className||!f()(this.props.style,ue.style)}},{key:"componentDidUpdate",value:function(ue){var Ce=this.props,rt="activeKey"in Ce?Ce.activeKey:Ce.store.getState().activeKey[Re(Ce)],Qe=Ze(Ce,rt);if(Qe!==rt)Me(Ce.store,Re(Ce),Qe);else if("activeKey"in ue){var At=Ze(ue,ue.activeKey);Qe!==At&&Me(Ce.store,Re(Ce),Qe)}}},{key:"render",value:function(){var ue=this,Ce=Object(b.a)({},this.props);this.instanceArray=[];var rt=a()(Ce.prefixCls,Ce.className,"".concat(Ce.prefixCls,"-").concat(Ce.mode)),Qe={className:rt,role:Ce.role||"menu"};Ce.id&&(Qe.id=Ce.id),Ce.focusable&&(Qe.tabIndex=0,Qe.onKeyDown=this.onKeyDown);var At=Ce.prefixCls,vt=Ce.eventKey,Le=Ce.visible,Ue=Ce.level,$e=Ce.mode,at=Ce.overflowedIndicator,St=Ce.theme;return ze.forEach(function(it){return delete Ce[it]}),delete Ce.onClick,W.createElement(Ot,Object.assign({},Ce,{prefixCls:At,mode:$e,tag:"ul",level:Ue,theme:St,visible:Le,overflowedIndicator:at},Qe),W.Children.map(Ce.children,function(it,It){return ue.renderMenuItem(it,It,vt||"0-menu-")}))}}]),nt}(W.Component);Ke.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:H};var tt=Object(F.b)()(Ke),Te=tt,me=N("Kwbf");function ve(gt,et,nt){var Xe=gt.prefixCls,ue=gt.motion,Ce=gt.defaultMotions,rt=Ce===void 0?{}:Ce,Qe=gt.openAnimation,At=gt.openTransitionName,vt=et.switchingModeFromInline;if(ue)return ue;if(Object(n.a)(Qe)==="object"&&Qe)Object(me.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Qe=="string")return{motionName:"".concat(Xe,"-open-").concat(Qe)};if(At)return{motionName:At};var Le=rt[nt];return Le||(vt?null:rt.other)}var re=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(Xe){var ue;Object(z.a)(this,nt),ue=et.call(this,Xe),ue.inlineOpenKeys=[],ue.onSelect=function(Qe){var At=Object(G.a)(ue),vt=At.props;if(vt.selectable){var Le=ue.store.getState(),Ue=Le.selectedKeys,$e=Qe.key;vt.multiple?Ue=Ue.concat([$e]):Ue=[$e],"selectedKeys"in vt||ue.store.setState({selectedKeys:Ue}),vt.onSelect(Object(Z.a)(Object(Z.a)({},Qe),{},{selectedKeys:Ue}))}},ue.onClick=function(Qe){var At=ue.getRealMenuMode(),vt=Object(G.a)(ue),Le=vt.store,Ue=vt.props.onOpenChange;At!=="inline"&&!("openKeys"in ue.props)&&(Le.setState({openKeys:[]}),Ue([])),ue.props.onClick(Qe)},ue.onKeyDown=function(Qe,At){ue.innerMenu.getWrappedInstance().onKeyDown(Qe,At)},ue.onOpenChange=function(Qe){var At=Object(G.a)(ue),vt=At.props,Le=ue.store.getState().openKeys.concat(),Ue=!1,$e=function(St){var it=!1;if(St.open)it=Le.indexOf(St.key)===-1,it&&Le.push(St.key);else{var It=Le.indexOf(St.key);it=It!==-1,it&&Le.splice(It,1)}Ue=Ue||it};Array.isArray(Qe)?Qe.forEach($e):$e(Qe),Ue&&("openKeys"in ue.props||ue.store.setState({openKeys:Le}),vt.onOpenChange(Le))},ue.onDeselect=function(Qe){var At=Object(G.a)(ue),vt=At.props;if(vt.selectable){var Le=ue.store.getState().selectedKeys.concat(),Ue=Qe.key,$e=Le.indexOf(Ue);$e!==-1&&Le.splice($e,1),"selectedKeys"in vt||ue.store.setState({selectedKeys:Le}),vt.onDeselect(Object(Z.a)(Object(Z.a)({},Qe),{},{selectedKeys:Le}))}},ue.onMouseEnter=function(Qe){ue.restoreModeVerticalFromInline();var At=ue.props.onMouseEnter;At&&At(Qe)},ue.onTransitionEnd=function(Qe){var At=Qe.propertyName==="width"&&Qe.target===Qe.currentTarget,vt=Qe.target.className,Le=Object.prototype.toString.call(vt)==="[object SVGAnimatedString]"?vt.animVal:vt,Ue=Qe.propertyName==="font-size"&&Le.indexOf("anticon")>=0;(At||Ue)&&ue.restoreModeVerticalFromInline()},ue.setInnerMenu=function(Qe){ue.innerMenu=Qe},ue.isRootMenu=!0;var Ce=Xe.defaultSelectedKeys,rt=Xe.defaultOpenKeys;return"selectedKeys"in Xe&&(Ce=Xe.selectedKeys||[]),"openKeys"in Xe&&(rt=Xe.openKeys||[]),ue.store=Object(F.c)({selectedKeys:Ce,openKeys:rt,activeKey:{"0-menu-":Ze(Xe,Xe.activeKey)}}),ue.state={switchingModeFromInline:!1},ue}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ue){this.updateOpentKeysWhenSwitchMode(ue),this.updateMiniStore();var Ce=this.props,rt=Ce.siderCollapsed,Qe=Ce.inlineCollapsed,At=Ce.onOpenChange;(!ue.inlineCollapsed&&Qe||!ue.siderCollapsed&&rt)&&At([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ue){var Ce=this.props,rt=this.store,Qe=this.inlineOpenKeys,At=rt.getState(),vt={};ue.mode==="inline"&&Ce.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ce||((Ce.inlineCollapsed&&!ue.inlineCollapsed||Ce.siderCollapsed&&!ue.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=At.openKeys.concat(),vt.openKeys=[]),(!Ce.inlineCollapsed&&ue.inlineCollapsed||!Ce.siderCollapsed&&ue.siderCollapsed)&&(vt.openKeys=Qe,this.inlineOpenKeys=[])),Object.keys(vt).length&&rt.setState(vt)}},{key:"updateMenuDisplay",value:function(){var ue=this.props.collapsedWidth,Ce=this.store,rt=this.prevOpenKeys,Qe=this.getInlineCollapsed()&&(ue===0||ue==="0"||ue==="0px");Qe?(this.prevOpenKeys=Ce.getState().openKeys.concat(),this.store.setState({openKeys:[]})):rt&&(this.store.setState({openKeys:rt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ue=this.props.mode,Ce=this.state.switchingModeFromInline,rt=this.getInlineCollapsed();return Ce&&rt?"inline":rt?"vertical":ue}},{key:"getInlineCollapsed",value:function(){var ue=this.props,Ce=ue.inlineCollapsed,rt=ue.siderCollapsed;return rt!==void 0?rt:Ce}},{key:"restoreModeVerticalFromInline",value:function(){var ue=this.state.switchingModeFromInline;ue&&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 ue=Object(Z.a)({},Object(O.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ce=this.getRealMenuMode();return ue.className+=" ".concat(ue.prefixCls,"-root"),ue.direction==="rtl"&&(ue.className+=" ".concat(ue.prefixCls,"-rtl")),ue=Object(Z.a)(Object(Z.a)({},ue),{},{mode:Ce,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ve(this.props,this.state,Ce)}),delete ue.openAnimation,delete ue.openTransitionName,W.createElement(F.a,{store:this.store},W.createElement(Te,Object.assign({},ue,{ref:this.setInnerMenu}),this.props.children))}}]),nt}(W.Component);re.defaultProps={selectable:!0,onClick:H,onSelect:H,onOpenChange:H,onDeselect:H,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:W.createElement("span",null,"\xB7\xB7\xB7")};var ae=re,he=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(){var Xe;return Object(z.a)(this,nt),Xe=et.apply(this,arguments),Xe.onKeyDown=function(ue){var Ce=ue.keyCode;return Ce===p.a.ENTER?(Xe.onClick(ue),!0):void 0},Xe.onMouseLeave=function(ue){var Ce=Xe.props,rt=Ce.eventKey,Qe=Ce.onItemHover,At=Ce.onMouseLeave;Qe({key:rt,hover:!1}),At({key:rt,domEvent:ue})},Xe.onMouseEnter=function(ue){var Ce=Xe.props,rt=Ce.eventKey,Qe=Ce.onItemHover,At=Ce.onMouseEnter;Qe({key:rt,hover:!0}),At({key:rt,domEvent:ue})},Xe.onClick=function(ue){var Ce=Xe.props,rt=Ce.eventKey,Qe=Ce.multiple,At=Ce.onClick,vt=Ce.onSelect,Le=Ce.onDeselect,Ue=Ce.isSelected,$e={key:rt,keyPath:[rt],item:Object(G.a)(Xe),domEvent:ue};At($e),Qe?Ue?Le($e):vt($e):Ue||vt($e)},Xe.saveNode=function(ue){Xe.node=ue},Xe}return Object(I.a)(nt,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ue=this.props;ue.onDestroy&&ue.onDestroy(ue.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 ue,Ce=Object(Z.a)({},this.props),rt=a()(this.getPrefixCls(),Ce.className,(ue={},Object(c.a)(ue,this.getActiveClassName(),!Ce.disabled&&Ce.active),Object(c.a)(ue,this.getSelectedClassName(),Ce.isSelected),Object(c.a)(ue,this.getDisabledClassName(),Ce.disabled),ue)),Qe=Object(Z.a)(Object(Z.a)({},Ce.attribute),{},{title:typeof Ce.title=="string"?Ce.title:void 0,className:rt,role:Ce.role||"menuitem","aria-disabled":Ce.disabled});Ce.role==="option"?Qe=Object(Z.a)(Object(Z.a)({},Qe),{},{role:"option","aria-selected":Ce.isSelected}):(Ce.role===null||Ce.role==="none")&&(Qe.role="none");var At={onClick:Ce.disabled?null:this.onClick,onMouseLeave:Ce.disabled?null:this.onMouseLeave,onMouseEnter:Ce.disabled?null:this.onMouseEnter},vt=Object(Z.a)({},Ce.style);Ce.mode==="inline"&&(Ce.direction==="rtl"?vt.paddingRight=Ce.inlineIndent*Ce.level:vt.paddingLeft=Ce.inlineIndent*Ce.level),ze.forEach(function(Ue){return delete Ce[Ue]}),delete Ce.direction;var Le=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Le=W.createElement(this.props.itemIcon,this.props)),W.createElement("li",Object.assign({},Object(O.default)(Ce,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Qe,At,{style:vt,ref:this.saveNode}),Ce.children,Le)}}]),nt}(W.Component);he.isMenuItem=!0,he.defaultProps={onSelect:H,onMouseEnter:H,onMouseLeave:H,manualRef:H};var ye=Object(F.b)(function(gt,et){var nt=gt.activeKey,Xe=gt.selectedKeys,ue=et.eventKey,Ce=et.subMenuKey;return{active:nt[Ce]===ue,isSelected:Xe.indexOf(ue)!==-1}})(he),Fe=ye,Pe=function(gt){Object(j.a)(nt,gt);var et=Object(w.a)(nt);function nt(){var Xe;return Object(z.a)(this,nt),Xe=et.apply(this,arguments),Xe.renderInnerMenuItem=function(ue){var Ce=Xe.props,rt=Ce.renderMenuItem,Qe=Ce.index;return rt(ue,Qe,Xe.props.subMenuKey)},Xe}return Object(I.a)(nt,[{key:"render",value:function(){var ue=Object(b.a)({},this.props),Ce=ue.className,rt=Ce===void 0?"":Ce,Qe=ue.rootPrefixCls,At="".concat(Qe,"-item-group-title"),vt="".concat(Qe,"-item-group-list"),Le=ue.title,Ue=ue.children;return ze.forEach(function($e){return delete ue[$e]}),delete ue.onClick,delete ue.direction,W.createElement("li",Object.assign({},ue,{className:"".concat(rt," ").concat(Qe,"-item-group")}),W.createElement("div",{className:At,title:typeof Le=="string"?Le:void 0},Le),W.createElement("ul",{className:vt},W.Children.map(Ue,this.renderInnerMenuItem)))}}]),nt}(W.Component);Pe.isMenuItemGroup=!0,Pe.defaultProps={disabled:!0};var ut=Pe,Et=function(et){var nt=et.className,Xe=et.rootPrefixCls,ue=et.style;return W.createElement("li",{className:"".concat(nt," ").concat(Xe,"-item-divider"),style:ue})};Et.defaultProps={disabled:!0,className:"",style:{}};var _t=Et,Ct=de.e=ae},"24hK":function(Ge,de,N){"use strict";N.d(de,"a",function(){return I});var Z=N("JYp7"),z=function(){function G(j){this.element=j,this.next=G.Undefined,this.prev=G.Undefined}return G.Undefined=new G(void 0),G}(),I=function(){function G(){this._first=z.Undefined,this._last=z.Undefined,this._size=0}return Object.defineProperty(G.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),G.prototype.isEmpty=function(){return this._first===z.Undefined},G.prototype.clear=function(){this._first=z.Undefined,this._last=z.Undefined,this._size=0},G.prototype.unshift=function(j){return this._insert(j,!1)},G.prototype.push=function(j){return this._insert(j,!0)},G.prototype._insert=function(j,w){var W=this,F=new z(j);if(this._first===z.Undefined)this._first=F,this._last=F;else if(w){var O=this._last;this._last=F,F.prev=O,O.next=F}else{var b=this._first;this._first=F,F.next=b,b.prev=F}this._size+=1;var c=!1;return function(){c||(c=!0,W._remove(F))}},G.prototype.shift=function(){if(this._first===z.Undefined)return;var j=this._first.element;return this._remove(this._first),j},G.prototype.pop=function(){if(this._last===z.Undefined)return;var j=this._last.element;return this._remove(this._last),j},G.prototype._remove=function(j){if(j.prev!==z.Undefined&&j.next!==z.Undefined){var w=j.prev;w.next=j.next,j.next.prev=w}else j.prev===z.Undefined&&j.next===z.Undefined?(this._first=z.Undefined,this._last=z.Undefined):j.next===z.Undefined?(this._last=this._last.prev,this._last.next=z.Undefined):j.prev===z.Undefined&&(this._first=this._first.next,this._first.prev=z.Undefined);this._size-=1},G.prototype.iterator=function(){var j,w=this._first;return{next:function(){return w===z.Undefined?Z.c:(j?j.value=w.element:j={done:!1,value:w.element},w=w.next,j)}}},G.prototype.toArray=function(){for(var j=[],w=this._first;w!==z.Undefined;w=w.next)j.push(w.element);return j},G}()},"4qgm":function(Ge,de){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1PTckKNereENM1L6rFmaAc/PzRD3L6E9jlUabN+Swj2tfFB6o8Q7h0e/GQMPDcy9djBS7DjPJzthOJ+0lSPvzguyxonyz96E9mjwIpGHeGZ+lFYiEXMpP+ozQhcPgZmj7z95MUE1H8Ef7gIhnCszyXOPWqa5lWUDVcvsu3Mk5KrXsodEhUtOtNT6qwYj0allj2dXAIzvx+5CtvOwT9vQpEFVtTVMzuK8QJT1yY55HssbZ0sLd3N3LF+k47pZ70YcZS5WNj5UAsr0PS74cG+C/DLNrjppYTm0wKaSW7gUxvz2HL0q/Jpxs4tgeVN+rRvUWPF+Hx/qEURmOl7uh1ePweN11Iua+XjtsYLUjSP+BZLW0vlmLEvk07paK+LNWoxWwQxBXKhWm8u2n2MpA+/+S/suQDXvfxc1ti0ioIC/ybK5o5BbJbSJj1pD+HLXnu0DBlmEaIIzNjbfi6VhErydNeAmgX2MPCu8ZxMaNJptlBjSi6zv+VbKOcSHFVgwxXY/CFc6AI7Hzc14kzBni7xPJtFgZnxp/S+WJLFAsvEYWiko04vKMMKbOtK7Y9/+h/4mmchkFWkWz6VxyvkzYBm9vzKjmsFFnX9PfZkbPYl0BSVBy7CzvNwvqsfm3/WMct1WXUy65h1lyNMb9CS9iEsUouVls3w/tDsTeCZDjDxduhqKqHk5ZJpaprgQ/VZleug3KOnl/1dJ6QvjL4Z5uohbAx2+fBWG/ziY7icTFHLp4W96ug1lM3l0eCxvIhQicWIqBu/IbhyLDz7cErCiRup6qX5ej/2u4iXVaFyVdlxfUyFN0UojbJPGlozH4B5o+DAJfh1GxjR+VYs2deNFrx2vELa+qIfSqAxUtqkW61iXvY7+zJ55+/mFGHcsN0FJ8+a89Y1RoL3xWVF85TwF8ahBZY16RtSzEtRBRq5RmTogbqtn6GGh+vDThHiLWVyadYstffvl/Q1cu8LHnrc/giMxjzdOxNrCU6rsry1Qv5sflkQ1x8qjN5VJWvD2C2cQGMpwmG4t8lJUUAtobDds1l3coJcnVulox2LdU4xzyc62berWmbfG4GSKo80SVKK0gfjfIWaGDXFcoJW32dZ6yR5x4hYuEafUaixbcYaX3cT7NlVLfMGXGAmq4nPHlz2YvMjbJ41k4iSbYOSylBz6VThZ+2dbPzga3Jj4Todhcd6FZ4XAd8DJwZucqAF3q4gPgCWZ78GK2/S76nFBonxSKhzZfoc5ydpxGNpy2Q5HFCr0mew2WjZPOJmXZcMuMDgFZiPi1Dv3SRuXmTOqdWhRV28ZHkc3hGXw+VN+rAK67GYjWD1VCAYd/Q9borHZrWpaymTjoWv6igtZh0E59OAWnYbMIGljbrDGc4L3g3eRQNqB83A89bo4zb81HYodV06VKkb+S4b4/slMbFRn7JsaiTGF7JpZu5S/ARH8FjSMkUaja35cZ1lCTUBNXPwzhHLRmAywd7dcZlb2Bhs1C3EGNTlsOr0eLkyZ7kOdYawyoJXRCj2PDArbjvguRxVl1d2rZXGCa36oO2zBmWexLCD+ExwHai91M6WszOkc06Vfi5msc4QNzmrO7VsIbEiSCTYubtaXiiowNJmfcBssumVniGw2XaY6Jl3gN1W2oj0fTrUY9PIf7HB0Cxv0ifUZhF+SlxzuZy4i1ofV5NOyu5ltXiqvlL+VlCBGWNzV+vX7RgHnRj3JXPeRKZ6ZtP0fBbviacugTItoOakY60PasalLTuIx3dIsrh+rZwKIy6YR9iOmX7z6zUmbTwhQq1l82gugtk20zRvqrKJDrZeKaX9/vd42oIay7kzQ+aaS/C8x3WEtZc9tu2PS6TXPZEFZibx4w36YMKl2lRPIti9xY2haQh4LmcQbqBMSBPpcX2zPKDB91m8Oy4no8LIi2D3QRZW6Uxs6sLQtMzhNkfq724zTf2aKutH+rwej0gt217eBLONLKzWh8z/wWgImr1RCKgZ0h4N4rJk59pUIupPK4jAzAQWxPU7QJ3t8MW+YjMXNfW55ivriy+xbfv23C9ToootqEAzeEDTplqV+X3FZibbWqlE0iCwZOdr/adWcBfNtarzqvS7tkWt1QtNE2uGGrAhNpzXty8qDLV7IjBDUy3ioszHwspk2lux5tOgHkt3xaU1quuF7V9wF+2Rpk0dwjhTXypcQ9lYdD9bB4LaPSPYPdOqsAcYh8336yulOSyF/vT7P83Gv9qVBJysAAAAAElFTkSuQmCC"},"4u4S":function(Ge,de){Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAABSCAYAAADjGc4eAAASm0lEQVR4Xu2dd5QUVRbGfz3kJDkKCJJBAVFWRUUkGFBQEFRWFhUWmBlAoqCoMGKAVcC8CLKLBEEkKCZMgKjkqIIIKCKiMCAsUfLUntuvi+7pqeqq7q7pcbrrncMfTL10v/f1q/vuu/eWR0vmBaA/bnERiGMEPFoaSaTzLhrt4lhOV7QER8Aj8mtDKMJxlqJxeYLj4Yofpwh4ie4l+wAqcopVaFSJU1ldsRIYgfNE95K9L5dyjq/RuCCBMXFFj0MEMhHdS/ZUbkTjQzTyxqG8rkgJikAWonvJnkIvNCYmKCau2HGIgCHRfWQfg8awOJTZFSkBETAnuoaHFN4GOiUgLq7IcYaAKdG9u3oaBUlnCRpXxZncrjgJhkBIonvJ3o+ynGUlGhcnGDauuHGEgCXRfWbHupxjORol40h2V5QEQsAW0X1kb8FZPgHyJxA+rqhxgoBtovts7N3IYGqcyO6KkUAIhEV0H9nTyGBkAmHkihoHCIRNdJ+NfToaXeNAfleEBEEgMqKnkZ+9fAY0TxCcXDFzOQIREd27qw+kFCdZgUbtXI6BO/0EQCBiovts7DU4w0qgTAJg5YqYixGIiui+w2kzMlgEFMzFODg/9dLVISkPHN0PJw+b91+gGGSchTMnnJ9DcI9FSsNFTeHgL5C+DbRzmWt48mT9m5OzkvFLXAgHdsLJI072bNlX1ET3kf1uMpgFONKf5axzQ4Uxe6B4BXi7Pyx5yXzGveZBo9th21J4sVX0kpW6CA79DhlnsvZ1xT3QYxZoGgwsDqeO+utUuhRSFsCcgfDtgujnYdRDp/HQaqCa3/Cq2fujChrfMWJqyTwMjM4ehCx6HbgESla1P/TLN8P+7ap+gaLw6Df22r4zFDbMs1fXDtGrXw1Dl6v+5g2Bz8fZ69usVlI+GPsH5C8Mb3SDtbL3BJQOz8KND8HerfBE3czP+nwIl7RVP4J3H4FP/xXdXIJb5ysEo3+DIiXh49GwYLiz/Vv05hjRvTt7CpPR6BFTCWSwUT9B2TBccUZdAns2q2kWvACeD6FaBAoz9QFY+YY98ayIXrgUPLwaytZQ/f260Vp9WfwirJttPn6t62HQF+r5o9Xh4M7MdfsvgrotYfVMmHJv5mf5CkP3N6HxHervy6fAjH+ClmFPXqtaV90P901RtUbU9m80Vu0ceu4s0dPISzoL0Wjt0PzsdaMT/dNnYcN84zYeDwxdoZ6ZEX3BY/D7pqztH5gBBYuCEdFLVgHRbYNJFYroeQtCv4VQu4U9+fRaolYsluwkJuWOMXDTMNizBUbVz1pp7EG1o84dDIvGZ33uSQJRL1r6sp+smArTuztD9mGroNrfYPtXMD72VmlHiS7IacMozhGWodEgvFWMorZO9Jkp8NVrJkRPgn/7Dl9mRB/fArYvNSDIAShSKivRWw+BDv+CrYvhpTaZ25kR/YIKkPwuVL9S1V/4NOz+1lx4qdd6kHo+/gbY7tuxjVo8uhEqN4LPxsH8IZlryOH4qR2+fkzk1FvcOhJuS1P/+3oyvNlLVtZ4jqI21rjWevHy+CIzRTXKCDoEW7f21xhWEY7/EU4Lb13Hie4lex8uIsPr2lsh7BlF0iCniC67+Yjv1W7/SlvYvNA/eyOiN7gF7p0EJStDRgbMTIZlr5tLfEFFeGQtlKgEa96C/3Yxr1u8Eoz5TT1/oZX68QWWy+6EXnOVDj6ohLXVo/OL0PJB9XZ4rhmcOGQ89qAvodZ1kaxaZG2GlP3rEN1L9r5cwVlkeywcmURhtMopossUWw2CTuPg983wVCO/JSGQ6GtnQ9fJ0PA2JdSp4zC9B2z7Apo9oHbgYCtJ3gIgu+XFV8PJozCyDhzZYw5Ks+7wj/+ouoNLZ+2v/dNwy3BlVkyrYwNcD7R/Epa8DEfTzetXuQwKlTB/ftV9cPV96vmMXrD/Rxtjh6jy49fGFiWLXrNlR9fH1PpwOxnMRyMpOuksWutEF/1PP2QGNxEd/bre6q9OqS7Sl+jnw9dD5YZqIfUdOpDoSyfAgM+hVnPYtBBmpSj7+uPfqUO0EH5SJzh+QM2vfF11MKzaRL3mp3WHVdNCg9BzDjTpBAd/hdVvZq0rh8wKdWH/T7BuTmTL8et6WB9G28qN1bkoX0H48jUldw6VbCW6yKSlMACN57NVPqesLuHq6LpQjTpA8nw4vBdG1oJTxyBYdSlaFmrfAOslDNdXqjRR+nqpKrB/B0xoD2I5uXMs5C8EJ4/Bf+6BTR+Ghi8pLzy3HwqH2FmdWICV02Cqb3e26k+sWaJ2laulZHuqIZw+7m8lF2W9fabaN+4L/bayGsvG82wnuo/sr6DRx8Z8IquiE/3b92HnauM+ZEdvN8r5Hd3bo0ftzpUawIej4IORWYluJlmxctBzrtJzZfeW21Qp/9sNr94Gv9mw8ctBU9QnsyLPqzRW+vk370aGsbSSN0+oy6/Anv85Gy6/S51Fnm8BP36VeVwxr47zvcEerwF/+A7Kkc8uZMvYEP1t8rCEBWjcmi1y5KSOrgvU9O9K3fh5FTx3DYzebX0zWqE+NO2i/un29DOn4OtJyhoTSjcOB0iddDtWqINldpfmqdDlVTWKkQVI/h6PRPfu6qkUReNLNC5zHOe/AtFFVxdT4A7fTaeR1aVIGWU7r3MD1GmpdGa9CMGXTVa3hod91hMngCpcUr1d8hWAOYNgcfZqkV5fmsFfqfHEYvNMEzh7Mqsk8Up0L9n7UomzrAIqO7GG5/v4KxA9WCAjot/9MrTom7nmrvUgKpeQ/NBu/zOx5jRPgd0b4fXOkcMlfXT5t1JbxL8kcIzIezVuKT/e3u9AIV/qziPpcHSfcV05V1Ssp56JJejsqdCzmXA7HPg54hnHRHUJnJ3Wj0acQRS2YhHPOrihTvR3HoaVJiGtcuun25mdtLqYCWG4o5dWurxO7u8+MN+9dXOgqELPRpFWR7+RPH0CNn0UHuTiYSg3o3aKqG7dpkDe/OpHJWciJ8sT9WHvloh7dHg29uahpdKODN6zV9tGrZy2uhhN0exmVH5wdvxHnCB6xQYwwsClwQak3irH/oCHylrXbjMUOoxR5D5xGOYOUjZ9KVPvhxMGLrkFi8H9vk1pVqqyWAUXsTzJuUdKWj1I/8F6LiY1coboyYijxcCIZ222o9vtMLt3dCHzs+lQtIzfTff6vnBRGN9ZENOj2OaFbLLz60V2eDM3h2D5u89UB129rJ8LPy2zRkns8TWuUW+e0SHmLHLe9aJfHRNLkdwQy6XV0z41w+wm046OLp6lL/hciXMb0bUUuqIx3RrtMGroO/rbA2C5bycJ1fz0n/5dNdB7MVI7euBYYh8Wgum3oLo/eu/50LhDGEKZVJVbVrGtW5ULG4L4vsguK/7f4kYgRHzyUvPrfOmz+IWQ9oNya5jUGTbMNR9J9y+XGr99p0guZ4BS1RKb6FoKl6PxtePRSHYOo2bL5STRZYFT34cLL/GPphP9mp7Klm23VLtSvQGO7MtMtl3rYPl/rXtJeQ8atoPDe+CZy5Xfe+lqxi66gb31eAuuuFu5NMiPwsyZS9qIeVRcjeUtM7GjP5IqkYmuJVMOD2uz5dMxVkQXX4zrU+GTMVn1Y6eILh58smsXKwt/HgLxVREd0yzCyCpsLRodPTCgQwIwVk2Huq2hvyRuQLkUrPD5hgeS/NLb1A9VyuR7Qvu+6+1kLPnxnTvt7ylRia5NJB8bWYRG9ri5hSK66JEjNiubtRx6vpyQeTeMluhCWHGWajsCxBX1wC/wyi0wYLHxhVH+IuqGtt6NMO46czUiUqKL2e6hZcr3+6flMFZcaH0utve+DtdKMIWmfNIDbeoN2qorefFL2fwxvHqrvUOz0bslYYmewgQ0kq3ftxHWsNrRW/SDu19SO6147gXadqMhetmacP90uNhn/pPDmxDkyF5zFwAh+tCVSr3ZugReusnYGy9Sord7Eto+pq7exzQFccTSi4TadZ+hrualLHoB5g2Ghu1Bbk/FNLhjpXLzPfNnhItBYuroWio9yWBS5KjZaGlFdNl1H14DVS+DYMckK6JLiNm4g+qmT5yPAr0Iu0yA5r7fr4SnSYCC7rgUKsKoTA01H4n2kZA1I1t1JESveR0M/AKSkuCricrfPbjIG+7vE9XOLkU8PsUVWN5GopePaw5/HrQBeogqibaja6lIKowl2Z6B14rosiZNOkNPn+egLKbuZGREdLlN1O3d9W+GRu3VqqbVhfSt/hUuWwuGr4M5Yu0JOiBaxYzWvwn6fKRIKbbm4IuucIku55DHvoFSVeH4/5QXpe72a8TJwB+pPJc2cvh0wv3AKaIHBpP8Vc2L3uv+c6yLSZSRGdELFlc+2ld2Ve6v+m2dV3e9Ri2/EdEf/AzqBYW9eq0QAdYUnTzifWh0zW1FdGnfcSy0GawCMcQnZN82PyXDIbocfMXKUv9GpX9P6QprZhpvuXnyw/V9oO3j6o0SWHaugfdHwPcf58yOLq7Mkvfl7Gl1kJd5SmCKXEI9VC7zgTfMGWbLhZHWjwKc4Uvgb2HOJ7LqT+6AMtVBYkY3zlc6Z6M7lKVBVA697PkeRK8WXfSVW2HzR8ZEl2idayVO0hcN9N37IPbrUBE+wTO3Q3Qh6CPr4OAumPZAZm9Fu0QX4kpuGN1u/1Y/WPqKMY6NO6oY13I11XPxdxdLVKVLlEnx/EawTBE+OBzP7upEuqOL6jVYaBNUJEh72v12Rzeslz1ET0ZsV9HNzK5YNZurFA+ySGIzLlZeqQN6kZvFNbOUbr5rLeivbO+t3xUgV9F6uguzCyO7cwmsZ4foUt/sjdDxOWgzRNmozXxdxMIi6ph+ESX5WIS4gUXyqUjiInEmk4glvcgPVywvuqoidnvxaZcbUb3s2qAipuT8ESrbWDA+kRJdDstP71R5aaRIRjGJhhJT6OHfI1mF820cJ7qWzIPAi1HNKpzGElcZnDbi2AHY8qnahcWRKTAes0RlGPWjOnDJRYocHnOS6CKrvLJFffGmpdOU1eLBT6B8bZW+Y9KdxoiISbPdE+qZ+K+/95i/XpmLlfejvJ0kg4Fe5K02u5/5bi1B1Lc/o8bWiziESQideFgGB1AYzUwIq/vX79tunJHLjgtAODywqOso0bW+tOAcn8X0q9PNeqjI+l/WKPuv6JcSZRTKcUoCduUHcGy/seriBMB2d3QZS4I0RDcV/frMSaWf6iXUNXz5OvD4Jlj6qjoQ60VUoqd+huIV/X+ToOLPx6t0c5ZOZR5ocLPSkSVzgf6GFBVLgrSN/MvDxSy3Et2b4uIca2OeWVdezfKqC2VhCLUIVubFcBdQrx8O0SWUrknQrr3vRxX29t7joYklFz3eNBtBeVfE5UD80MWRS5IVyUYQSQl8M8gt7+oZkfSStU1uJLqWRmHSvUmLwnDmcAav6Hvx+Hc+0ecDr7Kj6bxcbRAdWi6PrOzS8mMTTz29SOxotGF0Yh4V85xTgRayocjbJpTvSzh4yd2G7vsj2dGsAi/C6dugriOqi5bCLDRsuNRFOVu3uYtAhAhETXQtlaFk4HDq1QilcZu5CJggEBXRtWRuwsNH2Z6gyF0+F4EoEYiY6FoqNdFY7X5NOsoVcJvHBIGIiO5LXSFJRGOXMTcmcLiDxCsCYRNd0/CQ6s2n6MsYH6/QuHLFEwLhEz3Z+9VoX/LseILClSWeEQiL6N7suOd4J7vyqscz0K5sOYuAbaJrqdQjw5tly7nEQzkruzt6AiFgi+jaAEpwEklTWyuBsHFFjSMELImupZFEOh+gcUscye2KkmAIWBM9ldFkeL8h6hYXgVyLQEiia324i3OE+LBlrpXbnXiCIWBKdF/WW0n2nf0f20ow0F1xY4+AIdG1PpT2+ZZXi/2U3BFdBJxHIAvRNfX150/QaOn8cG6PLgI5g0BWoicj3+D2fSM7Zybljuoi4DQCmYiupdKNDEw+GeH00G5/LgKxQ+A80bVUmpLhzcVSMHbDuyO5CMQGAS/Rtf6U55Q3sNnZj2jFRgZ3FBcBSwQ83pTOG7z5EQMy11i2cyu4COQqBDxaMq8BvXPVrN3JugiEiYClC0CY/bnVXQRii0DHWkEJbYKG95ABnmSX6LFdFnc0pxEISXTPWTxaN+Ztn+US3Wng3f5ii4A50U/hydOZeT94P8rkEj22y+KO5jQCRkT3eI6T5GnPHH/ea5foTgPv9hdbBLIS/RD58t7C7C0rAyfiEj22y+KO5jQCmYm+j3yeG5m97ZvgYVyiOw28219sEfATfTd5klozZ2vAR6b8U3GJHttlcUdzGgFF9J8gbyvmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(Ge,de,N){"use strict";N.d(de,"a",function(){return o}),N.d(de,"b",function(){return R});var Z=N("Ty5D"),z=N("dI71"),I=N("q1tI"),G=N.n(I),j=N("YS25"),w=N("17x9"),W=N.n(w),F=N("wx14"),O=N("zLVn"),b=N("9R94"),c=function(h){Object(z.a)(s,h);function s(){for(var D,T=arguments.length,C=new Array(T),M=0;M=0||T.relatedTarget.className.indexOf("".concat(U,"-next"))>=0))return;h.setState({goInputText:""}),k(h.getValidValue())},h.go=function(T){var C=h.state.goInputText;if(C==="")return;(T.keyCode===v.ENTER||T.type==="click")&&(h.setState({goInputText:""}),h.props.quickGo(h.getValidValue()))},h}return Object(j.a)(g,[{key:"getValidValue",value:function(){var s=this.state,l=s.goInputText,D=s.current;return!l||isNaN(l)?D:Number(l)}},{key:"getPageSizeOptions",value:function(){var s=this.props,l=s.pageSize,D=s.pageSizeOptions;return D.some(function(T){return T.toString()===l.toString()})?D:D.concat([l.toString()]).sort(function(T,C){var M=isNaN(Number(T))?0:Number(T),k=isNaN(Number(C))?0:Number(C);return M-k})}},{key:"render",value:function(){var s=this,l=this.props,D=l.pageSize,T=l.locale,C=l.rootPrefixCls,M=l.changeSize,k=l.quickGo,U=l.goButton,P=l.selectComponentClass,K=l.buildOptionText,H=l.selectPrefixCls,$=l.disabled,le=this.state.goInputText,pe="".concat(C,"-options"),xe=P,ze=null,Ne=null,Ie=null;if(!M&&!k)return null;var Be=this.getPageSizeOptions();if(M&&xe){var ke=Be.map(function(ge,fe){return O.a.createElement(xe.Option,{key:fe,value:ge.toString()},(K||s.buildOptionText)(ge))});ze=O.a.createElement(xe,{disabled:$,prefixCls:H,showSearch:!1,className:"".concat(pe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(D||Be[0]).toString(),onChange:this.changeSize,getPopupContainer:function(fe){return fe.parentNode}},ke)}return k&&(U&&(Ie=typeof U=="boolean"?O.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:$,className:"".concat(pe,"-quick-jumper-button")},T.jump_to_confirm):O.a.createElement("span",{onClick:this.go,onKeyUp:this.go},U)),Ne=O.a.createElement("div",{className:"".concat(pe,"-quick-jumper")},T.jump_to,O.a.createElement("input",{disabled:$,type:"text",value:le,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),T.page,Ie)),O.a.createElement("li",{className:"".concat(pe)},ze,Ne)}}]),g}(O.a.Component);f.defaultProps={pageSizeOptions:["10","20","50","100"]};var m=f,a=N("N2Kk");function n(){}function o(_){return typeof _=="number"&&isFinite(_)&&Math.floor(_)===_}function u(_,R,g){return g}function A(_,R,g){var h=typeof _=="undefined"?R.pageSize:_;return Math.floor((g.total-1)/h)+1}var x=function(_){Object(w.a)(g,_);var R=Object(W.a)(g);function g(h){var s;Object(G.a)(this,g),s=R.call(this,h),s.getJumpPrevPage=function(){return Math.max(1,s.state.current-(s.props.showLessItems?3:5))},s.getJumpNextPage=function(){return Math.min(A(void 0,s.state,s.props),s.state.current+(s.props.showLessItems?3:5))},s.getItemIcon=function(M,k){var U=s.props.prefixCls,P=M||O.a.createElement("button",{type:"button","aria-label":k,className:"".concat(U,"-item-link")});return typeof M=="function"&&(P=O.a.createElement(M,Object(I.a)({},s.props))),P},s.savePaginationNode=function(M){s.paginationNode=M},s.isValid=function(M){return o(M)&&M!==s.state.current},s.shouldDisplayQuickJumper=function(){var M=s.props,k=M.showQuickJumper,U=M.pageSize,P=M.total;return P<=U?!1:k},s.handleKeyDown=function(M){(M.keyCode===v.ARROW_UP||M.keyCode===v.ARROW_DOWN)&&M.preventDefault()},s.handleKeyUp=function(M){var k=s.getValidValue(M),U=s.state.currentInputValue;k!==U&&s.setState({currentInputValue:k}),M.keyCode===v.ENTER?s.handleChange(k):M.keyCode===v.ARROW_UP?s.handleChange(k-1):M.keyCode===v.ARROW_DOWN&&s.handleChange(k+1)},s.changePageSize=function(M){var k=s.state.current,U=A(M,s.state,s.props);k=k>U?U:k,U===0&&(k=s.state.current),typeof M=="number"&&("pageSize"in s.props||s.setState({pageSize:M}),"current"in s.props||s.setState({current:k,currentInputValue:k})),s.props.onShowSizeChange(k,M),"onChange"in s.props&&s.props.onChange&&s.props.onChange(k,M)},s.handleChange=function(M){var k=s.props.disabled,U=M;if(s.isValid(U)&&!k){var P=A(void 0,s.state,s.props);U>P?U=P:U<1&&(U=1),"current"in s.props||s.setState({current:U,currentInputValue:U});var K=s.state.pageSize;return s.props.onChange(U,K),U}return s.state.current},s.prev=function(){s.hasPrev()&&s.handleChange(s.state.current-1)},s.next=function(){s.hasNext()&&s.handleChange(s.state.current+1)},s.jumpPrev=function(){s.handleChange(s.getJumpPrevPage())},s.jumpNext=function(){s.handleChange(s.getJumpNextPage())},s.hasPrev=function(){return s.state.current>1},s.hasNext=function(){return s.state.current2?U-2:0),K=2;K=D?C=D:C=Number(l),C}},{key:"getShowSizeChanger",value:function(){var s=this.props,l=s.showSizeChanger,D=s.total,T=s.totalBoundaryShowSizeChanger;return typeof l!="undefined"?l:D>T}},{key:"renderPrev",value:function(s){var l=this.props,D=l.prevIcon,T=l.itemRender,C=T(s,"prev",this.getItemIcon(D,"prev page")),M=!this.hasPrev();return Object(F.isValidElement)(C)?Object(F.cloneElement)(C,{disabled:M}):C}},{key:"renderNext",value:function(s){var l=this.props,D=l.nextIcon,T=l.itemRender,C=T(s,"next",this.getItemIcon(D,"next page")),M=!this.hasNext();return Object(F.isValidElement)(C)?Object(F.cloneElement)(C,{disabled:M}):C}},{key:"render",value:function(){var s=this,l=this.props,D=l.prefixCls,T=l.className,C=l.style,M=l.disabled,k=l.hideOnSinglePage,U=l.total,P=l.locale,K=l.showQuickJumper,H=l.showLessItems,$=l.showTitle,le=l.showTotal,pe=l.simple,xe=l.itemRender,ze=l.showPrevNextJumpers,Ne=l.jumpPrevIcon,Ie=l.jumpNextIcon,Be=l.selectComponentClass,ke=l.selectPrefixCls,ge=l.pageSizeOptions,fe=this.state,te=fe.current,be=fe.pageSize,se=fe.currentInputValue;if(k===!0&&U<=be)return null;var Oe=A(void 0,this.state,this.props),ie=[],oe=null,Ae=null,_e=null,je=null,He=null,Ye=K&&K.goButton,qe=H?1:2,bt=te-1>0?te-1:0,yt=te+1=qe*2&&te!==1+2&&(ie[0]=Object(F.cloneElement)(ie[0],{className:"".concat(D,"-item-after-jump-prev")}),ie.unshift(oe)),Oe-te>=qe*2&&te!==Oe-2&&(ie[ie.length-1]=Object(F.cloneElement)(ie[ie.length-1],{className:"".concat(D,"-item-before-jump-next")}),ie.push(Ae)),Ze!==1&&ie.unshift(_e),lt!==Oe&&ie.push(je)}var Te=null;le&&(Te=O.a.createElement("li",{className:"".concat(D,"-total-text")},le(U,[U===0?0:(te-1)*be+1,te*be>U?U:te*be])));var me=!this.hasPrev()||!Oe,ve=!this.hasNext()||!Oe;return O.a.createElement("ul",Object(Z.a)({className:c()(D,T,Object(z.a)({},"".concat(D,"-disabled"),M)),style:C,unselectable:"unselectable",ref:this.savePaginationNode},ct),Te,O.a.createElement("li",{title:$?P.prev_page:null,onClick:this.prev,tabIndex:me?null:0,onKeyPress:this.runIfEnterPrev,className:c()("".concat(D,"-prev"),Object(z.a)({},"".concat(D,"-disabled"),me)),"aria-disabled":me},this.renderPrev(bt)),ie,O.a.createElement("li",{title:$?P.next_page:null,onClick:this.next,tabIndex:ve?null:0,onKeyPress:this.runIfEnterNext,className:c()("".concat(D,"-next"),Object(z.a)({},"".concat(D,"-disabled"),ve)),"aria-disabled":ve},this.renderNext(yt)),O.a.createElement(m,{disabled:M,locale:P,rootPrefixCls:D,selectComponentClass:Be,selectPrefixCls:ke,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:te,pageSize:be,pageSizeOptions:ge,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ye}))}}],[{key:"getDerivedStateFromProps",value:function(s,l){var D={};if("current"in s&&(D.current=s.current,s.current!==l.current&&(D.currentInputValue=D.current)),"pageSize"in s&&s.pageSize!==l.pageSize){var T=l.current,C=A(s.pageSize,l,s);T=T>C?C:T,"current"in s||(D.current=T,D.currentInputValue=T),D.pageSize=s.pageSize}return D}}]),g}(O.a.Component);x.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:n,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:n,locale:a.a,style:{},itemRender:u,totalBoundaryShowSizeChanger:50};var y=x},"6RRn":function(Ge,de,N){"use strict";var Z=N("wCXF"),z=N("n6Qo");N.d(de,"b",function(){return z.a});var I=N("IBYe"),G=N("6eGT"),j=N("hW8S");N.d(de,"a",function(){return j.a}),de.c=Z.b},"6eGT":function(Ge,de,N){"use strict";function Z(z){return null}de.a=Z},"746U":function(Ge,de,N){"use strict";N.d(de,"d",function(){return z}),N.d(de,"j",function(){return I}),N.d(de,"i",function(){return G}),N.d(de,"h",function(){return j}),N.d(de,"e",function(){return w}),N.d(de,"k",function(){return W}),N.d(de,"l",function(){return F}),N.d(de,"a",function(){return O}),N.d(de,"f",function(){return c}),N.d(de,"g",function(){return p}),N.d(de,"m",function(){return S}),N.d(de,"c",function(){return m}),N.d(de,"b",function(){return a}),N.d(de,"n",function(){return n}),N.d(de,"o",function(){return o});var Z={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function z(u){return Array.isArray?Array.isArray(u):!!(u&&typeof u.length===Z.number&&u.constructor===Array)}function I(u){return typeof u===Z.string||u instanceof String}function G(u){return typeof u===Z.object&&u!==null&&!Array.isArray(u)&&!(u instanceof RegExp)&&!(u instanceof Date)}function j(u){return(typeof u===Z.number||u instanceof Number)&&!isNaN(u)}function w(u){return u===!0||u===!1}function W(u){return typeof u===Z.undefined}function F(u){return W(u)||u===null}function O(u,A){if(!u)throw new Error(A?"Unexpected type, expected '"+A+"'":"Unexpected type")}var b=Object.prototype.hasOwnProperty;function c(u){if(!G(u))return!1;for(var A in u)if(b.call(u,A))return!1;return!0}function p(u){return typeof u===Z.function}function S(u,A){for(var x=Math.min(u.length,A.length),y=0;y1&&arguments[1]!==void 0?arguments[1]:0,f=(W[S[v+0]]+W[S[v+1]]+W[S[v+2]]+W[S[v+3]]+"-"+W[S[v+4]]+W[S[v+5]]+"-"+W[S[v+6]]+W[S[v+7]]+"-"+W[S[v+8]]+W[S[v+9]]+"-"+W[S[v+10]]+W[S[v+11]]+W[S[v+12]]+W[S[v+13]]+W[S[v+14]]+W[S[v+15]]).toLowerCase();if(!w(f))throw TypeError("Stringified UUID is invalid");return f}var b=O;function c(S,v,f){S=S||{};var m=S.random||(S.rng||I)();if(m[6]=m[6]&15|64,m[8]=m[8]&63|128,v){f=f||0;for(var a=0;a<16;++a)v[f+a]=m[a];return v}return b(m)}var p=de.a=c},"7ZXX":function(Ge,de,N){Ge.exports=N.p+"static/err.6e7c5817.png"},"7ahc":function(Ge,de,N){"use strict";N.d(de,"a",function(){return A});var Z=N("k1fw"),z=N("0Owb"),I=N("+L6B"),G=N("2/Rp"),j=N("y8nQ"),w=N("Vl3Y"),W=N("tJVT"),F=N("OaEy"),O=N("2fM7"),b=N("q1tI"),c=N.n(b),p=N("VrN/"),S=N.n(p),v=N("p77/"),f=N.n(v),m=N("c5Ni"),a=N.n(m),n=O.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},u={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};de.b=function(x){var y=x.callback,_=x.onCancel,R=Object(b.useState)("python"),g=Object(W.a)(R,2),h=g[0],s=g[1];function l(T){s(u[T][1])}function D(T){y(T)}return c.a.createElement(w.a,Object(z.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:D}),c.a.createElement(w.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},c.a.createElement(O.a,{onChange:l},Object.keys(u).map(function(T){return c.a.createElement(n,{key:T,value:T},u[T][0])}))),c.a.createElement(w.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},c.a.createElement(A,{mode:h})),c.a.createElement("div",{className:"flex-container flex-end"},c.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),c.a.createElement(G.a,{type:"ghost",onClick:_},"\u53D6\u6D88")))};function A(x){var y=x.value,_=x.onChange,R=x.mode,g=x.options,h=g===void 0?{}:g,s=Object(b.useRef)(),l=Object(b.useState)(),D=Object(W.a)(l,2),T=D[0],C=D[1];return Object(b.useEffect)(function(){if(T){function M(k){var U=k.getValue();_&&_(U)}return T.on("change",M),function(){T.off("change",M)}}},[T,_]),Object(b.useEffect)(function(){T&&T.setOption("mode",R)},[T,R]),Object(b.useEffect)(function(){T&&((y!==T.getValue()||y==="")&&setTimeout(function(){T.setValue(y||" ")},300))},[T,y]),Object(b.useEffect)(function(){if(s.current&&!T){var M=S.a.fromTextArea(s.current,Object(Z.a)({mode:R,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},h));C(M)}},[s.current,T]),c.a.createElement("div",{className:"my-codemirror-container"},c.a.createElement("textarea",{ref:s}))}},"7ixt":function(Ge,de,N){"use strict";N.d(de,"a",function(){return I});var Z={adjustX:1,adjustY:1},z=[0,0],I={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:z},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:z},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:z},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:z},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:z},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:z},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:z},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:z},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:z},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:z},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:z},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:z}},G=I},"7v3h":function(Ge,de,N){Ge.exports=N.p+"static/empty2.dd73f390.png"},"8/bI":function(Ge,de,N){Ge.exports=N.p+"static/empty.8918e228.png"},"815F":function(Ge,de,N){"use strict";N.d(de,"e",function(){return W}),N.d(de,"c",function(){return O}),N.d(de,"d",function(){return b}),N.d(de,"a",function(){return p}),N.d(de,"f",function(){return S}),N.d(de,"b",function(){return v});var Z=N("KQm4"),z=N("VTBJ"),I=N("Ff2n"),G=N("Zm9Q"),j=N("Kwbf"),w=N("OZM5");function W(f,m){return f!=null?f:m}function F(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=new Map;function a(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(n||[]).forEach(function(u){var A=u.key,x=u.children;Object(j.a)(A!=null,"Tree node must have a certain key: [".concat(o).concat(A,"]"));var y=String(A);Object(j.a)(!m.has(y)||A===null||A===void 0,"Same 'key' exist in the Tree: ".concat(y)),m.set(y,!0),a(x,"".concat(o).concat(y," > "))})}a(f)}function O(f){function m(a){var n=Object(G.a)(a);return n.map(function(o){if(!Object(w.i)(o))return Object(j.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var u=o.key,A=o.props,x=A.children,y=Object(I.a)(A,["children"]),_=Object(z.a)({key:u},y),R=m(x);return R.length&&(_.children=R),_}).filter(function(o){return o})}return m(f)}function b(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=new Set(m===!0?[]:m),n=[];function o(u){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return u.map(function(x,y){var _=Object(w.h)(A?A.pos:"0",y),R=W(x.key,_),g=Object(z.a)(Object(z.a)({},x),{},{parent:A,pos:_,children:null,data:x,isStart:[].concat(Object(Z.a)(A?A.isStart:[]),[y===0]),isEnd:[].concat(Object(Z.a)(A?A.isEnd:[]),[y===u.length-1])});return n.push(g),m===!0||a.has(R)?g.children=o(x.children||[],g):g.children=[],g})}return o(f),n}function c(f,m,a){var n;a?typeof a=="string"?n=function(A){return A[a]}:typeof a=="function"&&(n=function(A){return a(A)}):n=function(A,x){return W(A.key,x)};function o(u,A,x){var y=u?u.children:f,_=u?Object(w.h)(x.pos,A):"0";if(u){var R=n(u,_),g={node:u,index:A,pos:_,key:R,parentPos:x.node?x.pos:null,level:x.level+1};m(g)}y&&y.forEach(function(h,s){o(h,s,{node:u,pos:_,level:x?x.level+1:-1})})}o(null)}function p(f){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=m.initWrapper,n=m.processEntity,o=m.onProcessFinished,u=arguments.length>2?arguments[2]:void 0,A={},x={},y={posEntities:A,keyEntities:x};return a&&(y=a(y)||y),c(f,function(_){var R=_.node,g=_.index,h=_.pos,s=_.key,l=_.parentPos,D=_.level,T={node:R,index:g,key:s,pos:h,level:D},C=W(s,h);A[h]=T,x[C]=T,T.parent=A[l],T.parent&&(T.parent.children=T.parent.children||[],T.parent.children.push(T)),n&&n(T,y)},u),o&&o(y),y}function S(f,m){var a=m.expandedKeys,n=m.selectedKeys,o=m.loadedKeys,u=m.loadingKeys,A=m.checkedKeys,x=m.halfCheckedKeys,y=m.dragOverNodeKey,_=m.dropPosition,R=m.keyEntities,g=R[f],h={eventKey:f,expanded:a.indexOf(f)!==-1,selected:n.indexOf(f)!==-1,loaded:o.indexOf(f)!==-1,loading:u.indexOf(f)!==-1,checked:A.indexOf(f)!==-1,halfChecked:x.indexOf(f)!==-1,pos:String(g?g.pos:""),dragOver:y===f&&_===0,dragOverGapTop:y===f&&_===-1,dragOverGapBottom:y===f&&_===1};return h}function v(f){var m=f.data,a=f.expanded,n=f.selected,o=f.checked,u=f.loaded,A=f.loading,x=f.halfChecked,y=f.dragOver,_=f.dragOverGapTop,R=f.dragOverGapBottom,g=f.pos,h=f.active,s=Object(z.a)(Object(z.a)({},m),{},{expanded:a,selected:n,checked:o,loaded:u,loading:A,halfChecked:x,dragOver:y,dragOverGapTop:_,dragOverGapBottom:R,pos:g,active:h});return"props"in s||Object.defineProperty(s,"props",{get:function(){return Object(j.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),f}}),s}},"8EBN":function(Ge,de,N){(function(Z){Z(N("VrN/"))})(function(Z){"use strict";Z.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var z=0;z-1&&G.substring(W+1,G.length);if(F)return Z.findModeByExtension(F)},Z.findModeByName=function(G){G=G.toLowerCase();for(var j=0;j0&&S[S.length-1])&&(a[0]===6||a[0]===2)){b=0;continue}if(a[0]===3&&(!S||a[1]>S[0]&&a[1]=V.length?J.slice(V.length):J}).join(` `)}var a=[],n=["